juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [2/8] juneau git commit: Update code to reflect changes in Java 7.
Date Thu, 26 Oct 2017 23:22:05 GMT
http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/AcceptCharsetResource.java
----------------------------------------------------------------------
diff --git a/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/AcceptCharsetResource.java b/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/AcceptCharsetResource.java
index e3c8275..f1d775f 100644
--- a/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/AcceptCharsetResource.java
+++ b/juneau-microservice/juneau-microservice-test/src/main/java/org/apache/juneau/rest/test/AcceptCharsetResource.java
@@ -82,9 +82,9 @@ public class AcceptCharsetResource extends RestServlet {
 
 				@Override /* SerializerSession */
 				protected void doSerialize(SerializerPipe out, Object o) throws Exception {
-					Writer w = new OutputStreamWriter(out.getOutputStream());
-					w.append(o.toString()).append('/').append(getStringProperty("characterEncoding"));
-					w.flush();
+					try (Writer w = new OutputStreamWriter(out.getOutputStream())) {
+						w.append(o.toString()).append('/').append(getStringProperty("characterEncoding"));
+					}
 				}
 			};
 		}

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.core.prefs
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.core.prefs b/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.core.prefs
index 8bd7d89..fb1af7a 100644
--- a/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.core.prefs
+++ b/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,10 @@
 eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
@@ -7,9 +13,105 @@ org.eclipse.jdt.core.compiler.compliance=1.7
 org.eclipse.jdt.core.compiler.debug.lineNumber=generate
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
 org.eclipse.jdt.core.compiler.source=1.7
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.ui.prefs
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.ui.prefs b/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.ui.prefs
index 9966070..2fb9b4a 100644
--- a/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.ui.prefs
+++ b/juneau-rest/juneau-rest-client/.settings/org.eclipse.jdt.ui.prefs
@@ -60,3 +60,9 @@ cleanup_settings_version=2
 eclipse.preferences.version=1
 formatter_profile=_juneau-formatter-rules
 formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=1
