ICU-10396 Updated ICU4J API report tools to support enum constants and generics. Added the API signature files generated with the new code back to ICU 4.8, and deleted old API signature files.

X-SVN-Rev: 34643
This commit is contained in:
Yoshito Umaoka 2013-11-06 20:52:01 +00:00
parent 6eede10a42
commit 0ba03b9663
33 changed files with 107 additions and 126 deletions

27
.gitattributes vendored
View File

@ -588,28 +588,11 @@ icu4j/samples/src/com/ibm/icu/samples/iuc/data/reshello/mt.res -text
icu4j/samples/src/com/ibm/icu/samples/iuc/data/reshello/res_index.res -text
icu4j/samples/src/com/ibm/icu/samples/iuc/data/reshello/root.res -text
icu4j/tools/build/.settings/org.eclipse.core.resources.prefs -text
icu4j/tools/build/icu4j28.api.gz -text
icu4j/tools/build/icu4j30.api.gz -text
icu4j/tools/build/icu4j32.api.gz -text
icu4j/tools/build/icu4j34.api.gz -text
icu4j/tools/build/icu4j341.api.gz -text
icu4j/tools/build/icu4j342.api.gz -text
icu4j/tools/build/icu4j343.api.gz -text
icu4j/tools/build/icu4j36.api.gz -text
icu4j/tools/build/icu4j38.api.gz -text
icu4j/tools/build/icu4j381.api.gz -text
icu4j/tools/build/icu4j400.api.gz -text
icu4j/tools/build/icu4j401.api.gz -text
icu4j/tools/build/icu4j42.api.gz -text
icu4j/tools/build/icu4j421.api.gz -text
icu4j/tools/build/icu4j44.api.gz -text
icu4j/tools/build/icu4j44.api2.gz -text
icu4j/tools/build/icu4j46.api2.gz -text
icu4j/tools/build/icu4j48.api2.gz -text
icu4j/tools/build/icu4j49.api2.gz -text
icu4j/tools/build/icu4j50.api2.gz -text
icu4j/tools/build/icu4j51.api2.gz -text
icu4j/tools/build/icu4j52.api2.gz -text
icu4j/tools/build/icu4j48.api3.gz -text
icu4j/tools/build/icu4j49.api3.gz -text
icu4j/tools/build/icu4j50.api3.gz -text
icu4j/tools/build/icu4j51.api3.gz -text
icu4j/tools/build/icu4j52.api3.gz -text
icu4j/tools/build/manifest.stub -text
icu4j/tools/misc/.settings/org.eclipse.core.resources.prefs -text
icu4j/tools/misc/manifest.stub -text

View File

