syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1333959 - /incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java
Date Fri, 04 May 2012 13:42:40 GMT
Author: rene
Date: Fri May  4 13:42:40 2012
New Revision: 1333959

URL: http://svn.apache.org/viewvc?rev=1333959&view=rev
Log:
sonar: clean up inline if statement in assignment

Modified:
    incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java

Modified: incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java?rev=1333959&r1=1333958&r2=1333959&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java
(original)
+++ incubator/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java
Fri May  4 13:42:40 2012
@@ -176,10 +176,13 @@ public class ResourceMappingPanel extend
 
                 final SchemaMappingTO mappingTO = item.getModelObject();
 
-                final AttributableType entity = mappingTO.getIntMappingType() == null
-                        ? null
-                        : mappingTO.getIntMappingType().getAttributableType();
-
+                final AttributableType entity;
+                if (mappingTO.getIntMappingType() != null){
+                    entity = mappingTO.getIntMappingType().getAttributableType();
+                } else {
+                    entity = null;
+                }
+                        
                 attrTypes = getAttributeTypes(entity);
 
                 item.add(new AjaxDecoratedCheckbox("toRemove", new Model(Boolean.FALSE))
{
@@ -274,7 +277,11 @@ public class ResourceMappingPanel extend
                     ((AjaxDropDownChoicePanel) extAttrName).setChoices(schemaNames);
                 }
 
-                boolean required = mappingTO != null && !mappingTO.isAccountid()
&& !mappingTO.isPassword();
+                boolean required = false;
+                if (mappingTO != null && !mappingTO.isAccountid() && !mappingTO.isPassword())
{
+                    required = true;
+                }
+                
 
                 extAttrName.setRequired(required);
                 extAttrName.setEnabled(required);



Mime
View raw message