dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #40314
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20422: Minor
------------------------------------------------------------
revno: 20422
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-10-01 09:51:29 +0200
message:
Minor
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/fileresource/FileResource.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/DefaultFileResourceContentStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.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/fileresource/FileResource.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/fileresource/FileResource.java 2015-09-21 14:52:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/fileresource/FileResource.java 2015-10-01 07:51:29 +0000
@@ -45,40 +45,40 @@
extends BaseIdentifiableObject
{
/**
- * MIME type
+ * MIME type.
*/
private String contentType;
/**
- * Byte size of content, non negative
+ * Byte size of content, non negative.
*/
private long contentLength;
/**
- * MD5 digest of content
+ * MD5 digest of content.
*/
private String contentMd5;
/**
- * Key used for content storage at external location
+ * Key used for content storage at external location.
*/
private String storageKey;
/**
- * Flag indicating wether the resource is assigned (e.g. to a DataValue) or not.
- * Unassigned FileResources are generally safe to delete when reaching a certain age
- * (unassigned objects might be in staging).
+ * Flag indicating whether the resource is assigned (e.g. to a DataValue) or
+ * not. Unassigned FileResources are generally safe to delete when reaching
+ * a certain age (unassigned objects might be in staging).
*/
private boolean assigned = false;
/**
- * The domain which this FileResource belongs to
+ * The domain which this FileResource belongs to.
*/
private FileResourceDomain domain;
- // ---------------------------------------------------------------------
+ // -------------------------------------------------------------------------
// Constructors
- // ---------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public FileResource()
{
@@ -94,9 +94,9 @@
this.storageKey = generateStorageKey();
}
- // ---------------------------------------------------------------------
+ // -------------------------------------------------------------------------
// Overrides
- // ---------------------------------------------------------------------
+ // -------------------------------------------------------------------------
@Override
public boolean haveUniqueNames()
@@ -104,9 +104,9 @@
return false;
}
- // ---------------------------------------------------------------------
+ // -------------------------------------------------------------------------
// Getters and setters
- // ---------------------------------------------------------------------
+ // -------------------------------------------------------------------------
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@@ -190,9 +190,9 @@
this.domain = domain;
}
- // ---------------------------------------------------------------------
+ // -------------------------------------------------------------------------
// Supportive methods
- // ---------------------------------------------------------------------
+ // -------------------------------------------------------------------------
private String generateStorageKey()
{
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatService.java 2015-09-28 02:56:57 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/preheat/PreheatService.java 2015-10-01 07:51:29 +0000
@@ -42,12 +42,12 @@
*
* @param classes Classes to preheat
*/
- void preheat( Set<Class> classes );
+ void preheat( Set<Class<?>> classes );
/**
* Preheat a specified set of UIDs for a set of classes.
*
* @param classes Class => UID Collection map
*/
- void preheat( Map<Class, Collection<String>> classes );
+ void preheat( Map<Class<?>, Collection<String>> classes );
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java 2015-09-30 08:37:01 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java 2015-10-01 07:51:29 +0000
@@ -28,21 +28,20 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
import org.hisp.dhis.common.Grid;
import org.hisp.dhis.common.IllegalQueryException;
import org.hisp.dhis.common.OrganisationUnitSelectionMode;
import org.hisp.dhis.event.EventStatus;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramStatus;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
import org.hisp.dhis.validation.ValidationCriteria;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
/**
* <p>This interface is responsible for retrieving tracked entity instances (TEI).
* The query methods accepts a TrackedEntityInstanceQueryParams object which
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/DefaultFileResourceContentStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/DefaultFileResourceContentStore.java 2015-09-23 12:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/DefaultFileResourceContentStore.java 2015-10-01 07:51:29 +0000
@@ -126,9 +126,9 @@
public void init()
{
- // -------------------------------------------------------------------------
+ // ---------------------------------------------------------------------
// Parse properties
- // -------------------------------------------------------------------------
+ // ---------------------------------------------------------------------
Map<String, String> fileStoreConfiguration = getFileStorePropertiesMap();
@@ -155,9 +155,9 @@
Credentials credentials = new Credentials( "Unused", "Unused" );
- // -------------------------------------------------------------------------
+ // ---------------------------------------------------------------------
// Provider specific configuration
- // -------------------------------------------------------------------------
+ // ---------------------------------------------------------------------
if ( provider.equals( JCLOUDS_PROVIDER_KEY_FILESYSTEM ) && locationManager.externalDirectorySet() )
{
@@ -166,7 +166,7 @@
else if ( provider.equals( JCLOUDS_PROVIDER_KEY_AWS_S3 ) )
{
credentials = new Credentials( fileStoreConfiguration.getOrDefault(
- KEY_FILE_STORE_IDENTITY, "" ), fileStoreConfiguration.getOrDefault( KEY_FILE_STORE_SECRET, "" ) );
+ KEY_FILE_STORE_IDENTITY, StringUtils.EMPTY ), fileStoreConfiguration.getOrDefault( KEY_FILE_STORE_SECRET, StringUtils.EMPTY ) );
if ( credentials.identity.isEmpty() || credentials.credential.isEmpty() )
{
@@ -174,9 +174,9 @@
}
}
- // -------------------------------------------------------------------------
+ // ---------------------------------------------------------------------
// Set up JClouds context
- // -------------------------------------------------------------------------
+ // ---------------------------------------------------------------------
blobStoreContext = ContextBuilder.newBuilder( provider )
.credentials( credentials.identity, credentials.credential )
@@ -190,7 +190,7 @@
blobStore.createContainerInLocation( configuredLocation.isPresent() ? configuredLocation.get() : null, container );
log.info( "File store configured with provider '" + provider + "' and container '" + container + "'. " +
- ( configuredLocation.isPresent() ? "Provider location: " + configuredLocation.get().getId() : "" ) );
+ ( configuredLocation.isPresent() ? "Provider location: " + configuredLocation.get().getId() : StringUtils.EMPTY ) );
}
public void cleanUp()
@@ -211,7 +211,7 @@
return null;
}
- ByteSource byteSource = new ByteSource()
+ final ByteSource byteSource = new ByteSource()
{
@Override
public InputStream openStream()
@@ -316,7 +316,8 @@
return provider;
}
- private boolean isValidContainerName( String containerName ) {
+ private boolean isValidContainerName( String containerName )
+ {
return containerName != null && CONTAINER_NAME_PATTERN.matcher( containerName ).matches();
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java 2015-09-28 02:56:57 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/preheat/DefaultPreheatService.java 2015-10-01 07:51:29 +0000
@@ -28,35 +28,31 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
import org.hisp.dhis.common.IdentifiableObjectManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
*/
@Transactional
public class DefaultPreheatService implements PreheatService
{
- private static final Log log = LogFactory.getLog( DefaultPreheatService.class );
-
@Autowired
private IdentifiableObjectManager identifiableObjectManager;
@Override
- public void preheat( Set<Class> classes )
+ public void preheat( Set<Class<?>> classes )
{
reset();
}
@Override
- public void preheat( Map<Class, Collection<String>> classes )
+ public void preheat( Map<Class<?>, Collection<String>> classes )
{
reset();
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java 2015-09-30 18:50:42 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java 2015-10-01 07:51:29 +0000
@@ -236,7 +236,7 @@
if ( fileResource.isAssigned() )
{
- throw new WebMessageException( WebMessageUtils.conflict( "File resource is already assigned or is linked to another data value" ) );
+ throw new WebMessageException( WebMessageUtils.conflict( "File resource already assigned or linked to another data value" ) );
}
fileResource.setAssigned( true );