Revision: 1784
Author: [email protected]
Date: Tue Dec 15 16:35:26 2009
Log: Use the getFeaturedProject method to avoid code duplication
http://code.google.com/p/simal/source/detail?r=1784
Modified:
/trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/panel/ProjectSummaryPanel.java
=======================================
---
/trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/panel/ProjectSummaryPanel.java
Mon Nov 23 15:01:40 2009
+++
/trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/panel/ProjectSummaryPanel.java
Tue Dec 15 16:35:26 2009
@@ -27,9 +27,6 @@
* specific language governing permissions and limitations * under the
License. *
*/
-import java.util.Random;
-import java.util.Set;
-
import org.apache.wicket.Page;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.IPageLink;
@@ -58,16 +55,8 @@
super(panelID);
IProject project;
try {
- Set<IProject> allProjects = UserApplication.getRepository()
- .getAllProjects();
- Random rand = new Random();
- int size = allProjects.size();
- if (size > 0) {
- int idx = rand.nextInt(size);
- project = (IProject) allProjects.toArray()[idx];
- } else {
- project = null;
- }
+ project = UserApplication.getRepository()
+ .getFeaturedProject();
} catch (SimalRepositoryException e) {
// If we can't get a random project it is safe to use a null project
as
// this will simply report an error to the user in this panel
--
You received this message because you are subscribed to the Google Groups
"Simal Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/simal-commits?hl=en.