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: | No compiler error when passing a Set where SortedSet would be required | ||
---|---|---|---|
Product: | ide | Reporter: | sebastianriemer |
Component: | Code | Assignee: | issues@ide <issues> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 8.2 | ||
Hardware: | PC | ||
OS: | Windows 10 x64 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | No compilaton error is shown for the given code while there should be one |
Pardon me, in the screenshot the compiler error would be expected on Line 20, the line containing "instanceOfA.setSomeSortedSet(Collections.singleton(id));" Thanks for the report, but I don't quite understand, why you selected 'Component' 'Exceptions Reporter' for this bug report. Can you explain it? Oh I am sorry, to be honest I was quite lost when having to choose a right category for this issue. Please feel free to reassign whatever component seems right to you, as I have no clue. (In reply to sebastianriemer from comment #3) > Oh I am sorry, to be honest I was quite lost when having to choose a right > category for this issue. Please feel free to reassign whatever component > seems right to you, as I have no clue. If you don't know the right component, please use 'Ide' as product and 'Code' as component as described here: <http://wiki.netbeans.org/IssuezillaFields>. Thanks. |
Created attachment 163394 [details] No compilaton error is shown for the given code while there should be one Product Version: NetBeans IDE 8.2 (Build 201609300101) Java: 1.8.0_112; Java HotSpot(TM) 64-Bit Server VM 25.112-b15 Runtime: Java(TM) SE Runtime Environment 1.8.0_112-b15 System: Windows 10 version 10.0 running on amd64; Cp1252; de_DE (nb) Given the following program code: package sometest; import java.util.Collections; import java.util.SortedSet; public class SomeTest { public static void main(String[] args) { } public class TestClassA { public void setSomeSortedSet(SortedSet<Long> sortedSet) { } } public void doIt() { TestClassA instanceOfA = new TestClassA(); long id = 1l; instanceOfA.setSomeSortedSet(Collections.singleton(id)); } } I would expect to receive a compiler error on line 17, but I don't. The whole file is marked with a red exclamation mark stating "Error parsing file". When compiled via Right-click on the project > "Build", I receive the compiler error. Additional note: I have had the same logic in a maven-based project, using the same JDK version and strangely when doing a manual build, I got "Build success", which clearly should not be possible? I am going to try to create a minimal code example for that case too.