langtools/src/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java
equal
deleted
inserted
replaced
63 NoteKind(String text) { |
63 NoteKind(String text) { |
64 this.text = text; |
64 this.text = text; |
65 } |
65 } |
66 public abstract boolean match(LocalVariableTypeTable_attribute.Entry entry, int pc); |
66 public abstract boolean match(LocalVariableTypeTable_attribute.Entry entry, int pc); |
67 public final String text; |
67 public final String text; |
68 }; |
68 } |
69 |
69 |
70 static LocalVariableTypeTableWriter instance(Context context) { |
70 static LocalVariableTypeTableWriter instance(Context context) { |
71 LocalVariableTypeTableWriter instance = context.get(LocalVariableTypeTableWriter.class); |
71 LocalVariableTypeTableWriter instance = context.get(LocalVariableTypeTableWriter.class); |
72 if (instance == null) |
72 if (instance == null) |
73 instance = new LocalVariableTypeTableWriter(context); |
73 instance = new LocalVariableTypeTableWriter(context); |
80 classWriter = ClassWriter.instance(context); |
80 classWriter = ClassWriter.instance(context); |
81 } |
81 } |
82 |
82 |
83 public void reset(Code_attribute attr) { |
83 public void reset(Code_attribute attr) { |
84 codeAttr = attr; |
84 codeAttr = attr; |
85 pcMap = new HashMap<Integer, List<LocalVariableTypeTable_attribute.Entry>>(); |
85 pcMap = new HashMap<>(); |
86 LocalVariableTypeTable_attribute lvt = |
86 LocalVariableTypeTable_attribute lvt = |
87 (LocalVariableTypeTable_attribute) (attr.attributes.get(Attribute.LocalVariableTypeTable)); |
87 (LocalVariableTypeTable_attribute) (attr.attributes.get(Attribute.LocalVariableTypeTable)); |
88 if (lvt == null) |
88 if (lvt == null) |
89 return; |
89 return; |
90 |
90 |
144 } |
144 } |
145 |
145 |
146 private void put(int pc, LocalVariableTypeTable_attribute.Entry entry) { |
146 private void put(int pc, LocalVariableTypeTable_attribute.Entry entry) { |
147 List<LocalVariableTypeTable_attribute.Entry> list = pcMap.get(pc); |
147 List<LocalVariableTypeTable_attribute.Entry> list = pcMap.get(pc); |
148 if (list == null) { |
148 if (list == null) { |
149 list = new ArrayList<LocalVariableTypeTable_attribute.Entry>(); |
149 list = new ArrayList<>(); |
150 pcMap.put(pc, list); |
150 pcMap.put(pc, list); |
151 } |
151 } |
152 if (!list.contains(entry)) |
152 if (!list.contains(entry)) |
153 list.add(entry); |
153 list.add(entry); |
154 } |
154 } |