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

[JBIDE-23821] fix NPE when existing server has no type #1401

Merged
merged 1 commit into from
Feb 2, 2017

Conversation

adietish
Copy link
Member

@adietish adietish commented Feb 1, 2017

Pull Request Checklist

General

  • Is this a blocking issue or new feature? If yes, QE needs to +1 this PR

Code

  • Are method-/class-/variable-names meaningful?
  • Are methods concise, not too long?
  • Are catch blocks catching precise Exceptions only (no catch all)?

Testing

  • Are there unit-tests?
  • Are there integration tests (or at least a jira to tackle these)?
  • Is the non-happy path working, too?
  • Are other parts that use the same component still working fine?

Function

  • Does it work?

@adietish
Copy link
Member Author

adietish commented Feb 1, 2017

@robstryker +1 please?

@Test
public void shouldFindServerGivenListOfServersContainsServerWithNullType() throws CoreException {
// given
IServer os3Server = mockOS3Server("os3", "someService");

Choose a reason for hiding this comment

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

CRITICAL Define a constant instead of duplicating this literal "someService" 8 times. rule

Copy link
Member Author

Choose a reason for hiding this comment

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

this is a test, there's no added value in defining a constant to make sure we're always using the very same string.

&& testServer(server);
}

abstract protected boolean testServer(IServer server);
Copy link
Member Author

Choose a reason for hiding this comment

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

oh, a leftover of a try that I eventually stopped.

@Test
public void shouldFindServerGivenListOfServersContainsServerWithNullType() throws CoreException {
// given
IServer os3Server = mockOS3Server("os3", "someService");
Copy link
Member Author

Choose a reason for hiding this comment

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

this is a test, there's no added value in defining a constant to make sure we're always using the very same string.

@rhdevelopers-ci
Copy link

SonarQube analysis reported 1 issue

  • CRITICAL 1 critical

Watch the comments in this conversation to review them.

@adietish
Copy link
Member Author

adietish commented Feb 1, 2017

@robstryker +1 please?

1 similar comment
@adietish
Copy link
Member Author

adietish commented Feb 2, 2017

@robstryker +1 please?

@robstryker
Copy link
Member

+1

@adietish adietish merged commit a5b2808 into jbosstools:master Feb 2, 2017
@adietish adietish deleted the JBIDE-23821 branch February 2, 2017 17:28
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.

None yet

3 participants