< prev index next >

src/com/sun/javatest/logging/LogModel.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg


 410         }
 411     }
 412 
 413     class LogFileListener implements FileListener {
 414         public void fileModified(FileEvent e) {
 415             synchronized (LogModel.this) {
 416                 if (e.getType().equals(FileEvent.START_ERASING)){
 417                     if (debug) System.out.println("FileEvent.START_ERASING");
 418                     resetModel();
 419                 } else if (e.getType().equals(FileEvent.ERASED)){
 420                     if (debug) System.out.println("FileEvent.ERASED");
 421                     init();
 422                 }
 423 
 424             }
 425         }
 426     }
 427 
 428 
 429     private class MessageCache extends LinkedHashMap<LiteLogRecord, String> {
 430         protected boolean removeEldestEntry(Map.Entry eldest) {
 431             return size() > PAGE_SIZE*2;
 432         }
 433     }
 434 
 435     private boolean stable = false;
 436     private ArrayList<String> loggers;
 437     private ArrayList<LiteLogRecord> records;
 438 
 439     private ArrayList<LoggerListener> loggerListeners = new ArrayList<LoggerListener>();
 440     private ArrayList<NewPageListener> pageListeners = new ArrayList<NewPageListener>();
 441     private MessageCache messageCache = new MessageCache();
 442     private String file;
 443     private RandomAccessFile mirrorFile;
 444     private Worker worker;
 445     private Logger logger;
 446 
 447     private ObservedFile of;
 448     private LogFileListener fileListener;
 449 
 450     static final boolean debug = false;




 410         }
 411     }
 412 
 413     class LogFileListener implements FileListener {
 414         public void fileModified(FileEvent e) {
 415             synchronized (LogModel.this) {
 416                 if (e.getType().equals(FileEvent.START_ERASING)){
 417                     if (debug) System.out.println("FileEvent.START_ERASING");
 418                     resetModel();
 419                 } else if (e.getType().equals(FileEvent.ERASED)){
 420                     if (debug) System.out.println("FileEvent.ERASED");
 421                     init();
 422                 }
 423 
 424             }
 425         }
 426     }
 427 
 428 
 429     private class MessageCache extends LinkedHashMap<LiteLogRecord, String> {
 430         protected boolean removeEldestEntry(Map.Entry<LiteLogRecord, String> eldest) {
 431             return size() > PAGE_SIZE*2;
 432         }
 433     }
 434 
 435     private boolean stable = false;
 436     private ArrayList<String> loggers;
 437     private ArrayList<LiteLogRecord> records;
 438 
 439     private ArrayList<LoggerListener> loggerListeners = new ArrayList<LoggerListener>();
 440     private ArrayList<NewPageListener> pageListeners = new ArrayList<NewPageListener>();
 441     private MessageCache messageCache = new MessageCache();
 442     private String file;
 443     private RandomAccessFile mirrorFile;
 444     private Worker worker;
 445     private Logger logger;
 446 
 447     private ObservedFile of;
 448     private LogFileListener fileListener;
 449 
 450     static final boolean debug = false;


< prev index next >