1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-08-22 15:15:48 -07:00
parent 80ca2e52aa
commit f99f12f4ed
2 changed files with 8 additions and 8 deletions

View file

@ -18,15 +18,14 @@ import org.eclipse.core.runtime.IStatus;
* @noextend This class is not intended to be subclassed by clients. * @noextend This class is not intended to be subclassed by clients.
*/ */
public class QualifiedTypeName implements IQualifiedTypeName { public class QualifiedTypeName implements IQualifiedTypeName {
private static final String[] NO_SEGMENTS = {};
private static final String[] NO_SEGMENTS = new String[0];
private static final String EMPTY_STRING = ""; //$NON-NLS-1$ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final int INITIAL_SEGMENT_LENGTH = 12; private static final int INITIAL_SEGMENT_LENGTH = 12;
private static final int HASH_INIT = 17; private static final int HASH_INIT = 17;
private static final int HASH_MULTIPLIER = 37; private static final int HASH_MULTIPLIER = 37;
private String[] fSegments = NO_SEGMENTS; private String[] fSegments = NO_SEGMENTS;
private int fHashCode = 0; private int fHashCode;
public static final QualifiedTypeName EMPTY = new QualifiedTypeName(); public static final QualifiedTypeName EMPTY = new QualifiedTypeName();
@ -43,11 +42,12 @@ public class QualifiedTypeName implements IQualifiedTypeName {
} }
public QualifiedTypeName(String name, String[] enclosingNames) { public QualifiedTypeName(String name, String[] enclosingNames) {
if (enclosingNames == null) if (enclosingNames == null) {
fSegments = createSegments(name); fSegments = createSegments(name);
else } else {
fSegments = createSegments(name, enclosingNames); fSegments = createSegments(name, enclosingNames);
} }
}
private QualifiedTypeName() { private QualifiedTypeName() {
} }

View file

@ -98,14 +98,14 @@ public class NameWriter extends NodeWriter {
if (i <= 0){ if (i <= 0){
return false; return false;
} }
if (qname.getNames()[i-1] instanceof ICPPASTTemplateId) { if (qname.getNames()[i - 1] instanceof ICPPASTTemplateId) {
return true; return true;
} }
IBinding binding = qname.getNames()[i-1].resolveBinding(); IBinding binding = qname.getNames()[i - 1].resolveBinding();
if (binding instanceof CPPTemplateTypeParameter) { if (binding instanceof CPPTemplateTypeParameter) {
return true; return true;
} }
return isDependentName(qname, tempId, i-1); return isDependentName(qname, tempId, i - 1);
} }
private boolean isNestedTemplateId(IASTNode node) { private boolean isNestedTemplateId(IASTNode node) {