Skip to content

Commit 12c3486

Browse files
committed
ICU-23091 Apply source formatter to all Java files in codebase
1 parent 0678d80 commit 12c3486

File tree

1,155 files changed

+242329
-189986
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,155 files changed

+242329
-189986
lines changed

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

Lines changed: 50 additions & 51 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;
@@ -22,26 +25,17 @@
2225
import java.lang.reflect.InvocationTargetException;
2326
import java.lang.reflect.Method;
2427

25-
import com.ibm.icu.dev.demo.impl.DemoApplet;
26-
import com.ibm.icu.dev.demo.impl.DemoUtility;
27-
import com.ibm.icu.util.VersionInfo;
28-
29-
3028
/**
31-
* @author srl
32-
* Application to provide a panel of demos to launch
29+
* @author srl Application to provide a panel of demos to launch
3330
*/
3431
public class Launcher extends DemoApplet {
3532
private static final long serialVersionUID = -8054963875776183877L;
36-
37-
/**
38-
* base package of all demos
39-
*/
33+
34+
/** base package of all demos */
4035
public static final String demoBase = "com.ibm.icu.dev.demo";
41-
/**
42-
* list of classes, relative to the demoBase. all must have a static void main(String[])
43-
*/
44-
public static final String demoList[] = {
36+
37+
/** list of classes, relative to the demoBase. all must have a static void main(String[]) */
38+
public static final String demoList[] = {
4539
"calendar.CalendarApp",
4640
"charsetdet.DetectingViewer",
4741
"holiday.HolidayCalendarDemo",
@@ -51,16 +45,16 @@ public class Launcher extends DemoApplet {
5145

5246
public class LauncherFrame extends Frame implements ActionListener {
5347
private static final long serialVersionUID = -8054963875776183878L;
54-
48+
5549
public Button buttonList[] = new Button[demoList.length]; // one button for each demo
5650
public Label statusLabel;
5751
private DemoApplet applet;
58-
52+
5953
LauncherFrame(DemoApplet applet) {
6054
init();
6155
this.applet = applet;
6256
}
63-
57+
6458
public void init() {
6559
// close down when close is clicked.
6660
// TODO: this should be factored..
@@ -74,114 +68,119 @@ public void windowClosing(WindowEvent e) {
7468
applet.demoClosed();
7569
} else System.exit(0);
7670
}
77-
} );
71+
});
7872

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

8276
Panel topPanel = new Panel();
83-
topPanel.setLayout(new GridLayout(5,3));
77+
topPanel.setLayout(new GridLayout(5, 3));
8478

85-
for(int i=0;i<buttonList.length;i++) {
79+
for (int i = 0; i < buttonList.length; i++) {
8680
String demo = demoList[i];
8781
Button b = new Button(demo);
8882
b.addActionListener(this);
89-
buttonList[i]=b;
83+
buttonList[i] = b;
9084
topPanel.add(b);
9185
}
92-
add(BorderLayout.CENTER,topPanel);
86+
add(BorderLayout.CENTER, topPanel);
9387
statusLabel = new Label("");
9488
statusLabel.setAlignment(Label.LEFT);
9589
String javaVersion = "";
96-
try {
97-
javaVersion = "* Java: "+System.getProperty("java.version");
90+
try {
91+
javaVersion = "* Java: " + System.getProperty("java.version");
9892
} catch (Throwable t) {
9993
javaVersion = "";
10094
}
101-
add(BorderLayout.NORTH, new Label(
102-
"ICU Demos * ICU version "+VersionInfo.ICU_VERSION +
103-
" * https://icu.unicode.org/ "+javaVersion));
104-
add(BorderLayout.SOUTH,statusLabel);
95+
add(
96+
BorderLayout.NORTH,
97+
new Label(
98+
"ICU Demos * ICU version "
99+
+ VersionInfo.ICU_VERSION
100+
+ " * https://icu.unicode.org/ "
101+
+ javaVersion));
102+
add(BorderLayout.SOUTH, statusLabel);
105103
// set up an initial status.
106-
showStatus(buttonList.length+" demos ready. ");
104+
showStatus(buttonList.length + " demos ready. ");
107105
}
108-
106+
109107
/**
110108
* Change the 'status' field, and set it to black
109+
*
111110
* @param status
112111
*/
113112
void showStatus(String status) {
114113
statusLabel.setText(status);
115114
statusLabel.setForeground(Color.BLACK);
116115
statusLabel.setBackground(Color.WHITE);
117-
// statusLabel.setFont(Font.PLAIN);
116+
// statusLabel.setFont(Font.PLAIN);
118117
doLayout();
119118
}
119+
120120
void showStatus(String demo, String status) {
121-
showStatus(demo+": "+status);
121+
showStatus(demo + ": " + status);
122122
}
123+
123124
void showFailure(String status) {
124125
statusLabel.setText(status);
125126
statusLabel.setBackground(Color.GRAY);
126127
statusLabel.setForeground(Color.RED);
127-
// statusLabel.setFont(Font.BOLD);
128+
// statusLabel.setFont(Font.BOLD);
128129
doLayout();
129130
}
131+
130132
void showFailure(String demo, String status) {
131-
showFailure(demo+": "+status);
133+
showFailure(demo + ": " + status);
132134
}
133135

134-
135136
public void actionPerformed(ActionEvent e) {
136137
// find button
137-
for(int i=0;i<buttonList.length;i++) {
138-
if(e.getSource() == buttonList[i]) {
138+
for (int i = 0; i < buttonList.length; i++) {
139+
if (e.getSource() == buttonList[i]) {
139140
String demoShort = demoList[i];
140-
String demo = demoBase+'.'+demoShort;
141+
String demo = demoBase + '.' + demoShort;
141142
showStatus(demoShort, "launching");
142143
try {
143144
Class c = Class.forName(demo);
144145
String args[] = new String[0];
145146
Class params[] = new Class[1];
146147
params[0] = args.getClass();
147-
Method m = c.getMethod("main", params );
148-
Object[] argList = { args };
148+
Method m = c.getMethod("main", params);
149+
Object[] argList = {args};
149150
m.invoke(null, argList);
150151
showStatus(demoShort, "launched.");
151152
} catch (ClassNotFoundException e1) {
152-
showFailure(demoShort,e1.toString());
153+
showFailure(demoShort, e1.toString());
153154
e1.printStackTrace();
154155
} catch (SecurityException se) {
155-
showFailure(demoShort,se.toString());
156+
showFailure(demoShort, se.toString());
156157
se.printStackTrace();
157158
} catch (NoSuchMethodException nsme) {
158-
showFailure(demoShort,nsme.toString());
159+
showFailure(demoShort, nsme.toString());
159160
nsme.printStackTrace();
160161
} catch (IllegalArgumentException iae) {
161-
showFailure(demoShort,iae.toString());
162+
showFailure(demoShort, iae.toString());
162163
iae.printStackTrace();
163164
} catch (IllegalAccessException iae) {
164-
showFailure(demoShort,iae.toString());
165+
showFailure(demoShort, iae.toString());
165166
iae.printStackTrace();
166167
} catch (InvocationTargetException ite) {
167-
showFailure(demoShort,ite.toString());
168+
showFailure(demoShort, ite.toString());
168169
ite.printStackTrace();
169170
}
170171
repaint();
171172
}
172173
}
173174
}
174-
175175
}
176-
176+
177177
/* This creates a Frame for the demo applet. */
178178
protected Frame createDemoFrame(DemoApplet applet) {
179179
return new LauncherFrame(applet);
180180
}
181181

182182
/**
183-
* The main function which defines the behavior of the Demo
184-
* applet when an applet is started.
183+
* The main function which defines the behavior of the Demo applet when an applet is started.
185184
*/
186185
public static void main(String[] args) {
187186
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)