Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-03-26 11:18:34 +0000
committerCamilo Bernal2013-03-26 13:58:47 +0000
commit44ac40c074f5b2772718fd8ff96bcce7c9abd5c1 (patch)
tree7a65b49efa80804f40335edcd7d7616b19ebfde7 /libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx
parentdaafdb024cf5588c988fb0b128b1a6d5ac9979ee (diff)
downloadorg.eclipse.linuxtools-44ac40c074f5b2772718fd8ff96bcce7c9abd5c1.tar.gz
org.eclipse.linuxtools-44ac40c074f5b2772718fd8ff96bcce7c9abd5c1.tar.xz
org.eclipse.linuxtools-44ac40c074f5b2772718fd8ff96bcce7c9abd5c1.zip
Add missing NON-NLS.
Doxygen keywords are not ment to be translated to mark as such. Also fix a bunch of spaces in NON-NLS comments making Eclipse to not recognize them as such. Change-Id: I6fb70276dda3a8568e077868ecfd5bbb459e50f7 Reviewed-on: https://git.eclipse.org/r/11468 Tested-by: Hudson CI Reviewed-by: Camilo Bernal <cabernal@redhat.com> IP-Clean: Camilo Bernal <cabernal@redhat.com> Tested-by: Camilo Bernal <cabernal@redhat.com>
Diffstat (limited to 'libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx')
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java176
1 files changed, 88 insertions, 88 deletions
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
index bb139e83a2..bb3682e7a9 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
@@ -40,11 +40,11 @@ import org.xml.sax.SAXException;
public class DoxygenCPPInfo {
-
+
private Document document;
private LibHoverInfo cppInfo = new LibHoverInfo();
private HashMap<String, ClassInfo> classesById = new HashMap<String, ClassInfo>();
-
+
public DoxygenCPPInfo(Document document) {
this.document = document;
}
@@ -52,10 +52,10 @@ public class DoxygenCPPInfo {
public Document getDocument() {
return document;
}
-
+
private String[] getTypedefTypes(String def) {
String[] result = null;
- if (def.startsWith("typedef ")) { // $NON-NLS-1$
+ if (def.startsWith("typedef ")) { //$NON-NLS-1$
int startIndex = 8;
int count = 0;
int i = def.length() - 1;
@@ -83,15 +83,15 @@ public class DoxygenCPPInfo {
result[1] = def.substring(startIndex);
// Following is a bit of a hack knowing the docs don't add the namespace when the transformed
// type is in the same space
- int namespace = result[1].indexOf("::"); // $NON-NLS-1$
+ int namespace = result[1].indexOf("::"); //$NON-NLS-1$
if (namespace < 0)
result[0] = def.substring(8, startIndex).trim();
else
- result[0] = result[1].substring(0, namespace) + "::" + def.substring(8, startIndex).trim(); // $NON-NLS-1$
+ result[0] = result[1].substring(0, namespace) + "::" + def.substring(8, startIndex).trim(); //$NON-NLS-1$
}
return result;
}
-
+
private String getElementText(Node node) {
StringBuffer d = new StringBuffer();
NodeList nl = node.getChildNodes();
@@ -106,7 +106,7 @@ public class DoxygenCPPInfo {
}
public ClassInfo getClassInfo(String className) {
- String typedefName = className.replaceAll("<.*>", "<>"); // $NON-NLS-1$ // $NON-NLS-2$
+ String typedefName = className.replaceAll("<.*>", "<>"); //$NON-NLS-1$ //$NON-NLS-2$
TypedefInfo typedef = cppInfo.typedefs.get(typedefName);
if (typedef != null) {
className = typedef.getTransformedType(className); // Reset class name to typedef transformation
@@ -135,33 +135,33 @@ public class DoxygenCPPInfo {
// Otherwise no template, just fetch the class info directly.
return cppInfo.classes.get(className);
}
-
+
public void buildDoxygenCPPInfo(String fileName) {
try {
// Create a hash table of all the class nodes mapped by class name. Trim any template info
// for the class name key value.
- NodeList nl = getDocument().getElementsByTagName("compounddef"); // $NON-NLS-1$
+ NodeList nl = getDocument().getElementsByTagName("compounddef"); //$NON-NLS-1$
for (int i = 0; i < nl.getLength(); ++i) {
Node n = nl.item(i);
NamedNodeMap attrs = n.getAttributes();
- Node kind = attrs.getNamedItem("kind"); // $NON-NLS-1$
- Node id = attrs.getNamedItem("id"); // $NON-NLS-1$
- Node prot = attrs.getNamedItem("prot"); // $NON-NLS-1$
+ Node kind = attrs.getNamedItem("kind"); //$NON-NLS-1$
+ Node id = attrs.getNamedItem("id"); //$NON-NLS-1$
+ Node prot = attrs.getNamedItem("prot"); //$NON-NLS-1$
// We are only interested in cataloging public classes.
- if (id != null && prot != null && prot.getNodeValue().equals("public") // $NON-NLS-1$
- && kind != null && kind.getNodeValue().equals("class")) { // $NON-NLS-1$
+ if (id != null && prot != null && prot.getNodeValue().equals("public") //$NON-NLS-1$
+ && kind != null && kind.getNodeValue().equals("class")) { //$NON-NLS-1$
NodeList nl2 = n.getChildNodes();
ClassInfo d = null;
String hashName = null;
for (int j = 0; j < nl2.getLength(); ++j) {
Node n2 = nl2.item(j);
String name2 = n2.getNodeName();
- if (name2.equals("compoundname")) { // $NON-NLS-1$
+ if (name2.equals("compoundname")) { //$NON-NLS-1$
String text = n2.getTextContent();
- if (text != null && !text.equals("")) {
+ if (text != null && !text.equals("")) { //$NON-NLS-1$
String className = text;
- text = text.replaceAll("<\\s*", "<"); // $NON-NLS-1$ // $NON-NLS-2$
- text = text.replaceAll("\\s*>", ">"); // $NON-NLS-1$ // $NON-NLS-2$
+ text = text.replaceAll("<\\s*", "<"); //$NON-NLS-1$ //$NON-NLS-2$
+ text = text.replaceAll("\\s*>", ">"); //$NON-NLS-1$ //$NON-NLS-2$
int index = text.indexOf('<');
hashName = text;
if (index > 0)
@@ -180,7 +180,7 @@ public class DoxygenCPPInfo {
// other variable (e.g. if _A is used, there is no __A or _AB). If this proves untrue in
// any instance, more refinement of the initial value to replace will be required.
for (int k = 0; k < templateParms.length; ++k) {
- text = text.replaceAll(templateParms[k], "[a-zA-Z0-9_: *]+"); // $NON-NLS-1$
+ text = text.replaceAll(templateParms[k], "[a-zA-Z0-9_: *]+"); //$NON-NLS-1$
}
d.setClassName(text);
e.addTemplate(d);
@@ -188,18 +188,18 @@ public class DoxygenCPPInfo {
else
cppInfo.classes.put(hashName, d);
}
- } else if (name2.equals("templateparamlist")) {
+ } else if (name2.equals("templateparamlist")) { //$NON-NLS-1$
ArrayList<String> templates = new ArrayList<String>();
NodeList params = n2.getChildNodes();
int paramsLength = params.getLength();
for (int j2 = 0; j2 < paramsLength; ++j2) {
Node n3 = params.item(j2);
- if (n3.getNodeName().equals("param")) {
+ if (n3.getNodeName().equals("param")) { //$NON-NLS-1$
NodeList types = n3.getChildNodes();
int typesLength = types.getLength();
for (int j3 = 0; j3 < typesLength; ++j3) {
Node n4 = types.item(j3);
- if (n4.getNodeName().equals("declname")) {
+ if (n4.getNodeName().equals("declname")) { //$NON-NLS-1$
templates.add(getElementText(n4));
}
}
@@ -207,18 +207,18 @@ public class DoxygenCPPInfo {
}
String[] templateNames = new String[templates.size()];
d.setTemplateParms(templates.toArray(templateNames));
- } else if (name2.equals("includes")) { // $NON-NLS-1$
+ } else if (name2.equals("includes")) { //$NON-NLS-1$
String include = getElementText(n2);
if (d != null)
d.setInclude(include);
- } else if (name2.equals("basecompoundref")) { // $NON-NLS-1$
+ } else if (name2.equals("basecompoundref")) { //$NON-NLS-1$
// We have a base class. If public, add it to the list of nodes to look at in case we don't find the member
// in the current class definition.
NamedNodeMap m = n2.getAttributes();
if (m != null) {
- Node refid = m.getNamedItem("refid"); // $NON-NLS-1$
- Node prot2 = m.getNamedItem("prot"); // $NON-NLS-1$
- if (prot2 != null && prot2.getNodeValue().equals("public")) { // $NON-NLS-1$
+ Node refid = m.getNamedItem("refid"); //$NON-NLS-1$
+ Node prot2 = m.getNamedItem("prot"); //$NON-NLS-1$
+ if (prot2 != null && prot2.getNodeValue().equals("public")) { //$NON-NLS-1$
ClassInfo baseClass = null;
if (refid != null) {
// If we have been given the id of the base class, fetch it directly
@@ -233,22 +233,22 @@ public class DoxygenCPPInfo {
d.addBaseClass(baseClass);
}
}
- } else if (name2.equals("sectiondef")) { // $NON-NLS-1$
+ } else if (name2.equals("sectiondef")) { //$NON-NLS-1$
// We are only interested in public member functions which are in their own section.
NamedNodeMap m = n2.getAttributes();
if (m != null) {
- Node kind2 = m.getNamedItem("kind"); // $NON-NLS-1$
- if (kind2 != null && kind2.getNodeValue().equals("public-func")) { // $NON-NLS-1$
+ Node kind2 = m.getNamedItem("kind"); //$NON-NLS-1$
+ if (kind2 != null && kind2.getNodeValue().equals("public-func")) { //$NON-NLS-1$
NodeList pubfuncs = n2.getChildNodes();
int pubfuncLength = pubfuncs.getLength();
for (int j1 = 0; j1 < pubfuncLength; ++j1) {
Node n3 = pubfuncs.item(j1);
// Add all public member functions to the list of members
- if (n3.getNodeName().equals("memberdef")) { // $NON-NLS-1$
+ if (n3.getNodeName().equals("memberdef")) { //$NON-NLS-1$
NamedNodeMap m3 = n3.getAttributes();
if (m3 != null) {
- Node m3Kind = m3.getNamedItem("kind"); // $NON-NLS-1$
- if (m3Kind != null && m3Kind.getNodeValue().equals("function")) { // $NON-NLS-1$
+ Node m3Kind = m3.getNamedItem("kind"); //$NON-NLS-1$
+ if (m3Kind != null && m3Kind.getNodeValue().equals("function")) { //$NON-NLS-1$
String name = null;
String type = null;
String args = null;
@@ -259,70 +259,70 @@ public class DoxygenCPPInfo {
for (int k = 0; k < memberLength; ++k) {
Node n4 = nl4.item(k);
String n4Name = n4.getNodeName();
- if (n4Name.equals("type")) { // $NON-NLS-1$
+ if (n4Name.equals("type")) { //$NON-NLS-1$
NodeList nl5 = n4.getChildNodes();
- type = new String(""); // $NON-NLS-1$
+ type = new String(""); //$NON-NLS-1$
for (int x = 0; x < nl5.getLength(); ++x) {
Node n5 = nl5.item(x);
if (n5.getNodeType() == Node.TEXT_NODE)
type += n5.getNodeValue();
- else if (n5.getNodeName().equals("ref")) { // $NON-NLS-1$
+ else if (n5.getNodeName().equals("ref")) { //$NON-NLS-1$
NamedNodeMap n5m = n5.getAttributes();
- Node n5id = n5m.getNamedItem("refid");
+ Node n5id = n5m.getNamedItem("refid"); //$NON-NLS-1$
if (n5id != null) {
String refid = n5id.getNodeValue();
ClassInfo refClass = classesById.get(refid);
if (refClass != null)
type += refClass.getClassName();
}
- }
+ }
}
- } else if (n4Name.equals("name")) { // $NON-NLS-1$
+ } else if (n4Name.equals("name")) { //$NON-NLS-1$
name = n4.getTextContent();
- } else if (n4Name.equals("argsstring")) { // $NON-NLS-1$
+ } else if (n4Name.equals("argsstring")) { //$NON-NLS-1$
args = getElementText(n4);
- } else if (n4Name.equals("param")) { // $NON-NLS-1$
+ } else if (n4Name.equals("param")) { //$NON-NLS-1$
NodeList nl5 = n4.getChildNodes();
for (int x = 0; x < nl5.getLength(); ++x) {
Node n5 = nl5.item(x);
- if (n5.getNodeName().equals("type")) { // $NON-NLS-1$
+ if (n5.getNodeName().equals("type")) { //$NON-NLS-1$
parms.add(getElementText(n5));
}
}
- } else if (n4Name.equals("briefdescription")) { // $NON-NLS-1$
+ } else if (n4Name.equals("briefdescription")) { //$NON-NLS-1$
NodeList nl5 = n4.getChildNodes();
for (int x = 0; x < nl5.getLength(); ++x) {
Node n5 = nl5.item(x);
- if (n5.getNodeName().equals("para")) { // $NON-NLS-1$
+ if (n5.getNodeName().equals("para")) { //$NON-NLS-1$
if (desc == null)
- desc = new String("");
- desc += "<p>" + getElementText(n5) + "</p>"; // $NON-NLS-1$ // $NON-NLS-2$
- }
+ desc = new String(""); //$NON-NLS-1$
+ desc += "<p>" + getElementText(n5) + "</p>"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
- } else if (n4Name.equals("detaileddescription")) { // $NON-NLS-1$
+ } else if (n4Name.equals("detaileddescription")) { //$NON-NLS-1$
NodeList nl5 = n4.getChildNodes();
for (int x = 0; x < nl5.getLength(); ++x) {
Node n5 = nl5.item(x);
- if (n5.getNodeName().equals("para")) { // $NON-NLS-1$
+ if (n5.getNodeName().equals("para")) { //$NON-NLS-1$
if (desc == null)
- desc = new String(""); // $NON-NLS-1$
+ desc = new String(""); //$NON-NLS-1$
NodeList nl6 = n5.getChildNodes();
Node n6 = nl6.item(0);
if (n6.getNodeType() == Node.TEXT_NODE)
- desc += "<p>" + getElementText(n5) + "</p>"; // $NON-NLS-1$ // $NON-NLS-2$
+ desc += "<p>" + getElementText(n5) + "</p>"; //$NON-NLS-1$ //$NON-NLS-2$
else {
for (int x2 = 0; x2 < nl6.getLength(); ++x2) {
n6 = nl6.item(x2);
- if (n6.getNodeName().equals("parameterlist")) { // $NON-NLS-1$
+ if (n6.getNodeName().equals("parameterlist")) { //$NON-NLS-1$
desc += getParameters(n6);
- } else if (n6.getNodeName().equals("simplesect")) { // $NON-NLS-1$
+ } else if (n6.getNodeName().equals("simplesect")) { //$NON-NLS-1$
desc += getReturn(n6);
}
}
}
- }
+ }
}
- } else if (n4Name.equals("location")) {
+ } else if (n4Name.equals("location")) { //$NON-NLS-1$
// Location is after all descriptions so we can now add the member
if (name != null) {
MemberInfo member = new MemberInfo(name);
@@ -347,30 +347,30 @@ public class DoxygenCPPInfo {
}
}
// Create a hash table of all the typedefs. Keep any template info.
- nl = getDocument().getElementsByTagName("memberdef"); // $NON-NLS-1$
+ nl = getDocument().getElementsByTagName("memberdef"); //$NON-NLS-1$
for (int i = 0; i < nl.getLength(); ++i) {
Node n = nl.item(i);
NamedNodeMap attrs = n.getAttributes();
if (attrs != null) {
- Node kind = attrs.getNamedItem("kind"); // $NON-NLS-1$
- Node prot = attrs.getNamedItem("prot"); // $NON-NLS-1$
- if (kind != null && kind.getNodeValue().equals("typedef") // $NON-NLS-1$
- && prot != null && prot.getNodeValue().equals("public")) { // $NON-NLS-1$
+ Node kind = attrs.getNamedItem("kind"); //$NON-NLS-1$
+ Node prot = attrs.getNamedItem("prot"); //$NON-NLS-1$
+ if (kind != null && kind.getNodeValue().equals("typedef") //$NON-NLS-1$
+ && prot != null && prot.getNodeValue().equals("public")) { //$NON-NLS-1$
NodeList list = n.getChildNodes();
for (int x = 0; x < list.getLength(); ++x) {
Node n2 = list.item(x);
- if (n2.getNodeName().equals("definition")) { // $NON-NLS-1$
+ if (n2.getNodeName().equals("definition")) { //$NON-NLS-1$
String def = n2.getTextContent();
- if (def != null && !def.equals("")) {
- def = def.replaceAll("<\\s*", "<"); // $NON-NLS-1$ // $NON-NLS-2$
- def = def.replaceAll("\\s*>", ">"); // $NON-NLS-1$ // $NON-NLS-2$
+ if (def != null && !def.equals("")) { //$NON-NLS-1$
+ def = def.replaceAll("<\\s*", "<"); //$NON-NLS-1$ //$NON-NLS-2$
+ def = def.replaceAll("\\s*>", ">"); //$NON-NLS-1$ //$NON-NLS-2$
String[] types = getTypedefTypes(def);
TypedefInfo d = new TypedefInfo(types[1], types[0]);
String hashName = d.getTypedefName();
int index = hashName.indexOf('<');
if (index > 0) {
String className = hashName.substring(0, index);
- hashName = hashName.replaceAll("<.*>", "<>"); // $NON-NLS-1$ // $NON-NLS-2$
+ hashName = hashName.replaceAll("<.*>", "<>"); //$NON-NLS-1$ //$NON-NLS-2$
ClassInfo e = cppInfo.classes.get(className);
if (e == null)
break;
@@ -378,9 +378,9 @@ public class DoxygenCPPInfo {
if (children != null && children.size() > 0) {
for (int y = 0; y < children.size(); ++y) {
ClassInfo child = children.get(y);
- String childName = child.getClassName().replaceAll("\\*", "\\\\*"); // $NON-NLS-1$ // $NON-NLS-2$
- childName = childName.replace("[]", "\\[\\]"); // $NON-NLS-1$ // $NON-NLS-2$
- if (types[1].matches(childName.concat("::.*"))) { // $NON-NLS-1$
+ String childName = child.getClassName().replaceAll("\\*", "\\\\*"); //$NON-NLS-1$ //$NON-NLS-2$
+ childName = childName.replace("[]", "\\[\\]"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (types[1].matches(childName.concat("::.*"))) { //$NON-NLS-1$
e = child;
break;
}
@@ -393,7 +393,7 @@ public class DoxygenCPPInfo {
if (f != null) {
String typedefName = d.getTypedefName();
for (int z = 0; z < templates.length; ++z) {
- typedefName = typedefName.replaceAll(templates[z], "[a-zA-Z0-9_: ]+"); // $NON-NLS-1$
+ typedefName = typedefName.replaceAll(templates[z], "[a-zA-Z0-9_: ]+"); //$NON-NLS-1$
}
d.setTypedefName(typedefName);
f.addTypedef(d);
@@ -421,41 +421,41 @@ public class DoxygenCPPInfo {
e.printStackTrace();
}
}
-
+
private String getParameters(Node n6) {
- String desc = "<br><br><h3>Parameters:</h3>";
+ String desc = "<br><br><h3>Parameters:</h3>"; //$NON-NLS-1$
NodeList nl = n6.getChildNodes();
for (int x = 0; x < nl.getLength(); ++x) {
Node n = nl.item(x);
- if (n.getNodeName().equals("parameteritem")) {
+ if (n.getNodeName().equals("parameteritem")) { //$NON-NLS-1$
NodeList nl2 = n.getChildNodes();
for (int y = 0; y < nl2.getLength(); ++y) {
Node n2 = nl2.item(y);
- if (n2.getNodeName().equals("parameternamelist")) {
+ if (n2.getNodeName().equals("parameternamelist")) { //$NON-NLS-1$
NodeList nl3 = n2.getChildNodes();
for (int z = 0; z < nl3.getLength(); ++z) {
Node n3 = nl3.item(z);
- if (n3.getNodeName().equals("parametername")) {
- desc += getElementText(n3) + " - ";
+ if (n3.getNodeName().equals("parametername")) { //$NON-NLS-1$
+ desc += getElementText(n3) + " - "; //$NON-NLS-1$
}
}
- } else if (n2.getNodeName().equals("parameterdescription")) {
- desc += getElementText(n2) + "<br>";
+ } else if (n2.getNodeName().equals("parameterdescription")) { //$NON-NLS-1$
+ desc += getElementText(n2) + "<br>"; //$NON-NLS-1$
}
}
}
}
return desc;
-
+
}
private String getReturn(Node n6) {
- String desc = "";
+ String desc = ""; //$NON-NLS-1$
NamedNodeMap m = n6.getAttributes();
- Node kind = m.getNamedItem("kind");
- if (kind != null && kind.getNodeValue().equals("return")) {
- desc += "<br><h3>Returns:</h3>" + getElementText(n6) + "<br>";
+ Node kind = m.getNamedItem("kind"); //$NON-NLS-1$
+ if (kind != null && kind.getNodeValue().equals("return")) { //$NON-NLS-1$
+ desc += "<br><h3>Returns:</h3>" + getElementText(n6) + "<br>"; //$NON-NLS-1$ //$NON-NLS-2$
}
return desc;
}
@@ -466,7 +466,7 @@ public class DoxygenCPPInfo {
NodeList list = classNode.getChildNodes();
for (int i = 0; i < list.getLength(); ++i) {
n = list.item(i);
- if (n.getNodeName().equals("templateparamlist")) { // $NON-NLS-1$
+ if (n.getNodeName().equals("templateparamlist")) { //$NON-NLS-1$
break;
}
}
@@ -474,11 +474,11 @@ public class DoxygenCPPInfo {
NodeList templateList = n.getChildNodes();
for (int j = 0; j < templateList.getLength(); ++j) {
Node p = templateList.item(j);
- if (p.getNodeName().equals("param")) { // $NON-NLS-1$
+ if (p.getNodeName().equals("param")) { //$NON-NLS-1$
NodeList paramList = p.getChildNodes();
for (int k = 0; k < paramList.getLength(); ++k) {
Node q = paramList.item(k);
- if (q.getNodeName().equals("declname")) { // $NON-NLS-1$
+ if (q.getNodeName().equals("declname")) { //$NON-NLS-1$
String templateName = q.getTextContent();
templateArray.add(templateName);
}
@@ -492,7 +492,7 @@ public class DoxygenCPPInfo {
/**
* Create LibHoverInfo serialized output
- *
+ *
* @param args (args[0] = location of Doxygen xml document to parse (file or URL),
* args[1] = name of file to put serialized LibHoverInfo
*/
@@ -516,7 +516,7 @@ public class DoxygenCPPInfo {
DoxygenCPPInfo d = new DoxygenCPPInfo(doc);
d.buildDoxygenCPPInfo(args[1]);
}
- System.out.println("Built " + args[1] + " from " + args[0]);
+ System.out.println("Built " + args[1] + " from " + args[0]); //$NON-NLS-1$ //$NON-NLS-2$
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();

Back to the top