I made a prototype, where java.desktop is split into 16+1
modules. java.swing is the largest module, its size is 6.9 MB,
less than the one third of original java.desktop's size (23.3 MB).
The prototype compiles without errors, but there are many runtime
errors. If there is intention to include this into Java in the
future, then I will continue the work.
Current list of modules (see dependency graphs at ):
Small, but breaking API incompatibilites:
- AWT accessibility interfaces (AccessibleText and the AccessibleEditableText) referenced the Swing AttributeSet class
- AWT InputMethodContext had a method where the return type was Swing JFrame
I copied both methods, and modified them to use non-Swing parameter/return types, and made them default methods. New methods' implementations are calling the old methods' implementations (and the opposite) to ensure backward compatibility.
Other necessary API changes that aren't big problems I think, because their APIs are new in Java 9:
- The AWT AccessibleContext is annotated with @SwingContainer. So I moved the annotation to the java.beans package.
- The AWT Desktop.setMenuBar's parameter type is Swing JMenuBar. I changed the API and the only implementation (Mac OS X), but I couldn't test it, because I currently don't have access to a Mac.
The accessibility and input method methods mentioned above must be removed when the java.desktop modularization is introduced possibly in Java 10 (except if some new mechanisms are introduced in the future, which help maintaining compatibility). These methods must be deprecated one version earlier (Java 9?). Therefore I made a separate patch for Java 9 which includes the deprecations and the other changes to the code which were introduced only in Java 9 (Desktop, SwingContainer). 
Regarding the actual split, I couldn't make a readable webrev about the prototype, because the webrev includes a huge number of files that are moved, but not changed. Also after the 1700th file it stops.
I uploaded the source, .hg directory, and Linux x64 build in a large .tar.gz . Consider it as a first attempt, there are many modifications which I would do differently now, for example the X11 TextArea reimplementation is unnecessary; and the patch isn't separated into small commits. If there is interest in this split, I will fix these problems and the runtime errors in it.
2017-01-30 17:57 keltezéssel, Alan Bateman írta:
On 30/01/2017 16:25, Hontvári Attila wrote:
|Free forum by Nabble||Edit this page|