Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8259439: Apply java.io.Serial annotations in java.datatransfer
Reviewed-by: aivanov, pbansal, trebari, darcy
  • Loading branch information
mrserb committed Jan 11, 2021
1 parent 712ea25 commit ff54b77b768d65b69d808d13ea14c528356fae4e
@@ -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
@@ -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;
@@ -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;

@@ -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
@@ -25,6 +25,7 @@

package java.awt.datatransfer;

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

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

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

/**
@@ -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
@@ -29,6 +29,7 @@
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serial;
import java.util.Locale;

/**
@@ -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
@@ -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
@@ -25,6 +25,8 @@

package java.awt.datatransfer;

import java.io.Serial;

/**
* A class to encapsulate MimeType parsing related exceptions.
*
@@ -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;

/**
@@ -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
@@ -25,6 +25,8 @@

package java.awt.datatransfer;

import java.io.Serial;

/**
* Signals that the requested data is not supported in this flavor.
*
@@ -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;

/**

0 comments on commit ff54b77

Please sign in to comment.