The program doesn’t compile while locally it passed all the test.
This is the compiler output:
[ERROR] COMPILATION ERROR :
[ERROR] /tmp/solution/src/main/java/src/Tournament.java:[7,8] duplicate class: Tournament
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project exercise: Compilation failure
[ERROR] /tmp/solution/src/main/java/src/Tournament.java:[7,8] duplicate class: Tournament
[ERROR] → [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] MojoFailureException - Apache Maven - Apache Software Foundation
These are the files I edited and submitted locally (I don’t see any reason to put the whole code in here) using this command:
Exercism submit Tournament.java Team.java
I see that if I comment the package src;
line, it shows the error above, but if I don’t it says that I didn’t implement the methods:
Message: Please implement the Tournament.applyResults() method.
Exception: java.lang.UnsupportedOperationException: Please implement the Tournament.applyResults() method.
at TournamentTest.typicalInput(TournamentTest.java:109)
Tournament.java:
package src;
import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.Collections;
public class Tournament {
String unformString;
ArrayList<Team> teams;
//Team teams[] = new Team[0];
private static final int NUM_OF_SPACES = 31;
private static final int FIRST_TEAM = 0;
private static final int SECOND_TEAM = 1;
private static final int RESULT = 2;
public Tournament() {
teams = new ArrayList<Team>();
}
And this is Team.java:
package src;
public class Team implements Comparable<Team>{
String name;
int MP;
int W;
int D;
int L;
int P;
public Team(String name) {
this.name = name;
MP = W = D = L = P =0;
}
I can’t seem to create 2 files in the online editor therefore I can’t just copy the code to the online editor.