You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vasily Zakharov (JIRA)" <ji...@apache.org> on 2007/03/02 01:29:51 UTC

[jira] Created: (HARMONY-3281) [netbeans] Netbeans addresses RI-specific private fields

[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.


[jira] Closed: (HARMONY-3281) [netbeans] Netbeans addresses RI-specific private fields

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov closed HARMONY-3281.
------------------------------------

    Resolution: Won't Fix

I'm closing this issue as no actual problem exists. This issue is only created to note a known issue.


> [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.


[jira] Commented: (HARMONY-3281) [netbeans] Netbeans addresses RI-specific private fields

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ 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");
sandboxKeyField.setAccessible(true);
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.