Skip to content

Commit e39e737

Browse files
committed
DRY: inline redundant local variable
Entfernt doppelt erzeugte Referenzen auf ein identisches Objekt.
1 parent d83e351 commit e39e737

File tree

7 files changed

+11
-19
lines changed

7 files changed

+11
-19
lines changed

src/de/willuhn/jameica/hbci/gui/input/AddressInput.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,10 @@ public void handleEvent(Event event)
348348
*/
349349
public void setText(String s)
350350
{
351-
String before = s;
352-
String after = HBCIProperties.clean(s,validChars);
353351
// Alle Zeichen rauswerfen, die nicht zulaessig sind.
352+
String after = HBCIProperties.clean(s,validChars);
354353
super.setText(after);
355-
if (before != null && !before.equals(after))
354+
if (s != null && !s.equals(after))
356355
GUI.getView().setErrorText(i18n.tr("Im Namen wurden nicht zulässige Zeichen entfernt"));
357356
}
358357

src/de/willuhn/jameica/hbci/gui/parts/AbstractSammelTransferList.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ else if (l.ausgefuehrt())
9595
item.setForeground(Color.COMMENT.getSWTColor());
9696

9797
// Checken, ob der Auftrag einen Reminder hat oder ob es ein geclonter Auftrag ist
98-
HibiscusDBObject o = (HibiscusDBObject) l;
99-
String uuid = MetaKey.REMINDER_UUID.get(o);
98+
String uuid = MetaKey.REMINDER_UUID.get((HibiscusDBObject) l);
10099
if (uuid != null)
101100
{
102101
try
@@ -110,7 +109,7 @@ else if (l.ausgefuehrt())
110109
Logger.error("unable to determine reminder",e);
111110
}
112111
}
113-
else if (MetaKey.REMINDER_TEMPLATE.get(o) != null)
112+
else if (MetaKey.REMINDER_TEMPLATE.get((HibiscusDBObject) l) != null)
114113
{
115114
item.setImage(4,SWTUtil.getImage("edit-copy.png"));
116115
}

src/de/willuhn/jameica/hbci/gui/parts/AbstractSepaSammelTransferList.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ public void format(TableItem item) {
116116
item.setForeground(Color.COMMENT.getSWTColor());
117117

118118
// Checken, ob der Auftrag einen Reminder hat oder ob es ein geclonter Auftrag ist
119-
HibiscusDBObject o = (HibiscusDBObject) l;
120-
String uuid = MetaKey.REMINDER_UUID.get(o);
119+
String uuid = MetaKey.REMINDER_UUID.get((HibiscusDBObject) l);
121120
if (uuid != null)
122121
{
123122
try
@@ -131,7 +130,7 @@ public void format(TableItem item) {
131130
Logger.error("unable to determine reminder",e);
132131
}
133132
}
134-
else if (MetaKey.REMINDER_TEMPLATE.get(o) != null)
133+
else if (MetaKey.REMINDER_TEMPLATE.get((HibiscusDBObject) l) != null)
135134
{
136135
item.setImage(4,SWTUtil.getImage("edit-copy.png"));
137136
}

src/de/willuhn/jameica/hbci/io/AbstractSepaExporter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ void setup(Object[] objects, IOFormat format, OutputStream os, ProgressMonitor m
107107

108108
// User nach der SEPA-Version fragen, die verwendet werden soll.
109109
PainVersionDialog d = new PainVersionDialog(this.getPainType());
110-
SepaVersion version = (SepaVersion) d.open();
111-
ctx.version = version;
110+
ctx.version = (SepaVersion) d.open();
112111

113112
// Header-Infos zuweisen
114113
ctx.props.setProperty("src.bic", StringUtils.trimToEmpty(konto.getBic()));

src/de/willuhn/jameica/hbci/passports/rdh/SelectSizEntryDialog.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ public void handleAction(Object context) throws ApplicationException
7373
{
7474
if (context == null || !(context instanceof Entry))
7575
return;
76-
Entry e = (Entry) context;
77-
selected = e;
76+
selected = (Entry) context;
7877
close();
7978
}
8079
});
@@ -92,8 +91,7 @@ public void handleAction(Object context) throws ApplicationException
9291
if (o == null || !(o instanceof Entry))
9392
return;
9493

95-
Entry e = (Entry) context;
96-
selected = e;
94+
selected = (Entry) context;
9795
close();
9896
}
9997
},null,false,"ok.png");

src/de/willuhn/jameica/hbci/server/UmsatzTypImpl.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,7 @@ public Object getAttribute(String arg0) throws RemoteException
497497
return null;
498498
try
499499
{
500-
Integer i = new Integer(n);
501-
return i;
500+
return new Integer(n);
502501
}
503502
catch (Exception e)
504503
{

src/de/willuhn/jameica/hbci/server/VersionUtil.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public static int delete(HBCIDBService service, String name) throws RemoteExcept
8484
if (name == null || name.length() == 0)
8585
throw new RemoteException("no name given");
8686

87-
int i = service.executeUpdate("delete from version where name = ?",name);
88-
return i;
87+
return service.executeUpdate("delete from version where name = ?",name);
8988
}
9089
}

0 commit comments

Comments
 (0)