Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-09-04 13:03:51 +0000
committerAlexander Kurtakov2017-09-04 13:03:51 +0000
commit61dd236707838aef30d2f849b4ffd4df3093717a (patch)
tree4a78675766343dc20375fa7b4e85c6ea4db42205 /bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository
parent71ce503c0e1dabec9f7d65841ee4852c59f0432f (diff)
downloadrt.equinox.p2-61dd236707838aef30d2f849b4ffd4df3093717a.tar.gz
rt.equinox.p2-61dd236707838aef30d2f849b4ffd4df3093717a.tar.xz
rt.equinox.p2-61dd236707838aef30d2f849b4ffd4df3093717a.zip
Bug 521827 - Move artifact.repository bundle to Java 8
* Bump BREE. * Bump minor version for the BREE change. * Enable more warnings. * Add missing Override annotations. * Remove redundant type declarations. * Try-with-resources. * Lambda conversion. Change-Id: I198af985183d1429fb18ed3198f238f42afd0c25 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ZipVerifierStep.java4
3 files changed, 12 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java
index a2f02b164..be4104abf 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2007, 2010 compeople AG and others.
+* Copyright (c) 2007, 2017 compeople AG 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
@@ -60,6 +60,7 @@ public abstract class ProcessingStep extends OutputStream implements IStateful {
* Process the given byte and pass the result on to the configured destination stream
* @param b the byte being written
*/
+ @Override
public void write(int b) throws IOException {
// nothing to do here!
}
@@ -67,6 +68,7 @@ public abstract class ProcessingStep extends OutputStream implements IStateful {
/**
* Flush any unwritten data from this stream.
*/
+ @Override
public void flush() throws IOException {
super.flush();
if (destination != null)
@@ -79,6 +81,7 @@ public abstract class ProcessingStep extends OutputStream implements IStateful {
* output stream. Implementors of this method should ensure they set the
* status of the step.
*/
+ @Override
public void close() throws IOException {
super.close();
if (destination instanceof ProcessingStep)
@@ -86,10 +89,12 @@ public abstract class ProcessingStep extends OutputStream implements IStateful {
monitor = null;
}
+ @Override
public IStatus getStatus() {
return status;
}
+ @Override
public void setStatus(IStatus value) {
if (value == null)
value = Status.OK_STATUS;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java
index feb6bb4d7..6e95fcf16 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2007, 2010 compeople AG and others.
+* Copyright (c) 2007, 2017 compeople AG 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 ProcessingStepHandler {
public static IStatus getStatus(OutputStream stream, boolean deep) {
if (!deep)
return getStatus(stream);
- ArrayList<IStatus> list = new ArrayList<IStatus>();
+ ArrayList<IStatus> list = new ArrayList<>();
int severity = collectStatus(stream, list);
if (severity == IStatus.OK)
return Status.OK_STATUS;
@@ -76,7 +76,7 @@ public class ProcessingStepHandler {
* @return the requested status
*/
public static IStatus getErrorStatus(OutputStream stream) {
- ArrayList<IStatus> list = new ArrayList<IStatus>();
+ ArrayList<IStatus> list = new ArrayList<>();
int severity = collectErrorStatus(stream, list);
if (severity == IStatus.OK)
return Status.OK_STATUS;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ZipVerifierStep.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ZipVerifierStep.java
index a649b0c23..ba24f81eb 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ZipVerifierStep.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ZipVerifierStep.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * 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 +18,7 @@ public class ZipVerifierStep extends ProcessingStep {
private int valid = 0; //-1 indicates that it is not a zip, >3 indicates that we are done the verification
+ @Override
public void write(int b) throws IOException {
getDestination().write(b);
if (valid > 3)
@@ -32,6 +33,7 @@ public class ZipVerifierStep extends ProcessingStep {
}
}
+ @Override
public void close() throws IOException {
if (valid > 3) {
setStatus(Status.OK_STATUS);

Back to the top