-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Improve error message for unresolved expressions #11615
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
base: master
Are you sure you want to change the base?
Improve error message for unresolved expressions #11615
Conversation
Signed-off-by: 高春晖 <18220699480@163.com>
| enhanced.append("Failed to collect dependencies"); | ||
|
|
||
| org.eclipse.aether.graph.Dependency root = request.getRoot(); | ||
| if (root != null && root.getArtifact() != null) { |
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.
| if (root != null && root.getArtifact() != null) { | |
| return if (root != null && root.getArtifact() != null) ? enhanceDependency() : enhanceDependencies(...); |
could be extracted as dedicated branch/concern to provide cohesion over coupling.
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.
ternary operators are harder to read
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.
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.
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.
It's not about formatting. The word "if" is clearer than the question mark symbol
| } | ||
| } | ||
|
|
||
| for (org.eclipse.aether.graph.Dependency dep : request.getDependencies()) { |
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.
could be extracted as dedicated branch/concern to provide cohesion over coupling.
| for (org.eclipse.aether.graph.Dependency dep : request.getDependencies()) { | |
| return enhanceDependencies(...) |
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.
I have no idea what that comment means
| } catch (DependencyCollectionException e) { | ||
| throw new DependencyResolverException("Unable to collect dependencies", e); | ||
| String enhancedMessage = enhanceCollectionError(e, collectRequest); | ||
| throw new DependencyResolverException(enhancedMessage, 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.
| throw new DependencyResolverException(enhancedMessage, e); | |
| throw new DependencyResolverException(enhanceCollectionError(e, collectRequest), 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.
I think this is fine as is
| } catch (DependencyCollectionException e) { | ||
| throw new DependencyResolverException("Unable to collect dependencies", e); | ||
| String enhancedMessage = enhanceCollectionError(e, collectRequest); | ||
| throw new DependencyResolverException(enhancedMessage, 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.
I think this is fine as is
| enhanced.append("Failed to collect dependencies"); | ||
|
|
||
| org.eclipse.aether.graph.Dependency root = request.getRoot(); | ||
| if (root != null && root.getArtifact() != null) { |
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.
ternary operators are harder to read
Adjust if statement formatting to comply with project code style: - Split OR conditions onto separate lines with proper indentation - Ensures consistency with Spotless formatting rules
5867ad5 to
1bafff2
Compare
|
Thanks for the reviews! Ready to merge? |
|
The CI failure on macOS + Java 25 is a network timeout issue when downloading I've pushed an empty commit to trigger a re-run. Should pass once the network is stable. |


Fixes #10324