You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sk...@apache.org on 2020/05/04 08:41:42 UTC
[netbeans] branch master updated: Fix ConvertToPatternInstanceOf
hint always showing.
This is an automated email from the ASF dual-hosted git repository.
skygo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new ffb0a35 Fix ConvertToPatternInstanceOf hint always showing.
new 1496c64 Merge pull request #2112 from neilcsmith-net/instanceof-hint-fix
ffb0a35 is described below
commit ffb0a353e6a69cd696f1dab9677c4d8238dfd336
Author: Neil C Smith <ne...@apache.org>
AuthorDate: Thu Apr 30 14:25:12 2020 +0100
Fix ConvertToPatternInstanceOf hint always showing.
Add minSourceVersion = 14 to ConvertToPatternInstanceOf hint.
Disable hint in HintMetadata if lookup of SourceVersion by name fails.
---
.../netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOf.java | 3 ++-
.../org/netbeans/modules/java/hints/providers/spi/HintMetadata.java | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOf.java b/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOf.java
index 90699b4..e397ed8 100644
--- a/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOf.java
+++ b/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToPatternInstanceOf.java
@@ -64,7 +64,8 @@ import org.openide.util.NbBundle;
"ERR_ConvertToPatternInstanceOf=instanceof <pattern> can be used here",
"FIX_ConvertToPatternInstanceOf=Use instanceof <pattern>"
})
-@Hint(displayName="#DN_ConvertToPatternInstanceOf", description="#DESC_ConvertToPatternInstanceOf", category="rules15")
+@Hint(displayName="#DN_ConvertToPatternInstanceOf", description="#DESC_ConvertToPatternInstanceOf", category="rules15",
+ minSourceVersion = "14")
public class ConvertToPatternInstanceOf {
@TriggerPatterns({
diff --git a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintMetadata.java b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintMetadata.java
index e98893a..4b3651e 100644
--- a/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintMetadata.java
+++ b/java/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintMetadata.java
@@ -175,6 +175,7 @@ public class HintMetadata {
this.sourceVersion = SourceVersion.valueOf("RELEASE_" + version);
} catch (IllegalArgumentException ex) {
this.sourceVersion = SourceVersion.RELEASE_3;
+ setEnabled(false);
}
}
return this;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists