-
Notifications
You must be signed in to change notification settings - Fork 134
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
Fix MalformedInputException in checkJUnitDependencies #1932
Conversation
Generate changelog in
|
} catch (IOException e) { | ||
throw new RuntimeException("Unable to check file " + file, e); | ||
return lines.anyMatch(substring); | ||
} catch (Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MalformedInputException
is thrown as an UncheckedIOException
.
…-baseline into callumr/fix-invalid-utf8
@@ -164,7 +163,7 @@ private boolean hasDep(Set<ResolvedComponentResult> deps, Predicate<ModuleVersio | |||
} | |||
|
|||
private boolean sourceSetMentionsJUnit4(SourceSet ss) { | |||
return !ss.getAllSource() | |||
return !ss.getAllJava() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth adding a small comment here that getAllJava
is also including groovy files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Released 4.28.0 |
###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. # Release Notes ## 4.28.0 | Type | Description | Link | | ---- | ----------- | ---- | | Fix | Fix `MalformedInputException` when checking non-utf8 files for correct junit dependencies. | palantir/gradle-baseline#1932 | To enable or disable this check, please contact the maintainers of Excavator.
Before this PR
In #1929, I had originally changed searching in
sourceSet.getAllJava()
tosourceSet.getAllSource()
to make sure we were looking in.groovy
files as well as java. I left it in there by accident. However, this has had the downside of searching through the resources too, which may contain non-utf8 encoded files. This leads to this kind of error:as it tries to decode non-utf8 files into utf8.
Additionally, I never proved out whether groovy files are included in
getAllSource
and notgetAllJava
. Looking at theGroovyBasePlugin
it actually puts the groovy source into the java source sets:After this PR
==COMMIT_MSG==
Fix
MalformedInputException
when checking non-utf8 files for correct junit dependencies.==COMMIT_MSG==
Possible downsides?