Skip to content

Commit

Permalink
Fix Javadoc warnings.
Browse files Browse the repository at this point in the history
Signed-off-by: arjantijms <arjan.tijms@gmail.com>
  • Loading branch information
arjantijms committed Mar 17, 2021
1 parent 5590c1a commit deb28ea
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 60 deletions.
16 changes: 10 additions & 6 deletions src/main/java/org/apache/jasper/Constants.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -109,12 +109,16 @@ public class Constants {
*/
public static final String TAGLIB_DTD_PUBLIC_ID_11 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
public static final String TAGLIB_DTD_RESOURCE_PATH_11 = "/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd";

public static final String TAGLIB_DTD_PUBLIC_ID_12 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
public static final String TAGLIB_DTD_RESOURCE_PATH_12 = "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";

public static final String TAGLIB_SCHEMA_PUBLIC_ID_20 = "web-jsptaglibrary_2_0.xsd";
public static final String TAGLIB_SCHEMA_RESOURCE_PATH_20 = "/javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd";

public static final String TAGLIB_SCHEMA_PUBLIC_ID_21 = "web-jsptaglibrary_2_1.xsd";
public static final String TAGLIB_SCHEMA_RESOURCE_PATH_21 = "/javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd";

public static final String SCHEMA_LOCATION_JSP_20 = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd";
public static final String SCHEMA_LOCATION_JSP_21 = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd";

Expand All @@ -124,19 +128,19 @@ public class Constants {
*/
public static final String WEBAPP_DTD_PUBLIC_ID_22 = "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
public static final String WEBAPP_DTD_RESOURCE_PATH_22 = "/javax/servlet/resources/web-app_2_2.dtd";

public static final String WEBAPP_DTD_PUBLIC_ID_23 = "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
public static final String WEBAPP_DTD_RESOURCE_PATH_23 = "/javax/servlet/resources/web-app_2_3.dtd";

public static final String WEBAPP_SCHEMA_PUBLIC_ID_24 = "web-app_2_4.xsd";
public static final String WEBAPP_SCHEMA_RESOURCE_PATH_24 = "/javax/servlet/resources/web-app_2_4.xsd";

public static final String WEBAPP_SCHEMA_PUBLIC_ID_25 = "web-app_2_5.xsd";
public static final String WEBAPP_SCHEMA_RESOURCE_PATH_25 = "/javax/servlet/resources/web-app_2_5.xsd";

public static final String SCHEMA_LOCATION_WEBAPP_24 = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
public static final String SCHEMA_LOCATION_WEBAPP_25 = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";

/*
* PWC 6386258 public static final String[] CACHED_DTD_RESOURCE_PATHS = { TAGLIB_DTD_RESOURCE_PATH_11,
* TAGLIB_DTD_RESOURCE_PATH_12, WEBAPP_DTD_RESOURCE_PATH_22, WEBAPP_DTD_RESOURCE_PATH_23, };
*/

/**
* Default URLs to download the pluging for Netscape and IE.
Expand Down Expand Up @@ -198,7 +202,7 @@ public class Constants {
/**
* The name of the JSP engine. Used for X-Powered-By identification in the response header
*/
public static final String JSP_NAME = "JSP/2.3";
public static final String JSP_NAME = "JSP/3.0";

/**
* Name of the ServletContext init-param that determines if the XML parsers will block the resolution of external
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/apache/jasper/JspC.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -568,7 +568,7 @@ public void setDefaultBufferNone(boolean defaultBufferNone) {
}

/**
* Sets the class-id value to be sent to Internet Explorer when using <jsp:plugin> tags.
* Sets the class-id value to be sent to Internet Explorer when using <code>&lt;jsp:plugin></code> tags.
*
* @param ieClassId Class-id value
*/
Expand All @@ -577,7 +577,7 @@ public void setIeClassId(String ieClassId) {
}

/**
* Gets the class-id value that is sent to Internet Explorer when using <jsp:plugin> tags.
* Gets the class-id value that is sent to Internet Explorer when using <code>&lt;jsp:plugin></code> tags.
*
* @return Class-id value
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -49,8 +49,9 @@
import jakarta.servlet.jsp.JspFactory;

/**
* Class for tracking JSP compile time file dependencies when the &060;%@include file="..."%&062; directive is used.
* Class for tracking JSP compile time file dependencies when the <code>&lt;@include file="..."></code> directive is used.
*
*<p>
* A background thread periodically checks the files a JSP page is dependent upon. If a dpendent file changes the JSP
* page which included it is recompiled.
*
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/apache/jasper/compiler/JspUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -107,8 +107,8 @@ public static char[] escapeQuotes(char[] chars) {
}

/**
* Checks if the token is a runtime expression. In standard JSP syntax, a runtime expression starts with '<%' and ends
* with '%>'. When the JSP document is in XML syntax, a runtime expression starts with '%=' and ends with '%'.
* Checks if the token is a runtime expression. In standard JSP syntax, a runtime expression starts with <code>'&lt;%'</code> and ends
* with <code>'%>'</code>. When the JSP document is in XML syntax, a runtime expression starts with '%=' and ends with '%'.
*
* @param token The token to be checked return whether the token is a runtime expression or not.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -104,7 +104,7 @@ public interface TagPluginContext {

/**
* Associate the attribute with a value in the current tagplugin context. The plugin attributes can be used for
* communication among tags that must work together as a group. See <c:when> for an example.
* communication among tags that must work together as a group. See <code>&lt;c:when></code> for an example.
*/
void setPluginAttribute(String attr, Object value);

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/jasper/runtime/JspWriterImpl.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -78,7 +78,7 @@ public JspWriterImpl(ServletResponse response) {
* @param response A Servlet Response
* @param sz Output-buffer size, a positive integer
*
* @exception IllegalArgumentException If sz is <= 0
* @exception IllegalArgumentException If sz is LTE 0
*/
public JspWriterImpl(ServletResponse response, int sz, boolean autoFlush) {
super(sz, autoFlush);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -47,10 +47,10 @@
import jakarta.servlet.jsp.tagext.TagInfo;

/**
* The JSP engine (a.k.a Jasper).
* The JSP engine (a.k.a WaSP).
*
* The servlet container is responsible for providing a URLClassLoader for the web application context Jasper is being
* used in. Jasper will try get the Tomcat ServletContext attribute for its ServletContext class loader, if that fails,
* The servlet container is responsible for providing a URLClassLoader for the web application context WaSP is being
* used in. WaSP will try get the ServletContext attribute for its ServletContext class loader, if that fails,
* it uses the parent class loader. In either case, it must be a URLClassLoader.
*
* @author Anil K. Vijendran
Expand Down
64 changes: 26 additions & 38 deletions src/main/java/org/apache/jasper/util/SystemLogHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -21,54 +21,47 @@
import java.io.IOException;
import java.io.PrintStream;


/**
* This helper class may be used to do sophisticated redirection of
* System.out and System.err.
* This helper class may be used to do sophisticated redirection of System.out and System.err.
*
* @author Remy Maucherat
*/
public class SystemLogHandler extends PrintStream {


// ----------------------------------------------------------- Constructors


/**
* Construct the handler to capture the output of the given steam.
*/
public SystemLogHandler(PrintStream wrapped) {
super(wrapped);
this.wrapped = wrapped;
}


// ----------------------------------------------------- Instance Variables


/**
* Wrapped PrintStream.
*/
protected PrintStream wrapped = null;

protected PrintStream wrapped;

/**
* Thread <-> PrintStream associations.
* Thread to PrintStream associations.
*/
protected static final ThreadLocal streams = new ThreadLocal();


/**
* Thread <-> ByteArrayOutputStream associations.
* Thread to ByteArrayOutputStream associations.
*/
protected static final ThreadLocal data = new ThreadLocal();


// ----------------------------------------------------------- Constructors

/**
* Construct the handler to capture the output of the given steam.
*/
public SystemLogHandler(PrintStream wrapped) {
super(wrapped);
this.wrapped = wrapped;
}



// --------------------------------------------------------- Public Methods


public PrintStream getWrapped() {
return wrapped;
return wrapped;
}

/**
Expand All @@ -80,40 +73,36 @@ public static void setThread() {
streams.set(new PrintStream(baos));
}


/**
* Stop capturing thread's output and return captured data as a String.
*/
public static String unsetThread() {
ByteArrayOutputStream baos =
(ByteArrayOutputStream) data.get();
ByteArrayOutputStream baos = (ByteArrayOutputStream) data.get();
if (baos == null) {
return null;
}

streams.set(null);
data.set(null);
return baos.toString();
}


// ------------------------------------------------------ Protected Methods


/**
* Find PrintStream to which the output must be written to.
*/
protected PrintStream findStream() {
PrintStream ps = (PrintStream) streams.get();
if (ps == null) {
ps = wrapped;
PrintStream printStream = (PrintStream) streams.get();
if (printStream == null) {
printStream = wrapped;
}
return ps;

return printStream;
}


// ---------------------------------------------------- PrintStream Methods


public void flush() {
findStream().flush();
}
Expand All @@ -134,8 +123,7 @@ public void write(int b) {
findStream().write(b);
}

public void write(byte[] b)
throws IOException {
public void write(byte[] b) throws IOException {
findStream().write(b);
}

Expand Down

0 comments on commit deb28ea

Please # to comment.