-
Notifications
You must be signed in to change notification settings - Fork 153
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
[JENKINS-55804] - Attempt to solve issue #53
Conversation
Did basic formatting suggested.
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.
Would be also nice to remove the original private method if it is no longer used
@@ -60,6 +44,14 @@ | |||
import org.kohsuke.stapler.DataBoundConstructor; | |||
import org.springframework.dao.DataAccessException; | |||
|
|||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nonnull; | |||
import java.util.*; |
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.
Better to avoid wildcard imports. Sometimes it causes ambiguuty conflicts
@oleg-nenashev thanks for the response. I was myself going to ask if that method is to be kept or not..... , removed the wildcard, any other changes you would like? |
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.
LGTM except one minor comment
roleMap.put(role, this.grantedRoles.get(role)); | ||
} | ||
new RoleWalker() | ||
{ |
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.
NIT: codestyle. In Java opening bracket usually goes to the initiating closure, e.g. new RoleWalker() {
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.
Oh i didn't notice that, thanks for pointing. Did the changes, if any further changes are required do point out. Thanks. @oleg-nenashev
new RoleWalker() { | ||
public void perform(Role current) { | ||
Matcher m = current.getPattern().matcher(namePattern); | ||
if (m.matches()) { |
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.
Minor thing: indenting is broken here
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.
Sorry for those repeated formatting issues. I have changed that, will try to overcome this next time on wards.
@deepanshnagaria nothing is really needed here apart from the formatting fix. I will mere the PR after it |
Thanks @deepanshnagaria ! |
Uh, I finally didn't squash it :( |
@oleg-nenashev i wanted to ask if the implementation i did is what also solves https://issues.jenkins-ci.org/browse/JENKINS-55807 ? Actually i didn't understand the issue clearly ,but feel that it says something similar.. Should I add that issue too in the heading?? @runzexia |
my attempt to fix the issue(55804,Performance: Reduce memory footprint and execution time for RoleMap#newMatchingRoleMap() )by removing the intermediate collections in the method newMatchingRoleMap(), which were created on call of getMatchingRoles() fuction.