diff -r edfb33e6d35d java.hints.legacy.spi/nbproject/project.properties
--- a/java.hints.legacy.spi/nbproject/project.properties Fri Aug 26 13:31:44 2016 +0200
+++ b/java.hints.legacy.spi/nbproject/project.properties Fri Sep 02 08:34:44 2016 +0200
@@ -38,6 +38,6 @@
is.autoload=true
javac.source=1.7
javac.compilerargs=-Xlint -Xlint:-serial
-spec.version.base=1.15.0
+spec.version.base=1.16.0
javadoc.arch=${basedir}/arch.xml
requires.nb.javac=true
diff -r edfb33e6d35d java.hints.legacy.spi/nbproject/project.xml
--- a/java.hints.legacy.spi/nbproject/project.xml Fri Aug 26 13:31:44 2016 +0200
+++ b/java.hints.legacy.spi/nbproject/project.xml Fri Sep 02 08:34:44 2016 +0200
@@ -143,17 +143,10 @@
-
- org.netbeans.modules.apisupport.ant
- org.netbeans.modules.javadoc
- org.netbeans.modules.javahints
- org.netbeans.modules.maven.hints
- org.netbeans.modules.maven.j2ee
- org.netbeans.modules.web.beans
+
org.netbeans.modules.java.hints.spi
org.netbeans.modules.java.hints.spi.support
- org.netbeans.modules.jshell.support
-
+
diff -r edfb33e6d35d java.hints.legacy.spi/src/org/netbeans/modules/java/hints/legacy/spi/Bundle.properties
--- a/java.hints.legacy.spi/src/org/netbeans/modules/java/hints/legacy/spi/Bundle.properties Fri Aug 26 13:31:44 2016 +0200
+++ b/java.hints.legacy.spi/src/org/netbeans/modules/java/hints/legacy/spi/Bundle.properties Fri Sep 02 08:34:44 2016 +0200
@@ -35,5 +35,5 @@
# made subject to such option by the copyright holder.
#
# Contributor(s):
-OpenIDE-Module-Name=Legacy Java Hints SPI
+OpenIDE-Module-Name=Java Hints SPI
OpenIDE-Module-Deprecation-Message=Use Java Hints SPI (org.netbeans.spi.java.hints) instead.
diff -r edfb33e6d35d java.hints.legacy.spi/src/org/netbeans/modules/java/hints/spi/OverrideErrorMessage.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/java.hints.legacy.spi/src/org/netbeans/modules/java/hints/spi/OverrideErrorMessage.java Fri Sep 02 08:34:44 2016 +0200
@@ -0,0 +1,71 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License. When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2013 Sun Microsystems, Inc.
+ */
+package org.netbeans.modules.java.hints.spi;
+
+import com.sun.source.util.TreePath;
+import javax.tools.Diagnostic;
+import org.netbeans.api.java.source.CompilationInfo;
+
+/**
+ * The interface is an optional mixing which can be present on the ErrorRule implementation and takes care of potential
+ * transformation of the standard message to something more precise. If present, it will be called as part of error
+ * conversion to annotations to produce a different error message. If more rules matching diagnostic key respond
+ * to the createMessage call, the infrastructure will choose a message or several messages to appear. All fixes will be available from that
+ * message.
+ *
+ * Note that the customized message does not propagate into the task list; the task list will show the original javac message.
+ * @since 1.16
+ */
+public interface OverrideErrorMessage extends ErrorRule {
+ /**
+ * Provides a custom error message to replace the one in Diagnostic. If the implementation does not want to produce
+ * a custom message, it should return {@code null}, the default message will be used. If the Rule stores a data
+ * into the 'data' holder, that data will be available later, in the call to run() method.
+ *
+ * @param info context
+ * @param diagnosticKey error message key
+ * @param offset offset in the Source
+ * @param treePath path to the error, if available
+ * @return an override message to be displayed instead of the standard one or {@code null} to use the standard one.
+ */
+ public String createMessage(CompilationInfo info, Diagnostic diagnosticKey, int offset, TreePath treePath, Data data);
+}
diff -r edfb33e6d35d java.hints/src/org/netbeans/modules/java/hints/errors/OverrideErrorMessage.java
--- a/java.hints/src/org/netbeans/modules/java/hints/errors/OverrideErrorMessage.java Fri Aug 26 13:31:44 2016 +0200
+++ b/java.hints/src/org/netbeans/modules/java/hints/errors/OverrideErrorMessage.java Fri Sep 02 08:34:44 2016 +0200
@@ -44,7 +44,6 @@
import com.sun.source.util.TreePath;
import javax.tools.Diagnostic;
import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.modules.java.hints.spi.ErrorRule;
/**
* The interface is an optional mixing which can be present on the ErrorRule implementation and takes care of potential
@@ -55,7 +54,7 @@
*
* Note that the customized message does not propagate into the task list; the task list will show the original javac message.
*/
-public interface OverrideErrorMessage extends ErrorRule {
+public interface OverrideErrorMessage extends org.netbeans.modules.java.hints.spi.OverrideErrorMessage {
/**
* Provides a custom error message to replace the one in Diagnostic. If the implementation does not want to produce
* a custom message, it should return {@code null}, the default message will be used. If the Rule stores a data
diff -r edfb33e6d35d java.hints/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProvider.java
--- a/java.hints/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProvider.java Fri Aug 26 13:31:44 2016 +0200
+++ b/java.hints/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProvider.java Fri Sep 02 08:34:44 2016 +0200
@@ -82,12 +82,12 @@
import org.netbeans.lib.editor.util.swing.DocumentUtilities;
import org.netbeans.modules.editor.NbEditorDocument;
import org.netbeans.modules.editor.java.Utilities;
-import org.netbeans.modules.java.hints.errors.OverrideErrorMessage;
import org.netbeans.modules.java.hints.jdk.ConvertToDiamondBulkHint;
import org.netbeans.modules.java.hints.jdk.ConvertToLambda;
import org.netbeans.modules.java.hints.legacy.spi.RulesManager;
import org.netbeans.modules.java.hints.spi.ErrorRule;
import org.netbeans.modules.java.hints.spi.ErrorRule.Data;
+import org.netbeans.modules.java.hints.spi.OverrideErrorMessage;
import org.netbeans.modules.java.source.parsing.Hacks;
import org.netbeans.modules.parsing.spi.Parser.Result;
import org.netbeans.modules.parsing.spi.Scheduler;
diff -r edfb33e6d35d jshell.support/manifest.mf
--- a/jshell.support/manifest.mf Fri Aug 26 13:31:44 2016 +0200
+++ b/jshell.support/manifest.mf Fri Sep 02 08:34:44 2016 +0200
@@ -3,3 +3,4 @@
OpenIDE-Module: org.netbeans.modules.jshell.support
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jshell/support/Bundle.properties
OpenIDE-Module-Layer: org/netbeans/modules/jshell/resources/layer.xml
+OpenIDE-Module-Specification-Version: 1.1
diff -r edfb33e6d35d jshell.support/nbproject/project.properties
--- a/jshell.support/nbproject/project.properties Fri Aug 26 13:31:44 2016 +0200
+++ b/jshell.support/nbproject/project.properties Fri Sep 02 08:34:44 2016 +0200
@@ -1,5 +1,4 @@
javac.source=1.8
javac.compilerargs=-Xlint -Xlint:-serial
-spec.version.base=1.0
cp.extra=${tools.jar}
bootclasspath.prepend=${nb_all}/libs.javacapi/external/nb-javac-api.jar${path.separator}${nb_all}/libs.javacimpl/external/nb-javac-impl.jar
diff -r edfb33e6d35d jshell.support/nbproject/project.xml
--- a/jshell.support/nbproject/project.xml Fri Aug 26 13:31:44 2016 +0200
+++ b/jshell.support/nbproject/project.xml Fri Sep 02 08:34:44 2016 +0200
@@ -185,7 +185,6 @@
1
-
@@ -234,21 +233,12 @@
- org.netbeans.modules.java.hints
-
-
-
- 1
-
-
-
-
org.netbeans.modules.java.hints.legacy.spi
1
-
+ 1.16
@@ -318,7 +308,6 @@
-
diff -r edfb33e6d35d jshell.support/src/org/netbeans/modules/jshell/editor/SnippetClassGenerator.java
--- a/jshell.support/src/org/netbeans/modules/jshell/editor/SnippetClassGenerator.java Fri Aug 26 13:31:44 2016 +0200
+++ b/jshell.support/src/org/netbeans/modules/jshell/editor/SnippetClassGenerator.java Fri Sep 02 08:34:44 2016 +0200
@@ -63,7 +63,6 @@
import org.netbeans.api.project.Project;
import org.netbeans.api.templates.FileBuilder;
import org.netbeans.modules.editor.indent.api.Reformat;
-import org.netbeans.modules.java.hints.OrganizeImports;
import org.netbeans.modules.jshell.support.ShellSession;
import org.openide.cookies.EditorCookie;
import org.openide.filesystems.FileObject;
@@ -302,7 +301,7 @@
src.runModificationTask(wc -> {
wc.toPhase(JavaSource.Phase.RESOLVED);
this.copy = wc;
- OrganizeImports.doOrganizeImports(copy, null, true);
+// OrganizeImports.doOrganizeImports(copy, null, true);
}).commit();
editor.saveDocument();
} catch (IOException ex) {
diff -r edfb33e6d35d jshell.support/src/org/netbeans/modules/jshell/project/JShellOptions2.java
--- a/jshell.support/src/org/netbeans/modules/jshell/project/JShellOptions2.java Fri Aug 26 13:31:44 2016 +0200
+++ b/jshell.support/src/org/netbeans/modules/jshell/project/JShellOptions2.java Fri Sep 02 08:34:44 2016 +0200
@@ -82,7 +82,7 @@
import org.netbeans.api.project.SourceGroup;
import org.netbeans.modules.java.j2seproject.api.J2SECategoryExtensionProvider;
import org.netbeans.modules.java.j2seproject.api.J2SECategoryExtensionProvider.ConfigChangeListener;
-import org.netbeans.modules.java.source.parsing.ClasspathInfoProvider;
+//import org.netbeans.modules.java.source.parsing.ClasspathInfoProvider;
import org.netbeans.modules.jshell.project.RunOptionsModel.LoaderPolicy;
import org.netbeans.modules.parsing.api.ParserManager;
import org.netbeans.modules.parsing.api.ResultIterator;
@@ -176,9 +176,9 @@
return;
}
- class UT extends UserTask implements ClasspathInfoProvider {
+ class UT extends UserTask /*implements ClasspathInfoProvider*/ {
- @Override
+// @Override
public ClasspathInfo getClasspathInfo() {
return JShellOptions2.this.getClasspathInfo();
}
diff -r edfb33e6d35d jshell.support/src/org/netbeans/modules/jshell/support/LocationSuppressRule.java
--- a/jshell.support/src/org/netbeans/modules/jshell/support/LocationSuppressRule.java Fri Aug 26 13:31:44 2016 +0200
+++ b/jshell.support/src/org/netbeans/modules/jshell/support/LocationSuppressRule.java Fri Sep 02 08:34:44 2016 +0200
@@ -50,12 +50,11 @@
import java.util.regex.Pattern;
import javax.tools.Diagnostic;
import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.modules.java.hints.errors.OverrideErrorMessage;
import org.netbeans.modules.java.hints.spi.ErrorRule;
+import org.netbeans.modules.java.hints.spi.OverrideErrorMessage;
import org.netbeans.spi.editor.hints.Fix;
import org.openide.util.NbBundle;
-import static org.netbeans.modules.jshell.support.Bundle.*;
/**
* Suppresses erroneous locations. The javac gives location in its error messages, which
* displays classname. In case of JShell snippets, those class names are 'hidden' and computer generated
diff -r edfb33e6d35d jshell.support/src/org/netbeans/modules/jshell/support/SemicolonMissingRule.java
--- a/jshell.support/src/org/netbeans/modules/jshell/support/SemicolonMissingRule.java Fri Aug 26 13:31:44 2016 +0200
+++ b/jshell.support/src/org/netbeans/modules/jshell/support/SemicolonMissingRule.java Fri Sep 02 08:34:44 2016 +0200
@@ -42,7 +42,6 @@
package org.netbeans.modules.jshell.support;
import com.sun.source.util.TreePath;
-import com.sun.tools.javac.parser.Tokens;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@@ -51,9 +50,8 @@
import javax.swing.text.Document;
import javax.tools.Diagnostic;
import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.modules.java.hints.errors.OverrideErrorMessage;
-import org.netbeans.modules.java.source.parsing.Hacks;
-import org.openide.util.Exceptions;
+import org.netbeans.modules.java.hints.spi.OverrideErrorMessage;
+//import org.netbeans.modules.java.source.parsing.Hacks;
/**
* Suppresses error warning that a semicolon is missing from the input. JShell automatically
@@ -66,10 +64,10 @@
@Override
public String createMessage(CompilationInfo info, Diagnostic d, int offset, TreePath treePath, Data data) {
- Object dp = Hacks.getDiagnosticParam(d, 0);
- if (dp != Tokens.TokenKind.SEMI) {
- return null;
- }
+// Object dp = Hacks.getDiagnosticParam(d, 0);
+// if (dp != Tokens.TokenKind.SEMI) {
+// return null;
+// }
int off = offset;
final CharSequence seq = info.getSnapshot().getText();
diff -r edfb33e6d35d nbbuild/build.properties
--- a/nbbuild/build.properties Fri Aug 26 13:31:44 2016 +0200
+++ b/nbbuild/build.properties Fri Sep 02 08:34:44 2016 +0200
@@ -204,6 +204,7 @@
sampler,\
spi.editor.hints,\
spi.java.hints,\
+ java.hints.legacy.spi,\
java.hints.test,\
api.web.webmodule,\
xml.xam,\