fixes a missing increment statement

This commit is contained in:
Eyck Jentzsch 2024-01-27 14:56:21 +01:00
parent e472a092c3
commit c4fafae029
6 changed files with 13 additions and 23 deletions

View File

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CBOR transaction database
Bundle-SymbolicName: com.minres.scviewer.database.ftr
Bundle-Version: 1.0.1.qualifier
Bundle-Version: 1.0.2.qualifier
Bundle-Vendor: MINRES Technologies GmbH
Bundle-RequiredExecutionEnvironment: JavaSE-11
Import-Package: org.osgi.framework;version="1.3.0",

View File

@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>com.minres.scviewer.database.ftr</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>

View File

@ -297,10 +297,10 @@ public class FtrDbLoader implements IWaveformDbLoader {
case 6: // id/generator/start/end
long len = cborDecoder.readArrayLength();
assert(len==4);
cborDecoder.readInt();
cborDecoder.readInt();
cborDecoder.readInt();
cborDecoder.readInt();
cborDecoder.readInt(); //txid
cborDecoder.readInt(); // genId
cborDecoder.readInt(); // startTime
cborDecoder.readInt(); // endTime
break;
default: { // skip over 7:begin attr, 8:record attr, 9:end attr
long sz = cborDecoder.readArrayLength();

View File

@ -77,8 +77,8 @@ class FtrTx implements Serializable {
public List<ITxAttribute> getAttributes(FtrDbLoader loader) {
if(attributes.size()==0)
try {
TxStream stream = loader.txStreams.get(streamId);
byte[] chunk = stream.getChunks().get((int)blockId);
final TxStream stream = loader.txStreams.get(streamId);
final byte[] chunk = stream.getChunks().get((int)blockId);
attributes.addAll(loader.parseAtrributes(chunk, blockOffset));
} catch (InputFormatException e) {
// TODO Auto-generated catch block

View File

@ -70,7 +70,7 @@ class TxGenerator extends AbstractTxStream {
List<byte[]> chunks = stream.getChunks();
int blockid = 0;
for (byte[] bs : chunks) {
loader.parseTx(stream, blockid, bs);
loader.parseTx(stream, blockid++, bs);
}
} catch (InputFormatException e) {
// TODO Auto-generated catch block

View File

@ -15,10 +15,10 @@ import java.beans.PropertyChangeListener;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -44,13 +44,13 @@ public class WaveformDb extends HierNode implements IWaveformDb, PropertyChangeL
private boolean loaded;
/** The relation types. */
private List<RelationType> relationTypes;
private List<RelationType> relationTypes = new ArrayList<>();;
/** The waveforms. */
private Map<String, IWaveform> waveforms;
private Map<String, IWaveform> waveforms = Collections.synchronizedMap(new HashMap<>()) ;;
/** The max time. */
private long maxTime = -1;
private long maxTime = 0L;
private static final Logger LOG = LoggerFactory.getLogger(WaveformDb.class);
@ -81,16 +81,6 @@ public class WaveformDb extends HierNode implements IWaveformDb, PropertyChangeL
return Collections.unmodifiableList(loaderFactories);
}
/**
* Instantiates a new waveform db.
*/
public WaveformDb() {
super();
waveforms = new ConcurrentHashMap<>();
relationTypes = new ArrayList<>();
maxTime = 0L;
}
/**
* Gets the max time.
*