Skip to content

Commit 029b61e

Browse files
committed
Revert "Fight bad code styles"
This reverts commit 8bdf6be.
1 parent b864eee commit 029b61e

20 files changed

+66
-67
lines changed

src/jfs/gui/JFSAssistantView.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,21 @@
3535

3636
/**
3737
* This dialog assists a new user in performing a synchronization.
38-
*
38+
*
3939
* @author Jens Heidrich
4040
* @version $Id: JFSAssistantView.java,v 1.9 2007/02/26 18:49:10 heidrich Exp $
4141
*/
4242
public class JFSAssistantView extends JDialog implements ActionListener {
43-
43+
4444
/** The UID. */
4545
private static final long serialVersionUID = 200L;
4646

4747
/** The main view. */
4848
private final JFSMainView mainView;
4949

50+
/** The button for step 1. */
51+
private final JButton step1Button;
52+
5053
/** The button for step 2. */
5154
private final JButton step2Button;
5255

@@ -56,7 +59,7 @@ public class JFSAssistantView extends JDialog implements ActionListener {
5659

5760
/**
5861
* Initializes the assistant.
59-
*
62+
*
6063
* @param mainView
6164
* The main view.
6265
*/
@@ -80,7 +83,7 @@ public JFSAssistantView(JFSMainView mainView) {
8083
step1.setBorder(new TitledBorder(t.get("assistant.editProfile")));
8184
step1.add(new JLabel(t.get("assistant.step1")), BorderLayout.NORTH);
8285
JPanel step1ButtonPanel = new JPanel();
83-
JButton step1Button = JFSSupport.getButton("jfs.icon.profile", "OPTIONS", this, "menu.options");
86+
step1Button = JFSSupport.getButton("jfs.icon.profile", "OPTIONS", this, "menu.options");
8487
step1Button.setText(t.get("menu.options"));
8588
step1ButtonPanel.add(step1Button);
8689
step1.add(step1ButtonPanel, BorderLayout.SOUTH);
@@ -155,5 +158,5 @@ public void actionPerformed(ActionEvent event) {
155158
setVisible(false);
156159
}
157160
}
158-
161+
159162
}

src/jfs/gui/JFSCopyTable.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,20 @@ public final Object getValueAt(int row, int column) {
107107
return null;
108108
}
109109

110-
JFSFile file = column==0 ? v.get(row).getSrc() : v.get(row).getTgt();
111-
return file!=null ? file.getPath() : "";
110+
JFSFile file;
111+
switch (column) {
112+
case 0:
113+
file = v.get(row).getSrc();
114+
break;
115+
default:
116+
file = v.get(row).getTgt();
117+
break;
118+
}
119+
120+
if (file!=null) {
121+
return file.getPath();
122+
}
123+
return "";
112124
}
113125

114126

src/jfs/gui/JFSDirectoryTable.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import javax.swing.table.TableColumn;
3333
import javax.swing.table.TableModel;
3434
import jfs.conf.JFSConfig;
35-
import jfs.conf.JFSDirectoryPair;
3635
import jfs.conf.JFSText;
3736
import jfs.sync.JFSFileProducerManager;
3837

@@ -159,8 +158,12 @@ public final Object getValueAt(int row, int column) {
159158
return null;
160159
}
161160

162-
JFSDirectoryPair pair = config.getDirectoryList().get(row);
163-
return column == 0 ? pair.getSrc() : pair.getTgt();
161+
switch (column) {
162+
case 0:
163+
return config.getDirectoryList().get(row).getSrc();
164+
default:
165+
return config.getDirectoryList().get(row).getTgt();
166+
}
164167
}
165168

166169

src/jfs/gui/JFSMainView.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@
7575
import jfs.sync.JFSProgress;
7676
import jfs.sync.JFSSynchronization;
7777
import jfs.sync.JFSTable;
78-
import org.slf4j.Logger;
79-
import org.slf4j.LoggerFactory;
8078

8179

