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 251397 - Default methods not supported for interface in test package.
Summary: Default methods not supported for interface in test package.
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-24 13:05 UTC by gsjava
Modified: 2015-05-07 14:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gsjava 2015-03-24 13:05:46 UTC
I have the source level and default JDK set to 1.8.

To reproduce:

1) create a new Java/Maven project
2) verify source level and build JDK are both set to 1.8
3) place the following interface in the src/test/java folder

public interface Iface {
    
    default int x() {
        return 1;
    }
}

You will see the editor hint "default methods are not supported in -source 1.7"


This only breaks in the test package, if you move the interface to the source package the hint does not display.
Comment 1 Svata Dedic 2015-05-07 12:26:50 UTC
Cannot reproduce. When I set both Build/Compile - Java Platform to 1.8 and Sources - Source/Binary format to 1.8, the source didn't show any errors eve in src/test/java.

Tested in both 8.02 and dev version.

If the defect still happens, please isolate the sample in a separate project, zip the project directory, attach here and reopen the defect.
Comment 2 Svata Dedic 2015-05-07 14:39:49 UTC
Incidentally, I got the error during some other testing. Please check that your settings.xml and ~/.mavenrc (or possibly other configuration files) are clean. I found an ancient ~/.mavenrc, which defined MAVEN_OPTS and hardcoded source/target levels.