Skip to content

Commit

Permalink
8343483: Remove unnecessary @SuppressWarnings annotations (serviceabi…
Browse files Browse the repository at this point in the history
…lity)

Reviewed-by: cjplummer
  • Loading branch information
archiecobbs committed Nov 13, 2024
1 parent 7be7772 commit a5f11b5
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, 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,8 +35,7 @@
import java.rmi.server.RemoteRef;


@SuppressWarnings({"deprecation",
"serial"}) // Externalizable class w/o no-arg c'tor
@SuppressWarnings("serial") // Externalizable class w/o no-arg c'tor
public class ProxyRef implements RemoteRef {
private static final long serialVersionUID = -6503061366316814723L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2024, 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,7 +32,7 @@
*
* @since 1.5
*/
@SuppressWarnings({"deprecation", "rawtypes", "unchecked"})
@SuppressWarnings({"deprecation", "rawtypes"})
public final class RMIServerImpl_Stub
extends java.rmi.server.RemoteStub
implements javax.management.remote.rmi.RMIServer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ public void terminate() {
//----------------
// PRIVATE METHODS
//----------------
@SuppressWarnings("removal")
private Subject getSubject() {
return Subject.current();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2024, 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 @@ -445,7 +445,6 @@ public boolean logout() throws LoginException {
* @param usePasswdFromSharedState a flag to tell this method whether
* to retrieve the password from the sharedState.
*/
@SuppressWarnings("unchecked") // sharedState used as Map<String,Object>
private void attemptAuthentication(boolean usePasswdFromSharedState)
throws LoginException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@
* @author Mandy Chung
* @since 1.5
*/
@SuppressWarnings({"removal",
"doclint:reference"}) // cross-module links
@SuppressWarnings("doclint:reference") // cross-module links
public class ManagementFactory {
// A class with only static fields and methods.
private ManagementFactory() {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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 @@ -47,7 +47,6 @@ public class BadAttributeValueExpException extends Exception {
* @serial A string representation of the attribute that originated this exception.
* For example, the string value can be the return of {@code attribute.toString()}.
*/
@SuppressWarnings("serial") // See handling in constructor and readObject
private String val;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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 @@ -162,7 +162,6 @@ public class MonitorNotification extends javax.management.Notification {
/**
* @serial Monitor notification observed object.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private ObjectName observedObject = null;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, 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 @@ -61,7 +61,6 @@ public class OpenMBeanAttributeInfoSupport
/**
* @serial The open mbean attribute's <i>open type</i>
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private OpenType<?> openType;

/**
Expand Down Expand Up @@ -565,7 +564,7 @@ static void check(OpenMBeanParameterInfo info) throws OpenDataException {

}

@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
static int compare(Object x, Object y) {
return ((Comparable) x).compareTo(y);
}
Expand Down Expand Up @@ -938,7 +937,7 @@ public boolean isValue(Object obj) {
return isValue(this, obj);
}

@SuppressWarnings({"unchecked", "rawtypes"}) // cast to Comparable
@SuppressWarnings("unchecked") // cast to Comparable
static boolean isValue(OpenMBeanParameterInfo info, Object obj) {
if (info.hasDefaultValue() && obj == null)
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, 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 @@ -58,7 +58,6 @@ public class OpenMBeanParameterInfoSupport
/**
* @serial The open mbean parameter's <i>open type</i>
*/
@SuppressWarnings("serial") // Not statically typed as Serializable
private OpenType<?> openType;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, 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 @@ -612,7 +612,6 @@ public Set<Object> keySet() {
* @return a collection view ({@code Collection<CompositeData>}) of
* the values contained in this {@code TabularDataSupport} instance.
*/
@SuppressWarnings("unchecked") // historical confusion about the return type
public Collection<Object> values() {

return Util.cast(dataMap.values());
Expand Down Expand Up @@ -648,7 +647,6 @@ public Collection<Object> values() {
* of the mappings contained in this map.
* @see java.util.Map.Entry
*/
@SuppressWarnings("unchecked") // historical confusion about the return type
public Set<Map.Entry<Object,Object>> entrySet() {

return Util.cast(dataMap.entrySet());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, 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 @@ -134,7 +134,6 @@ public RoleList(List<Role> list) throws IllegalArgumentException {
*
* @since 1.6
*/
@SuppressWarnings("unchecked")
public List<Role> asList() {
if (!typeSafe) {
if (tainted)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, 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 @@ -134,7 +134,6 @@ public RoleUnresolvedList(List<RoleUnresolved> list)
*
* @since 1.6
*/
@SuppressWarnings("unchecked")
public List<RoleUnresolved> asList() {
if (!typeSafe) {
if (tainted)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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 @@ -1154,7 +1154,6 @@ private synchronized void updateTimerTable(Integer notifID) {
*
* @param notification The TimerAlarmClock notification.
*/
@SuppressWarnings("deprecation")
void notifyAlarmClock(TimerAlarmClockNotification notification) {

TimerNotification timerNotification = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2024, 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 @@ -221,7 +221,6 @@ private Vector<?> getRow(int row) {
return dataVector.elementAt(row);
}

@SuppressWarnings("unchecked")
private void setRow(Vector<?> data, int row) {
dataVector.setElementAt(data,row);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2024, 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 @@ -42,7 +42,6 @@ public abstract class XTable extends JTable {

public XTable () {
super();
@SuppressWarnings("serial")
final TableSorter sorter = new TableSorter();
setModel(sorter);
sorter.addMouseListenerToHeaderInTable(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, 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 @@ -376,7 +376,6 @@ public void forEachClass(Consumer<ReferenceType> action) {
}
Iterator<?> it = classToBytes.entrySet().iterator();
for (int i = 0; it.hasNext(); i++) {
@SuppressWarnings("rawtypes")
Map.Entry<?, ?> entry = (Map.Entry)it.next();
ReferenceTypeImpl refType = (ReferenceTypeImpl)entry.getKey();
validateMirror(refType);
Expand Down

1 comment on commit a5f11b5

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