Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated API usages replaced #1005

Merged
merged 5 commits into from
Aug 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract class AnalysisExecution<T> extends SynchronousNonBlockingStepExecution<
Run<?, ?> run = getContext().get(Run.class);

if (run == null) {
throw new IOException("Can't resolve Run for " + toString());
throw new IOException("Can't resolve Run for " + this);
}

return run;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private JsonObject convertToJson(final HttpResponse response) throws IOException
throw new ParsingException("Response without a json body");
}
try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
final JsonElement json = new JsonParser().parse(reader);
final JsonElement json = JsonParser.parseReader(reader);
if (!json.isJsonObject()) {
throw new ParsingException("Invalid response from dashboard. Json object expected.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void shouldParseHtmlMessage() {
ChecksDetails details = publisher.extractChecksDetails(AnnotationScope.PUBLISH_NEW_ISSUES);

assertThat(details.getOutput().get().getChecksAnnotations())
.usingElementComparatorOnFields("message")
.usingRecursiveFieldByFieldElementComparatorOnFields("message")
.containsOnly(new ChecksAnnotationBuilder()
.withMessage("ERROR:\n"
+ "Some diagnostic messages may contain incorrect line number.\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public JsonObject getIssues(final AxIssueKind kind) {

JsonObject getIssuesFrom(final String resourcePath) {
final URL testCase = this.getClass().getResource(resourcePath);
return new JsonParser().parse(new Resource(testCase).asReader()).getAsJsonObject();
return JsonParser.parseReader(new Resource(testCase).asReader()).getAsJsonObject();
}

private String resolveResourcePath(final AxIssueKind kind) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,50 +36,50 @@
* <b>Maven:</b>
*
* <dl>
* <dt>pom.xml<dt/>
* <dd>a default pom.xml with a valid name tag<dd/>
* <dt>m1/pom.xml<dt/>
* <dt>pom.xml</dt>
* <dd>a default pom.xml with a valid name tag</dd>
* <dt>m1/pom.xml</dt>
* <dd>a default pom.xml with a valid name tag which could be used to detect additional modules in addition to
* the previous mentioned pom.xml<dd/>
* <dt>m2/pom.xml<dt/>
* the previous mentioned pom.xml</dd>
* <dt>m2/pom.xml</dt>
* <dd>a default pom.xml with a valid name tag which could be used to detect additional modules in addition to
* the previous mentioned pom.xml<dd/>
* <dt>m3/pom.xml<dt/>
* <dd>a broken XML-structure breaks the correct parsing of this file<dd/>
* <dt>m4/pom.xml<dt/>
* <dd>a pom.xml with an artifactId tag and without a name tag<dd/>
* <dt>m5/pom.xml<dt/>
* <dd>a pom.xml without an artifactId tag and without a name tag<dd/>
* the previous mentioned pom.xml</dd>
* <dt>m3/pom.xml</dt>
* <dd>a broken XML-structure breaks the correct parsing of this file</dd>
* <dt>m4/pom.xml</dt>
* <dd>a pom.xml with an artifactId tag and without a name tag</dd>
* <dt>m5/pom.xml</dt>
* <dd>a pom.xml without an artifactId tag and without a name tag</dd>
* </dl>
* <p>
*
* <b>Ant:</b>
*
* <dl>
* <dt>build.xml<dt/>
* <dd>a default build.xml with a valid name tag<dd/>
* <dt>m1/build.xml<dt/>
* <dt>build.xml</dt>
* <dd>a default build.xml with a valid name tag</dd>
* <dt>m1/build.xml</dt>
* <dd>a default build.xml with a valid name tag which could be used to detect additional modules in addition
* * to the previous mentioned build.xml<dd/>
* <dt>m2/build.xml<dt/>
* <dd>a broken XML-structure breaks the correct parsing of this file<dd/>
* <dt>m3/build.xml<dt/>
* <dd>a build file without the name tag<dd/>
* * to the previous mentioned build.xml</dd>
* <dt>m2/build.xml</dt>
* <dd>a broken XML-structure breaks the correct parsing of this file</dd>
* <dt>m3/build.xml</dt>
* <dd>a build file without the name tag</dd>
* </dl>
*
* <b>OSGI:</b>
*
* <dl>
* <dt>META-INF/MANIFEST.MF<dt/>
* <dd>a default MANIFEST.MF with a set Bundle-SymbolicName and a set Bundle-Vendor<dd/>
* <dt>m1/META-INF/MANIFEST.MF<dt/>
* <dd> a MANIFEST.MF with a wildcard Bundle-Name, a set Bundle-SymbolicName and a wildcard<dd/>
* <dt>m2/META-INF/MANIFEST.MF<dt/>
* <dd>a MANIFEST.MF with a set Bundle-Name and a wildcard Bundle-Vendor<dd/>
* <dt>m3/META-INF/MANIFEST.MF<dt/>
* <dd>an empty MANIFEST.MF<dd/>
* <dt>plugin.properties<dt/>
* <dd>a default plugin.properties file<dd/>
* <dt>META-INF/MANIFEST.MF</dt>
* <dd>a default MANIFEST.MF with a set Bundle-SymbolicName and a set Bundle-Vendor</dd>
* <dt>m1/META-INF/MANIFEST.MF</dt>
* <dd> a MANIFEST.MF with a wildcard Bundle-Name, a set Bundle-SymbolicName and a wildcard</dd>
* <dt>m2/META-INF/MANIFEST.MF</dt>
* <dd>a MANIFEST.MF with a set Bundle-Name and a wildcard Bundle-Vendor</dd>
* <dt>m3/META-INF/MANIFEST.MF</dt>
* <dd>an empty MANIFEST.MF</dd>
* <dt>plugin.properties</dt>
* <dd>a default plugin.properties file</dd>
* </dl>
* <p>
* All tests work the same way: first of all a set of module files will be copied to the workspace. Each module file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,31 @@ public void shouldFindAllIssuesForCheckStyleAlias() {
}
}

/** Runs the Iar parser on an output file that contains 8 issues. */
/** Runs the Cmake parser on an output file that contains 8 issues. */
@Test
public void shouldFindAllCmakeIssues() {
shouldFindIssuesOfTool(8, new Cmake(), "cmake.txt");
}

/** Runs the Iar parser on an output file that contains 2 issues. */
/** Runs the Cargo parser on an output file that contains 2 issues. */
@Test
public void shouldFindAllCargoIssues() {
shouldFindIssuesOfTool(2, new Cargo(), "CargoCheck.json");
}

/** Runs the Iar parser on an output file that contains 262 issues. */
/** Runs the Pmd parser on an output file that contains 262 issues. */
@Test
public void shouldFindAllIssuesForPmdAlias() {
shouldFindIssuesOfTool(262, new Infer(), "pmd-6.xml");
}

/** Runs the Iar parser on an output file that contains 262 issues. */
/** Runs the MSBuild parser on an output file that contains 262 issues. */
@Test
public void shouldFindAllIssuesForMsBuildAlias() {
shouldFindIssuesOfTool(6, new PcLint(), "msbuild.txt");
}

/** Runs the Iar parser on an output file that contains 4 issues. */
/** Runs the YamlLint parser on an output file that contains 4 issues. */
@Test
public void shouldFindAllYamlLintIssues() {
shouldFindIssuesOfTool(4, new YamlLint(), "yamllint.txt");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void shouldHandleMalformedInputException() {
Report report = scanner.scan(pathToFile, StandardCharsets.UTF_8);

assertThat(report.getErrorMessages()).isNotEmpty().contains("Can't read source file '"
+ pathToFile.toString()
+ pathToFile
+ "', defined encoding 'UTF-8' seems to be wrong");
}

Expand Down