Skip to content
Commits on Source (3)
......@@ -10,3 +10,4 @@ Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
J2SE-1.4
Require-Bundle: org.junit,
ie.wombat.jbdiff
Automatic-Module-Name: ie.wombat.jbdiff.test
......@@ -4,7 +4,7 @@
<parent>
<artifactId>org.eclipse.equinox.p2-parent</artifactId>
<groupId>org.eclipse</groupId>
<version>4.7.3-SNAPSHOT</version>
<version>4.8.0-SNAPSHOT</version>
<relativePath>../../org.eclipse.equinox.p2.releng/org.eclipse.equinox.p2-parent</relativePath>
</parent>
<groupId>ie.wombat.jbdiff</groupId>
......
......@@ -8,3 +8,4 @@ Bundle-ActivationPolicy: lazy
Export-Package: ie.wombat.jbdiff
Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
J2SE-1.4
Automatic-Module-Name: ie.wombat.jbdiff
......@@ -4,7 +4,7 @@
<parent>
<artifactId>org.eclipse.equinox.p2-parent</artifactId>
<groupId>org.eclipse</groupId>
<version>4.7.3-SNAPSHOT</version>
<version>4.8.0-SNAPSHOT</version>
<relativePath>../../org.eclipse.equinox.p2.releng/org.eclipse.equinox.p2-parent</relativePath>
</parent>
<groupId>ie.wombat.jbdiff</groupId>
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
......
#Sun Sep 23 11:57:33 EDT 2007
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_core
formatter_settings_version=11
formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
formatter_settings_version=13
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=;
org.eclipse.jdt.ui.ondemandthreshold=3
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.frameworkadmin.equinox;singleton:=true
Bundle-Version: 1.0.800.qualifier
Bundle-Version: 1.1.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Import-Package: org.eclipse.equinox.frameworkadmin;version="[2.0.0,3.0.0)",
......@@ -20,6 +20,7 @@ Import-Package: org.eclipse.equinox.frameworkadmin;version="[2.0.0,3.0.0)",
Export-Package: org.eclipse.equinox.internal.frameworkadmin.equinox;x-friends:="org.eclipse.equinox.p2.publisher,org.eclipse.equinox.p2.publisher.eclipse,org.eclipse.equinox.simpleconfigurator.manipulator",
org.eclipse.equinox.internal.frameworkadmin.equinox.utils;x-friends:="org.eclipse.equinox.p2.publisher.eclipse"
Require-Bundle: org.eclipse.equinox.common
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Service-Component: OSGI-INF/fwadmin.xml
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.equinox.frameworkadmin.equinox
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.equinox.frameworkadmin.equinox">
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.equinox.frameworkadmin.equinox">
<implementation class="org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwAdminImpl"/>
<service>
<provide interface="org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdmin"/>
......
# To force a version qualifier update add the bug here
Bug 403352 - Update all parent versions to match our build stream
Bug 534597 - Unanticipated comparator errors in I20180511-2000
\ No newline at end of file
......@@ -4,11 +4,11 @@
<parent>
<artifactId>org.eclipse.equinox.p2-parent</artifactId>
<groupId>org.eclipse</groupId>
<version>4.7.3-SNAPSHOT</version>
<version>4.8.0-SNAPSHOT</version>
<relativePath>../../org.eclipse.equinox.p2.releng/org.eclipse.equinox.p2-parent</relativePath>
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.frameworkadmin.equinox</artifactId>
<version>1.0.800-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
/*******************************************************************************
* Copyright (c) 2007, 2008 IBM Corporation and others.
* Copyright (c) 2007, 2017 IBM Corporation and others.
* 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
......@@ -62,7 +62,7 @@ public class EclipseLauncherImpl {
Utils.checkAbsoluteFile(launcherData.getFwJar(), "fwJar"); //$NON-NLS-1$
Utils.checkAbsoluteDir(cwd, "cwd"); //$NON-NLS-1$
List<String> cmdList = new LinkedList<String>();
List<String> cmdList = new LinkedList<>();
if (launcherData.getJvm() != null)
cmdList.add(launcherData.getJvm().getAbsolutePath());
else
......
/*******************************************************************************
* Copyright (c) 2007, 2014 IBM Corporation and others.
* Copyright (c) 2007, 2017 IBM Corporation and others.
* 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
......@@ -151,7 +151,7 @@ public class EclipseLauncherParser {
}
private void getJVMArgs(List<String> lines, LauncherData launcherData) {
ArrayList<String> vmargs = new ArrayList<String>(lines.size());
ArrayList<String> vmargs = new ArrayList<>(lines.size());
boolean foundVmArgs = false;
for (Iterator<String> iterator = lines.iterator(); iterator.hasNext();) {
String line = iterator.next();
......@@ -179,7 +179,7 @@ public class EclipseLauncherParser {
}
private void getProgramArgs(List<String> lines, LauncherData launcherData) {
ArrayList<String> args = new ArrayList<String>(lines.size());
ArrayList<String> args = new ArrayList<>(lines.size());
for (Iterator<String> iterator = lines.iterator(); iterator.hasNext();) {
String line = iterator.next();
if (EquinoxConstants.OPTION_VMARGS.equals(line))
......@@ -295,7 +295,7 @@ public class EclipseLauncherParser {
}
//Tweak all the values to make them relative
File launcherFolder = launcherData.getLauncher().getParentFile();
List<String> newlines = new ArrayList<String>();
List<String> newlines = new ArrayList<>();
newlines.addAll(Arrays.asList(launcherData.getProgramArgs()));
setStartup(newlines, launcherFolder.toURI());
......@@ -326,9 +326,7 @@ public class EclipseLauncherParser {
//only write the file if we actually have content
if (newlines.size() > 0) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter(launcherConfigFile));
try (BufferedWriter bw = new BufferedWriter(new FileWriter(launcherConfigFile));) {
for (int j = 0; j < newlines.size(); j++) {
String arg = newlines.get(j);
if (arg == null)
......@@ -338,9 +336,6 @@ public class EclipseLauncherParser {
}
bw.flush();
Log.log(LogService.LOG_INFO, NLS.bind(Messages.log_launcherConfigSave, launcherConfigFile));
} finally {
if (bw != null)
bw.close();
}
}
File previousLauncherIni = launcherData.getPreviousLauncherIni();
......
......@@ -214,13 +214,13 @@ public class EquinoxBundlesState implements BundlesState {
/**
* Map of URI->BundleDescription, where the key is the bundle location.
*/
private HashMap<URI, BundleDescription> locationStateIndex = new HashMap<URI, BundleDescription>();
private HashMap<URI, BundleDescription> locationStateIndex = new HashMap<>();
/**
* Map of String->BundleDescription, where the key is the bundle name
* and version as defined by the {@link #getKey(BundleDescription)} method.
*/
private HashMap<String, BundleDescription> nameVersionStateIndex = new HashMap<String, BundleDescription>();
private HashMap<String, BundleDescription> nameVersionStateIndex = new HashMap<>();
private final PlatformAdmin platformAdmin;
/**
......@@ -414,7 +414,7 @@ public class EquinoxBundlesState implements BundlesState {
public BundleInfo[] convertState(BundleDescription[] bundles) {
BundleInfo[] originalBInfos = manipulator.getConfigData().getBundles();
Map<URI, BundleInfo> bundleInfoMap = new HashMap<URI, BundleInfo>();
Map<URI, BundleInfo> bundleInfoMap = new HashMap<>();
for (int i = 0; i < originalBInfos.length; i++) {
bundleInfoMap.put(originalBInfos[i].getLocation(), originalBInfos[i]);
}
......@@ -450,6 +450,7 @@ public class EquinoxBundlesState implements BundlesState {
return result;
}
@Override
public BundleInfo[] getExpectedState() throws FrameworkAdminRuntimeException {
SimpleBundlesState.checkAvailability(fwAdmin);
return convertState(state.getBundles());
......@@ -459,8 +460,9 @@ public class EquinoxBundlesState implements BundlesState {
return platfromProperties;
}
@Override
public BundleInfo[] getPrerequisteBundles(BundleInfo bInfo) {
Set<BundleDescription> set = new HashSet<BundleDescription>();
Set<BundleDescription> set = new HashSet<>();
URI realLocation = bInfo.getLocation();
BundleDescription bundle = getBundleByLocation(realLocation);
ImportPackageSpecification[] imports = bundle.getImportPackages();
......@@ -485,6 +487,7 @@ public class EquinoxBundlesState implements BundlesState {
return (startLevel == BundleInfo.NO_LEVEL ? manipulator.getConfigData().getInitialBundleStartLevel() : startLevel);
}
@Override
public BundleInfo getSystemBundle() {
BundleDescription bundle = this.getSystemBundleDescription();
return (bundle != null ? convertSystemBundle(bundle) : null);
......@@ -499,6 +502,7 @@ public class EquinoxBundlesState implements BundlesState {
return (EquinoxConstants.FW_SYMBOLIC_NAME.equals(bundle.getSymbolicName()) ? bundle : null);
}
@Override
public BundleInfo[] getSystemFragmentedBundles() {
BundleDescription bundle = this.getSystemBundleDescription();
if (bundle == null)
......@@ -506,6 +510,7 @@ public class EquinoxBundlesState implements BundlesState {
return convertState(bundle.getFragments());
}
@Override
public String[] getUnsatisfiedConstraints(BundleInfo bInfo) {
URI realLocation = bInfo.getLocation();
BundleDescription description = getBundleByLocation(realLocation);
......@@ -546,6 +551,7 @@ public class EquinoxBundlesState implements BundlesState {
}
}
@Override
public void installBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
SimpleBundlesState.checkAvailability(fwAdmin);
......@@ -576,14 +582,17 @@ public class EquinoxBundlesState implements BundlesState {
}
}
@Override
public boolean isFullySupported() {
return true;
}
@Override
public boolean isResolved() {
return state.isResolved();
}
@Override
public boolean isResolved(BundleInfo bInfo) {
URI realLocation = bInfo.getLocation();
BundleDescription description = getBundleByLocation(realLocation);
......@@ -592,6 +601,7 @@ public class EquinoxBundlesState implements BundlesState {
return description.isResolved();
}
@Override
public void resolve(boolean increment) {
state.resolve(increment);
}
......@@ -648,6 +658,7 @@ public class EquinoxBundlesState implements BundlesState {
soFactory = platformAdmin.getFactory();
}
@Override
public String toString() {
if (state == null)
return null;
......@@ -678,6 +689,7 @@ public class EquinoxBundlesState implements BundlesState {
return sb.toString();
}
@Override
public void uninstallBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
SimpleBundlesState.checkAvailability(fwAdmin);
long id = DEFAULT_TIMESTAMP;
......
/*******************************************************************************
* Copyright (c) 2007, 2008 IBM Corporation and others.
* Copyright (c) 2007, 2018 IBM Corporation and others.
* 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
......@@ -10,12 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.internal.frameworkadmin.equinox;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulatorFactory;
import org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdmin;
import org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdminFactory;
public class EquinoxFrameworkAdminFactoryImpl extends FrameworkAdminFactory {
public FrameworkAdmin createFrameworkAdmin() throws InstantiationException, IllegalAccessException, ClassNotFoundException {
@Override
public FrameworkAdmin createFrameworkAdmin()
throws InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException,
InvocationTargetException, NoSuchMethodException, SecurityException {
String className = System.getProperty(ConfiguratorManipulatorFactory.SYSTEM_PROPERTY_KEY);
if (className == null)
return new EquinoxFwAdminImpl();
......
/*******************************************************************************
* Copyright (c) 2007, 2010 IBM Corporation and others.
* Copyright (c) 2007, 2018 IBM Corporation and others.
* 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
......@@ -12,6 +12,7 @@ package org.eclipse.equinox.internal.frameworkadmin.equinox;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Dictionary;
import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulator;
import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulatorFactory;
......@@ -49,7 +50,7 @@ public class EquinoxFwAdminImpl implements FrameworkAdmin {
this.runningFw = runningFw;
}
EquinoxFwAdminImpl(String configuratorManipulatorFactoryName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
EquinoxFwAdminImpl(String configuratorManipulatorFactoryName) throws InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
this.context = null;
this.active = true;
this.runningFw = false;
......@@ -76,16 +77,19 @@ public class EquinoxFwAdminImpl implements FrameworkAdmin {
return configuratorManipulator;
}
@Override
public Manipulator getManipulator() {
return new EquinoxManipulatorImpl(context, this, platformAdmin, startLevelService, false);
}
@Override
public Manipulator getRunningManipulator() {
if (!this.runningFw)
return null;
return new EquinoxManipulatorImpl(context, this, platformAdmin, startLevelService, true);
}
@Override
public boolean isActive() {
return active;
}
......@@ -113,12 +117,13 @@ public class EquinoxFwAdminImpl implements FrameworkAdmin {
return false;
}
@Override
public Process launch(Manipulator manipulator, File cwd) throws IllegalArgumentException, FrameworkAdminRuntimeException, IOException {
//return new EclipseLauncherImpl(context, this).launch(manipulator, cwd);
return new EclipseLauncherImpl(this).launch(manipulator, cwd);
}
private void loadConfiguratorManipulator(String configuratorManipulatorFactoryName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
private void loadConfiguratorManipulator(String configuratorManipulatorFactoryName) throws InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
if (configuratorManipulatorFactoryName == null)
this.configuratorManipulator = null;
else
......
/*******************************************************************************
* Copyright (c) 2007, 2013 IBM Corporation and others.
* Copyright (c) 2007, 2017 IBM Corporation and others.
* 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
......@@ -26,7 +26,7 @@ import org.osgi.framework.Constants;
import org.osgi.service.log.LogService;
public class EquinoxFwConfigFileParser {
private static final Set<String> KNOWN_PROPERTIES = new HashSet<String>(Arrays.asList(new String[] {EquinoxConstants.PROP_BUNDLES, EquinoxConstants.PROP_FW_EXTENSIONS, EquinoxConstants.PROP_INITIAL_STARTLEVEL, EquinoxConstants.PROP_BUNDLES_STARTLEVEL}));
private static final Set<String> KNOWN_PROPERTIES = new HashSet<>(Arrays.asList(new String[] {EquinoxConstants.PROP_BUNDLES, EquinoxConstants.PROP_FW_EXTENSIONS, EquinoxConstants.PROP_INITIAL_STARTLEVEL, EquinoxConstants.PROP_BUNDLES_STARTLEVEL}));
private static final String CONFIG_DIR = "@config.dir/"; //$NON-NLS-1$
private static final String KEY_ECLIPSE_PROV_DATA_AREA = "eclipse.p2.data.area"; //$NON-NLS-1$
private static final String KEY_ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL = "org.eclipse.equinox.simpleconfigurator.configUrl"; //$NON-NLS-1$
......@@ -114,7 +114,7 @@ public class EquinoxFwConfigFileParser {
if (value == null || value.length() == 0)
return null;
List<BundleInfo> bundles = new ArrayList<BundleInfo>();
List<BundleInfo> bundles = new ArrayList<>();
String[] bInfoStrings = Utils.getTokens(value, ","); //$NON-NLS-1$
for (int i = 0; i < bInfoStrings.length; i++) {
String entry = bInfoStrings[i].trim();
......@@ -564,7 +564,7 @@ public class EquinoxFwConfigFileParser {
if (bundles == null || sharedBundles == null || bundles.length != sharedBundles.length)
return false;
List<BundleInfo> compareList = new ArrayList<BundleInfo>(Arrays.asList(bundles));
List<BundleInfo> compareList = new ArrayList<>(Arrays.asList(bundles));
compareList.removeAll(Arrays.asList(sharedBundles));
return compareList.isEmpty();
}
......
/*******************************************************************************
* Copyright (c) 2008 IBM Corporation and others. All rights reserved. This
* Copyright (c) 2008, 2017 IBM Corporation and others.
* 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
......@@ -18,6 +19,7 @@ public class EquinoxLauncherData extends LauncherData {
super(fwName, fwVersion, launcherName, launcherVersion);
}
@Override
public void setLauncher(File launcherFile) {
if (previousLauncher == null && launcherFile != null && !launcherFile.equals(getLauncher()))
previousLauncher = EquinoxManipulatorImpl.getLauncherConfigLocation(this);
......
/*******************************************************************************
* Copyright (c) 2007, 2015 IBM Corporation and others.
* Copyright (c) 2007, 2017 IBM Corporation and others.
* 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
......@@ -29,9 +29,6 @@ import org.osgi.service.log.LogService;
import org.osgi.service.startlevel.StartLevel;
import org.osgi.util.tracker.ServiceTracker;
/**
*
*/
public class EquinoxManipulatorImpl implements Manipulator {
private static final long DEFAULT_LASTMODIFIED = 0L;
private static final boolean LOG_ILLEGALSTATEEXCEPTION = false;
......@@ -144,6 +141,7 @@ public class EquinoxManipulatorImpl implements Manipulator {
configData.setInitialBundleStartLevel(4);
}
@Override
public BundlesState getBundlesState() throws FrameworkAdminRuntimeException {
if (context == null)
return new SimpleBundlesState(fwAdmin, this, EquinoxConstants.FW_SYMBOLIC_NAME);
......@@ -157,10 +155,12 @@ public class EquinoxManipulatorImpl implements Manipulator {
return new EquinoxBundlesState(context, fwAdmin, this, platformAdmin, platformProperties);
}
@Override
public ConfigData getConfigData() throws FrameworkAdminRuntimeException {
return configData;
}
@Override
public BundleInfo[] getExpectedState() throws IllegalArgumentException, FrameworkAdminRuntimeException {
//Log.log(LogService.LOG_DEBUG, this, "getExpectedState()", "BEGIN");
SimpleBundlesState.checkAvailability(fwAdmin);
......@@ -173,6 +173,7 @@ public class EquinoxManipulatorImpl implements Manipulator {
return bundleState.getExpectedState();
}
@Override
public LauncherData getLauncherData() throws FrameworkAdminRuntimeException {
return launcherData;
}
......@@ -233,6 +234,7 @@ public class EquinoxManipulatorImpl implements Manipulator {
return props;
}
@Override
public long getTimeStamp() {
long ret = this.getTimeStampWithoutFwPersistentData();
if (this.launcherData.isClean())
......@@ -260,6 +262,7 @@ public class EquinoxManipulatorImpl implements Manipulator {
return ret;
}
@Override
public void initialize() {
Log.log(LogService.LOG_DEBUG, this, "initialize()", "BEGIN"); //$NON-NLS-1$ //$NON-NLS-2$
configData.initialize();
......@@ -324,9 +327,7 @@ public class EquinoxManipulatorImpl implements Manipulator {
configData.setInitialBundleStartLevel(startLevelService.getInitialBundleStartLevel());
}
/* (non-Javadoc)
* @see org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator#load()
*/
@Override
public void load() throws IllegalStateException, IOException, FrameworkAdminRuntimeException {
Log.log(LogService.LOG_DEBUG, this, "load()", "BEGIN"); //$NON-NLS-1$//$NON-NLS-2$
loadWithoutFwPersistentData();
......@@ -371,6 +372,7 @@ public class EquinoxManipulatorImpl implements Manipulator {
}
// Save all parameter in memory into proper config files.
@Override
public void save(boolean backup) throws IOException, FrameworkAdminRuntimeException {
Log.log(LogService.LOG_DEBUG, this, "save()", "BEGIN"); //$NON-NLS-1$//$NON-NLS-2$
SimpleBundlesState.checkAvailability(fwAdmin);
......@@ -430,6 +432,7 @@ public class EquinoxManipulatorImpl implements Manipulator {
}
}
@Override
public void setConfigData(ConfigData configData) {
this.configData.initialize();
this.configData.setInitialBundleStartLevel(configData.getInitialBundleStartLevel());
......@@ -493,6 +496,7 @@ public class EquinoxManipulatorImpl implements Manipulator {
return null;
}
@Override
public void setLauncherData(LauncherData value) {
launcherData.initialize();
launcherData.setFwConfigLocation(value.getFwConfigLocation());
......@@ -528,6 +532,7 @@ public class EquinoxManipulatorImpl implements Manipulator {
return false;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("++++++++++++++++++++++++++++++++++++++++++\n" + "Class:" + this.getClass().getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
......
/*******************************************************************************
* Copyright (c) 2007, 2012 IBM Corporation and others.
* Copyright (c) 2007, 2017 IBM Corporation and others.
* 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
......@@ -207,25 +207,15 @@ public class FileUtils {
* Loads an ini file, returning a list of all non-blank lines in the file.
*/
public static List<String> loadFile(File file) throws IOException {
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(file));
try (BufferedReader br = new BufferedReader(new FileReader(file));) {
String line;
List<String> list = new ArrayList<String>();
List<String> list = new ArrayList<>();
while ((line = br.readLine()) != null) {
//skip whitespace
if (line.trim().length() > 0)
list.add(line);
}
return list;
} finally {
if (br != null)
try {
br.close();
} catch (IOException e) {
//Ignore
}
}
}
......