Author: nextgens
Date: 2006-11-10 20:58:24 +0000 (Fri, 10 Nov 2006)
New Revision: 10870
Modified:
trunk/contrib/fec/common/src/com/onionnetworks/io/BlockingRAF.java
trunk/contrib/fec/common/src/com/onionnetworks/io/CommitRaf.java
trunk/contrib/fec/common/src/com/onionnetworks/io/FilterRAF.java
trunk/contrib/fec/common/src/com/onionnetworks/io/JournalingRAF.java
trunk/contrib/fec/common/src/com/onionnetworks/io/LazyRenameRAF.java
trunk/contrib/fec/common/src/com/onionnetworks/util/ReflectiveEventDispatch.java
Log:
contrib: onion-common: rename some variables to prevent the compiler from
complaining about variable shadowing
Modified: trunk/contrib/fec/common/src/com/onionnetworks/io/BlockingRAF.java
===================================================================
--- trunk/contrib/fec/common/src/com/onionnetworks/io/BlockingRAF.java
2006-11-10 20:50:42 UTC (rev 10869)
+++ trunk/contrib/fec/common/src/com/onionnetworks/io/BlockingRAF.java
2006-11-10 20:58:24 UTC (rev 10870)
@@ -25,7 +25,7 @@
throw e;
}
- raf.seekAndWrite(pos,b,off,len);
+ _raf.seekAndWrite(pos,b,off,len);
// call this after seekAndWrite() to allow exceptions to be thrown, if
// there are any.
@@ -111,7 +111,7 @@
} else {
// (int) cast is safe because size() can't be larger than
// len
- return raf.seekAndRead(pos,b,off,(int) first.size());
+ return _raf.seekAndRead(pos,b,off,(int) first.size());
}
} else {
@@ -129,8 +129,8 @@
try {
this.wait();
- } catch (InterruptedException e) {
- throw new InterruptedIOException(e.getMessage());
+ } catch (InterruptedException ie) {
+ throw new InterruptedIOException(ie.getMessage());
} finally {
buffers.remove(key);
}
@@ -145,7 +145,7 @@
// We only block during r/w mode. For read-only we use the
// normal behavior.
if (getMode().equals("r")) {
- return raf.seekAndRead(pos,b,off,len);
+ return _raf.seekAndRead(pos,b,off,len);
}
// RAF closed
@@ -164,7 +164,7 @@
}
public synchronized void setReadOnly() throws IOException {
- raf.setReadOnly();
+ _raf.setReadOnly();
this.notifyAll();
}
@@ -174,7 +174,7 @@
}
public synchronized void close() throws IOException {
- raf.close();
+ _raf.close();
this.notifyAll();
}
}
Modified: trunk/contrib/fec/common/src/com/onionnetworks/io/CommitRaf.java
===================================================================
--- trunk/contrib/fec/common/src/com/onionnetworks/io/CommitRaf.java
2006-11-10 20:50:42 UTC (rev 10869)
+++ trunk/contrib/fec/common/src/com/onionnetworks/io/CommitRaf.java
2006-11-10 20:58:24 UTC (rev 10870)
@@ -37,7 +37,7 @@
}
}
- raf.seekAndWrite(pos,b,off,len);
+ _raf.seekAndWrite(pos,b,off,len);
// call this after seekAndWrite() to allow exceptions to be thrown, if
// there are any.
@@ -116,7 +116,7 @@
(length() == 0 ||
committed.equals(new RangeSet(new Range(0,length()-1))))) {
- return raf.seekAndRead(pos,b,off,len);
+ return _raf.seekAndRead(pos,b,off,len);
}
if (r == null) {
@@ -141,7 +141,7 @@
} else {
// (int) cast is safe because size() can't be larger than
// len
- return raf.seekAndRead(pos,b,off,(int) first.size());
+ return _raf.seekAndRead(pos,b,off,(int) first.size());
}
} else {
@@ -159,8 +159,8 @@
try {
this.wait();
- } catch (InterruptedException e) {
- throw new InterruptedIOException(e.getMessage());
+ } catch (InterruptedException ie) {
+ throw new InterruptedIOException(ie.getMessage());
} finally {
buffers.remove(key);
}
@@ -193,7 +193,7 @@
}
public synchronized void close() throws IOException {
- raf.close();
+ _raf.close();
this.notifyAll();
}
}
Modified: trunk/contrib/fec/common/src/com/onionnetworks/io/FilterRAF.java
===================================================================
--- trunk/contrib/fec/common/src/com/onionnetworks/io/FilterRAF.java
2006-11-10 20:50:42 UTC (rev 10869)
+++ trunk/contrib/fec/common/src/com/onionnetworks/io/FilterRAF.java
2006-11-10 20:58:24 UTC (rev 10870)
@@ -4,66 +4,66 @@
public abstract class FilterRAF extends RAF {
- protected RAF raf;
+ protected final RAF _raf;
public FilterRAF(RAF raf) {
- this.raf = raf;
+ this._raf = raf;
}
public synchronized void seekAndWrite(long pos, byte[] b, int off,
int len) throws IOException {
- raf.seekAndWrite(pos,b,off,len);
+ _raf.seekAndWrite(pos,b,off,len);
}
public synchronized int seekAndRead(long pos, byte[] b, int off, int len)
throws IOException {
- return raf.seekAndRead(pos,b,off,len);
+ return _raf.seekAndRead(pos,b,off,len);
}
public synchronized void seekAndReadFully(long pos, byte[] b, int off,
int len) throws IOException {
- raf.seekAndReadFully(pos,b,off,len);
+ _raf.seekAndReadFully(pos,b,off,len);
}
public synchronized void renameTo(File destFile) throws IOException {
- raf.renameTo(destFile);
+ _raf.renameTo(destFile);
}
public synchronized String getMode() {
- return raf.getMode();
+ return _raf.getMode();
}
public synchronized boolean isClosed() {
- return raf.isClosed();
+ return _raf.isClosed();
}
public synchronized File getFile() {
- return raf.getFile();
+ return _raf.getFile();
}
public synchronized void setReadOnly() throws IOException {
- raf.setReadOnly();
+ _raf.setReadOnly();
}
public synchronized void deleteOnClose() {
- raf.deleteOnClose();
+ _raf.deleteOnClose();
}
public synchronized void setLength(long len) throws IOException {
- raf.setLength(len);
+ _raf.setLength(len);
}
public synchronized long length() throws IOException {
- return raf.length();
+ return _raf.length();
}
public synchronized void close() throws IOException {
- raf.close();
+ _raf.close();
}
public String toString() {
- return raf.toString();
+ return _raf.toString();
}
}
Modified: trunk/contrib/fec/common/src/com/onionnetworks/io/JournalingRAF.java
===================================================================
--- trunk/contrib/fec/common/src/com/onionnetworks/io/JournalingRAF.java
2006-11-10 20:50:42 UTC (rev 10869)
+++ trunk/contrib/fec/common/src/com/onionnetworks/io/JournalingRAF.java
2006-11-10 20:58:24 UTC (rev 10870)
@@ -39,9 +39,9 @@
// Can be null from deleteJournal()
if (journal != null) {
- // Use raf.getFile() because renameTo() may have failed and was
+ // Use _raf.getFile() because renameTo() may have failed and was
// forced to fall back.
- journal.setTargetFile(raf.getFile());
+ journal.setTargetFile(_raf.getFile());
// flush here because it is important that the journal stay in
// sync on this operation.
@@ -70,12 +70,12 @@
}
private void deleteJournal() {
- File f = journal.getFile();
+ File file = journal.getFile();
try {
journal.close();
} catch (IOException e) {e.printStackTrace();}
//FIX maybe throw exception on failed delete?
- f.delete();
+ file.delete();
journal = null;
}
}
Modified: trunk/contrib/fec/common/src/com/onionnetworks/io/LazyRenameRAF.java
===================================================================
--- trunk/contrib/fec/common/src/com/onionnetworks/io/LazyRenameRAF.java
2006-11-10 20:50:42 UTC (rev 10869)
+++ trunk/contrib/fec/common/src/com/onionnetworks/io/LazyRenameRAF.java
2006-11-10 20:58:24 UTC (rev 10870)
@@ -36,23 +36,23 @@
this.destFile = newFile;
if (getMode().equals("r")) {
- raf.renameTo(destFile);
+ _raf.renameTo(destFile);
} else {
// create a temp file in the same directory as destFile, if
// destFile is null, then try to create a temp file in the
// user temp directory, then fall back to the system temp dir.
File newTemp = FileUtil.createTempFile(destFile);
- raf.renameTo(newTemp);
+ _raf.renameTo(newTemp);
}
}
// This should at least by in read-only mode when it bombs, should
// FIX parent.setReadOnly to revert as well.
public synchronized void setReadOnly() throws IOException {
- raf.setReadOnly();
+ _raf.setReadOnly();
if (destFile != null) {
- raf.renameTo(destFile);
+ _raf.renameTo(destFile);
}
}
}
Modified:
trunk/contrib/fec/common/src/com/onionnetworks/util/ReflectiveEventDispatch.java
===================================================================
---
trunk/contrib/fec/common/src/com/onionnetworks/util/ReflectiveEventDispatch.java
2006-11-10 20:50:42 UTC (rev 10869)
+++
trunk/contrib/fec/common/src/com/onionnetworks/util/ReflectiveEventDispatch.java
2006-11-10 20:58:24 UTC (rev 10870)
@@ -10,20 +10,20 @@
public static final int DEFAULT_WARNING_TIME = 10;
- private Thread t;
+ private final Thread thread;
private HashMap methodCache = new HashMap();
private HashMap listeners = new HashMap();
private LinkedList eventQueue = new LinkedList();
private ExceptionHandler handler;
public ReflectiveEventDispatch() {
- t = new Thread(this,"Reflective Dispatch#" + hashCode());
- t.setDaemon(true);
- t.start();
+ thread = new Thread(this,"Reflective Dispatch#" + hashCode());
+ thread.setDaemon(true);
+ thread.start();
}
public void setPriority(int priority) {
- t.setPriority(priority);
+ thread.setPriority(priority);
}
public void setExceptionHandler(ExceptionHandler h) {