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 61581

Summary: DebugException when safe deleting data type
Product: editor Reporter: Jiri Prox <jiriprox>
Component: RefactoringAssignee: _ bharathch <bharathch>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: exception

Description Jiri Prox 2005-08-01 09:04:09 UTC
NB 4.2 (200507272036)
JDK 1.5.0_04
Experimental refactoring 0.20.0.2.3

DebugException is thrown when safe deleting generic type from method parameters.

Steps to reproduce:
1) create new class:
public interface Basic<T> {
    void methodA(int x, int... y);

    void methodB(T a, T b);
    
}

2) select type T from the methodB (don't matter if first one or second one)
3) call Refactoring | Safe delete
4) confirm dialog
->org.netbeans.mdr.util.DebugException: Invalid key
	at
org.netbeans.mdr.storagemodel.MdrStorage.getObjectsFromIndex(MdrStorage.java:725)
	at org.netbeans.mdr.storagemodel.IndexImmutSet.getObjects(IndexImmutSet.java:66)
Comment 1 Jiri Prox 2005-08-01 09:04:28 UTC
Created attachment 23384 [details]
exception
Comment 2 Jiri Prox 2005-08-01 09:16:53 UTC
It is reproducible with all data types, not only in methods headers.
This exception is even thrown when deleting class field whose type is another
class. (IMHO in this case the usage of the proper class should be checked and if
no one found the class can be deleted)
Comment 3 Jan Becicka 2005-08-01 12:50:03 UTC
Bharath, please take a look at it. Thanks.
Comment 4 _ bharathch 2005-08-23 14:20:30 UTC
SafeDelete now handles generic types and also prevents invocation on a 
method/constructor parameter.
Files modified:SafeDeletePanel.java, SafeDeleteRefactoringPlugin.java
Comment 5 Jiri Prox 2005-08-30 10:29:56 UTC
verified