/*******************************************************************************
- * Copyright (c) 2010, 2014 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
List<OutputColumn> outputs = definition.outputs;
for (int i = 0; i < outputs.size(); i++) {
String name = outputs.get(i).name;
- if (name != null) {
- builder.add(new CustomEventFieldAspect(name, i));
- }
+ builder.add(new CustomEventFieldAspect(name, i));
}
return checkNotNull(builder.build());
}
/*******************************************************************************
- * Copyright (c) 2010, 2014 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import java.text.SimpleDateFormat;
import java.util.List;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
public static class OutputColumn {
/** Name of this column */
- public String name;
+ public @NonNull String name;
/**
* Default constructor (empty)
*/
- public OutputColumn() {}
+ public OutputColumn() {
+ this(""); //$NON-NLS-1$
+ }
/**
* Constructor
*
* @param name Name of this output column
*/
- public OutputColumn(String name) {
+ public OutputColumn(@NonNull String name) {
this.name = name;
}
package org.eclipse.tracecompass.tmf.core.parsers.custom;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
} else if (nodeName.equals(OUTPUT_COLUMN_ELEMENT)) {
Element outputColumnElement = (Element) node;
OutputColumn outputColumn = new OutputColumn();
- outputColumn.name = outputColumnElement.getAttribute(NAME_ATTRIBUTE);
+ outputColumn.name = checkNotNull(outputColumnElement.getAttribute(NAME_ATTRIBUTE));
def.outputs.add(outputColumn);
}
}
package org.eclipse.tracecompass.tmf.core.parsers.custom;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
} else if (nodeName.equals(OUTPUT_COLUMN_ELEMENT)) {
Element outputColumnElement = (Element) node;
OutputColumn outputColumn = new OutputColumn();
- outputColumn.name = outputColumnElement.getAttribute(NAME_ATTRIBUTE);
+ outputColumn.name = checkNotNull(outputColumnElement.getAttribute(NAME_ATTRIBUTE));
def.outputs.add(outputColumn);
}
}
/*******************************************************************************
- * Copyright (c) 2010, 2014 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
package org.eclipse.tracecompass.internal.tmf.ui.parsers.wizards;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
final Output output = outputs.get(i);
if (output.enabledButton.getSelection()) {
final OutputColumn column = new OutputColumn();
- column.name = output.nameLabel.getText();
+ column.name = checkNotNull(output.nameLabel.getText());
outputColumns.add(column);
}
}
/*******************************************************************************
- * Copyright (c) 2010, 2014 Ericsson
+ * Copyright (c) 2010, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
package org.eclipse.tracecompass.internal.tmf.ui.parsers.wizards;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
final Output output = outputs.get(i);
if (output.enabledButton.getSelection()) {
final OutputColumn column = new OutputColumn();
- column.name = output.nameLabel.getText();
+ column.name = checkNotNull(output.nameLabel.getText());
outputColumns.add(column);
}
}