|
5 | 5 | import java.util.Collection; |
6 | 6 | import java.util.ArrayList; |
7 | 7 | import java.util.Arrays; |
8 | | -import java.util.HashMap; |
9 | 8 | import java.util.HashSet; |
10 | 9 | import java.util.List; |
11 | 10 | import java.util.Set; |
@@ -720,66 +719,6 @@ public IDebugEntity[] getIndexedVariables(long ID) { |
720 | 719 | return GlobalIDebugManagerHolder.debugManager.getVariables(ID, IDebugEntity.DebugEntityType.INDEXED); |
721 | 720 | } |
722 | 721 |
|
723 | | - static private class KlassMap { |
724 | | - /** |
725 | | - * original -> original |
726 | | - * |
727 | | - * transformed -> canonicalized as per fs config |
728 | | - */ |
729 | | - final public OriginalAndTransformedString sourceName; |
730 | | - final public HashMap<Integer, Location> lineMap; |
731 | | - private final ClassObjectReference objRef; |
732 | | - |
733 | | - @SuppressWarnings("unused") |
734 | | - final public ReferenceType refType; |
735 | | - |
736 | | - private KlassMap(Config config, ReferenceType refType) throws AbsentInformationException { |
737 | | - objRef = refType.classObject(); |
738 | | - |
739 | | - String sourceName = refType.sourceName(); |
740 | | - var lineMap = new HashMap<Integer, Location>(); |
741 | | - |
742 | | - for (var loc : refType.allLineLocations()) { |
743 | | - lineMap.put(loc.lineNumber(), loc); |
744 | | - } |
745 | | - |
746 | | - this.sourceName = new OriginalAndTransformedString( |
747 | | - sourceName, |
748 | | - Config.canonicalizeFileName(sourceName) |
749 | | - ); |
750 | | - this.lineMap = lineMap; |
751 | | - this.refType = refType; |
752 | | - } |
753 | | - |
754 | | - /** |
755 | | - * May return null if ReferenceType throws an AbsentInformationException, which the caller |
756 | | - * should interpret as "we can't do anything meaningful with this file" |
757 | | - */ |
758 | | - static KlassMap maybeNull_tryBuildKlassMap(Config config, ReferenceType refType) { |
759 | | - try { |
760 | | - return new KlassMap(config, refType); |
761 | | - } |
762 | | - catch (AbsentInformationException e) { |
763 | | - return null; |
764 | | - } |
765 | | - catch (Throwable e) { |
766 | | - e.printStackTrace(); |
767 | | - System.exit(1); |
768 | | - } |
769 | | - |
770 | | - // unreachable |
771 | | - return null; |
772 | | - } |
773 | | - |
774 | | - @Override |
775 | | - public boolean equals(Object e) { |
776 | | - if (e instanceof KlassMap) { |
777 | | - return ((KlassMap)e).sourceName.equals(this.sourceName); |
778 | | - } |
779 | | - return false; |
780 | | - } |
781 | | - } |
782 | | - |
783 | 722 | private AtomicInteger breakpointID = new AtomicInteger(); |
784 | 723 | private int nextBreakpointID() { |
785 | 724 | return breakpointID.incrementAndGet(); |
@@ -875,7 +814,7 @@ private IBreakpoint[] __internal__bindBreakpoints(String serverAbsPath, BpLineAn |
875 | 814 | List<KlassMap> garbageCollectedKlassMaps = new ArrayList<>(); |
876 | 815 |
|
877 | 816 | for (KlassMap mapping : klassMapSet) { |
878 | | - if (mapping.objRef.isCollected()) { |
| 817 | + if (mapping.isCollected()) { |
879 | 818 | // This still leaves us with a little race where it gets collected after this, |
880 | 819 | // but before we start adding breakpoints to the gc'd class. |
881 | 820 | garbageCollectedKlassMaps.add(mapping); |
|
0 commit comments