aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2014-03-15 00:25:37 +0100
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2014-04-03 15:38:37 +0200
commit82f28cc18b9371c81f3e6fa147080371a00443f5 (patch)
tree9f6e9f65dbe1b930d90d01ba09ae438cac2a0bd2 /pdf-as-web/src/main
parent0f8777952974daf03099bf48c6db1d91bd431bb2 (diff)
downloadpdf-as-4-82f28cc18b9371c81f3e6fa147080371a00443f5.tar.gz
pdf-as-4-82f28cc18b9371c81f3e6fa147080371a00443f5.tar.bz2
pdf-as-4-82f28cc18b9371c81f3e6fa147080371a00443f5.zip
Don't use raw types! Also check casts where possible
Diffstat (limited to 'pdf-as-web/src/main')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/filter/ExceptionCatchFilter.java1
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java5
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java2
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java2
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java2
5 files changed, 9 insertions, 3 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/filter/ExceptionCatchFilter.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/filter/ExceptionCatchFilter.java
index 6beff606..085976f0 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/filter/ExceptionCatchFilter.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/filter/ExceptionCatchFilter.java
@@ -70,6 +70,7 @@ public class ExceptionCatchFilter implements Filter {
logger.debug("Processing Parameters into Attributes");
HttpServletRequest httpRequest = (HttpServletRequest)request;
PdfAsHelper.logAccess(httpRequest);
+ @SuppressWarnings("unchecked")
Enumeration<String> parameterNames = httpRequest.getParameterNames();
while(parameterNames.hasMoreElements()) {
String name = parameterNames.nextElement();
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
index 2d14a99a..47243a43 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
@@ -774,12 +774,17 @@ public class PdfAsHelper {
session.setAttribute(VERIFICATION_RESULT, value);
}
+ @SuppressWarnings("unchecked")
public static List<VerifyResult> getVerificationResult(
HttpServletRequest request) {
HttpSession session = request.getSession();
Object obj = session.getAttribute(VERIFICATION_RESULT);
if (obj != null) {
try {
+ if (!(obj instanceof List<?>)) {
+ logger.error("Invalid object type");
+ return null;
+ }
return (List<VerifyResult>) obj;
} catch (Throwable e) {
logger.error("Invalid object type");
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java
index ecdc4a8c..cf25c2f2 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java
@@ -83,7 +83,7 @@ public class DataURLServlet extends HttpServlet {
//System.out.println(xmlResponse);
- JAXBElement jaxbObject = (JAXBElement) SLMarschaller.unmarshalFromString(xmlResponse);
+ JAXBElement<?> jaxbObject = (JAXBElement<?>) SLMarschaller.unmarshalFromString(xmlResponse);
if(jaxbObject.getValue() instanceof InfoboxReadResponseType) {
InfoboxReadResponseType infoboxReadResponseType = (InfoboxReadResponseType)jaxbObject.getValue();
logger.info("Got InfoboxReadResponseType");
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java
index 28ce628a..ac22f6c8 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java
@@ -157,7 +157,7 @@ public class ExternSignServlet extends HttpServlet {
uploadDir.mkdir();
}
- List formItems = upload.parseRequest(request);
+ List<?> formItems = upload.parseRequest(request);
logger.debug(formItems.size() + " Items in form data");
if (formItems.size() < 1) {
// No Uploaded data!
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java
index f6b65245..42a5175a 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java
@@ -143,7 +143,7 @@ public class VerifyServlet extends HttpServlet {
uploadDir.mkdir();
}
- List formItems = upload.parseRequest(request);
+ List<?> formItems = upload.parseRequest(request);
logger.debug(formItems.size() + " Items in form data");
if (formItems.size() < 1) {
// No Uploaded data!