8280
/**
@@ -87,8 +85,6 @@
8785
*/
8886
public class JFSMainView extends WindowAdapter implements ActionListener, ComponentListener, JFSConfigObserver, JFSLogObserver {
8987

90-
private static final Logger LOG = LoggerFactory.getLogger(JFSMainView.class);
91-
9288
/**
9389
* Stores the corresponding frame.
9490
*/
@@ -177,11 +173,11 @@ private String getAppTitle(String appName) {
177173
}
178174
SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy HH:mm");
179175
buildInfo += " - build date "+formatter.format(new Date(jfsFile.lastModified()))+" ";
180-
} catch (URISyntaxException|MalformedURLException e) {
181-
LOG.debug("getAppTitle()", e);
182-
}
183-
// try/catch
184-
// try/catch
176+
} catch (URISyntaxException use) {
177+
;
178+
} catch (MalformedURLException mue) {
179+
;
180+
} // try/catch
185181

186182
String version = JFSConst.getInstance().getString("jfs.version");
187183
JFSConfig config = JFSConfig.getInstance();

src/jfs/gui/JFSProgressView.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ public final void compareInThread() {
424424
public void run() {
425425
// Wait for dialog to appear:
426426
while (!dialog.isVisible()) {
427-
;
428427
}
429428

430429
// Compare:
@@ -456,7 +455,6 @@ public final void synchronizeInThread() {
456455
public void run() {
457456
// Wait for dialog to appear:
458457
while (!dialog.isVisible()) {
459-
;
460458
}
461459

462460
// Synchronize:

src/jfs/shell/JFSProgressPrint.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import jfs.sync.JFSProgress;
3232
import jfs.sync.JFSProgress.ProgressActivity;
3333
import jfs.sync.JFSProgressObserver;
34-
import org.slf4j.Logger;
35-
import org.slf4j.LoggerFactory;
3634

3735

3836
/**
@@ -43,8 +41,6 @@
4341
*/
4442
public class JFSProgressPrint implements JFSProgressObserver {
4543

46-
private static final Logger LOG = LoggerFactory.getLogger(JFSProgressPrint.class);
47-
4844
/**
4945
* The stream for controling cancel operations.
5046
*/
@@ -133,7 +129,7 @@ public final void update(JFSProgress progress) {
133129
}
134130
}
135131
} catch (IOException e) {
136-
LOG.warn("update()", e.getMessage());
132+
// Just continue...
137133
}
138134
}
139135

src/jfs/shell/JFSShell.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* of all the specified directory pair is compared. After that, you may enter
4646
* different options via a shell-like environment or skip the shell and directly
4747
* perform the synchronization depeding on the command line options.
48-
*
48+
*
4949
* @author Jens Heidrich
5050
* @version $Id: JFSShell.java,v 1.11 2007/02/26 18:49:11 heidrich Exp $
5151
*/
@@ -58,7 +58,7 @@ private JFSShell() {
5858
/**
5959
* Reads a positive number out of a string of the following form: "[command]
6060
* [number]"
61-
*
61+
*
6262
* @param input
6363
* The input string.
6464
* @param min
@@ -96,7 +96,7 @@ public static int parseInt(String input, int min, int max) {
9696

9797
/**
9898
* Prints the content of URL to standard out.
99-
*
99+
*
100100
* @param url
101101
* The input url.
102102
*/
@@ -124,7 +124,7 @@ public static void printURL(URL url) {
124124
/**
125125
* Starts the JFS command line shell in order to perform comparisons and
126126
* synchronizations.
127-
*
127+
*
128128
* @param quiet
129129
* This option has to be true, if comparison and synchronization
130130
* should run in background. It has to be false, if a shell

src/jfs/sync/JFSComparisonMonitor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void clean() {
118118
* The weigth of the currently handled item; i.e., the delta by which the number of handled items is
119119
* increased if this item is completely handled.
120120
*/
121-
public void increase(int containedItems, int weight) {
121+
void increase(int containedItems, int weight) {
122122
itemsStarted.add(containedItems);
123123
itemsHandled.add(0);
124124
itemsWeight.add(weight);
@@ -128,7 +128,7 @@ public void increase(int containedItems, int weight) {
128128
/**
129129
* Decreases the depth for the started and handled items. Always used in combination with increase().
130130
*/
131-
public void decrease() {
131+
void decrease() {
132132
// All vector (should ;-) have the same size, so we just
133133
// use the size of itemsStarted to remove the last elements:
134134
int size = itemsStarted.size();

src/jfs/sync/JFSCopyMonitor.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public long getBytesToTransferCurrentFile() {
189189
* @param bytesToTransferCurrentFile
190190
* The bytes to transfer to set.
191191
*/
192-
public void setBytesToTransferCurrentFile(long bytesToTransferCurrentFile) {
192+
void setBytesToTransferCurrentFile(long bytesToTransferCurrentFile) {
193193
this.bytesToTransferCurrentFile = bytesToTransferCurrentFile;
194194
}
195195

@@ -208,7 +208,7 @@ public long getBytesTransfered() {
208208
* @param bytesTransfered
209209
* The bytes transfered to set.
210210
*/
211-
public void setBytesTransfered(long bytesTransfered) {
211+
void setBytesTransfered(long bytesTransfered) {
212212
this.bytesTransfered = bytesTransfered;
213213
}
214214

@@ -227,7 +227,7 @@ public long getBytesTransferedCurrentFile() {
227227
* @param bytesTransferedCurrentFile
228228
* The bytes transfered to set.
229229
*/
230-
public void setBytesTransferedCurrentFile(long bytesTransferedCurrentFile) {
230+
void setBytesTransferedCurrentFile(long bytesTransferedCurrentFile) {
231231
this.bytesTransferedCurrentFile = bytesTransferedCurrentFile;
232232
}
233233

@@ -246,7 +246,7 @@ public JFSFile getCurrentSrc() {
246246
* @param currentSrc
247247
* The current source to set.
248248
*/
249-
public void setCurrentSrc(JFSFile currentSrc) {
249+
void setCurrentSrc(JFSFile currentSrc) {
250250
this.currentSrc = currentSrc;
251251
}
252252

@@ -265,7 +265,7 @@ public JFSFile getCurrentTgt() {
265265
* @param currentTgt
266266
* The current target to set.
267267
*/
268-
public void setCurrentTgt(JFSFile currentTgt) {
268+
void setCurrentTgt(JFSFile currentTgt) {
269269
this.currentTgt = currentTgt;
270270
}
271271

@@ -297,7 +297,7 @@ public int getFilesCopied() {
297297
* @param filesCopied
298298
* The files copied to set.
299299
*/
300-
public void setFilesCopied(int filesCopied) {
300+
void setFilesCopied(int filesCopied) {
301301
this.filesCopied = filesCopied;
302302
}
303303

@@ -316,7 +316,7 @@ public int getFilesToCopy() {
316316
* @param filesToCopy
317317
* The files to copy to set.
318318
*/
319-
public void setFilesToCopy(int filesToCopy) {
319+
void setFilesToCopy(int filesToCopy) {
320320
this.filesToCopy = filesToCopy;
321321
}
322322

src/jfs/sync/JFSDeleteMonitor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public int getFilesToDelete() {
127127
* @param filesToDelete
128128
* The number of files to delete to set.
129129
*/
130-
public void setFilesToDelete(int filesToDelete) {
130+
void setFilesToDelete(int filesToDelete) {
131131
this.filesToDelete = filesToDelete;
132132
}
133133

@@ -146,7 +146,7 @@ public int getFilesDeleted() {
146146
* @param filesDeleted
147147
* The number of files deleted to set.
148148
*/
149-
public void setFilesDeleted(int filesDeleted) {
149+
void setFilesDeleted(int filesDeleted) {
150150
this.filesDeleted = filesDeleted;
151151
}
152152

0 commit comments

Comments
 (0)