juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [juneau] branch master updated: Remove deprecated code.
Date Tue, 13 Oct 2020 17:14:42 GMT
This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new 43618fe  Remove deprecated code.
43618fe is described below

commit 43618feeb3e860148901cb9d2b4fe9d7dc39144b
Author: JamesBognar <james.bognar@salesforce.com>
AuthorDate: Tue Oct 13 13:14:38 2020 -0400

    Remove deprecated code.
---
 .../apache/juneau/a/rttests/RoundTripMapsTest.java |  2 +-
 .../serializer/SerializerConfigAnnotationTest.java |  2 +-
 .../org/apache/juneau/serializer/Serializer.java   | 56 +---------------------
 .../juneau/serializer/SerializerBuilder.java       | 28 -----------
 .../juneau/serializer/SerializerGroupBuilder.java  | 14 ------
 .../serializer/annotation/SerializerConfig.java    | 32 -------------
 .../annotation/SerializerConfigApply.java          |  3 --
 .../xmlschema/XmlSchemaSerializerBuilder.java      |  6 ---
 8 files changed, 3 insertions(+), 140 deletions(-)

diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripMapsTest.java
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripMapsTest.java
index 44a9ba0..fd40071 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripMapsTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripMapsTest.java
@@ -127,7 +127,7 @@ public class RoundTripMapsTest extends RoundTripTest {
 		r = s.serialize(t);
 		assertEquals(e, r);
 
-		s = UrlEncodingSerializer.create().swaps(getPojoSwaps()).trimNullProperties(false).build();
+		s = UrlEncodingSerializer.create().swaps(getPojoSwaps()).keepNullProperties().build();
 		e = "AQID=a&BAUG=null&null=b";
 		r = s.serialize(t);
 		assertEquals(e, r);
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/SerializerConfigAnnotationTest.java
b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/SerializerConfigAnnotationTest.java
index 83617d1..cb93827 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/SerializerConfigAnnotationTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/SerializerConfigAnnotationTest.java
@@ -65,7 +65,7 @@ public class SerializerConfigAnnotationTest {
 		sortMaps="$X{true}",
 		trimEmptyCollections="$X{true}",
 		trimEmptyMaps="$X{true}",
-		trimNullProperties="$X{true}",
+		keepNullProperties="$X{false}",
 		trimStrings="$X{true}",
 		uriContext="{}",
 		uriRelativity="$X{RESOURCE}",
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 edec8ad..dffaa60 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
@@ -544,60 +544,6 @@ public abstract class Serializer extends BeanTraverseContext {
 	public static final String SERIALIZER_trimEmptyMaps = PREFIX + ".trimEmptyMaps.b";
 
 	/**
-	 * Configuration property:  Trim null bean property values.
-	 *
-	 * <h5 class='section'>Property:</h5>
-	 * <ul class='spaced-list'>
-	 * 	<li><b>ID:</b>  {@link org.apache.juneau.serializer.Serializer#SERIALIZER_trimNullProperties
SERIALIZER_trimNullProperties}
-	 * 	<li><b>Name:</b>  <js>"Serializer.trimNullProperties.b"</js>
-	 * 	<li><b>Data type:</b>  <jk>boolean</jk>
-	 * 	<li><b>System property:</b>  <c>Serializer.trimNullProperties</c>
-	 * 	<li><b>Environment variable:</b>  <c>SERIALIZER_TRIMNULLPROPERTIES</c>
-	 * 	<li><b>Default:</b>  <jk>true</jk>
-	 * 	<li><b>Session property:</b>  <jk>false</jk>
-	 * 	<li><b>Annotations:</b>
-	 * 		<ul>
-	 * 			<li class='ja'>{@link org.apache.juneau.serializer.annotation.SerializerConfig#trimNullProperties()}
-	 * 		</ul>
-	 * 	<li><b>Methods:</b>
-	 * 		<ul>
-	 * 			<li class='jm'>{@link org.apache.juneau.serializer.SerializerBuilder#trimNullProperties(boolean)}
-	 * 			<li class='jm'>{@link org.apache.juneau.serializer.SerializerBuilder#dontTrimNullProperties()}
-	 * 		</ul>
-	 * </ul>
-	 *
-	 * <h5 class='section'>Description:</h5>
-	 *
-	 * <p>
-	 * When enabled, null bean values will not be serialized to the output.
-	 *
-	 * <p>
-	 * Note that enabling this setting has the following effects on parsing:
-	 * <ul class='spaced-list'>
-	 * 	<li>
-	 * 		Map entries with <jk>null</jk> values will be lost.
-	 * </ul>
-	 *
-	 * <h5 class='section'>Example:</h5>
-	 * <p class='bcode w800'>
-	 * 	<jc>// Create a serializer that serializes null properties.</jc>
-	 * 	WriterSerializer s = JsonSerializer
-	 * 		.<jsm>create</jsm>()
-	 * 		.dontTrimNullProperties()
-	 * 		.build();
-	 *
-	 * 	<jc>// Same, but use property.</jc>
-	 * 	WriterSerializer s = JsonSerializer
-	 * 		.<jsm>create</jsm>()
-	 * 		.set(<jsf>SERIALIZER_trimNullProperties</jsf>, <jk>false</jk>)
-	 * 		.build();
-	 * </p>
-	 * @deprecated Use {@link #SERIALIZER_keepNullProperties}
-	 */
-	@Deprecated
-	public static final String SERIALIZER_trimNullProperties = PREFIX + ".trimNullProperties.b";
-
-	/**
 	 * Configuration property:  Trim strings.
 	 *
 	 * <h5 class='section'>Property:</h5>
@@ -881,7 +827,7 @@ public abstract class Serializer extends BeanTraverseContext {
 		super(ps);
 
 		addBeanTypes = getBooleanProperty(SERIALIZER_addBeanTypes, false);
-		keepNullProperties = getBooleanProperty(SERIALIZER_keepNullProperties, ! getBooleanProperty(SERIALIZER_trimNullProperties,
true));
+		keepNullProperties = getBooleanProperty(SERIALIZER_keepNullProperties, false);
 		trimEmptyCollections = getBooleanProperty(SERIALIZER_trimEmptyCollections, false);
 		trimEmptyMaps = getBooleanProperty(SERIALIZER_trimEmptyMaps, false);
 		trimStrings = getBooleanProperty(SERIALIZER_trimStrings, false);
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
index a6c5463..334f614 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
@@ -495,34 +495,6 @@ public class SerializerBuilder extends BeanTraverseBuilder {
 	}
 
 	/**
-	 * <i><l>Serializer</l> configuration property:&emsp;</i>  Trim
null bean property values.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link #keepNullProperties()}
-	 * </div>
-	 */
-	@SuppressWarnings("javadoc")
-	@FluentSetter
-	@Deprecated
-	public SerializerBuilder trimNullProperties(boolean value) {
-		return set(SERIALIZER_trimNullProperties, value);
-	}
-
-	/**
-	 * <i><l>Serializer</l> configuration property:&emsp;</i>  Trim
null bean property values.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link #keepNullProperties()}
-	 * </div>
-	 */
-	@SuppressWarnings("javadoc")
-	@FluentSetter
-	@Deprecated
-	public SerializerBuilder dontTrimNullProperties() {
-		return set(SERIALIZER_trimNullProperties, false);
-	}
-
-	/**
 	 * <i><l>Serializer</l> configuration property:&emsp;</i>  Trim
strings.
 	 *
 	 * <div class='warn'>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
index d34363c..76a12cd 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
@@ -371,20 +371,6 @@ public class SerializerGroupBuilder extends BeanTraverseBuilder {
 	}
 
 	/**
-	 * Configuration property:  Trim null bean property values.
-	 *
-	 * <div class='warn'>
-	 * 	<b>Deprecated</b> - Use {@link #keepNullProperties()}
-	 * </div>
-	 */
-	@SuppressWarnings("javadoc")
-	@FluentSetter
-	@Deprecated
-	public SerializerGroupBuilder trimNullProperties(boolean value) {
-		return set(SERIALIZER_trimNullProperties, value);
-	}
-
-	/**
 	 * Configuration property:  Trim strings.
 	 *
 	 * <div class='warn'>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfig.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfig.java
index 8d18ea0..09923f0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfig.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfig.java
@@ -303,38 +303,6 @@ public @interface SerializerConfig {
 	String trimEmptyMaps() default "";
 
 	/**
-	 * Configuration property:  Trim null bean property values.
-	 *
-	 * <p>
-	 * If <js>"true"</js>, null bean values will not be serialized to the output.
-	 *
-	 * <p>
-	 * Note that enabling this setting has the following effects on parsing:
-	 * <ul class='spaced-list'>
-	 * 	<li>
-	 * 		Map entries with <jk>null</jk> values will be lost.
-	 * </ul>
-	 *
-	 * <ul class='notes'>
-	 * 	<li>
-	 * 		Possible values:
-	 * 		<ul>
-	 * 			<li><js>"true"</js> (default)
-	 * 			<li><js>"false"</js>
-	 * 		</ul>
-	 * 	<li>
-	 * 		Supports {@doc DefaultVarResolver} (e.g. <js>"$C{myConfigVar}"</js>).
-	 * </ul>
-	 *
-	 * <ul class='seealso'>
-	 * 	<li class='jf'>{@link Serializer#SERIALIZER_trimNullProperties}
-	 * </ul>
-	 * @deprecated Use {@link #keepNullProperties()}
-	 */
-	@Deprecated
-	String trimNullProperties() default "";
-
-	/**
 	 * Configuration property:  Trim strings.
 	 *
 	 * <p>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfigApply.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfigApply.java
index 9b0718a..353838f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfigApply.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfigApply.java
@@ -38,7 +38,6 @@ public class SerializerConfigApply extends ConfigApply<SerializerConfig>
{
 		super(c, r);
 	}
 
-	@SuppressWarnings("deprecation")
 	@Override
 	public void apply(AnnotationInfo<SerializerConfig> ai, PropertyStoreBuilder psb) {
 		SerializerConfig a = ai.getAnnotation();
@@ -58,8 +57,6 @@ public class SerializerConfigApply extends ConfigApply<SerializerConfig>
{
 			psb.set(SERIALIZER_trimEmptyCollections, bool(a.trimEmptyCollections()));
 		if (! a.trimEmptyMaps().isEmpty())
 			psb.set(SERIALIZER_trimEmptyMaps, bool(a.trimEmptyMaps()));
-		if (! a.trimNullProperties().isEmpty())
-			psb.set(SERIALIZER_trimNullProperties, bool(a.trimNullProperties()));
 		if (! a.trimStrings().isEmpty())
 			psb.set(SERIALIZER_trimStrings, bool(a.trimStrings()));
 		if (! a.uriContext().isEmpty())
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xmlschema/XmlSchemaSerializerBuilder.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xmlschema/XmlSchemaSerializerBuilder.java
index cc82089..8df732b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xmlschema/XmlSchemaSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xmlschema/XmlSchemaSerializerBuilder.java
@@ -261,12 +261,6 @@ public class XmlSchemaSerializerBuilder extends XmlSerializerBuilder
{
 	}
 
 	@Override /* SerializerBuilder */
-	public XmlSchemaSerializerBuilder trimNullProperties(boolean value) {
-		super.trimNullProperties(value);
-		return this;
-	}
-
-	@Override /* SerializerBuilder */
 	public XmlSchemaSerializerBuilder trimStrings(boolean value) {
 		super.trimStrings(value);
 		return this;


Mime
View raw message