代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openjdk-1.8.0 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
index c481ea5d..f1f92b6a 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
@@ -297,6 +297,29 @@ public class TypeAnnotationPosition {
isValidOffset = true;
}
+ public boolean hasCatchType() {
+ return exception_index < 0 && exception_index != Integer.MIN_VALUE;
+ }
+
+ public int getCatchType() {
+ Assert.check(hasCatchType(),
+ "exception_index does not contain valid catch info");
+ return ((-this.exception_index) - 1) & 0xff ;
+ }
+
+ public int getStartPos() {
+ Assert.check(hasCatchType(),
+ "exception_index does not contain valid catch info");
+ return ((-this.exception_index) - 1) >> 8;
+ }
+
+ public void setCatchInfo(final int catchType, final int startPos) {
+ Assert.check(this.exception_index < 0,
+ "exception_index already contains a bytecode index");
+ Assert.check(catchType >= 0, "Expected a valid catch type");
+ this.exception_index = -((catchType | startPos << 8) + 1);
+ }
+
/**
* Decode the binary representation for a type path and set
* the {@code location} field.
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
index 738c5a1d..622a5942 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
@@ -2135,14 +2135,16 @@ public class Code {
// same location; updating one is enough.
// Use -666 as a marker that the exception_index was already updated.
if (p.type_index != -666) {
- p.exception_index = findExceptionIndex(p.type_index);
+ p.exception_index = findExceptionIndex(p);
p.type_index = -666;
}
}
}
}
- private int findExceptionIndex(int catchType) {
+ private int findExceptionIndex(TypeAnnotationPosition p) {
+ final int catchType = p.getCatchType();
+ final int startPos = p.getStartPos();
if (catchType == Integer.MIN_VALUE) {
// We didn't set the catch type index correctly.
// This shouldn't happen.
@@ -2154,8 +2156,9 @@ public class Code {
for (int i = 0; i < len; ++i) {
char[] catchEntry = iter.head;
iter = iter.tail;
- char ct = catchEntry[3];
- if (catchType == ct) {
+ int ct = catchEntry[3];
+ int sp = catchEntry[0];
+ if (catchType == ct && sp == startPos) {
return i;
}
}
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
index 4cc7fb7b..f79d3eee 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
@@ -1609,7 +1609,7 @@ public class Gen extends JCTree.Visitor {
if (subCatch.type.isAnnotated()) {
for (Attribute.TypeCompound tc :
subCatch.type.getAnnotationMirrors()) {
- tc.position.type_index = catchType;
+ tc.position.setCatchInfo(catchType, startpc);
}
}
}
@@ -1626,7 +1626,7 @@ public class Gen extends JCTree.Visitor {
if (subCatch.type.isAnnotated()) {
for (Attribute.TypeCompound tc :
subCatch.type.getAnnotationMirrors()) {
- tc.position.type_index = catchType;
+ tc.position.setCatchInfo(catchType, startpc);
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。