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.
See the simple testcase @Test public void testPreserveGenerics_PublicMethod() throws Exception { HintTest.create().setCaretMarker('|') .sourceLevel("1.6") .input("package test;\n" + "public class Test {\n" + " public <T extends java.lang.Number> java.util.Set<T> fi|nd(){return null;};\n" + "}\n") .run(MakePackageProtected.class) .findWarning("2:59-2:59:hint:" + Bundle.ERR_MakePackageProtected()) .applyFix() .assertOutput("package test;\n" + "public class Test {\n" + " <T extends java.lang.Number> java.util.Set<T> find(){return null;};\n" + "}\n"); } MakePackageProtected hint simply invokes org.netbeans.spi.java.hints.support.FixFactory.changeModifiersFix/removeModifiersFix ACTUAL: Generics are not preserved, test fails java.util.Set<T> find(){return null;}; EXPECTED: Generics are preserved, test succeeds <T extends java.lang.Number> java.util.Set<T> find(){return null;}; Reproduction: * Checkout https://github.com/markiewb/nb-additional-hints.git Branch feature/issue61-changemodifiersremovesgenerics * test: https://github.com/markiewb/nb-additional-hints/commit/b6891a9f740027c4c17ea8251a2b0e0116b04e52 * hint: https://raw.githubusercontent.com/markiewb/nb-additional-hints/feature/issue61-changemodifiersremovesgenerics/src/main/java/de/markiewb/netbeans/plugins/hints/modifiers/MakePackageProtected.java
Seems to work for me in dev version
(In reply to Svata Dedic from comment #1) > Seems to work for me in dev version @Svata: Reopen. It does not work for me.
Fixed in jet-main#07c1edea0ada, test added into java.source.base.
Integrated into 'main-silver', will be available in build *201607190002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/07c1edea0ada User: Svata Dedic <sdedic@netbeans.org> Log: #251898: removing modifiers will preserve type parameters