harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasily Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3281) [netbeans] Netbeans addresses RI-specific private fields
Date Sun, 25 Mar 2007 22:05:32 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483981

Vasily Zakharov commented on HARMONY-3281:

There's another similar problem in org.netbeans.TopSecurityManager class.

The code in question is contained in method makeSwingUseSpecialClipboard() and is generally
equivalent to this:

Class appContextClass = Class.forName("sun.awt.AppContext");
Method getAppContext = appContextClass.getMethod("getAppContext", null);
Object appContext = getAppContext.invoke(null, null);
Class c = appContext.getClass();
Class actionClass = TransferHandler.getCopyAction().getClass();
Field sandboxKeyField = actionClass.getDeclaredField ("SandboxClipboardKey");
Object value = sandboxKeyField.get(null);

If HARMONY-3479 and HARMONY-3280 are fixed, it also produces a NoSuchFieldException stack
trace in Netbeans log. This doesn't cause a serious error, as the code is properly wrapped
and all exceptions are caught. This situation is not a bug in Harmony.

java.lang.NoSuchFieldException: SandboxClipboardKey
	at java.lang.Class.getDeclaredFieldImpl(Native Method)
	at java.lang.Class.getDeclaredField(Class.java:483)
	at org.netbeans.TopSecurityManager.makeSwingUseSpecialClipboard(TopSecurityManager.java:50)
	at org.netbeans.core.NonGui.run(NonGui.java:132)
	at org.netbeans.core.startup.Main.start(Main.java:41)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:96)
	at java.lang.Thread.run(Thread.java:872)

> [netbeans] Netbeans addresses RI-specific private fields
> --------------------------------------------------------
>                 Key: HARMONY-3281
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3281
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports
>            Reporter: Vasily Zakharov
>            Priority: Trivial
> Netbeans class org.netbeans.modules.editor.EditorModule uses reflection to address RI-specific
private fields kitRegistryKey and kitTypeRegistryKey in class javax.swing.JEditorPane.
> The mentioned code is generally equivalent to this:
> try {
>     Field field = JEditorPane.class.getDeclaredField("kitRegistryKey");
>     field.setAccessible(true);
>     Object key = field.get(JEditorPane.class);
> } catch (Throwable t) {
>     t.printStackTrace();
> }
> The code is properly wrapped and exceptions are caught, and no serious problems occur,
but nasty NoSuchFieldException stack traces appear in Netbeans log
> file, so one may think this is a bug in Harmony. In fact, it is not.
> Here's an example of such stack trace from the Netbeans log file:
> java.lang.NoSuchFieldException: kitRegistryKey
> 	at java.lang.Class.getDeclaredField(Class.java:440)
> 	at org.netbeans.modules.editor.EditorModule.restored(EditorModule.java:134)
> 	at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:365)
> 	at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:280)
> 	at org.netbeans.ModuleManager.enable(ModuleManager.java:903)
> 	at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:383)
> 	at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:389)
> 	at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:316)
> 	at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:249)
> 	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:211)
> 	at org.netbeans.core.startup.Main.start(Main.java:377)
> 	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java)
> 	at java.lang.Thread.run(Thread.java:660)
> Here's the discussion of this issue in the dev-list: http://thread.gmane.org/gmane.comp.java.harmony.devel/24441

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message