tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r747242 - /tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java
Date Tue, 24 Feb 2009 00:58:29 GMT
Author: rfeng
Date: Tue Feb 24 00:58:29 2009
New Revision: 747242

URL: http://svn.apache.org/viewvc?rev=747242&view=rev
Log:
Minor clean up

Modified:
    tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java

Modified: tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java?rev=747242&r1=747241&r2=747242&view=diff
==============================================================================
--- tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java
(original)
+++ tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java
Tue Feb 24 00:58:29 2009
@@ -99,26 +99,6 @@
     }
 
     /**
-     * Report a error.
-     * 
-     * @param problems
-     * @param message
-     * @param model
-     */
-    private void error(String message, Object model, Object... messageParameters) {
-        if (monitor != null) {
-            Problem problem =
-                monitor.createProblem(this.getClass().getName(),
-                                      "definitions-xml-validation-messages",
-                                      Severity.ERROR,
-                                      model,
-                                      message,
-                                      (Object[])messageParameters);
-            monitor.problem(problem);
-        }
-    }
-
-    /**
      * Report a exception.
      * 
      * @param problems
@@ -200,21 +180,23 @@
         }
     }
 
-    private static void stripDuplicates(Definitions scaDefns) {
-        Set<Intent> definedIntents = new HashSet<Intent>(scaDefns.getIntents());
-        Set<PolicySet> definedPolicySets = new HashSet<PolicySet>(scaDefns.getPolicySets());
-
-        Set<BindingType> definedBindingTypes = new HashSet<BindingType>(scaDefns.getBindingTypes());
-        Set<ImplementationType> definedImplTypes = new HashSet<ImplementationType>(scaDefns.getImplementationTypes());
-
-        scaDefns.getIntents().clear();
-        scaDefns.getIntents().addAll(definedIntents);
-        scaDefns.getPolicySets().clear();
-        scaDefns.getPolicySets().addAll(definedPolicySets);
-        scaDefns.getBindingTypes().clear();
-        scaDefns.getBindingTypes().addAll(definedBindingTypes);
-        scaDefns.getImplementationTypes().clear();
-        scaDefns.getImplementationTypes().addAll(definedImplTypes);
+    // FIXME: [rfeng] We need to validate the definitions against the Conformance Items
+    // defined by the SCA Policy Framework Spec V1.1
+    private static void stripDuplicates(Definitions definitions) {
+        Set<Intent> intents = new HashSet<Intent>(definitions.getIntents());
+        Set<PolicySet> policySets = new HashSet<PolicySet>(definitions.getPolicySets());
+
+        Set<BindingType> bindingTypes = new HashSet<BindingType>(definitions.getBindingTypes());
+        Set<ImplementationType> implementationTypes = new HashSet<ImplementationType>(definitions.getImplementationTypes());
+
+        definitions.getIntents().clear();
+        definitions.getIntents().addAll(intents);
+        definitions.getPolicySets().clear();
+        definitions.getPolicySets().addAll(policySets);
+        definitions.getBindingTypes().clear();
+        definitions.getBindingTypes().addAll(bindingTypes);
+        definitions.getImplementationTypes().clear();
+        definitions.getImplementationTypes().addAll(implementationTypes);
     }
 
     public void resolve(Definitions scaDefinitions, ModelResolver resolver) throws ContributionResolveException
{



Mime
View raw message