Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2018, 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,10 +25,24 @@

package com.sun.beans.editors;

import java.awt.*;
import java.beans.*;
import java.awt.Canvas;
import java.awt.Choice;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Event;
import java.awt.Panel;
import java.awt.TextField;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyEditor;
import java.io.Serial;

public class ColorEditor extends Panel implements PropertyEditor {

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

@SuppressWarnings("deprecation")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2018, 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,10 +25,25 @@

package com.sun.beans.editors;

import java.awt.*;
import java.beans.*;
import java.awt.Choice;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Event;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Label;
import java.awt.Panel;
import java.awt.Toolkit;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serial;

public class FontEditor extends Panel implements java.beans.PropertyEditor {

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

@SuppressWarnings("deprecation")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 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 @@ -22,9 +22,17 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package com.sun.beans.finder;

import java.io.Serial;

final class SignatureException extends RuntimeException {

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

SignatureException(Throwable cause) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 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 @@ -22,15 +22,22 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package com.sun.imageio.plugins.common;

import java.awt.color.ColorSpace;
import java.io.Serial;

/**
* Singleton class representing a simple, mathematically defined CMYK
* color space.
*/
public final class SimpleCMYKColorSpace extends ColorSpace {

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

private static ColorSpace theInstance = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 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 @@ -26,6 +26,7 @@
package com.sun.media.sound;

import java.io.IOException;
import java.io.Serial;

/**
* This exception is used when a file contains illegal or unexpected data.
Expand All @@ -34,6 +35,10 @@
*/
public class InvalidDataException extends IOException {

/**
* Use serialVersionUID from JDK 1.7 for interoperability.
*/
@Serial
private static final long serialVersionUID = 1L;
Comment on lines +38 to 42
Copy link
Member

Choose a reason for hiding this comment

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

This is the standard wording, yet should it mention the serialization is between the same versions only because the value of serialVersionUID is not unique?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is "quite" unique, the "1L" is used from the beginning. It is just different from the value which could be generated by the "serialver" but still should work fine.

Copy link
Member

Choose a reason for hiding this comment

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

Okay. There are several classes which extend this one, all of them use the same 1L value which makes it not "quite" unique.

Changing the values at this time presents more risks than benefits.


public InvalidDataException() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 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 com.sun.media.sound;

import java.io.Serial;

/**
* This exception is used when a reader is used to read file of a format
* it doesn't unterstand or support.
Expand All @@ -33,6 +35,10 @@
*/
public class InvalidFormatException extends InvalidDataException {

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

public InvalidFormatException() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 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,13 +25,19 @@

package com.sun.media.sound;

import java.io.Serial;

/**
* This exception is used when a RIFF file contains illegal or unexpected data.
*
* @author Karl Helgason
*/
public final class RIFFInvalidDataException extends InvalidDataException {

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

public RIFFInvalidDataException() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 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 com.sun.media.sound;

import java.io.Serial;

/**
* This exception is used when a reader is used to read RIFF file of a format it
* doesn't unterstand or support.
Expand All @@ -33,6 +35,10 @@
*/
public final class RIFFInvalidFormatException extends InvalidFormatException {

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

public RIFFInvalidFormatException() {
Expand Down
6 changes: 5 additions & 1 deletion src/java.desktop/share/classes/java/applet/Applet.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 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 @@ -34,6 +34,7 @@
import java.awt.event.ComponentEvent;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serial;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Locale;
Expand Down Expand Up @@ -94,6 +95,7 @@ public Applet() throws HeadlessException {
/**
* Use serialVersionUID from JDK 1.0 for interoperability.
*/
@Serial
private static final long serialVersionUID = -5836846270535785031L;

/**
Expand All @@ -109,6 +111,7 @@ public Applet() throws HeadlessException {
* @see java.awt.GraphicsEnvironment#isHeadless
* @since 1.4
*/
@Serial
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException, HeadlessException {
if (GraphicsEnvironment.isHeadless()) {
Expand Down Expand Up @@ -579,6 +582,7 @@ protected class AccessibleApplet extends AccessibleAWTPanel {
/**
* Use serialVersionUID from JDK 1.3 for interoperability.
*/
@Serial
private static final long serialVersionUID = 8127374778187708896L;

/**
Expand Down
9 changes: 6 additions & 3 deletions src/java.desktop/share/classes/java/awt/AWTError.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 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,16 +25,19 @@

package java.awt;

import java.io.Serial;

/**
* Thrown when a serious Abstract Window Toolkit error has occurred.
*
* @author Arthur van Hoff
*/
public class AWTError extends Error {

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

/**
Expand Down
8 changes: 5 additions & 3 deletions src/java.desktop/share/classes/java/awt/AWTEvent.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, 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 @@ -38,6 +38,7 @@
import java.awt.event.WindowEvent;
import java.awt.peer.ComponentPeer;
import java.awt.peer.LightweightPeer;
import java.io.Serial;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.util.EventObject;
Expand Down Expand Up @@ -252,9 +253,10 @@ final AccessControlContext getAccessControlContext() {
*/
public static final int RESERVED_ID_MAX = 1999;

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

static {
Expand Down
9 changes: 6 additions & 3 deletions src/java.desktop/share/classes/java/awt/AWTException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 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 @@ -22,8 +22,10 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package java.awt;

import java.io.Serial;

/**
* Signals that an Abstract Window Toolkit exception has occurred.
Expand All @@ -32,9 +34,10 @@
*/
public class AWTException extends Exception {

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

/**
Expand Down
11 changes: 9 additions & 2 deletions src/java.desktop/share/classes/java/awt/AWTKeyStroke.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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 @@ -27,6 +27,7 @@

import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.io.Serial;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
Expand Down Expand Up @@ -64,7 +65,12 @@
* @since 1.4
*/
public class AWTKeyStroke implements Serializable {
static final long serialVersionUID = -6430539691155161871L;

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

private static Map<String, Integer> modifierKeywords;
/**
Expand Down Expand Up @@ -725,6 +731,7 @@ static String getVKText(int keyCode) {
* @return a cached instance which is equal to this instance
* @throws java.io.ObjectStreamException if a serialization problem occurs
*/
@Serial
protected Object readResolve() throws java.io.ObjectStreamException {
synchronized (AWTKeyStroke.class) {

Expand Down
Loading