Skip to content

Commit ede8e3e

Browse files
committed
rework after review
1 parent d360f25 commit ede8e3e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageDebugInfoProvider.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ private class NativeImageDebugCodeInfo implements DebugCodeInfo {
9494
private Path fullFilePath;
9595
private final Path cachePath;
9696

97+
@SuppressWarnings("try")
9798
NativeImageDebugCodeInfo(HostedMethod method, CompilationResult compilation) {
9899
this.method = method;
99100
HostedType declaringClass = method.getDeclaringClass();
@@ -102,7 +103,7 @@ private class NativeImageDebugCodeInfo implements DebugCodeInfo {
102103
this.compilation = compilation;
103104
SourceManager sourceManager = ImageSingletons.lookup(SourceManager.class);
104105
try (DebugContext.Scope s = debugContext.scope("DebugCodeInfo", declaringClass)) {
105-
fullFilePath = ImageSingletons.lookup(SourceManager.class).findAndCacheSource(javaType, clazz, debugContext);
106+
fullFilePath = sourceManager.findAndCacheSource(javaType, clazz, debugContext);
106107
this.cachePath = sourceManager.getCachePathForSource(javaType);
107108
} catch (Throwable e) {
108109
throw debugContext.handle(e);
@@ -300,6 +301,7 @@ public int line() {
300301
return -1;
301302
}
302303

304+
@SuppressWarnings("try")
303305
private void computeFullFilePathAndCachePath() {
304306
ResolvedJavaType declaringClass = method.getDeclaringClass();
305307
Class<?> clazz = null;
@@ -316,9 +318,10 @@ private void computeFullFilePathAndCachePath() {
316318
if (declaringClass instanceof AnalysisType) {
317319
declaringClass = ((AnalysisType) declaringClass).getWrapped();
318320
}
321+
SourceManager sourceManager = ImageSingletons.lookup(SourceManager.class);
319322
try (DebugContext.Scope s = debugContext.scope("DebugCodeInfo", declaringClass)) {
320-
fullFilePath = ImageSingletons.lookup(SourceManager.class).findAndCacheSource(declaringClass, clazz, debugContext);
321-
cachePath = ImageSingletons.lookup(SourceManager.class).getCachePathForSource(declaringClass);
323+
fullFilePath = sourceManager.findAndCacheSource(declaringClass, clazz, debugContext);
324+
cachePath = sourceManager.getCachePathForSource(declaringClass);
322325
} catch (Throwable e) {
323326
throw debugContext.handle(e);
324327
}

0 commit comments

Comments
 (0)