Skip to content

Commit dd032b7

Browse files
committed
8254798: Deprecate for removal an empty finalize() methods in java.desktop module
Reviewed-by: kcr, pbansal
1 parent 272bb5d commit dd032b7

File tree

6 files changed

+11
-46
lines changed

6 files changed

+11
-46
lines changed

src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -478,12 +478,6 @@ public final MidiDevice getMidiDevice() {
478478
final boolean isOpen() {
479479
return open;
480480
}
481-
482-
//$$fb is that a good idea?
483-
//protected void finalize() {
484-
// close();
485-
//}
486-
487481
} // class AbstractReceiver
488482

489483

src/java.desktop/share/classes/java/awt/color/ICC_Profile.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,8 @@ public void activate() throws ProfileDataException {
759759
* Object#finalize()} for further information about migration
760760
* options.
761761
*/
762-
@Deprecated(since="9")
762+
@Deprecated(since = "9", forRemoval = true)
763+
@SuppressWarnings("removal")
763764
protected void finalize () {
764765
}
765766

src/java.desktop/share/classes/java/awt/image/ColorModel.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1630,7 +1630,8 @@ public boolean isCompatibleSampleModel(SampleModel sm) {
16301630
* See the specification for {@link Object#finalize()} for further
16311631
* information about migration options.
16321632
*/
1633-
@Deprecated(since="9")
1633+
@Deprecated(since = "9", forRemoval = true)
1634+
@SuppressWarnings("removal")
16341635
public void finalize() {
16351636
}
16361637

src/java.desktop/share/classes/java/awt/image/IndexColorModel.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1524,7 +1524,8 @@ public BigInteger getValidPixels() {
15241524
* See the specification for {@link Object#finalize()} for further
15251525
* information about migration options.
15261526
*/
1527-
@Deprecated(since="9")
1527+
@Deprecated(since = "9", forRemoval = true)
1528+
@SuppressWarnings("removal")
15281529
public void finalize() {
15291530
}
15301531

src/java.desktop/share/classes/sun/java2d/pipe/RegionClipSpanIterator.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -377,15 +377,4 @@ public void skipDownTo(int y) {
377377
public long getNativeIterator() {
378378
return 0;
379379
}
380-
381-
/*
382-
* Cleans out all internal data structures.
383-
*/
384-
//public native void dispose();
385-
386-
@SuppressWarnings("deprecation")
387-
protected void finalize() {
388-
//dispose();
389-
}
390-
391380
}

src/java.desktop/share/classes/sun/java2d/pipe/RegionSpanIterator.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -47,17 +47,6 @@ public class RegionSpanIterator implements SpanIterator {
4747
// Is the associated Region rectangular?
4848
boolean isrect;
4949

50-
/*
51-
REMIND: For native implementation
52-
long pData; // Private storage of rect info
53-
54-
static {
55-
initIDs();
56-
}
57-
58-
public static native void initIDs();
59-
*/
60-
6150
/**
6251
* Constructs an instance based on the given Region
6352
*/
@@ -197,14 +186,4 @@ public void skipDownTo(int y) {
197186
public long getNativeIterator() {
198187
return 0;
199188
}
200-
201-
/*
202-
* Cleans out all internal data structures.
203-
* REMIND: Native implementation
204-
public native void dispose();
205-
206-
protected void finalize() {
207-
dispose();
208-
}
209-
*/
210189
}

0 commit comments

Comments
 (0)