Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

SONARJAVA-1377 Fine tuning#1545

Merged
benzonico merged 8 commits into
masterSonarSource/sonar-java:masterfrom
SONARJAVA-1377_fine-tuningSonarSource/sonar-java:SONARJAVA-1377_fine-tuningCopy head branch name to clipboard
Jun 30, 2017
Merged

SONARJAVA-1377 Fine tuning#1545
benzonico merged 8 commits into
masterSonarSource/sonar-java:masterfrom
SONARJAVA-1377_fine-tuningSonarSource/sonar-java:SONARJAVA-1377_fine-tuningCopy head branch name to clipboard

Conversation

@ghost

@ghost ghost commented Jun 29, 2017

Copy link
Copy Markdown

No description provided.

@ghost ghost changed the title SOANRJAVA-1377 Fine tuning SONARJAVA-1377 Fine tuning Jun 29, 2017
.filter(e -> toSimpleName(e.getKey()).equals(exceptionName))
.map(Map.Entry::getValue)
.flatMap(List::stream)
.collect(Collectors.toList());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAJOR Unknown method rule

@SonarTech

Copy link
Copy Markdown
Contributor

SonarQube analysis reported 2 issues

  • MAJOR 2 major

Watch the comments in this conversation to review them.

.filter(e -> isEmptyDescription(e.getValue()))
.map(Map.Entry::getKey)
.map(Javadoc::toSimpleName)
.collect(Collectors.toList());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAJOR Unknown method rule

"Should never happen. Exceptions can not be specified other than with an identifier or a fully qualified name, and can not be parametrized.");
// should not happen, as exceptions can only be defined using identifier or fully qualified name,
// no parameterized type can be used
return null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So why actually returning something ? I would really prefer to stick to throwing an explicit exception. AFAI understand you only return so you can test it in an existing test : create a dedicated test for the case and keep the explicit failure.

if (!results.containsKey(elementName)) {
results.put(elementName, new ArrayList<>());
}
List<String> currentDescriptions = results.get(elementName);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use results.computeIfAbsent(elementName, ArrayList::new)

@benzonico benzonico merged commit a5db574 into master Jun 30, 2017
@ghost ghost deleted the SONARJAVA-1377_fine-tuning branch June 30, 2017 12:16
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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.