Skip to content

Commit

Permalink
8259439: Apply java.io.Serial annotations in java.datatransfer
Browse files Browse the repository at this point in the history
Reviewed-by: aivanov, pbansal, trebari, darcy
  • Loading branch information
mrserb committed Jan 11, 2021
1 parent 712ea25 commit ff54b77
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 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 @@ -35,6 +35,7 @@
import java.io.ObjectOutput;
import java.io.OptionalDataException;
import java.io.Reader;
import java.io.Serial;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
Expand Down Expand Up @@ -111,6 +112,10 @@
*/
public class DataFlavor implements Externalizable, Cloneable {

/**
* Use serialVersionUID from JDK 1.2 for interoperability.
*/
@Serial
private static final long serialVersionUID = 8367026044764648243L;
private static final Class<InputStream> ioInputStreamClass = InputStream.class;

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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 All @@ -25,6 +25,7 @@

package java.awt.datatransfer;

import java.io.Serial;
import java.util.EventObject;

/**
Expand All @@ -37,6 +38,10 @@
*/
public class FlavorEvent extends EventObject {

/**
* Use serialVersionUID from JDK 1.5 for interoperability.
*/
@Serial
private static final long serialVersionUID = -5842664112252414548L;

/**
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serial;
import java.util.Locale;

/**
Expand All @@ -41,11 +42,11 @@
*/
class MimeType implements Externalizable, Cloneable {

/*
* serialization support
/**
* Use serialVersionUID from JDK 1.2 for interoperability.
*/

static final long serialVersionUID = -6568722458793895906L;
@Serial
private static final long serialVersionUID = -6568722458793895906L;

/**
* Constructor for externalization; this constructor should not be called
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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 All @@ -25,6 +25,8 @@

package java.awt.datatransfer;

import java.io.Serial;

/**
* A class to encapsulate MimeType parsing related exceptions.
*
Expand All @@ -33,7 +35,10 @@
*/
public class MimeTypeParseException extends Exception {

// use serialVersionUID from JDK 1.2.2 for interoperability
/**
* Use serialVersionUID from JDK 1.2.2 for interoperability.
*/
@Serial
private static final long serialVersionUID = -5604407764691570741L;

/**
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 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 All @@ -25,6 +25,8 @@

package java.awt.datatransfer;

import java.io.Serial;

/**
* Signals that the requested data is not supported in this flavor.
*
Expand All @@ -34,9 +36,10 @@
*/
public class UnsupportedFlavorException extends Exception {

/*
* JDK 1.1 serialVersionUID
/**
* Use serialVersionUID from JDK 1.1 for interoperability.
*/
@Serial
private static final long serialVersionUID = 5383814944251665601L;

/**
Expand Down

1 comment on commit ff54b77

@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.