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

Summary: Default methods not supported for interface in test package.
Product: java Reporter: gsjava
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: Macintosh   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

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.