Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r5965 - in trunk/perfsonar-java-base2: . src/main/java/org/perfsonar/base2/client src/main/java/org/perfsonar/base2/client/authn src/main/java/org/perfsonar/base2/client/authn/edugain src/main/java/org/perfsonar/base2/client/authn/saslca src/main/java/org/perfsonar/base2/service/authn src/main/java/org/perfsonar/base2/service/authn/component src/main/java/org/perfsonar/base2/service/authn/tokens src/main/java/org/perfsonar/base2/service/configuration src/main/java/org/perfsonar/base2/service/configuration/migration src/main/java/org/perfsonar/base2/service/configuration/migration/grammar src/main/java/org/perfsonar/base2/service/storage/xml src/main/java/org/perfsonar/base2/servlets src/main/java/org/perfsonar/base2/xml src/main/java/org/perfsonar/base2/xml/nmwg src/main/java/org/perfsonar/test src/test/java/org/perfsonar/base2/service/configuration/migration

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r5965 - in trunk/perfsonar-java-base2: . src/main/java/org/perfsonar/base2/client src/main/java/org/perfsonar/base2/client/authn src/main/java/org/perfsonar/base2/client/authn/edugain src/main/java/org/perfsonar/base2/client/authn/saslca src/main/java/org/perfsonar/base2/service/authn src/main/java/org/perfsonar/base2/service/authn/component src/main/java/org/perfsonar/base2/service/authn/tokens src/main/java/org/perfsonar/base2/service/configuration src/main/java/org/perfsonar/base2/service/configuration/migration src/main/java/org/perfsonar/base2/service/configuration/migration/grammar src/main/java/org/perfsonar/base2/service/storage/xml src/main/java/org/perfsonar/base2/servlets src/main/java/org/perfsonar/base2/xml src/main/java/org/perfsonar/base2/xml/nmwg src/main/java/org/perfsonar/test src/test/java/org/perfsonar/base2/service/configuration/migration


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r5965 - in trunk/perfsonar-java-base2: . src/main/java/org/perfsonar/base2/client src/main/java/org/perfsonar/base2/client/authn src/main/java/org/perfsonar/base2/client/authn/edugain src/main/java/org/perfsonar/base2/client/authn/saslca src/main/java/org/perfsonar/base2/service/authn src/main/java/org/perfsonar/base2/service/authn/component src/main/java/org/perfsonar/base2/service/authn/tokens src/main/java/org/perfsonar/base2/service/configuration src/main/java/org/perfsonar/base2/service/configuration/migration src/main/java/org/perfsonar/base2/service/configuration/migration/grammar src/main/java/org/perfsonar/base2/service/storage/xml src/main/java/org/perfsonar/base2/servlets src/main/java/org/perfsonar/base2/xml src/main/java/org/perfsonar/base2/xml/nmwg src/main/java/org/perfsonar/test src/test/java/org/perfsonar/base2/service/configuration/migration
  • Date: Tue, 21 Aug 2012 11:48:05 +0100 (BST)

Author: nordunet.behrmann
Date: 2012-08-21 11:48:05 +0100 (Tue, 21 Aug 2012)
New Revision: 5965

Modified:
trunk/perfsonar-java-base2/pom.xml

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCMDSTest.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/AttrEERequestGenerator.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNSAMLData.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNX509Data.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/edugain/EduGAINFilterHelper.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AADispatchSOAPProtocol.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AttrResponse.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AuthNResponse.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AuthRResponse.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/component/DynamicCrypto.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/tokens/SecTokenSOAPManager.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Actions.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/AuxiliaryComponents.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Configuration.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ConfigurationManager.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/MessageHandler.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/OptionEntry.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ProtocolMappings.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Service.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollection.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/grammar/LoopExpression.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/storage/xml/XMLDBResult.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/AXIOMCreator.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/ConfigurationStaxParser.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/Element.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/ElementSerializer.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/StaxParser.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/nmwg/ParametersContainer.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/ElementToJavaGenerator.java

trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/StaxParserSimple.java
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/TestParser.java

trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/SimpleTemplateEngineTest.java
Log:
perfsonar-java-base2: Make use of Java 5 language constructs

