Skip to content

Commit

Permalink
Merge pull request #944 from DevFactory/staging/Two-branches-in-the-s…
Browse files Browse the repository at this point in the history
…ame-conditional-structure-should-not-have-exactly-the-same-implementation-fix-3

Two branches in the same conditional structure should not have exactly the same implementation
  • Loading branch information
cbeust committed Jan 11, 2016
2 parents c8a0b66 + b1d002d commit 527223e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 20 deletions.
4 changes: 1 addition & 3 deletions src/main/java/org/testng/internal/BaseTestMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,12 @@ public int compareTo(Object o) {
int result = -2;
Class<?> thisClass = getRealClass();
Class<?> otherClass = ((ITestNGMethod) o).getRealClass();
if (this == o) {
if (this == o || equals(o)) {
result = 0;
} else if (thisClass.isAssignableFrom(otherClass)) {
result = -1;
} else if (otherClass.isAssignableFrom(thisClass)) {
result = 1;
} else if (equals(o)) {
result = 0;
}

return result;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/testng/internal/DynamicGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ public List<T> getFreeNodes() {

List<T> du = m_dependedUpon.get(m);
// - no other nodes depend on it
if (!m_dependedUpon.containsKey(m)) {
result.add(m);
} else if (getUnfinishedNodes(du).size() == 0) {
if (!m_dependedUpon.containsKey(m) || getUnfinishedNodes(du).size() == 0) {
result.add(m);
}
}
Expand Down
9 changes: 1 addition & 8 deletions src/main/java/org/testng/remote/RemoteTestNG.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,7 @@ public static void main(String[] args) throws ParameterException {
}
m_debug = cla.debug;
m_ack = ra.ack;
if (m_debug) {
// while (true) {
initAndRun(args, cla, ra);
// }
}
else {
initAndRun(args, cla, ra);
}
initAndRun(args, cla, ra);
}

private static void initAndRun(String[] args, CommandLineArgs cla, RemoteArgs ra) {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/testng/xml/TestNGContentHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,6 @@ else if ("selector-class".equals(qName)) {
else if ("script".equals(qName)) {
xmlScript(false, null);
}
else if ("packages".equals(qName)) {
xmlPackages(false, null);
}
else if ("include".equals(qName)) {
xmlInclude(false, null);
} else if ("exclude".equals(qName)){
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/testng/xml/XmlClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,7 @@ public boolean equals(Object obj) {
if (getClass() != obj.getClass())
return XmlSuite.f();
XmlClass other = (XmlClass) obj;
if (other.m_loadClasses != m_loadClasses) {
return XmlSuite.f();
} else if (!m_excludedMethods.equals(other.m_excludedMethods)) {
if (other.m_loadClasses != m_loadClasses || !m_excludedMethods.equals(other.m_excludedMethods)) {
return XmlSuite.f();
}
if (m_includedMethods == null) {
Expand Down

0 comments on commit 527223e

Please sign in to comment.