Skip to content

Commit

Permalink
Remove deprecated (#162)
Browse files Browse the repository at this point in the history
- Replace new xxx by xxx.valueOf
- Replace deprecated setSummary(..)
- Pass List to new SelectInput
  • Loading branch information
JohannMaierhofer committed Feb 24, 2024
1 parent f3b9d52 commit 0623ee9
Show file tree
Hide file tree
Showing 72 changed files with 197 additions and 196 deletions.
6 changes: 3 additions & 3 deletions junit/src/de/jost_net/JVereinJUnit/io/AbrechnungSEPA.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ public class AbrechnungSEPA
public void test01() throws SEPAException
{
Zahler z1 = new Zahler();
z1.setBetrag(new BigDecimal("1.00"));
z1.setBetrag(BigDecimal.valueOf(1.00));
z1.setVerwendungszweck("Zweck 1");
Zahler z2 = new Zahler();
z2.setBetrag(new BigDecimal("1.00"));
z2.setBetrag(BigDecimal.valueOf(1.00));
z2.setVerwendungszweck("Zweck 2");
z1.add(z2);

Zahler z3 = new Zahler();
z3.setBetrag(new BigDecimal("1.00"));
z3.setBetrag(BigDecimal.valueOf(1.00));
z3.setVerwendungszweck("Zweck 3");
z1.add(z3);
assertEquals("bla", z1.getVerwendungszweck());
Expand Down
18 changes: 9 additions & 9 deletions junit/src/de/jost_net/JVereinJUnit/io/SuchbetragTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,64 +40,64 @@ public void test01() throws Exception
public void test02() throws Exception
{
Suchbetrag sb = new Suchbetrag("1,23");
Assert.assertEquals(new BigDecimal("1.23"), sb.getBetrag());
Assert.assertEquals(BigDecimal.valueOf(1.23), sb.getBetrag());
Assert.assertEquals(Suchstrategie.GLEICH, sb.getSuchstrategie());
}

@Test
public void test02m() throws Exception
{
Suchbetrag sb = new Suchbetrag("-1,23");
Assert.assertEquals(new BigDecimal("-1.23"), sb.getBetrag());
Assert.assertEquals(BigDecimal.valueOf(-1.23), sb.getBetrag());
Assert.assertEquals(Suchstrategie.GLEICH, sb.getSuchstrategie());
}

@Test
public void test03() throws Exception
{
Suchbetrag sb = new Suchbetrag("=1,23");
Assert.assertEquals(new BigDecimal("1.23"), sb.getBetrag());
Assert.assertEquals(BigDecimal.valueOf(1.23), sb.getBetrag());
Assert.assertEquals(Suchstrategie.GLEICH, sb.getSuchstrategie());
}

@Test
public void test04() throws Exception
{
Suchbetrag sb = new Suchbetrag(">1,23");
Assert.assertEquals(new BigDecimal("1.23"), sb.getBetrag());
Assert.assertEquals(BigDecimal.valueOf(1.23), sb.getBetrag());
Assert.assertEquals(Suchstrategie.GRÖSSER, sb.getSuchstrategie());
}

@Test
public void test05() throws Exception
{
Suchbetrag sb = new Suchbetrag(">=1,23");
Assert.assertEquals(new BigDecimal("1.23"), sb.getBetrag());
Assert.assertEquals(BigDecimal.valueOf(1.23), sb.getBetrag());
Assert.assertEquals(Suchstrategie.GRÖSSERGLEICH, sb.getSuchstrategie());
}

@Test
public void test06() throws Exception
{
Suchbetrag sb = new Suchbetrag("<1,23");
Assert.assertEquals(new BigDecimal("1.23"), sb.getBetrag());
Assert.assertEquals(BigDecimal.valueOf(1.23), sb.getBetrag());
Assert.assertEquals(Suchstrategie.KLEINER, sb.getSuchstrategie());
}

@Test
public void test07() throws Exception
{
Suchbetrag sb = new Suchbetrag("<=1,23");
Assert.assertEquals(new BigDecimal("1.23"), sb.getBetrag());
Assert.assertEquals(BigDecimal.valueOf(1.23), sb.getBetrag());
Assert.assertEquals(Suchstrategie.KLEINERGLEICH, sb.getSuchstrategie());
}

@Test
public void test08() throws Exception
{
Suchbetrag sb = new Suchbetrag("1,23..2,34");
Assert.assertEquals(new BigDecimal("1.23"), sb.getBetrag());
Assert.assertEquals(new BigDecimal("2.34"), sb.getBetrag2());
Assert.assertEquals(BigDecimal.valueOf(1.23), sb.getBetrag());
Assert.assertEquals(BigDecimal.valueOf(2.34), sb.getBetrag2());
Assert.assertEquals(Suchstrategie.BEREICH, sb.getSuchstrategie());
}

Expand Down
2 changes: 1 addition & 1 deletion src/de/jost_net/JVerein/Queries/MitgliedQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public Object extract(ResultSet rs) throws RemoteException, SQLException
}
if (bg != null)
{
bedingungen.add(new Integer(bg.getID()));
bedingungen.add(Integer.valueOf(bg.getID()));
}
return (ArrayList<Mitglied>) service.execute(sql, bedingungen.toArray(),
rs);
Expand Down
6 changes: 2 additions & 4 deletions src/de/jost_net/JVerein/Variable/MitgliedskontoMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.control.FormularfeldControl;
import de.jost_net.JVerein.rmi.Mitgliedskonto;
import de.jost_net.JVerein.util.JVDateFormatTTMMJJJJ;
import de.willuhn.jameica.gui.formatter.CurrencyFormatter;
import de.willuhn.jameica.gui.formatter.DateFormatter;

public class MitgliedskontoMap
{
Expand Down Expand Up @@ -110,8 +108,8 @@ public Map<String, Object> getMap(ArrayList<Mitgliedskonto> mk,
map.put(MitgliedskontoVar.BETRAG.getName(), betrag.toArray());
map.put(MitgliedskontoVar.IST.getName(), ist.toArray());
map.put(MitgliedskontoVar.DIFFERENZ.getName(), differenz.toArray());
map.put(MitgliedskontoVar.STAND.getName(), new Double(-1 * saldo));
map.put(MitgliedskontoVar.SUMME_OFFEN.getName(), new Double(saldo));
map.put(MitgliedskontoVar.STAND.getName(), Double.valueOf(-1 * saldo));
map.put(MitgliedskontoVar.SUMME_OFFEN.getName(), Double.valueOf(saldo));
return map;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void handleAction(Object context) throws ApplicationException
throw new ApplicationException(
"Neues Mitglied bitte erst speichern. Dann können Arbeitseinsätze aufgenommen werden.");
}
aeins.setMitglied(new Integer(m.getID()).intValue());
aeins.setMitglied(Integer.valueOf(m.getID()).intValue());
}
}
catch (RemoteException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import java.util.Date;
import java.util.Map;

import com.schlevoigt.JVerein.util.Misc;

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.Variable.AllgemeineMap;
import de.jost_net.JVerein.Variable.AllgemeineVar;
Expand Down Expand Up @@ -90,7 +88,7 @@ public void handleAction(Object context) throws ApplicationException
map.put(FormularfeldControl.ZAHLUNGSGRUND,
"Zahlungsgrund1 Zahlungsgrund2");
map.put(FormularfeldControl.ZAHLUNGSGRUND1, "Zahlungsgrund 1");
map.put(FormularfeldControl.BETRAG, new Double(1234.96 + 15.0));
map.put(FormularfeldControl.BETRAG, Double.valueOf(1234.96 + 15.0));
map.put("Betrag in Worten", GermanNumber.toString(1234 + 15));
map.put(FormularfeldControl.ID, "444");
map.put(FormularfeldControl.EXTERNEMITGLIEDSNUMMER, "9999");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void handleAction(Object context) throws ApplicationException
null);
jvereinkonto.setNummer(k.getKontonummer());
jvereinkonto.setBezeichnung(k.getBezeichnung());
jvereinkonto.setHibiscusId(new Integer(k.getID()));
jvereinkonto.setHibiscusId(Integer.valueOf(k.getID()));
jvereinkonto.store();
control.refreshTable();
GUI.getStatusBar().setSuccessText(
Expand Down
2 changes: 1 addition & 1 deletion src/de/jost_net/JVerein/gui/action/LehrgangAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void handleAction(Object context) throws ApplicationException
"Neues Mitglied bitte erst speichern. Dann können Lehrgänge aufgenommen werden.");
}

l.setMitglied(new Integer(m.getID()).intValue());
l.setMitglied(Integer.valueOf(m.getID()).intValue());
}
}
catch (RemoteException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void handleAction(Object context) throws ApplicationException
throw new ApplicationException(
"Neues Mitglied bitte erst speichern. Dann können Wiedervorlagen aufgenommen werden.");
}
w.setMitglied(new Integer(m.getID()).intValue());
w.setMitglied(Integer.valueOf(m.getID()).intValue());
}
}
catch (RemoteException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void handleAction(Object context) throws ApplicationException

if (m != null)
{
z.setMitglied(new Integer(m.getID()).intValue());
z.setMitglied(Integer.valueOf(m.getID()).intValue());
}
}
catch (RemoteException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private void aenderBeitragsGruppe(MitgliedNextBGruppe mitgliedBeitraege)
{
Mitglied mitglied = mitgliedBeitraege.getMitglied();
Beitragsgruppe beitragsGruppe = mitgliedBeitraege.getBeitragsgruppe();
mitglied.setBeitragsgruppe(new Integer(beitragsGruppe.getID()));
mitglied.setBeitragsgruppe(Integer.valueOf(beitragsGruppe.getID()));
mitglied.store();
mitgliedBeitraege.delete();
aenderungsListenPart.removeItem(mitgliedBeitraege);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import de.willuhn.jameica.gui.parts.Button;
import de.willuhn.jameica.gui.parts.Column;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.gui.parts.table.FeatureSummary;
import de.willuhn.jameica.system.Application;
import de.willuhn.jameica.system.BackgroundTask;
import de.willuhn.logging.Logger;
Expand Down Expand Up @@ -180,7 +181,7 @@ public Part getSollbuchungsList() throws RemoteException
new ZahlungswegFormatter(), false, Column.ALIGN_LEFT);
SollbuchungsList.setRememberColWidths(true);
SollbuchungsList.setRememberOrder(true);
SollbuchungsList.setSummary(true);
SollbuchungsList.addFeature(new FeatureSummary());
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import de.willuhn.jameica.gui.input.TextInput;
import de.willuhn.jameica.gui.parts.Column;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.gui.parts.table.FeatureSummary;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

Expand Down Expand Up @@ -375,7 +376,7 @@ public Part getAbrechungslaeufeList() throws RemoteException
abrechnungslaufList.setContextMenu(new AbrechnungslaufMenu());
abrechnungslaufList.setRememberColWidths(true);
abrechnungslaufList.setRememberOrder(true);
abrechnungslaufList.setSummary(true);
abrechnungslaufList.addFeature(new FeatureSummary());
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/de/jost_net/JVerein/gui/control/AdresstypControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import de.willuhn.jameica.gui.input.Input;
import de.willuhn.jameica.gui.input.TextInput;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.gui.parts.table.FeatureSummary;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

Expand Down Expand Up @@ -125,7 +126,7 @@ public Part getAdresstypList() throws RemoteException
adresstypList.setContextMenu(new AdresstypMenu());
adresstypList.setRememberColWidths(true);
adresstypList.setRememberOrder(true);
adresstypList.setSummary(true);
adresstypList.addFeature(new FeatureSummary());
return adresstypList;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import de.willuhn.jameica.gui.input.DecimalInput;
import de.willuhn.jameica.gui.input.TextInput;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.gui.parts.table.FeatureSummary;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

Expand Down Expand Up @@ -165,7 +166,7 @@ public Part getAnfangsbestandList() throws RemoteException
anfangsbestandList.setRememberColWidths(true);
anfangsbestandList.setContextMenu(new AnfangsbestandMenu());
anfangsbestandList.setRememberOrder(true);
anfangsbestandList.setSummary(false);
anfangsbestandList.removeFeature(FeatureSummary.class);
return anfangsbestandList;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ else if (juengstesBuchungsDatum.before(datum))
private String formatWert(double wert)
{
if (wert != 0d)
return wertFormater.format(new Double(wert));
return wertFormater.format(Double.valueOf(wert));
return "\\";
}

Expand Down
7 changes: 4 additions & 3 deletions src/de/jost_net/JVerein/gui/control/BuchungsartControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import de.willuhn.jameica.gui.parts.Button;
import de.willuhn.jameica.gui.parts.Column;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.gui.parts.table.FeatureSummary;
import de.willuhn.jameica.system.Application;
import de.willuhn.jameica.system.BackgroundTask;
import de.willuhn.logging.Logger;
Expand Down Expand Up @@ -247,7 +248,7 @@ public SelectInput getSteuerBuchungsart() throws RemoteException
Boolean hasSteuersatz = ((getSteuersatz().getValue() != null) && (getSteuersatz().getValue().toString().length() > 0)) ? true : false;

DBIterator<Buchungsart> it = (!isSpende && hasSteuersatz) ? getFilteredBuchungsart() : null;
steuer_buchungsart = new SelectInput(it, null);
steuer_buchungsart = new SelectInput(PseudoIterator.asList(it), null);
if (it != null)
{
List<Buchungsart> buchungsartenListe = it != null ? PseudoIterator.asList(it) : null;
Expand Down Expand Up @@ -377,7 +378,7 @@ public void handleStore()
GenericObject o = (GenericObject) getBuchungsklasse().getValue();
if (o != null)
{
b.setBuchungsklasse(new Integer(o.getID()));
b.setBuchungsklasse(Integer.valueOf(o.getID()));
}
else
{
Expand Down Expand Up @@ -507,7 +508,7 @@ public String format(Object o)
buchungsartList.setRememberColWidths(true);
buchungsartList.setRememberOrder(true);
buchungsartList.setRememberState(true);
buchungsartList.setSummary(true);
buchungsartList.addFeature(new FeatureSummary());
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import de.willuhn.jameica.gui.input.IntegerInput;
import de.willuhn.jameica.gui.input.TextInput;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.gui.parts.table.FeatureSummary;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

Expand Down Expand Up @@ -131,7 +132,7 @@ public Part getBuchungsklasseList() throws RemoteException
buchungsklassenList.setContextMenu(new BuchungsklasseMenu());
buchungsklassenList.setRememberColWidths(true);
buchungsklassenList.setRememberOrder(true);
buchungsklassenList.setSummary(true);
buchungsklassenList.addFeature(new FeatureSummary());
return buchungsklassenList;
}
}
3 changes: 2 additions & 1 deletion src/de/jost_net/JVerein/gui/control/DokumentControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import de.willuhn.jameica.gui.input.FileInput;
import de.willuhn.jameica.gui.parts.Button;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.gui.parts.table.FeatureSummary;
import de.willuhn.jameica.messaging.Message;
import de.willuhn.jameica.messaging.MessageConsumer;
import de.willuhn.jameica.messaging.QueryMessage;
Expand Down Expand Up @@ -208,7 +209,7 @@ public Part getDokumenteList(AbstractDokument doc) throws RemoteException
docsList.setRememberColWidths(true);
docsList.setContextMenu(new DokumentMenu(enabled));
docsList.setRememberOrder(true);
docsList.setSummary(true);
docsList.addFeature(new FeatureSummary());
this.mc = new DokumentMessageConsumer();
Application.getMessagingFactory().registerMessageConsumer(this.mc);

Expand Down
5 changes: 3 additions & 2 deletions src/de/jost_net/JVerein/gui/control/EigenschaftControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import de.willuhn.jameica.gui.input.SelectInput;
import de.willuhn.jameica.gui.input.TextInput;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.gui.parts.table.FeatureSummary;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

Expand Down Expand Up @@ -111,7 +112,7 @@ public void handleStore()
{
if (o != null)
{
ei.setEigenschaftGruppe(new Integer(o.getID()));
ei.setEigenschaftGruppe(Integer.valueOf(o.getID()));
}
else
{
Expand Down Expand Up @@ -152,7 +153,7 @@ public Part getEigenschaftList() throws RemoteException
eigenschaftList.setRememberColWidths(true);
eigenschaftList.setRememberOrder(true);
eigenschaftList.setRememberState(true);
eigenschaftList.setSummary(true);
eigenschaftList.addFeature(new FeatureSummary());
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ else if (b.equalsIgnoreCase("true") || b.equalsIgnoreCase("ja"))
{
Zusatzfelder z1 = (Zusatzfelder) Einstellungen.getDBService()
.createObject(Zusatzfelder.class, z.getID());
z1.setFeldWaehrung(new BigDecimal(doub.doubleValue()));
z1.setFeldWaehrung(BigDecimal.valueOf(doub.doubleValue()));
z1.setFeld(null);
z1.store();
}
Expand Down
3 changes: 2 additions & 1 deletion src/de/jost_net/JVerein/gui/control/FormularControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import de.willuhn.jameica.gui.input.TextInput;
import de.willuhn.jameica.gui.parts.Column;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.jameica.gui.parts.table.FeatureSummary;
import de.willuhn.logging.Logger;
import de.willuhn.util.ApplicationException;

Expand Down Expand Up @@ -263,7 +264,7 @@ public Part getFormularList() throws RemoteException
formularList.setRememberColWidths(true);
formularList.setContextMenu(new FormularMenu(this));
formularList.setRememberOrder(true);
formularList.setSummary(false);
formularList.removeFeature(FeatureSummary.class);
return formularList;
}

Expand Down
Loading

0 comments on commit 0623ee9

Please sign in to comment.