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 240558 - IllegalArgumentException: (java.lang.String)void
Summary: IllegalArgumentException: (java.lang.String)void
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-16 18:52 UTC by dimaki
Modified: 2016-03-07 15:23 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 206629


Attachments
stacktrace (1.46 KB, text/plain)
2014-01-16 18:52 UTC, dimaki
Details
unrunnable project (156.55 KB, application/octet-stream)
2014-02-16 20:46 UTC, bmeher
Details
stacktrace (1.46 KB, text/plain)
2015-04-12 16:31 UTC, Exceptions Reporter
Details
stacktrace (1.86 KB, text/plain)
2015-06-11 01:36 UTC, misterm
Details
stacktrace (1.87 KB, text/plain)
2015-07-24 17:17 UTC, Michel Graciano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dimaki 2014-01-16 18:52:05 UTC
This bug was originally marked as duplicate of bug 152143, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 8.0 Beta (Build 201401141042)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b65, Java(TM) SE Runtime Environment, 1.8.0-ea-b123
OS: Mac OS X

User Comments:
dimaki: While browsing java hints on JDK 8 bulk operations, e.g. map()




Stacktrace: 
java.lang.IllegalArgumentException: (java.lang.String)void
   at com.sun.tools.javac.model.JavacTypes.validateTypeNotIn(JavacTypes.java:295)
   at com.sun.tools.javac.model.JavacTypes.isAssignable(JavacTypes.java:105)
   at org.netbeans.modules.editor.java.Utilities.resolveMethod(Utilities.java:1055)
   at org.netbeans.modules.editor.java.Utilities.fuzzyResolveMethodInvocation(Utilities.java:988)
   at org.netbeans.modules.java.hints.errors.AddCast.computeType(AddCast.java:130)
   at org.netbeans.modules.java.hints.errors.AddCast.run(AddCast.java:192)
Comment 1 dimaki 2014-01-16 18:52:07 UTC
Created attachment 144040 [details]
stacktrace
Comment 2 bmeher 2014-02-16 20:46:21 UTC
Created attachment 145271 [details]
unrunnable project

hi, i have a problem to run a project, an exception was launched "java.lang.IllegalArgumentException" ; Note that this project was runnable before i reinstalled netbeans 7.0.
thank you to offer me a solution as soon as possible
Meher
Comment 3 Exceptions Reporter 2015-03-24 21:46:47 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=206629
Comment 4 Exceptions Reporter 2015-04-12 16:31:06 UTC
Created attachment 153145 [details]
stacktrace

Typing up lambda expression that had File::getName as an argument.
Comment 5 misterm 2015-06-11 01:36:55 UTC
Created attachment 154148 [details]
stacktrace

Typing
Comment 6 terje7601 2015-06-18 12:58:00 UTC
A test case to reproduce: create a Java class with the content below.


import java.math.BigDecimal;
import java.util.stream.Stream;

public class Issue {

public static void main(String[] args) {
Stream.of(new Issue()).mapToLong(Issue::getNb).map(BigDecimal::valueOf);
}

public long getNb() {
return 42;
}

}
Comment 7 terje7601 2015-06-18 13:44:17 UTC
The problem is that the potential IllegalArgumentException (cf. http://docs.oracle.com/javase/8/docs/api/javax/lang/model/util/Types.html#isAssignable-javax.lang.model.type.TypeMirror-javax.lang.model.type.TypeMirror- ) isn't handled at http://hg.netbeans.org/jet-main/file/538ff1b738d0/java.editor/src/org/netbeans/modules/editor/java/Utilities.java#l1049

Note that all method invocations should be fixed (besides the call to "isSameType" which doesn't throw IAE), as none of them seems to currently handle the possible IAE.
Comment 8 Michel Graciano 2015-07-24 17:17:23 UTC
Created attachment 154860 [details]
stacktrace

Editing some unfinished source file
Comment 9 Exceptions Reporter 2015-07-24 17:17:31 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=206629