Skip to content

Commit

Permalink
Add missing @OverRide annotation (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
darxriggs authored Oct 31, 2021
1 parent b89c952 commit 3cc961f
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/main/java/hudson/tasks/junit/CaseResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ private static int halfMaxSize(Collection<CaseResult> results) {
return HALF_MAX_SIZE;
}

@Override
public ClassResult getParent() {
return classResult;
}
Expand Down Expand Up @@ -304,6 +305,7 @@ public String getTransformedTestName() {
return TestNameTransformer.getTransformedName(getName());
}

@Override
public String getDisplayName() {
return getNameWithEnclosingBlocks(getTransformedTestName());
}
Expand Down Expand Up @@ -349,6 +351,7 @@ public String getTitle() {
* Gets the duration of the test, in seconds
*/
@Exported(visibility=9)
@Override
public float getDuration() {
return duration;
}
Expand Down Expand Up @@ -409,6 +412,7 @@ public String getFullName() {
/**
* @since 1.515
*/
@Override
public String getFullDisplayName() {
return getNameWithEnclosingBlocks(getTransformedFullDisplayName());
}
Expand Down Expand Up @@ -436,6 +440,7 @@ public int getPassCount() {
* when this test started failing.
*/
@Exported(visibility=9)
@Override
public int getFailedSince() {
// If we haven't calculated failedSince yet, and we should,
// do it now.
Expand All @@ -457,6 +462,7 @@ private void recomputeFailedSinceIfNeeded() {
}
}

@Override
public Run<?,?> getFailedSinceRun() {
JunitTestResultStorage storage = JunitTestResultStorage.find();
if (!(storage instanceof FileJunitTestResultStorage)) {
Expand Down Expand Up @@ -500,6 +506,7 @@ else if (getRun() != null) {
* @since 1.294
*/
@Exported
@Override
public String getStdout() {
if(stdout!=null) return stdout;
SuiteResult sr = getSuiteResult();
Expand All @@ -514,6 +521,7 @@ public String getStdout() {
* @since 1.294
*/
@Exported
@Override
public String getStderr() {
if(stderr!=null) return stderr;
SuiteResult sr = getSuiteResult();
Expand Down Expand Up @@ -582,6 +590,7 @@ private Collection<? extends hudson.tasks.test.TestResult> singletonListOfThisOr
* If there was an error or a failure, this is the stack trace, or otherwise null.
*/
@Exported
@Override
public String getErrorStackTrace() {
return errorStackTrace;
}
Expand All @@ -590,13 +599,15 @@ public String getErrorStackTrace() {
* If there was an error or a failure, this is the text from the message.
*/
@Exported
@Override
public String getErrorDetails() {
return errorDetails;
}

/**
* @return true if the test was not skipped and did not fail, false otherwise.
*/
@Override
public boolean isPassed() {
return !skipped && errorDetails == null && errorStackTrace==null;
}
Expand Down Expand Up @@ -688,6 +699,7 @@ public void freeze(SuiteResult parent) {
recomputeFailedSinceIfNeeded();
}

@Override
public int compareTo(CaseResult that) {
if (this == that) {
return 0;
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/hudson/tasks/junit/ClassResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public ClassResult(PackageResult parent, String className) {
return parent==null ? null: parent.getRun();
}

@Override
public PackageResult getParent() {
return parent;
}
Expand Down Expand Up @@ -91,6 +92,7 @@ public hudson.tasks.test.TestResult findCorrespondingResult(String id) {
return getCaseResult(caseName);
}

@Override
public String getTitle() {
return Messages.ClassResult_getTitle(getDisplayName());
}
Expand All @@ -101,6 +103,7 @@ public String getChildTitle() {
}

@Exported(visibility=999)
@Override
public String getName() {
int idx = className.lastIndexOf('.');
if(idx<0) return className;
Expand Down Expand Up @@ -134,30 +137,36 @@ public Object getDynamic(String name, StaplerRequest req, StaplerResponse rsp) {


@Exported(name="child")
@Override
public List<CaseResult> getChildren() {
return cases;
}

@Override
public boolean hasChildren() {
return (cases != null) && (cases.size() > 0);
}

// TODO: wait for stapler 1.60 @Exported
@Override
public float getDuration() {
return duration;
}

@Exported
@Override
public int getPassCount() {
return passCount;
}

@Exported
@Override
public int getFailCount() {
return failCount;
}

@Exported
@Override
public int getSkipCount() {
return skipCount;
}
Expand Down Expand Up @@ -197,6 +206,7 @@ public String getClassName() {
return className;
}

@Override
public int compareTo(ClassResult that) {
if (this.equals(that)) {
return 0;
Expand All @@ -223,6 +233,7 @@ public int hashCode() {
return System.identityHashCode(this);
}

@Override
public String getDisplayName() {
return TestNameTransformer.getTransformedName(getName());
}
Expand All @@ -235,6 +246,7 @@ public String getFullName() {
return getParent().getName() + "." + className;
}

@Override
public String getFullDisplayName() {
return getParent().getDisplayName() + "." + TestNameTransformer.getTransformedName(className);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/hudson/tasks/junit/JUnitParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ private ParseResultCallable(String testResults, Run<?,?> build,
this.listener = listener;
}

@Override
public T invoke(File ws, VirtualChannel channel) throws IOException {
final long nowSlave = System.currentTimeMillis();

Expand Down
11 changes: 10 additions & 1 deletion src/main/java/hudson/tasks/junit/JUnitResultArchiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,17 @@ protected TestResult parseResult(DirectoryScanner ds, long buildTime)
return new TestResult(buildTime, ds);
}

@Override
public BuildStepMonitor getRequiredMonitorService() {
return BuildStepMonitor.NONE;
}

@Override
public String getTestResults() {
return testResults;
}

@Override
public double getHealthScaleFactor() {
return healthScaleFactor == null ? 1.0 : healthScaleFactor;
}
Expand All @@ -349,7 +352,9 @@ public double getHealthScaleFactor() {
this.healthScaleFactor = Math.max(0.0, healthScaleFactor);
}

public @Nonnull List<TestDataPublisher> getTestDataPublishers() {
@Nonnull
@Override
public List<TestDataPublisher> getTestDataPublishers() {
return testDataPublishers == null ? Collections.emptyList() : testDataPublishers;
}

Expand All @@ -366,6 +371,7 @@ public double getHealthScaleFactor() {
/**
* @return the keepLongStdio.
*/
@Override
public boolean isKeepLongStdio() {
return keepLongStdio;
}
Expand All @@ -383,6 +389,7 @@ public boolean isKeepLongStdio() {
*
* @return the allowEmptyResults
*/
@Override
public boolean isAllowEmptyResults() {
return allowEmptyResults;
}
Expand Down Expand Up @@ -429,6 +436,7 @@ public void setSkipMarkingBuildUnstable(boolean skipMarkingBuildUnstable) {

@Extension
public static class DescriptorImpl extends BuildStepDescriptor<Publisher> {
@Override
public String getDisplayName() {
return Messages.JUnitResultArchiver_DisplayName();
}
Expand All @@ -450,6 +458,7 @@ public FormValidation doCheckTestResults(
return FilePath.validateFileMask(project.getSomeWorkspace(), value);
}

@Override
public boolean isApplicable(Class<? extends AbstractProject> jobType) {
return true;
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/hudson/tasks/junit/PackageResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ public Run<?,?> getRun() {
return parent == null ? null : parent.getRun();
}

@Override
public hudson.tasks.junit.TestResult getParent() {
return parent;
}

@Exported(visibility=999)
@Override
public String getName() {
return packageName;
}
Expand Down Expand Up @@ -158,6 +160,7 @@ public ClassResult getClassResult(String name) {
}

@Exported(name="child")
@Override
public Collection<ClassResult> getChildren() {
return classes.values();
}
Expand All @@ -175,6 +178,7 @@ public boolean hasChildren() {
* Returns a list of the failed cases, in no particular
* sort order
*/
@Override
public List<CaseResult> getFailedTests() {
TestResultImpl pluggableStorage = parent.getPluggableStorage();
if (pluggableStorage != null) {
Expand Down Expand Up @@ -314,6 +318,7 @@ void freeze() {
}
}

@Override
public int compareTo(PackageResult that) {
if (this.equals(that)) {
return 0;
Expand All @@ -340,6 +345,7 @@ public int hashCode() {
return System.identityHashCode(this);
}

@Override
public String getDisplayName() {
return TestNameTransformer.getTransformedName(packageName);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/hudson/tasks/junit/TestObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public TestObject getResultInRun(Run<?,?> run) {
*/
public abstract String getSafeName();

@Override
public abstract String getSearchUrl();

/**
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/hudson/tasks/junit/TestResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public TestResultImpl getPluggableStorage() {
return impl;
}

@Override
public TestObject getParent() {
return parent;
}
Expand Down Expand Up @@ -394,6 +395,7 @@ public void parse(File reportFile, PipelineTestDetails pipelineTestDetails) thro
}
}

@Override
public String getDisplayName() {
return Messages.TestResult_getDisplayName();
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/hudson/tasks/junit/TestResultAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ private TestResult load() {
return r;
}

@Override
public Object getTarget() {
return getResult();
}
Expand Down Expand Up @@ -313,6 +314,7 @@ public static abstract class Data {
public abstract List<? extends TestAction> getTestAction(hudson.tasks.junit.TestObject testObject);
}

@Override
public Object readResolve() {
super.readResolve(); // let it do the post-deserialization work
if (testData == null) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/hudson/tasks/junit/XMLEntityResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class XMLEntityResolver implements EntityResolver {
/**
* Intercepts the lookup of publicId, systemId
*/
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
if (systemId != null) {
if (LOGGER.isLoggable(Level.FINE)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ public JUnitResultsStep(String testResults) {
this.testResults = testResults;
}

@Override
public String getTestResults() {
return testResults;
}

@Override
public double getHealthScaleFactor() {
return healthScaleFactor == null ? 1.0 : healthScaleFactor;
}
Expand All @@ -83,8 +85,9 @@ public final void setHealthScaleFactor(double healthScaleFactor) {
this.healthScaleFactor = Math.max(0.0, healthScaleFactor);
}

public @Nonnull
List<TestDataPublisher> getTestDataPublishers() {
@Nonnull
@Override
public List<TestDataPublisher> getTestDataPublishers() {
return testDataPublishers == null ? Collections.emptyList() : testDataPublishers;
}

Expand All @@ -101,6 +104,7 @@ List<TestDataPublisher> getTestDataPublishers() {
/**
* @return the keepLongStdio.
*/
@Override
public boolean isKeepLongStdio() {
return keepLongStdio;
}
Expand All @@ -118,6 +122,7 @@ public boolean isKeepLongStdio() {
*
* @return the allowEmptyResults
*/
@Override
public boolean isAllowEmptyResults() {
return allowEmptyResults;
}
Expand Down
Loading

0 comments on commit 3cc961f

Please sign in to comment.