Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6063 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType perfsonar_base/sr c/main/java/org/perfsonar/service/measurementArchive/regis ter

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r6063 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType perfsonar_base/sr c/main/java/org/perfsonar/service/measurementArchive/regis ter


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6063 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType perfsonar_base/sr c/main/java/org/perfsonar/service/measurementArchive/regis ter
  • Date: Sat, 8 Dec 2012 15:42:19 +0000 (GMT)

Author: nordunet.behrmann
Date: 2012-12-08 15:42:19 +0000 (Sat, 08 Dec 2012)
New Revision: 6063

Modified:

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/NMWGInterfaceBaseChaining.java

trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
Log:
perfsonar_base, perfsonar-java-sql-ma: Remove nested if statements found by
PMD

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/NMWGInterfaceBaseChaining.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/NMWGInterfaceBaseChaining.java
2012-12-08 15:12:47 UTC (rev 6062)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/NMWGInterfaceBaseChaining.java
2012-12-08 15:42:19 UTC (rev 6063)
@@ -103,19 +103,15 @@
}

// comparing and adding
- if (m1Subject != null || m2Subject != null) {
- if (newMetadata.getSubject() == null) {
- newMetadata.setSubject(new
org.ggf.ns.nmwg.characteristic.utilization.v2_0.Subject());
- }
+ if ((m1Subject != null || m2Subject != null) &&
newMetadata.getSubject() == null) {
+ newMetadata.setSubject(new
org.ggf.ns.nmwg.characteristic.utilization.v2_0.Subject());
}
org.ggf.ns.nmwg.characteristic.utilization.v2_0.Subject newSubject =
(org.ggf.ns.nmwg.characteristic.utilization.v2_0.Subject)
newMetadata.getSubject();


- if (m1Interf != null || m2Interf != null) {
- if (newSubject.getInterface() == null) {
- newSubject.setInterface(new
org.ggf.ns.nmwg.topology.v2_0.Interface());
- }
+ if ((m1Interf != null || m2Interf != null) &&
newSubject.getInterface() == null) {
+ newSubject.setInterface(new
org.ggf.ns.nmwg.topology.v2_0.Interface());
}


@@ -207,25 +203,19 @@
EventType m2EventType = metadata2.getEventType();


- if (m1Subject != null || m2Subject != null) {
- if (newMetadata.getSubject() == null) {
- newMetadata.setSubject(new
org.ggf.ns.nmwg.ops.select.v2_0.Subject());
- }
+ if ((m1Subject != null || m2Subject != null) &&
newMetadata.getSubject() == null) {
+ newMetadata.setSubject(new
org.ggf.ns.nmwg.ops.select.v2_0.Subject());
}
org.ggf.ns.nmwg.ops.select.v2_0.Subject newSubject =
(org.ggf.ns.nmwg.ops.select.v2_0.Subject)
newMetadata.getSubject();


- if (m1Subject != null) {
- if (!m1Subject.getMetadataIdRef().isEmpty()) {
- newSubject.setMetadataIdRef(m1Subject.getMetadataIdRef());
- }
+ if (m1Subject != null && !m1Subject.getMetadataIdRef().isEmpty()) {
+ newSubject.setMetadataIdRef(m1Subject.getMetadataIdRef());
}

- if (m2Subject != null) {
- if (!m2Subject.getMetadataIdRef().isEmpty()) {
- newSubject.setMetadataIdRef(m2Subject.getMetadataIdRef());
- }
+ if (m2Subject != null && !m2Subject.getMetadataIdRef().isEmpty()) {
+ newSubject.setMetadataIdRef(m2Subject.getMetadataIdRef());
}



Modified:
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2012-12-08 15:12:47 UTC (rev 6062)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/service/measurementArchive/register/LSRegistrationComponent.java
2012-12-08 15:42:19 UTC (rev 6063)
@@ -166,10 +166,8 @@

try {
lsURL = configuration.getProperty("service.r.ls_url");
- if (lsURL != null) {
- if (!lsURL.trim().isEmpty()) {
- lsURLArray = lsURL.split(",");
- }
+ if (lsURL != null && !lsURL.trim().isEmpty()) {
+ lsURLArray = lsURL.split(",");
}
} catch (PatternSyntaxException ex) {
throw new PerfSONARException(



  • [pS-dev] [GEANT/SA2/ps-java-services] r6063 - in trunk: perfsonar-java-sql-ma/src/main/java/org/perfso nar/service/measurementArchive/sqlType perfsonar_base/sr c/main/java/org/perfsonar/service/measurementArchive/regis ter, svn-noreply, 12/08/2012

Archive powered by MHonArc 2.6.16.

Top of Page