From 89554d72bc2121e0301ea5db09c558119da84205 Mon Sep 17 00:00:00 2001 From: acuccuru Date: Fri, 22 Jul 2011 07:59:10 +0000 Subject: Merged with branch --- .../org.eclipse.papyrus.operation.editor.xtext/.classpath | 4 ++-- .../editor/xtext/scoping/OperationEditorScopingTool.java | 12 ++---------- .../editor/xtext/validation/OperationJavaValidator.java | 8 ++++---- .../typing/OperationEditorMultiplicityFacadeFactory.java | 12 ++++++------ 4 files changed, 14 insertions(+), 22 deletions(-) (limited to 'extraplugins/alf') diff --git a/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/.classpath b/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/.classpath index 48aa7f6e91a..2f6f3f6d779 100644 --- a/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/.classpath +++ b/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/.classpath @@ -1,9 +1,9 @@ + + - - diff --git a/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/scoping/OperationEditorScopingTool.java b/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/scoping/OperationEditorScopingTool.java index 2052775bb02..fd2d14938f2 100644 --- a/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/scoping/OperationEditorScopingTool.java +++ b/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/scoping/OperationEditorScopingTool.java @@ -702,20 +702,12 @@ public class OperationEditorScopingTool extends AbstractScopingTool{ } nestedList = removeDuplicateClassifiers(nestedList) ; nestedScopes.add(nestedList) ; - - // Then process the implicit import of alf library - nestedList = new ArrayList() ; - if (AlfJavaValidator.getAlfStandardLibrary() != null) { - List importedClassifiers = processPublicallyImportedClassifiers(AlfJavaValidator.getAlfStandardLibrary()) ; - importedClassifiers = removeDuplicateClassifiers(importedClassifiers) ; - nestedList.addAll(importedClassifiers) ; - nestedScopes.add(nestedList) ; - } // Then process the implicit import of alf library nestedList = new ArrayList() ; if (AlfJavaValidator.getAlfStandardLibrary() != null) { List importedClassifiers = processPublicallyImportedClassifiers(AlfJavaValidator.getAlfStandardLibrary()) ; + /** to be uncommented when templates are supported importedClassifiers.add(TypeUtils._Collection.extractActualType()) ; importedClassifiers.add(TypeUtils._Set.extractActualType()) ; importedClassifiers.add(TypeUtils._Bag.extractActualType()) ; @@ -724,7 +716,7 @@ public class OperationEditorScopingTool extends AbstractScopingTool{ importedClassifiers.add(TypeUtils._List.extractActualType()) ; importedClassifiers.add(TypeUtils._Deque.extractActualType()) ; importedClassifiers.add(TypeUtils._Map.extractActualType()) ; - importedClassifiers.add(TypeUtils._Entry.extractActualType()) ; + importedClassifiers.add(TypeUtils._Entry.extractActualType()) ; */ nestedList.addAll(removeDuplicateClassifiers(importedClassifiers)) ; nestedScopes.add(nestedList) ; } diff --git a/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/validation/OperationJavaValidator.java b/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/validation/OperationJavaValidator.java index 0e8b65f7ff9..08d13725cb8 100644 --- a/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/validation/OperationJavaValidator.java +++ b/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/validation/OperationJavaValidator.java @@ -152,7 +152,7 @@ public class OperationJavaValidator extends AbstractOperationJavaValidator { lower += range.getLower().getValue() ; if (range.getUpper() != null) upper += range.getUpper().getValue() ; - if (! upper.isEmpty()) { + if (! (upper.length() == 0)) { if (upper.equals("*")) upperValue = -1 ; // multiplicity is valid else { @@ -165,7 +165,7 @@ public class OperationJavaValidator extends AbstractOperationJavaValidator { } } } - if (! lower.isEmpty()) { + if (! (lower.length() == 0)) { if (lower.equals("*")) { error("Invalid lower bound", range, OperationPackage.eINSTANCE.getMultiplicityRange_Lower(), INSIGNIFICANT_INDEX) ; valid_return_parameter = true ; @@ -244,7 +244,7 @@ public class OperationJavaValidator extends AbstractOperationJavaValidator { lower += range.getLower().getValue() ; if (range.getUpper() != null) upper += range.getUpper().getValue() ; - if (! upper.isEmpty()) { + if (! (upper.length() == 0)) { if (upper.equals("*")) upperValue = -1 ; // multiplicity is valid else { @@ -257,7 +257,7 @@ public class OperationJavaValidator extends AbstractOperationJavaValidator { } } } - if (! lower.isEmpty()) { + if (! (lower.length() == 0)) { if (lower.equals("*")) { error("Invalid lower bound", range, OperationPackage.eINSTANCE.getMultiplicityRange_Lower(), INSIGNIFICANT_INDEX) ; valid_formal_parameters = false ; diff --git a/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/validation/typing/OperationEditorMultiplicityFacadeFactory.java b/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/validation/typing/OperationEditorMultiplicityFacadeFactory.java index be3eeb8b38b..429b7ae579a 100644 --- a/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/validation/typing/OperationEditorMultiplicityFacadeFactory.java +++ b/extraplugins/alf/org.eclipse.papyrus.operation.editor.xtext/src/org/eclipse/papyrus/operation/editor/xtext/validation/typing/OperationEditorMultiplicityFacadeFactory.java @@ -47,7 +47,7 @@ public class OperationEditorMultiplicityFacadeFactory extends MultiplicityFacade } int lowerValue = 1 ; int upperValue = 1 ; - if (!lower.isEmpty()) { + if (!(lower.length() == 0)) { if (lower.equals("*")) lowerValue = -1 ; else { @@ -57,7 +57,7 @@ public class OperationEditorMultiplicityFacadeFactory extends MultiplicityFacade catch (Exception e) {} } } - if (!upper.isEmpty()) { + if (!(upper.length() == 0)) { if (upper.equals("*")) { upperValue = -1 ; } @@ -67,7 +67,7 @@ public class OperationEditorMultiplicityFacadeFactory extends MultiplicityFacade } catch (Exception e) {} } - if (lower.isEmpty()) + if (lower.length() == 0) lowerValue = upperValue ; } boolean isOrdered ; @@ -99,7 +99,7 @@ public class OperationEditorMultiplicityFacadeFactory extends MultiplicityFacade } int lowerValue = 1 ; int upperValue = 1 ; - if (!lower.isEmpty()) { + if (!(lower.length() == 0)) { if (lower.equals("*")) lowerValue = -1 ; else { @@ -109,7 +109,7 @@ public class OperationEditorMultiplicityFacadeFactory extends MultiplicityFacade catch (Exception e) {} } } - if (!upper.isEmpty()) { + if (!(upper.length() == 0)) { if (upper.equals("*")) { upperValue = -1 ; } @@ -119,7 +119,7 @@ public class OperationEditorMultiplicityFacadeFactory extends MultiplicityFacade } catch (Exception e) {} } - if (lower.isEmpty()) + if (lower.length() == 0) lowerValue = upperValue ; } boolean isUnique ; -- cgit v1.2.3