You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/04/02 23:28:57 UTC
svn commit: r1088130 -
/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/names/DiscoverMappedNames.java
Author: simonetripodi
Date: Sat Apr 2 21:28:56 2011
New Revision: 1088130
URL: http://svn.apache.org/viewvc?rev=1088130&view=rev
Log:
removed trailing spaces
Modified:
commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/names/DiscoverMappedNames.java
Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/names/DiscoverMappedNames.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/names/DiscoverMappedNames.java?rev=1088130&r1=1088129&r2=1088130&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/names/DiscoverMappedNames.java (original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/names/DiscoverMappedNames.java Sat Apr 2 21:28:56 2011
@@ -45,18 +45,18 @@ public class DiscoverMappedNames
public static void setLog(Log _log) {
log = _log;
}
-
+
private final Map<String, String[]> mapping = new Hashtable<String, String[]>(); // String name ==> String[] newNames
-
+
/** Construct a new resource discoverer
*/
public DiscoverMappedNames() {
}
-
+
public void map(String fromName, String toName) {
map(fromName, new String[]{ toName });
}
-
+
public void map(String fromName, String [] toNames) {
mapping.put(fromName, toNames);
}
@@ -68,13 +68,13 @@ public class DiscoverMappedNames
if (log.isDebugEnabled()) {
log.debug("find: resourceName='" + resourceName + "', mapping to constants");
}
-
+
final String[] names = mapping.get(resourceName);
return new ResourceNameIterator() {
private int idx = 0;
-
+
public boolean hasNext() {
if (names != null) {
while (idx < names.length && names[idx] == null) {
@@ -84,7 +84,7 @@ public class DiscoverMappedNames
}
return false;
}
-
+
public String nextResourceName() {
return hasNext() ? names[idx++] : null;
}