Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlbigearde2008-08-12 17:00:33 +0000
committerlbigearde2008-08-12 17:00:33 +0000
commitb918e62bd276ba104c8d69c355b339f6299c02bf (patch)
tree719f18c5414b75b395008b61dd5b0d503b8b0699
parentc0106122719be2848119ebbea9b51406acf1ba9b (diff)
downloadorg.eclipse.emfatic-b918e62bd276ba104c8d69c355b339f6299c02bf.tar.gz
org.eclipse.emfatic-b918e62bd276ba104c8d69c355b339f6299c02bf.tar.xz
org.eclipse.emfatic-b918e62bd276ba104c8d69c355b339f6299c02bf.zip
fix code style
-rw-r--r--plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Connector.java42
-rw-r--r--plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/EmfaticGenerator.java2
-rw-r--r--plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/EcoreWalker.java6
-rw-r--r--plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToManyMap.java2
-rw-r--r--plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticAnnotationMap.java12
-rw-r--r--plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticBasicTypes.java10
6 files changed, 36 insertions, 38 deletions
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Connector.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Connector.java
index f39dbbd..b40dd26 100644
--- a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Connector.java
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Connector.java
@@ -217,7 +217,7 @@ import org.eclipse.gymnast.runtime.core.parser.ParseContext;
new EmfaticASTNodeVisitor() {
@Override
public boolean beginVisit(TypeParam tp) {
- String tp2 = TokenText.Get(tp.getTypeVarName()).trim();
+ TokenText.Get(tp.getTypeVarName()).trim();
if (tp.getTypeBoundsInfo() != null) {
for (ASTNode tbN : tp.getTypeBoundsInfo().getOneOrMoreTypeParamBounds().getChildren()) {
if (tbN instanceof BoundExceptWildcard) {
@@ -410,7 +410,7 @@ import org.eclipse.gymnast.runtime.core.parser.ParseContext;
}
private EClassifier resolve(EPackage context, QualifiedID qualifiedID) {
- String rawQIDText = TokenText.Get(qualifiedID);
+ TokenText.Get(qualifiedID);
EClassifier eClassifier = resolveHelper(context, qualifiedID);
if (eClassifier == null)
logError(new EmfaticSemanticError.NameResolutionFailure(qualifiedID));
@@ -574,14 +574,14 @@ import org.eclipse.gymnast.runtime.core.parser.ParseContext;
return null;
}
- private static boolean isClassifier(EGenericType egt) {
- if (egt == null) {
- return false;
- }
- boolean res = (egt.getEClassifier() != null) && (egt.getETypeArguments().size() == 0)
- && (egt.getETypeParameter() == null);
- return res;
- }
+// private static boolean isClassifier(EGenericType egt) {
+// if (egt == null) {
+// return false;
+// }
+// boolean res = (egt.getEClassifier() != null) && (egt.getETypeArguments().size() == 0)
+// && (egt.getETypeParameter() == null);
+// return res;
+// }
private void placeBewInBigMap(final BoundExceptWildcard bew, final EGenericType gt) {
EObject ecoreDecl = getEcoreDeclForTypeRef(gt);
@@ -629,16 +629,16 @@ import org.eclipse.gymnast.runtime.core.parser.ParseContext;
return ecoreDecl;
}
- private ASTNode getCstDeclForTypeRef(EGenericType gt) {
- ASTNode cstDecl = null;
- if (GenericsUtil.isRefToClassifier(gt)) {
- EClassifier c = gt.getEClassifier();
- cstDecl = cstDecl2EcoreAST.getInv(c);
- } else {
- ETypeParameter tp = gt.getETypeParameter();
- cstDecl = cstDecl2EcoreAST.getInv(tp);
- }
- return cstDecl;
- }
+// private ASTNode getCstDeclForTypeRef(EGenericType gt) {
+// ASTNode cstDecl = null;
+// if (GenericsUtil.isRefToClassifier(gt)) {
+// EClassifier c = gt.getEClassifier();
+// cstDecl = cstDecl2EcoreAST.getInv(c);
+// } else {
+// ETypeParameter tp = gt.getETypeParameter();
+// cstDecl = cstDecl2EcoreAST.getInv(tp);
+// }
+// return cstDecl;
+// }
}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/EmfaticGenerator.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/EmfaticGenerator.java
index 3ffdec4..c127458 100644
--- a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/EmfaticGenerator.java
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/EmfaticGenerator.java
@@ -55,7 +55,7 @@ public class EmfaticGenerator {
private Resource getResource(ResourceSet resourceSet, String filePath)
{
- URI uri = URI.createPlatformResourceURI(filePath);
+ URI uri = URI.createPlatformResourceURI(filePath, false);
Resource resource = resourceSet.getResource(uri, true);
return resource;
}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/EcoreWalker.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/EcoreWalker.java
index 17931df..3f6dccb 100644
--- a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/EcoreWalker.java
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/EcoreWalker.java
@@ -59,13 +59,13 @@ public class EcoreWalker {
* the visitor that should visit the expression
* @return
*/
- public EcoreSwitch walk(EModelElement eME, EcoreSwitch v) {
+ public EcoreSwitch<?> walk(EModelElement eME, EcoreSwitch<?> v) {
v.doSwitch(eME);
visitOwnedParts(eME, v);
return v;
}
- private EcoreSwitch visitOwnedParts(EModelElement e, EcoreSwitch v) {
+ private EcoreSwitch<?> visitOwnedParts(EModelElement e, EcoreSwitch<?> v) {
// the annotations
for (Object oa : e.getEAnnotations()) {
EAnnotation a = (EAnnotation) oa;
@@ -127,7 +127,7 @@ public class EcoreWalker {
return v;
}
// it's a non-EEnum EDataType
- EDataType eD = (EDataType) e;
+ //EDataType eD = (EDataType) e;
// the datatype itself was already visited by virtue of it being an
// EClassifier
return v;
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToManyMap.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToManyMap.java
index 786aba6..280ae7c 100644
--- a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToManyMap.java
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToManyMap.java
@@ -46,7 +46,7 @@ public class OneToManyMap<K, V> {
*/
public Set<V> get(K k) {
if (m.get(k) == null) {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
} else {
return m.get(k);
}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticAnnotationMap.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticAnnotationMap.java
index 22aeb48..675d477 100644
--- a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticAnnotationMap.java
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticAnnotationMap.java
@@ -53,12 +53,12 @@ public class EmfaticAnnotationMap {
//
//
- private Hashtable _keyToSourceURI;
- private Hashtable _sourceURIToDetails;
+ private Hashtable<String, String> _keyToSourceURI;
+ private Hashtable<String, SourceURIDetails> _sourceURIToDetails;
public EmfaticAnnotationMap() {
- _keyToSourceURI = new Hashtable();
- _sourceURIToDetails = new Hashtable();
+ _keyToSourceURI = new Hashtable<String, String>();
+ _sourceURIToDetails = new Hashtable<String, SourceURIDetails>();
initPredefinedMappings();
}
@@ -156,11 +156,11 @@ public class EmfaticAnnotationMap {
private static class SourceURIDetails {
private String _sourceURI;
- private Hashtable _keyCountToLabelMapping;
+ private Hashtable<Integer, LabelMapping> _keyCountToLabelMapping;
public SourceURIDetails(String sourceURI) {
_sourceURI = sourceURI;
- _keyCountToLabelMapping = new Hashtable();
+ _keyCountToLabelMapping = new Hashtable<Integer, LabelMapping>();
}
public String getSourceURI() {
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticBasicTypes.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticBasicTypes.java
index 402f1aa..da3224a 100644
--- a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticBasicTypes.java
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticBasicTypes.java
@@ -22,11 +22,9 @@ public class EmfaticBasicTypes {
}
private static void initBasicTypes() {
- _nameToType = new Hashtable();
- _typeToName = new Hashtable();
+ _nameToType = new Hashtable<String, EClassifier>();
+ _typeToName = new Hashtable<EClassifier, String>();
-
-
EcorePackage ecore = EcorePackage.eINSTANCE;
/*
@@ -119,8 +117,8 @@ public class EmfaticBasicTypes {
}
private static boolean _isInitialized = false;
- private static Hashtable _nameToType;
- private static Hashtable _typeToName;
+ private static Hashtable<String, EClassifier> _nameToType;
+ private static Hashtable<EClassifier, String> _typeToName;
private static String _array[];
}

Back to the top