From a5ddf365805742517d48a0cb7d2c81b3b66396c1 Mon Sep 17 00:00:00 2001 From: Mickael Istria Date: Mon, 2 Sep 2024 09:53:49 +0200 Subject: [PATCH] Improve rename tests so they can work with Javac too The current code being tested has syntax errors. Those errors prevents Javac from properly setting up bindings (and it's not obvious that Javac is more wrong than ECJ, so there are little chance Javac gets changed to behave like ECJ). Those syntax errors do not seem so relevant for the case being covered. So we get rid of them to focus on the "correct" case and allow Javac to work with it. --- .../ls/core/internal/handlers/PrepareRenameHandlerTest.java | 2 +- .../jdt/ls/core/internal/handlers/RenameHandlerTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/PrepareRenameHandlerTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/PrepareRenameHandlerTest.java index fb2c0786e8..4e57e19d15 100644 --- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/PrepareRenameHandlerTest.java +++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/PrepareRenameHandlerTest.java @@ -214,7 +214,7 @@ public void testRenameTypeParameterInMethod() throws JavaModelException, BadLoca "package test1;\n", "public class B {\n", " private T t;\n", - " public inspect(U u) { return u; }\n", + " public U inspect(U u) { return u; }\n", "}\n" }; diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/RenameHandlerTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/RenameHandlerTest.java index 378dbb10fa..f8c43f99d5 100644 --- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/RenameHandlerTest.java +++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/RenameHandlerTest.java @@ -775,7 +775,7 @@ public void testRenameTypeParameterInMethod() throws JavaModelException, BadLoca "package test1;\n", "public class B {\n", " private T t;\n", - " public inspect(U u) { return u; }\n", + " public U inspect(U u) { return u; }\n", "}\n" }; @@ -791,7 +791,7 @@ public void testRenameTypeParameterInMethod() throws JavaModelException, BadLoca "package test1;\n" + "public class B {\n" + " private T t;\n" + - " public inspect(UU u) { return u; }\n" + + " public UU inspect(UU u) { return u; }\n" + "}\n" ); }