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

class field can be replaced by local variable #8970

Merged
merged 2 commits into from
Feb 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ public class SWORDv2ContainerServlet extends SwordServlet {
ContainerManagerImpl containerManagerImpl;
@Inject
StatementManagerImpl statementManagerImpl;
private ContainerManager cm;
// this field can be replaced by local variable
// private ContainerManager cm;
private ContainerAPI api;
private StatementManager sm;
// this field can be replaced by local variable
// private StatementManager sm;
private final ReentrantLock lock = new ReentrantLock();


Expand All @@ -28,13 +30,15 @@ public void init() throws ServletException {
super.init();

// load the container manager implementation
this.cm = containerManagerImpl;

// load the statement manager implementation
this.sm = statementManagerImpl;
// this.cm = containerManagerImpl;
ContainerManager cm = containerManagerImpl;
// load the statement manager implementation
// this.sm = statementManagerImpl;
StatementManager sm = statementManagerImpl;

// initialise the underlying servlet processor
this.api = new ContainerAPI(this.cm, this.sm, this.config);
// this.api = new ContainerAPI(this.cm, this.sm, this.config);
this.api = new ContainerAPI(cm, sm, this.config);
}

@Override
Expand Down