From 12a7c701e392b59dfdd1a1912906d4853b167ad5 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 22 Feb 2023 07:45:22 +0100 Subject: [PATCH] cleans imports and other warnings --- .../scviewer/database/ftr/AbstractTxStream.java | 3 +-- .../scviewer/database/ftr/FtrDbLoader.java | 3 +-- .../database/ftr/FtrDbLoaderFactory.java | 8 +------- .../scviewer/database/ftr/FtrRelation.java | 4 ++-- .../com/minres/scviewer/database/ftr/FtrTx.java | 6 +----- .../com/minres/scviewer/database/ftr/Tx.java | 1 - .../scviewer/database/ftr/TxAttribute.java | 3 +-- .../scviewer/database/ftr/TxAttributeType.java | 3 +-- .../minres/scviewer/database/ftr/TxEvent.java | 4 ++-- .../scviewer/database/ftr/TxGenerator.java | 3 +-- .../scviewer/database/ftr/TxRelation.java | 4 ++-- .../minres/scviewer/database/ftr/TxStream.java | 3 +-- .../database/sqlite/SQLiteDbLoader.java | 4 ---- .../database/text/TextDbLoaderFactory.java | 17 ----------------- .../scviewer/database/internal/WaveformDb.java | 2 -- .../database/test/DatabaseServicesTest.java | 4 ---- 16 files changed, 14 insertions(+), 58 deletions(-) diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/AbstractTxStream.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/AbstractTxStream.java index 1c2eff4..ac98dfc 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/AbstractTxStream.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/AbstractTxStream.java @@ -1,6 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working - * Copyright (c) 2020 MINRES Technologies GmbH + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java index 1157f0f..5aa4b21 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java @@ -1,6 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. - * Copyright (c) 2020 MINRES Technologies GmbH + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoaderFactory.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoaderFactory.java index 3ac082d..c4d0338 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoaderFactory.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoaderFactory.java @@ -1,6 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. - * Copyright (c) 2020 MINRES Technologies GmbH + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,18 +10,13 @@ *******************************************************************************/ package com.minres.scviewer.database.ftr; -import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.util.zip.GZIPInputStream; - -import org.apache.commons.compress.compressors.lz4.FramedLZ4CompressorInputStream; import com.minres.scviewer.database.IWaveformDbLoader; import com.minres.scviewer.database.IWaveformDbLoaderFactory; -import com.minres.scviewer.database.ftr.FtrDbLoader.FileType; /** * The Class TextDbLoader. diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrRelation.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrRelation.java index d1663f9..d265c24 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrRelation.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrRelation.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2020 MINRES Technologies GmbH and others. + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * MINRES Technologies GmbH - initial API and implementation + * IT Just working - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database.ftr; diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrTx.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrTx.java index c62766d..f7970ab 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrTx.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrTx.java @@ -1,6 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. - * Copyright (c) 2020 MINRES Technologies GmbH + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,7 +10,6 @@ *******************************************************************************/ package com.minres.scviewer.database.ftr; -import java.io.ByteArrayInputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -19,8 +17,6 @@ import java.util.List; import com.minres.scviewer.database.InputFormatException; import com.minres.scviewer.database.tx.ITxAttribute; -import jacob.CborDecoder; - /** * The Class ScvTx. */ diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/Tx.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/Tx.java index 9cc0bf8..884efcc 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/Tx.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/Tx.java @@ -17,7 +17,6 @@ import java.util.Set; import java.util.stream.Collectors; import com.minres.scviewer.database.IWaveform; -import com.minres.scviewer.database.InputFormatException; import com.minres.scviewer.database.tx.ITx; import com.minres.scviewer.database.tx.ITxAttribute; import com.minres.scviewer.database.tx.ITxRelation; diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxAttribute.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxAttribute.java index c29fe26..19042a9 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxAttribute.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxAttribute.java @@ -1,6 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. - * Copyright (c) 2020 MINRES Technologies GmbH + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxAttributeType.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxAttributeType.java index 7d6ad91..da21ec5 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxAttributeType.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxAttributeType.java @@ -1,6 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. - * Copyright (c) 2020 MINRES Technologies GmbH + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxEvent.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxEvent.java index 18275fb..1146cc1 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxEvent.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxEvent.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2020 MINRES Technologies GmbH and others. + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * MINRES Technologies GmbH - initial API and implementation + * IT Just working - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database.ftr; diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxGenerator.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxGenerator.java index d32d01f..fe11811 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxGenerator.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxGenerator.java @@ -1,6 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. - * Copyright (c) 2020 MINRES Technologies GmbH + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxRelation.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxRelation.java index b717b1f..0f1e8ba 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxRelation.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxRelation.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2020 MINRES Technologies GmbH and others. + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * MINRES Technologies GmbH - initial API and implementation + * IT Just working - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database.ftr; diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxStream.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxStream.java index 1a3c2f0..b47f1ef 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxStream.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/TxStream.java @@ -1,6 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. - * Copyright (c) 2020 MINRES Technologies GmbH + * Copyright (c) 2023 MINRES Technologies GmbH * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at 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 189229e..7a47697 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 @@ -14,8 +14,6 @@ import java.beans.IntrospectionException; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.util.ArrayList; @@ -42,8 +40,6 @@ public class SQLiteDbLoader implements IWaveformDbLoader { private ScvSimProps scvSimProps; - private static final byte[] x = "SQLite format 3".getBytes(); - /** The pcs. */ protected PropertyChangeSupport pcs = new PropertyChangeSupport(this); diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoaderFactory.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoaderFactory.java index dc70190..7bb9c88 100644 --- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoaderFactory.java +++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoaderFactory.java @@ -11,7 +11,6 @@ *******************************************************************************/ package com.minres.scviewer.database.text; -import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -32,22 +31,6 @@ public class TextDbLoaderFactory implements IWaveformDbLoaderFactory { /** The Constant x. */ static final byte[] x = "scv_tr_stream".getBytes(); - /** - * Checks if f is gzipped. - * - * @param f the f - * @return true, if is gzipped - */ - private static boolean isGzipped(File f) { - try (InputStream is = new FileInputStream(f)) { - byte[] signature = new byte[2]; - int nread = is.read(signature); // read the gzip signature - return nread == 2 && signature[0] == (byte) 0x1f && signature[1] == (byte) 0x8b; - } catch (IOException e) { - return false; - } - } - /** * Can load. * 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 4cc15c3..64961e3 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 @@ -20,8 +20,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import javax.inject.Inject; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 36d7b88..b0d8293 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 @@ -15,11 +15,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; -import java.util.Arrays; -import java.util.Collections; import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; import org.junit.After; import org.junit.Before;