File tree Expand file tree Collapse file tree
cdap-app-fabric/src/main/java/io/cdap/cdap/internal/app/preview Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 * License for the specific language governing permissions and limitations under
1414 * the License.
1515 */
16+
1617package io .cdap .cdap .internal .app .preview ;
1718
1819import com .google .gson .Gson ;
3031import io .cdap .cdap .proto .id .ApplicationId ;
3132
3233/**
33- * Default implementation of {@link DataTracer}, the data are preserved using {@link PreviewStore}
34+ * Default implementation of {@link DataTracer}, the data are preserved using {@link PreviewStore}.
3435 */
3536class DefaultDataTracer implements DataTracer {
3637
3738 private static final Gson GSON = new GsonBuilder ().registerTypeAdapter (Schema .class ,
3839 new SchemaTypeAdapter ())
40+ // Starting java 9, some java internal modules are private and cannot be used by current
41+ // version of gson. https://cdap.atlassian.net/browse/CDAP-21212
42+ .setExclusionStrategies (new com .google .gson .ExclusionStrategy () {
43+ @ Override
44+ public boolean shouldSkipField (com .google .gson .FieldAttributes f ) {
45+ return false ;
46+ }
47+
48+ @ Override
49+ public boolean shouldSkipClass (Class <?> clazz ) {
50+ String name = clazz .getName ();
51+ return name .startsWith ("java.lang.module" )
52+ || name .startsWith ("jdk.internal" )
53+ || name .startsWith ("sun." );
54+ }
55+ })
3956 .registerTypeAdapter (StructuredRecord .class , new PreviewJsonSerializer ()).create ();
4057
4158 private final String tracerName ;
You can’t perform that action at this time.
0 commit comments