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 130144 - IllegalArgumentException: Invalid field
Summary: IllegalArgumentException: Invalid field
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-14 13:21 UTC by Max Sauer
Modified: 2009-02-10 15:47 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 34864


Attachments
stacktrace (1.90 KB, text/plain)
2008-03-14 13:21 UTC, Max Sauer
Details
gestures (9.01 KB, text/plain)
2008-03-19 15:21 UTC, unr303
Details
ide log (150.81 KB, text/plain)
2008-03-19 15:21 UTC, unr303
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max Sauer 2008-03-14 13:21:29 UTC
Build: NetBeans IDE Dev (Build 20080312071229)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_04-b12-45-optimized
OS: Mac OS X, 10.5.2, x86_64

User Comments: 
This constantly pops up while I'm typing code while having debugger session active
Comment 1 Max Sauer 2008-03-14 13:21:36 UTC
Created attachment 58385 [details]
stacktrace
Comment 2 Martin Entlicher 2008-03-14 13:27:05 UTC
It comes from a tooltip over some field. Can you please provide the source and the field you're evaluating?
Comment 3 Max Sauer 2008-03-14 14:45:27 UTC
Sorry, I've closed the session in the meantime and I don't remember what my mouse has been pointing at. I'll add the info if it occurs again.
Comment 4 Max Sauer 2008-03-19 09:26:21 UTC
I've reproduced it again.

1) Open Editor.Options module
2) Debug module from step 1)
4) In the debugged IDE, invoke Tools|Options|Fonts&Colors|[...] button
5) Place BP on ColorModel:311
6) Change Font Type in Font dialog from 4)
7) Confirm form dialog
8) Wait until BP hit
9) Point yout mouse to 312:testProfileName field

Comment 5 unr303 2008-03-19 15:21:20 UTC
Created attachment 58669 [details]
gestures
Comment 6 unr303 2008-03-19 15:21:38 UTC
Created attachment 58670 [details]
ide log
Comment 7 Exceptions Reporter 2008-03-21 01:41:40 UTC
This issue has already 5 duplicates 
Comment 8 Martin Entlicher 2008-03-21 13:10:06 UTC
Huh, what's Editor.Options module??

grep -r ColorModel main, gave me, besides others, options.editor/src/org/netbeans/modules/options/colors/ColorModel.java

Reproduced, the problematic field is "testProfileName".
There is one more problem, variables from the outer method - defaults, highlightings, syntaxColorings - are reported as
unknown.
Comment 9 Max Sauer 2008-03-21 21:30:39 UTC
Eh, I meant options.editor of course. Sorry :)
Comment 10 Martin Entlicher 2008-03-25 09:02:25 UTC
Fixed: changeset:   75273:6635865247db
http://hg.netbeans.org/main/rev/6635865247db
Comment 11 Egor Ushakov 2008-04-09 09:34:54 UTC
I was able to reproduce it in 6.1:

Product Version: NetBeans IDE Dev (Build 200804082140)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: SunOS version 5.11 running on x86; UTF-8; en_US (nb)

http://statistics.netbeans.org/analytics/detail.do?id=45094

Is the fix in 6.1 branch?
Comment 12 Martin Entlicher 2008-04-09 10:20:19 UTC
The fix is in 6.1 branch, I've verified that.

gorrus, we need the steps to reproduce this - the source code and the place where did you evaluated the field. I hope
it's not confidential.
Comment 13 Egor Ushakov 2008-04-09 11:11:22 UTC
Sure, here is how I reproduce the problem:
- run netbeans(1) on your machine(1)
- run netbeans(2) with debug on a separate machine(2)
- attach debugger from netbeans(1) to machine(2)
- in netbeans(2) open Window->Debugging->Watches
- in netbeans(1) set breakpoint at openide.explorer/src/org/openide/explorer/view/TreeTableView.java:1593
  ( inside getTableCellRendererComponent method. It is called when you click on column header in a table)
- click on column header inside Watches window in netbeans(2)
- debugger in netbeans(1) stopped on the breakpoint
- try to get the tooltip with the variable value for any class memeber (for example treeColumnProperty) and get the
exception
Comment 14 Egor Ushakov 2008-04-09 15:35:13 UTC
It is still there in (I changed java and ide build slightly):

