1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-13 12:05:21 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-07-21 19:30:00 -07:00
parent 2050fe2bfb
commit 9827378be6
16 changed files with 156 additions and 157 deletions

View file

@ -19,10 +19,10 @@
package org.eclipse.cdt.core.parser.tests.ast2;
import static org.eclipse.cdt.core.parser.ParserLanguage.CPP;
import static org.eclipse.cdt.core.parser.tests.VisibilityAsserts.assertVisibility;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getNestedType;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getUltimateType;
import static org.eclipse.cdt.core.parser.tests.VisibilityAsserts.assertVisibility;
import java.io.IOException;

View file

@ -13,6 +13,9 @@
*******************************************************************************/
package org.eclipse.cdt.internal.index.tests;
import java.util.ArrayList;
import java.util.List;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
@ -65,9 +68,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
import org.eclipse.cdt.internal.core.index.IIndexScope;
import org.eclipse.core.runtime.CoreException;
import java.util.ArrayList;
import java.util.List;
/**
* Tests for exercising resolution of template bindings against IIndex
*/

View file

@ -32,8 +32,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
*/
public class CPPClassTemplateSpecialization extends CPPClassSpecialization
implements ICPPClassTemplate, ICPPInternalClassTemplate {
private ObjectMap instances = null;
private ObjectMap instances;
private ICPPDeferredClassInstance fDeferredInstance;
private ICPPClassTemplatePartialSpecialization[] fPartialSpecs;
private ICPPTemplateParameter[] fTemplateParameters;

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems)
* IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;

View file

