Skip to content

Commit

Permalink
Merge pull request #3398 from eclipse/jetty-10.0.x-remove-deprecated
Browse files Browse the repository at this point in the history
Issue #1676 - Removing deprecated methods and classes
  • Loading branch information
joakime authored Mar 1, 2019
2 parents 39d122a + e476cec commit ce3f663
Show file tree
Hide file tree
Showing 201 changed files with 709 additions and 9,003 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ public static void main( String[] args ) throws Exception
lowResourcesMonitor.setPeriod(1000);
lowResourcesMonitor.setLowResourcesIdleTimeout(200);
lowResourcesMonitor.setMonitorThreads(true);
lowResourcesMonitor.setMaxConnections(0);
lowResourcesMonitor.setMaxMemory(0);
lowResourcesMonitor.setMaxLowResourcesTime(5000);
server.addBean(lowResourcesMonitor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static final void main( String args[] ) throws Exception
new Transaction(new com.acme.MockUserTransaction());

// Define an env entry with webapp scope.
new EnvEntry(webapp, "maxAmount", new Double(100), true);
new EnvEntry(webapp, "maxAmount", 100D, true);

// Register a mock DataSource scoped to the webapp
new Resource(webapp, "jdbc/mydatasource", new com.acme.MockDataSource());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static void main( String[] args ) throws Exception
// <env-entry-type>java.lang.Integer</env-entry-type>
// <env-entry-value>4000</env-entry-value>
// </env-entry>
new org.eclipse.jetty.plus.jndi.EnvEntry(server, "woggle", new Integer(4000), false);
new org.eclipse.jetty.plus.jndi.EnvEntry(server, "woggle", 4000, false);

// Define an env entry with webapp scope.
// At runtime, the webapp accesses this as java:comp/env/wiggle
Expand All @@ -74,7 +74,7 @@ public static void main( String[] args ) throws Exception
// Note that the last arg of "true" means that this definition for
// "wiggle" would override an entry of the
// same name in web.xml
new org.eclipse.jetty.plus.jndi.EnvEntry(webapp, "wiggle", new Double(100), true);
new org.eclipse.jetty.plus.jndi.EnvEntry(webapp, "wiggle", 100D, true);

// Register a reference to a mail service scoped to the webapp.
// This must be linked to the webapp by an entry in web.xml:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.annotation.HandlesTypes;

Expand Down Expand Up @@ -217,12 +216,12 @@ public ServletContainerInitializerOrdering (String ordering)
for (int i=0; i<tmp.length; i++)
{
String s = tmp[i].trim();
_indexMap.put(s, Integer.valueOf(i));
_indexMap.put(s, i);
if ("*".equals(s))
{
if (_star != null)
throw new IllegalArgumentException("Duplicate wildcards in ServletContainerInitializer ordering "+ordering);
_star = Integer.valueOf(i);
_star = i;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;
Expand Down Expand Up @@ -570,22 +569,6 @@ public void addParsedClass (String classname, Resource location)
if (existing != null)
LOG.warn("{} scanned from multiple locations: {}, {}", classname, existing, location);
}


/**
* Get the locations of the given classname. There may be more than one
* location if there are duplicates of the same class.
*
* @param classname the name of the class
* @return an immutable list of locations
*
* @deprecated List of duplicate locations no longer stored
*/
@Deprecated
public List<String> getParsedLocations (String classname)
{
return Collections.emptyList();
}

/**
* Parse a given class
Expand Down Expand Up @@ -755,22 +738,6 @@ protected void parseDir (Set<? extends Handler> handlers, Resource root) throws
me.ifExceptionThrow();
}

/**
* Parse classes in the supplied classloader.
* Only class files in jar files will be scanned.
*
* @param handlers the handlers to look for classes in
* @param loader the classloader for the classes
* @param visitParents if true, visit parent classloaders too
* @param nullInclusive if true, an empty pattern means all names match, if false, none match
* @throws Exception if unable to parse
*/
@Deprecated
public void parse (final Set<? extends Handler> handlers, ClassLoader loader, boolean visitParents, boolean nullInclusive) throws Exception
{
throw new UnsupportedOperationException();
}

/**
* Parse classes in the supplied uris.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@

package org.eclipse.jetty.annotations;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.servlet.ServletContainerInitializer;

import org.eclipse.jetty.toolchain.test.FS;
Expand All @@ -42,6 +36,11 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class TestAnnotationConfiguration
{
public class TestableAnnotationConfiguration extends AnnotationConfiguration
Expand Down Expand Up @@ -121,7 +120,7 @@ public void testAnnotationScanControl() throws Exception
WebAppContext context25 = new WebAppContext();
context25.setClassLoader(Thread.currentThread().getContextClassLoader());
context25.setAttribute(AnnotationConfiguration.MULTI_THREADED, Boolean.FALSE);
context25.setAttribute(AnnotationConfiguration.MAX_SCAN_WAIT, new Integer(0));
context25.setAttribute(AnnotationConfiguration.MAX_SCAN_WAIT, 0);
context25.getMetaData().setWebXml(Resource.newResource(web25));
context25.getServletContext().setEffectiveMajorVersion(2);
context25.getServletContext().setEffectiveMinorVersion(5);
Expand All @@ -133,7 +132,7 @@ public void testAnnotationScanControl() throws Exception
WebAppContext context25b = new WebAppContext();
context25b.setClassLoader(Thread.currentThread().getContextClassLoader());
context25b.setAttribute(AnnotationConfiguration.MULTI_THREADED, Boolean.FALSE);
context25b.setAttribute(AnnotationConfiguration.MAX_SCAN_WAIT, new Integer(0));
context25b.setAttribute(AnnotationConfiguration.MAX_SCAN_WAIT, 0);
context25b.setConfigurationDiscovered(true);
context25b.getMetaData().setWebXml(Resource.newResource(web25));
context25b.getServletContext().setEffectiveMajorVersion(2);
Expand All @@ -146,7 +145,7 @@ public void testAnnotationScanControl() throws Exception
WebAppContext context31 = new WebAppContext();
context31.setClassLoader(Thread.currentThread().getContextClassLoader());
context31.setAttribute(AnnotationConfiguration.MULTI_THREADED, Boolean.FALSE);
context31.setAttribute(AnnotationConfiguration.MAX_SCAN_WAIT, new Integer(0));
context31.setAttribute(AnnotationConfiguration.MAX_SCAN_WAIT, 0);
context31.getMetaData().setWebXml(Resource.newResource(web31true));
context31.getServletContext().setEffectiveMajorVersion(3);
context31.getServletContext().setEffectiveMinorVersion(1);
Expand All @@ -158,7 +157,7 @@ public void testAnnotationScanControl() throws Exception
WebAppContext context31b = new WebAppContext();
context31b.setClassLoader(Thread.currentThread().getContextClassLoader());
context31b.setAttribute(AnnotationConfiguration.MULTI_THREADED, Boolean.FALSE);
context31b.setAttribute(AnnotationConfiguration.MAX_SCAN_WAIT, new Integer(0));
context31b.setAttribute(AnnotationConfiguration.MAX_SCAN_WAIT, 0);
context31b.getMetaData().setWebXml(Resource.newResource(web31false));
context31b.getServletContext().setEffectiveMajorVersion(3);
context31b.getServletContext().setEffectiveMinorVersion(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ResourceB extends ResourceA
private Integer f;//test no inheritance of private fields

@Resource
private Integer p = new Integer(8); //test no injection because no value
private Integer p = 8; //test no injection because no value

//test no annotation
public void z()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.util.List;
import java.util.Set;
import java.util.jar.Manifest;

import javax.servlet.Servlet;

import org.apache.tools.ant.AntClassLoader;
Expand Down Expand Up @@ -250,12 +249,6 @@ protected Package definePackage(String name, String specTitle, String specVersio
return super.definePackage(name, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor, sealBase);
}

@Override
protected Package getPackage(String name)
{
return super.getPackage(name);
}

@Override
protected Package[] getPackages()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public int getVersion()
void setLifeCycleNode(Node node)
{
this.lifecyleNode = node;
this.stateTimestamps.put(node,Long.valueOf(System.currentTimeMillis()));
this.stateTimestamps.put(node, System.currentTimeMillis());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ Below is the relevant section taken from link:{GITBROWSEURL}/jetty-server/src/ma
<Set name="headerCacheSize"><Property name="jetty.httpConfig.headerCacheSize" default="4096" /></Set>
<Set name="delayDispatchUntilContent"><Property name="jetty.httpConfig.delayDispatchUntilContent" deprecated="jetty.delayDispatchUntilContent" default="true"/></Set>
<Set name="maxErrorDispatches"><Property name="jetty.httpConfig.maxErrorDispatches" default="10"/></Set>
<Set name="blockingTimeout"><Property name="jetty.httpConfig.blockingTimeout" default="-1"/></Set>
<Set name="persistentConnectionsEnabled"><Property name="jetty.httpConfig.persistentConnectionsEnabled" default="true"/></Set>
<Set name="cookieCompliance"><Call class="org.eclipse.jetty.http.CookieCompliance" name="valueOf"><Arg><Property name="jetty.httpConfig.cookieCompliance" default="RFC6265"/></Arg></Call></Set>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,8 @@ public enum HttpCompliance // TODO in Jetty-10 convert this enum to a class so t
RFC7230_LEGACY(sectionsBySpec("RFC7230,-METHOD_CASE_SENSITIVE")),

/** The RFC7230 support mode */
RFC7230(sectionsBySpec("RFC7230")),

/** Custom compliance mode that can be defined with System property <code>org.eclipse.jetty.http.HttpCompliance.CUSTOM0</code> */
@Deprecated
CUSTOM0(sectionsByProperty("CUSTOM0")),
/** Custom compliance mode that can be defined with System property <code>org.eclipse.jetty.http.HttpCompliance.CUSTOM1</code> */
@Deprecated
CUSTOM1(sectionsByProperty("CUSTOM1")),
/** Custom compliance mode that can be defined with System property <code>org.eclipse.jetty.http.HttpCompliance.CUSTOM2</code> */
@Deprecated
CUSTOM2(sectionsByProperty("CUSTOM2")),
/** Custom compliance mode that can be defined with System property <code>org.eclipse.jetty.http.HttpCompliance.CUSTOM3</code> */
@Deprecated
CUSTOM3(sectionsByProperty("CUSTOM3"));

RFC7230(sectionsBySpec("RFC7230"));

public static final String VIOLATIONS_ATTR = "org.eclipse.jetty.http.compliance.violations";

private static final Logger LOG = Log.getLogger(HttpParser.class);
Expand Down
18 changes: 0 additions & 18 deletions jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
Expand All @@ -34,9 +33,7 @@
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import org.eclipse.jetty.util.ArrayTernaryTrie;
import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.eclipse.jetty.util.Trie;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;

Expand All @@ -52,9 +49,6 @@
*/
public class HttpFields implements Iterable<HttpField>
{
@Deprecated
public static final String __separators = ", \t";

private static final Logger LOG = Log.getLogger(HttpFields.class);

private HttpField[] _fields;
Expand Down Expand Up @@ -225,12 +219,6 @@ public boolean containsKey(String name)
return false;
}

@Deprecated
public String getStringField(HttpHeader header)
{
return get(header);
}

public String get(HttpHeader header)
{
for (int i=0;i<_size;i++)
Expand All @@ -242,12 +230,6 @@ public String get(HttpHeader header)
return null;
}

@Deprecated
public String getStringField(String name)
{
return get(name);
}

public String get(String header)
{
for (int i=0;i<_size;i++)
Expand Down
22 changes: 0 additions & 22 deletions jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,6 @@ public void reset()
_trailers = null;
}

/* ------------------------------------------------------------ */
@Deprecated
public boolean getSendServerVersion ()
{
return (_send&SEND_SERVER)!=0;
}

/* ------------------------------------------------------------ */
@Deprecated
public void setSendServerVersion (boolean sendServerVersion)
{
throw new UnsupportedOperationException();
}

/* ------------------------------------------------------------ */
public State getState()
{
Expand Down Expand Up @@ -385,14 +371,6 @@ private Result completing( ByteBuffer chunk, ByteBuffer content)

}


/* ------------------------------------------------------------ */
@Deprecated
public Result generateResponse(MetaData.Response info, ByteBuffer header, ByteBuffer chunk, ByteBuffer content, boolean last) throws IOException
{
return generateResponse(info,false,header,chunk,content,last);
}

/* ------------------------------------------------------------ */
public Result generateResponse(MetaData.Response info, boolean head, ByteBuffer header, ByteBuffer chunk, ByteBuffer content, boolean last) throws IOException
{
Expand Down
16 changes: 1 addition & 15 deletions jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1908,17 +1908,6 @@ public default void parsedTrailer(HttpField field) {}
* @param failure the failure with the bad message information
*/
public default void badMessage(BadMessageException failure)
{
badMessage(failure.getCode(), failure.getReason());
}

/**
* @param status The status to send
* @param reason The reason for the bad message
* @deprecated use {@link #badMessage(BadMessageException)} instead
*/
@Deprecated
public default void badMessage(int status, String reason)
{
}

Expand Down Expand Up @@ -1964,12 +1953,9 @@ public interface ResponseHandler extends HttpHandler
/* ------------------------------------------------------------------------------- */
public interface ComplianceHandler extends HttpHandler
{
@Deprecated
public default void onComplianceViolation(HttpCompliance compliance, HttpCompliance required, String reason) {}

public default void onComplianceViolation(HttpCompliance compliance, HttpComplianceSection violation, String details)
{
onComplianceViolation(compliance,HttpCompliance.requiredCompliance(violation), details);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,9 @@ public class HttpStatus
public final static int GONE_410 = 410;
public final static int LENGTH_REQUIRED_411 = 411;
public final static int PRECONDITION_FAILED_412 = 412;
@Deprecated
public final static int REQUEST_ENTITY_TOO_LARGE_413 = 413;
public final static int PAYLOAD_TOO_LARGE_413 = 413;
@Deprecated
public final static int REQUEST_URI_TOO_LONG_414 = 414;
public final static int URI_TOO_LONG_414 = 414;
public final static int UNSUPPORTED_MEDIA_TYPE_415 = 415;
@Deprecated
public final static int REQUESTED_RANGE_NOT_SATISFIABLE_416 = 416;
public final static int RANGE_NOT_SATISFIABLE_416 = 416;
public final static int EXPECTATION_FAILED_417 = 417;
public final static int IM_A_TEAPOT_418 = 418;
Expand Down
Loading

0 comments on commit ce3f663

Please sign in to comment.