Product Version: NetBeans IDE Dev (Build 200804090901)
Java: 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19
System: SunOS version 5.11 running on x86; UTF-8; en_US (nb)

Raising priority to P1.
Comment 15 Martin Entlicher 2008-04-09 16:07:53 UTC
Thanks for reproducible steps. However I believe that this is not a showstopper. NB 5.x and 6.0 had a lot of issues with
expression evaluation and they were not considered as showstoppers. Decreasing to P2.
Comment 16 Egor Ushakov 2008-04-09 17:09:29 UTC
In described case if I have watch on this member I get an exception every debugger step.
I will not argue about priorities, just wanted to see this fixed in 6.1.
Comment 17 Exceptions Reporter 2008-04-15 14:40:36 UTC
This issue has already 20 duplicates 
Comment 18 Martin Entlicher 2008-04-23 23:16:24 UTC
We did not take into account subclasses of object which contains the evaluated fields. It should be fixed now in trunk:
changeset:   79039:5344d2156a92
http://hg.netbeans.org/main/rev/5344d2156a92
Comment 19 Quality Engineering 2008-04-24 03:52:30 UTC
Issue '130144' Integrated in NB_Trunk_Production #154 : http://hg.netbeans.org/main/rev/5344d2156a92,
 with comment: #130144: When searching for object that contains the evaluated field, take subclasses of the outer class into account.
Comment 20 Jiri Vagner 2008-04-25 08:07:02 UTC
Verified

Product Version: NetBeans IDE Dev (Build 200804250004)
Java: 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Comment 21 rbalada 2008-04-25 16:57:47 UTC
merged to release61_fixes repository

changeset:   77442:54e97f89a549
user:        mentlicher@netbeans.org
date:        Wed Apr 23 23:50:02 2008 +0200
summary:     #130144: When searching for object that contains the evaluated field, take subclasses of the outer class
into account.
Comment 22 Peter Pis 2008-05-19 10:03:57 UTC
Verified on Patch1.
Comment 23 Jan Pokorsky 2008-07-16 12:34:55 UTC
I can reproduce it with

Product Version: NetBeans IDE Dev (Build 080716)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)

