summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2013-07-30 13:45:58 (EDT)
committerCurtis Windatt2013-07-30 13:45:58 (EDT)
commit68cb8199c251d3c749e9664e2471eb98f4a04170 (patch)
treea961688f87abffbadfa722386f92f9e11425af55
parentd36a2d3d989aedd175601a3b853f3c90e17c69e6 (diff)
downloadeclipse.pde.ui-68cb8199c251d3c749e9664e2471eb98f4a04170.zip
eclipse.pde.ui-68cb8199c251d3c749e9664e2471eb98f4a04170.tar.gz
eclipse.pde.ui-68cb8199c251d3c749e9664e2471eb98f4a04170.tar.bz2
Bug 410142 - API Deprecation log: Bad rendering of types and state
-rw-r--r--apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIDeprecationReportConversionTask.java87
-rw-r--r--apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties2
3 files changed, 52 insertions, 41 deletions
diff --git a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIDeprecationReportConversionTask.java b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIDeprecationReportConversionTask.java
index 89ecc97..2efed53 100644
--- a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIDeprecationReportConversionTask.java
+++ b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIDeprecationReportConversionTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
+ * Copyright (c) 2010, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -60,7 +60,7 @@ public class APIDeprecationReportConversionTask extends Task {
this.debug = debug;
}
public void endElement(String uri, String localName, String name)
- throws SAXException {
+ throws SAXException {
if (IApiXmlConstants.DELTA_ELEMENT_NAME.equals(name)) {
Entry entry = new Entry(
this.flags,
@@ -167,57 +167,62 @@ public class APIDeprecationReportConversionTask extends Task {
this.kind = kind;
this.elementType = elementType;
}
-
+
public String getDisplayString() {
StringBuffer buffer = new StringBuffer();
if(this.typeName != null && this.typeName.length() != 0) {
buffer.append(this.typeName);
- switch(this.flags) {
- case IDelta.DEPRECATION :
- switch(this.elementType) {
- case IDelta.ANNOTATION_ELEMENT_TYPE :
- case IDelta.INTERFACE_ELEMENT_TYPE :
- case IDelta.ENUM_ELEMENT_TYPE :
- case IDelta.CLASS_ELEMENT_TYPE :
- buffer.append('.');
- buffer.append(this.key);
- break;
- case IDelta.CONSTRUCTOR_ELEMENT_TYPE :
- int indexOf = key.indexOf('(');
- if (indexOf == -1) {
- return null;
- }
- int index = indexOf;
- String selector = key.substring(0, index);
- String descriptor = key.substring(index, key.length());
- buffer.append('#');
- buffer.append(Signature.toString(descriptor, selector, null, false, false));
- break;
- case IDelta.METHOD_ELEMENT_TYPE :
- indexOf = key.indexOf('(');
- if (indexOf == -1) {
- return null;
- }
- index = indexOf;
- selector = key.substring(0, index);
- descriptor = key.substring(index, key.length());
- buffer.append('#');
- buffer.append(Signature.toString(descriptor, selector, null, false, true));
- break;
- case IDelta.FIELD_ELEMENT_TYPE :
- buffer.append('#');
- buffer.append(this.key);
+ if (this.flags == IDelta.DEPRECATION) {
+ switch(this.elementType) {
+ case IDelta.ANNOTATION_ELEMENT_TYPE :
+ case IDelta.INTERFACE_ELEMENT_TYPE :
+ case IDelta.ENUM_ELEMENT_TYPE :
+ case IDelta.CLASS_ELEMENT_TYPE :
+ // If the root type is deprecated, don't repeat the typename
+ if (!this.typeName.equals(this.key)){
+ buffer.append('.');
+ buffer.append(this.key);
+ }
+ break;
+ case IDelta.CONSTRUCTOR_ELEMENT_TYPE :
+ int indexOf = key.indexOf('(');
+ if (indexOf == -1) {
+ return null;
+ }
+ int index = indexOf;
+ String selector = key.substring(0, index);
+ String descriptor = key.substring(index, key.length());
+ buffer.append('#');
+ buffer.append(Signature.toString(descriptor, selector, null, false, false));
+ break;
+ case IDelta.METHOD_ELEMENT_TYPE :
+ indexOf = key.indexOf('(');
+ if (indexOf == -1) {
+ return null;
}
+ index = indexOf;
+ selector = key.substring(0, index);
+ descriptor = key.substring(index, key.length());
+ buffer.append('#');
+ buffer.append(Signature.toString(descriptor, selector, null, false, true));
+ break;
+ case IDelta.FIELD_ELEMENT_TYPE :
+ buffer.append('#');
+ buffer.append(this.key);
+ break;
+ default :
+ break;
+ }
}
}
-
+
return CommonUtilsTask.convertToHtml(String.valueOf(buffer));
}
public String getDisplayKind() {
if (ADDED.equals(this.kind)) {
- return Messages.AddedElement;
+ return Messages.APIDeprecationReportConversionTask_KindDeprecated;
} else if (REMOVED.equals(this.kind)) {
- return Messages.RemovedElement;
+ return Messages.APIDeprecationReportConversionTask_KindUndeprecated;
}
return Messages.ChangedElement;
}
diff --git a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java
index 6266048..63c4f87 100644
--- a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java
+++ b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java
@@ -102,6 +102,10 @@ public class Messages extends NLS {
public static String AddedElement;
public static String AnalysisReportConversionTask_component_resolution_header;
+ public static String APIDeprecationReportConversionTask_KindDeprecated;
+
+ public static String APIDeprecationReportConversionTask_KindUndeprecated;
+
public static String APIFreezeReportConversionTask_resolverErrorTableEnd;
public static String APIFreezeReportConversionTask_resolverErrorTableEntry;
diff --git a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties
index 69c6a9f..c7e87d0 100644
--- a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties
+++ b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties
@@ -207,6 +207,8 @@ fullReportTask_resolutiondetailsSingle=<p><b><font color="#FF0000">Reported warn
UseTask_no_scan_both_types_not_searched_for=Build stopping - neither API, internal nor illegal references are being searched for
AddedElement=ADDED
AnalysisReportConversionTask_component_resolution_header=Component Resolution
+APIDeprecationReportConversionTask_KindDeprecated=DEPRECATED
+APIDeprecationReportConversionTask_KindUndeprecated=UN-DEPRECATED
APIFreezeReportConversionTask_resolverErrorTableEnd=</table>\n
APIFreezeReportConversionTask_resolverErrorTableEntry=\ <tr>\n <td>{0}</td>\n </tr>
APIFreezeReportConversionTask_resolverErrorTableStart=<br/><table border="1" width="80%">\n\