Skip to content

Commit

Permalink
8274405: Suppress warnings on non-serializable non-transient instance…
Browse files Browse the repository at this point in the history
… fields in javac and javadoc

Reviewed-by: prappo, jjg
  • Loading branch information
jddarcy committed Sep 29, 2021
1 parent 79cebe2 commit 97385d4
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;

/**
Expand Down

1 comment on commit 97385d4

@openjdk-notifier
Copy link

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.