Commit f66b5eae authored by Uwe Peuker's avatar Uwe Peuker

Code-Bereinigung

parent 8cf3533d
......@@ -31,7 +31,6 @@ import de.bsvrz.dav.daf.main.config.SystemObject;
import de.bsvrz.sys.funclib.losb.exceptions.FailureException;
import de.bsvrz.sys.funclib.losb.kernsoftware.ConnectionManager;
import de.bsvrz.sys.funclib.losb.ringbuffer.RingBuffer;
import jdk.nashorn.internal.ir.ThrowNode;
/**
* Klasse die den Empfang von Daten über den Datenverteiler übernimmt. Eingehende Daten werden nur gespeichert, wenn diese einen Datenteil haben. Außerdem
......@@ -86,7 +85,7 @@ public abstract class AnswerReceiver implements ClientReceiverInterface {
this.requestId = requestId;
this.dav = dav;
this.receiver = receiver;
incoming = new RingBuffer<ResultData>(INITIAL_RINGBUFFER_SIZE, RingBuffer.UNBOUNDED_SIZE);
incoming = new RingBuffer<>(INITIAL_RINGBUFFER_SIZE, RingBuffer.UNBOUNDED_SIZE);
DataModel model = dav.getDataModel();
this.dataDescription = new DataDescription(model.getAttributeGroup(atg), model.getAspect(asp));
......
......@@ -125,7 +125,7 @@ public class CmdPua {
/////////////// Klassenvariablen und Methoden
/** Kommandozeilen-Paramter */
public HashMap<String, String> parameter = new HashMap<String, String>();
public HashMap<String, String> parameter = new HashMap<>();
/** Datenverteiler */
public ClientDavInterface dav = null;
......@@ -393,7 +393,7 @@ public class CmdPua {
// bla=ex, blub=exs, ere=as
String[] bind = (this.parameter.get("bindungen") == null) ? null : this.parameter.get("bindungen").split(",");
Hashtable<String, String> aspBindings = new Hashtable<String, String>();
Hashtable<String, String> aspBindings = new Hashtable<>();
for(int i = 0; (bind != null && i < bind.length); i++) {
aspBindings.put(bind[i].split("=")[0].trim(), bind[i].split("=")[1].trim());
}
......@@ -406,7 +406,7 @@ public class CmdPua {
}
// (123-234) (234-345)
List<Tuple<Long, Long>> periodList = new ArrayList<Tuple<Long, Long>>();
List<Tuple<Long, Long>> periodList = new ArrayList<>();
String periods = this.parameter.get("zeitbereich");
if(periods != null) {
String[] pList = periods.replace(" ", "").split(",");
......@@ -416,7 +416,7 @@ public class CmdPua {
//unterscheiden zwischen Angabe im ms-Format oder ähnlich wie im Protokoll selbst
try {
periodList.add(new Tuple<Long, Long>(new Long(first), new Long(last)));
periodList.add(new Tuple<>(new Long(first), new Long(last)));
}
catch(NumberFormatException nfe) {
try {
......@@ -426,7 +426,7 @@ public class CmdPua {
gc.clear();
gc.setTime(_sdf.parse(last));
long end = gc.getTimeInMillis();
periodList.add(new Tuple<Long, Long>(start, end));
periodList.add(new Tuple<>(start, end));
}
catch(ParseException e) {
throw new FailureException(
......@@ -441,7 +441,7 @@ public class CmdPua {
// (alias1,alias2) = (def1_1,def2_1) (def1_2, def2_2)
// -> tmp[0] = (alias1,alias2)
// -> tmp[1] = (def_1,def_2)(def_1,def_2)
Hashtable<String, String[]> pseudoObjects = new Hashtable<String, String[]>();
Hashtable<String, String[]> pseudoObjects = new Hashtable<>();
String pseuObj = (this.parameter.get("pseudoobjekte") == null) ? "" : this.parameter.get("pseudoobjekte");
if(!pseuObj.equals("")) {
String[] tmp = pseuObj.replace(" ", "").split("=");
......
......@@ -194,7 +194,7 @@ class ProtocolTableModel extends AbstractTableModel {
String header[];
/** Werte */
ArrayList<ProtocolResult> rows = new ArrayList<ProtocolResult>(500);
ArrayList<ProtocolResult> rows = new ArrayList<>(500);
/** Aggregationsdatensatz */
private ProtocolAggregationData pad = null;
......
......@@ -115,7 +115,7 @@ public class PuaClient implements AutoCloseable {
private static final long PROTOCOL_COMPLETION_INTERFACE_ID = -1;
private final Set<ProtocolListenerEx> _protocolListeners = new HashSet<ProtocolListenerEx>();
private final Set<ProtocolListenerEx> _protocolListeners = new HashSet<>();
private final Set<StatusListener> _statusListeners = new CopyOnWriteArraySet<>();
......@@ -795,7 +795,7 @@ public class PuaClient implements AutoCloseable {
}
Tuple<Long, ProcessingParameter>[] result = new Tuple[protocolIds.length];
for(int i = 0; i < protocolIds.length; i++) {
result[i] = new Tuple<Long, ProcessingParameter>(protocolIds[i], pp[i]);
result[i] = new Tuple<>(protocolIds[i], pp[i]);
}
resultInfo.setSuccessful();
......
......@@ -55,7 +55,7 @@ public class ProtocolAggregationData implements ProtocolResult {
* @param orders Orders*/
public ProtocolAggregationData(int size, final List<ProcessingInformation.ApplyAggregation> orders) {
_orders = orders;
_aggregations = new ArrayList<List<String>>();
_aggregations = new ArrayList<>();
columnDataType = new long[size];
}
......@@ -107,7 +107,7 @@ public class ProtocolAggregationData implements ProtocolResult {
}
public void addAggregations(final List<Class<? extends Aggregation>> aggregationClasses) {
final ArrayList<String> list = new ArrayList<String>(aggregationClasses.size());
final ArrayList<String> list = new ArrayList<>(aggregationClasses.size());
for(final Class<? extends Aggregation> aggregationClass : aggregationClasses) {
try {
list.add(aggregationClass.newInstance().getAggregationName());
......
......@@ -204,7 +204,7 @@ public class ProtocolAggregationResultData implements ProtocolResult {
* @return Liste mit Data-Objekten
*/
public List<ProtocolData> getDataList(final DataModel dataModel){
final List<ProtocolData> result = new ArrayList<ProtocolData>(values.length);
final List<ProtocolData> result = new ArrayList<>(values.length);
for(int i = 0; i < values.length; i++) {
result.add(getData(dataModel, i) );
}
......@@ -284,7 +284,7 @@ public class ProtocolAggregationResultData implements ProtocolResult {
*/
public Map<String, ProtocolData> getAggregations(final DataModel dataModel, final int index){
final List<String> aggregations = getAggregations(index);
final Map<String, ProtocolData> map = new HashMap<String, ProtocolData>(aggregations.size());
final Map<String, ProtocolData> map = new HashMap<>(aggregations.size());
for(int i = 0, aggregationsSize = aggregations.size(); i < aggregationsSize; i++) {
final String aggregationName = aggregations.get(i);
map.put(aggregationName, getData(dataModel, index, i));
......@@ -298,7 +298,7 @@ public class ProtocolAggregationResultData implements ProtocolResult {
* @return Eine Liste über die Spaltenindizes, deren Einträge Maps enthalten, welche die Aggregationen für eine Zelle enthalten und den Data-Objekten zuordnen
*/
public List<Map<String, ProtocolData>> getAggregations(final DataModel dataModel){
final List<Map<String, ProtocolData>> result = new ArrayList<Map<String, ProtocolData>>();
final List<Map<String, ProtocolData>> result = new ArrayList<>();
for (int i = 0; i < values.length; i++){
result.add(getAggregations(dataModel, i) );
}
......@@ -335,7 +335,7 @@ public class ProtocolAggregationResultData implements ProtocolResult {
}
private static ProtocolData createDataArray(final DataModel dataModel, final ResultValue value, final Column column) {
final ArrayList<Data> dataList = new ArrayList<Data>();
final ArrayList<Data> dataList = new ArrayList<>();
for(final ResultValue resultValue : value.getChildren()) {
final ProtocolData data = createDataObject(dataModel, resultValue, column);
dataList.add(data);
......
......@@ -218,7 +218,7 @@ public class ProtocolResultData implements ProtocolResult {
* @return Liste mit Data-Objekten
*/
public List<ProtocolData> getDataList(final DataModel dataModel){
final List<ProtocolData> result = new ArrayList<ProtocolData>(values.length);
final List<ProtocolData> result = new ArrayList<>(values.length);
for(int i = 0; i < values.length; i++) {
result.add(getData(dataModel, i) );
}
......
......@@ -88,8 +88,8 @@ public final class AttributeGroupProtocolData extends ProtocolData {
}
_atomicString = null;
final List<ResultValue> children = _value.getChildren();
_attributeMap = new HashMap<String, AttributeProtocolData>(children.size());
_childrenByIndex = new ArrayList<Data>(children.size());
_attributeMap = new HashMap<>(children.size());
_childrenByIndex = new ArrayList<>(children.size());
_attributeList = _attributeGroup.getAttributes();
for(int i = 0, attributeListSize = _attributeList.size(); i < attributeListSize; i++) {
final Attribute attribute = _attributeList.get(i);
......
......@@ -128,8 +128,8 @@ public class AttributeProtocolData extends ProtocolData {
getName() + ": Die Anzahl der Unterattribute der Attributdefinition stimmt nicht mit der Anzahl der vorhandenen Daten überein"
);
}
_childrenByString = new HashMap<String, AttributeProtocolData>(children.size());
_childrenByIndex = new ArrayList<Data>(children.size());
_childrenByString = new HashMap<>(children.size());
_childrenByIndex = new ArrayList<>(children.size());
for(int i = 0, attributesSize = attributes.size(); i < attributesSize; i++) {
final Attribute attribute = attributes.get(i);
final AttributeProtocolData value = new AttributeProtocolData(attribute, _dataModel, children.get(i));
......
......@@ -43,7 +43,7 @@ import java.util.Map;
*/
public final class MultiColumnProtocolData extends ProtocolData{
private final Map<String, Data> _internalData = new HashMap<String, Data>();
private final Map<String, Data> _internalData = new HashMap<>();
private final List<ProtocolData> _list;
......@@ -69,7 +69,7 @@ public final class MultiColumnProtocolData extends ProtocolData{
@Override
protected List<Data> getChildrenList() {
return new ArrayList<Data>(_list);
return new ArrayList<>(_list);
}
public Data createUnmodifiableCopy() {
......
......@@ -170,7 +170,7 @@ public abstract class ProtocolData implements Data {
* @return flache Kopie des Data-Objektes (Liste von Spaltennamen-Daten-Paaren). Alle enthaltenen Data-Objekte sind Atomar.
*/
public static List<Tuple<String, Data>> convertDataToList(final Data data){
final List<Tuple<String, Data>> result = new ArrayList<Tuple<String, Data>>();
final List<Tuple<String, Data>> result = new ArrayList<>();
recursiveFlattenData(data, result, "");
return result;
}
......@@ -178,7 +178,7 @@ public abstract class ProtocolData implements Data {
private static void recursiveFlattenData(final Data data, final List<Tuple<String, Data>> result, final String prefix) {
final String myName = prefix + data.getName();
if(data.isPlain()) {
result.add(new Tuple<String, Data>(myName, data));
result.add(new Tuple<>(myName, data));
}
else if(data.isArray()) {
int i = 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -286,7 +286,7 @@ public ProtocolTreeWalker() {
AST f1 = null;
AST ast = null;
ArrayList<String> v = new ArrayList<String>();
ArrayList<String> v = new ArrayList<>();
String alsName = null, y = null;
......@@ -438,7 +438,7 @@ public ProtocolTreeWalker() {
AST a = null;
AST na = null;
ArrayList<String> v = new ArrayList<String>();
ArrayList<String> v = new ArrayList<>();
String alsName = null;
......
......@@ -32,34 +32,34 @@ import java.util.*;
public class PrettyPrinter {
/** Enthaelt alle Zeichenketten, vor denen ein Zeilenumbruch eingefuegt werden soll. */
private static HashSet<String> NEW_LINE_BEFORE = new HashSet<String>();
private static HashSet<String> NEW_LINE_BEFORE = new HashSet<>();
/** Enthaelt alle Zeichenketten, nach denen ein Zeilenumbruch eingefuegt werden soll. */
private static HashSet<String> NEW_LINE_AFTER = new HashSet<String>();
private static HashSet<String> NEW_LINE_AFTER = new HashSet<>();
/** Enthaelt alle Zeichenketten, die als Schluesselwort definiert sind. */
private static HashSet<String> ALL_KEYWORDS = new HashSet<String>();
private static HashSet<String> ALL_KEYWORDS = new HashSet<>();
/**
* Enthaelt alle Zeichenketten, die eine Kommentarzeile einleiten und nach denen kein Zeilenumbruch erfolgt. Erst eine EscapeSequenz zeigt an, dass die Zeile
* zu Ende ist.
*/
private static HashSet<String> ALL_COMMENT = new HashSet<String>();
private static HashSet<String> ALL_COMMENT = new HashSet<>();
/** Enthaelt alle relevanten Escape Sequenzen. */
private static HashSet<String> ALL_ESCAPES = new HashSet<String>();
private static HashSet<String> ALL_ESCAPES = new HashSet<>();
/** Enthaelt alle Zeichenketten, die das Ende einer Zeile markieren. */
private static HashSet<String> ALL_END_OF_LINE = new HashSet<String>();
private static HashSet<String> ALL_END_OF_LINE = new HashSet<>();
/** Enthaelt alle Zeichenketten, die eine <b>nachfolgende</b> -> Einrueckung verursachen. */
private static HashSet<String> TAB_PLUS = new HashSet<String>();
private static HashSet<String> TAB_PLUS = new HashSet<>();
/** Enthaelt alle Zeichenketten, die eine <b>vorherige</b> <- Einrueckung verursachen. */
private static HashSet<String> TAB_MINUS = new HashSet<String>();
private static HashSet<String> TAB_MINUS = new HashSet<>();
/** Enthaelt alle Zeichenketten, die eine <b>vorherige</b> Einrueckung komplett aufheben. */
private static HashSet<String> TAB_CLEAR = new HashSet<String>();
private static HashSet<String> TAB_CLEAR = new HashSet<>();
/** Leere Zeichenkette, die als Einrückung dient. */
private static String EMPTY_TAB = " ";
......
......@@ -56,8 +56,8 @@ public class AttributeSemantics implements SemanticChecks {
/** Konstruktor */
public AttributeSemantics() {
_aggregationInformation = new HashMap<RealAttributeDescription, RealAttributeDescription>();
_attributeInformation = new ArrayList<RealAttributeDescription>();
_aggregationInformation = new HashMap<>();
_attributeInformation = new ArrayList<>();
}
/**
......
......@@ -47,7 +47,7 @@ public class ExpressionSemantics implements SemanticChecks {
private RealAttributeSemantics _realAttributeSemantics;
private Map<TempAttributeDescription, AST> _tempAttributesUsedInFilterExpression = new HashMap<TempAttributeDescription, AST>();
private Map<TempAttributeDescription, AST> _tempAttributesUsedInFilterExpression = new HashMap<>();
/**
* @param semantics Semantics
......
......@@ -52,7 +52,7 @@ public class MiscellaneousSemantics implements SemanticChecks {
private final Semantics _semantics;
/** Enthält die freien Aspekte, für die keine Bindung existiert */
private final HashSet<String> noFreeAspects = new HashSet<String>();
private final HashSet<String> noFreeAspects = new HashSet<>();
/** @param semantics Semantics */
public MiscellaneousSemantics(final Semantics semantics) {
......@@ -195,7 +195,7 @@ public class MiscellaneousSemantics implements SemanticChecks {
* @param merge True falls verschmolzen werden soll, sonst false
*/
public void setConstraint(final ExpressionTree expression, final boolean merge) {
_semantics.pi.setConstraint(new Tuple<ExpressionTree, Boolean>(expression, merge));
_semantics.pi.setConstraint(new Tuple<>(expression, merge));
}
/**
......
......@@ -67,8 +67,8 @@ public class ScopeSemantics implements SemanticChecks {
_check = semantics.getCheck();
_model = semantics.model;
_simVar = semantics.pi.getSimVar();
_objectToScope = new Hashtable<String, Qualifier>();
_pathStack = new Stack<Qualifier>();
_objectToScope = new Hashtable<>();
_pathStack = new Stack<>();
}
/**
......
......@@ -134,7 +134,7 @@ public class Semantics implements SemanticChecks {
_miscSemantics = new MiscellaneousSemantics(this);
_tempAttributeSemantics = new TempAttributeSemantics(this, _attributeSemantics);
_semanticChecks = new ArrayList<SemanticChecks>();
_semanticChecks = new ArrayList<>();
_semanticChecks.add(_scopeSemantics);
_semanticChecks.add(_attributeSemantics);
_semanticChecks.add(_realAttributeSemantics);
......
......@@ -107,7 +107,7 @@ public class SymbolTable {
/** Prüft, ob es schon eine Pseudoobjekt-Definition gibt. Falls ja, und eine zweite angelegt wird, wird ein Fehler geworfen */
protected boolean _pseudoObjectDefinitionInitialized;
private final Collection<String> _possibleAspectBindings = new HashSet<String>();
private final Collection<String> _possibleAspectBindings = new HashSet<>();
/**
* Erzeugen der Symboltabelle
......@@ -120,9 +120,9 @@ public class SymbolTable {
public SymbolTable(final DataModel model, final ProcessingParameter pp) throws CriticalParserException {
_check = null;
this._model = model;
_aliases = new LinkedHashMap<String, String>();
_tempAttributes = new ArrayList<TempAttributeDescription>();
_aggregationFcts = new LinkedHashMap<String, Class<? extends Aggregation>>();
_aliases = new LinkedHashMap<>();
_tempAttributes = new ArrayList<>();
_aggregationFcts = new LinkedHashMap<>();
_aggregationFcts.put("maximum", Maximum.class);
_aggregationFcts.put("minimum", Minimum.class);
_aggregationFcts.put("summe", Sum.class);
......@@ -134,28 +134,28 @@ public class SymbolTable {
_mainObject = pp.getMainObject();
if(pp.getPeriodList() != null) {
_periodList = new ArrayList<Tuple<Long, Long>>(pp.getPeriodList());
_periodList = new ArrayList<>(pp.getPeriodList());
}
else {
_periodList = new ArrayList<Tuple<Long, Long>>();
_periodList = new ArrayList<>();
}
_simVar = pp.getSimVar();
_saveProtocol = pp.getSaveProtocol();
_deltaProtocol = pp.getDeltaProtocol();
_pseudoObjects = new LinkedHashMap<String, String[]>(pp.getPseudoObjects());
_aspectBindings = new LinkedHashMap<String, String>(pp.getAspBindings());
_pseudoObjects = new LinkedHashMap<>(pp.getPseudoObjects());
_aspectBindings = new LinkedHashMap<>(pp.getAspBindings());
}
else {
_mainObject = null;
_periodList = new ArrayList<Tuple<Long, Long>>();
_periodList = new ArrayList<>();
_simVar = Qualifier.INVALID_SIMVAR;
_saveProtocol = false;
_deltaProtocol = null;
_pseudoObjects = new LinkedHashMap<String, String[]>();
_aspectBindings = new LinkedHashMap<String, String>();
_pseudoObjects = new LinkedHashMap<>();
_aspectBindings = new LinkedHashMap<>();
}
}
......@@ -450,7 +450,7 @@ public class SymbolTable {
end = start;
start = temp;
}
_periodList.add(new Tuple<Long, Long>(start, end));
_periodList.add(new Tuple<>(start, end));
}
}
......@@ -574,6 +574,6 @@ public class SymbolTable {
* @return Liste mit Aspekt-Namen
*/
public List<String> getPossibleAspectBindings() {
return new ArrayList<String>(_possibleAspectBindings);
return new ArrayList<>(_possibleAspectBindings);
}
}
......@@ -73,7 +73,7 @@ public class TempAttributeSemantics implements SemanticChecks {
this._symbolTable = semantics.symbolTable;
this._attributeSemantics = attributeSemantics;
_allTempAttributes = new Hashtable<String, TempAttributeDescription>();
_allTempAttributes = new Hashtable<>();
}
/**
......@@ -218,7 +218,7 @@ public class TempAttributeSemantics implements SemanticChecks {
tad = Arrays.asList(realElement.createIndexedClone(0));
}
else{
final List<TempAttributeDescription> list = new ArrayList<TempAttributeDescription>();
final List<TempAttributeDescription> list = new ArrayList<>();
for(int columnIndex = 0; columnIndex < numColumns; columnIndex++){
list.add(realElement.createIndexedClone(columnIndex));
}
......@@ -269,9 +269,9 @@ public class TempAttributeSemantics implements SemanticChecks {
*/
private String checkForRecursion() {
//bereits geprüfte Attribute
final HashSet<TempAttributeDescription> checked = new HashSet<TempAttributeDescription>();
final HashSet<TempAttributeDescription> checked = new HashSet<>();
//Attribute die sich gerade im Test befinden
final HashSet<TempAttributeDescription> inTest = new HashSet<TempAttributeDescription>();
final HashSet<TempAttributeDescription> inTest = new HashSet<>();
for(final TempAttributeDescription tad : _allTempAttributes.values()) {
String result = checkAttributeForRecursion(tad, checked, inTest);
......@@ -312,7 +312,7 @@ public class TempAttributeSemantics implements SemanticChecks {
/** Diese Methode existiert nur zu Testzwecken und überschreibt {@link #_allTempAttributes}! */
String checkForRecursion(final List<TempAttributeDescription> atts) {
final Hashtable<String, TempAttributeDescription> table = new Hashtable<String, TempAttributeDescription>();
final Hashtable<String, TempAttributeDescription> table = new Hashtable<>();
for(final TempAttributeDescription tad : atts) {
table.put(tad.getName(), tad);
}
......
......@@ -102,7 +102,7 @@ public class CreateScriptRequest extends ScriptRequest {
try {
int versionNumber = 0;
ArrayList<AtlVariable> atlVariables = new ArrayList<AtlVariable>();
ArrayList<AtlVariable> atlVariables = new ArrayList<>();
//Skript parsen
AtgScriptRequest request = AtgScriptRequest.getJavaObject(data);
......
......@@ -49,7 +49,7 @@ public class StatePublisher {
private static final ThreadPool[] EMPTY_ARRAY = new ThreadPool[0];
/** Liste mit Veröffentlichungs-Modulen, die den Threadstatus über Konsole oder Datenverteiler veröffentlichen */
private final List<StatePublisherTask> _publishers = new CopyOnWriteArrayList<StatePublisherTask>();
private final List<StatePublisherTask> _publishers = new CopyOnWriteArrayList<>();
/** Map mit überwachten Thread-Pools (Value ist der Name des Threadpools) */
private final Map<ThreadPool, String> _threadPoolsAndNames = Collections.synchronizedMap(new WeakHashMap<ThreadPool, String>());
......@@ -136,8 +136,8 @@ public class StatePublisher {
}
public Status getStatus() {
List<ThreadPool.QueuedThread> waitingProtocols = new ArrayList<ThreadPool.QueuedThread>();
List<ThreadElement> threadElements = new ArrayList<ThreadElement>();
List<ThreadPool.QueuedThread> waitingProtocols = new ArrayList<>();
List<ThreadElement> threadElements = new ArrayList<>();
Set<ThreadPool> threadPools = _threadPoolsAndNames.keySet();
// Array-Kopie wegen Threadsicherheit erzeugen,
// nicht "threadPools.toArray(new ThreadPool[threadPools.length()])"
......
......@@ -116,7 +116,7 @@ public class ThreadPool {
else {
_useQuery = true;
}
_queries = new ArrayList<TaskManagerRequest>();
_queries = new ArrayList<>();
for(int i = 0; i < maxProtocols; i++) {
ThreadElement thread = new ThreadElement(this, dataManager, maxDelay, timeout);
......@@ -408,7 +408,7 @@ public class ThreadPool {
* @throws FailureException Exception
*/
public synchronized ArrayList<JobInProgress> getJobList() throws FailureException {
final ArrayList<JobInProgress> jobsInProgress = new ArrayList<JobInProgress>();
final ArrayList<JobInProgress> jobsInProgress = new ArrayList<>();
for(TaskManagerRequest query : _queries) {
jobsInProgress.add(new JobInProgress(query.jobId, query.operation.getCode(), JobState.InQueue, (byte) 0, query.startTime, query.client.getId(), query.pp != null ? query.pp : query.protocolId));
}
......@@ -571,7 +571,7 @@ public class ThreadPool {
*/
public synchronized List<QueuedThread> getWaitingProtocols() {
if(_useQuery) {
final ArrayList<QueuedThread> list = new ArrayList<QueuedThread>();
final ArrayList<QueuedThread> list = new ArrayList<>();
for (TaskManagerRequest tmr : _queries) {
list.add(new QueuedThread(tmr.requestId, tmr.protocolId, tmr.jobId, tmr.operation, tmr.client));
}
......@@ -637,8 +637,8 @@ class ThreadManager {
/** @param maxProtocols Anzahl Threads. */
public ThreadManager(int maxProtocols) {
activeThreads = new Hashtable<Long, ThreadElement>(maxProtocols);
inactiveThreads = new ArrayList<ThreadElement>(maxProtocols);
activeThreads = new Hashtable<>(maxProtocols);
inactiveThreads = new ArrayList<>(maxProtocols);
}
/**
......@@ -683,7 +683,7 @@ class ThreadManager {
public void killAll(long timeout) {
die = true;
stillAlive = new ArrayList<ThreadElement>(activeThreads.size() + inactiveThreads.size());
stillAlive = new ArrayList<>(activeThreads.size() + inactiveThreads.size());
synchronized(activeThreads) {
for(ThreadElement thread : activeThreads.values()) {
......@@ -805,7 +805,7 @@ class ThreadManager {
*/
public ArrayList<ThreadElement> getThreads() {
synchronized(activeThreads) {
return new ArrayList<ThreadElement>(activeThreads.values());
return new ArrayList<>(activeThreads.values());
}
}
......@@ -831,7 +831,7 @@ class ThreadManager {
* @return <code>true</code> falls alle Threads beendet wurden.
*/
public boolean isTerminated() {
ArrayList<ThreadElement> temp = new ArrayList<ThreadElement>(stillAlive.size());
ArrayList<ThreadElement> temp = new ArrayList<>(stillAlive.size());
for(ThreadElement thread : stillAlive) {
if(thread.isAlive()) {
thread.kill();
......
......@@ -142,7 +142,7 @@ public class IMDSBuilder {
this._processingBuffer = processingBuffer;
this._status = status;
_startPeriodIndex = startPeriodIndex;
_realElementValues = new RingBuffer<ValueContainer>(ProcessingBuffer.INITIAL_RINGBUFFER_SIZE, RingBuffer.UNBOUNDED_SIZE);
_realElementValues = new RingBuffer<>(ProcessingBuffer.INITIAL_RINGBUFFER_SIZE, RingBuffer.UNBOUNDED_SIZE);
}
/**
......@@ -312,7 +312,7 @@ public class IMDSBuilder {
* @return Liste mit Datensätzen für diese Zeile.
*/
private List<BaseDataSet> calcBaseDataForAllAttributes(final ValueContainer valueContainer, final boolean[] constraints) {
final List<BaseDataSet> list = new ArrayList<BaseDataSet>(_attributes.size());
final List<BaseDataSet> list = new ArrayList<>(_attributes.size());
for(final Elements element : _attributes) {
if(element instanceof RealElement)
{
......
......@@ -547,9 +547,9 @@ public class Processing extends BasicFlowControl implements ProcessingInterface
// [Spalte] -> Index der zugrundeliegenden Datenidentifikation in dids (weiter unten)
final int[] columnToDataId = new int[_pi.getAttributes().size()];
// Liste aller Dids in der Reihenfolge ihres Vorkommens in pi.getAttributes() -> Doppelte Einträge möglich
final ArrayList<Qualifier> di = new ArrayList<Qualifier>();
final ArrayList<Qualifier> di = new ArrayList<>();
// Jeder Datenindex erhält eine eindeutige Nummer (= Index in dids)
final ArrayList<Integer> map = new ArrayList<Integer>();
final ArrayList<Integer> map = new ArrayList<>();
// falls Archivbuffer fertig ist (z.B: weil leeres Intervall)...
final ProcessingBuffer buf = (!_archiveBuffer.isDone()) ? _archiveBuffer : _onlineBuffer;
......@@ -683,7 +683,7 @@ public class Processing extends BasicFlowControl implements ProcessingInterface
* @param now
*/
private List<Tuple<Long, Long>> getOnlinePeriods(final long now) {
final List<Tuple<Long, Long>> periods = new ArrayList<Tuple<Long, Long>>();
final List<Tuple<Long, Long>> periods = new ArrayList<>();
for(final Tuple<Long, Long> period : _pi.getPeriods()) {
if(period.last > now) periods.add(period);
......@@ -699,7 +699,7 @@ public class Processing extends BasicFlowControl implements ProcessingInterface
* @return Zeiträume für die Daten vom Archivsystem geholt werden sollen.
*/
private List<Tuple<Long, Long>> getArsPeriods(final long stop) {
final List<Tuple<Long, Long>> arsPeriods = new ArrayList<Tuple<Long, Long>>();
final List<Tuple<Long, Long>> arsPeriods = new ArrayList<>();
Tuple<Long, Long> period;
for(int i = 0; i < _pi.getPeriods().size(); i++) {
period = _pi.getPeriods().get(i);
......@@ -707,7 +707,7 @@ public class Processing extends BasicFlowControl implements ProcessingInterface
arsPeriods.add(period);
}
else if(period.first <= stop) {
arsPeriods.add(new Tuple<Long, Long>(period.first, stop));
arsPeriods.add(new Tuple<>(period.first, stop));
}
else {
break; // Zeitbereiche sind aufsteigend sortiert -> abbruch schon jetzt möglich
......
......@@ -139,10 +139,10 @@ public abstract class ProcessingBuffer extends Thread {
_startPeriodIndex = startPeriodIndex;
_scriptName = scriptName;
this._periods = Collections.unmodifiableList(periods);
_buffer = new RingBuffer<IntermediateDataSet>(INITIAL_RINGBUFFER_SIZE, RingBuffer.UNBOUNDED_SIZE);
_buffer = new RingBuffer<>(INITIAL_RINGBUFFER_SIZE, RingBuffer.UNBOUNDED_SIZE);
_realElements = new Hashtable<RealElement, ValueProvider>();
_tempElements = new Hashtable<TempAttributeDescription, TempAttribut>();
_realElements = new Hashtable<>();
_tempElements = new Hashtable<>();
this.setName(this.getClass().getName() + ": " + processor.getJobId());
}
......@@ -295,7 +295,7 @@ public abstract class ProcessingBuffer extends Thread {
elements = _realElements.values().toArray(elements);
// winners enthält alle realen Elemente, für die Daten abgeholt werden müssen
final ArrayList<ValueProvider> winners = new ArrayList<ValueProvider>();
final ArrayList<ValueProvider> winners = new ArrayList<>();
while(!isDoneCollecting()) {
i++;
......@@ -434,7 +434,7 @@ public abstract class ProcessingBuffer extends Thread {
winners.clear();
long minTimeStamp = Long.MAX_VALUE;
// 1. Elemente mit dem kleinsten DZS suchen
final ArrayList<ValueProvider> temps = new ArrayList<ValueProvider>();
final ArrayList<ValueProvider> temps = new ArrayList<>();
for(final ValueProvider element : elements) {
// OPT als Verlierer markieren
element.lost();
......
......@@ -109,7 +109,7 @@ public class Status {
int timeStampIndex = 0;
HashSet<Integer> ignored = new HashSet<Integer>(_dataTimeStamps.length);
HashSet<Integer> ignored = new HashSet<>(_dataTimeStamps.length);
// Zeitstempel sammeln
for(int i = 0; i < baseDataSets.size(); i++) {
......