Skip to content

Commit

Permalink
Debug view display bugfix
Browse files Browse the repository at this point in the history
#592

This commit provides fix for not showing primitive arrays and lambdas
correctly in debug view.

Fixes : #592
  • Loading branch information
SougandhS committed Jan 19, 2025
1 parent e9c7fa9 commit 69062bd
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2024 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -507,7 +507,14 @@ public String getValueText(IJavaValue value) throws DebugException {
buffer.append(' ');
}
}

if (buffer.isEmpty() && value instanceof IJavaArray javaArray) {
String label = javaArray.getJavaType().getName();
label = adjustTypeNameForArrayIndex(label, javaArray.getLength());
if (label != null) {
buffer.append(label);
buffer.append(' ');
}
}
// Put double quotes around Strings
if (valueString != null && (isString || valueString.length() > 0)) {
if (isString) {
Expand Down Expand Up @@ -1917,11 +1924,20 @@ public String removeQualifierFromGenericName(String qualifiedName) {
/**
* Return the simple name from a qualified name (non-generic)
*/
@SuppressWarnings("nls")
private String getSimpleName(String qualifiedName) {
int index = qualifiedName.lastIndexOf('.');
if (index >= 0) {
if (index >= 0 && !qualifiedName.contains("$Lambda.")) {
return qualifiedName.substring(index + 1);
}
if (index >= 0 && qualifiedName.contains("$Lambda.")) {
int indexLambdaStart = qualifiedName.indexOf("$Lambda.");
String temp = qualifiedName.substring(indexLambdaStart + 1);
if (temp.indexOf('.') != -1) {
temp = temp.substring(0, temp.indexOf('.'));
return temp;
}
}
return qualifiedName;
}

Expand Down

0 comments on commit 69062bd

Please sign in to comment.