Skip to content

Commit

Permalink
Backport #61 in 2.5 branch for 2.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 24, 2015
1 parent 0a5a31c commit b3538e0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,7 @@ public THIS setDefaultView(Class<?> view) {
// // // JaxRSFeature config

public THIS configure(JaxRSFeature feature, boolean state) {
_jaxRSFeatures |= feature.getMask();
return _this();
return state ? enable(feature) : disable(feature);
}

public THIS enable(JaxRSFeature feature) {
Expand Down Expand Up @@ -353,12 +352,12 @@ public THIS configure(DeserializationFeature f, boolean state) {
return _this();
}

public THIS enable(DeserializationFeature f, boolean state) {
public THIS enable(DeserializationFeature f) {
_mapperConfig.configure(f, true);
return _this();
}

public THIS disable(DeserializationFeature f, boolean state) {
public THIS disable(DeserializationFeature f) {
_mapperConfig.configure(f, false);
return _this();
}
Expand All @@ -370,34 +369,34 @@ public THIS configure(SerializationFeature f, boolean state) {
return _this();
}

public THIS enable(SerializationFeature f, boolean state) {
public THIS enable(SerializationFeature f) {
_mapperConfig.configure(f, true);
return _this();
}

public THIS disable(SerializationFeature f, boolean state) {
public THIS disable(SerializationFeature f) {
_mapperConfig.configure(f, false);
return _this();
}

// // // JsonParser/JsonGenerator

public THIS enable(JsonParser.Feature f, boolean state) {
public THIS enable(JsonParser.Feature f) {
_mapperConfig.configure(f, true);
return _this();
}

public THIS enable(JsonGenerator.Feature f, boolean state) {
public THIS enable(JsonGenerator.Feature f) {
_mapperConfig.configure(f, true);
return _this();
}

public THIS disable(JsonParser.Feature f, boolean state) {
public THIS disable(JsonParser.Feature f) {
_mapperConfig.configure(f, false);
return _this();
}

public THIS disable(JsonGenerator.Feature f, boolean state) {
public THIS disable(JsonGenerator.Feature f) {
_mapperConfig.configure(f, false);
return _this();
}
Expand Down Expand Up @@ -803,7 +802,7 @@ public Object readFrom(Class<Object> type, Type genericType, Annotation[] annota
}
final JavaType resolvedType = reader.getTypeFactory().constructType(genericType);
reader = reader.withType(resolvedType);
// [Issue#32]: allow modification by filter-injectible thing
// [Issue#32]: allow modification by filter-injectable thing
ObjectReaderModifier mod = ObjectReaderInjector.getAndClear();
if (mod != null) {
reader = mod.modify(endpoint, httpHeaders, resolvedType, reader, jp);
Expand Down
5 changes: 5 additions & 0 deletions release-notes/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ Dain Sundstrom:
* Suggested #6: Add `JaxRSFeature.ADD_NO_SNIFF_HEADER` to automatically add
X-Content-Type-Options header (works with IE)
(2.2.3)

Jonathan Haber:
* Contributed #61: Fix disabling of `JaxRSFeature` (was always enabling features)
(2.5.2)

4 changes: 3 additions & 1 deletion release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Sub-modules:

2.5.2 (not yet released)

Update Woodstox dep to 4.1.4, stax2-api 3.1.4.
#61: Fix disabling of `JaxRSFeature` (was always enabling features)
(contributed by Jonathan H, HiJon89@github)
- Update Woodstox dep to 4.4.1, stax2-api 3.1.4.

2.5.1 (06-Feb-2015)
2.5.0 (01-Jan-2015)
Expand Down

0 comments on commit b3538e0

Please sign in to comment.