/
JApiCompatibilityChange.java
109 lines (98 loc) · 5.13 KB
/
JApiCompatibilityChange.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package japicmp.model;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlEnum;
@XmlEnum
public enum JApiCompatibilityChange {
ANNOTATION_DEPRECATED_ADDED(true, true, JApiSemanticVersionLevel.MINOR),
CLASS_REMOVED(false, false, JApiSemanticVersionLevel.MAJOR),
CLASS_NOW_ABSTRACT(false, false, JApiSemanticVersionLevel.MAJOR),
CLASS_NOW_FINAL(false, false, JApiSemanticVersionLevel.MAJOR),
CLASS_NO_LONGER_PUBLIC(false, false, JApiSemanticVersionLevel.MAJOR),
CLASS_TYPE_CHANGED(false, false, JApiSemanticVersionLevel.MAJOR),
CLASS_NOW_CHECKED_EXCEPTION(true, false, JApiSemanticVersionLevel.MINOR),
CLASS_LESS_ACCESSIBLE(false, false, JApiSemanticVersionLevel.MAJOR),
SUPERCLASS_REMOVED(false, false, JApiSemanticVersionLevel.MAJOR),
SUPERCLASS_ADDED(true, true, JApiSemanticVersionLevel.MINOR),
SUPERCLASS_MODIFIED_INCOMPATIBLE(false, false, JApiSemanticVersionLevel.MAJOR),
INTERFACE_ADDED(true, true, JApiSemanticVersionLevel.MINOR),
INTERFACE_REMOVED(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_REMOVED(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_REMOVED_IN_SUPERCLASS(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_LESS_ACCESSIBLE(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_LESS_ACCESSIBLE_THAN_IN_SUPERCLASS(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_IS_STATIC_AND_OVERRIDES_NOT_STATIC(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_RETURN_TYPE_CHANGED(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_NOW_ABSTRACT(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_NOW_FINAL(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_NOW_STATIC(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_NO_LONGER_STATIC(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_NOW_VARARGS(true, true, JApiSemanticVersionLevel.MINOR),
METHOD_NO_LONGER_VARARGS(true, false, JApiSemanticVersionLevel.MINOR),
METHOD_ADDED_TO_INTERFACE(true, false, JApiSemanticVersionLevel.MINOR),
METHOD_ADDED_TO_PUBLIC_CLASS(true, true, JApiSemanticVersionLevel.PATCH),
METHOD_NOW_THROWS_CHECKED_EXCEPTION(true, false, JApiSemanticVersionLevel.MINOR),
METHOD_NO_LONGER_THROWS_CHECKED_EXCEPTION(true, false, JApiSemanticVersionLevel.MINOR),
METHOD_ABSTRACT_ADDED_TO_CLASS(true, false, JApiSemanticVersionLevel.MINOR),
METHOD_ABSTRACT_ADDED_IN_SUPERCLASS(true, false, JApiSemanticVersionLevel.MINOR),
METHOD_ABSTRACT_ADDED_IN_IMPLEMENTED_INTERFACE(true, false, JApiSemanticVersionLevel.MINOR),
METHOD_DEFAULT_ADDED_IN_IMPLEMENTED_INTERFACE(true, true, JApiSemanticVersionLevel.MINOR),
METHOD_NEW_DEFAULT(false, false, JApiSemanticVersionLevel.MAJOR),
METHOD_ABSTRACT_NOW_DEFAULT(false, false, JApiSemanticVersionLevel.MAJOR),
FIELD_STATIC_AND_OVERRIDES_STATIC(false, false, JApiSemanticVersionLevel.MAJOR),
FIELD_LESS_ACCESSIBLE_THAN_IN_SUPERCLASS(false, false, JApiSemanticVersionLevel.MAJOR),
FIELD_NOW_FINAL(false, false, JApiSemanticVersionLevel.MAJOR),
FIELD_NOW_STATIC(false, false, JApiSemanticVersionLevel.MAJOR),
FIELD_NO_LONGER_STATIC(false, false, JApiSemanticVersionLevel.MAJOR),
FIELD_TYPE_CHANGED(false, false, JApiSemanticVersionLevel.MAJOR),
FIELD_REMOVED(false, false, JApiSemanticVersionLevel.MAJOR),
FIELD_REMOVED_IN_SUPERCLASS(false, false, JApiSemanticVersionLevel.MAJOR),
FIELD_LESS_ACCESSIBLE(false, false, JApiSemanticVersionLevel.MAJOR),
CONSTRUCTOR_REMOVED(false, false, JApiSemanticVersionLevel.MAJOR),
CONSTRUCTOR_LESS_ACCESSIBLE(false, false, JApiSemanticVersionLevel.MAJOR);
private boolean binaryCompatible;
private boolean sourceCompatible;
private JApiSemanticVersionLevel semanticVersionLevel;
private Boolean binaryCompatibleOverridden = null;
private Boolean sourceCompatibleOverridden = null;
private JApiSemanticVersionLevel semanticVersionLevelOverridden = null;
JApiCompatibilityChange(boolean binaryCompatible, boolean sourceCompatible,
JApiSemanticVersionLevel jApiSemanticVersionLevel) {
this.binaryCompatible = binaryCompatible;
this.sourceCompatible = sourceCompatible;
this.semanticVersionLevel = jApiSemanticVersionLevel;
}
@XmlAttribute(name = "binaryCompatible")
public boolean isBinaryCompatible() {
if (binaryCompatibleOverridden != null) {
return binaryCompatibleOverridden;
}
return binaryCompatible;
}
@XmlAttribute(name = "sourceCompatible")
public boolean isSourceCompatible() {
if (sourceCompatibleOverridden != null) {
return sourceCompatibleOverridden;
}
return sourceCompatible;
}
public JApiSemanticVersionLevel getSemanticVersionLevel() {
if (semanticVersionLevelOverridden != null) {
return semanticVersionLevelOverridden;
}
return semanticVersionLevel;
}
public void setBinaryCompatible(boolean binaryCompatible) {
this.binaryCompatibleOverridden = binaryCompatible;
}
public void setSourceCompatible(boolean sourceCompatible) {
this.sourceCompatibleOverridden = sourceCompatible;
}
public void setSemanticVersionLevel(JApiSemanticVersionLevel semanticVersionLevel) {
this.semanticVersionLevelOverridden = semanticVersionLevel;
}
public void resetOverrides() {
this.binaryCompatibleOverridden = null;
this.sourceCompatibleOverridden = null;
this.semanticVersionLevelOverridden = null;
}
}