The exception occurs whenever I move mouse cursor over a java statement e.g. refactoring.setRefactorFields at
setParameters(boolean checkOnly), EncapsulateFieldUI.java, refactoring.java project.

    private Problem setParameters(boolean checkOnly) {
        refactoring.setRefactorFields(panel.getAllFields());
        refactoring.setMethodModifiers(panel.getMethodModifiers());
Comment 24 Martin Entlicher 2008-07-21 10:14:08 UTC
Jiri, I can not reproduce this "Invalid field" error when following your description. Where did you have the program
counter during evaluation of the refactoring.setRefactorFields?

I've found one case where "Invalid field" is thrown, but that seems to be a different problem. It's thrown when you try
to evaluate a private field of a super class.
Comment 25 Daniel Prusa 2008-07-21 10:48:28 UTC
This is not reproducible for me as well. I have stopped debugger at breakpoint set in EncapsulateFieldUI.setParameters()
method and tried to invoke tooltips for all possible identifiers of the method's body. No IllegalArgumentException has
been thrown.
Comment 26 Jan Pokorsky 2008-07-21 12:23:19 UTC
As you can read from the logger (http://statistics.netbeans.org/analytics/detail.do?id=77178) I did several Step Over
actions. I am not sure if I was looking there via the Debugging view -> Make Current. Sorry, I am not able to reproduce
it again.
Comment 27 Martin Entlicher 2008-07-21 13:50:49 UTC
There was no pointer to http://statistics.netbeans.org/analytics/detail.do?id=77178 from this issue!

I can not read anything relevant from that anyway, it's not apparent where was the debugger stopped, where was your
program counter. Thus, it's impossible to reproduce.
Comment 28 Jan Pokorsky 2008-07-21 14:36:03 UTC
It is listed as a duplicate of the http://statistics.netbeans.org/exceptions/detail.do?id=34864. See 'URL:' field.

My experience is that these debugger bugs are random between IDE sessions and I see a lot of different exceptions from
the debugger lately. Thus I do not remember all circumstances. If you have some logging that I could turn on please let
me know. I will provide more relevant details then.
Comment 29 Martin Entlicher 2008-07-21 14:58:05 UTC
O.K. Thanks. This bug is not random, I've found just one case when it's reproducible:

public class InvalidField {
    private int field = 0;

    private static class Inner {
        public Inner() {
            int a = 0;// field
        }
    }

    public static void main(String[] args) {
        new Inner();
    }
}

When the program counter is at line "int a = 0;" then when "field" variable is evaluated, the "Invalid field" exception
is thrown. I'll fix that case.
Comment 30 Martin Entlicher 2008-07-21 16:49:57 UTC
I've fixed in problem with the described use-case in changeset:   91030:22584cb65360
Please reopen if this happens again. I will need the location where debugger was stopped and the string that was evaluated.
http://hg.netbeans.org/main/rev/22584cb65360
Comment 31 artibee 2008-08-05 00:50:41 UTC
If there are additional code changes (trunk changesets) to be included in Patch 3, 
ensure its status is "VERIFIED" before nominating. Please note NetBeans 6.1 Patch3
cut-off is going to happen on close of business August 5th. 
Comment 32 Peter Pis 2008-08-05 13:11:32 UTC
Verified in trunk. 
Comment 33 rbalada 2008-08-06 16:01:27 UTC
I've ported the changeset http://hg.netbeans.org/main/rev/22584cb65360 into release61_fixes repository as
http://hg.netbeans.org/release61_fixes/rev/80628106ce96 and http://hg.netbeans.org/release61_fixes/rev/6b3c1e14601b
(fix-up of manually applied changeset).
Comment 34 collinm 2008-09-30 12:33:36 UTC
i have this problem with
NetBeans IDE 6.1 (Build 200804211638)
Comment 35 Martin Entlicher 2008-09-30 12:36:31 UTC
collinm, if this exception still occurs, please provide steps to reproduce. Otherwise we can not fix it. Thanks.
Comment 36 pgebauer 2008-09-30 12:56:19 UTC
collinm, have you applied all available patches? (BTW. patches don't change IDE build number so it's hard say if you
applied any patch). You can use steps described at
http://hg.netbeans.org/main/raw-file/63c0534adb36/usersguide/javahelp/org/netbeans/modules/usersguide/configure/modules/autoupdate.html
for the IDE update, if needed.
Comment 37 Petr Cyhelsky 2008-10-06 15:41:59 UTC
found steps to reproduce in:
Product Version: NetBeans IDE Dev (Build 200810060201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b14
System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb)

place caret on line 129 of MemoryView.java -> invoke run to cursor -> invoke step into -> hold mouse over some
non-primitive variable (to get baloon tooltip) -> exception
Comment 38 Martin Entlicher 2008-10-06 15:58:52 UTC
Reproduced. Thanks for the reproducible steps.
Comment 39 Martin Entlicher 2008-10-06 16:10:43 UTC
The problem is, that the reference to the outer class is not yet defined when entering the constructor of the inner class.
Comment 40 Martin Entlicher 2008-10-06 17:18:49 UTC
Fixed in changeset:   105159:209b78feb8ba
http://hg.netbeans.org/main/rev/209b78feb8ba

Please verify.
Comment 41 Quality Engineering 2008-10-07 06:05:53 UTC
Integrated into 'main-golden', will be available in build *200810070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/209b78feb8ba
User: mentlicher@netbeans.org
Log: #130144 - Report an error when we're not able to find the enclosing object instead of evaluating the field/method on a bad instance.
Comment 42 Petr Cyhelsky 2008-10-07 13:03:36 UTC
Verified fixed on:
Product Version: NetBeans IDE Dev (Build 200810070201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b14
System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb)
Comment 43 rbalada 2008-11-05 15:56:59 UTC
I've ported the changeset http://hg.netbeans.org/main/rev/209b78feb8ba into release61_fixes repository as
http://hg.netbeans.org/release61_fixes/rev/b1400e3bf201