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.
Summary: | AssertionError: Method parameter without PARAMETER flag | ||
---|---|---|---|
Product: | java | Reporter: | michbarsinai <michbarsinai> |
Component: | Compiler | Assignee: | Dusan Balek <dbalek> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | akobberup, aldobrucale, alexvsimon, chuprin, gjong, hmichel, janario, jglick, MackSix, michbarsinai, mmirilovic, rkamradt, scanti, sdedic, sedlakf, zdenek.rod |
Priority: | P2 | ||
Version: | 8.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 204946 |
Attachments: |
stacktrace
stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace Possible fixes |
Description
michbarsinai
2013-10-30 20:46:59 UTC
Created attachment 141720 [details]
stacktrace
Created attachment 143281 [details]
stacktrace
coding. Adding another parameter in a method
Created attachment 143711 [details]
stacktrace
added a semicolon between a parameter type and its name
Created attachment 144100 [details]
stacktrace
Exception after javadoc template insertion.
Created attachment 144277 [details]
stacktrace
During code completion that included enums, and was for a parameter of another method.
Created attachment 144316 [details]
stacktrace
Hi all. I added method with code completion and change "Object" to specified variable name
Created attachment 145453 [details]
stacktrace
Coping some classes with refactoring activated (Lombok active)
Created attachment 145463 [details]
stacktrace
Coping some class files from a package to another (Lombok active). It does not happens at 7.4
It looks like to be a regression since I can't reproduce it at 7.4. Could you please create a simple reproducible test case and attach it to the issue? Thanks. 21 reports => P2 Which exact Lombok version is that? I think Lombok was fixed to include the PARAMETER flag on some places some time ago. A testcase to reproduce would help to determine whether that was sufficient to cover this situation or not. I will check the Lombok version we are using, but AFAIR it is the latest one. So far, I was unable to create a sample to reproduce it. The only think I was able to reproduce was issue #242191. Monday I will check this issue as soon as I get back to work. Regards We have been using Lombok 1.12.4. I am not able to reproduce it yet. I don't know if this is helpful, but I have a freeform project that got messed up by Inspect & Transform and if I open a file from the project, this AssertionError is thrown every time. 1. Unzip the freeform project (jEdit) that can be found at http://deadlock.netbeans.org/hudson/job/upload/ws/ 2. Run NetBeans. 3. You don't have to open project, just open the file BufferHistory.java located in package org.gjt.sp.jedit. 4. Scroll down. By now this AssertionError should be thrown. Product Version: NetBeans IDE Dev (Build nbms-and-javadoc-1921-on-20140717) Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) It may not be helpful because the file was made uncompilable, but curious that no errors show in the editor. Created attachment 148222 [details]
stacktrace
Changing parameters of an (overridden) method, did not yet import the type of one of the modified parameters.
This error happens to me without using Lombok. I was working with the example attached in Comment#15; I've found out that VarSymbols that correspond to method parameters are created with 0 PARAMETER flag only as a part of error recovery from PostAttrAnalyzer *and* from some Lambda translation code (sorry I didn't yet fully decipher its function). A possible fix would be that PostAttrAnalyzer properly uses PARAMETER flag when visiting method's variable. Second possible fix is to add a condition to the Assert clause that prevents Asserting on erroneous symbols (owner == noSymbol). May be less intrusive because PostAttrAnalyzer creates very rudimentary symbols with no flags at all. Please check the attached diff (both approaches are present). Note: the fix in Attr.java, line 4891 is a NPE which appears when opening the attached project. The md is also an errorenous method with no restype at all. Created attachment 148387 [details]
Possible fixes
Fixed in jet-main. Thanks for the patch. http://hg.netbeans.org/jet-main/rev/79b30f18dab0 http://hg.netbeans.org/nb-javac/rev/bc997355c91a Integrated into 'main-silver', will be available in build *201408010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/79b30f18dab0 User: Dusan Balek <dbalek@netbeans.org> Log: Issues #152386 and #237828 fixed. *** Bug 244012 has been marked as a duplicate of this bug. *** *** Bug 239461 has been marked as a duplicate of this bug. *** |