Ignore:
Timestamp:
10/12/12 15:16:25 (12 years ago)
Author:
pharms
Message:
  • removed find bug warnings
Location:
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorLogManager.java

    r871 r872  
    2424class HtmlMonitorLogManager implements HtmlMonitorComponent, HtmlMonitorMessageListener { 
    2525     
     26    /**  */ 
     27    private static final long serialVersionUID = 1L; 
     28 
    2629    /** 
    2730     * the timeout after which a writer of an inactive client is closed 
  • trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorMessageListener.java

    r871 r872  
    11package de.ugoe.cs.autoquest.htmlmonitor; 
     2 
     3import java.io.Serializable; 
    24 
    35/** 
     
    911 * @author Patrick Harms 
    1012 */ 
    11 public interface HtmlMonitorMessageListener { 
     13public interface HtmlMonitorMessageListener extends Serializable { 
    1214 
    1315    /** 
  • trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java

    r871 r872  
    88import java.io.PrintWriter; 
    99import java.text.DecimalFormat; 
     10 
     11import de.ugoe.cs.util.console.Console; 
    1012 
    1113/** 
     
    3032public class HtmlMonitorOutputWriter implements HtmlMonitorComponent, HtmlMonitorMessageListener { 
    3133     
     34    /**  */ 
     35    private static final long serialVersionUID = 1L; 
     36 
    3237    /** 
    3338     * the maximum size of an individual log file 
     
    102107             
    103108                if (!clientLogDir.exists()) { 
    104                     clientLogDir.mkdirs(); 
     109                    if (!clientLogDir.mkdirs()) { 
     110                        throw new HtmlMonitorException("client log file directory " + clientLogDir + 
     111                                                       " can not be created"); 
     112                    } 
    105113                } 
    106114                else if (!clientLogDir.isDirectory()) { 
     
    278286        while (checkFile.exists()); 
    279287     
    280         logFile.renameTo(checkFile); 
    281         logFileIndex++; 
    282         logFile = new File(clientLogDir, getLogFileName(-1)); 
     288        if (!logFile.renameTo(checkFile)) { 
     289            Console.printerrln("could not rename log file " + logFile + " to " + checkFile + 
     290                               ". Will not perform log rotation."); 
     291        } 
     292        else { 
     293            logFileIndex++; 
     294            logFile = new File(clientLogDir, getLogFileName(-1)); 
     295        } 
    283296    } 
    284297 
  • trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorServlet.java

    r871 r872  
    6262        Object value = null; 
    6363        try { 
    64             value = JSONValue.parseWithException(new InputStreamReader(request.getInputStream())); 
     64            value = JSONValue.parseWithException 
     65                (new InputStreamReader(request.getInputStream(), "UTF-8")); 
    6566             
    6667            if (!(value instanceof JSONObject)) { 
     
    325326            else if ((int.class.equals(clazz)) || (Integer.class.equals(clazz))) { 
    326327                try { 
    327                     result = (T) new Integer(Integer.parseInt((String) value)); 
     328                    result = (T) Integer.valueOf(Integer.parseInt((String) value)); 
    328329                } 
    329330                catch (NumberFormatException e) { 
     
    334335            else if ((long.class.equals(clazz)) || (Long.class.equals(clazz))) { 
    335336                try { 
    336                     result = (T) new Long(Long.parseLong((String) value)); 
     337                    result = (T) Long.valueOf(Long.parseLong((String) value)); 
    337338                } 
    338339                catch (NumberFormatException e) { 
Note: See TracChangeset for help on using the changeset viewer.