This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
There is a place in OpenIDE which references classes from different modules - Utilities.translate. It translates package names of old classes into new onces, so deserialization of old settings continues to work even after repackaging. It might be nice to enhance the Utility to easily allow modules to add their classes there. For example each module could provide a file META-INF/translate.txt and this utility method would read them and convert into new package names. Another task is to rewrite the method to use regular expressions (probably from JDK1.4) so the checking is linear to the length of the package name and does not slow down with the number of packages that need to be translated.
It makes sense, it was also our original intention, but we are too conservative regarding OpenIDE :-). Going to implement a part allowing modules to plugin their translation tables...
Implemented by looking for all "META-INF/OpenIDE/translate.txt" resources using IDE system class loader. It may be a little bit slower that previous hard wired implemetation. New OpenIDE specification version 1.43. This enhancement allows old modules to be used with new OpenIDE without senseless translation of their class names.
org.openide.util package should not depend on other packages. Please rewrite the code not to listen on ModuleItem Try to build openide$ ant lib-util and check whether classes from that library (that were loadable - not all them could be made) are still loadable.
Also consider renaming META-INF/OpenIDE/translate.txt to something less IDE dependent like META-INF/classname.translate please.
Leaving as an enhancement for Module API. It should load needed metadata (e.g. from module manifests) and communitate it to Utilities (while leaving Utilities independent on module API). Currently it sounds like unsolveable task without such support. I also increased enhancement priority as it affect back compatability of OpenIDE (while using an old module version that was repackaged with new OpenIDE). To Yarda's naming suggestion "package.translation" i.e. giving stress to package.
Target milestone -> 3.3.1.
I'll investigate it.
Hi Jesse, it seems I have a solution to this issue and also to the ability to suppress missing SUID. Implemented in branch serialization_17164 and here are the diffs: http://www.netbeans.org/source/browse/openide/src/org/openide/util/Utilities.java.diff?r1=1.80&r2=1.80.2.1 http://www.netbeans.org/source/browse/openide/src/org/openide/util/io/NbObjectInputStream.java.diff?r1=1.22&r2=1.22.6.1 http://www.netbeans.org/source/browse/openide/src/org/openide/util/packages.txt.diff?r1=1.14&r2=1.14.2.1 A review would be nice. Before I merge it I would like to distribute the content of packages.txt to different modules (mostly XML ;-). Is it ok to create a directory META-INF under xml/src and put the "translate.packages" file there?
For xml modules it is already in place under xml/{submodule}/compat/src/META-INF/OpenIDE/translate.txt. Yarda, do you really dislike the idea of putting it into META-INF subdirectory (e.g. OpenIDE)? It creates a "namespace".
Looks reasonable to me. Some more comments in Utilities.java explaining what it is doing might be nice. Also a comment in NbObjectInputStream.java explaining the distinction between name==newN (normal behavior) and name!=newN&&name.equals(newN) (same name, broken svuid) would be useful, as this is subtle. I think I saw that you were adding some unit tests for this too, which is good.
Thanks Jesse, I'll separate packages.txt and improve the documentation. Ok Petr, namespace would be good. Can I use META-INF/netbeans/translate.names?
Cool namespace.
XML module updated to this new schema.
Merged into main trunk. Now waiting for module owners to take their part of packages.txt and put it into their modules. After that the rest of packages.txt should be deleted and moved to core-ide as soon as Hrebejk finishes it.
Created attachment 4749 [details] A patch to move packages.txt from openide to core/ide/src
packages.txt moved to core/ide/src/META-INF/netbeans/translate.names