8001173: [findbugs] Evaluate FindBug output for sun.font.CompositeFont, sun.font.CompositeFontDescriptor
Reviewed-by: prr, bae
--- a/jdk/src/share/classes/sun/font/StandardTextSource.java Tue Oct 22 15:39:33 2013 -0700
+++ b/jdk/src/share/classes/sun/font/StandardTextSource.java Wed Oct 23 08:56:56 2013 +0400
@@ -97,7 +97,7 @@
throw new IllegalArgumentException("bad frc: null");
}
- this.chars = chars;
+ this.chars = chars.clone();
this.start = start;
this.len = len;
this.cstart = cstart;
@@ -148,7 +148,7 @@
// TextSource API
public char[] getChars() {
- return chars;
+ return chars.clone();
}
public int getStart() {
--- a/jdk/src/share/classes/sun/font/TextLabelFactory.java Tue Oct 22 15:39:33 2013 -0700
+++ b/jdk/src/share/classes/sun/font/TextLabelFactory.java Wed Oct 23 08:56:56 2013 +0400
@@ -32,7 +32,6 @@
import java.awt.Font;
import java.awt.font.FontRenderContext;
-import java.awt.font.LineMetrics;
import java.text.Bidi;
/**
@@ -70,7 +69,7 @@
Bidi bidi,
int flags) {
this.frc = frc;
- this.text = text;
+ this.text = text.clone();
this.bidi = bidi;
this.flags = flags;
this.lineBidi = bidi;
@@ -82,30 +81,10 @@
return frc;
}
- public char[] getText() {
- return text;
- }
-
- public Bidi getParagraphBidi() {
- return bidi;
- }
-
public Bidi getLineBidi() {
return lineBidi;
}
- public int getLayoutFlags() {
- return flags;
- }
-
- public int getLineStart() {
- return lineStart;
- }
-
- public int getLineLimit() {
- return lineLimit;
- }
-
/**
* Set a line context for the factory. Shaping only occurs on this line.
* Characters are ordered as they would appear on this line.
--- a/jdk/src/solaris/classes/sun/font/FontConfigManager.java Tue Oct 22 15:39:33 2013 -0700
+++ b/jdk/src/solaris/classes/sun/font/FontConfigManager.java Wed Oct 23 08:56:56 2013 +0400
@@ -108,10 +108,6 @@
public FontConfigManager() {
}
- public static String[] getFontConfigNames() {
- return fontConfigNames;
- }
-
/* Called from code that needs to know what are the AA settings
* that apps using FC would pick up for the default desktop font.
* Note apps can change the default desktop font. etc, so this
@@ -182,7 +178,6 @@
t0 = System.nanoTime();
}
- String[] fontConfigNames = FontConfigManager.getFontConfigNames();
FcCompFont[] fontArr = new FcCompFont[fontConfigNames.length];
for (int i = 0; i< fontArr.length; i++) {