Skip to content

Commit 0d748a1

Browse files
Fix SpotBugs UPM_UNCALLED_PRIVATE_METHOD warnings
1 parent 153eb65 commit 0d748a1

File tree

1 file changed

+4
-55
lines changed

1 file changed

+4
-55
lines changed

CodenameOne/src/com/codename1/ui/html/HTMLComponent.java

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,9 @@ static int getInt(String intStr, int defaultValue) {
527527
}
528528
}
529529

530+
static int getInt(String intStr) {
531+
return getInt(intStr, 0);
532+
}
530533

531534
/**
532535
* Calculates width or height of an element according to its original size, requested size and default size
@@ -2060,55 +2063,6 @@ private Vector showText(String text, int align) {
20602063
return getWords(text, align, true);
20612064
}
20622065

2063-
/**
2064-
* Shows the given text. This method breaks lines as necessary and adds the text either as regular labels or links.
2065-
*
2066-
* @param text The text to display
2067-
* @param align The current horizontal alignment
2068-
*/
2069-
private Vector showTextFixedWidth(String text, int align) {
2070-
Vector comps = new Vector();
2071-
if ((text == null) || (text.equals(""))) {
2072-
return comps; //no text to show
2073-
}
2074-
int spaceW = width - x;
2075-
2076-
Vector words = getWords(text, align, false);
2077-
2078-
if (words.size() > 0) {
2079-
int w = 0;
2080-
StringBuilder wordStr = new StringBuilder();
2081-
if ((CSSParser.isWhiteSpace(text.charAt(0))) && (curLine.getComponentCount() != 0)) { //leading space is trimmed if it is in the first component of the line
2082-
wordStr.append(" "); //leading space
2083-
}
2084-
2085-
while (w < words.size()) {
2086-
String nextWord = (String) words.elementAt(w);
2087-
String space = "";
2088-
if ((wordStr.length() > 0) && (!wordStr.toString().equals(" "))) {
2089-
space = " ";
2090-
}
2091-
if (font.stringWidth(wordStr.toString() + space + nextWord) > spaceW - 2) {
2092-
comps.addElement(addString(wordStr.toString(), align));
2093-
newLineIfNotEmpty(align);
2094-
spaceW = width - x;
2095-
wordStr.setLength(0);
2096-
wordStr.append(nextWord);
2097-
} else {
2098-
wordStr.append(space).append(nextWord);
2099-
}
2100-
w++;
2101-
}
2102-
if (CSSParser.isWhiteSpace(text.charAt(text.length() - 1))) {
2103-
wordStr.append(" "); //trailing space
2104-
}
2105-
2106-
comps.addElement(addString(wordStr.toString(), align));
2107-
}
2108-
2109-
return comps;
2110-
}
2111-
21122066
/**
21132067
* Adds the given text to the container as a label or a link.
21142068
* The string given here does not need line breaking as this was calculated before in the calling method.
@@ -2917,12 +2871,7 @@ private void processTag(HTMLElement element, int align) {
29172871
if (preTagCount != 0) {
29182872
comps = showPreTagText(text, curAlign);
29192873
} else {
2920-
2921-
if (FIXED_WIDTH) {
2922-
comps = showTextFixedWidth(text, curAlign);
2923-
} else {
2924-
comps = showText(text, curAlign);
2925-
}
2874+
comps = showText(text, curAlign);
29262875
}
29272876
if (loadCSS) {
29282877
child.setAssociatedComponents(comps);

0 commit comments

Comments
 (0)