@ -996,7 +996,7 @@
</packageset>
<doclet name="com.ibm.icu.dev.tool.docs.GatherAPIData" path="${icu4j.build-tools.jar}">
<param name="-name" value="ICU4J ${icu4j.impl.version}"/>
<param name="-output" value="${out.dir}/icu4j${api.report.version}.api2"/>
<param name="-output" value="${out.dir}/icu4j${api.report.version}.api3"/>
<param name="-internal"/>
<param name="-version"/>
<param name="-gzip"/>
@ -1009,9 +1009,9 @@
classpath="${icu4j.build-tools.jar}"
failonerror="true">
<arg value="-old:" />
<arg value="${icu4j.build-tools.dir}/icu4j${api.report.prev.version}.api2.gz" />
<arg value="${icu4j.build-tools.dir}/icu4j${api.report.prev.version}.api3.gz" />
<arg value="-new:" />
<arg value="${out.dir}/icu4j${api.report.version}.api2.gz" />
<arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
<arg value="-html" />
<arg value="-out:" />
<arg value="${out.dir}/icu4j_compare_${api.report.prev.version}_${api.report.version}.html" />
@ -1070,7 +1070,7 @@
<arg value="Draft"/>
<arg value="-o"/>
<arg value="${out.dir}/draftAPIs.html"/>
<arg value="${out.dir}/icu4j${api.report.version}.api2.gz" />
<arg value="${out.dir}/icu4j${api.report.version}.api3.gz" />
</java>
</target>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:772a1e5195bbdcd2ac5fdf7153af71ca0a9dd934118bfbdb17a4388c4e3af6da
size 19566

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d79fcac17e325a019a52ffdfb8e1fdd8eca4079faf05149a8710751d77934a73
size 20672

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:535e05f6624f372fd241b1f2e5d4feb90ccff5fdaf732eb0df52acac9f5d1f29
size 21416

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f807843ac5fb8b32a9b7f13a89779d3aa712521a9c35d23c2352bc7835ee9050
size 23103

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:044f24883f55361bf4d78e63191f1600d64453b7405f93978fbe63a5722fe1b3
size 23106

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f76f514fd1344a4216b240345dbf1e93625e7a3c9f40c9e75939954c19526462
size 23134

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3af60a55b9cdc943952832f7a142eaeac21c51d4b16fb2cf977244553248fd08
size 23132

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a2a384467160d3d30872209c1b60eeaa233365d7a25d637218e580f740fbce45
size 26926

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db98896cfc89946ae3a58c1c36c1bba9ca44bc0814cc6592d1b665cf9839344f
size 30589

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1c59f72974592ea9bd43564f9018904a362a1692aa431164548c7cb758d06c55
size 30708

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0b04f969c3f732686089229e08fbb3187e363a456311ab011c4e9555d003c97d
size 32245

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7cc77b7302c1258e5ca116a37061a10b0f3a7f1810213b48b5c7df25c193764e
size 32248

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5ca8be4f31d1245ef194629faa635726407178b0e3c03cdb1acfecfd14fa477a
size 33596

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:72b71094b20d55c82d680b99b7a1f380198c003d45b56068798a2ed7aaed2522
size 33598

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f064a693acf1517cd89add3d3dff79284ace6d7e6cf8a5eb2ca2698cab192fcf
size 36216

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b6db852067ffdd486e8b114ec12babfd9b794c04e3a8136cf2a8abec8e764ec6
size 35967

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ff116d85ce08fa4d080898ea2f8c4fa7fab06f1dab745dba5c76d8509f9ee7bb
size 39962

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1a1756e0f5d18689bef0e08700aaa33c722f2145908c0638f3d6bce23c6cbd5d
size 42998

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d272c31e708adcc17544a7a3113436624ad9ed4fca304ac2b0b1565290f0b799
size 44040

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0703dff2fb02a5b6808fbb355548d96cded33c351282aed5a82a1e3926cb862a
size 44852

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0e6d5a58f28906fbe9d3c51b03c040ac0d98b140067e118e764e7e97db08cbd9
size 46314

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9d42ac8df49b0f206fc95a87fa7981ea47950fa126cb97ebd617936bd228e7de
size 45209

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:81885b27524422574be17a496dee260fdd67463fd81e33d6a9620bcd83cad2b0
size 46745

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e9123db86ebf82488fbf3433f1a3ec947c31dfed7ff2e106146e459b45e3a10b
size 45752

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:56e70bfc577dde6d3bea8e0d3ffd7fb77f776c2f7cce5dec197a652e27ab732b
size 47569

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8e5d77dd10547e6cc26ea345b5e816c809068d70e4397470c8a5bf92f5997d89
size 47776

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1f854140b68580ba8a0c836b6f6f29ec08904aa3d60a6a8f4433a8fe0a931bca
size 49836

