Skip to content

Commit 8013389

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

File tree

6 files changed

+11
-19
lines changed

6 files changed

+11
-19
lines changed

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

+3-4
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.
354-
super.setText(after);
355-
if (before != null && !before.equals(after))
352+
String cleaned = HBCIProperties.clean(s,validChars);
353+
super.setText(cleaned);
354+
if (s != null && !s.equals(cleaned))
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-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import de.willuhn.jameica.hbci.messaging.ObjectMessage;
4646
import de.willuhn.jameica.hbci.reminder.ReminderStorageProviderHibiscus;
4747
import de.willuhn.jameica.hbci.rmi.HBCIDBService;
48-
import de.willuhn.jameica.hbci.rmi.HibiscusDBObject;
4948
import de.willuhn.jameica.hbci.rmi.Konto;
5049
import de.willuhn.jameica.hbci.rmi.SammelTransfer;
5150
import de.willuhn.jameica.hbci.rmi.SammelTransferBuchung;
@@ -95,8 +94,7 @@ else if (l.ausgefuehrt())
9594
item.setForeground(Color.COMMENT.getSWTColor());
9695

9796
// 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);
97+
String uuid = MetaKey.REMINDER_UUID.get(l);
10098
if (uuid != null)
10199
{
102100
try
@@ -110,7 +108,7 @@ else if (l.ausgefuehrt())
110108
Logger.error("unable to determine reminder",e);
111109
}
112110
}
113-
else if (MetaKey.REMINDER_TEMPLATE.get(o) != null)
111+
else if (MetaKey.REMINDER_TEMPLATE.get(l) != null)
114112
{
115113
item.setImage(4,SWTUtil.getImage("edit-copy.png"));
116114
}

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(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(l) != null)
135134
{
136135
item.setImage(4,SWTUtil.getImage("edit-copy.png"));
137136
}

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 = Integer.valueOf(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)