Skip to content

Make Hamming check for method refs#321

Merged
kahgoh merged 2 commits intoexercism:mainfrom
kahgoh:fix/hamming-method-ref
Mar 30, 2026
Merged

Make Hamming check for method refs#321
kahgoh merged 2 commits intoexercism:mainfrom
kahgoh:fix/hamming-method-ref

Conversation

@kahgoh
Copy link
Copy Markdown
Member

@kahgoh kahgoh commented Mar 30, 2026

This is to ensure that the Hamming analyzer considers the use of method references when checking the solution.

Fixes #303.

This is to ensure that the Hamming analyzer considers the use of
method references when checking the solution.

Fixes exercism#303.
@kahgoh kahgoh requested a review from a team as a code owner March 30, 2026 04:22
Comment on lines +81 to +82
Stream<String> methodRefs = statement.findAll(MethodReferenceExpr.class).stream()
.map(MethodReferenceExpr::getIdentifier);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Stream<String> methodRefs = statement.findAll(MethodReferenceExpr.class).stream()
.map(MethodReferenceExpr::getIdentifier);
Stream<String> methodRefs = statement.findAll(MethodReferenceExpr.class).stream()
.map(MethodReferenceExpr::getIdentifier);

public int getHammingDistance() {
return distance;
}
} No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add trailing newlines.

private int doesLetterMatch(int i) {
return leftStrand.charAt(i) == rightStrand.charAt(i) ? 0 : 1;
}
} No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing newline please.

@kahgoh kahgoh merged commit 3d96cb6 into exercism:main Mar 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive: Analyzer warns about charAt usage when comparison is done in helper method

2 participants