// The mapping of available trace type IDs to their corresponding
// configuration element
- private final Map<String, IConfigurationElement> fTraceTypeAttributes = new HashMap<String, IConfigurationElement>();
- private final Map<String, IConfigurationElement> fTraceCategories = new HashMap<String, IConfigurationElement>();
- private final Map<String, TraceTypeHelper> fTraceTypes = new LinkedHashMap<String, TraceTypeHelper>();
+ private final Map<String, IConfigurationElement> fTraceTypeAttributes = new HashMap<>();
+ private final Map<String, IConfigurationElement> fTraceCategories = new HashMap<>();
+ private final Map<String, TraceTypeHelper> fTraceTypes = new LinkedHashMap<>();
private static TmfTraceType fInstance = null;
public static IConfigurationElement[] getTypeElements() {
IConfigurationElement[] elements = Platform.getExtensionRegistry()
.getConfigurationElementsFor(TMF_TRACE_TYPE_ID);
- List<IConfigurationElement> typeElements = new LinkedList<IConfigurationElement>();
+ List<IConfigurationElement> typeElements = new LinkedList<>();
for (IConfigurationElement element : elements) {
if (element.getName().equals(TYPE_ELEM)) {
typeElements.add(element);
public String[] getAvailableTraceTypes() {
// Generate the list of Category:TraceType to populate the ComboBox
- List<String> traceTypes = new ArrayList<String>();
+ List<String> traceTypes = new ArrayList<>();
// re-populate custom trace types
getCustomTraceTypes();
* @since 2.0
*/
public static List<String> getCustomTraceTypes(String type) {
- List<String> traceTypes = new ArrayList<String>();
+ List<String> traceTypes = new ArrayList<>();
if (type.equals(CUSTOM_TXT_CATEGORY)) {
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
String traceTypeName = def.definitionName;
* @since 2.0
*/
public List<String> getCustomTraceTypes() {
- List<String> traceTypes = new ArrayList<String>();
+ List<String> traceTypes = new ArrayList<>();
// remove the customTraceTypes
final String[] keySet = fTraceTypes.keySet().toArray(new String[0]);
for (String key : keySet) {
* @since 2.0
*/
public List<String> getTraceCategories() {
- List<String> categoryNames = new ArrayList<String>();
+ List<String> categoryNames = new ArrayList<>();
for (String key : fTraceTypes.keySet()) {
final String categoryName = fTraceTypes.get(key).getCategoryName();
if (!categoryNames.contains(categoryName)) {
public List<TraceTypeHelper> getTraceTypes(String categoryName) {
init();
- List<TraceTypeHelper> traceNames = new ArrayList<TraceTypeHelper>();
+ List<TraceTypeHelper> traceNames = new ArrayList<>();
for (String key : fTraceTypes.keySet()) {
final String storedCategoryName = fTraceTypes.get(key).getCategoryName();
if (storedCategoryName.equals(categoryName)) {
private static List<File> isolateTraces(List<FileSystemElement> selectedResources) {
- List<File> traces = new ArrayList<File>();
+ List<File> traces = new ArrayList<>();
// Get the selection
Iterator<FileSystemElement> resources = selectedResources.iterator();
// Get the sorted list of unique entries
- Map<String, File> fileSystemObjects = new HashMap<String, File>();
+ Map<String, File> fileSystemObjects = new HashMap<>();
while (resources.hasNext()) {
File resource = (File) resources.next().getFileSystemObject();
String key = resource.getAbsolutePath();
fileSystemObjects.put(key, resource);
}
- List<String> files = new ArrayList<String>(fileSystemObjects.keySet());
+ List<String> files = new ArrayList<>(fileSystemObjects.keySet());
Collections.sort(files);
// After sorting, traces correspond to the unique prefixes
* @since 2.2
*/
public TraceTypeHelper selectTraceType(String path, Shell shell, String traceTypeHint) throws TmfTraceImportException {
- List<TraceTypeHelper> validCandidates = new ArrayList<TraceTypeHelper>();
+ List<TraceTypeHelper> validCandidates = new ArrayList<>();
getCustomTraceTypes();
final Set<String> traceTypes = fTraceTypes.keySet();
for (String traceType : traceTypes) {
}
private static List<TraceTypeHelper> reduce(List<TraceTypeHelper> candidates) {
- List<TraceTypeHelper> retVal = new ArrayList<TraceTypeHelper>();
+ List<TraceTypeHelper> retVal = new ArrayList<>();
// get all the tracetypes that are unique in that stage
for (TraceTypeHelper trace : candidates) {
}
private TraceTypeHelper getTraceTypeToSet(List<TraceTypeHelper> candidates, Shell shell) {
- final Map<String, String> names = new HashMap<String, String>();
+ final Map<String, String> names = new HashMap<>();
Shell shellToShow = new Shell(shell);
shellToShow.setText(Messages.TmfTraceType_SelectTraceType);
final String candidatesToSet[] = new String[1];