remove compiler warnings; use new-style "for" loop.
This commit is contained in:
parent
9e2d64fb5f
commit
0fea51aed7
1 changed files with 9 additions and 16 deletions
|
@ -4,11 +4,9 @@ package edu.cornell.mannlib.vitro.webapp.controller.edit.listing;
|
|||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -20,22 +18,21 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.Datatype;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.PropertyInstance;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.PropertyGroup;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.PropertyGroupDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||
|
||||
public class DatatypePropertiesListingController extends BaseEditController {
|
||||
private final int NUM_COLS = 9;
|
||||
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) {
|
||||
@Override
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) {
|
||||
VitroRequest vrequest = new VitroRequest(request);
|
||||
Portal portal = vrequest.getPortal();
|
||||
|
||||
|
@ -57,7 +54,7 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
|||
DatatypeDao dDao = vrequest.getFullWebappDaoFactory().getDatatypeDao();
|
||||
PropertyGroupDao pgDao = vrequest.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||
|
||||
List props = new ArrayList();
|
||||
List<DataProperty> props = new ArrayList<DataProperty>();
|
||||
|
||||
if (request.getParameter("propsForClass") != null) {
|
||||
noResultsMsgStr = "There are no data properties that apply to this class.";
|
||||
|
@ -68,7 +65,7 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
|||
DataProperty dp = dataPropIt.next();
|
||||
if (!(propURIs.contains(dp.getURI()))) {
|
||||
propURIs.add(dp.getURI());
|
||||
DataProperty prop = (DataProperty) dao.getDataPropertyByURI(dp.getURI());
|
||||
DataProperty prop = dao.getDataPropertyByURI(dp.getURI());
|
||||
if (prop != null) {
|
||||
props.add(prop);
|
||||
}
|
||||
|
@ -79,10 +76,8 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
|||
}
|
||||
|
||||
if (ontologyUri != null) {
|
||||
List scratch = new ArrayList();
|
||||
Iterator propIt = props.iterator();
|
||||
while (propIt.hasNext()) {
|
||||
DataProperty p = (DataProperty) propIt.next();
|
||||
List<DataProperty> scratch = new ArrayList<DataProperty>();
|
||||
for (DataProperty p: props) {
|
||||
if (p.getNamespace().equals(ontologyUri)) {
|
||||
scratch.add(p);
|
||||
}
|
||||
|
@ -94,7 +89,7 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
|||
Collections.sort(props);
|
||||
}
|
||||
|
||||
ArrayList results = new ArrayList();
|
||||
ArrayList<String> results = new ArrayList<String>();
|
||||
results.add("XX"); // column 1
|
||||
results.add("Data Property"); // column 2
|
||||
results.add("domain"); // column 3
|
||||
|
@ -118,9 +113,7 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
|||
results.add("");
|
||||
results.add("");
|
||||
} else {
|
||||
Iterator propsIt = props.iterator();
|
||||
while (propsIt.hasNext()) {
|
||||
DataProperty prop = (DataProperty) propsIt.next();
|
||||
for (DataProperty prop: props) {
|
||||
results.add("XX"); // column 1
|
||||
String nameStr = prop.getPublicName()==null ? prop.getName()==null ? prop.getURI()==null ? "(no name)" : prop.getURI() : prop.getName() : prop.getPublicName();
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue