Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-05-22 07:29:58 -0400
committerRoland Grunberg2015-06-02 17:45:39 -0400
commit94734f51f17c6245ce73cfef71fe3ea26708fbfb (patch)
tree44a11ead7997e43fff7a109fca326ee1abba7c65
parente6c61ceb202e06db3e32c2e27d86e07627d6537f (diff)
downloadorg.eclipse.linuxtools-94734f51f17c6245ce73cfef71fe3ea26708fbfb.tar.gz
org.eclipse.linuxtools-94734f51f17c6245ce73cfef71fe3ea26708fbfb.tar.xz
org.eclipse.linuxtools-94734f51f17c6245ce73cfef71fe3ea26708fbfb.zip
docker: Enable compiler warnings and fix them in docker.core.
Change-Id: Id51a805a767344a06cb82366c73f1b794223dbb8 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com> Reviewed-on: https://git.eclipse.org/r/48452 Tested-by: Hudson CI Reviewed-on: https://git.eclipse.org/r/49257 Reviewed-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.core.prefs94
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.ui.prefs2
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Activator.java15
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java3
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java24
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java1
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainer.java1
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java18
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerRefreshManager.java3
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerHostConfig.java14
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortMapping.java4
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/HttpHijackWorkaround.java2
13 files changed, 140 insertions, 43 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.core.prefs b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.core.prefs
index 267d23cb7d..9944f10769 100644
--- a/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.core.prefs
+++ b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,9 +1,103 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
diff --git a/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.ui.prefs b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.ui.prefs
index 32fe9378ab..446b847248 100644
--- a/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.ui.prefs
+++ b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.ui.prefs
@@ -28,7 +28,7 @@ sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=true
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Activator.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Activator.java
index 8f80a470bb..13a1bce73a 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Activator.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Activator.java
@@ -32,24 +32,13 @@ public class Activator extends Plugin {
// The shared instance
private static Activator plugin;
- /*
- * (non-Javadoc)
- *
- * @see
- * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
- * )
- */
+ @Override
public void start(BundleContext bundleContext) throws Exception {
super.start(bundleContext);
plugin = this;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
+ @Override
public void stop(BundleContext bundleContext) throws Exception {
plugin = null;
super.stop(bundleContext);
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java
index 6732c7b835..6b5a008fe7 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java
@@ -44,7 +44,7 @@ public class DockerConnectionManager {
private ListenerList connectionManagerListeners;
private DockerConnectionManager() {
- connections = new ArrayList<IDockerConnection>();
+ connections = new ArrayList<>();
loadConnections();
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java
index 7ff45624a7..4e6ac05aef 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java
@@ -54,10 +54,13 @@ public interface IDockerContainerInfo {
public Map<String, Boolean> volumesRW();
+ @Override
public boolean equals(Object o);
+ @Override
public int hashCode();
+ @Override
public String toString();
} \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
index 5c21fb2edc..bb54ba1597 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
@@ -73,6 +73,7 @@ import org.eclipse.linuxtools.docker.core.IDockerPortMapping;
import org.eclipse.linuxtools.docker.core.IDockerProgressHandler;
import org.eclipse.linuxtools.docker.core.ILogger;
import org.eclipse.linuxtools.docker.core.Messages;
+import org.eclipse.osgi.util.NLS;
import com.spotify.docker.client.ContainerNotFoundException;
import com.spotify.docker.client.DefaultDockerClient;
@@ -453,7 +454,7 @@ public class DockerConnection implements IDockerConnection {
private Map<String, Job> actionJobs;
- private Map<String, LogThread> loggingThreads = new HashMap<String, LogThread>();
+ private Map<String, LogThread> loggingThreads = new HashMap<>();
// private Set<String> printIds = new HashSet<String>();
@@ -679,7 +680,7 @@ public class DockerConnection implements IDockerConnection {
public void registerActionJob(String id, Job j) {
synchronized (actionLock) {
if (actionJobs == null)
- actionJobs = new HashMap<String, Job>();
+ actionJobs = new HashMap<>();
actionJobs.put(id, j);
}
}
@@ -744,10 +745,12 @@ public class DockerConnection implements IDockerConnection {
return new LogThread(id, copyClient, follow);
}
+ @Override
public void setOutputStream(OutputStream stream) {
outputStream = stream;
}
+ @Override
public void execute() throws InterruptedException, IOException {
try {
// Add timestamps to log based on user preference
@@ -801,7 +804,7 @@ public class DockerConnection implements IDockerConnection {
}
private List<IDockerContainer> listContainers() throws DockerException {
- final List<IDockerContainer> dclist = new ArrayList<IDockerContainer>();
+ final List<IDockerContainer> dclist = new ArrayList<>();
synchronized (containerLock) {
List<Container> list = null;
try {
@@ -809,7 +812,8 @@ public class DockerConnection implements IDockerConnection {
.allContainers());
} catch (com.spotify.docker.client.DockerException
| InterruptedException e) {
- throw new DockerException(Messages.bind(
+ throw new DockerException(
+ NLS.bind(
Messages.List_Docker_Containers_Failure,
this.getName()), e);
}
@@ -941,7 +945,7 @@ public class DockerConnection implements IDockerConnection {
}
private List<IDockerImage> listImages() throws DockerException {
- final List<IDockerImage> dilist = new ArrayList<IDockerImage>();
+ final List<IDockerImage> dilist = new ArrayList<>();
synchronized (imageLock) {
List<Image> rawImages = null;
try {
@@ -968,7 +972,7 @@ public class DockerConnection implements IDockerConnection {
&& imageParentIds.contains(rawImage.id());
final boolean danglingImage = !taggedImage
&& !intermediateImage;
- dilist.add(new DockerImage(this, (List<String>) rawImage
+ dilist.add(new DockerImage(this, rawImage
.repoTags(), rawImage.id(), rawImage.parentId(),
rawImage.created(), rawImage.size(), rawImage
.virtualSize(), intermediateImage,
@@ -1282,7 +1286,7 @@ public class DockerConnection implements IDockerConnection {
builder.links(config.links());
if (config.lxcConf() != null) {
List<IDockerConfParameter> lxcconf = config.lxcConf();
- ArrayList<LxcConfParameter> lxcreal = new ArrayList<LxcConfParameter>();
+ ArrayList<LxcConfParameter> lxcreal = new ArrayList<>();
for (IDockerConfParameter param : lxcconf) {
lxcreal.add(new LxcConfParameter(param.key(), param.value()));
}
@@ -1291,13 +1295,13 @@ public class DockerConnection implements IDockerConnection {
if (config.portBindings() != null) {
Map<String, List<IDockerPortBinding>> bindings = config
.portBindings();
- HashMap<String, List<PortBinding>> realBindings = new HashMap<String, List<PortBinding>>();
+ HashMap<String, List<PortBinding>> realBindings = new HashMap<>();
for (Entry<String, List<IDockerPortBinding>> entry : bindings
.entrySet()) {
String key = entry.getKey();
List<IDockerPortBinding> bindingList = entry.getValue();
- ArrayList<PortBinding> newList = new ArrayList<PortBinding>();
+ ArrayList<PortBinding> newList = new ArrayList<>();
for (IDockerPortBinding binding : bindingList) {
newList.add(PortBinding.of(binding.hostIp(),
binding.hostPort()));
@@ -1433,7 +1437,7 @@ public class DockerConnection implements IDockerConnection {
public WritableByteChannel attachCommand(final String id,
final InputStream in, final OutputStream out)
- throws DockerException, InterruptedException {
+ throws DockerException {
final byte[] prevCmd = new byte[1024];
try {
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java
index ea77d96251..a4b8e548ae 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java
@@ -86,6 +86,7 @@ public class DockerConnectionInfo implements IDockerConnectionInfo {
return memoryLimit;
}
+ @Override
public int getContainers() {
return containers;
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainer.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainer.java
index 0befc04823..9a4d0cf814 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainer.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainer.java
@@ -51,6 +51,7 @@ public class DockerContainer implements IDockerContainer {
this.ports = ports;
}
+ @Override
public DockerConnection getConnection() {
return parent;
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java
index 13749dbec2..0cbfb6fe7d 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java
@@ -331,7 +331,7 @@ public class DockerContainerConfig implements IDockerContainerConfig {
public Builder portSpecs(final List<String> portSpecs) {
- this.portSpecs = new ArrayList<String>(portSpecs);
+ this.portSpecs = new ArrayList<>(portSpecs);
return this;
}
@@ -345,12 +345,12 @@ public class DockerContainerConfig implements IDockerContainerConfig {
}
public Builder exposedPorts(final Set<String> exposedPorts) {
- this.exposedPorts = new TreeSet<String>(exposedPorts);
+ this.exposedPorts = new TreeSet<>(exposedPorts);
return this;
}
public Builder exposedPorts(final String... exposedPorts) {
- this.exposedPorts = new TreeSet<String>(Arrays.asList(exposedPorts));
+ this.exposedPorts = new TreeSet<>(Arrays.asList(exposedPorts));
return this;
}
@@ -386,7 +386,7 @@ public class DockerContainerConfig implements IDockerContainerConfig {
}
public Builder env(final List<String> env) {
- this.env = new ArrayList<String>(env);
+ this.env = new ArrayList<>(env);
return this;
}
@@ -400,7 +400,7 @@ public class DockerContainerConfig implements IDockerContainerConfig {
}
public Builder cmd(final List<String> cmd) {
- this.cmd = new ArrayList<String>(cmd);
+ this.cmd = new ArrayList<>(cmd);
return this;
}
@@ -423,12 +423,12 @@ public class DockerContainerConfig implements IDockerContainerConfig {
}
public Builder volumes(final Set<String> volumes) {
- this.volumes = new TreeSet<String>(volumes);
+ this.volumes = new TreeSet<>(volumes);
return this;
}
public Builder volumes(final String... volumes) {
- this.volumes = new TreeSet<String>(Arrays.asList(volumes));
+ this.volumes = new TreeSet<>(Arrays.asList(volumes));
return this;
}
@@ -446,7 +446,7 @@ public class DockerContainerConfig implements IDockerContainerConfig {
}
public Builder entryPoint(final List<String> entrypoint) {
- this.entrypoint = new ArrayList<String>(entrypoint);
+ this.entrypoint = new ArrayList<>(entrypoint);
return this;
}
@@ -469,7 +469,7 @@ public class DockerContainerConfig implements IDockerContainerConfig {
}
public Builder onBuild(final List<String> onBuild) {
- this.onBuild = new ArrayList<String>(onBuild);
+ this.onBuild = new ArrayList<>(onBuild);
return this;
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerRefreshManager.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerRefreshManager.java
index bf3bae0472..b94520f23c 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerRefreshManager.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerRefreshManager.java
@@ -28,7 +28,7 @@ public class DockerContainerRefreshManager implements IDockerContainerListener {
private Map<IDockerConnection, ContainerRefreshThread> refreshThreadMap;
private DockerContainerRefreshManager() {
- refreshThreadMap = new HashMap<IDockerConnection, ContainerRefreshThread>();
+ refreshThreadMap = new HashMap<>();
}
public static DockerContainerRefreshManager getInstance() {
@@ -104,6 +104,7 @@ public class DockerContainerRefreshManager implements IDockerContainerListener {
this.interrupt();
}
+ @Override
public void run() {
for (;;) {
try {
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerHostConfig.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerHostConfig.java
index 04e3c2f37a..a4649ee2ec 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerHostConfig.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerHostConfig.java
@@ -49,7 +49,7 @@ public class DockerHostConfig implements IDockerHostConfig {
}
}
this.privileged = hostConfig.privileged();
- this.portBindings = new HashMap<String, List<IDockerPortBinding>>();
+ this.portBindings = new HashMap<>();
if(hostConfig != null && hostConfig.portBindings() != null) {
for(Entry<String, List<PortBinding>> entry : hostConfig.portBindings().entrySet()) {
final List<IDockerPortBinding> portBindings = new ArrayList<>();
@@ -156,7 +156,7 @@ public class DockerHostConfig implements IDockerHostConfig {
public Builder binds(final List<String> binds) {
- this.binds = new ArrayList<String>(binds);
+ this.binds = new ArrayList<>(binds);
return this;
}
@@ -179,7 +179,7 @@ public class DockerHostConfig implements IDockerHostConfig {
}
public Builder lxcConf(final List<IDockerConfParameter> lxcConf) {
- this.lxcConf = new ArrayList<IDockerConfParameter>(lxcConf);
+ this.lxcConf = new ArrayList<>(lxcConf);
return this;
}
@@ -212,7 +212,7 @@ public class DockerHostConfig implements IDockerHostConfig {
}
public Builder links(final List<String> links) {
- this.links = new ArrayList<String>(links);
+ this.links = new ArrayList<>(links);
return this;
}
@@ -235,7 +235,7 @@ public class DockerHostConfig implements IDockerHostConfig {
}
public Builder dns(final List<String> dns) {
- this.dns = new ArrayList<String>(dns);
+ this.dns = new ArrayList<>(dns);
return this;
}
@@ -249,7 +249,7 @@ public class DockerHostConfig implements IDockerHostConfig {
}
public Builder dnsSearch(final List<String> dnsSearch) {
- this.dnsSearch = new ArrayList<String>(dnsSearch);
+ this.dnsSearch = new ArrayList<>(dnsSearch);
return this;
}
@@ -263,7 +263,7 @@ public class DockerHostConfig implements IDockerHostConfig {
}
public Builder volumesFrom(final List<String> volumesFrom) {
- this.volumesFrom = new ArrayList<String>(volumesFrom);
+ this.volumesFrom = new ArrayList<>(volumesFrom);
return this;
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortMapping.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortMapping.java
index 1f42aecec3..8c1f7a09d6 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortMapping.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortMapping.java
@@ -52,18 +52,22 @@ public class DockerPortMapping implements IDockerPortMapping {
this.ip = ip;
}
+ @Override
public int getPrivatePort() {
return privatePort;
}
+ @Override
public int getPublicPort() {
return publicPort;
}
+ @Override
public String getType() {
return type;
}
+ @Override
public String getIp() {
return ip;
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/HttpHijackWorkaround.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/HttpHijackWorkaround.java
index 746cb925c3..fa7d68a2e2 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/HttpHijackWorkaround.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/HttpHijackWorkaround.java
@@ -86,7 +86,7 @@ public class HttpHijackWorkaround {
* access to the underlying InputStream but better wait and see what
* happens with the HTTP Hijacking situation.
*/
- public static InputStream getInputStream(LogStream stream) throws Exception {
+ public static InputStream getInputStream(LogStream stream) {
final String[] fields = new String[] { "reader", "stream" };
final String[] declared = new String[] { LogStream.class.getName(), LogReader.class.getName()};

Back to the top