Skip to content

Commit 1918547

Browse files
authored
[RESTEASY-2772] Backing out changes for RESTEASY-2772. (#2627)
1 parent 2e6bcbe commit 1918547

4 files changed

Lines changed: 6 additions & 10 deletions

File tree

providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartReader.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import java.io.InputStream;
1616
import java.lang.annotation.Annotation;
1717
import java.lang.reflect.Type;
18-
import javax.ws.rs.BadRequestException;
1918

2019
/**
2120
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -36,7 +35,7 @@ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotati
3635
public MultipartInput readFrom(Class<MultipartInput> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException
3736
{
3837
String boundary = mediaType.getParameters().get("boundary");
39-
if (boundary == null) throw new BadRequestException(Messages.MESSAGES.unableToGetBoundary());
38+
if (boundary == null) throw new IOException(Messages.MESSAGES.unableToGetBoundary());
4039
MultipartInputImpl input = new MultipartInputImpl(mediaType, workers);
4140
/*
4241
StringWriter writer = new StringWriter();

resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/delegates/MediaTypeHeaderDelegate.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import javax.ws.rs.ext.RuntimeDelegate;
88

99
import java.util.HashMap;
10-
import javax.ws.rs.BadRequestException;
1110

1211
/**
1312
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@@ -114,7 +113,7 @@ public static MediaType parse(String type)
114113
}
115114
if (!MediaType.MEDIA_TYPE_WILDCARD.equals(major))
116115
{
117-
throw new BadRequestException(Messages.MESSAGES.failureParsingMediaType(type));
116+
throw new IllegalArgumentException(Messages.MESSAGES.failureParsingMediaType(type));
118117
}
119118
subtype = MediaType.MEDIA_TYPE_WILDCARD;
120119
}
@@ -132,11 +131,11 @@ public static MediaType parse(String type)
132131
}
133132
if (major.length() < 1 || subtype.length() < 1)
134133
{
135-
throw new BadRequestException(Messages.MESSAGES.failureParsingMediaType(type));
134+
throw new IllegalArgumentException(Messages.MESSAGES.failureParsingMediaType(type));
136135
}
137136
if (!isValid(major) || !isValid(subtype))
138137
{
139-
throw new BadRequestException(Messages.MESSAGES.failureParsingMediaType(type));
138+
throw new IllegalArgumentException(Messages.MESSAGES.failureParsingMediaType(type));
140139
}
141140
String params = null;
142141
if (paramIndex > -1) params = type.substring(paramIndex + 1);

testsuite/unit-tests/src/test/java/org/jboss/resteasy/test/client/ClientBuilderTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import javax.ws.rs.core.Response;
1717
import javax.ws.rs.ext.ContextResolver;
1818
import javax.ws.rs.ext.RuntimeDelegate;
19-
import javax.ws.rs.BadRequestException;
2019

2120
import static org.jboss.resteasy.test.TestPortProvider.generateURL;
2221

@@ -33,7 +32,7 @@ public class ClientBuilderTest {
3332
* @tpPassCrit IllegalArgumentException is raised
3433
* @tpSince RESTEasy 3.0.16
3534
*/
36-
@Test(expected = BadRequestException.class)
35+
@Test(expected = IllegalArgumentException.class)
3736
public void entityStringThrowsExceptionWhenUnparsableTest() throws Exception {
3837
Entity.entity("entity", "\\//\\");
3938
Assert.fail();

testsuite/unit-tests/src/test/java/org/jboss/resteasy/test/mediatype/MediaTypeHeaderTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
import org.jboss.resteasy.plugins.delegates.MediaTypeHeaderDelegate;
44
import org.junit.Test;
5-
import javax.ws.rs.BadRequestException;
65

76
public class MediaTypeHeaderTest {
87

9-
@Test(expected = BadRequestException.class)
8+
@Test(expected = IllegalArgumentException.class)
109
public void testNewLineInHeaderValueIsRejected() {
1110
MediaTypeHeaderDelegate delegate = new MediaTypeHeaderDelegate();
1211

0 commit comments

Comments
 (0)