← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21695: Constant

 

------------------------------------------------------------
revno: 21695
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-01-11 19:08:08 +0100
message:
  Constant
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdScheme.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdScheme.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdScheme.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdScheme.java	2016-01-11 18:08:08 +0000
@@ -53,6 +53,8 @@
         put( IdentifiableProperty.CODE, IdScheme.CODE ).
         put( IdentifiableProperty.NAME, IdScheme.NAME ).build();
     
+    private static final String ATTR_ID_SCHEME_PREFIX = "ATTRIBUTE:";
+    
     private IdentifiableProperty identifiableProperty;
 
     private String attribute;
@@ -151,7 +153,7 @@
 
     public static boolean isAttribute( String str )
     {
-        return !StringUtils.isEmpty( str ) && str.toUpperCase().startsWith( "ATTRIBUTE:" ) && str.length() == 21;
+        return !StringUtils.isEmpty( str ) && str.toUpperCase().startsWith( ATTR_ID_SCHEME_PREFIX ) && str.length() == 21;
     }
 
     @Override