You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ne...@apache.org on 2022/01/19 12:19:33 UTC
[netbeans] branch delivery updated: [#3466] do not show Convert Type to Var hint for method references
This is an automated email from the ASF dual-hosted git repository.
neilcsmith pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/delivery by this push:
new a2baf75 [#3466] do not show Convert Type to Var hint for method references
new 8df36f8 Merge pull request #3471 from oyarzun/issue-3466
a2baf75 is described below
commit a2baf75e2756ff9cae3ea0ead0037b513f930715
Author: Christian Oyarzun <oy...@apache.org>
AuthorDate: Mon Jan 17 20:52:16 2022 -0500
[#3466] do not show Convert Type to Var hint for method references
---
.../modules/java/hints/jdk/ConvertToVarHint.java | 2 ++
.../modules/java/hints/jdk/ConvertToVarHintTest.java | 18 ++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java b/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java
index c9e537d..f1a19da 100644
--- a/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java
+++ b/java/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java
@@ -204,6 +204,8 @@ public class ConvertToVarHint {
break;
case LAMBDA_EXPRESSION:
return false;
+ case MEMBER_REFERENCE:
+ return false;
default:
break;
}
diff --git a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHintTest.java b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHintTest.java
index a9a2168..30b3a21 100644
--- a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHintTest.java
+++ b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHintTest.java
@@ -122,6 +122,24 @@ public class ConvertToVarHintTest {
}
@Test
+ public void testMethodRefToVar() throws Exception {
+
+ HintTest.create()
+ .setCaretMarker('^')
+ .input("package test;\n"
+ + "import java.util.function.Consumer;\n"
+ + "public class Test {\n"
+ + " void m2() {\n"
+ + " final Consumer<String> println = System.out::println^;\n"
+ + " }\n"
+ + "}\n")
+ .sourceLevel("1.10")
+ .run(ConvertToVarHint.class)
+ .assertNotContainsWarnings(VAR_CONV_DESC);
+
+ }
+
+ @Test
public void testArrayInitializerVar() throws Exception {
HintTest.create()
---------------------------------------------------------------------
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