Skip to content
Permalink
Browse files
8274405: Suppress warnings on non-serializable non-transient instance…
… fields in javac and javadoc

Reviewed-by: prappo, jjg
  • Loading branch information
jddarcy committed Sep 29, 2021
1 parent 79cebe2 commit 97385d4f166fbd63a7c91d2ee28b5ed75cb02518
Showing 12 changed files with 22 additions and 10 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -64,6 +64,7 @@ public static DocTreePath getPath(DocTreePath path, DocTree target) {

class Result extends Error {
static final long serialVersionUID = -5942088234594905625L;
@SuppressWarnings("serial") // Type of field is not Serializable
DocTreePath path;
Result(DocTreePath path) {
this.path = path;
@@ -63,6 +63,7 @@ public static TreePath getPath(TreePath path, Tree target) {

class Result extends Error {
static final long serialVersionUID = -5942088234594905625L;
@SuppressWarnings("serial") // Type of field is not Serializable
TreePath path;
Result(TreePath path) {
this.path = path;
@@ -805,6 +805,7 @@ public static Env<AttrContext> scopeFor(List<JCTree> path) {
public static List<JCTree> pathFor(final JCTree node, final JCCompilationUnit unit) {
class Result extends Error {
static final long serialVersionUID = -5942088234594905625L;
@SuppressWarnings("serial") // List not statically Serilizable
List<JCTree> path;
Result(List<JCTree> path) {
this.path = path;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,6 +49,7 @@
import com.sun.tools.javac.util.Assert;
import com.sun.tools.javac.util.StringUtils;

@SuppressWarnings("serial") // Types of instance fields are not Serializable
public class PubApi implements Serializable {

private static final long serialVersionUID = 5926627347801986850L;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
import java.util.List;
import java.util.stream.Collectors;

@SuppressWarnings("serial") // Types of instance fields are not Serializable
public class PubApiTypeParam implements Serializable {

private static final long serialVersionUID = 8899204612014329162L;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@

import javax.lang.model.element.Modifier;

@SuppressWarnings("serial") // Types of instance fields are not Serializable
public class PubMethod implements Serializable {

private static final long serialVersionUID = -7813050194553446243L;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@

import javax.lang.model.element.Modifier;

@SuppressWarnings("serial") // Types of instance fields are not Serializable
public class PubType implements Serializable {

private static final long serialVersionUID = -7423416049253889793L;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@

import javax.lang.model.element.Modifier;

@SuppressWarnings("serial") // Types of instance fields are not Serializable
public class PubVar implements Serializable {

private static final long serialVersionUID = 5806536061153374575L;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,7 @@
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
@SuppressWarnings("serial") // Types of instance fields are not Serializable
public class CompilationSubResult implements Serializable {

static final long serialVersionUID = 46739181113L;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,7 @@ public enum Mode {
/**
* The file that was in use when the exception occurred.
*/
@SuppressWarnings("serial") // Type of field is not Serializable
public final DocFile fileName;

/**
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,7 @@ public class ResourceIOException extends DocletException {
/**
* The resource that was in use when the exception occurred.
*/
@SuppressWarnings("serial") // Type of field is not Serializable
public final DocPath resource;

private static final long serialVersionUID = 1L;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@ class OptionException extends Exception {

public final Result result;
public final String message;
@SuppressWarnings("serial") // Type of field is not Serializable
public final Runnable m;

/**

1 comment on commit 97385d4

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 97385d4 Sep 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.