← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20436: Support commons, javadoc

 

------------------------------------------------------------
revno: 20436
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-10-01 15:14:27 +0200
message:
  Support commons, javadoc
modified:
  dhis-2/dhis-support/dhis-support-commons/pom.xml
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/ListUtils.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/CodecUtils.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/Encoder.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/ExpressionFunctions.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/PageRange.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/SqlHelper.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/StreamUtils.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/TextUtils.java
  dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.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-support/dhis-support-commons/pom.xml'
--- dhis-2/dhis-support/dhis-support-commons/pom.xml	2015-09-25 12:29:08 +0000
+++ dhis-2/dhis-support/dhis-support-commons/pom.xml	2015-10-01 13:14:27 +0000
@@ -45,6 +45,26 @@
     </dependency>
     
   </dependencies>
+  
+  <!-- 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>2.10.3</version>
+        <executions>
+          <execution>
+            <id>attach-javadocs</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  -->
 
   <properties>
     <rootDir>../../</rootDir>

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/ListUtils.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/ListUtils.java	2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/ListUtils.java	2015-10-01 13:14:27 +0000
@@ -265,7 +265,7 @@
     }
 
     /**
-     * Converts a List<Double> into a double[].
+     * Converts a List into a double[].
      *
      * @param list the List.
      * @return a double array.

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/CodecUtils.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/CodecUtils.java	2015-07-14 09:49:07 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/CodecUtils.java	2015-10-01 13:14:27 +0000
@@ -52,6 +52,7 @@
      * truncates the string if it is longer than 255 characters.
      * 
      * @param string the string to encode.
+     * @return encoded string.
      */
     public static String databaseEncode( String string )
     {

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/Encoder.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/Encoder.java	2015-07-03 20:43:24 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/Encoder.java	2015-10-01 13:14:27 +0000
@@ -92,6 +92,12 @@
     }
 
     /**
+     * JavaScript-escaped the given String.
+     * 
+     * @param object the object.
+     * @param quoteChar the quote char.
+     * @return the escaped representation.
+     * 
      * See {@link #jsEncode(String)}.
      * @deprecated quoteChar is ignored.
      */

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/ExpressionFunctions.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/ExpressionFunctions.java	2015-09-24 19:49:43 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/ExpressionFunctions.java	2015-10-01 13:14:27 +0000
@@ -119,6 +119,7 @@
      * @param start the start date. 
      * @param end the end date.
      * @return number of days between dates.
