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.

Bug 70305 - I18N - OutOfMemoryError, add operation to websvc in Chinese locale
Summary: I18N - OutOfMemoryError, add operation to websvc in Chinese locale
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Adamek
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2005-12-13 08:54 UTC by Marek Grummich
Modified: 2006-01-24 13:28 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
org-netbeans-modules-websvc-core_zh_CN.jar (10.55 KB, application/octet-stream)
2005-12-13 08:55 UTC, Marek Grummich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Grummich 2005-12-13 08:54:30 UTC
Build 200512111900 + pseudo localization

java.lang.OutOfMemoryError:Java heap space is thrown when user tries to add
operation to websvc in Chinese locale

Please, fix it per Ken Frank's request:
   it is a bug in that in looking at src code, think the word
operation should not be translated - I was using wrong nb today
when i tried it and thats why it still seemed to fail

attached is corrected jar - please try
and please file p2 bug that bundle file needs to be marked with
#NOI18N comment or fixed so that word operation can be translated.
TXT_DefaultOperationName=operation
from one of the bundle files in the attached jar.

Also, when add operation window does come up, besides resize issues,
it does not allow mbyte yet i thought method name could have mbyte -
but maybe that is some spec restriction, so that not allowing
translation of "operation" would make sense.
Comment 1 Marek Grummich 2005-12-13 08:55:23 UTC
Created attachment 27776 [details]
org-netbeans-modules-websvc-core_zh_CN.jar
Comment 2 Milan Kuchtiak 2005-12-14 14:49:02 UTC
This is the problematic part in
org.netbeans.modules.websvc.core.webservices.action.AddOperationAction class:

            JMIUtils.beginJmiTransaction();
            try {
                m = JMIUtils.createMethod(javaClass);
                m.setModifiers(Modifier.PUBLIC);
                m.setName(NbBundle.getMessage(AddOperationAction.class,
"TXT_DefaultOperationName")); //NOI18N
                m.setType(JMIUtils.resolveType("java.lang.String")); //NOI18N

            }

The name for the method is taken from the bundle.
I managed to simulate the issue by changing the bundle string in a following way : 
TXT_DefaultOperationName=ope ration 
(in
websvc/core/src/org/netbeans/modules/websvc/core/webservices/action/Bundle.properties)
Then I got OutOfMemoryError.
This is the StackTrace :

"Inactive RequestProcessor thread [Was:Folder recognizer/org.openide.loaders.Fol
                                                                     
derList$ListTask]" daemon prio=1 tid=0x085ef520 nid=0x211 in Object.wait() [0xaa
                                                                     
de1000..0xaade2030]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x83fa4348> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
                                                                      :879)
        - locked <0x83fa4348> (a java.lang.Object)

"AWT-EventQueue-1" prio=1 tid=0x083f74b8 nid=0x207 runnable [0xb10ea000..0xb10ea
                                                                      f30]
        at java.text.Bidi.requiresBidi(Bidi.java:490)
        at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument
                                                                      .java:743)
        at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:
                                                                      711)
        at javax.swing.text.PlainDocument.insertString(PlainDocument.java:114)
        at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:673)
        at javax.swing.text.JTextComponent.setText(JTextComponent.java:1441)
        at org.netbeans.modules.j2ee.common.ui.nodes.MethodCustomizer.handleChan
                                                                     
ge(MethodCustomizer.java:693)
        at org.netbeans.modules.j2ee.common.ui.nodes.MethodCustomizer.generateUn
                                                                     
iqueName(MethodCustomizer.java:649)
        at org.netbeans.modules.j2ee.common.ui.nodes.MethodCustomizer.enablePref
                                                                     
ixForName(MethodCustomizer.java:579)
        at org.netbeans.modules.j2ee.common.ui.nodes.MethodCollectorFactory.oper
                                                                     
ationCollector(MethodCollectorFactory.java:94)
        at org.netbeans.modules.websvc.core.webservices.action.AddOperationActio
                                                                     
n.performAction(AddOperationAction.java:127)

The easy fix is to use the "hard" string for the default operation name 
<
m.setName(NbBundle.getMessage(AddOperationAction.class,"TXT_DefaultOperationName"));

> m.setName("operation");

However I am reasigning the issue to Martin. He may find some other potential
issues in j2ee/utilities.
Comment 3 Martin Adamek 2005-12-14 15:33:22 UTC
Fixed. Endless loop in method signature checking is fixed. I also added comment
to bundle, that specific translation must be only valid Java identifier. 
http://j2ee.netbeans.org/source/browse/j2ee/utilities/src/org/netbeans/modules/j2ee/common/ui/nodes/MethodCustomizer.java?r1=1.32&r2=1.33
http://websvc.netbeans.org/source/browse/websvc/core/src/org/netbeans/modules/websvc/core/webservices/action/Bundle.properties?r1=1.6&r2=1.7
Comment 4 Martin Adamek 2005-12-14 15:37:21 UTC
Milan, please review, thanks.
Comment 5 Ken Frank 2005-12-14 16:12:29 UTC
I'd suggest just marking #NOI18N comment for the value "operation" in the bundle.
I don't think there is any need for l10n to change this, and it would
avoid any problems as to what a valid name might be.

ken.frank@sun.com
Comment 6 Marek Grummich 2005-12-15 12:22:22 UTC
verified, integrate it to 5.0 branch also, please.
Comment 7 Milan Kuchtiak 2005-12-15 17:22:22 UTC
The fix looks fine.
Mark only the bundle value with #NOI18N as Ken suggested.
Comment 8 Martin Adamek 2005-12-16 09:38:28 UTC
Added #NOI18N comment in bundle in trunk.
/cvs/websvc/core/src/org/netbeans/modules/websvc/core/webservices/action/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.8; previous revision: 1.7
Comment 9 Martin Adamek 2005-12-16 09:45:46 UTC
Fixed in release50 branch.
/cvs/j2ee/utilities/src/org/netbeans/modules/j2ee/common/ui/nodes/MethodCustomizer.java,v
 <--  MethodCustomizer.java; new revision: 1.32.4.1; previous revision: 1.32
/cvs/websvc/core/src/org/netbeans/modules/websvc/core/webservices/action/Bundle.properties,v
 <--  Bundle.properties; new revision: 1.6.32.1; previous revision: 1.6
Comment 10 Marek Grummich 2005-12-20 14:53:50 UTC
verified 200512192030