Skip to content

Commit

Permalink
8254798: Deprecate for removal an empty finalize() methods in java.de…
Browse files Browse the repository at this point in the history
…sktop module

Reviewed-by: kcr, pbansal
  • Loading branch information
mrserb committed Oct 19, 2020
1 parent 272bb5d commit dd032b7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 46 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, 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 @@ -478,12 +478,6 @@ public final MidiDevice getMidiDevice() {
final boolean isOpen() {
return open;
}

//$$fb is that a good idea?
//protected void finalize() {
// close();
//}

} // class AbstractReceiver


Expand Down
Expand Up @@ -759,7 +759,8 @@ public void activate() throws ProfileDataException {
* Object#finalize()} for further information about migration
* options.
*/
@Deprecated(since="9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
protected void finalize () {
}

Expand Down
5 changes: 3 additions & 2 deletions src/java.desktop/share/classes/java/awt/image/ColorModel.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2020, 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 @@ -1630,7 +1630,8 @@ public boolean isCompatibleSampleModel(SampleModel sm) {
* See the specification for {@link Object#finalize()} for further
* information about migration options.
*/
@Deprecated(since="9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public void finalize() {
}

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2020, 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 @@ -1524,7 +1524,8 @@ public BigInteger getValidPixels() {
* See the specification for {@link Object#finalize()} for further
* information about migration options.
*/
@Deprecated(since="9")
@Deprecated(since = "9", forRemoval = true)
@SuppressWarnings("removal")
public void finalize() {
}

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, 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 @@ -377,15 +377,4 @@ public void skipDownTo(int y) {
public long getNativeIterator() {
return 0;
}

/*
* Cleans out all internal data structures.
*/
//public native void dispose();

@SuppressWarnings("deprecation")
protected void finalize() {
//dispose();
}

}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, 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,17 +47,6 @@ public class RegionSpanIterator implements SpanIterator {
// Is the associated Region rectangular?
boolean isrect;

/*
REMIND: For native implementation
long pData; // Private storage of rect info
static {
initIDs();
}
public static native void initIDs();
*/

/**
* Constructs an instance based on the given Region
*/
Expand Down Expand Up @@ -197,14 +186,4 @@ public void skipDownTo(int y) {
public long getNativeIterator() {
return 0;
}

/*
* Cleans out all internal data structures.
* REMIND: Native implementation
public native void dispose();
protected void finalize() {
dispose();
}
*/
}

1 comment on commit dd032b7

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on dd032b7 Oct 19, 2020

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.