Doh, thought we got all these in already... Noticing other problems with the
release process now... webapp wars are supposed to be skinny by default and
are being filled with lib jars.  Looks to be more issues to rectify.

Mark

On Mon, Apr 6, 2009 at 3:52 PM, <[email protected]> wrote:

> Revision: 3684
>          http://dspace.svn.sourceforge.net/dspace/?rev=3684&view=rev
> Author:   grahamtriggs
> Date:     2009-04-06 22:52:38 +0000 (Mon, 06 Apr 2009)
>
> Log Message:
> -----------
> Fix various critical bugs identified by Findbugs.
>
> Modified Paths:
> --------------
>    branches/dspace-1_5_x/dspace/CHANGES
>
>  branches/dspace-1_5_x/dspace-api/src/main/java/org/dspace/event/Event.java
>
>  
> branches/dspace-1_5_x/dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/servlet/SitemapServlet.java
>
>  
> branches/dspace-1_5_x/dspace-lni/dspace-lni-client/src/main/java/LNISmokeTest.java
>
>  
> branches/dspace-1_5_x/dspace-lni/dspace-lni-client/src/main/java/org/dspace/app/dav/client/LNIRemoteException.java
>
>  
> branches/dspace-1_5_x/dspace-sword/dspace-sword-api/src/main/java/org/purl/sword/base/SWORDErrorDocument.java
>
>  
> branches/dspace-1_5_x/dspace-sword/dspace-sword-api/src/main/java/org/purl/sword/server/DepositServlet.java
>
>  
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowEPersonUtils.java
>
>  
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/HttpServletRequestCocoonWrapper.java
>
>  
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/PropertyFileReader.java
>
> Modified: branches/dspace-1_5_x/dspace/CHANGES
> ===================================================================
> --- branches/dspace-1_5_x/dspace/CHANGES        2009-04-06 22:15:05 UTC
> (rev 3683)
> +++ branches/dspace-1_5_x/dspace/CHANGES        2009-04-06 22:52:38 UTC
> (rev 3684)
> @@ -1,3 +1,5 @@
> +(Graham Triggs)
> + - Fixes for critical bugs identified by Findbugs
>
>  (Mark Diggory)
>  - [DS-100] XMLUI OpenURL support contributed by the National Evolutionary
> Synthesis Center (NESCent) and @mire.
>
> Modified:
> branches/dspace-1_5_x/dspace-api/src/main/java/org/dspace/event/Event.java
> ===================================================================
> ---
> branches/dspace-1_5_x/dspace-api/src/main/java/org/dspace/event/Event.java
>  2009-04-06 22:15:05 UTC (rev 3683)
> +++
> branches/dspace-1_5_x/dspace-api/src/main/java/org/dspace/event/Event.java
>  2009-04-06 22:52:38 UTC (rev 3684)
> @@ -406,7 +406,7 @@
>      */
>     public static int parseObjectType(String s)
>     {
> -        if (s.equals("*") | s.equalsIgnoreCase("all"))
> +        if ("*".equals(s) || "all".equalsIgnoreCase(s))
>             return ALL_OBJECTS_MASK;
>         else
>         {
> @@ -450,7 +450,7 @@
>      */
>     public static int parseEventType(String s)
>     {
> -        if (s.equals("*") | s.equalsIgnoreCase("all"))
> +        if ("*".equals(s) || "all".equalsIgnoreCase(s))
>         {
>             int result = 0;
>             for (int i = 0; i < eventTypeText.length; ++i)
>
> Modified:
> branches/dspace-1_5_x/dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/servlet/SitemapServlet.java
> ===================================================================
> ---
> branches/dspace-1_5_x/dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/servlet/SitemapServlet.java
>  2009-04-06 22:15:05 UTC (rev 3683)
> +++
> branches/dspace-1_5_x/dspace-jspui/dspace-jspui-api/src/main/java/org/dspace/app/webui/servlet/SitemapServlet.java
>  2009-04-06 22:52:38 UTC (rev 3684)
> @@ -141,15 +141,21 @@
>
>         // Pipe the bits
>         InputStream is = new FileInputStream(f);
> +        try
> +        {
> +            // Set the response MIME type
> +            response.setContentType(mimeType);
>
> -        // Set the response MIME type
> -        response.setContentType(mimeType);
> +            // Response length
> +            response.setHeader("Content-Length",
> String.valueOf(f.length()));
>
> -        // Response length
> -        response.setHeader("Content-Length", String.valueOf(f.length()));
> -
> -        Utils.bufferedCopy(is, response.getOutputStream());
> -        is.close();
> +            Utils.bufferedCopy(is, response.getOutputStream());
> +        }
> +        finally
> +        {
> +            is.close();
> +        }
> +
>         response.getOutputStream().flush();
>     }
>  }
>
> Modified:
> branches/dspace-1_5_x/dspace-lni/dspace-lni-client/src/main/java/LNISmokeTest.java
> ===================================================================
> ---
> branches/dspace-1_5_x/dspace-lni/dspace-lni-client/src/main/java/LNISmokeTest.java
>  2009-04-06 22:15:05 UTC (rev 3683)
> +++
> branches/dspace-1_5_x/dspace-lni/dspace-lni-client/src/main/java/LNISmokeTest.java
>  2009-04-06 22:52:38 UTC (rev 3684)
> @@ -552,9 +552,12 @@
>
>         InputStream in = new FileInputStream(source);
>         OutputStream out = conn.getOutputStream();
> -        copyStream(in, out);
> -        in.close();
> -        out.close();
> +        try {
> +            copyStream(in, out);
> +        } finally {
> +            in.close();
> +            out.close();
> +        }
>
>         int status = conn.getResponseCode();
>         if (status < 200 || status >= 300)
>
> Modified:
> branches/dspace-1_5_x/dspace-lni/dspace-lni-client/src/main/java/org/dspace/app/dav/client/LNIRemoteException.java
> ===================================================================
> ---
> branches/dspace-1_5_x/dspace-lni/dspace-lni-client/src/main/java/org/dspace/app/dav/client/LNIRemoteException.java
>  2009-04-06 22:15:05 UTC (rev 3683)
> +++
> branches/dspace-1_5_x/dspace-lni/dspace-lni-client/src/main/java/org/dspace/app/dav/client/LNIRemoteException.java
>  2009-04-06 22:52:38 UTC (rev 3684)
> @@ -28,7 +28,7 @@
>      *
>      * @return cause1
>      */
> -    public java.lang.Object getCause1() {
> +    public synchronized java.lang.Object getCause1() {
>         return cause1;
>     }
>
> @@ -38,7 +38,7 @@
>      *
>      * @param cause1
>      */
> -    public void setCause1(java.lang.Object cause1) {
> +    public synchronized void setCause1(java.lang.Object cause1) {
>         this.cause1 = cause1;
>     }
>
> @@ -48,7 +48,7 @@
>      *
>      * @return message1
>      */
> -    public java.lang.String getMessage1() {
> +    public synchronized java.lang.String getMessage1() {
>         return message1;
>     }
>
> @@ -58,7 +58,7 @@
>      *
>      * @param message1
>      */
> -    public void setMessage1(java.lang.String message1) {
> +    public synchronized void setMessage1(java.lang.String message1) {
>         this.message1 = message1;
>     }
>
> @@ -66,7 +66,6 @@
>     public synchronized boolean equals(java.lang.Object obj) {
>         if (!(obj instanceof LNIRemoteException)) return false;
>         LNIRemoteException other = (LNIRemoteException) obj;
> -        if (obj == null) return false;
>         if (this == obj) return true;
>         if (__equalsCalc != null) {
>             return (__equalsCalc == obj);
>
> Modified:
> branches/dspace-1_5_x/dspace-sword/dspace-sword-api/src/main/java/org/purl/sword/base/SWORDErrorDocument.java
> ===================================================================
> ---
> branches/dspace-1_5_x/dspace-sword/dspace-sword-api/src/main/java/org/purl/sword/base/SWORDErrorDocument.java
>       2009-04-06 22:15:05 UTC (rev 3683)
> +++
> branches/dspace-1_5_x/dspace-sword/dspace-sword-api/src/main/java/org/purl/sword/base/SWORDErrorDocument.java
>       2009-04-06 22:52:38 UTC (rev 3684)
> @@ -241,10 +241,10 @@
>          if(errorURI.startsWith("http://purl.org/net/sword/error/";))
>          {
>              // check that the list of codes
> -             if( ! (errorURI.equals(ErrorCodes.ERROR_CONTENT) |
> -                    errorURI.equals(ErrorCodes.ERROR_CHECKSUM_MISMATCH) |
> -                    errorURI.equals(ErrorCodes.ERROR_BAD_REQUEST) |
> -                    errorURI.equals(ErrorCodes.TARGET_OWNER_UKNOWN) |
> +             if( ! (errorURI.equals(ErrorCodes.ERROR_CONTENT) ||
> +                    errorURI.equals(ErrorCodes.ERROR_CHECKSUM_MISMATCH) ||
> +                    errorURI.equals(ErrorCodes.ERROR_BAD_REQUEST) ||
> +                    errorURI.equals(ErrorCodes.TARGET_OWNER_UKNOWN) ||
>                     errorURI.equals(ErrorCodes.MEDIATION_NOT_ALLOWED)) )
>              {
>                  info.addValidationInfo(new SwordValidationInfo(xmlName,
>
> Modified:
> branches/dspace-1_5_x/dspace-sword/dspace-sword-api/src/main/java/org/purl/sword/server/DepositServlet.java
> ===================================================================
> ---
> branches/dspace-1_5_x/dspace-sword/dspace-sword-api/src/main/java/org/purl/sword/server/DepositServlet.java
> 2009-04-06 22:15:05 UTC (rev 3683)
> +++
> branches/dspace-1_5_x/dspace-sword/dspace-sword-api/src/main/java/org/purl/sword/server/DepositServlet.java
> 2009-04-06 22:52:38 UTC (rev 3684)
> @@ -216,13 +216,16 @@
>                                        + request.getRemoteAddr() + "-" +
> counter.addAndGet(1);
>                        InputStream inputStream = request.getInputStream();
>                        OutputStream outputStream = new
> FileOutputStream(filename);
> -                       int data;
> -                       while ((data = inputStream.read()) != -1) {
> -                               outputStream.write(data);
> -                       }
> -                       inputStream.close();
> -                       outputStream.close();
> -
> +            try {
> +                int data;
> +                while ((data = inputStream.read()) != -1) {
> +                    outputStream.write(data);
> +                }
> +            } finally {
> +                inputStream.close();
> +                outputStream.close();
> +            }
> +
>                        // Check the size is OK
>                        File file = new File(filename);
>                    long fLength = file.length() / 1024;
>
> Modified:
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowEPersonUtils.java
> ===================================================================
> ---
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowEPersonUtils.java
>  2009-04-06 22:15:05 UTC (rev 3683)
> +++
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowEPersonUtils.java
>  2009-04-06 22:52:38 UTC (rev 3684)
> @@ -192,7 +192,7 @@
>                EPerson personModified = EPerson.find(context, epersonID);
>
>                // Make sure the email address we are changing to is unique
> -               if (personModified.getEmail() != email)
> +               if (!personModified.getEmail().equals(email))
>                {
>                        EPerson potentialDupicate =
> EPerson.findByEmail(context,email);
>
> @@ -207,13 +207,13 @@
>                                return result;
>                        }
>                }
> -               if (personModified.getFirstName() != first) {
> +               if (!personModified.getFirstName().equals(first)) {
>                        personModified.setFirstName(first);
>                }
> -               if (personModified.getLastName() != last) {
> +               if (!personModified.getLastName().equals(last)) {
>                        personModified.setLastName(last);
>                }
> -               if (personModified.getMetadata("phone") != phone) {
> +               if (!personModified.getMetadata("phone").equals(phone)) {
>                        personModified.setMetadata("phone", phone);
>                }
>                personModified.setCanLogIn(login);
>
> Modified:
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/HttpServletRequestCocoonWrapper.java
> ===================================================================
> ---
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/HttpServletRequestCocoonWrapper.java
>  2009-04-06 22:15:05 UTC (rev 3683)
> +++
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/HttpServletRequestCocoonWrapper.java
>  2009-04-06 22:52:38 UTC (rev 3684)
> @@ -152,11 +152,11 @@
>        }
>
>        public String getRemoteUser() {
> -               return this.getRemoteUser();
> +               return this.cocoonRequest.getRemoteUser();
>        }
>
>        public String getRequestURI() {
> -               return this.getRequestURI();
> +               return this.cocoonRequest.getRequestURI();
>        }
>
>        public StringBuffer getRequestURL() {
> @@ -168,15 +168,15 @@
>        }
>
>        public String getServletPath() {
> -               return this.getServletPath();
> +               return this.cocoonRequest.getServletPath();
>        }
>
>        public HttpSession getSession() {
> -               return this.getSession();
> +               return (HttpSession) this.cocoonRequest.getSession();
>        }
>
>        public HttpSession getSession(boolean arg0) {
> -               return this.getSession(arg0);
> +               return (HttpSession) this.cocoonRequest.getSession(arg0);
>        }
>
>        public Principal getUserPrincipal() {
>
> Modified:
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/PropertyFileReader.java
> ===================================================================
> ---
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/PropertyFileReader.java
>       2009-04-06 22:15:05 UTC (rev 3683)
> +++
> branches/dspace-1_5_x/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/cocoon/PropertyFileReader.java
>       2009-04-06 22:52:38 UTC (rev 3684)
> @@ -76,8 +76,11 @@
>
>                Properties props = new Properties();
>                InputStream in = new FileInputStream(propertyFile);
> -               props.load(in);
> -               in.close();
> +        try {
> +                   props.load(in);
> +        } finally {
> +                   in.close();
> +        }
>
>                final String[] parameterNames = parameters.getNames();
>
>
>
> This was sent by the SourceForge.net collaborative development platform,
> the world's largest Open Source development site.
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> DSpace-changelog mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-changelog
>



-- 
Mark R. Diggory
http://purl.org/net/mdiggory/homepage - Bio
http://www.atmire.com - Institutional Repository Solutions
http://www.togather.eu - Before getting together, get t...@ther
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to