View File

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 2004-2010, International Business Machines Corporation and *
* Copyright (C) 2004-2013, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -141,7 +141,7 @@ public final class APIData {
boolean internal = false;
String path = "src/com/ibm/icu/dev/tool/docs/";
String fn = "icu4j341.api.gz";
String fn = "icu4j52.api3.gz";
if (args.length == 0) {
args = new String[] { "-file", fn };
}

View File

@ -33,7 +33,7 @@ class APIInfo {
public static final int SYN = 4, SYN_SYNCHRONIZED = 1;
public static final int ABS = 5, ABS_ABSTRACT = 1;
public static final int CAT = 6, CAT_CLASS = 0, CAT_FIELD = 1, CAT_CONSTRUCTOR = 2,
CAT_METHOD = 3;
CAT_METHOD = 3, CAT_ENUM = 4, CAT_ENUM_CONSTANT = 5;
public static final int PAK = 7;
public static final int CLS = 8;
public static final int NAM = 9;
@ -42,7 +42,7 @@ class APIInfo {
public static final int NUM_TYPES = 11;
// the separator between tokens in the data file
public int[] masks = { 0x7, 0x3, 0x1, 0x1, 0x1, 0x1, 0x3 };
public int[] masks = { 0x7, 0x3, 0x1, 0x1, 0x1, 0x1, 0x7 };
public int[] shifts = { 0, 3, 5, 6, 7, 8, 9 };
public static final char SEP = ';';
@ -100,6 +100,8 @@ class APIInfo {
public void setField() { setType(CAT, CAT_FIELD); }
public void setConstructor() { setType(CAT, CAT_CONSTRUCTOR); }
public void setMethod() { setType(CAT, CAT_METHOD); }
public void setEnum() { setType(CAT, CAT_ENUM); }
public void setEnumConstant() { setType(CAT, CAT_ENUM_CONSTANT); }
public void setPackage(String val) { setType(PAK, val); }
public void setClassName(String val) { setType(CLS, val); }
@ -124,6 +126,8 @@ class APIInfo {
public boolean isField() { return getVal(CAT) == CAT_FIELD; }
public boolean isConstructor() { return getVal(CAT) == CAT_CONSTRUCTOR; }
public boolean isMethod() { return getVal(CAT) == CAT_METHOD; }
public boolean isEnum() { return getVal(CAT) == CAT_ENUM; }
public boolean isEnumConstant() { return getVal(CAT) == CAT_ENUM_CONSTANT; }
public String getPackageName() { return get(PAK, true); }
public String getClassName() { return get(CLS, true); }
@ -330,8 +334,8 @@ class APIInfo {
APIInfo rhi = (APIInfo)rhs;
int result = lhi.pack.compareTo(rhi.pack);
if (result == 0) {
result = (lhi.getVal(CAT) == CAT_CLASS ? lhi.name : lhi.cls)
.compareTo(rhi.getVal(CAT) == CAT_CLASS ? rhi.name : rhi.cls);
result = (lhi.getVal(CAT) == CAT_CLASS || lhi.getVal(CAT) == CAT_ENUM ? lhi.name : lhi.cls)
.compareTo(rhi.getVal(CAT) == CAT_CLASS || rhi.getVal(CAT) == CAT_ENUM ? rhi.name : rhi.cls);
if (result == 0) {
result = lhi.getVal(CAT)- rhi.getVal(CAT);
if (result == 0) {
@ -435,7 +439,7 @@ class APIInfo {
String xsig = sig;
if (!detail) {
final String ICUPACK = "com.ibm.icu.";
StringBuffer tbuf = new StringBuffer();
StringBuilder tbuf = new StringBuilder();
for (int i = 0; i < sig.length();) {
int n = sig.indexOf(ICUPACK, i);
if (n == -1) {
@ -466,7 +470,7 @@ class APIInfo {
color = "gray";
}
if (color != null) {
s = "<span style='color:" + color + "'>" + s + "</span>";
s = "<span style='color:" + color + "'>" + prepText(s, html) + "</span>";
}
}
}
@ -483,48 +487,86 @@ class APIInfo {
} else {
buf.append("class ");
}
if (html) {
buf.append("<i>");
}
if (html) {
buf.append("<i>");
}
if (cls.length() > 0) {
buf.append(cls);
buf.append(prepText(cls, html));
buf.append('.');
}
buf.append(name);
if (html) {
buf.append("</i>");
}
buf.append(prepText(name, html));
if (html) {
buf.append("</i>");
}
if (detail) {
buf.append(' ');
buf.append(sig);
buf.append(prepText(sig, html));
}
break;
case CAT_ENUM:
buf.append("enum ");
if (html) {
buf.append("<i>");
}
if (cls.length() > 0) {
buf.append(prepText(cls, html));
buf.append('.');
}
buf.append(prepText(name, html));
if (html) {
buf.append("</i>");
}
if (detail) {
buf.append(' ');
buf.append(prepText(sig, html));
}
break;
case CAT_FIELD:
buf.append(xsig);
case CAT_ENUM_CONSTANT:
buf.append(prepText(xsig, html));
buf.append(' ');
buf.append(name);
buf.append(prepText(name, html));
break;
case CAT_METHOD:
case CAT_CONSTRUCTOR:
int n = xsig.indexOf('(');
if (n > 0) {
buf.append(xsig.substring(0, n));
buf.append(prepText(xsig.substring(0, n), html));
buf.append(' ');
} else {
n = 0;
}
if (html) {
buf.append("<i>" + name + "</i>");
} else {
buf.append(name);
}
buf.append(xsig.substring(n));
if (html) {
buf.append("<i>" + prepText(name, html) + "</i>");
} else {
buf.append(name);
}
buf.append(prepText(xsig.substring(n), html));
break;
}
}
private static String prepText(String text, boolean html) {
if (html && (text.indexOf('<') >= 0 || text.indexOf('>') >= 0)) {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (c == '<') {
buf.append("&lt;");
} else if (c == '>') {
buf.append("&gt;");
} else {
buf.append(c);
}
}
text = buf.toString();
}
return text;
}
public void println(PrintWriter pw, boolean detail, boolean html) {
print(pw, detail, html);
pw.println();
@ -551,7 +593,7 @@ class APIInfo {
{ "", "final" },
{ "", "synchronized" },
{ "", "abstract" },
{ "class", "field", "constructor", "method" },
{ "class", "field", "constructor", "method", "enum", "enum constant" },
null,
null,
null,
@ -566,7 +608,7 @@ class APIInfo {
{ "NF", "FN" },
{ "NS", "SY" },
{ "NA", "AB" },
{ "L", "F", "C", "M" },
{ "L", "F", "C", "M", "E", "K" },
null,
null,
null,

View File

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 2004-2012, International Business Machines Corporation and *
* Copyright (C) 2004-2013, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -211,6 +211,7 @@ public class GatherAPIData {
doDocs(cdoc.fields());
doDocs(cdoc.constructors());
doDocs(cdoc.methods());
doDocs(cdoc.enumConstants());
// don't call this to iterate over inner classes,
// root.classes already includes them
// doDocs(cdoc.innerClasses());
@ -361,7 +362,7 @@ public class GatherAPIData {
}
// final
if (doc.isFinal()) {
if (doc.isFinal() && !doc.isEnum()) {
info.setFinal();
} else {
// default is non-final
@ -375,7 +376,13 @@ public class GatherAPIData {
} else if (doc.isConstructor()) {
info.setConstructor();
} else if (doc.isClass() || doc.isInterface()) {
info.setClass();
if (doc.isEnum()) {
info.setEnum();
} else {
info.setClass();
}
} else if (doc.isEnumConstant()) {
info.setEnumConstant();
}
info.setPackage(trimBase(doc.containingPackage().name()));
@ -398,7 +405,7 @@ public class GatherAPIData {
StringBuffer buf = new StringBuffer();
if (cdoc.isClass()) {
buf.append("extends ");
buf.append(cdoc.superclass().qualifiedName());
buf.append(cdoc.superclassType().toString());
}
ClassDoc[] imp = cdoc.interfaces();
if (imp != null && imp.length > 0) {

View File

@ -1,6 +1,6 @@
/**
*******************************************************************************
* Copyright (C) 2004-2012, International Business Machines Corporation and *
* Copyright (C) 2004-2013, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -470,7 +470,7 @@ public class ReportAPI {
clas = null;
}
if (!info.isClass()) {
if (!info.isClass() && !info.isEnum()) {
String className = info.getClassName();
if (!className.equals(clas)) {
if (html) {