From 87f5878d43032f0a617cfe369ba0c2f0049f57bd Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Thu, 11 Feb 2016 14:39:13 +0300 Subject: [PATCH] cleanup --- .../impl/watch/StackFrameDescriptorImpl.java | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StackFrameDescriptorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StackFrameDescriptorImpl.java index ffef62199dae..bc148bf98cad 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StackFrameDescriptorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StackFrameDescriptorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,32 +78,22 @@ public class StackFrameDescriptorImpl extends NodeDescriptorImpl implements Stac } myMethodOccurrence = tracker.getMethodOccurrence(myUiIndex, myLocation.method()); myIsSynthetic = DebuggerUtils.isSynthetic(myMethodOccurrence.getMethod()); - ApplicationManager.getApplication().runReadAction(new Runnable() { - @Override - public void run() { - mySourcePosition = ContextUtil.getSourcePosition(StackFrameDescriptorImpl.this); - final PsiFile file = mySourcePosition != null? mySourcePosition.getFile() : null; - if (file == null) { - myIsInLibraryContent = true; - } - else { - myBackgroundColor = FileColorManager.getInstance(file.getProject()).getFileColor(file); - - final ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(getDebugProcess().getProject()).getFileIndex(); - final VirtualFile vFile = file.getVirtualFile(); - myIsInLibraryContent = vFile != null && (projectFileIndex.isInLibraryClasses(vFile) || projectFileIndex.isInLibrarySource(vFile)); - } + ApplicationManager.getApplication().runReadAction(() -> { + mySourcePosition = ContextUtil.getSourcePosition(this); + final PsiFile file = mySourcePosition != null? mySourcePosition.getFile() : null; + if (file == null) { + myIsInLibraryContent = true; + } + else { + myBackgroundColor = FileColorManager.getInstance(file.getProject()).getFileColor(file); + + final ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(getDebugProcess().getProject()).getFileIndex(); + final VirtualFile vFile = file.getVirtualFile(); + myIsInLibraryContent = vFile != null && (projectFileIndex.isInLibraryClasses(vFile) || projectFileIndex.isInLibrarySource(vFile)); } }); } - catch (InternalException e) { - LOG.info(e); - myLocation = null; - myMethodOccurrence = tracker.getMethodOccurrence(0, null); - myIsSynthetic = false; - myIsInLibraryContent = false; - } - catch (EvaluateException e) { + catch (InternalException | EvaluateException e) { LOG.info(e); myLocation = null; myMethodOccurrence = tracker.getMethodOccurrence(0, null);