Skip to content

Commit

Permalink
Removed deprecated stuff marked for removal in 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed Apr 16, 2017
1 parent fcf7a8d commit 8b3899b
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 1,005 deletions.
15 changes: 1 addition & 14 deletions src/main/java/org/omnifaces/cdi/push/Socket.java
Expand Up @@ -16,7 +16,6 @@
import static java.lang.Boolean.parseBoolean;
import static java.lang.String.format;
import static java.util.Collections.unmodifiableList;
import static java.util.logging.Logger.getLogger;
import static javax.faces.component.behavior.ClientBehaviorContext.createClientBehaviorContext;
import static org.omnifaces.util.Beans.getReference;
import static org.omnifaces.util.FacesLocal.getApplicationAttribute;
Expand Down Expand Up @@ -623,17 +622,10 @@ public class Socket extends ScriptFamily implements ClientBehaviorHolder {
/** The boolean context parameter name to register web socket endpoint during startup. */
public static final String PARAM_SOCKET_ENDPOINT_ENABLED = "org.omnifaces.SOCKET_ENDPOINT_ENABLED";

/** Naming convention was wrong. Use {@link #PARAM_SOCKET_ENDPOINT_ENABLED} instead. @deprecated */
@Deprecated // TODO: remove in 3.0.
public static final String PARAM_ENABLE_SOCKET_ENDPOINT = "org.omnifaces.ENABLE_SOCKET_ENDPOINT";

// Private constants ----------------------------------------------------------------------------------------------

private static final Pattern PATTERN_CHANNEL = Pattern.compile("[\\w.-]+");

private static final String WARNING_PARAM_DEPRECATED = "Context parameter name '" + PARAM_ENABLE_SOCKET_ENDPOINT
+ "' is deprecated. It has been renamed to '" + PARAM_SOCKET_ENDPOINT_ENABLED + "'."
+ " Please update web.xml accordingly.";
private static final String ERROR_EXPRESSION_DISALLOWED =
"o:socket 'channel' and 'scope' attributes may not contain an EL expression.";
private static final String ERROR_INVALID_USER =
Expand Down Expand Up @@ -962,12 +954,7 @@ public static void registerEndpointIfNecessary(ServletContext context) {
}

if (!parseBoolean(context.getInitParameter(PARAM_SOCKET_ENDPOINT_ENABLED))) {
if (parseBoolean(context.getInitParameter(PARAM_ENABLE_SOCKET_ENDPOINT))) { // TODO: remove in OmniFaces 3.0.
getLogger(Socket.class.getName()).warning(WARNING_PARAM_DEPRECATED);
}
else {
return;
}
return;
}

try {
Expand Down
168 changes: 0 additions & 168 deletions src/main/java/org/omnifaces/config/BeanManager.java

This file was deleted.

12 changes: 0 additions & 12 deletions src/main/java/org/omnifaces/el/MethodReference.java
Expand Up @@ -16,7 +16,6 @@

import java.lang.reflect.Method;

import javax.el.MethodExpression;
import javax.el.MethodInfo;

/**
Expand Down Expand Up @@ -81,15 +80,4 @@ public boolean isFromMethod() {
return fromMethod;
}

/**
* Returns the standard EL {@link MethodInfo} of the {@link MethodExpression} where this {@link MethodReference}
* has been extracted from.
* @return The standard EL {@link MethodInfo}.
* @deprecated Since 2.5 this class already extends from {@link MethodInfo}.
*/
@Deprecated // TODO: Remove in OmniFaces 3.0.
public MethodInfo getMethodInfo() {
return this;
}

}

This file was deleted.

38 changes: 1 addition & 37 deletions src/main/java/org/omnifaces/facesviews/FacesViews.java
Expand Up @@ -22,9 +22,7 @@
import static javax.servlet.DispatcherType.FORWARD;
import static javax.servlet.DispatcherType.REQUEST;
import static org.omnifaces.facesviews.ExtensionAction.REDIRECT_TO_EXTENSIONLESS;
import static org.omnifaces.facesviews.FacesServletDispatchMethod.DO_FILTER;
import static org.omnifaces.facesviews.PathAction.SEND_404;
import static org.omnifaces.facesviews.ViewHandlerMode.STRIP_EXTENSION_FROM_PARENT;
import static org.omnifaces.util.Faces.getApplicationFromFactory;
import static org.omnifaces.util.Faces.getServletContext;
import static org.omnifaces.util.Platform.getFacesServletMappings;
Expand Down Expand Up @@ -147,7 +145,6 @@
* @see UriExtensionRequestWrapper
* @see FacesViewsViewHandlerInstaller
* @see FacesViewsViewHandler
* @see ViewHandlerMode
*/
public final class FacesViews {

Expand Down Expand Up @@ -195,32 +192,12 @@ public final class FacesViews {
*/
public static final String FACES_VIEWS_PATH_ACTION_PARAM_NAME = "org.omnifaces.FACES_VIEWS_PATH_ACTION";

/**
* The name of the enum context parameter that determines the method used by FacesViews to invoke the FacesServlet.
* See {@link FacesServletDispatchMethod}.
* @see FacesServletDispatchMethod
* @deprecated Since 2.6 As this is superfluous since Servlet 3.0.
* It will default to DO_FILTER and automatically use FORWARD when resource is not mapped.
*/
@Deprecated // TODO: remove in OmniFaces 3.0.
public static final String FACES_VIEWS_DISPATCH_METHOD_PARAM_NAME = "org.omnifaces.FACES_VIEWS_DISPATCH_METHOD";

/**
* The name of the boolean context parameter via which the user can set whether the
* {@link FacesViewsForwardingFilter} should match before declared filters (false) or after declared filters (true).
*/
public static final String FACES_VIEWS_FILTER_AFTER_DECLARED_FILTERS_PARAM_NAME = "org.omnifaces.FACES_VIEWS_FILTER_AFTER_DECLARED_FILTERS";

/**
* The name of the enum context parameter via which the user can set whether the {@link FacesViewsViewHandler}
* should strip the extension from the parent view handler's outcome or construct the URL itself and only take the
* query parameters (if any) from the parent.
* @see ViewHandlerMode
* @deprecated Since 2.6 As this is superfluous since Servlet 3.0.
*/
@Deprecated // TODO: remove in OmniFaces 3.0.
public static final String FACES_VIEWS_VIEW_HANDLER_MODE_PARAM_NAME = "org.omnifaces.FACES_VIEWS_VIEW_HANDLER_MODE";


// Request attributes ---------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -332,12 +309,7 @@ public static void addFacesServletMappings(ServletContext servletContext) {

Set<String> mappings = new HashSet<>(encounteredExtensions);
mappings.addAll(getMappedWelcomeFiles(servletContext));

if (getFacesServletDispatchMethod(servletContext) == DO_FILTER) {
// In order for the DO_FILTER method to work the FacesServlet, in addition the forward filter,
// has to be mapped on all extensionless resources.
mappings.addAll(filterExtension(getMappedResources(servletContext).keySet()));
}
mappings.addAll(filterExtension(getMappedResources(servletContext).keySet()));

ServletRegistration facesServletRegistration = getFacesServletRegistration(servletContext);

Expand Down Expand Up @@ -586,10 +558,6 @@ static PathAction getPathAction(ServletContext servletContext) {
return getEnumInitParameter(servletContext, FACES_VIEWS_PATH_ACTION_PARAM_NAME, PathAction.class, SEND_404);
}

static FacesServletDispatchMethod getFacesServletDispatchMethod(ServletContext servletContext) {
return getEnumInitParameter(servletContext, FACES_VIEWS_DISPATCH_METHOD_PARAM_NAME, FacesServletDispatchMethod.class, DO_FILTER);
}

static boolean isResourceInPublicPath(ServletContext servletContext, String resource) {
for (String path : getPublicRootPaths(servletContext)) {
if (resource.startsWith(path)) {
Expand Down Expand Up @@ -619,10 +587,6 @@ static boolean isScannedViewsAlwaysExtensionless(ServletContext servletContext)
return isEmpty(alwaysExtensionless) || parseBoolean(alwaysExtensionless);
}

static ViewHandlerMode getViewHandlerMode(ServletContext servletContext) {
return getEnumInitParameter(servletContext, FACES_VIEWS_VIEW_HANDLER_MODE_PARAM_NAME, ViewHandlerMode.class, STRIP_EXTENSION_FROM_PARENT);
}

@SuppressWarnings("unchecked")
static Set<String> getFacesServletExtensions(ServletContext servletContext) {
Set<String> extensions = (Set<String>) servletContext.getAttribute(FACES_SERVLET_EXTENSIONS);
Expand Down

0 comments on commit 8b3899b

Please sign in to comment.