+     * @throws ParseException if start or end could not be parsed.
      */
     public static Integer daysBetween( String start, String end )
         throws ParseException

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/PageRange.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/PageRange.java	2015-07-03 20:43:24 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/PageRange.java	2015-10-01 13:14:27 +0000
@@ -82,6 +82,8 @@
     /**
      * Moves the range to the next page. Returns true if the range has another page,
      * false if not.
+     * 
+     * @return true if range has another page, false if not.
      */
     public boolean nextPage()
     {
@@ -102,6 +104,8 @@
 
     /**
      * Returns the number of pages in the list.
+     * 
+     * @return number of pages.
      */
     public int pageCount()
     {       
@@ -122,6 +126,8 @@
     
     /**
      * Returns the current from index, which is closed / inclusive.
+     * 
+     * @return the current from index.
      */
     public int getFromIndex()
     {
@@ -130,6 +136,8 @@
 
     /**
      * Returns the current to index, which is open / exclusive.
+     * 
+     * @return the current to index.
      */
     public int getToIndex()
     {
@@ -143,6 +151,8 @@
     
     /**
      * Returns the page size.
+     * 
+     * @return the page size.
      */
     public int getPageSize()
     {
@@ -152,6 +162,8 @@
     /**
      * Returns a list of all pages. Each item is an array where index 0 holds the
      * from index and index 1 holds the to index. Resets the page.
+     * 
+     * @return a list of all pages.
      */
     public List<int[]> getPages()
     {

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/SqlHelper.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/SqlHelper.java	2015-07-08 07:20:16 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/SqlHelper.java	2015-10-01 13:14:27 +0000
@@ -50,6 +50,8 @@
 
     /**
      * Returns "where" the first time it is invoked, then "and" for subsequent invocations.
+     * 
+     * @return "where" or "and".
      */
     public String whereAnd()
     {
@@ -62,6 +64,8 @@
 
     /**
      * Returns "where" the first time it is invoked, then "or" for subsequent invocations.
+     * 
+     * @return "where" or "or".
      */
     public String whereOr()
     {
@@ -74,6 +78,8 @@
 
     /**
      * Returns "" the first time it is invoked, then "and" for subsequent invocations.
+     * 
+     * @return empty or "and".
      */
     public String and()
     {
@@ -86,6 +92,8 @@
 
     /**
      * Returns "" the first time it is invoked, then "or" for subsequent invocations.
+     * 
+     * @return empty or "or".
      */
     public String or()
     {

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/StreamUtils.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/StreamUtils.java	2015-07-03 20:43:24 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/StreamUtils.java	2015-10-01 13:14:27 +0000
@@ -63,7 +63,7 @@
      * @param file       the file to read from.
      * @param replaceMap a map containing keys to be matched and values with replacements.
      * @return a StringBuffer with the content of the file replaced according to the Map.
-     * @throws IOException
+     * @throws IOException if operation failed.
      */
     public static StringBuffer readContent( File file, Map<String[], String> replaceMap )
         throws IOException
@@ -128,6 +128,7 @@
      *
      * @param in the InputStream.
      * @return the wrapped InputStream.
+     * @throws IOException if operation failed.
      */
     public static InputStream wrapAndCheckCompressionFormat( InputStream in )
         throws IOException
@@ -151,16 +152,13 @@
 
     /**
      * Test for ZIP stream signature.
-     * <p/>
-     * Signature of ZIP stream from
-     * http://www.pkware.com/documents/casestudies/APPNOTE.TXT Local file
-     * header: local file header signature 4 bytes (0x04034b50)
      *
-     * @param instream the BufferedInputStream to test.
+     * @param in the BufferedInputStream to test.
+     * @return true if input stream is zip.
      */
-    public static boolean isZip( BufferedInputStream instream )
+    public static boolean isZip( BufferedInputStream in )
     {
-        instream.mark( 4 );
+        in.mark( 4 );
         byte[] b = new byte[4];
         byte[] zipSig = new byte[4];
         zipSig[0] = 0x50;
@@ -170,7 +168,7 @@
 
         try
         {
-            instream.read( b, 0, 4 );
+            in.read( b, 0, 4 );
         }
         catch ( Exception ex )
         {
@@ -178,7 +176,7 @@
         }
         try
         {
-            instream.reset();
+            in.reset();
         }
         catch ( Exception ex )
         {
@@ -190,12 +188,9 @@
 
     /**
      * Test for GZIP stream signature.
-     * <p/>
-     * Signature of GZIP stream from RFC 1952: ID1 (IDentification 1) ID2
-     * (IDentification 2) These have the fixed values ID1 = 31 (0x1f, \037),
-     * ID2 = 139 (0x8b, \213), to identify the file as being in GZIP format.
      *
      * @param instream the BufferedInputStream to test.
+     * @return true if input stream is gzip.
      */
     public static boolean isGZip( BufferedInputStream instream )
     {
@@ -210,6 +205,7 @@
         {
             throw new RuntimeException( "Couldn't read header from stream ", ex );
         }
+        
         try
         {
             instream.reset();

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/TextUtils.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/TextUtils.java	2015-10-01 10:05:20 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/TextUtils.java	2015-10-01 13:14:27 +0000
@@ -242,6 +242,7 @@
      * trailing spaces.
      * 
      * @param string the string.
+     * @param remove the text to remove.
      * @return the chopped string.
      */
     public static String removeLast( String string, String remove )
@@ -297,6 +298,7 @@
      * Joins the elements of the provided array into a single String containing 
      * the provided list of elements.
      * 
+     * @param <T> type.
      * @param list the list of objects to join.
      * @param separator the separator string.
      * @param nullReplacement the value to replace nulls in list with.

=== modified file 'dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java'
--- dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java	2015-10-01 13:14:27 +0000
@@ -350,7 +350,7 @@
                     return false;
                 }
             } 
-            catch( SecurityException ex ) 
+            catch ( SecurityException ex ) 
             {
                 log.info( "Directory " + directory.getAbsolutePath() + " cannot be accessed" );