@@ -126,7 +126,7 @@ public PomReader(final URL descriptorURL, final Resource res) throws IOException
126
126
Document pomDomDoc = XMLHelper .parseToDom (source , new EntityResolver () {
127
127
public InputSource resolveEntity (String publicId , String systemId )
128
128
throws SAXException , IOException {
129
- if (( systemId != null ) && systemId .endsWith ("m2-entities.ent" )) {
129
+ if (systemId != null && systemId .endsWith ("m2-entities.ent" )) {
130
130
return new InputSource (
131
131
PomReader .class .getResourceAsStream ("m2-entities.ent" ));
132
132
}
@@ -264,7 +264,7 @@ public License[] getLicenses() {
264
264
String name = getFirstChildText (license , LICENSE_NAME );
265
265
String url = getFirstChildText (license , LICENSE_URL );
266
266
267
- if (( name == null ) && ( url == null ) ) {
267
+ if (name == null && url == null ) {
268
268
// move to next license
269
269
continue ;
270
270
}
@@ -287,11 +287,17 @@ public ModuleRevisionId getRelocation() {
287
287
return null ;
288
288
} else {
289
289
String relocGroupId = getFirstChildText (relocation , GROUP_ID );
290
+ if (relocGroupId == null ) {
291
+ relocGroupId = getGroupId ();
292
+ }
290
293
String relocArtId = getFirstChildText (relocation , ARTIFACT_ID );
294
+ if (relocArtId == null ) {
295
+ relocArtId = getArtifactId ();
296
+ }
291
297
String relocVersion = getFirstChildText (relocation , VERSION );
292
- relocGroupId = relocGroupId == null ? getGroupId () : relocGroupId ;
293
- relocArtId = relocArtId == null ? getArtifactId () : relocArtId ;
294
- relocVersion = relocVersion == null ? getVersion () : relocVersion ;
298
+ if ( relocVersion == null ) {
299
+ relocVersion = getVersion () ;
300
+ }
295
301
return ModuleRevisionId .newInstance (relocGroupId , relocArtId , relocVersion );
296
302
}
297
303
}
@@ -408,7 +414,7 @@ public List<ModuleId> getExcludedModules() {
408
414
if (node instanceof Element && EXCLUSION .equals (node .getNodeName ())) {
409
415
String groupId = getFirstChildText ((Element ) node , GROUP_ID );
410
416
String artifactId = getFirstChildText ((Element ) node , ARTIFACT_ID );
411
- if (( groupId != null ) && ( artifactId != null ) ) {
417
+ if (groupId != null && artifactId != null ) {
412
418
exclusions .add (ModuleId .newInstance (groupId , artifactId ));
413
419
}
414
420
}
@@ -719,8 +725,8 @@ public int read() throws IOException {
719
725
public int read (byte [] b , int off , int len ) throws IOException {
720
726
if (b == null ) {
721
727
throw new NullPointerException ();
722
- } else if (( off < 0 ) || ( off > b .length ) || ( len < 0 ) || (( off + len ) > b .length )
723
- || (( off + len ) < 0 ) ) {
728
+ } else if (off < 0 || off > b .length || len < 0 || (off + len ) > b .length
729
+ || (off + len ) < 0 ) {
724
730
throw new IndexOutOfBoundsException ();
725
731
} else if (len == 0 ) {
726
732
return 0 ;
0 commit comments