Skip to content

Commit 2ee31d2

Browse files
committed
ICU-23091 Apply source formatter to all Java files in codebase
1 parent 3f45b76 commit 2ee31d2

File tree

1,142 files changed

+242074
-190201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,142 files changed

+242074
-190201
lines changed

icu4j/demos/src/main/java/com/ibm/icu/dev/demo/Launcher.java

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
*/
99
package com.ibm.icu.dev.demo;
1010

11+
import com.ibm.icu.dev.demo.impl.DemoApplet;
12+
import com.ibm.icu.dev.demo.impl.DemoUtility;
13+
import com.ibm.icu.util.VersionInfo;
1114
import java.awt.BorderLayout;
1215
import java.awt.Button;
1316
import java.awt.Color;
@@ -23,45 +26,36 @@
2326
import java.lang.reflect.Method;
2427
import java.util.List;
2528

26-
import com.ibm.icu.dev.demo.impl.DemoApplet;
27-
import com.ibm.icu.dev.demo.impl.DemoUtility;
28-
import com.ibm.icu.util.VersionInfo;
29-
30-
3129
/**
32-
* @author srl
33-
* Application to provide a panel of demos to launch
30+
* @author srl Application to provide a panel of demos to launch
3431
*/
3532
public class Launcher extends DemoApplet {
3633
private static final long serialVersionUID = -8054963875776183877L;
37-
38-
/**
39-
* base package of all demos
40-
*/
34+
35+
/** base package of all demos */
4136
public static final String demoBase = "com.ibm.icu.dev.demo";
42-
/**
43-
* list of classes, relative to the demoBase. all must have a static void main(String[])
44-
*/
45-
public static final List<String> demoList = List.of(
46-
"calendar.CalendarApp",
47-
"charsetdet.DetectingViewer",
48-
"holiday.HolidayCalendarDemo",
49-
"rbnf.RbnfDemo",
50-
"translit.Demo"
51-
);
37+
38+
/** list of classes, relative to the demoBase. all must have a static void main(String[]) */
39+
public static final List<String> demoList =
40+
List.of(
41+
"calendar.CalendarApp",
42+
"charsetdet.DetectingViewer",
43+
"holiday.HolidayCalendarDemo",
44+
"rbnf.RbnfDemo",
45+
"translit.Demo");
5246

5347
public class LauncherFrame extends Frame implements ActionListener {
5448
private static final long serialVersionUID = -8054963875776183878L;
55-
49+
5650
public Button buttonList[] = new Button[demoList.size()]; // one button for each demo
5751
public Label statusLabel;
5852
private DemoApplet applet;
59-
53+
6054
LauncherFrame(DemoApplet applet) {
6155
init();
6256
this.applet = applet;
6357
}
64-
58+
6559
public void init() {
6660
// close down when close is clicked.
6761
// TODO: this should be factored..
@@ -75,114 +69,119 @@ public void windowClosing(WindowEvent e) {
7569
applet.demoClosed();
7670
} else System.exit(0);
7771
}
78-
} );
72+
});
7973

8074
setBackground(DemoUtility.bgColor);
8175
setLayout(new BorderLayout());
8276

8377
Panel topPanel = new Panel();
84-
topPanel.setLayout(new GridLayout(5,3));
78+
topPanel.setLayout(new GridLayout(5, 3));
8579

