aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Sergey Bylokhov <serb@openjdk.org> 2021-03-24 21:41:14 +0000
committerGravatar Sergey Bylokhov <serb@openjdk.org> 2021-03-24 21:41:14 +0000
commit37f494cafad95a36ec368b48bbebf5bc54c8cbe8 (patch)
tree39b8b54d640e1f4d87600a4b90c44cbc83048693
parentcfc9aa34fdf5f7844e4b77e7be34d5455f63ae4a (diff)
downloadjdk-37f494cafad95a36ec368b48bbebf5bc54c8cbe8.tar.gz
jdk-37f494cafad95a36ec368b48bbebf5bc54c8cbe8.zip
8260619: Add final modifier to several DataFlavor static fields
Reviewed-by: azvegint, kizune
-rw-r--r--src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java b/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
index d2f9f22cd1c..b04c8b37eda 100644
--- a/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
+++ b/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
@@ -185,10 +185,10 @@ public class DataFlavor implements Externalizable, Cloneable {
/*
* private initializer
*/
- private static DataFlavor initHtmlDataFlavor(String htmlFlavorType) {
+ private static DataFlavor initHtml(String htmlFlavorType) {
try {
- return new DataFlavor ("text/html; class=java.lang.String;document=" +
- htmlFlavorType + ";charset=Unicode");
+ return new DataFlavor("text/html; class=java.lang.String;document="
+ + htmlFlavorType + ";charset=Unicode");
} catch (Exception e) {
return null;
}
@@ -292,7 +292,7 @@ public class DataFlavor implements Externalizable, Cloneable {
*
* @since 1.8
*/
- public static DataFlavor selectionHtmlFlavor = initHtmlDataFlavor("selection");
+ public static final DataFlavor selectionHtmlFlavor = initHtml("selection");
/**
* Represents a piece of an HTML markup. If possible, the markup received
@@ -306,7 +306,7 @@ public class DataFlavor implements Externalizable, Cloneable {
*
* @since 1.8
*/
- public static DataFlavor fragmentHtmlFlavor = initHtmlDataFlavor("fragment");
+ public static final DataFlavor fragmentHtmlFlavor = initHtml("fragment");
/**
* Represents a piece of an HTML markup. If possible, the markup received
@@ -320,7 +320,7 @@ public class DataFlavor implements Externalizable, Cloneable {
*
* @since 1.8
*/
- public static DataFlavor allHtmlFlavor = initHtmlDataFlavor("all");
+ public static final DataFlavor allHtmlFlavor = initHtml("all");
/**
* Constructs a new {@code DataFlavor}. This constructor is provided only