From df9a9a4cf68dc044a42ce298beefe32c151525e1 Mon Sep 17 00:00:00 2001 From: Ian Bull Date: Wed, 29 Aug 2012 11:25:20 -0700 Subject: Bug 381673: Fixes a few compile warnings This fixes 2 types of compile warnings. 1. Stream not closed warnings. 2. Unused object warnings --- .../internal/p2/artifact/repository/CompositeArtifactRepository.java | 5 ++--- .../p2/artifact/repository/simple/SimpleArtifactRepository.java | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository') diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java index 87cf474b5..c1cddeeeb 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java @@ -456,9 +456,8 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl jarFile.getParentFile().mkdirs(); jarFile.createNewFile(); } - JarOutputStream jOs = new JarOutputStream(new FileOutputStream(jarFile)); - jOs.putNextEntry(new JarEntry(new Path(artifactsFile.getAbsolutePath()).lastSegment())); - os = jOs; + os = new JarOutputStream(new FileOutputStream(jarFile)); + ((JarOutputStream) os).putNextEntry(new JarEntry(new Path(artifactsFile.getAbsolutePath()).lastSegment())); } super.setProperty(IRepository.PROP_TIMESTAMP, Long.toString(System.currentTimeMillis())); new CompositeRepositoryIO().write(toState(), os, PI_REPOSITORY_TYPE); diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java index 1f036394b..f72ae6847 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java @@ -1238,9 +1238,8 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme mkdirs(jarFile.getParentFile()); jarFile.createNewFile(); } - JarOutputStream jOs = new JarOutputStream(new FileOutputStream(jarFile)); - jOs.putNextEntry(new JarEntry(new Path(artifactsFile.getAbsolutePath()).lastSegment())); - os = jOs; + os = new JarOutputStream(new FileOutputStream(jarFile)); + ((JarOutputStream) os).putNextEntry(new JarEntry(new Path(artifactsFile.getAbsolutePath()).lastSegment())); } super.setProperty(IRepository.PROP_TIMESTAMP, Long.toString(System.currentTimeMillis()), new NullProgressMonitor()); new SimpleArtifactRepositoryIO(getProvisioningAgent()).write(this, os); -- cgit v1.2.3