You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2012/12/04 12:01:05 UTC

svn commit: r1416878 - in /syncope/trunk: ./ client/src/main/java/org/apache/syncope/client/util/ console/src/main/java/org/apache/syncope/console/pages/panels/ core/src/main/java/org/apache/syncope/core/persistence/beans/ core/src/test/java/org/apache...

Author: ilgrosso
Date: Tue Dec  4 11:01:03 2012
New Revision: 1416878

URL: http://svn.apache.org/viewvc?rev=1416878&view=rev
Log:
Merge from 1_0_X + solving some unchecked casts

Modified:
    syncope/trunk/   (props changed)
    syncope/trunk/client/src/main/java/org/apache/syncope/client/util/XMLSerializer.java
    syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/DerivedAttributesPanel.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttr.java
    syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java
    syncope/trunk/pom.xml

Propchange: syncope/trunk/
------------------------------------------------------------------------------
  Merged /syncope/branches/1_0_X:r1415194-1416867

Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/util/XMLSerializer.java
URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/util/XMLSerializer.java?rev=1416878&r1=1416877&r2=1416878&view=diff
==============================================================================
--- syncope/trunk/client/src/main/java/org/apache/syncope/client/util/XMLSerializer.java (original)
+++ syncope/trunk/client/src/main/java/org/apache/syncope/client/util/XMLSerializer.java Tue Dec  4 11:01:03 2012
@@ -26,11 +26,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Helper class for serialization and deserialization of configuration objects,
- * empowering XStream.
+ * Helper class for serialization and deserialization of configuration objects, empowering XStream.
+ *
  * @see http://xstream.codehaus.org/
  */
-public class XMLSerializer {
+public final class XMLSerializer {
 
     private static final Logger LOG = LoggerFactory.getLogger(XMLSerializer.class);
 
@@ -47,8 +47,8 @@ public class XMLSerializer {
         return result;
     }
 
+    @SuppressWarnings("unchecked")
     public static <T extends Object> T deserialize(final String serialized) {
-
         T result = null;
 
         XStream xstream = new XStream();
@@ -60,4 +60,7 @@ public class XMLSerializer {
 
         return result;
     }
+
+    private XMLSerializer() {
+    }
 }

Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/DerivedAttributesPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/DerivedAttributesPanel.java?rev=1416878&r1=1416877&r2=1416878&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/DerivedAttributesPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/DerivedAttributesPanel.java Tue Dec  4 11:01:03 2012
@@ -63,7 +63,6 @@ public class DerivedAttributesPanel exte
     private SchemaRestClient schemaRestClient;
 
     public <T extends AbstractAttributableTO> DerivedAttributesPanel(final String id, final T entityTO) {
-
         super(id);
         setOutputMarkupId(true);
 
@@ -107,7 +106,7 @@ public class DerivedAttributesPanel exte
         };
 
         add(addAttributeBtn.setDefaultFormProcessing(Boolean.FALSE));
-        
+
         final ListView<AttributeTO> attributes = new ListView<AttributeTO>("attributes",
                 new PropertyModel<List<? extends AttributeTO>>(entityTO, "derivedAttributes")) {
 
@@ -117,7 +116,7 @@ public class DerivedAttributesPanel exte
             protected void populateItem(final ListItem<AttributeTO> item) {
                 final AttributeTO attributeTO = item.getModelObject();
 
-                item.add(new  AjaxDecoratedCheckbox("toRemove", new Model<Boolean>(Boolean.FALSE)) {
+                item.add(new AjaxDecoratedCheckbox("toRemove", new Model<Boolean>(Boolean.FALSE)) {
 
                     private static final long serialVersionUID = 7170946748485726506L;
 
@@ -128,14 +127,15 @@ public class DerivedAttributesPanel exte
                     }
 
                     @Override
-                    protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+                    protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
                         super.updateAjaxAttributes(attributes);
 
                         IAjaxCallListener ajaxCallListener = new AjaxCallListener() {
+
                             private static final long serialVersionUID = 7160235486520935153L;
 
                             @Override
-                            public CharSequence getPrecondition(Component component) { 
+                            public CharSequence getPrecondition(final Component component) {
                                 return "if (!confirm('" + getString("confirmDelete") + "')) return false;";
                             }
                         };
@@ -164,11 +164,12 @@ public class DerivedAttributesPanel exte
                 item.add(schemaChoice);
 
                 final List<String> values = attributeTO.getValues();
-
                 if (values == null || values.isEmpty()) {
-                    item.add(new TextField("value", new Model(null)).setVisible(Boolean.FALSE));
+                    item.add(new TextField<String>("value",
+                            new Model<String>(null)).setVisible(Boolean.FALSE));
                 } else {
-                    item.add(new TextField("value", new Model(values.get(0))).setEnabled(Boolean.FALSE));
+                    item.add(new TextField<String>("value",
+                            new Model<String>(values.get(0))).setEnabled(Boolean.FALSE));
                 }
             }
         };

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttr.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttr.java?rev=1416878&r1=1416877&r2=1416878&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttr.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttr.java Tue Dec  4 11:01:03 2012
@@ -34,6 +34,7 @@ public abstract class AbstractAttr exten
 
     public abstract Long getId();
 
+    @SuppressWarnings("unchecked")
     public <T extends AbstractAttrValue> T addValue(final String value, final AttributableUtil attributableUtil)
             throws InvalidAttrValueException {
 
@@ -74,13 +75,13 @@ public abstract class AbstractAttr exten
 
     public List<String> getValuesAsStrings() {
         List<String> result;
-        if (getUniqueValue() != null) {
-            result = Collections.singletonList(getUniqueValue().getValueAsString());
-        } else {
+        if (getUniqueValue() == null) {
             result = new ArrayList<String>(getValues().size());
             for (AbstractAttrValue attributeValue : getValues()) {
                 result.add(attributeValue.getValueAsString());
             }
+        } else {
+            result = Collections.singletonList(getUniqueValue().getValueAsString());
         }
 
         return result;

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java?rev=1416878&r1=1416877&r2=1416878&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java Tue Dec  4 11:01:03 2012
@@ -41,8 +41,8 @@ public class ReportTestITCase extends Ab
 
     @Test
     public void getReportletClasses() {
-        Set<String> reportletClasses = restTemplate.getForObject(BASE_URL + "report/reportletConfClasses.json",
-                Set.class);
+        List<String> reportletClasses = Arrays.asList(restTemplate.getForObject(
+                BASE_URL + "report/reportletConfClasses.json", String[].class));
         assertNotNull(reportletClasses);
         assertFalse(reportletClasses.isEmpty());
     }

Modified: syncope/trunk/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/pom.xml?rev=1416878&r1=1416877&r2=1416878&view=diff
==============================================================================
--- syncope/trunk/pom.xml (original)
+++ syncope/trunk/pom.xml Tue Dec  4 11:01:03 2012
@@ -755,6 +755,7 @@ under the License.
             <target>${targetJdk}</target>
             <showWarnings>true</showWarnings>
             <showDeprecation>true</showDeprecation>
+            <!--<compilerArgument>-Xlint:unchecked</compilerArgument>-->
           </configuration>
         </plugin>
         <plugin>
@@ -982,7 +983,7 @@ under the License.
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-enforcer-plugin</artifactId>
-        <version>1.1.1</version>
+        <version>1.2</version>
         <executions>
           <execution>
             <id>enforce-java</id>