Author: ross.gardler
Date: Sun Sep 7 14:41:47 2008
New Revision: 1282
Removed:
trunk/uk.ac.osswatch.simal.web/src/test/java/uk/ac/osswatch/simal/wicket/TestOpenSocialPage.java
Modified:
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/doap/ExhibitProjectBrowserPage.java
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/panel/PersonListPanel.java
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/panel/ProjectSummaryPanel.java
Log:
Another few findbugs warnings and a log message to try and figure out why
the CI server is failing tests
Modified:
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/doap/ExhibitProjectBrowserPage.java
==============================================================================
---
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/doap/ExhibitProjectBrowserPage.java
(original)
+++
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/doap/ExhibitProjectBrowserPage.java
Sun Sep 7 14:41:47 2008
@@ -24,6 +24,8 @@
import org.apache.wicket.behavior.HeaderContributor;
import org.apache.wicket.behavior.StringHeaderContributor;
import org.apache.wicket.markup.html.resources.CompressedResourceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import uk.ac.osswatch.simal.rdf.SimalRepositoryException;
import uk.ac.osswatch.simal.wicket.BasePage;
@@ -38,11 +40,13 @@
*/
public class ExhibitProjectBrowserPage extends BasePage {
private static final long serialVersionUID = 2675836864409849552L;
+ private static final Logger logger =
LoggerFactory.getLogger(ExhibitProjectBrowserPage.class);
private static final CompressedResourceReference EXHIBIT_CSS = new
CompressedResourceReference(
BasePage.class, "style/exhibit.css");
public ExhibitProjectBrowserPage() {
String dir = System.getProperty("java.io.tmpdir");
+ logger.debug("Temporary JSON file will be saved in {}", dir);
try {
File outFile = new File(dir + "projects.js");
FileWriter out = new FileWriter(outFile);
Modified:
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/panel/PersonListPanel.java
==============================================================================
---
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/panel/PersonListPanel.java
(original)
+++
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/panel/PersonListPanel.java
Sun Sep 7 14:41:47 2008
@@ -44,7 +44,7 @@
* records.
*/
public class PersonListPanel extends Panel {
-
+ private static final long serialVersionUID = 1L;
private Set<IPerson> people;
private String title;
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
(original)
+++
trunk/uk.ac.osswatch.simal.web/src/main/java/uk/ac/osswatch/simal/wicket/panel/ProjectSummaryPanel.java
Sun Sep 7 14:41:47 2008
@@ -42,6 +42,7 @@
import org.apache.wicket.markup.html.panel.Panel;
import uk.ac.osswatch.simal.model.IProject;
+import uk.ac.osswatch.simal.rdf.SimalRepositoryException;
import uk.ac.osswatch.simal.wicket.ErrorReportPage;
import uk.ac.osswatch.simal.wicket.UserApplication;
import uk.ac.osswatch.simal.wicket.UserReportableException;
@@ -66,7 +67,8 @@
Random rand = new Random();
int idx = rand.nextInt(allProjects.size());
project = (IProject)allProjects.toArray()[idx];
- } catch (Exception e) {
+ } 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
project = null;
}
populatePage(project);
@@ -99,18 +101,25 @@
add(new Label("shortDesc", msg));
final UserReportableException exception = new
UserReportableException(msg, ProjectSummaryPanel.class);
- IPageLink link = new IPageLink() {
- public Page getPage() {
- return new ErrorReportPage(exception);
- }
-
- public Class<ErrorReportPage> getPageIdentity()
{
- return ErrorReportPage.class;
- }
- };
- add(new PageLink("projectDetailLink", link));
-
+ add(new PageLink("projectDetailLink", new
ExceptionDetailLink(exception)));
}
+ }
+
+ private static class ExceptionDetailLink implements IPageLink {
+ private static final long serialVersionUID = 1L;
+ private UserReportableException exception;
+
+ public ExceptionDetailLink(UserReportableException exception) {
+ this.exception = exception;
+ }
+
+ public Page getPage() {
+ return new ErrorReportPage(exception);
+ }
+
+ public Class<ErrorReportPage> getPageIdentity() {
+ return ErrorReportPage.class;
+ }
}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---