+org.eclipse.jdt.ui.staticondemandthreshold=1
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * Bean property getter\:  &lt;property&gt;${bare_field_name}&lt;/property&gt;.\n *\n * @return The value of the &lt;property&gt;${bare_field_name}&lt;/property&gt; property on this bean, or &lt;jk&gt;null&lt;/jk&gt; if it is not set.\n */</template><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * Bean property setter\:  &lt;property&gt;${bare_field_name}&lt;/property&gt;.\n *\n * @param ${param} The new value for the &lt;property&gt;${bare_field_name}&lt;/property&gt; property on
  this bean.\n * @return This object (for method chaining).\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * TODO\n * \n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">// ***************************************************************************************************************************\n// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *\n// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *\n// * to you under the Apache License, V
 ersion 2.0 (the "License"); you may not use this file except in compliance            *\n// * with the License.  You may obtain a copy of the License at                                                              * \n// *                                                                                                                         *\n// *  http\://www.apache.org/licenses/LICENSE-2.0                                                                             *\n// *                                                                                                                         *\n// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *\n// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *\n// * specific language governing permissions and limitations under the License.                                              *\n// *******
 ********************************************************************************************************************</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * TODO\n * \n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * TODO\n * \n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overr
 iding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * TODO\n * \n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" descripti
 on\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in c
 reated method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="false" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">this.${field} \= ${param};</template></templates>

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
index 35e58c6..721ec08 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
@@ -74,7 +74,7 @@ public final class RestCall {
 	private final RestClient client;                       // The client that created this call.
 	private final HttpRequestBase request;                 // The request.
 	private HttpResponse response;                         // The response.
-	private List<RestCallInterceptor> intercepters = new ArrayList<RestCallInterceptor>();               // Used for intercepting and altering requests.
+	private List<RestCallInterceptor> intercepters = new ArrayList<>();               // Used for intercepting and altering requests.
 
 	private boolean isConnected = false;                   // connect() has been called.
 	private boolean allowRedirectsOnPosts;
@@ -1616,13 +1616,13 @@ public final class RestCall {
 		if (cs == null)
 			cs = "UTF-8";
 
-		Reader isr = new InputStreamReader(is, cs);
-
 		if (writers.size() > 0) {
-			StringWriter sw = new StringWriter();
-			writers.add(sw, true);
-			IOPipe.create(isr, writers).byLines(byLines).run();
-			return new StringReader(sw.toString());
+			try (Reader isr = new InputStreamReader(is, cs)) {
+				StringWriter sw = new StringWriter();
+				writers.add(sw, true);
+				IOPipe.create(isr, writers).byLines(byLines).run();
+				return new StringReader(sw.toString());
+			}
 		}
 
 		return new InputStreamReader(is, cs);
@@ -1708,6 +1708,7 @@ public final class RestCall {
 	 * @throws IOException If an exception occurred while streaming was already occurring.
 	 * @throws IllegalStateException If an attempt is made to read the response more than once.
 	 */
+	@SuppressWarnings("resource")
 	public InputStream getInputStream() throws IOException {
 		if (isClosed)
 			throw new IllegalStateException("Method cannot be called.  Response has already been consumed.");
@@ -1722,6 +1723,7 @@ public final class RestCall {
 			ByteArrayInOutStream baios = new ByteArrayInOutStream();
 			outputStreams.add(baios, true);
 			IOPipe.create(is, baios).run();
+			is.close();
 			return baios.getInputStream();
 		}
 		return is;
@@ -1736,10 +1738,8 @@ public final class RestCall {
 	 * @throws IOException If an exception occurred while streaming was already occurring.
 	 */
 	public String getResponseAsString() throws IOException {
-		try {
-			Reader r = getReader();
-			String s = read(r).toString();
-			return s;
+		try (Reader r = getReader()) {
+			return read(r).toString();
 		} catch (IOException e) {
 			isFailed = true;
 			throw e;
@@ -1982,15 +1982,9 @@ public final class RestCall {
 			if (type.getInnerClass().equals(InputStream.class))
 				return (T)getInputStream();
 			Parser p = getParser();
-			T o = null;
-			if (! p.isReaderParser()) {
-				InputStream is = getInputStream();
-				o = ((InputStreamParser)p).parse(is, type);
-			} else {
-				Reader r = getReader();
-				o = ((ReaderParser)p).parse(r, type);
+			try (Closeable in = p.isReaderParser() ? getReader() : getInputStream()) {
+				return p.parse(in, type);
 			}
-			return o;
 		} catch (ParseException e) {
 			isFailed = true;
 			throw e;

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index adff21d..8045d02 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -64,7 +64,7 @@ import org.apache.juneau.urlencoding.*;
 @SuppressWarnings("rawtypes")
 public class RestClient extends CoreObject {
 
-	private static final ConcurrentHashMap<Class,PartSerializer> partSerializerCache = new ConcurrentHashMap<Class,PartSerializer>();
+	private static final ConcurrentHashMap<Class,PartSerializer> partSerializerCache = new ConcurrentHashMap<>();
 
 	private final Map<String,String> headers;
 	private final CloseableHttpClient httpClient;
@@ -115,7 +115,7 @@ public class RestClient extends CoreObject {
 		this.urlEncodingSerializer = urlEncodingSerializer;
 		this.partSerializer = partSerializer;
 
-		Map<String,String> h2 = new ConcurrentHashMap<String,String>(headers);
+		Map<String,String> h2 = new ConcurrentHashMap<>(headers);
 
 		this.headers = Collections.unmodifiableMap(h2);
 		this.rootUrl = rootUri;
@@ -124,7 +124,7 @@ public class RestClient extends CoreObject {
 		this.retryInterval = retryInterval;
 		this.debug = debug;
 
-		List<RestCallInterceptor> l = new ArrayList<RestCallInterceptor>(intercepters);
+		List<RestCallInterceptor> l = new ArrayList<>(intercepters);
 		if (debug)
 			l.add(RestCallLogger.DEFAULT);
 
@@ -668,9 +668,8 @@ public class RestClient extends CoreObject {
 
 							if (rmm.getRequestBeanArgs().length > 0) {
 								BeanSession bs = getBeanContext().createSession();
-
 								for (RemoteMethodArg rma : rmm.getRequestBeanArgs()) {
-									BeanMap<?> bm = bs.toBeanMap(args[rma.index]);
+									BeanMap<?> bm = bs.toBeanMap(args[rma.index]); 
 
 									for (BeanPropertyValue bpv : bm.getValues(false)) {
 										BeanPropertyMeta pMeta = bpv.getMeta();

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
index 5f41094..61db743 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
@@ -67,9 +67,9 @@ public class RestClientBuilder extends CoreObjectBuilder {
 	private Parser parser;
 	private PartSerializer partSerializer;
 
-	private Map<String,String> headers = new TreeMap<String,String>(String.CASE_INSENSITIVE_ORDER);
+	private Map<String,String> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
 
-	private List<RestCallInterceptor> intercepters = new ArrayList<RestCallInterceptor>();
+	private List<RestCallInterceptor> intercepters = new ArrayList<>();
 
 	private String rootUrl;
 	private SSLOpts sslOpts;
@@ -127,6 +127,7 @@ public class RestClientBuilder extends CoreObjectBuilder {
 		super(propertyStore);
 	}
 
+	@SuppressWarnings("resource")
 	@Override /* CoreObjectBuilder */
 	public RestClient build() {
 		try {
@@ -219,6 +220,7 @@ public class RestClientBuilder extends CoreObjectBuilder {
 	 *
 	 * @return The HTTP client builder to use to create the HTTP client.
 	 */
+	@SuppressWarnings("resource")
 	protected HttpClientConnectionManager createConnectionManager() {
 		if (sslOpts != null) {
 			HostnameVerifier hv = null;

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequestEntity.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequestEntity.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequestEntity.java
index c37bb84..09275f5 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequestEntity.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestRequestEntity.java
@@ -18,6 +18,7 @@ import java.io.*;
 
 import org.apache.http.entity.*;
 import org.apache.http.message.*;
+import org.apache.juneau.internal.*;
 import org.apache.juneau.serializer.*;
 import org.apache.juneau.utils.*;
 
@@ -44,10 +45,13 @@ public final class RestRequestEntity extends BasicHttpEntity {
 
 	@Override /* BasicHttpEntity */
 	public void writeTo(OutputStream os) throws IOException {
+		os = new NoCloseOutputStream(os);
 		if (output instanceof InputStream) {
-			IOPipe.create(output, os).closeOut().run();
+			IOPipe.create(output, os).run();
 		} else if (output instanceof Reader) {
-			IOPipe.create(output, new OutputStreamWriter(os, UTF8)).closeOut().run();
+			try (OutputStreamWriter osw = new OutputStreamWriter(os, UTF8)) {
+				IOPipe.create(output, osw).run();
+			}
 		} else {
 			try {
 				if (serializer == null) {
@@ -55,15 +59,8 @@ public final class RestRequestEntity extends BasicHttpEntity {
 					os.close();
 				} else {
 					SerializerSession session = serializer.createSession();
-					if (session.isWriterSerializer()) {
-						Writer w = new OutputStreamWriter(os, UTF8);
-						session.serialize(w, output);
-						w.flush();
-						w.close();
-					} else {
-						session.serialize(os, output);
-						os.flush();
-						os.close();
+					try (Closeable c = session.isWriterSerializer() ? new OutputStreamWriter(os, UTF8) : os) {
+						session.serialize(c, output);
 					}
 				}
 			} catch (SerializeException e) {
@@ -80,8 +77,7 @@ public final class RestRequestEntity extends BasicHttpEntity {
 	@Override /* BasicHttpEntity */
 	public InputStream getContent() {
 		if (outputBytes == null) {
-			ByteArrayOutputStream baos = new ByteArrayOutputStream();
-			try {
+			try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
 				writeTo(baos);
 				outputBytes = baos.toByteArray();
 			} catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.core.prefs
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.core.prefs b/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.core.prefs
index 8bd7d89..fb1af7a 100644
--- a/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.core.prefs
+++ b/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,10 @@
 eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
@@ -7,9 +13,105 @@ org.eclipse.jdt.core.compiler.compliance=1.7
 org.eclipse.jdt.core.compiler.debug.lineNumber=generate
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
 org.eclipse.jdt.core.compiler.source=1.7
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.ui.prefs
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.ui.prefs b/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.ui.prefs
index 9966070..2fb9b4a 100644
--- a/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.ui.prefs
+++ b/juneau-rest/juneau-rest-server-jaxrs/.settings/org.eclipse.jdt.ui.prefs
@@ -60,3 +60,9 @@ cleanup_settings_version=2
 eclipse.preferences.version=1
 formatter_profile=_juneau-formatter-rules
 formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=1
+org.eclipse.jdt.ui.staticondemandthreshold=1
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * Bean property getter\:  &lt;property&gt;${bare_field_name}&lt;/property&gt;.\n *\n * @return The value of the &lt;property&gt;${bare_field_name}&lt;/property&gt; property on this bean, or &lt;jk&gt;null&lt;/jk&gt; if it is not set.\n */</template><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * Bean property setter\:  &lt;property&gt;${bare_field_name}&lt;/property&gt;.\n *\n * @param ${param} The new value for the &lt;property&gt;${bare_field_name}&lt;/property&gt; property on
  this bean.\n * @return This object (for method chaining).\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * TODO\n * \n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">// ***************************************************************************************************************************\n// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *\n// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *\n// * to you under the Apache License, V
 ersion 2.0 (the "License"); you may not use this file except in compliance            *\n// * with the License.  You may obtain a copy of the License at                                                              * \n// *                                                                                                                         *\n// *  http\://www.apache.org/licenses/LICENSE-2.0                                                                             *\n// *                                                                                                                         *\n// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *\n// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *\n// * specific language governing permissions and limitations under the License.                                              *\n// *******
 ********************************************************************************************************************</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * TODO\n * \n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * TODO\n * \n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overr
 iding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * TODO\n * \n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" descripti
 on\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in c
 reated method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="false" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">this.${field} \= ${param};</template></templates>

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java b/juneau-rest/juneau-rest-server-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java
index ecdee93..1847ba0 100644
--- a/juneau-rest/juneau-rest-server-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java
+++ b/juneau-rest/juneau-rest-server-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/BaseProvider.java
@@ -117,15 +117,11 @@ public class BaseProvider implements MessageBodyReader<Object>, MessageBodyWrite
 			TimeZone timeZone = getTimeZone(headers);
 			
 			SerializerSession session = s.createSession(new SerializerSessionArgs(mp, null, locale, timeZone, sm.getMediaType(), null));
+			
+			// Leave this open in case an error occurs.
+			Closeable c = s.isWriterSerializer() ? new OutputStreamWriter(os, UTF8) : os;
+			session.serialize(c, o);
 
-			if (s.isWriterSerializer()) {
-				OutputStreamWriter w = new OutputStreamWriter(os, UTF8);
-				session.serialize(w, o);
-				w.close();  // Leave open if exception occurs.
-			} else {
-				session.serialize(os, o);
-				os.close();  // Leave open if exception occurs.
-			}
 		} catch (SerializeException e) {
 			throw new IOException(e);
 		}
@@ -149,12 +145,8 @@ public class BaseProvider implements MessageBodyReader<Object>, MessageBodyWrite
 			Locale locale = getLocale(headers);
 			TimeZone timeZone = getTimeZone(headers);
 			ParserSession session = p.createSession(new ParserSessionArgs(mp, null, locale, timeZone, pm.getMediaType(), null));
-			try {
-				Object in2 = session.isReaderParser() ? new InputStreamReader(in, UTF8) : in;
-				return session.parse(in2, p.getBeanContext().getClassMeta(gType));
-			} finally {
-				session.close();
-			}
+			Object in2 = session.isReaderParser() ? new InputStreamReader(in, UTF8) : in;
+			return session.parse(in2, p.getBeanContext().getClassMeta(gType));
 		} catch (ParseException e) {
 			throw new IOException(e);
 		}

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.core.prefs
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.core.prefs b/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.core.prefs
index 8bd7d89..fb1af7a 100644
--- a/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.core.prefs
+++ b/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,10 @@
 eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
@@ -7,9 +13,105 @@ org.eclipse.jdt.core.compiler.compliance=1.7
 org.eclipse.jdt.core.compiler.debug.lineNumber=generate
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
 org.eclipse.jdt.core.compiler.source=1.7
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.ui.prefs
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.ui.prefs b/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.ui.prefs
index 9966070..2fb9b4a 100644
--- a/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.ui.prefs
+++ b/juneau-rest/juneau-rest-server/.settings/org.eclipse.jdt.ui.prefs
@@ -60,3 +60,9 @@ cleanup_settings_version=2
 eclipse.preferences.version=1
 formatter_profile=_juneau-formatter-rules
 formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=1
+org.eclipse.jdt.ui.staticondemandthreshold=1
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * Bean property getter\:  &lt;property&gt;${bare_field_name}&lt;/property&gt;.\n *\n * @return The value of the &lt;property&gt;${bare_field_name}&lt;/property&gt; property on this bean, or &lt;jk&gt;null&lt;/jk&gt; if it is not set.\n */</template><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * Bean property setter\:  &lt;property&gt;${bare_field_name}&lt;/property&gt;.\n *\n * @param ${param} The new value for the &lt;property&gt;${bare_field_name}&lt;/property&gt; property on
  this bean.\n * @return This object (for method chaining).\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * TODO\n * \n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">// ***************************************************************************************************************************\n// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *\n// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *\n// * to you under the Apache License, V
 ersion 2.0 (the "License"); you may not use this file except in compliance            *\n// * with the License.  You may obtain a copy of the License at                                                              * \n// *                                                                                                                         *\n// *  http\://www.apache.org/licenses/LICENSE-2.0                                                                             *\n// *                                                                                                                         *\n// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *\n// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *\n// * specific language governing permissions and limitations under the License.                                              *\n// *******
 ********************************************************************************************************************</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * TODO\n * \n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * TODO\n * \n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overr
 iding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * TODO\n * \n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" descripti
 on\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in c
 reated method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="false" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">this.${field} \= ${param};</template></templates>

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallMethod.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallMethod.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallMethod.java
index 093f5d5..04c3a54 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallMethod.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallMethod.java
@@ -161,7 +161,7 @@ class CallMethod implements Comparable<CallMethod>  {
 				HtmlDoc hd = m.htmldoc();
 				hdb.process(hd);
 
-				widgets = new HashMap<String,Widget>(context.getWidgets());
+				widgets = new HashMap<>(context.getWidgets());
 				for (Class<? extends Widget> wc : hd.widgets()) {
 					Widget w = ClassUtils.newInstance(Widget.class, wc);
 					widgets.put(w.getName(), w);
@@ -209,7 +209,7 @@ class CallMethod implements Comparable<CallMethod>  {
 				for (int i = 0; i < guards.length; i++)
 					guards[i] = newInstance(RestGuard.class, m.guards()[i]);
 
-				List<RestMatcher> optionalMatchers = new LinkedList<RestMatcher>(), requiredMatchers = new LinkedList<RestMatcher>();
+				List<RestMatcher> optionalMatchers = new LinkedList<>(), requiredMatchers = new LinkedList<>();
 				for (int i = 0; i < m.matchers().length; i++) {
 					Class<? extends RestMatcher> c = m.matchers()[i];
 					RestMatcher matcher = null;
@@ -241,7 +241,7 @@ class CallMethod implements Comparable<CallMethod>  {
 					for (String p1 : m.flags())
 						sgb.property(p1, true);
 					if (m.bpi().length > 0) {
-						Map<String,String> bpiMap = new LinkedHashMap<String,String>();
+						Map<String,String> bpiMap = new LinkedHashMap<>();
 						for (String s : m.bpi()) {
 							for (String s2 : split(s, ';')) {
 								int i = s2.indexOf(':');
@@ -254,7 +254,7 @@ class CallMethod implements Comparable<CallMethod>  {
 						sgb.includeProperties(bpiMap);
 					}
 					if (m.bpx().length > 0) {
-						Map<String,String> bpxMap = new LinkedHashMap<String,String>();
+						Map<String,String> bpxMap = new LinkedHashMap<>();
 						for (String s : m.bpx()) {
 							for (String s2 : split(s, ';')) {
 								int i = s2.indexOf(':');
@@ -319,7 +319,7 @@ class CallMethod implements Comparable<CallMethod>  {
 					encoders = g.build();
 				}
 
-				defaultRequestHeaders = new TreeMap<String,String>(String.CASE_INSENSITIVE_ORDER);
+				defaultRequestHeaders = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
 				for (String s : m.defaultRequestHeaders()) {
 					String[] h = RestUtils.parseKeyValuePair(s);
 					if (h == null)
@@ -328,7 +328,7 @@ class CallMethod implements Comparable<CallMethod>  {
 					defaultRequestHeaders.put(h[0], h[1]);
 				}
 
-				defaultQuery = new LinkedHashMap<String,String>();
+				defaultQuery = new LinkedHashMap<>();
 				for (String s : m.defaultQuery()) {
 					String[] h = RestUtils.parseKeyValuePair(s);
 					if (h == null)
@@ -337,7 +337,7 @@ class CallMethod implements Comparable<CallMethod>  {
 					defaultQuery.put(h[0], h[1]);
 				}
 
-				defaultFormData = new LinkedHashMap<String,String>();
+				defaultFormData = new LinkedHashMap<>();
 				for (String s : m.defaultFormData()) {
 					String[] h = RestUtils.parseKeyValuePair(s);
 					if (h == null)
@@ -535,7 +535,7 @@ class CallMethod implements Comparable<CallMethod>  {
 
 		VarResolverSession vr = req.getVarResolverSession();
 		JsonParser jp = JsonParser.DEFAULT;
-		Map<String,ParameterInfo> m = new TreeMap<String,ParameterInfo>();
+		Map<String,ParameterInfo> m = new TreeMap<>();
 
 		// First parse @RestMethod.parameters() annotation.
 		for (org.apache.juneau.rest.annotation.Parameter v : parameters) {
@@ -632,13 +632,12 @@ class CallMethod implements Comparable<CallMethod>  {
 
 		if (m.isEmpty())
 			return null;
-		return new ArrayList<ParameterInfo>(m.values());
+		return new ArrayList<>(m.values());
 	}
 
 	/**
 	 * Returns the localized Swagger response information about this Java method.
 	 */
-	@SuppressWarnings("unchecked")
 	private Map<Integer,ResponseInfo> getResponses(RestRequest req) throws ParseException {
 		Operation o = getSwaggerOperationFromFile(req);
 		if (o != null && o.getResponses() != null)
@@ -646,8 +645,8 @@ class CallMethod implements Comparable<CallMethod>  {
 
 		VarResolverSession vr = req.getVarResolverSession();
 		JsonParser jp = JsonParser.DEFAULT;
-		Map<Integer,ResponseInfo> m = new TreeMap<Integer,ResponseInfo>();
-		Map<String,HeaderInfo> m2 = new TreeMap<String,HeaderInfo>();
+		Map<Integer,ResponseInfo> m = new TreeMap<>();
+		Map<String,HeaderInfo> m2 = new TreeMap<>();
 
 		// First parse @RestMethod.parameters() annotation.
 		for (Response r : responses) {

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallRouter.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallRouter.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallRouter.java
index a592f5a..5251d39 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallRouter.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/CallRouter.java
@@ -37,8 +37,8 @@ class CallRouter {
 	 * Builder class.
 	 */
 	static class Builder {
-		private List<CallMethod> childMethods = new ArrayList<CallMethod>();
-		private Set<String> collisions = new HashSet<String>();
+		private List<CallMethod> childMethods = new ArrayList<>();
+		private Set<String> collisions = new HashSet<>();
 		private String httpMethodName;
 
 		Builder(String httpMethodName) {

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/HtmlDocBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/HtmlDocBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/HtmlDocBuilder.java
index 0c877ba..ac7c7ca 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/HtmlDocBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/HtmlDocBuilder.java
@@ -451,7 +451,7 @@ public class HtmlDocBuilder {
 	private static final Pattern INDEXED_LINK_PATTERN = Pattern.compile("(?s)(\\S*)\\[(\\d+)\\]\\:(.*)");
 
 	private static String[] resolveLinks(Object[] value, String[] prev) {
-		List<String> list = new ArrayList<String>();
+		List<String> list = new ArrayList<>();
 		for (Object v : value) {
 			String s = StringUtils.toString(v);
 			if ("INHERIT".equals(s)) {

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java
index d12ede2..bad1f9f 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/ReaderResource.java
@@ -79,7 +79,7 @@ public class ReaderResource implements Writable {
 		this.mediaType = mediaType;
 		this.varSession = varSession;
 
-		Map<String,String> m = new LinkedHashMap<String,String>();
+		Map<String,String> m = new LinkedHashMap<>();
 		if (headers != null)
 			for (Map.Entry<String,String> e : headers.entrySet())
 				m.put(e.getKey(), StringUtils.toString(e.getValue()));
@@ -107,10 +107,10 @@ public class ReaderResource implements Writable {
 	 * Builder class for constructing {@link ReaderResource} objects.
 	 */
 	public static class Builder {
-		ArrayList<Object> contents = new ArrayList<Object>();
+		ArrayList<Object> contents = new ArrayList<>();
 		MediaType mediaType;
 		VarResolverSession varResolver;
-		Map<String,String> headers = new LinkedHashMap<String,String>();
+		Map<String,String> headers = new LinkedHashMap<>();
 
 		/**
 		 * Specifies the resource media type string.

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestBody.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestBody.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestBody.java
index 3633331..fcb68ae 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestBody.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestBody.java
@@ -230,6 +230,18 @@ public class RequestBody {
 	}
 
 	/**
+	 * Returns the HTTP body content as a simple space-delimited hexadecimal character string.
+	 *
+	 * @return The incoming input from the connection as a plain string.
+	 * @throws IOException If a problem occurred trying to read from the reader.
+	 */
+	public String asSpacedHex() throws IOException {
+		if (body == null)
+			body = readBytes(getInputStream(), 1024);
+		return toSpacedHex(body);
+	}
+
+	/**
 	 * Returns the HTTP body content as a {@link Reader}.
 	 *
 	 * <p>
@@ -272,6 +284,7 @@ public class RequestBody {
 	 * @return The negotiated input stream.
 	 * @throws IOException If any error occurred while trying to get the input stream or wrap it in the GZIP wrapper.
 	 */
+	@SuppressWarnings("resource")
 	public ServletInputStream getInputStream() throws IOException {
 
 		if (body != null)
@@ -358,8 +371,9 @@ public class RequestBody {
 				try {
 					req.getProperties().append("mediaType", mediaType).append("characterEncoding", req.getCharacterEncoding());
 					ParserSession session = p.createSession(new ParserSessionArgs(req.getProperties(), req.getJavaMethod(), locale, timeZone, mediaType, req.getContext().getResource()));
-					Object in = session.isReaderParser() ? getUnbufferedReader() : getInputStream();
-					return session.parse(in, cm);
+					try (Closeable in = session.isReaderParser() ? getUnbufferedReader() : getInputStream()) {
+						return session.parse(in, cm);
+					}
 				} catch (ParseException e) {
 					throw new RestException(SC_BAD_REQUEST,
 						"Could not convert request body content to class type ''{0}'' using parser ''{1}''.",

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java
index 5fdb378..7ff6c93 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCallHandler.java
@@ -307,15 +307,16 @@ public class RestCallHandler {
 		} catch (IllegalStateException e2) {
 			w = new PrintWriter(new OutputStreamWriter(res.getOutputStream(), UTF8));
 		}
-		String httpMessage = RestUtils.getHttpResponseText(status);
-		if (httpMessage != null)
-			w.append("HTTP ").append(String.valueOf(status)).append(": ").append(httpMessage).append("\n\n");
-		if (context != null && context.isRenderResponseStackTraces())
-			e.printStackTrace(w);
-		else
-			w.append(e.getFullStackMessage(true));
-		w.flush();
-		w.close();
+		
+		try (PrintWriter w2 = w) {
+			String httpMessage = RestUtils.getHttpResponseText(status);
+			if (httpMessage != null)
+				w2.append("HTTP ").append(String.valueOf(status)).append(": ").append(httpMessage).append("\n\n");
+			if (context != null && context.isRenderResponseStackTraces())
+				e.printStackTrace(w2);
+			else
+				w2.append(e.getFullStackMessage(true));
+		}
 	}
 
 	/**
@@ -328,7 +329,7 @@ public class RestCallHandler {
 	 * @return The session objects for that request.
 	 */
 	public Map<String,Object> getSessionObjects(RestRequest req) {
-		Map<String,Object> m = new HashMap<String,Object>();
+		Map<String,Object> m = new HashMap<>();
 		m.put(RequestVar.SESSION_req, req);
 		return m;
 	}

http://git-wip-us.apache.org/repos/asf/juneau/blob/d1258753/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java
index 58525fc..04c80f6 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestConfig.java
@@ -92,21 +92,21 @@ public class RestConfig implements ServletConfig {
 	VarResolverBuilder varResolverBuilder;
 
 	List<Class<?>>
-		beanFilters = new ArrayList<Class<?>>(),
-		pojoSwaps = new ArrayList<Class<?>>(),
-		paramResolvers = new ArrayList<Class<?>>();
+		beanFilters = new ArrayList<>(),
+		pojoSwaps = new ArrayList<>(),
+		paramResolvers = new ArrayList<>();
 	Class<? extends SerializerListener> serializerListener;
 	Class<? extends ParserListener> parserListener;
 	SerializerGroupBuilder serializers = new SerializerGroupBuilder();
 	ParserGroupBuilder parsers = new ParserGroupBuilder();
 	EncoderGroupBuilder encoders = new EncoderGroupBuilder().append(IdentityEncoder.INSTANCE);
-	List<Object> converters = new ArrayList<Object>();
-	List<Object> guards = new ArrayList<Object>();
+	List<Object> converters = new ArrayList<>();
+	List<Object> guards = new ArrayList<>();
 	MimetypesFileTypeMap mimeTypes = new ExtendedMimetypesFileTypeMap();
-	Map<String,String> defaultRequestHeaders = new TreeMap<String,String>(String.CASE_INSENSITIVE_ORDER);
-	Map<String,Object> defaultResponseHeaders = new LinkedHashMap<String,Object>();
-	List<Object> responseHandlers = new ArrayList<Object>();
-	List<Object> childResources = new ArrayList<Object>();
+	Map<String,String> defaultRequestHeaders = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
+	Map<String,Object> defaultResponseHeaders = new LinkedHashMap<>();
+	List<Object> responseHandlers = new ArrayList<>();
+	List<Object> childResources = new ArrayList<>();
 	List<MediaType> supportedContentTypes, supportedAcceptTypes;
 	List<Object> staticFiles;
 	RestContext parentContext;
@@ -114,7 +114,7 @@ public class RestConfig implements ServletConfig {
 	String clientVersionHeader = "X-Client-Version";
 	String contextPath;
 	HtmlDocBuilder htmlDocBuilder;
-	List<Class<? extends Widget>> widgets = new ArrayList<Class<? extends Widget>>();
+	List<Class<? extends Widget>> widgets = new ArrayList<>();
 
 	Object resourceResolver = RestResourceResolverSimple.class;
 	Object logger = RestLogger.Normal.class;
@@ -272,7 +272,7 @@ public class RestConfig implements ServletConfig {
 	 * Calls all @RestHook(INIT) methods on the specified resource object.
 	 */
 	void init(Object resource) throws ServletException {
-		Map<String,Method> map = new LinkedHashMap<String,Method>();
+		Map<String,Method> map = new LinkedHashMap<>();
 		for (Method m : ClassUtils.getAllMethods(this.resourceClass, true)) {
 			if (m.isAnnotationPresent(RestHook.class) && m.getAnnotation(RestHook.class).value() == HookEvent.INIT) {
 				Visibility.setAccessible(m);
@@ -881,7 +881,7 @@ public class RestConfig implements ServletConfig {
 	 * @return This object (for method chaining).
 	 */
 	public RestConfig addChildResource(String path, Object child) {
-		this.childResources.add(new Pair<String,Object>(path, child));
+		this.childResources.add(new Pair<>(path, child));
 		return this;
 	}
 
@@ -934,7 +934,7 @@ public class RestConfig implements ServletConfig {
 	 * @return This object (for method chaining).
 	 */
 	public RestConfig setSupportedAcceptTypes(String...mediaTypes) {
-		supportedAcceptTypes = new ArrayList<MediaType>();
+		supportedAcceptTypes = new ArrayList<>();
 		for (String mediaType : mediaTypes)
 			supportedAcceptTypes.add(MediaType.forString(mediaType));
 		return this;
@@ -970,7 +970,7 @@ public class RestConfig implements ServletConfig {
 	 * @return This object (for method chaining).
 	 */
 	public RestConfig setSupportedContentTypes(String...mediaTypes) {
-		supportedContentTypes = new ArrayList<MediaType>();
+		supportedContentTypes = new ArrayList<>();
 		for (String mediaType : mediaTypes)
 			supportedContentTypes.add(MediaType.forString(mediaType));
 		return this;
@@ -1013,7 +1013,7 @@ public class RestConfig implements ServletConfig {
 	 */
 	public RestConfig addStaticFiles(Class<?> resourceClass, String staticFilesString) {
 		if (staticFiles == null)
-			staticFiles = new ArrayList<Object>();
+			staticFiles = new ArrayList<>();
 		staticFiles.add(new Pair<Class<?>,Object>(resourceClass, staticFilesString));
 		return this;
 	}


Mime
View raw message