This is an automated email from the ASF dual-hosted git repository.
lkishalmi 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 c2b8bf6 [NETBEANS-4842] Bugfix: 'Go To Source' broken with JUnit5 and
Gradle (#2401)
c2b8bf6 is described below
commit c2b8bf67dcfb9b321e7d046d2de0764e1813504d
Author: ratcash <[email protected]>
AuthorDate: Fri Sep 25 21:40:19 2020 +0200
[NETBEANS-4842] Bugfix: 'Go To Source' broken with JUnit5 and Gradle (#2401)
* Fix for NETBEANS-4842
* look for char, instead of String.
---
.../modules/gradle/java/api/output/LocationOpener.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git
a/java/gradle.java/src/org/netbeans/modules/gradle/java/api/output/LocationOpener.java
b/java/gradle.java/src/org/netbeans/modules/gradle/java/api/output/LocationOpener.java
index 0974c80..8e8a60b 100644
---
a/java/gradle.java/src/org/netbeans/modules/gradle/java/api/output/LocationOpener.java
+++
b/java/gradle.java/src/org/netbeans/modules/gradle/java/api/output/LocationOpener.java
@@ -80,7 +80,17 @@ public final class LocationOpener {
}
}
- private int getMethodLine(final FileObject fo, final String methodName) {
+ private static String stripMethodParams(String methodNameWithParams) {
+ final int paramsIndex = methodNameWithParams.indexOf('(');
+ String cleanName = methodNameWithParams;
+ if (paramsIndex > 0) {
+ cleanName = methodNameWithParams.substring(0, paramsIndex);
+ }
+ return cleanName;
+ }
+
+ private int getMethodLine(final FileObject fo, final String
methodNameWithParams) {
+ String methodName = stripMethodParams(methodNameWithParams);
final int[] line = new int[1];
JavaSource javaSource = JavaSource.forFileObject(fo);
if (javaSource != null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists