From 45c1396e0e604111c78725034bdb8dcc8f0a23bf Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 27 Feb 2021 13:59:00 +0000 Subject: [PATCH] move interface to primitive types --- .../database/sqlite/AbstractTxStream.java | 4 ++-- .../database/sqlite/SQLiteDbLoader.java | 2 +- .../minres/scviewer/database/sqlite/Tx.java | 18 +++++++++--------- .../scviewer/database/sqlite/TxEvent.java | 2 +- .../scviewer/database/sqlite/TxGenerator.java | 4 ++-- .../scviewer/database/sqlite/TxStream.java | 6 +++--- .../database/text/AbstractTxStream.java | 6 +++--- .../scviewer/database/text/TextDbLoader.java | 2 +- .../com/minres/scviewer/database/text/Tx.java | 10 +++++----- .../minres/scviewer/database/text/TxEvent.java | 2 +- .../scviewer/database/text/TxGenerator.java | 2 +- .../scviewer/database/text/TxStream.java | 2 +- .../scviewer/database/vcd/VCDDbLoader.java | 2 +- .../scviewer/database/vcd/VCDSignal.java | 8 ++++---- .../minres/scviewer/database/EventList.java | 1 - .../minres/scviewer/database/IWaveform.java | 6 +++--- .../minres/scviewer/database/IWaveformDb.java | 2 +- .../scviewer/database/IWaveformDbLoader.java | 2 +- .../scviewer/database/internal/WaveformDb.java | 4 ++-- .../com/minres/scviewer/database/tx/ITx.java | 6 +++--- .../minres/scviewer/database/tx/ITxEvent.java | 2 +- .../e4/application/parts/TransactionList.java | 2 +- .../txTableTree/AttributeLabelProvider.java | 2 +- .../ui/views/sections/RelatedProperty.java | 4 ++-- .../database/test/DatabaseServicesTest.java | 6 +++--- 25 files changed, 53 insertions(+), 54 deletions(-) diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/AbstractTxStream.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/AbstractTxStream.java index 37d3c34..cb46eff 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/AbstractTxStream.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/AbstractTxStream.java @@ -90,7 +90,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform { protected abstract Map getTransactions(); @Override - public IEvent[] getEventsAtTime(Long time) { + public IEvent[] getEventsAtTime(long time) { return getEvents().get(time); } @@ -105,7 +105,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform { } @Override - public IEvent[] getEventsBeforeTime(Long time) { + public IEvent[] getEventsBeforeTime(long time) { EventEntry e = events.floorEntry(time); if(e==null) return new IEvent[]{}; diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java index cb13a1f..cf027af 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java @@ -48,7 +48,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader { protected PropertyChangeSupport pcs = new PropertyChangeSupport(this); @Override - public Long getMaxTime() { + public long getMaxTime() { SQLiteDatabaseSelectHandler handler = new SQLiteDatabaseSelectHandler<>(ScvTxEvent.class, database, "time = (SELECT MAX(time) FROM ScvTxEvent)"); try { diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java index d3ed2ec..634818b 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java @@ -37,8 +37,8 @@ public class Tx implements ITx { private TxGenerator trGenerator; private ScvTx scvTx; private List attributes; - private Long begin; - private Long end; + private long begin=-1; + private long end=-1; private List incoming; private List outgoing; @@ -50,7 +50,7 @@ public class Tx implements ITx { } @Override - public Long getId() { + public long getId() { return (long) scvTx.getId(); } @@ -69,8 +69,8 @@ public class Tx implements ITx { } @Override - public Long getBeginTime() { - if(begin==null){ + public long getBeginTime() { + if(begin<0){ SQLiteDatabaseSelectHandler handler = new SQLiteDatabaseSelectHandler<>(ScvTxEvent.class, database, "tx="+scvTx.getId()+" AND type="+ AssociationType.BEGIN.ordinal()); try { @@ -85,8 +85,8 @@ public class Tx implements ITx { } @Override - public Long getEndTime() { - if(end==null){ + public long getEndTime() { + if(end<0){ SQLiteDatabaseSelectHandler handler = new SQLiteDatabaseSelectHandler<>(ScvTxEvent.class, database, "tx="+scvTx.getId()+" AND type="+ AssociationType.END.ordinal()); try { @@ -178,11 +178,11 @@ public class Tx implements ITx { @Override public int compareTo(ITx o) { - int res = this.getBeginTime().compareTo(o.getBeginTime()); + int res = Long.compare(this.getBeginTime(), o.getBeginTime()); if(res!=0) return res; else - return this.getId().compareTo(o.getId()); + return Long.compare(this.getId(), o.getId()); } @Override diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java index b52bc41..14d5b6f 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java @@ -28,7 +28,7 @@ public class TxEvent implements ITxEvent { } @Override - public Long getTime() { + public long getTime() { return type==EventKind.BEGIN?tx.getBeginTime():tx.getEndTime(); } diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java index 45002a4..c773d84 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java @@ -39,7 +39,7 @@ public class TxGenerator extends AbstractTxStream { } @Override - public Long getId() { + public long getId() { return (long) scvGenerator.getId(); } @@ -50,7 +50,7 @@ public class TxGenerator extends AbstractTxStream { @Override public boolean isSame(IWaveform other) { - return(other instanceof TxGenerator && this.getId().equals(other.getId())); + return(other instanceof TxGenerator && this.getId() == other.getId()); } @Override diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java index 35da3e4..a628600 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java @@ -49,7 +49,7 @@ public class TxStream extends AbstractTxStream { } @Override - public Long getId() { + public long getId() { return (long) scvStream.getId(); } @@ -89,13 +89,13 @@ public class TxStream extends AbstractTxStream { } @Override - public IEvent[] getEventsAtTime(Long time) { + public IEvent[] getEventsAtTime(long time) { return getEvents().get(time); } @Override public boolean isSame(IWaveform other) { - return(other instanceof TxStream && this.getId().equals(other.getId())); + return(other instanceof TxStream && this.getId() == other.getId()); } @Override diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/AbstractTxStream.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/AbstractTxStream.java index a5c98ac..111552f 100644 --- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/AbstractTxStream.java +++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/AbstractTxStream.java @@ -93,7 +93,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform { * @return the events at time */ @Override - public IEvent[] getEventsAtTime(Long time) { + public IEvent[] getEventsAtTime(long time) { return events.get(time); } @@ -104,7 +104,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform { * @return the events before time */ @Override - public IEvent[] getEventsBeforeTime(Long time) { + public IEvent[] getEventsBeforeTime(long time) { EventEntry e = events.floorEntry(time); if (e == null) return new IEvent[] {}; @@ -128,7 +128,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform { * @return the id */ @Override - public Long getId() { + public long getId() { return id; } diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java index 0ec1809..c1afaa9 100644 --- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java +++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java @@ -131,7 +131,7 @@ public class TextDbLoader implements IWaveformDbLoader { * @return the max time */ @Override - public Long getMaxTime() { + public long getMaxTime() { return maxTime; } diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/Tx.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/Tx.java index 9b1b9d6..88af0bf 100644 --- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/Tx.java +++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/Tx.java @@ -102,11 +102,11 @@ class Tx implements ITx { */ @Override public int compareTo(ITx o) { - int res = getBeginTime().compareTo(o.getBeginTime()); + int res = Long.compare(getBeginTime(), o.getBeginTime()); if (res != 0) return res; else - return getId().compareTo(o.getId()); + return Long.compare(getId(), o.getId()); } /** @@ -150,7 +150,7 @@ class Tx implements ITx { * @return the id */ @Override - public Long getId() { + public long getId() { return getScvTx().id; } @@ -180,7 +180,7 @@ class Tx implements ITx { * @return the begin time */ @Override - public Long getBeginTime() { + public long getBeginTime() { if (beginTime < 0) { ScvTx tx = scvTx==null?loader.getScvTx(id):getScvTx(); beginTime = tx.beginTime; @@ -195,7 +195,7 @@ class Tx implements ITx { * @return the end time */ @Override - public Long getEndTime() { + public long getEndTime() { if (endTime < 0) { ScvTx tx = scvTx==null?loader.getScvTx(id):getScvTx(); beginTime = tx.beginTime; diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.java index 5758e8e..607b25f 100644 --- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.java +++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.java @@ -95,7 +95,7 @@ class TxEvent implements ITxEvent { * @return the time */ @Override - public Long getTime() { + public long getTime() { return time; } diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.java index a6597d1..3dbd7e4 100644 --- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.java +++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.java @@ -52,7 +52,7 @@ class TxGenerator extends AbstractTxStream { */ @Override public boolean isSame(IWaveform other) { - return (other instanceof TxGenerator && this.getId().equals(other.getId())); + return (other instanceof TxGenerator && this.getId()==other.getId()); } /** diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxStream.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxStream.java index 47e8112..2b07cad 100644 --- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxStream.java +++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxStream.java @@ -42,7 +42,7 @@ class TxStream extends AbstractTxStream { */ @Override public boolean isSame(IWaveform other) { - return (other instanceof TxStream && this.getId().equals(other.getId())); + return (other instanceof TxStream && this.getId() == other.getId()); } /** diff --git a/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java b/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java index 03fbc96..1bf27e9 100644 --- a/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java +++ b/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java @@ -146,7 +146,7 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder { * @see com.minres.scviewer.database.ITrDb#getMaxTime() */ @Override - public Long getMaxTime() { + public long getMaxTime() { return maxTime; } diff --git a/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java b/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java index bb950f3..68b0127 100644 --- a/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java +++ b/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java @@ -62,7 +62,7 @@ public class VCDSignal extends HierNode implements IWaveform { } @Override - public Long getId() { + public long getId() { return id; } @@ -76,12 +76,12 @@ public class VCDSignal extends HierNode implements IWaveform { } @Override - public IEvent[] getEventsAtTime(Long time) { + public IEvent[] getEventsAtTime(long time) { return values.get(time); } @Override - public IEvent[] getEventsBeforeTime(Long time) { + public IEvent[] getEventsBeforeTime(long time) { EventEntry e = values.floorEntry(time); if(e==null) return new IEvent[] {}; @@ -91,7 +91,7 @@ public class VCDSignal extends HierNode implements IWaveform { @Override public boolean isSame(IWaveform other) { - return( other instanceof VCDSignal && this.getId().equals(other.getId())); + return( other instanceof VCDSignal && this.getId() == other.getId()); } @Override diff --git a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/EventList.java b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/EventList.java index 84228fd..c5a7fea 100644 --- a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/EventList.java +++ b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/EventList.java @@ -1,7 +1,6 @@ package com.minres.scviewer.database; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; diff --git a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java index ef3b2ee..a558c1b 100644 --- a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java +++ b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java @@ -24,7 +24,7 @@ public interface IWaveform extends IHierNode { * * @return the id */ - public Long getId(); + public long getId(); /** * Checks if is same. @@ -47,7 +47,7 @@ public interface IWaveform extends IHierNode { * @param time the time * @return the events at time */ - public IEvent[] getEventsAtTime(Long time); + public IEvent[] getEventsAtTime(long time); /** * Gets the events before time. @@ -55,7 +55,7 @@ public interface IWaveform extends IHierNode { * @param time the time * @return the events before time */ - public IEvent[] getEventsBeforeTime(Long time); + public IEvent[] getEventsBeforeTime(long time); /** * Gets the type. diff --git a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDb.java b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDb.java index f4e60fa..3534a9a 100644 --- a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDb.java +++ b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDb.java @@ -23,7 +23,7 @@ public interface IWaveformDb extends IHierNode { * * @return the max time */ - public Long getMaxTime(); + public long getMaxTime(); /** * Gets the stream by name. diff --git a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java index 740f6cf..3a56058 100644 --- a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java +++ b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java @@ -69,7 +69,7 @@ public interface IWaveformDbLoader { * * @return the max time */ - public Long getMaxTime(); + public long getMaxTime(); /** * Gets the all waves. diff --git a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/internal/WaveformDb.java b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/internal/WaveformDb.java index c4d829f..49aaf4a 100644 --- a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/internal/WaveformDb.java +++ b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/internal/WaveformDb.java @@ -45,7 +45,7 @@ public class WaveformDb extends HierNode implements IWaveformDb, PropertyChangeL private Map waveforms; /** The max time. */ - private Long maxTime; + private long maxTime = -1; /** * Bind. @@ -90,7 +90,7 @@ public class WaveformDb extends HierNode implements IWaveformDb, PropertyChangeL * @return the max time */ @Override - public Long getMaxTime() { + public long getMaxTime() { return maxTime; } diff --git a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITx.java b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITx.java index f539270..c9c69a5 100644 --- a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITx.java +++ b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITx.java @@ -25,7 +25,7 @@ public interface ITx extends Comparable { * * @return the id */ - public Long getId(); + public long getId(); /** * Gets the stream. @@ -46,14 +46,14 @@ public interface ITx extends Comparable { * * @return the begin time */ - public Long getBeginTime(); + public long getBeginTime(); /** * Gets the end time. * * @return the end time */ - public Long getEndTime(); + public long getEndTime(); /** * Gets the attributes. diff --git a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITxEvent.java b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITxEvent.java index 9f417a9..2bd5f33 100644 --- a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITxEvent.java +++ b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITxEvent.java @@ -22,7 +22,7 @@ public interface ITxEvent extends IEvent { * * @return the time */ - public Long getTime(); + public long getTime(); /** * Gets the transaction. diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java index 805af8b..1bfa169 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java @@ -260,7 +260,7 @@ public class TransactionList extends Composite { tx.getAttributes().forEach(attr -> propNames.put(attr.getName(), attr.getDataType())); return tx; }) - .sorted((t1, t2)-> t1.getBeginTime().compareTo(t2.getBeginTime())) + .sorted((t1, t2)-> Long.compare(t1.getBeginTime(),t2.getBeginTime())) .collect(Collectors.toList()); final List newAttrNames=propNames.entrySet().stream() .sorted((e1,e2)->e1.getKey().compareTo(e2.getKey())) diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AttributeLabelProvider.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AttributeLabelProvider.java index 10e4b33..9daf7bf 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AttributeLabelProvider.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AttributeLabelProvider.java @@ -69,7 +69,7 @@ public class AttributeLabelProvider extends LabelProvider implements IStyledLabe ITx iTx = (ITx) element; switch(field){ case NAME: - return new StyledString(iTx.getId().toString()); + return new StyledString(String.format("%d", iTx.getId())); case TX_TIME: return new StyledString(waveformViewerPart.getScaledTime(iTx.getBeginTime())); case TYPE: diff --git a/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/RelatedProperty.java b/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/RelatedProperty.java index 1833506..4ae1ecf 100644 --- a/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/RelatedProperty.java +++ b/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/RelatedProperty.java @@ -182,9 +182,9 @@ public class RelatedProperty extends AbstractPropertySection implements ISelecti else if (columnIndex == 2 && element instanceof ITxRelation){ ITxRelation rel = (ITxRelation) element; if(rel.getTarget()==iTr) - return ((ITxRelation) element).getSource().getId().toString(); + return String.format("%d", ((ITxRelation) element).getSource().getId()); else - return ((ITxRelation) element).getTarget().getId().toString(); + return String.format("%d", ((ITxRelation) element).getTarget().getId()); } else return null; diff --git a/tests/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java b/tests/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java index 53e02a5..21c3ac4 100644 --- a/tests/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java +++ b/tests/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java @@ -76,11 +76,11 @@ public class DatabaseServicesTest { assertEquals(3, waveforms.size()); assertEquals(1, waveformDb.getChildNodes().size()); for(IWaveform w:waveforms) { - if(w.getId().equals(1l)) { + if(w.getId()==1) { assertEquals(2, w.getRowCount()); - } else if(w.getId().equals(2l)) { + } else if(w.getId()==2l) { assertEquals(1, w.getRowCount()); - } else if(w.getId().equals(3l)) { + } else if(w.getId()==3l) { assertEquals(1, w.getRowCount()); } }