86-
for(int i=0;i<buttonList.length;i++) {
80+
for (int i = 0; i < buttonList.length; i++) {
8781
String demo = demoList.get(i);
8882
Button b = new Button(demo);
8983
b.addActionListener(this);
90-
buttonList[i]=b;
84+
buttonList[i] = b;
9185
topPanel.add(b);
9286
}
93-
add(BorderLayout.CENTER,topPanel);
87+
add(BorderLayout.CENTER, topPanel);
9488
statusLabel = new Label("");
9589
statusLabel.setAlignment(Label.LEFT);
9690
String javaVersion = "";
97-
try {
98-
javaVersion = "* Java: "+System.getProperty("java.version");
91+
try {
92+
javaVersion = "* Java: " + System.getProperty("java.version");
9993
} catch (Throwable t) {
10094
javaVersion = "";
10195
}
102-
add(BorderLayout.NORTH, new Label(
103-
"ICU Demos * ICU version "+VersionInfo.ICU_VERSION +
104-
" * https://icu.unicode.org/ "+javaVersion));
105-
add(BorderLayout.SOUTH,statusLabel);
96+
add(
97+
BorderLayout.NORTH,
98+
new Label(
99+
"ICU Demos * ICU version "
100+
+ VersionInfo.ICU_VERSION
101+
+ " * https://icu.unicode.org/ "
102+
+ javaVersion));
103+
add(BorderLayout.SOUTH, statusLabel);
106104
// set up an initial status.
107-
showStatus(buttonList.length+" demos ready. ");
105+
showStatus(buttonList.length + " demos ready. ");
108106
}
109-
107+
110108
/**
111109
* Change the 'status' field, and set it to black
110+
*
112111
* @param status
113112
*/
114113
void showStatus(String status) {
115114
statusLabel.setText(status);
116115
statusLabel.setForeground(Color.BLACK);
117116
statusLabel.setBackground(Color.WHITE);
118-
// statusLabel.setFont(Font.PLAIN);
117+
// statusLabel.setFont(Font.PLAIN);
119118
doLayout();
120119
}
120+
121121
void showStatus(String demo, String status) {
122-
showStatus(demo+": "+status);
122+
showStatus(demo + ": " + status);
123123
}
124+
124125
void showFailure(String status) {
125126
statusLabel.setText(status);
126127
statusLabel.setBackground(Color.GRAY);
127128
statusLabel.setForeground(Color.RED);
128-
// statusLabel.setFont(Font.BOLD);
129+
// statusLabel.setFont(Font.BOLD);
129130
doLayout();
130131
}
132+
131133
void showFailure(String demo, String status) {
132-
showFailure(demo+": "+status);
134+
showFailure(demo + ": " + status);
133135
}
134136

135-
136137
public void actionPerformed(ActionEvent e) {
137138
// find button
138-
for(int i=0;i<buttonList.length;i++) {
139-
if(e.getSource() == buttonList[i]) {
139+
for (int i = 0; i < buttonList.length; i++) {
140+
if (e.getSource() == buttonList[i]) {
140141
String demoShort = demoList.get(i);
141-
String demo = demoBase+'.'+demoShort;
142+
String demo = demoBase + '.' + demoShort;
142143
showStatus(demoShort, "launching");
143144
try {
144145
Class c = Class.forName(demo);
145146
String args[] = new String[0];
146147
Class params[] = new Class[1];
147148
params[0] = args.getClass();
148-
Method m = c.getMethod("main", params );
149-
Object[] argList = { args };
149+
Method m = c.getMethod("main", params);
150+
Object[] argList = {args};
150151
m.invoke(null, argList);
151152
showStatus(demoShort, "launched.");
152153
} catch (ClassNotFoundException e1) {
153-
showFailure(demoShort,e1.toString());
154+
showFailure(demoShort, e1.toString());
154155
e1.printStackTrace();
155156
} catch (SecurityException se) {
156-
showFailure(demoShort,se.toString());
157+
showFailure(demoShort, se.toString());
157158
se.printStackTrace();
158159
} catch (NoSuchMethodException nsme) {
159-
showFailure(demoShort,nsme.toString());
160+
showFailure(demoShort, nsme.toString());
160161
nsme.printStackTrace();
161162
} catch (IllegalArgumentException iae) {
162-
showFailure(demoShort,iae.toString());
163+
showFailure(demoShort, iae.toString());
163164
iae.printStackTrace();
164165
} catch (IllegalAccessException iae) {
165-
showFailure(demoShort,iae.toString());
166+
showFailure(demoShort, iae.toString());
166167
iae.printStackTrace();
167168
} catch (InvocationTargetException ite) {
168-
showFailure(demoShort,ite.toString());
169+
showFailure(demoShort, ite.toString());
169170
ite.printStackTrace();
170171
}
171172
repaint();
172173
}
173174
}
174175
}
175-
176176
}
177-
177+
178178
/* This creates a Frame for the demo applet. */
179179
protected Frame createDemoFrame(DemoApplet applet) {
180180
return new LauncherFrame(applet);
181181
}
182182

183183
/**
184-
* The main function which defines the behavior of the Demo
185-
* applet when an applet is started.
184+
* The main function which defines the behavior of the Demo applet when an applet is started.
186185
*/
187186
public static void main(String[] args) {
188187
new Launcher().showDemo();

icu4j/demos/src/main/java/com/ibm/icu/dev/demo/calendar/CalendarApp.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,17 @@
99

1010
package com.ibm.icu.dev.demo.calendar;
1111

12-
import java.awt.Frame;
13-
1412
import com.ibm.icu.dev.demo.impl.DemoApplet;
13+
import java.awt.Frame;
1514

16-
/**
17-
* CalendarApp demonstrates how Calendar works.
18-
*/
19-
public class CalendarApp extends DemoApplet
20-
{
21-
/**
22-
* For serialization
23-
*/
15+
/** CalendarApp demonstrates how Calendar works. */
16+
public class CalendarApp extends DemoApplet {
17+
/** For serialization */
2418
private static final long serialVersionUID = -4270137898405840825L;
2519

2620
/**
27-
* The main function which defines the behavior of the CalendarDemo
28-
* applet when an applet is started.
21+
* The main function which defines the behavior of the CalendarDemo applet when an applet is
22+
* started.
2923
*/
3024
public static void main(String argv[]) {
3125

0 commit comments

Comments
 (0)