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 256710

Summary: IndexOutOfBoundsException: Index: -1, Size: 0
Product: java Reporter: rcasha <rcasha>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: VERIFIED FIXED    
Severity: normal CC: akrasny, bht, epdv, FiruzzZ, ggghhhjjj, locked, markiewb, peterhull90, vv159170, xehpuk
Priority: P2    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 219793
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace

Description rcasha 2015-11-20 13:42:12 UTC
Build: NetBeans IDE 8.1 (Build 201510222201)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.51-b03, Java(TM) SE Runtime Environment, 1.8.0_51-b16
OS: Linux

User Comments:
FiruzzZ: trying to "change method signature", adding a parameter at the beginning of it
The method is private and called just from one place.

rcasha: Created a new class "X" without a constructor
Created a static main method
In the main method, call "new X(args);"
From the hints, selected "change constructor" option
This error was generated.

bht: Adding a parameter to a method call then trying to change method signature to add the parameter.

peterhull90: Refactoring - changing method signature

GUEST: Using IDE, trying to refactor method signature.




Stacktrace: 
java.lang.IndexOutOfBoundsException: Index: -1, Size: 0
   at java.util.LinkedList.checkElementIndex(LinkedList.java:555)
   at java.util.LinkedList.get(LinkedList.java:476)
   at org.netbeans.modules.refactoring.java.ui.ChangeParametersPanel.initTableData(ChangeParametersPanel.java:799)
   at org.netbeans.modules.refactoring.java.ui.ChangeParametersPanel.access$800(ChangeParametersPanel.java:92)
   at org.netbeans.modules.refactoring.java.ui.ChangeParametersPanel$2.run(ChangeParametersPanel.java:236)
   at org.netbeans.modules.refactoring.java.ui.ChangeParametersPanel$2.run(ChangeParametersPanel.java:195)
Comment 1 rcasha 2015-11-20 13:42:14 UTC
Created attachment 157429 [details]
stacktrace
Comment 2 ggghhhjjj 2015-11-23 08:33:03 UTC
Created attachment 157445 [details]
stacktrace

On refactoring - change method parameters
Comment 3 FiruzzZ 2015-12-02 10:50:36 UTC
Created attachment 157610 [details]
stacktrace

trying to Change method signature
from this:
private void calcularCoberturaPostBajaOS()
to:
calcularCoberturaPostBajaOS(TipoBaja tb, Date fechaBaja)
Comment 4 Vladimir Voskresensky 2015-12-03 12:23:41 UTC
Created attachment 157643 [details]
stacktrace

trying to change method signature (using hint) from one parameter to 2 params
Comment 5 Andrew Krasny 2015-12-25 19:37:58 UTC
Created attachment 157920 [details]
stacktrace

An attempt to change method's parameters.
(Accepted a proposed refactoring hint).
Comment 6 Exceptions Reporter 2015-12-25 19:38:03 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=219793
Comment 7 markiewb 2016-02-01 20:39:43 UTC
Created attachment 158344 [details]
stacktrace

Update method via hint
Comment 8 markiewb 2016-02-07 20:04:48 UTC
Created attachment 158403 [details]
stacktrace

Change method parameter
Comment 9 Exceptions Reporter 2016-02-16 12:43:50 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=219793
Comment 10 Ralph Ruijs 2016-03-03 12:24:58 UTC
changeset:   587d78c734ce
user:        Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date:        Thu Mar 03 13:23:58 2016 +0100
summary:     #256710 - New parameters can be added by clients
Comment 11 Quality Engineering 2016-03-04 02:07:20 UTC
Integrated into 'main-silver', will be available in build *201603040002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/587d78c734ce
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #256710 - New parameters can be added by clients
Comment 12 Jiri Kovalsky 2016-03-16 21:46:48 UTC
Can somebody from reporters of this bug please verify the fix in the latest development build [1]? Thanks!

[1] http://bits.netbeans.org/dev/nightly/latest/
Comment 13 markiewb 2016-03-20 17:34:15 UTC
(In reply to Jiri Kovalsky from comment #12)
> Can somebody from reporters of this bug please verify the fix in the latest
> development build [1]? Thanks!
> 
> [1] http://bits.netbeans.org/dev/nightly/latest/


Using the steps:
rcasha: Created a new class "X" without a constructor
Created a static main method
In the main method, call "new X(args);"
From the hints, selected "change constructor" option
This error was generated.

Producible using Product Version: NetBeans IDE 8.1 (Build 201510222201)
Not producible anymore using Product Version: NetBeans IDE Dev (Build 201603200001)