You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2018/11/20 22:58:45 UTC
[jspwiki] 07/07: use generics and non-deprecated code
This is an automated email from the ASF dual-hosted git repository.
juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit a737373f91b45b15bf3bba80fbdb4d88a50e163a
Author: juanpablo <ju...@apache.org>
AuthorDate: Tue Nov 20 23:56:39 2018 +0100
use generics and non-deprecated code
---
jspwiki-war/src/main/webapp/Delete.jsp | 4 ++--
jspwiki-war/src/main/webapp/NewBlogEntry.jsp | 2 +-
jspwiki-war/src/main/webapp/Search.jsp | 4 ++--
jspwiki-war/src/main/webapp/SisterSites.jsp | 6 +++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/jspwiki-war/src/main/webapp/Delete.jsp b/jspwiki-war/src/main/webapp/Delete.jsp
index 8e89d09..b20fcce 100644
--- a/jspwiki-war/src/main/webapp/Delete.jsp
+++ b/jspwiki-war/src/main/webapp/Delete.jsp
@@ -81,9 +81,9 @@
{
log.info("Deleting a range of pages from "+pagereq);
- for( Enumeration params = request.getParameterNames(); params.hasMoreElements(); )
+ for( Enumeration< String > params = request.getParameterNames(); params.hasMoreElements(); )
{
- String paramName = (String)params.nextElement();
+ String paramName = params.nextElement();
if( paramName.startsWith("delver") )
{
diff --git a/jspwiki-war/src/main/webapp/NewBlogEntry.jsp b/jspwiki-war/src/main/webapp/NewBlogEntry.jsp
index 729efc9..3021ad8 100644
--- a/jspwiki-war/src/main/webapp/NewBlogEntry.jsp
+++ b/jspwiki-war/src/main/webapp/NewBlogEntry.jsp
@@ -47,6 +47,6 @@
String newEntry = p.getNewEntryPage( wiki, pagereq );
// Redirect to a new page for user to edit
- response.sendRedirect( wiki.getEditURL(newEntry) );
+ response.sendRedirect( wikiContext.getURL( WikiContext.EDIT, newEntry ) );
%>
diff --git a/jspwiki-war/src/main/webapp/Search.jsp b/jspwiki-war/src/main/webapp/Search.jsp
index fb0c143..e373d9d 100644
--- a/jspwiki-war/src/main/webapp/Search.jsp
+++ b/jspwiki-war/src/main/webapp/Search.jsp
@@ -40,7 +40,7 @@
String pagereq = wikiContext.getName();
// Get the search results
- Collection list = null;
+ Collection< SearchResult > list = null;
String query = request.getParameter( "query");
String go = request.getParameter("go");
@@ -74,7 +74,7 @@
{
if( list != null && list.size() > 0 )
{
- SearchResult sr = (SearchResult) list.iterator().next();
+ SearchResult sr = list.iterator().next();
WikiPage wikiPage = sr.getPage();
diff --git a/jspwiki-war/src/main/webapp/SisterSites.jsp b/jspwiki-war/src/main/webapp/SisterSites.jsp
index b08678d..0870b73 100644
--- a/jspwiki-war/src/main/webapp/SisterSites.jsp
+++ b/jspwiki-war/src/main/webapp/SisterSites.jsp
@@ -38,12 +38,12 @@
WikiContext wikiContext = wiki.createContext( request, "rss" );
if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
- Set allPages = wiki.getReferenceManager().findCreated();
+ Set< String > allPages = wiki.getReferenceManager().findCreated();
response.setContentType("text/plain; charset=UTF-8");
- for( Iterator i = allPages.iterator(); i.hasNext(); )
+ for( Iterator< String > i = allPages.iterator(); i.hasNext(); )
{
- String pageName = (String)i.next();
+ String pageName = i.next();
// Let's not add attachments.
// TODO: This is a kludge and not forward-compatible.