Skip to content

Commit e0f2bd2

Browse files
prioritize lookup the project source code during debugging (#463)
* prioritize lookup the project source code during debugging * fix null check
1 parent 42f9ac7 commit e0f2bd2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/InlineValueHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private static IMethod findMethodInLocalTypes(IMethod enclosingMethod, int stopp
166166
*/
167167
private static Position getPosition(IBuffer buffer, int offset) {
168168
int[] result = JsonRpcHelpers.toLine(buffer, offset);
169-
if (result == null && result.length < 1) {
169+
if (result == null || result.length < 1) {
170170
return new Position(-1, -1);
171171
}
172172

com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/JdtUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ public static ISourceContainer[] getSourceContainers(String projectName) {
213213
projects.stream().distinct().map(project -> JdtUtils.getJavaProject(project))
214214
.filter(javaProject -> javaProject != null && javaProject.exists())
215215
.forEach(javaProject -> {
216-
// Add source containers associated with the project's runtime classpath entries.
217-
containers.addAll(Arrays.asList(getSourceContainers(javaProject, calculated)));
218216
// Add source containers associated with the project's source folders.
219217
containers.add(new JavaProjectSourceContainer(javaProject));
218+
// Add source containers associated with the project's runtime classpath entries.
219+
containers.addAll(Arrays.asList(getSourceContainers(javaProject, calculated)));
220220
});
221221

222222
return containers.toArray(new ISourceContainer[0]);

0 commit comments

Comments
 (0)