The patch

- makes use of for each loops when possible
- Uses StringBuilder rather than StringBuffer
- Uses String.contains rather than indexOf
- Avoids redundant type casts
- Adds an explicit dependency on log4j
- Avoids manual array copies
- Avoids unnecessary String copies (Strings are immutable)

All changes were done automatically by IntelliJ.

Modified: trunk/perfsonar-java-base2/pom.xml
===================================================================
--- trunk/perfsonar-java-base2/pom.xml 2012-08-21 10:48:03 UTC (rev 5964)
+++ trunk/perfsonar-java-base2/pom.xml 2012-08-21 10:48:05 UTC (rev 5965)
@@ -268,6 +268,11 @@
<artifactId>httpcore-nio</artifactId>
<version>4.0.1</version>
</dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ </dependency>
</dependencies>



Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCMDSTest.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCMDSTest.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCMDSTest.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -17,14 +17,13 @@
defaultMDS=args[0];
}
List<BEMetaData>
bes=EduGAINMetadataService.getOrganizationList(defaultMDS);
- for (int i=0; i<bes.size(); i++) {
- BEMetaData be=bes.get(i);
- System.out.println("Bridging Element
"+be.getComponentID());
- CAInterface caonline=be.getCAInterface();
- if (caonline!=null) {
- System.out.println("*** CA online:
"+caonline.getContactURL());
- }
- }
+ for (BEMetaData be : bes) {
+ System.out.println("Bridging Element " +
be.getComponentID());
+ CAInterface caonline = be.getCAInterface();
+ if (caonline != null) {
+ System.out.println("*** CA online: " +
caonline.getContactURL());
+ }
+ }
} catch (PerfSONARException e) {
}
}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/UbCSaslTest.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -112,15 +112,13 @@
System.out.println("Subject DN:
"+certificate.getSubjectDN().toString());
Collection<List<?>> collection = certificate
.getSubjectAlternativeNames();
- Iterator<List<?>> it = collection.iterator();
- while (it.hasNext()) {
- List<?> list = it.next();
- for (int i = 0; i < list.size(); i++) {
- if
(list.get(i).toString().startsWith("http")) {
- System.out.println("Subject
Alternative Name:" +list.get(i).toString());
- }
- }
- }
+ for (List<?> list : collection) {
+ for (Object aList : list) {
+ if (aList.toString().startsWith("http")) {
+ System.out.println("Subject Alternative Name:" +
aList.toString());
+ }
+ }
+ }
System.out.println("Valid from:
"+DateFormat.getInstance().format(certificate.getNotBefore()));
System.out.println("Valid until:
"+DateFormat.getInstance().format(certificate.getNotAfter()));
}
@@ -203,17 +201,13 @@
if
(respAttr.getStatus()==AttrResponse.ATTR_OK_RESPONSE) {
Map<String, List<String>> attrs =
respAttr.getAttributes();
Set<String> keys = attrs.keySet();
- Iterator<String> it1 = keys.iterator();
- while (it1.hasNext()) {
- String key = it1.next();
- System.out.println("* "+key);
- List<String> values = attrs.get(key);
- Iterator<String> it2 =
values.iterator();
- while (it2.hasNext()) {
- String value = it2.next();
- System.out.println("***
"+value);
- }
- }
+ for (String key : keys) {
+ System.out.println("* " + key);
+ List<String> values = attrs.get(key);
+ for (String value : values) {
+ System.out.println("*** " + value);
+ }
+ }
}

} catch (Exception e) {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/AttrEERequestGenerator.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/AttrEERequestGenerator.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/AttrEERequestGenerator.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -119,22 +119,19 @@
"<saml:Issuer>"+attrReq.getIssuer()+"</saml:Issuer>" +
"<saml:Subject><saml:NameID
Format=\"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified\">"+attrReq.getSubject()+"</saml:NameID></saml:Subject>";
Map<String, Map<String, List<String>>> attrs =
attrReq.getAttributes();
- Iterator<String> it=attrs.keySet().iterator();
- while (it.hasNext()) {
- String urn=it.next();
- Map<String, List<String>> data = attrs.get(urn);
- Iterator<String> attrNames=data.keySet().iterator();
- String friendlyName = attrNames.next();
+ for (String urn : attrs.keySet()) {
+ Map<String, List<String>> data = attrs.get(urn);
+ Iterator<String> attrNames = data.keySet().iterator();
+ String friendlyName = attrNames.next();

- samlMessage +="<saml:Attribute
NameFormat=\"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\"
Name=\""+urn+"\" FriendlyName=\""+friendlyName+"\">";
+ samlMessage += "<saml:Attribute
NameFormat=\"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\" Name=\"" + urn
+ "\" FriendlyName=\"" + friendlyName + "\">";

- List<String> attrsValues=(List<String>)data.get(friendlyName);
- Iterator<String> itValues=attrsValues.iterator();
- while (itValues.hasNext()) {
- samlMessage +="<saml:AttributeValue
xsi:type=\"xsd:string\">"+itValues.next()+"</saml:AttributeValue>";
- }
+ List<String> attrsValues = data.get(friendlyName);
+ for (String attrsValue : attrsValues) {
+ samlMessage += "<saml:AttributeValue
xsi:type=\"xsd:string\">" + attrsValue + "</saml:AttributeValue>";
+ }

- samlMessage +="</saml:Attribute>";
+ samlMessage += "</saml:Attribute>";
}
samlMessage += "</samlp:AttributeQuery>";


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNSAMLData.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNSAMLData.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNSAMLData.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -75,7 +75,7 @@
}
// add the security provider
BouncyCastleProvider bcp = new BouncyCastleProvider();
- java.security.Security.addProvider((Provider)bcp);
+ java.security.Security.addProvider(bcp);

// add the private and public keys
Crypto crypto = null;
@@ -88,7 +88,7 @@
try {
Certificate[] certs = new Certificate[certchain.size()];
certs = certchain.toArray(certs);
- ks.setKeyEntry("xmlsec", (Key)key, "security".toCharArray(),
certs);
+ ks.setKeyEntry("xmlsec", key, "security".toCharArray(),
certs);
} catch (KeyStoreException e) {
throw new PerfSONARException("error.as.crypto","WSSAuthNData:
"+e.getMessage());
}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNX509Data.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNX509Data.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/WSSAuthNX509Data.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -58,7 +58,7 @@

// add the security provider
BouncyCastleProvider bcp = new BouncyCastleProvider();
- java.security.Security.addProvider((Provider)bcp);
+ java.security.Security.addProvider(bcp);

// add the private and public keys
Crypto crypto = null;
@@ -82,7 +82,7 @@

// add the security provider
BouncyCastleProvider bcp = new BouncyCastleProvider();
- java.security.Security.addProvider((Provider)bcp);
+ java.security.Security.addProvider(bcp);

Crypto crypto = null;
try {
@@ -93,7 +93,7 @@
KeyStore ks=crypto.getKeyStore();

try {
- ks.setKeyEntry("xmlsec", (Key)privateKey,
"security".toCharArray(), new Certificate[]{(Certificate)cert});
+ ks.setKeyEntry("xmlsec", privateKey,
"security".toCharArray(), new Certificate[]{cert});
} catch (KeyStoreException e) {
throw new
PerfSONARException("error.as.crypto","WSSAuthNX509Data: "+e.getMessage());
}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/edugain/EduGAINFilterHelper.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/edugain/EduGAINFilterHelper.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/edugain/EduGAINFilterHelper.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -18,7 +18,7 @@

Enumeration<String> attrs = session.getAttributeNames();
while (attrs.hasMoreElements()&&authStatementAssertion==null)
{
- String attrName = (String)attrs.nextElement();
+ String attrName = attrs.nextElement();
Object attrValRaw = session.getAttribute(attrName);
if (attrValRaw instanceof SAMLResponse) {
SAMLResponse
samlResponse=(SAMLResponse)attrValRaw;

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/SASLCAClient.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -65,7 +65,7 @@
clientProtocolHandler.addCSR(edugainCSR);

try {
- certMap = (Map<CertificationRequest,
X509Certificate[]>) Subject
+ certMap = Subject
.doAs(subj, clientProtocolHandler);
} catch (Exception e) {
e.printStackTrace();

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/client/authn/saslca/UserIDCallbackHandler.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -17,19 +17,17 @@

public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- if (callbacks[i] instanceof NameCallback) {
- NameCallback nc = (NameCallback)callbacks[i];
- nc.setName(userId.getName());
- }
- else if (callbacks[i] instanceof PasswordCallback) {
- PasswordCallback pc =
(PasswordCallback)callbacks[i];
-
pc.setPassword(userId.getPassword().toCharArray());
- }
- else {
- throw new
UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
- }
- }
+ for (Callback callback : callbacks) {
+ if (callback instanceof NameCallback) {
+ NameCallback nc = (NameCallback) callback;
+ nc.setName(userId.getName());
+ } else if (callback instanceof PasswordCallback) {
+ PasswordCallback pc = (PasswordCallback) callback;
+ pc.setPassword(userId.getPassword().toCharArray());
+ } else {
+ throw new UnsupportedCallbackException(callback,
"Unrecognized Callback");
+ }
+ }
}

}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AADispatchSOAPProtocol.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AADispatchSOAPProtocol.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AADispatchSOAPProtocol.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -81,28 +81,25 @@

// get the parameter which specifies the format of the
security token
Collection<Metadata>
metadatas=requestMessage.getMetadataCollection();
- Iterator<Metadata> itMeta = metadatas.iterator();
- while (itMeta.hasNext()) {
- Metadata meta = itMeta.next();
- Parameters pars=meta.getParameters();
- if (pars.getParameterValues("SecurityToken")!=null) {
- parameter =
pars.getFirstParameter("SecurityToken");
- }
- }
+ for (Metadata meta : metadatas) {
+ Parameters pars = meta.getParameters();
+ if (pars.getParameterValues("SecurityToken") != null) {
+ parameter = pars.getFirstParameter("SecurityToken");
+ }
+ }

SOAPHeader header=(SOAPHeader)token.getSecToken();
ArrayList<?> headerBlocks =
header.getHeaderBlocksWithNSURI(WSConstants.WSSE_NS);
SOAPHeaderBlock secHeader = null;
//Issue is axiom - a returned collection must not be null
if(headerBlocks != null) {
- Iterator<?> headerBlocksIterator = headerBlocks.iterator();
- while (headerBlocksIterator.hasNext()) {
- SOAPHeaderBlock elem = (SOAPHeaderBlock)
headerBlocksIterator.next();
- if(elem.getLocalName().equals(WSConstants.WSSE_LN)) {
- secHeader = elem;
- break;
- }
- }
+ for (Object headerBlock : headerBlocks) {
+ SOAPHeaderBlock elem = (SOAPHeaderBlock) headerBlock;
+ if (elem.getLocalName().equals(WSConstants.WSSE_LN)) {
+ secHeader = elem;
+ break;
+ }
+ }
}

if(secHeader == null) {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AttrResponse.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AttrResponse.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AttrResponse.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -75,7 +75,7 @@
}
}
if (eventType != null) {
- if (eventType.getText().trim().indexOf("success.as.attr") != -1)
{
+ if (eventType.getText().trim().contains("success.as.attr")) {
res.setStatus(AttrResponse.ATTR_BAD_RESPONSE);
}
}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AuthNResponse.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AuthNResponse.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AuthNResponse.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -43,7 +43,7 @@
}
}
if (eventType != null) {
- if (eventType.getText().trim().indexOf("success.as.authn") !=
-1) {
+ if (eventType.getText().trim().contains("success.as.authn")) {
res.setStatus(AuthNResponse.AUTHENTICATED);
}
}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AuthRResponse.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AuthRResponse.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/AuthRResponse.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -19,7 +19,7 @@
}
}
if (eventType != null) {
- if (eventType.getText().trim().indexOf("success.as.authr") !=
-1) {
+ if (eventType.getText().trim().contains("success.as.authr")) {
res.setStatus(AuthRResponse.AUTHENTICATED);
}
}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/component/DynamicCrypto.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/component/DynamicCrypto.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/component/DynamicCrypto.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -273,7 +273,7 @@
// Convert the vector into an array
String[] result = new String[aliases.size()];
for (int i = 0; i < aliases.size(); i++)
- result[i] = (String) aliases.elementAt(i);
+ result[i] = aliases.elementAt(i);

return result;
}
@@ -281,11 +281,11 @@
public byte[] getCertificateData(boolean reverse, X509Certificate[]
certs)
throws WSSecurityException {
Vector<X509Certificate> list = new Vector<X509Certificate>();
- for (int i = 0; i < certs.length; i++) {
+ for (X509Certificate cert : certs) {
if (reverse) {
- list.insertElementAt(certs[i], 0);
+ list.insertElementAt(cert, 0);
} else {
- list.add(certs[i]);
+ list.add(cert);
}
}
try {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/tokens/SecTokenSOAPManager.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/tokens/SecTokenSOAPManager.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/authn/tokens/SecTokenSOAPManager.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -160,14 +160,12 @@
X509Certificate cert=(X509Certificate)stValue;
Collection<List<?>> subjectAltNames =
cert.getSubjectAlternativeNames();
if (subjectAltNames != null) {
- Iterator<List<?>> names = subjectAltNames.iterator();
- while (names.hasNext()) {
- List<?> values = (List<?>)names.next();
+ for (List<?> values : subjectAltNames) {
if (values.size() == 2) {
- Integer type = (Integer)values.get(0);
- String name = (String)values.get(1);
+ Integer type = (Integer) values.get(0);
+ String name = (String) values.get(1);
if ((type == 6) &&
(name.startsWith(BaseDefinitions.EDUGAIN_CID_RESOLVER))) {
- return
URLDecoder.decode(name.substring(name.indexOf('=')+1),"UTF-8");
+ return
URLDecoder.decode(name.substring(name.indexOf('=') + 1), "UTF-8");
}
}
}

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Actions.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Actions.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Actions.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -35,7 +35,7 @@
}

public Action getAction(String name) {
- return ((Action)actions.get(name));
+ return actions.get(name);
}

public Map<String,Action> getActions() {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/AuxiliaryComponents.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/AuxiliaryComponents.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/AuxiliaryComponents.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -39,7 +39,7 @@
}

public Component getComponent(String name) {
- return ((Component)components.get(name));
+ return components.get(name);
}

public Map<String,Component> getComponents() {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Configuration.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Configuration.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Configuration.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -36,7 +36,7 @@
}

public Service getService(String name) throws PerfSONARException {
- Service service = (Service) services.get(name);
+ Service service = services.get(name);
if (service == null) {
// TODO: url event types
throw new PerfSONARException("error.configuration",
@@ -73,28 +73,28 @@

public String getLookupInformationOption(String optionName)
throws PerfSONARException {
- return ((LookupInformation) getService().getEntry(
-
Configuration.LOOKUP_INFORMATION)).getOption(optionName)
+ return getService().getEntry(
+
Configuration.LOOKUP_INFORMATION).getOption(optionName)
.getValue();
}

public String getLookupInformationOption(String serviceName,
String optioName) throws PerfSONARException {
- return ((LookupInformation) getService(serviceName).getEntry(
-
Configuration.LOOKUP_INFORMATION)).getOption(optioName)
+ return getService(serviceName).getEntry(
+
Configuration.LOOKUP_INFORMATION).getOption(optioName)
.getValue();
}

public Iterator<String> getLookupInformationIterator() throws
PerfSONARException {
- return ((LookupInformation) getService().getEntry(
-
Configuration.LOOKUP_INFORMATION)).getOptions().keySet()
+ return getService().getEntry(
+
Configuration.LOOKUP_INFORMATION).getOptions().keySet()
.iterator();
}

public Iterator<String> getLookupInformationIterator(String
serviceName)
throws PerfSONARException {
- return ((LookupInformation) getService(serviceName).getEntry(
-
Configuration.LOOKUP_INFORMATION)).getOptions().keySet()
+ return getService(serviceName).getEntry(
+
Configuration.LOOKUP_INFORMATION).getOptions().keySet()
.iterator();
}

@@ -153,25 +153,25 @@

public String getExtensionOption(String extensionName, String
optionName)
throws PerfSONARException {
- return ((Extension)
getService().getEntry(extensionName)).getOption(
- optionName).getValue();
+ return getService().getEntry(extensionName).getOption(
+ optionName).getValue();
}

public String getExtensionOption(String serviceName, String
extensionName,
String optionName) throws PerfSONARException {
- return ((Extension)
getService(serviceName).getEntry(extensionName))
+ return getService(serviceName).getEntry(extensionName)
.getOption(optionName).getValue();
}

public Iterator<String> getExtensionOptionsIterator(String
extensionName,
String optionName) throws PerfSONARException {
- return ((Extension)
getService().getEntry(extensionName)).getOptions()
+ return getService().getEntry(extensionName).getOptions()
.keySet().iterator();
}

public Iterator<String> getExtensionOptionsIterator(String
serviceName,
String extensionName, String optionName) throws
PerfSONARException {
- return ((Extension)
getService(serviceName).getEntry(extensionName))
+ return getService(serviceName).getEntry(extensionName)
.getOptions().keySet().iterator();
}


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ConfigurationManager.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ConfigurationManager.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ConfigurationManager.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -213,11 +213,11 @@
AuxiliaryComponents ac = configuration.getAuxiliaryComponents();
if (ac == null) return;

- for (Component c :
(Collection<Component>)ac.getComponents().values()) {
+ for (Component c : ac.getComponents().values()) {

try {
logger.info("Initialize component ["+c.getName()+"] as
["+c.getClassName()+"]");
- ((Component)c).init();
+ c.init();
if(runComponents){
c.run();
}
@@ -259,8 +259,8 @@
AuxiliaryComponents ac = configuration.getAuxiliaryComponents();
if (ac == null) return;

- Collection<Component> components =
(Collection<Component>)ac.getComponents().values();
- for (Component c : (Collection<Component>)components) {
+ Collection<Component> components = ac.getComponents().values();
+ for (Component c : components) {

try {
logger.info("Destroy component ["+c.getName()+"]");

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/MessageHandler.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/MessageHandler.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/MessageHandler.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -38,7 +38,7 @@
}

public Message getMessage(String type) throws PerfSONARException {
- return ((Message)messages.get(type));
+ return messages.get(type);
}

public Map<String,Message> getMessages() {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/OptionEntry.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/OptionEntry.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/OptionEntry.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -48,7 +48,7 @@


public Option getOption(String name) {
- return ((Option)options.get(name));
+ return options.get(name);
}



Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ProtocolMappings.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ProtocolMappings.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/ProtocolMappings.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -39,7 +39,7 @@
}

public ElementConf getElement(String name) throws PerfSONARException {
- return ((ElementConf)elements.get(name));
+ return elements.get(name);
}

public Map<String,ElementConf> getElements() {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Service.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Service.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/Service.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -37,7 +37,7 @@
}

public Entry getEntry(String name) throws PerfSONARException {
- return ((Entry)childs.get(name));
+ return childs.get(name);
}

public Map<String,Entry> getEntries() {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollection.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollection.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/ConfigFilesCollection.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -12,6 +12,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Properties;
import java.util.regex.Pattern;

@@ -68,15 +69,14 @@
return result;
if (!file.isDirectory())
throw new IOException("Invalid directory path: " +
configPath);
+
+ Collections.addAll(result, file.listFiles(new FileFilter() {
+ @Override
+ public boolean accept(File file) {
+ return matchesFileName(file.getName());
+ }
+ }));

- for (File temp : file.listFiles(new FileFilter() {
- @Override
- public boolean accept(File file) {
- return matchesFileName(file.getName());
- }}))
-
- result.add(temp);
-
return result;
}


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/grammar/LoopExpression.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/grammar/LoopExpression.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/configuration/migration/grammar/LoopExpression.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -108,18 +108,18 @@
regexpMatcher.appendReplacement(buffer, "");
if (buffer.length() > 0)
lines.add(buffer.toString());
- for (int idx = 0; idx < strings.length; idx++) {
- ((PropertyExpression)
expressions.get(0)).setProperty(varName, strings[idx]);
- boolean first = true;
- for (String tempLine : lines) {
- if (!first)
- newLine(writer);
- else
- first = false;
- writer.write(interpret(tempLine));
- }
- ((PropertyExpression)
expressions.get(0)).removeProperty(varName);
- }
+ for (String string : strings) {
+ ((PropertyExpression)
expressions.get(0)).setProperty(varName, string);
+ boolean first = true;
+ for (String tempLine : lines) {
+ if (!first)
+ newLine(writer);
+ else
+ first = false;
+ writer.write(interpret(tempLine));
+ }
+ ((PropertyExpression)
expressions.get(0)).removeProperty(varName);
+ }
buffer.delete(0, buffer.length());
regexpMatcher.appendTail(buffer);
filter(writer, buffer.toString(), regexpMatcher);

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/storage/xml/XMLDBResult.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/storage/xml/XMLDBResult.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/service/storage/xml/XMLDBResult.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -92,7 +92,7 @@

public String toString() {

- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append("XML DB Result (total=");
sb.append(total);
sb.append(", count=");

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/servlets/AuthServlet.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -90,8 +90,8 @@
String credentials = st.nextToken();

String userPass;
- userPass = new String(new
String(Base64
-
.decodeBase64(credentials.getBytes())));
+ userPass = new String(Base64
+ .decodeBase64(credentials.getBytes()));
int p = userPass.indexOf(":");
if (p != -1) {
loginAndPassword = new
String[2];

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/AXIOMCreator.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/AXIOMCreator.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/AXIOMCreator.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -40,9 +40,7 @@

//attributes
boolean isId = false;
- Iterator<Map.Entry<String, String>> i =
e.getAttributes().entrySet().iterator();
- while (i.hasNext()) {
- Map.Entry<String,String> attr = i.next();
+ for (Map.Entry<String, String> attr : e.getAttributes().entrySet()) {
String name = attr.getKey();
String value = attr.getValue();
OMAttribute omAttribute = fac.createOMAttribute(name, null,
value);

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/ConfigurationStaxParser.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/ConfigurationStaxParser.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/ConfigurationStaxParser.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -47,7 +47,7 @@
}

protected void setElementMapping() throws PerfSONARException {
- Configuration conf =
(Configuration)(ConfigurationManager.getInstance().getConfiguration());
+ Configuration conf =
ConfigurationManager.getInstance().getConfiguration();
if (serviceName == null) {
elementMapping = (ProtocolMappings)

(conf.getService().getEntry(Configuration.PROTOCOL_MAPPINGS));

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/Element.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/Element.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/Element.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -325,10 +325,7 @@
out.id = id;

// copy all attributes
- Iterator<Map.Entry<String, String>> attrs = attributes.entrySet()
- .iterator();
- while (attrs.hasNext()) {
- Map.Entry<String, String> entry = attrs.next();
+ for (Map.Entry<String, String> entry : attributes.entrySet()) {
out.addAttribute(entry.getKey(), entry.getValue());
}


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/ElementSerializer.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/ElementSerializer.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/ElementSerializer.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -65,9 +65,7 @@

//attributes
boolean isId = false;
- Iterator<Map.Entry<String, String>> i =
e.getAttributes().entrySet().iterator();
- while (i.hasNext()) {
- Map.Entry<String, String> attr = i.next();
+ for (Map.Entry<String, String> attr : e.getAttributes().entrySet()) {
String name = attr.getKey();
String value = attr.getValue();
writer.writeAttribute(name, value);

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/StaxParser.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/StaxParser.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/StaxParser.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -50,9 +50,9 @@
public Element parse(InputStream istream) throws XMLStreamException {

// create STAX reader from inputstream
- XMLInputFactory factory = (XMLInputFactory) XMLInputFactory
+ XMLInputFactory factory = XMLInputFactory
.newInstance();
- XMLStreamReader staxXmlReader = (XMLStreamReader) factory
+ XMLStreamReader staxXmlReader = factory
.createXMLStreamReader(istream);
return parse(staxXmlReader);

@@ -76,7 +76,7 @@

String textNodeName=null;
boolean textNodeFound = false;
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
String localName;

// Parse for all STAX events

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/nmwg/ParametersContainer.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/nmwg/ParametersContainer.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/nmwg/ParametersContainer.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -37,12 +37,12 @@

public Parameters getParameters() {

- return (Parameters) parametersMap.get(nmwgUri);
+ return parametersMap.get(nmwgUri);
}

public Parameters getParameters(String namespaceUri) {

- return (Parameters) parametersMap.get(namespaceUri);
+ return parametersMap.get(namespaceUri);
}

public Map<String, Parameters> getParametersMap() {

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/ElementToJavaGenerator.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/ElementToJavaGenerator.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/ElementToJavaGenerator.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -54,12 +54,10 @@
}

//attributes
- Iterator<Map.Entry<String, String>> i =
e.getAttributes().entrySet().iterator();
- while (i.hasNext()) {
- Map.Entry<String, String> attr = (Map.Entry<String,
String>)i.next();
- String name = (String)attr.getKey();
- String value = (String)attr.getValue();
- System.out.println(" "+elementName+".addAttribute(\""+name+"\",
\""+value+"\");");
+ for (Map.Entry<String, String> attr : e.getAttributes().entrySet()) {
+ String name = attr.getKey();
+ String value = attr.getValue();
+ System.out.println(" " + elementName + ".addAttribute(\"" +
name + "\", \"" + value + "\");");
}

//characters

Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/StaxParserSimple.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/StaxParserSimple.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/StaxParserSimple.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -44,8 +44,8 @@
*/
public Element parse(InputStream istream) throws XMLStreamException {
// create STAX reader from inputstream
- XMLInputFactory factory = (XMLInputFactory)
XMLInputFactory.newInstance();
- XMLStreamReader staxXmlReader = (XMLStreamReader)
factory.createXMLStreamReader(istream);
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ XMLStreamReader staxXmlReader =
factory.createXMLStreamReader(istream);
return parse(staxXmlReader);
}


Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/TestParser.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/TestParser.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/test/TestParser.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -35,8 +35,8 @@

FileInputStream fis = new
FileInputStream("/home/mac/projects/simple-service-branch/test.xml");

- XMLInputFactory factory =
(XMLInputFactory)XMLInputFactory.newInstance();
- XMLStreamReader r = (XMLStreamReader)
factory.createXMLStreamReader(fis);
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ XMLStreamReader r = factory.createXMLStreamReader(fis);
Element e= parser.parse(r);



Modified:
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/SimpleTemplateEngineTest.java
===================================================================
---
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/SimpleTemplateEngineTest.java
2012-08-21 10:48:03 UTC (rev 5964)
+++
trunk/perfsonar-java-base2/src/test/java/org/perfsonar/base2/service/configuration/migration/SimpleTemplateEngineTest.java
2012-08-21 10:48:05 UTC (rev 5965)
@@ -58,7 +58,7 @@

private String toString(File file) throws IOException {
final BufferedReader reader = new BufferedReader(new
FileReader(file));
- final StringBuffer result = new StringBuffer();
+ final StringBuilder result = new StringBuilder();
boolean first = true;
for (String line = reader.readLine(); line != null; line =
reader.readLine()) {
if (first == false)



  • [pS-dev] [GEANT/SA2/ps-java-services] r5965 - in trunk/perfsonar-java-base2: . src/main/java/org/perfsonar/base2/client src/main/java/org/perfsonar/base2/client/authn src/main/java/org/perfsonar/base2/client/authn/edugain src/main/java/org/perfsonar/base2/client/authn/saslca src/main/java/org/perfsonar/base2/service/authn src/main/java/org/perfsonar/base2/service/authn/component src/main/java/org/perfsonar/base2/service/authn/tokens src/main/java/org/perfsonar/base2/service/configuration src/main/java/org/perfsonar/base2/service/configuration/migration src/main/java/org/perfsonar/base2/service/configuration/migration/grammar src/main/java/org/perfsonar/base2/service/storage/xml src/main/java/org/perfsonar/base2/servlets src/main/java/org/perfsonar/base2/xml src/main/java/org/perfsonar/base2/xml/nmwg src/main/java/org/perfsonar/test src/test/java/org/perfsonar/base2/service/configuration/migration, svn-noreply, 08/21/2012

Archive powered by MHonArc 2.6.16.

Top of Page