if (m_changedNumLines) {    m_changedNumLines = false; m_reader.close(); m_reader = new BufferedReader(new FileReader(m_file)); }
	public void run()	{		m_active = true;				m_list = new BoundedList(Integer.MAX_VALUE);		String line = null;		long size = 0;		boolean firstUpdate = false;				while (m_active) {			// Keep checking for new lines in the file			boolean updated = false;			boolean truncated = false;						// See if the file was truncated...			truncated = false;			if (m_file.length() < size) {				truncated = true;			}			size = m_file.length();						try {				if (truncated) {					m_list.put("*** File truncated ***");					updated = true;					m_reader.close();					m_reader = new BufferedReader(new FileReader(m_file));										// Reset the stream					while ((line = m_reader.readLine()) != null) {}					}				else if (!m_file.exists()) {					m_list.put("*** File deleted ***");					updated = true;					m_active = false;				}				else {                                        if (m_changedNumLines) {                        // User has updated the number of lines                        // we should display. Refresh the reader                        //                        m_changedNumLines = false;                        m_reader.close();                        m_reader = new BufferedReader(new FileReader(m_file));                    }                                        // Read through the lines of the files					while ((line = m_reader.readLine()) != null) {												if (line.length() > 0) {						    synchronized (m_filters) {						        // Apply each filter								for (Iterator iter = m_filters.iterator(); iter.hasNext();) {		                            Filter f = (Filter) iter.next();		                            if (f.matches(line)) {		                    			line = f.handleWatcherMatch(line, firstUpdate);			                    		}   		                        }						    }						    							// Make sure the filter didn't set the line to null...							if (line != null) {								updated = true;								m_list.put(line);																if (m_console) {									// Dump the latest line to the console if debugging									System.out.println(line);								}							}						}					}										firstUpdate = true;				}								if (updated) {					notifyListeners();				}								sleep(m_interval * 1000);                m_list.clear();			}			catch (IOException e) {                // TODO: Should we handle this differently?				e.printStackTrace();			}			catch (InterruptedException e) {				// Ignore. If we have been stopped, the while condition will fail.				}		}				try {			m_reader.close();		}		catch (Exception e) {			// ignore			}	}