JUNEAU-124 Serializers and parsers should throw specific exceptions.
diff --git a/eclipse-preferences/org.eclipse.jdt.core.prefs b/eclipse-preferences/source-prefs/org.eclipse.jdt.core.prefs
similarity index 94%
copy from eclipse-preferences/org.eclipse.jdt.core.prefs
copy to eclipse-preferences/source-prefs/org.eclipse.jdt.core.prefs
index 880e185..c357749 100644
--- a/eclipse-preferences/org.eclipse.jdt.core.prefs
+++ b/eclipse-preferences/source-prefs/org.eclipse.jdt.core.prefs
@@ -1,15 +1,3 @@
-# ***************************************************************************************************************************
-# * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-# * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-# * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-# * with the License. You may obtain a copy of the License at *
-# * *
-# * http://www.apache.org/licenses/LICENSE-2.0 *
-# * *
-# * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-# * specific language governing permissions and limitations under the License. *
-# ***************************************************************************************************************************
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
@@ -20,12 +8,18 @@
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
+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.APILeak=warning
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
@@ -34,8 +28,9 @@
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=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=info
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
@@ -45,7 +40,7 @@
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=ignore
+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
@@ -53,10 +48,10 @@
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=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=info
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=info
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
@@ -65,10 +60,10 @@
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=ignore
+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=ignore
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=info
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
@@ -81,13 +76,13 @@
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=info
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
@@ -99,7 +94,7 @@
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+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
@@ -107,11 +102,11 @@
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+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.unstableAutoModuleName=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=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
diff --git a/eclipse-preferences/source-prefs/org.eclipse.jdt.ui.prefs b/eclipse-preferences/source-prefs/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..cfe018f
--- /dev/null
+++ b/eclipse-preferences/source-prefs/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,69 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=false
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=true
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
+cleanup.qualify_static_member_accesses_with_declaring_class=false
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_modifiers=false
+cleanup.remove_redundant_semicolons=false
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=false
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_juneau-cleanup-rules
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_juneau-formatter-rules
+formatter_settings_version=16
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=false
+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\: <property>${bare_field_name}</property>.\n *\n * @return The value of the <property>${bare_field_name}</property> property on this bean, or <jk>null</jk> 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\: <property>${bare_field_name}</property>.\n *\n * @param ${param} The new value for the <property>${bare_field_name}</property> 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, Version 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 overriding 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" description\="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 created 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>
diff --git a/eclipse-preferences/org.eclipse.jdt.core.prefs b/eclipse-preferences/test-prefs/org.eclipse.jdt.core.prefs
similarity index 95%
rename from eclipse-preferences/org.eclipse.jdt.core.prefs
rename to eclipse-preferences/test-prefs/org.eclipse.jdt.core.prefs
index 880e185..09a3122 100644
--- a/eclipse-preferences/org.eclipse.jdt.core.prefs
+++ b/eclipse-preferences/test-prefs/org.eclipse.jdt.core.prefs
@@ -1,15 +1,3 @@
-# ***************************************************************************************************************************
-# * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-# * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-# * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-# * with the License. You may obtain a copy of the License at *
-# * *
-# * http://www.apache.org/licenses/LICENSE-2.0 *
-# * *
-# * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-# * specific language governing permissions and limitations under the License. *
-# ***************************************************************************************************************************
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
@@ -20,12 +8,18 @@
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+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=disabled
org.eclipse.jdt.core.compiler.problem.APILeak=warning
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
@@ -34,6 +28,7 @@
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=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
diff --git a/eclipse-preferences/org.eclipse.jdt.ui.prefs b/eclipse-preferences/test-prefs/org.eclipse.jdt.ui.prefs
similarity index 100%
rename from eclipse-preferences/org.eclipse.jdt.ui.prefs
rename to eclipse-preferences/test-prefs/org.eclipse.jdt.ui.prefs
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
index e224d5f..d611882 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
Binary files differ
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
index b8e8978..2aae8d3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyStoreBuilder.java
@@ -844,7 +844,6 @@
add(e.getKey(), e.getValue());
}
- @SuppressWarnings("unchecked")
@Override /* MutableProperty */
synchronized void add(String arg, Object o) {
if (arg != null) {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserSession.java
index 203ad2d..de56226 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvParserSession.java
@@ -49,7 +49,7 @@
}
@SuppressWarnings({})
- private <T> T parseAnything(ClassMeta<T> eType, ParserReader r, Object outer, BeanPropertyMeta pMeta) throws IOException, ParseException {
+ private <T> T parseAnything(ClassMeta<T> eType, ParserReader r, Object outer, BeanPropertyMeta pMeta) throws ParseException {
throw new ParseException("Not implemented.");
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserSession.java
index 45790db..79e19e9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlParserSession.java
@@ -285,7 +285,7 @@
/*
* For parsing output from HtmlDocSerializer, this skips over the head, title, and links.
*/
- private HtmlTag skipToData(XmlReader r) throws IOException, ParseException, XMLStreamException {
+ private HtmlTag skipToData(XmlReader r) throws ParseException, XMLStreamException {
while (true) {
int event = r.next();
if (event == START_ELEMENT && "div".equals(r.getLocalName()) && "data".equals(r.getAttributeValue(null, "id"))) {
@@ -524,7 +524,7 @@
* Precondition: Must be pointing before the event we want to parse.
* Postcondition: Pointing at the tag just parsed.
*/
- private HtmlTag nextTag(XmlReader r, HtmlTag...expected) throws IOException, ParseException, XMLStreamException {
+ private HtmlTag nextTag(XmlReader r, HtmlTag...expected) throws ParseException, XMLStreamException {
int et = r.next();
while (et != START_ELEMENT && et != END_ELEMENT && et != END_DOCUMENT)
@@ -552,7 +552,7 @@
* @param r The stream being read from.
* @throws XMLStreamException
*/
- private void skipTag(XmlReader r) throws IOException, ParseException, XMLStreamException {
+ private void skipTag(XmlReader r) throws ParseException, XMLStreamException {
int et = r.getEventType();
if (et != START_ELEMENT)
@@ -580,7 +580,7 @@
}
}
- private void skipTag(XmlReader r, HtmlTag...expected) throws IOException, ParseException, XMLStreamException {
+ private void skipTag(XmlReader r, HtmlTag...expected) throws ParseException, XMLStreamException {
HtmlTag tag = HtmlTag.forEvent(this, r);
if (tag.isOneOf(expected))
r.next();
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java
index 0881c12..f17bf73 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java
@@ -371,7 +371,7 @@
return cr;
}
- @SuppressWarnings({ "rawtypes", "unchecked" })
+ @SuppressWarnings({ "rawtypes" })
private void serializeMap(XmlWriter out, Map m, ClassMeta<?> sType,
ClassMeta<?> eKeyType, ClassMeta<?> eValueType, String typeName, BeanPropertyMeta ppMeta) throws IOException, SerializeException {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/DelegateMap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/DelegateMap.java
index 7341f6b..4a66687 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/DelegateMap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/internal/DelegateMap.java
@@ -33,7 +33,6 @@
* @param m The metadata object that created this delegate object.
* @param session The current bean session.
*/
- @SuppressWarnings("unchecked")
public DelegateMap(T m, BeanSession session) {
this.classMeta = session.getClassMetaForObject(m);
for (Map.Entry e : (Set<Map.Entry>)m.entrySet())
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserSession.java
index 0540718..586fdc4 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonParserSession.java
@@ -237,7 +237,7 @@
return parseNumber(r, parseNumberString(r), type);
}
- private Number parseNumber(ParserReader r, String s, Class<? extends Number> type) throws IOException, ParseException {
+ private Number parseNumber(ParserReader r, String s, Class<? extends Number> type) throws ParseException {
// JSON has slightly different number rules from Java.
// Strict mode enforces these different rules, lax does not.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/Marshall.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/Marshall.java
index ed0dfb9..15ef4f9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/Marshall.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/Marshall.java
@@ -119,8 +119,9 @@
* <li>{@link File}
* </ul>
* @throws SerializeException If a problem occurred trying to convert the output.
+ * @throws IOException Thrown by underlying stream.
*/
- public final void write(Object o, Object output) throws SerializeException {
+ public final void write(Object o, Object output) throws SerializeException, IOException {
s.createSession().serialize(o, output);
}
@@ -298,9 +299,51 @@
* <br>Ignored if the main type is not a map or collection.
* @return The parsed object.
* @throws ParseException Malformed input encountered.
+ * @throws IOException Thrown by underlying stream.
* @see BeanSession#getClassMeta(Type,Type...) for argument syntax for maps and collections.
*/
- public final <T> T read(Object input, Type type, Type...args) throws ParseException {
+ public final <T> T read(Object input, Type type, Type...args) throws ParseException, IOException {
+ return p.createSession().parse(input, type, args);
+ }
+
+ /**
+ * Same as {@link #read(Object,Type,Type...)} but reads from a string and thus doesn't throw an <c>IOException</c>.
+ *
+ * @param <T> The class type of the object to create.
+ * @param input
+ * The input.
+ * <br>Character-based parsers can handle the following input class types:
+ * <ul>
+ * <li><jk>null</jk>
+ * <li>{@link Reader}
+ * <li>{@link CharSequence}
+ * <li>{@link InputStream} containing UTF-8 encoded text (or charset defined by
+ * {@link ReaderParser#RPARSER_streamCharset} property value).
+ * <li><code><jk>byte</jk>[]</code> containing UTF-8 encoded text (or charset defined by
+ * {@link ReaderParser#RPARSER_streamCharset} property value).
+ * <li>{@link File} containing system encoded text (or charset defined by
+ * {@link ReaderParser#RPARSER_fileCharset} property value).
+ * </ul>
+ * <br>Stream-based parsers can handle the following input class types:
+ * <ul>
+ * <li><jk>null</jk>
+ * <li>{@link InputStream}
+ * <li><code><jk>byte</jk>[]</code>
+ * <li>{@link File}
+ * <li>{@link CharSequence} containing encoded bytes according to the {@link InputStreamParser#ISPARSER_binaryFormat} setting.
+ * </ul>
+ * @param type
+ * The object type to create.
+ * <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}
+ * @param args
+ * The type arguments of the class if it's a collection or map.
+ * <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}
+ * <br>Ignored if the main type is not a map or collection.
+ * @return The parsed object.
+ * @throws ParseException Malformed input encountered.
+ * @see BeanSession#getClassMeta(Type,Type...) for argument syntax for maps and collections.
+ */
+ public final <T> T read(String input, Type type, Type...args) throws ParseException {
return p.createSession().parse(input, type, args);
}
@@ -337,8 +380,47 @@
* @param type The object type to create.
* @return The parsed object.
* @throws ParseException Malformed input encountered.
+ * @throws IOException Thrown by underlying stream.
*/
- public final <T> T read(Object input, Class<T> type) throws ParseException {
+ public final <T> T read(Object input, Class<T> type) throws ParseException, IOException {
+ return p.createSession().parse(input, type);
+ }
+
+ /**
+ * Same as {@link #read(Object,Class)} but reads from a string and thus doesn't throw an <c>IOException</c>.
+ *
+ * <p>
+ * This is the preferred parse method for simple types since you don't need to cast the results.
+ *
+ * <h5 class='section'>Examples:</h5>
+ * <p class='bcode w800'>
+ * Marshall m = Json.<jsf>DEFAULT</jsf>;
+ *
+ * <jc>// Parse into a string.</jc>
+ * String s = m.read(json, String.<jk>class</jk>);
+ *
+ * <jc>// Parse into a bean.</jc>
+ * MyBean b = m.read(json, MyBean.<jk>class</jk>);
+ *
+ * <jc>// Parse into a bean array.</jc>
+ * MyBean[] ba = m.read(json, MyBean[].<jk>class</jk>);
+ *
+ * <jc>// Parse into a linked-list of objects.</jc>
+ * List l = m.read(json, LinkedList.<jk>class</jk>);
+ *
+ * <jc>// Parse into a map of object keys/values.</jc>
+ * Map m = m.read(json, TreeMap.<jk>class</jk>);
+ * </p>
+ *
+ * @param <T> The class type of the object being created.
+ * @param input
+ * The input.
+ * See {@link #read(Object, Type, Type...)} for details.
+ * @param type The object type to create.
+ * @return The parsed object.
+ * @throws ParseException Malformed input encountered.
+ */
+ public final <T> T read(String input, Class<T> type) throws ParseException {
return p.createSession().parse(input, type);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
index ee88303..a72f691 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
@@ -219,7 +219,7 @@
return out;
}
- @SuppressWarnings({ "rawtypes", "unchecked" })
+ @SuppressWarnings({ "rawtypes" })
private Map toMap(HttpPartType partType, ClassMeta<?> type, Object o, HttpPartSchema s) throws SerializeException, SchemaValidationException {
if (s == null)
s = DEFAULT_SCHEMA;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
index e8f1fb7..50e365a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/Parser.java
@@ -627,9 +627,31 @@
* <br>Ignored if the main type is not a map or collection.
* @return The parsed object.
* @throws ParseException Malformed input encountered.
+ * @throws IOException Thrown by underlying stream.
* @see BeanSession#getClassMeta(Type,Type...) for argument syntax for maps and collections.
*/
- public final <T> T parse(Object input, Type type, Type...args) throws ParseException {
+ public final <T> T parse(Object input, Type type, Type...args) throws ParseException, IOException {
+ return createSession().parse(input, type, args);
+ }
+
+ /**
+ * Same as {@link #parse(Object, Type, Type...)} but since it's a {@link String} input doesn't throw an {@link IOException}.
+ *
+ * @param <T> The class type of the object being created.
+ * @param input
+ * The input.
+ * See {@link #parse(Object, Type, Type...)} for details.
+ * @param type
+ * The object type to create.
+ * <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}
+ * @param args
+ * The type arguments of the class if it's a collection or map.
+ * <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}
+ * <br>Ignored if the main type is not a map or collection.
+ * @return The parsed object.
+ * @throws ParseException Malformed input encountered.
+ */
+ public final <T> T parse(String input, Type type, Type...args) throws ParseException {
return createSession().parse(input, type, args);
}
@@ -666,8 +688,24 @@
* @param type The object type to create.
* @return The parsed object.
* @throws ParseException Malformed input encountered.
+ * @throws IOException Thrown by the underlying stream.
*/
- public final <T> T parse(Object input, Class<T> type) throws ParseException {
+ public final <T> T parse(Object input, Class<T> type) throws ParseException, IOException {
+ return createSession().parse(input, type);
+ }
+
+ /**
+ * Same as {@link #parse(Object, Class)} but since it's a {@link String} input doesn't throw an {@link IOException}.
+ *
+ * @param <T> The class type of the object being created.
+ * @param input
+ * The input.
+ * See {@link #parse(Object, Type, Type...)} for details.
+ * @param type The object type to create.
+ * @return The parsed object.
+ * @throws ParseException Malformed input encountered.
+ */
+ public final <T> T parse(String input, Class<T> type) throws ParseException {
return createSession().parse(input, type);
}
@@ -685,8 +723,24 @@
* @param type The object type to create.
* @return The parsed object.
* @throws ParseException Malformed input encountered.
+ * @throws IOException Thrown by the underlying stream.
*/
- public final <T> T parse(Object input, ClassMeta<T> type) throws ParseException {
+ public final <T> T parse(Object input, ClassMeta<T> type) throws ParseException, IOException {
+ return createSession().parse(input, type);
+ }
+
+ /**
+ * Same as {@link #parse(Object, ClassMeta)} but since it's a {@link String} input doesn't throw an {@link IOException}.
+ *
+ * @param <T> The class type of the object being created.
+ * @param input
+ * The input.
+ * See {@link #parse(Object, Type, Type...)} for details.
+ * @param type The object type to create.
+ * @return The parsed object.
+ * @throws ParseException Malformed input encountered.
+ */
+ public final <T> T parse(String input, ClassMeta<T> type) throws ParseException {
return createSession().parse(input, type);
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSession.java
index d7f198f..ff5e946 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/parser/ParserSession.java
@@ -390,15 +390,61 @@
* @return The parsed object.
* @throws ParseException Malformed input encountered.
* @see BeanSession#getClassMeta(Type,Type...) for argument syntax for maps and collections.
+ * @throws IOException Thrown by the underlying stream.
*/
@SuppressWarnings("unchecked")
- public final <T> T parse(Object input, Type type, Type...args) throws ParseException {
+ public final <T> T parse(Object input, Type type, Type...args) throws ParseException, IOException {
try (ParserPipe pipe = createPipe(input)) {
return (T)parseInner(pipe, getClassMeta(type, args));
}
}
/**
+ * Same as {@link #parse(Object,Type,Type...)} but parses from a string and doesn't throw an {@link IOException}.
+ *
+ * @param <T> The class type of the object to create.
+ * @param input
+ * The input.
+ * <br>Character-based parsers can handle the following input class types:
+ * <ul>
+ * <li><jk>null</jk>
+ * <li>{@link Reader}
+ * <li>{@link CharSequence}
+ * <li>{@link InputStream} containing UTF-8 encoded text (or charset defined by
+ * {@link ReaderParser#RPARSER_streamCharset} property value).
+ * <li><code><jk>byte</jk>[]</code> containing UTF-8 encoded text (or charset defined by
+ * {@link ReaderParser#RPARSER_streamCharset} property value).
+ * <li>{@link File} containing system encoded text (or charset defined by
+ * {@link ReaderParser#RPARSER_fileCharset} property value).
+ * </ul>
+ * <br>Stream-based parsers can handle the following input class types:
+ * <ul>
+ * <li><jk>null</jk>
+ * <li>{@link InputStream}
+ * <li><code><jk>byte</jk>[]</code>
+ * <li>{@link File}
+ * </ul>
+ * @param type
+ * The object type to create.
+ * <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}
+ * @param args
+ * The type arguments of the class if it's a collection or map.
+ * <br>Can be any of the following: {@link ClassMeta}, {@link Class}, {@link ParameterizedType}, {@link GenericArrayType}
+ * <br>Ignored if the main type is not a map or collection.
+ * @return The parsed object.
+ * @throws ParseException Malformed input encountered.
+ * @see BeanSession#getClassMeta(Type,Type...) for argument syntax for maps and collections.
+ */
+ @SuppressWarnings("unchecked")
+ public final <T> T parse(String input, Type type, Type...args) throws ParseException {
+ try (ParserPipe pipe = createPipe(input)) {
+ return (T)parseInner(pipe, getClassMeta(type, args));
+ } catch (IOException e) {
+ throw new ParseException(e); // Shouldn't happen.
+ }
+ }
+
+ /**
* Same as {@link #parse(Object, Type, Type...)} except optimized for a non-parameterized class.
*
* <p>
@@ -431,14 +477,57 @@
* @param type The object type to create.
* @return The parsed object.
* @throws ParseException Malformed input encountered.
+ * @throws IOException Thrown by the underlying stream.
*/
- public final <T> T parse(Object input, Class<T> type) throws ParseException {
+ public final <T> T parse(Object input, Class<T> type) throws ParseException, IOException {
try (ParserPipe pipe = createPipe(input)) {
return parseInner(pipe, getClassMeta(type));
}
}
/**
+ * Same as {@link #parse(Object, Class)} but parses from a string and doesn't throw an {@link IOException}.
+ *
+ * <p>
+ * This is the preferred parse method for simple types since you don't need to cast the results.
+ *
+ * <h5 class='section'>Examples:</h5>
+ * <p class='bcode w800'>
+ * ReaderParser p = JsonParser.<jsf>DEFAULT</jsf>;
+ *
+ * <jc>// Parse into a string.</jc>
+ * String s = p.parse(json, String.<jk>class</jk>);
+ *
+ * <jc>// Parse into a bean.</jc>
+ * MyBean b = p.parse(json, MyBean.<jk>class</jk>);
+ *
+ * <jc>// Parse into a bean array.</jc>
+ * MyBean[] ba = p.parse(json, MyBean[].<jk>class</jk>);
+ *
+ * <jc>// Parse into a linked-list of objects.</jc>
+ * List l = p.parse(json, LinkedList.<jk>class</jk>);
+ *
+ * <jc>// Parse into a map of object keys/values.</jc>
+ * Map m = p.parse(json, TreeMap.<jk>class</jk>);
+ * </p>
+ *
+ * @param <T> The class type of the object being created.
+ * @param input
+ * The input.
+ * See {@link #parse(Object, Type, Type...)} for details.
+ * @param type The object type to create.
+ * @return The parsed object.
+ * @throws ParseException Malformed input encountered.
+ */
+ public final <T> T parse(String input, Class<T> type) throws ParseException {
+ try (ParserPipe pipe = createPipe(input)) {
+ return parseInner(pipe, getClassMeta(type));
+ } catch (IOException e) {
+ throw new ParseException(e); // Shouldn't happen.
+ }
+ }
+
+ /**
* Same as {@link #parse(Object, Type, Type...)} except the type has already been converted into a {@link ClassMeta}
* object.
*
@@ -452,14 +541,37 @@
* @param type The object type to create.
* @return The parsed object.
* @throws ParseException Malformed input encountered.
+ * @throws IOException Thrown by the underlying stream.
*/
- public final <T> T parse(Object input, ClassMeta<T> type) throws ParseException {
+ public final <T> T parse(Object input, ClassMeta<T> type) throws ParseException, IOException {
try (ParserPipe pipe = createPipe(input)) {
return parseInner(pipe, type);
}
}
/**
+ * Same as {@link #parse(Object, ClassMeta)} except parses from a string and doesn't throw an {@link IOException}.
+ *
+ * <p>
+ * This is mostly an internal method used by the framework.
+ *
+ * @param <T> The class type of the object being created.
+ * @param input
+ * The input.
+ * See {@link #parse(Object, Type, Type...)} for details.
+ * @param type The object type to create.
+ * @return The parsed object.
+ * @throws ParseException Malformed input encountered.
+ */
+ public final <T> T parse(String input, ClassMeta<T> type) throws ParseException {
+ try (ParserPipe pipe = createPipe(input)) {
+ return parseInner(pipe, type);
+ } catch (IOException e) {
+ throw new ParseException(e); // Shouldn't happen.
+ }
+ }
+
+ /**
* Entry point for all parsing calls.
*
* <p>
@@ -471,19 +583,17 @@
* @param <T> The class type of the object to create.
* @return The parsed object.
* @throws ParseException Malformed input encountered.
+ * @throws IOException Thrown by the underlying stream.
*/
- private <T> T parseInner(ParserPipe pipe, ClassMeta<T> type) throws ParseException {
+ private <T> T parseInner(ParserPipe pipe, ClassMeta<T> type) throws ParseException, IOException {
if (type.isVoid())
return null;
try {
return doParse(pipe, type);
- } catch (ParseException e) {
+ } catch (ParseException | IOException e) {
throw e;
} catch (StackOverflowError e) {
throw new ParseException(this, "Depth too deep. Stack overflow occurred.");
- } catch (IOException e) {
- throw new ParseException(this, e, "I/O exception occurred. exception={0}, message={1}.",
- e.getClass().getSimpleName(), e.getLocalizedMessage());
} catch (Exception e) {
throw new ParseException(this, e, "Exception occurred. exception={0}, message={1}.",
e.getClass().getSimpleName(), e.getLocalizedMessage());
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/pojotools/PojoSearcher.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/pojotools/PojoSearcher.java
index 286e5b8..a2e5a9d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/pojotools/PojoSearcher.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/pojotools/PojoSearcher.java
@@ -95,7 +95,6 @@
Map<String,ColumnMatcher> entryMatchers = new HashMap<>();
BeanSession bs;
- @SuppressWarnings("unchecked")
RowMatcher(BeanSession bs, Map query) {
this.bs = bs;
for (Map.Entry e : (Set<Map.Entry>)query.entrySet())
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializerSession.java
index cef7fc9..7a2e01c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializerSession.java
@@ -79,7 +79,11 @@
@Override /* SerializerSession */
public final byte[] serialize(Object o) throws SerializeException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- serialize(o, baos);
+ try {
+ serialize(o, baos);
+ } catch (IOException e) {
+ throw new SerializeException(e); // Should never happen.
+ }
return baos.toByteArray();
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
index 78daa12..7181ef9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
@@ -793,8 +793,9 @@
* <li>{@link File}
* </ul>
* @throws SerializeException If a problem occurred trying to convert the output.
+ * @throws IOException Thrown by the underlying stream.
*/
- public final void serialize(Object o, Object output) throws SerializeException {
+ public final void serialize(Object o, Object output) throws SerializeException, IOException {
createSession().serialize(o, output);
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
index e1036b1..455a175 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
@@ -209,11 +209,12 @@
* @param out Where to send the output from the serializer.
* @param o The object to serialize.
* @throws SerializeException If a problem occurred trying to convert the output.
+ * @throws IOException Thrown by the underlying stream.
*/
- public final void serialize(Object o, Object out) throws SerializeException {
+ public final void serialize(Object o, Object out) throws SerializeException, IOException {
try (SerializerPipe pipe = createPipe(out)) {
doSerialize(pipe, o);
- } catch (SerializeException e) {
+ } catch (SerializeException | IOException e) {
throw e;
} catch (StackOverflowError e) {
throw new SerializeException(this,
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializerSession.java
index ed74a48..fd19a37 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializerSession.java
@@ -91,7 +91,11 @@
@Override /* SerializerSession */
public final String serialize(Object o) throws SerializeException {
StringWriter w = new StringWriter();
- serialize(o, w);
+ try {
+ serialize(o, w);
+ } catch (IOException e) {
+ throw new SerializeException(e); // Shouldn't happen.
+ }
return w.toString();
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java
index 81dac6d..f74785a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java
@@ -36,7 +36,6 @@
*
* @return A new var resolver.
*/
- @SuppressWarnings("unchecked")
public VarResolver build() {
return new VarResolver(vars.toArray(new Class[vars.size()]), contextObjects);
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/ProcBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/ProcBuilder.java
index 7d90b07..a238fd3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/ProcBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/ProcBuilder.java
@@ -247,7 +247,7 @@
* @param env The new set of environment variables.
* @return This object (for method chaining).
*/
- @SuppressWarnings({"rawtypes", "unchecked"})
+ @SuppressWarnings({"rawtypes"})
public ProcBuilder env(Map env) {
if (env != null)
for (Map.Entry e : (Set<Map.Entry>)env.entrySet())
diff --git a/juneau-doc/docs/ReleaseNotes/8.0.1.html b/juneau-doc/docs/ReleaseNotes/8.0.1.html
index d7c389c..f6cb642 100644
--- a/juneau-doc/docs/ReleaseNotes/8.0.1.html
+++ b/juneau-doc/docs/ReleaseNotes/8.0.1.html
@@ -54,6 +54,9 @@
<li class='jm'>{@link oaj.marshall.Marshall#err(String,Object...)} - Prints <c>MessageFormat</c>-style messages to STDERR.
</ul>
</ul>
+ <li>
+ Serializer and parser APIs now throw <c>IOExceptions</c> in addition to <c>SerializeException</c> and <c>ParseException</c> to make it
+ easier to determine if problems are stream based or syntax based.
</ul>
<h5 class='topic w800'>juneau-config</h5>
diff --git a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/petstore/PetStoreService.java b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/petstore/PetStoreService.java
index e24d1da..19f3e17 100644
--- a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/petstore/PetStoreService.java
+++ b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/petstore/PetStoreService.java
@@ -49,8 +49,9 @@
* @param w Console output.
* @return This object (for method chaining).
* @throws ParseException Malformed input encountered.
+ * @throws IOException File could not be read from file system.
*/
- public PetStoreService initDirect(PrintWriter w) throws ParseException {
+ public PetStoreService initDirect(PrintWriter w) throws ParseException, IOException {
EntityManager em = getEntityManager();
EntityTransaction et = em.getTransaction();
diff --git a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/ConfigResource.java b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/ConfigResource.java
index b35d0d8..e2bbefc 100644
--- a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/ConfigResource.java
+++ b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/ConfigResource.java
@@ -24,7 +24,7 @@
@RestResource(
path="/testConfig"
)
-@SuppressWarnings({"serial","javadoc"})
+@SuppressWarnings({"serial"})
public class ConfigResource extends BasicRestServlet {
@RestMethod(name=GET, path="/")
diff --git a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/Root.java b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/Root.java
index 1a88d23..5847a92 100644
--- a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/Root.java
+++ b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/Root.java
@@ -33,7 +33,6 @@
ShutdownResource.class,
}
)
-@SuppressWarnings("javadoc")
public class Root extends BasicRestServlet {
private static final long serialVersionUID = 1L;
diff --git a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/_TestSuite.java b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/_TestSuite.java
index 2c434ec..e1da651 100644
--- a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/_TestSuite.java
+++ b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/_TestSuite.java
@@ -35,7 +35,6 @@
RestClientTest.class,
ThirdPartyProxyTest.class,
})
-@SuppressWarnings("javadoc")
public class _TestSuite {
@BeforeClass
diff --git a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/CallbackStringsTest.java b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/CallbackStringsTest.java
index 9885f52..45db140 100644
--- a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/CallbackStringsTest.java
+++ b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/CallbackStringsTest.java
@@ -25,7 +25,6 @@
import org.junit.*;
import org.junit.runners.*;
-@SuppressWarnings("javadoc")
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class CallbackStringsTest {
diff --git a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/ClientFuturesTest.java b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/ClientFuturesTest.java
index 9c861a9..ec548e1 100644
--- a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/ClientFuturesTest.java
+++ b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/ClientFuturesTest.java
@@ -25,7 +25,6 @@
import org.junit.*;
import org.junit.runners.*;
-@SuppressWarnings("javadoc")
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ClientFuturesTest {
diff --git a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/FormDataTest.java b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/FormDataTest.java
index 7c50b7b..89e2b38 100644
--- a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/FormDataTest.java
+++ b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/FormDataTest.java
@@ -30,7 +30,6 @@
/**
* Tests client-side form posts.
*/
-@SuppressWarnings("javadoc")
public class FormDataTest extends RestTestcase {
//=================================================================================================================
diff --git a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/RequestBeanProxyTest.java b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/RequestBeanProxyTest.java
index b3fa415..fe65ba2 100644
--- a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/RequestBeanProxyTest.java
+++ b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/RequestBeanProxyTest.java
@@ -39,7 +39,6 @@
import org.junit.runners.*;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-@SuppressWarnings("javadoc")
public class RequestBeanProxyTest {
//=================================================================================================================
diff --git a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/RestClientResource.java b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/RestClientResource.java
index 0ac63f1..fb98415 100644
--- a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/RestClientResource.java
+++ b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/RestClientResource.java
@@ -22,7 +22,6 @@
/**
* JUnit automated testcase resource.
*/
-@SuppressWarnings("javadoc")
@RestResource(
path="/testRestClient"
)
diff --git a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/ThirdPartyProxyResource.java b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/ThirdPartyProxyResource.java
index 17a7a66..3db48e1 100644
--- a/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/ThirdPartyProxyResource.java
+++ b/juneau-microservice/juneau-microservice-ftest/src/test/java/org/apache/juneau/rest/test/client/ThirdPartyProxyResource.java
@@ -41,7 +41,7 @@
path="/testThirdPartyProxy"
)
@SerializerConfig(addRootType="true",addBeanTypes="true")
-@SuppressWarnings({"serial","javadoc"})
+@SuppressWarnings({"serial"})
public class ThirdPartyProxyResource extends BasicRestServletJena {
public static FileWriter logFile;
diff --git a/juneau-sc/juneau-sc-server/src/main/java/org/apache/juneau/server/config/repository/GetConfiguration.java b/juneau-sc/juneau-sc-server/src/main/java/org/apache/juneau/server/config/repository/GetConfiguration.java
index df93eaf..e01be54 100644
--- a/juneau-sc/juneau-sc-server/src/main/java/org/apache/juneau/server/config/repository/GetConfiguration.java
+++ b/juneau-sc/juneau-sc-server/src/main/java/org/apache/juneau/server/config/repository/GetConfiguration.java
@@ -27,7 +27,7 @@
private static final String EXT = ".cfg";
private static final String BAR = "/";
- private Map<String, ConfigItem> configs = new HashMap<String, ConfigItem>();
+ private Map<String, ConfigItem> configs = new HashMap<>();
private String project;
private String branch;
diff --git a/juneau-sc/juneau-sc-server/src/main/java/org/apache/juneau/server/config/repository/GitControl.java b/juneau-sc/juneau-sc-server/src/main/java/org/apache/juneau/server/config/repository/GitControl.java
index 8ad3240..7782681 100644
--- a/juneau-sc/juneau-sc-server/src/main/java/org/apache/juneau/server/config/repository/GitControl.java
+++ b/juneau-sc/juneau-sc-server/src/main/java/org/apache/juneau/server/config/repository/GitControl.java
@@ -40,7 +40,7 @@
import org.eclipse.jgit.transport.PushResult;
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
-@SuppressWarnings("javadoc")
+@SuppressWarnings({"javadoc","unused"})
public class GitControl {
private String localPath, remotePath;
diff --git a/launches/juneau-apply-prefs.sh b/launches/juneau-apply-prefs.sh
index 419e367..f0b2129 100755
--- a/launches/juneau-apply-prefs.sh
+++ b/launches/juneau-apply-prefs.sh
@@ -14,7 +14,6 @@
projects=(
"juneau-core/juneau-config"
-"juneau-core/juneau-core-utest"
"juneau-core/juneau-dto"
"juneau-core/juneau-marshall"
"juneau-core/juneau-marshall-rdf"
@@ -23,22 +22,17 @@
"juneau-examples/juneau-examples-core"
"juneau-examples/juneau-examples-rest"
"juneau-examples/juneau-examples-rest-jetty"
-"juneau-examples/juneau-examples-rest-jetty-ftest"
"juneau-examples/juneau-examples-rest-springboot"
"juneau-microservice/juneau-microservice-core"
-"juneau-microservice/juneau-microservice-ftest"
"juneau-microservice/juneau-microservice-jetty"
"juneau-microservice/juneau-my-jetty-microservice"
"juneau-microservice/juneau-my-springboot-microservice"
"juneau-rest/juneau-rest-client"
-"juneau-rest/juneau-rest-client-utest"
"juneau-rest/juneau-rest-mock"
-"juneau-rest/juneau-rest-mock-utest"
"juneau-rest/juneau-rest-server"
"juneau-rest/juneau-rest-server-jaxrs"
"juneau-rest/juneau-rest-server-rdf"
"juneau-rest/juneau-rest-server-springboot"
-"juneau-rest/juneau-rest-server-utest"
"juneau-sc/juneau-sc-client"
"juneau-sc/juneau-sc-server"
)
@@ -46,8 +40,23 @@
for i in "${projects[@]}"
do
echo Preferences applied to $i
- cp eclipse-preferences/org.eclipse.jdt.core.prefs $i/.settings
- cp eclipse-preferences/org.eclipse.jdt.ui.prefs $i/.settings
+ cp eclipse-preferences/source-prefs/org.eclipse.jdt.core.prefs $i/.settings
+ cp eclipse-preferences/source-prefs/org.eclipse.jdt.ui.prefs $i/.settings
done
+projects=(
+"juneau-core/juneau-core-utest"
+"juneau-examples/juneau-examples-rest-jetty-ftest"
+"juneau-microservice/juneau-microservice-ftest"
+"juneau-rest/juneau-rest-client-utest"
+"juneau-rest/juneau-rest-mock-utest"
+"juneau-rest/juneau-rest-server-utest"
+)
+
+for i in "${projects[@]}"
+do
+ echo Preferences applied to $i
+ cp eclipse-preferences/test-prefs/org.eclipse.jdt.core.prefs $i/.settings
+ cp eclipse-preferences/test-prefs/org.eclipse.jdt.ui.prefs $i/.settings
+done
diff --git a/pom.xml b/pom.xml
index b7ec35c..80d402d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -169,6 +169,7 @@
<exclude>**/.project</exclude>
<exclude>**/.classpath</exclude>
<exclude>**/*.launch</exclude>
+ <exclude>**/*.prefs</exclude>
<!-- Overlay files -->
<exclude>**/*.2</exclude>