@ -27,7 +27,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
*/
public class CPPMethodTemplateSpecialization extends CPPFunctionTemplateSpecialization
implements ICPPMethod {
private ICPPTemplateParameter[] fTemplateParameters;
public CPPMethodTemplateSpecialization(ICPPMethod specialized, ICPPClassSpecialization owner,

View file

@ -27,7 +27,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateNonTypeParameter;
*/
public class CPPTemplateNonTypeParameterSpecialization extends CPPTemplateParameterSpecialization
implements ICPPTemplateNonTypeParameter {
private final IType fType;
public CPPTemplateNonTypeParameterSpecialization(ICPPSpecialization owner, ICPPScope scope,

View file

@ -30,7 +30,6 @@ import org.eclipse.core.runtime.PlatformObject;
*/
public abstract class CPPTemplateParameterSpecialization extends PlatformObject
implements ICPPTemplateParameter, ICPPSpecialization {
private final ICPPSpecialization fOwner;
private final ICPPScope fScope;
private final ICPPTemplateParameter fSpecialized;
@ -126,5 +125,4 @@ public abstract class CPPTemplateParameterSpecialization extends PlatformObject
public boolean isParameterPack() {
return fSpecialized.isParameterPack();
}
}

View file

@ -26,6 +26,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPFunctionParamet
* Assists in evaluating expressions.
*/
public interface ICPPEvaluation extends ISerializableEvaluation {
public static final ICPPEvaluation[] EMPTY_ARRAY = {};
boolean isInitializerList();
boolean isFunctionSet();

View file

@ -2461,9 +2461,9 @@ public class CPPTemplates {
}
/**
* Converts the template argument <code>arg</code> to match the parameter type
* <code>paramType</code> or returns <code>null</code>, if this violates the rules
* specified in 14.3.2 - 5.
* Converts the template argument {@code arg} to match the parameter type {@code paramType}
* or returns {@code null}, if this violates the rules specified in 14.3.2 - 5.
*
* @throws DOMException
*/
private static ICPPTemplateArgument convertNonTypeTemplateArgument(ICPPTemplateDefinition template,

View file

@ -39,6 +39,7 @@ public class EvalTypeId extends CPPDependentEvaluation {
public EvalTypeId(IType type, IASTNode pointOfDefinition, ICPPEvaluation... arguments) {
this(type, findEnclosingTemplate(pointOfDefinition), arguments);
}
public EvalTypeId(IType type, IBinding templateDefinition, ICPPEvaluation... arguments) {
super(templateDefinition);
fInputType= type;
@ -136,7 +137,8 @@ public class EvalTypeId extends CPPDependentEvaluation {
marshalTemplateDefinition(buffer);
}
public static ISerializableEvaluation unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException {
public static ISerializableEvaluation unmarshal(short firstBytes, ITypeMarshalBuffer buffer)
throws CoreException {
IType type= buffer.unmarshalType();
ICPPEvaluation[] args= null;
if ((firstBytes & ITypeMarshalBuffer.FLAG1) != 0) {
@ -146,7 +148,7 @@ public class EvalTypeId extends CPPDependentEvaluation {
args[i]= (ICPPEvaluation) buffer.unmarshalEvaluation();
}
} else {
args = new ICPPEvaluation[0]; // arguments must not be null
args = ICPPEvaluation.EMPTY_ARRAY; // arguments must not be null
}
IBinding templateDefinition= buffer.unmarshalBinding();
return new EvalTypeId(type, templateDefinition, args);

View file

@ -104,7 +104,7 @@ public class PDOM extends PlatformObject implements IPDOM {
private static final int BLOCKED_WRITE_LOCK_OUTPUT_INTERVAL = 30000;
private static final int LONG_WRITE_LOCK_REPORT_THRESHOLD = 1000;
private static final int LONG_READ_LOCK_WAIT_REPORT_THRESHOLD = 1000;
static boolean sDEBUG_LOCKS= false; // initialized in the PDOMManager, because IBM needs PDOM independent of runtime plugin.
static boolean sDEBUG_LOCKS= false; // Initialized in the PDOMManager, because IBM needs PDOM independent of runtime plugin.
/**
* Identifier for PDOM format
@ -239,6 +239,8 @@ public class PDOM extends PlatformObject implements IPDOM {
* 145.0 - Changed marshalling of CPPBasicType to store the associated numerical value, bug 407808.
* 146.0 - Added visibility support on class type level, bug 402878.
* #147.0# - Store whether function name is qualified in EvalFunctionSet, bug 408296. <<CDT 8.2>>
*
* CDT 8.3 development (versions not supported on the 8.2.x branch)
* 148.0 - Store specialized template parameters of class/function template specializations, bug 407497.
*/
private static final int MIN_SUPPORTED_VERSION= version(148, 0);

View file

@ -44,7 +44,6 @@ import org.eclipse.core.runtime.CoreException;
*/
class PDOMCPPClassTemplateSpecialization extends PDOMCPPClassSpecialization
implements ICPPClassTemplate, ICPPInstanceCache {
private static final int TEMPLATE_PARAMS = PDOMCPPClassSpecialization.RECORD_SIZE;
@SuppressWarnings("hiding")
@ -52,8 +51,8 @@ class PDOMCPPClassTemplateSpecialization extends PDOMCPPClassSpecialization
private volatile IPDOMCPPTemplateParameter[] fTemplateParameters;
public PDOMCPPClassTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent, ICPPClassTemplate template, PDOMBinding specialized)
throws CoreException {
public PDOMCPPClassTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent,
ICPPClassTemplate template, PDOMBinding specialized) throws CoreException {
super(linkage, parent, template, specialized);
computeTemplateParameters(template); // sets fTemplateParameters
final Database db = getDB();
@ -209,8 +208,8 @@ class PDOMCPPClassTemplateSpecialization extends PDOMCPPClassSpecialization
private void computeTemplateParameters(ICPPClassTemplate originalTemplate) {
try {
fTemplateParameters = PDOMTemplateParameterArray.createPDOMTemplateParameters(getLinkage(), this,
originalTemplate.getTemplateParameters());
fTemplateParameters = PDOMTemplateParameterArray.createPDOMTemplateParameters(getLinkage(),
this, originalTemplate.getTemplateParameters());
} catch (DOMException e) {
CCorePlugin.log(e);
fTemplateParameters = IPDOMCPPTemplateParameter.EMPTY_ARRAY;

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX - Initial API and implementation
* QNX - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@ -28,8 +28,8 @@ class PDOMCPPConstructorTemplateSpecialization extends PDOMCPPMethodTemplateSpec
@SuppressWarnings("hiding")
protected static final int RECORD_SIZE = PDOMCPPFunctionSpecialization.RECORD_SIZE + 0;
public PDOMCPPConstructorTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent, ICPPConstructor constructor, PDOMBinding specialized)
throws CoreException {
public PDOMCPPConstructorTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent,
ICPPConstructor constructor, PDOMBinding specialized) throws CoreException {
super(linkage, parent, constructor, specialized);
}

View file

@ -29,11 +29,9 @@ import org.eclipse.core.runtime.CoreException;
/**
* @author Bryan Wilkinson
*
*/
class PDOMCPPMethodTemplateSpecialization extends
PDOMCPPFunctionTemplateSpecialization implements ICPPMethod {
class PDOMCPPMethodTemplateSpecialization extends PDOMCPPFunctionTemplateSpecialization
implements ICPPMethod {
private static final int TEMPLATE_PARAMS = PDOMCPPFunctionTemplateSpecialization.RECORD_SIZE;
@SuppressWarnings("hiding")
@ -41,14 +39,15 @@ class PDOMCPPMethodTemplateSpecialization extends
private volatile IPDOMCPPTemplateParameter[] fTemplateParameters;
public PDOMCPPMethodTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent, ICPPMethod method, PDOMBinding specialized)
throws CoreException {
public PDOMCPPMethodTemplateSpecialization(PDOMCPPLinkage linkage, PDOMNode parent,
ICPPMethod method, PDOMBinding specialized) throws CoreException {
super(linkage, parent, (ICPPFunctionTemplate) method, specialized);
computeTemplateParameters((ICPPFunctionTemplate) method); // sets fTemplateParameters
computeTemplateParameters((ICPPFunctionTemplate) method); // Sets fTemplateParameters
final Database db = getDB();
long rec = PDOMTemplateParameterArray.putArray(db, fTemplateParameters);
db.putRecPtr(record + TEMPLATE_PARAMS, rec);
linkage.new ConfigureTemplateParameters(((ICPPFunctionTemplate) method).getTemplateParameters(), fTemplateParameters);
linkage.new ConfigureTemplateParameters(((ICPPFunctionTemplate) method).getTemplateParameters(),
fTemplateParameters);
}
public PDOMCPPMethodTemplateSpecialization(PDOMLinkage linkage, long bindingRecord) {
@ -155,8 +154,8 @@ class PDOMCPPMethodTemplateSpecialization extends
private void computeTemplateParameters(ICPPFunctionTemplate originalMethodTemplate) {
try {
fTemplateParameters = PDOMTemplateParameterArray.createPDOMTemplateParameters(getLinkage(), this,
originalMethodTemplate.getTemplateParameters());
fTemplateParameters = PDOMTemplateParameterArray.createPDOMTemplateParameters(getLinkage(),
this, originalMethodTemplate.getTemplateParameters());
} catch (DOMException e) {
CCorePlugin.log(e);
fTemplateParameters = IPDOMCPPTemplateParameter.EMPTY_ARRAY;