Instance variable should be local if possible, to save memory usage.
This commit is contained in:
parent
674ab0dcf1
commit
8fff1fb783
@ -15,9 +15,7 @@ import se.su.dsv.scipro.security.auth.roles.Roles;
|
||||
@Authorization(authorizedRoles={Roles.STUDENT})
|
||||
public class ProjectIdeaSubmissionPage extends ProjectPage implements MenuHighlightProjectIdeas {
|
||||
|
||||
private final ProjectIdea idea;
|
||||
|
||||
@SpringBean
|
||||
@SpringBean
|
||||
private ProjectIdeaDao projectIdeaDao;
|
||||
|
||||
public ProjectIdeaSubmissionPage(PageParameters pp) {
|
||||
@ -25,13 +23,14 @@ public class ProjectIdeaSubmissionPage extends ProjectPage implements MenuHighli
|
||||
|
||||
Long ideaId = pp.getAsLong("idea");
|
||||
|
||||
if(ideaId != null)
|
||||
ProjectIdea idea;
|
||||
if(ideaId != null)
|
||||
idea = projectIdeaDao.load(ideaId);
|
||||
else
|
||||
idea = new ProjectIdea();
|
||||
add(new ProjectIdeaSubmissionPanel("projectIdeaPanel", getUser(), idea));
|
||||
add(new CheatSheetPanel("cheatSheetPanel"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user