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 92610 - Unable rename java file because of SIOOBE & NPE
Summary: Unable rename java file because of SIOOBE & NPE
Status: CLOSED DUPLICATE of bug 90196
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords: T9Y
Depends on:
Blocks: 110278
  Show dependency tree
 
Reported: 2007-01-16 13:23 UTC by Marian Mirilovic
Modified: 2009-01-22 15:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exceptions (21.05 KB, text/plain)
2007-01-16 13:23 UTC, Marian Mirilovic
Details
JEdit project (1.81 MB, application/octet-stream)
2007-01-16 13:25 UTC, Marian Mirilovic
Details
StatusBar.dump (24.27 KB, text/plain)
2007-01-16 13:26 UTC, Marian Mirilovic
Details
NPE from Rename (3.42 KB, application/octet-stream)
2007-07-17 15:39 UTC, Pavel Flaska
Details
Exceptions (125.17 KB, text/plain)
2007-07-18 08:10 UTC, Jan Becicka
Details
Simple testing project. (9.74 KB, application/octet-stream)
2007-08-17 17:27 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2007-01-16 13:23:03 UTC
This is 100% reproducible by one of our performance test.

Steps test does :
- open jEdit project (attached)
- invoke Refactor | Rename ... on jEdit.java file
-> Rename dialog rises
- type jEdit1
- push Refactor button
-> StringIndexOutOfBoundsException & NullPointerException rose (see attachment)
+ asked me to report issue against "java/core" - there is no such component in
IZ + ask to attach dump.log file
Comment 1 Marian Mirilovic 2007-01-16 13:23:32 UTC
Created attachment 37400 [details]
Exceptions
Comment 2 Marian Mirilovic 2007-01-16 13:25:27 UTC
Created attachment 37402 [details]
JEdit project
Comment 3 Marian Mirilovic 2007-01-16 13:26:17 UTC
Created attachment 37403 [details]
StatusBar.dump
Comment 4 Marian Mirilovic 2007-01-16 13:27:38 UTC
NetBeans IDE Dev (Build 200701151900)
1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
Linux version 2.6.12-10-686 running on i386
en_US (nb); UTF-8
Comment 5 Jan Becicka 2007-01-16 14:27:39 UTC
Who asked you to file bug against java/core?
Comment 6 Marian Mirilovic 2007-01-16 14:49:25 UTC
>Who asked you to file bug against java/core?
have you read attached exception ? There is a message :
"Please report a bug against java/source and attach dump file"
Comment 7 Jan Lahoda 2007-01-26 13:31:43 UTC
For the SIOOBE see also issue #93280. For the NPE, see issue #91706.
Comment 8 Pavel Flaska 2007-01-30 15:19:18 UTC
Known problem in generator. Adding Honza to Cc, he'll be interested in
Types.rank() NPE. 
Comment 9 Pavel Flaska 2007-02-01 16:53:36 UTC
Most of the problems are known in generator. It is:
- switch/case diffing,
- fields groups, i.e. int a, b;
- enum constants.
Comment 10 Pavel Flaska 2007-02-23 09:05:15 UTC
Rename in array init.

Checking in source/src/org/netbeans/modules/java/source/save/CasualDiff.java;
/cvs/java/source/src/org/netbeans/modules/java/source/save/CasualDiff.java,v 
<--  CasualDiff.java
new revision: 1.66; previous revision: 1.65
done
Comment 11 Pavel Flaska 2007-03-13 11:03:01 UTC
Partial fix.
Rename in case statement.

Checking in src/org/netbeans/modules/java/source/save/CasualDiff.java;
/cvs/java/source/src/org/netbeans/modules/java/source/save/CasualDiff.java,v 
<--  CasualDiff.java
new revision: 1.87; previous revision: 1.86
done
Comment 12 Pavel Flaska 2007-03-13 11:03:57 UTC
Added testcase.

Checking in test/unit/src/org/netbeans/api/java/source/gen/BodyStatementTest.java;
/cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/BodyStatementTest.java,v
 <--  BodyStatementTest.java
new revision: 1.23; previous revision: 1.22
done
Comment 13 Pavel Flaska 2007-07-17 15:37:23 UTC
I made several fixes and also variables separated by comma should be correctly rename. Unfortunately when I tried to
reproduce the issue, I've got an exception in RenameTransformer. Reassigning to refactoring and waiting for evalution of
the problem. Honzo, when exception will be fixed, reassign it back.

java.lang.NullPointerException
        at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.renameDeclIfMatch(RenameTransformer.java:117)
        at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.visitClass(RenameTransformer.java:97)
        at org.netbeans.modules.refactoring.java.plugins.RenameTransformer.visitClass(RenameTransformer.java:35)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:596)
Comment 14 Pavel Flaska 2007-07-17 15:39:18 UTC
Created attachment 45219 [details]
NPE from Rename
Comment 15 Jan Becicka 2007-07-18 07:41:52 UTC
Element el = workingCopy.getTrees().getElement(path);

el is null for path representing class ActionHandler in VFSBrowser.java:1369

I can surely handle null values, but this is bug in java/source imo.
Comment 16 Jan Becicka 2007-07-18 08:10:12 UTC
NPE fixed.

Checking in RenameTransformer.java;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/RenameTransformer.java,v  <-- 
RenameTransformer.java
new revision: 1.12; previous revision: 1.11
done

Now it throws some more exceptions. See attachment.
Comment 17 Jan Becicka 2007-07-18 08:10:49 UTC
Created attachment 45283 [details]
Exceptions
Comment 18 Pavel Flaska 2007-07-18 09:39:49 UTC
I didn't see exceptions in current trunk build, but still there are problems, added test for missing right paren.

IDE:-------------------------------------------------
IDE: [7/18/07 10:40 AM] Committing "BodyStatementTest.java" started
Checking in BodyStatementTest.java;
/cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/BodyStatementTest.java,v  <--  BodyStatementTest.java
new revision: 1.35; previous revision: 1.34
done
IDE: [7/18/07 10:40 AM] Committing "BodyStatementTest.java" finished
Comment 19 Pavel Flaska 2007-07-18 09:51:59 UTC
Checking in org/netbeans/modules/java/source/save/CasualDiff.java;
/cvs/java/source/src/org/netbeans/modules/java/source/save/CasualDiff.java,v  <--  CasualDiff.java
new revision: 1.168; previous revision: 1.167
done
Comment 20 Pavel Flaska 2007-07-18 15:51:40 UTC
Exceptions are no longer reproducible. Several usages are not renamed, in files

VFSBrowser.java
SyntaxHiliteOptionPane.java
and one more...

Seems they are connected with comment written by Honza B.
Reassigning to Honza Lahoda.
Comment 21 Jan Lahoda 2007-08-17 17:26:49 UTC
After the last wave of fixed in the infrastructure, the rename works correctly for me, except for
org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java, in which the occurrences of jEdit are not renamed. It seems that
the cause is:
-the file contains more than one class
-all references of jEdit in this file are in "secondary" classes, not in the primary one
-the ClassIndex.getReferences does not return org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java as a file that
contains  references to jEdit

I will attach a simple testing project - try to rename "Main" to "Main1" - the references in Auxiliary.java are not renamed.
Comment 22 Jan Lahoda 2007-08-17 17:27:46 UTC
Created attachment 46798 [details]
Simple testing project.
Comment 23 Tomas Zezula 2007-08-21 12:49:35 UTC
Caused by same root case as #90196, the Index does not handle correctly non public top level classes.

*** This issue has been marked as a duplicate of 90196 ***
Comment 24 Marian Mirilovic 2009-01-22 15:40:48 UTC
v/c