Skip to content

Commit

Permalink
Änderungsvorschläge von @meigelb eingearbeitet
Browse files Browse the repository at this point in the history
  • Loading branch information
ruderphilipp committed Jan 23, 2022
1 parent ccfdc21 commit add68c9
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 29 deletions.
3 changes: 2 additions & 1 deletion src/de/willuhn/jameica/hbci/TextSchluessel.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public static TextSchluessel[] get(String[] codes)
if (code.equals(ts.getCode()))
{
l.add(ts);
break;
}
}
}
Expand Down Expand Up @@ -222,4 +223,4 @@ public boolean equals(Object other)
* Revision 1.1 2008/08/01 11:05:14 willuhn
* @N BUGZILLA 587
*
**********************************************************************/
**********************************************************************/
11 changes: 6 additions & 5 deletions src/de/willuhn/jameica/hbci/io/AbstractDTAUSIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import de.willuhn.jameica.system.Application;
import de.willuhn.util.I18N;

import java.util.Arrays;

/**
* Abstrakte Basis-Klasse fuer DTAUS-Import/Export.
*/
Expand Down Expand Up @@ -94,13 +96,12 @@ public IOFormat[] getIOFormats(Class objectType)
return null;

Class[] supported = getSupportedObjectTypes();
if (supported == null || supported.length == 0)
return null;

for (Class supportedObjType : supported)
if (supported != null && supported.length > 0)
{
if (objectType.equals(supportedObjType))
if (Arrays.asList(supported).contains(objectType))
{
return new IOFormat[]{new MyIOFormat(objectType)};
}
}
return null;
}
Expand Down
10 changes: 5 additions & 5 deletions src/de/willuhn/jameica/hbci/io/AbstractExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.io.OutputStream;
import java.rmi.RemoteException;
import java.util.Arrays;

import de.willuhn.io.IOUtil;
import de.willuhn.jameica.hbci.HBCI;
Expand Down Expand Up @@ -129,13 +130,12 @@ public IOFormat[] getIOFormats(Class objectType)
return null;

Class[] supported = getSupportedObjectTypes();
if (supported == null || supported.length == 0)
return null;

for (Class supportedObjType : supported)
if (supported != null && supported.length > 0)
{
if (objectType.equals(supportedObjType))
if (Arrays.asList(supported).contains(objectType))
{
return new IOFormat[]{new MyIOFormat(objectType)};
}
}
return null;
}
Expand Down
10 changes: 5 additions & 5 deletions src/de/willuhn/jameica/hbci/io/AbstractImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.io.InputStream;
import java.rmi.RemoteException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -147,13 +148,12 @@ public IOFormat[] getIOFormats(Class objectType)
return null;

Class[] supported = getSupportedObjectTypes();
if (supported == null || supported.length == 0)
return null;

for (Class supportedObjType : supported)
if (supported != null && supported.length > 0)
{
if (objectType.equals(supportedObjType))
if (Arrays.asList(supported).contains(objectType))
{
return new IOFormat[]{new MyIOFormat(objectType)};
}
}
return null;
}
Expand Down
10 changes: 5 additions & 5 deletions src/de/willuhn/jameica/hbci/io/AbstractPDFUmsatzExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ public void doExport(Object[] objects, IOFormat format, OutputStream os, Progres

Date startDate = first.getDatum();
Date endDate = first.getDatum();
Map<String,List> umsaetze = new HashMap<String,List>();
Map<String,List<Umsatz>> umsaetze = new HashMap<>();

if (monitor != null)
{
monitor.setStatusText(i18n.tr("Ermittle zu exportierende Umsätze und Konten"));
monitor.addPercentComplete(1);
}

Map<String,T> groupMap = new HashMap<String,T>();
Map<String,T> groupMap = new HashMap<>();

for (int i=0;i<objects.length;++i)
for (Object object : objects)
{
Umsatz u = (Umsatz) objects[i];
Umsatz u = (Umsatz) object;

// Wir ermitteln bei der Gelegenheit das Maximal- und Minimal-Datum
Date date = u.getDatum();
Expand All @@ -84,7 +84,7 @@ public void doExport(Object[] objects, IOFormat format, OutputStream os, Progres
T group = this.getGroup(u);
String key = group != null ? group.getID() : null;
groupMap.put(key,group);
List<Umsatz> list = umsaetze.computeIfAbsent(key, k -> new ArrayList<Umsatz>());
List<Umsatz> list = umsaetze.computeIfAbsent(key, k -> new ArrayList<>());
list.add(u);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.io.File;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Set;

import org.kapott.hbci.manager.HBCIUtils;
Expand Down Expand Up @@ -73,14 +74,10 @@ public static synchronized void store(PinTanConfig config) throws Exception
boolean found = false;
if (existing != null && existing.length > 0)
{
for (String configID : existing)
if(Arrays.asList(existing).contains(config.getID()))
{
if (configID.equals(config.getID()))
{
Logger.info("updating existing config");
found = true;
break;
}
Logger.info("updating existing config");
found = true;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/de/willuhn/jameica/hbci/server/UmsatzGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class UmsatzGroup implements GenericObjectNode, Comparable
private final static transient I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();

private UmsatzTyp typ = null;
private ArrayList<Umsatz> umsaetze = new ArrayList();
private ArrayList<Umsatz> umsaetze = new ArrayList<>();

/**
* ct.
Expand Down

0 comments on commit add68c9

Please sign in to comment.