Author: jboynes
Date: Thu Mar 23 11:03:05 2006
New Revision: 388233
URL: http://svn.apache.org/viewcvs?rev=388233&view=rev
Log:
a few more cosmetic changes to remove IDEA warnings
Removed:
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/UTF8String.java
Modified:
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyException.java
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLClassLoader.java
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/IOHelper.java
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/JavaLoggingMonitorFactory.java
Modified:
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyException.java
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyException.java?rev=388233&r1=388232&r2=388233&view=diff
==============================================================================
---
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyException.java
(original)
+++
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyException.java
Thu Mar 23 11:03:05 2006
@@ -4,7 +4,7 @@
import java.util.List;
/**
- * The root checked exception for the Tuscany rubntime
+ * The root checked exception for the Tuscany runtime.
*
* @version $Rev: 368822 $ $Date: 2006-01-13 10:54:38 -0800 (Fri, 13 Jan 2006)
$
*/
@@ -71,12 +71,12 @@
}
StringBuffer b = new StringBuffer();
if (identifier != null) {
- b.append(" [" + identifier + "]");
+ b.append(" [").append(identifier).append("]");
}
if (contextStack != null) {
b.append("\nContext stack trace: ");
for (int i = contextStack.size() - 1; i >= 0; i--) {
- b.append("[" + contextStack.get(i) + "]");
+ b.append("[").append(contextStack.get(i)).append("]");
}
}
return super.getMessage() + b.toString();
Modified:
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java?rev=388233&r1=388232&r2=388233&view=diff
==============================================================================
---
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java
(original)
+++
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java
Thu Mar 23 11:03:05 2006
@@ -76,12 +76,12 @@
}
StringBuffer b = new StringBuffer();
if (identifier != null) {
- b.append(" [" + identifier + "]");
+ b.append(" [").append(identifier).append("]");
}
if (contextStack != null) {
b.append("\nContext stack trace: ");
for (int i = contextStack.size() - 1; i >= 0; i--) {
- b.append("[" + contextStack.get(i) + "]");
+ b.append("[").append(contextStack.get(i)).append("]");
}
}
return super.getMessage() + b.toString();
Modified:
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLClassLoader.java
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLClassLoader.java?rev=388233&r1=388232&r2=388233&view=diff
==============================================================================
---
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLClassLoader.java
(original)
+++
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLClassLoader.java
Thu Mar 23 11:03:05 2006
@@ -211,7 +211,7 @@
jarStream = jFile.getInputStream(jarEntry);
ByteArrayOutputStream out = new
ByteArrayOutputStream();
byte buf[] = new byte[4096];
- int length = 0;
+ int length;
length = jarStream.read(buf);
while (length > 0) {
out.write(buf, 0, length);
Modified:
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/IOHelper.java
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/IOHelper.java?rev=388233&r1=388232&r2=388233&view=diff
==============================================================================
---
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/IOHelper.java
(original)
+++
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/io/util/IOHelper.java
Thu Mar 23 11:03:05 2006
@@ -54,7 +54,7 @@
public static void copy(InputStream in, OutputStream out, long byteCount)
throws IOException {
byte buffer[] = new byte[BYTES];
- int len = BYTES;
+ int len;
if (byteCount >= 0) {
while (byteCount > 0) {
@@ -83,7 +83,7 @@
public static byte[] read(InputStream in) throws IOException {
byte buffer[] = new byte[BYTES];
ByteArrayOutputStream out = new ByteArrayOutputStream();
- int len = BYTES;
+ int len;
while (true) {
len = in.read(buffer, 0, BYTES);
if (len < 0) {
@@ -99,9 +99,8 @@
*/
public static boolean deleteDir(File pDir) {
if (pDir.isDirectory()) {
- String[] children = pDir.list();
- for (int i = 0; i < children.length; i++) {
- boolean success = deleteDir(new File(pDir, children[i]));
+ for (String aChildren : pDir.list()) {
+ boolean success = deleteDir(new File(pDir, aChildren));
if (!success) {
return false;
}
@@ -116,10 +115,9 @@
*/
public static InputStream getResource(File pRoot, String pPath) throws
FileNotFoundException {
- File[] files = pRoot.listFiles();
- for (int i = 0; i < files.length; i++) {
- if (files[i].isFile() && files[i].getName().equals(pPath)) {
- return new BufferedInputStream(new FileInputStream(files[i]));
+ for (File file : pRoot.listFiles()) {
+ if (file.isFile() && file.getName().equals(pPath)) {
+ return new BufferedInputStream(new FileInputStream(file));
}
}
return null;
Modified:
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/JavaLoggingMonitorFactory.java
URL:
http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/JavaLoggingMonitorFactory.java?rev=388233&r1=388232&r2=388233&view=diff
==============================================================================
---
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/JavaLoggingMonitorFactory.java
(original)
+++
incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/JavaLoggingMonitorFactory.java
Thu Mar 23 11:03:05 2006
@@ -24,7 +24,6 @@
import java.util.Map;
import java.util.HashMap;
import java.util.Properties;
-import java.util.Iterator;
import java.util.logging.Logger;
import java.util.logging.Level;
@@ -53,8 +52,7 @@
this.defaultLevel = defaultLevel;
this.bundleName = bundleName;
this.levels = new HashMap<String, Level>(levels.size());
- for (Iterator<Map.Entry<Object, Object>> i =
levels.entrySet().iterator(); i.hasNext();) {
- Map.Entry<Object, Object> entry = i.next();
+ for (Map.Entry<Object, Object> entry : levels.entrySet()) {
String method = (String) entry.getKey();
String level = (String) entry.getValue();
try {
@@ -75,7 +73,7 @@
}
private <T>T getCachedMonitor(Class<T> monitorInterface) {
- WeakReference<?> ref = (WeakReference<?>)proxies.get(monitorInterface);
+ WeakReference<?> ref = proxies.get(monitorInterface);
return (ref != null) ? monitorInterface.cast(ref.get()) : null;
}
@@ -84,8 +82,7 @@
Logger logger = Logger.getLogger(className, bundleName);
Method[] methods = monitorInterface.getMethods();
Map<String, Level> levels = new HashMap<String, Level>(methods.length);
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
+ for (Method method : methods) {
String key = className + '#' + method.getName();
Level level = this.levels.get(key);