File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed
src/main/java/org/scm4j/commons/coords Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1- package org .scm4j .commons ;
1+ package org .scm4j .commons .coords ;
2+
3+ import org .scm4j .commons .Version ;
24
35public interface Coords {
46
Original file line number Diff line number Diff line change 22
33import org .apache .commons .lang3 .StringUtils ;
44import org .scm4j .commons .CommentedString ;
5- import org .scm4j .commons .Coords ;
65import org .scm4j .commons .Version ;
76
87public class CoordsGradle implements Coords {
Original file line number Diff line number Diff line change 22
33import org .apache .commons .lang3 .StringUtils ;
44import org .scm4j .commons .CommentedString ;
5- import org .scm4j .commons .Coords ;
65import org .scm4j .commons .Version ;
76
87public class CoordsMaven implements Coords {
@@ -93,4 +92,29 @@ public Version getVersion() {
9392 public String getName () {
9493 return groupId + artifactId ;
9594 }
95+
96+ @ Override
97+ public int hashCode () {
98+ final int prime = 31 ;
99+ int result = 1 ;
100+ result = prime * result + ((coordsStringNoComment == null ) ? 0 : coordsStringNoComment .hashCode ());
101+ return result ;
102+ }
103+
104+ @ Override
105+ public boolean equals (Object obj ) {
106+ if (this == obj )
107+ return true ;
108+ if (obj == null )
109+ return false ;
110+ if (getClass () != obj .getClass ())
111+ return false ;
112+ CoordsMaven other = (CoordsMaven ) obj ;
113+ if (coordsStringNoComment == null ) {
114+ if (other .coordsStringNoComment != null )
115+ return false ;
116+ } else if (!coordsStringNoComment .equals (other .coordsStringNoComment ))
117+ return false ;
118+ return true ;
119+ }
96120}
You can’t perform that action at this time.
0 commit comments