Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-03-02 08:07:47 +0000
committerEike Stepper2016-03-02 08:07:47 +0000
commita3c5d78e54e9fb1045430999fdfd4b336987e283 (patch)
treec497762ce9d397b4361cbb523e94f2aa0ed3438b /plugins
parent23e3f9604a7797c6f9d7858d8d372e288db11872 (diff)
downloadcdo-a3c5d78e54e9fb1045430999fdfd4b336987e283.tar.gz
cdo-a3c5d78e54e9fb1045430999fdfd4b336987e283.tar.xz
cdo-a3c5d78e54e9fb1045430999fdfd4b336987e283.zip
[Releng] Work around resource bogus leak warnings
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java4
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ObjectUtil.java8
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java7
4 files changed, 15 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java b/plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java
index fdca4832d1..468665d60d 100644
--- a/plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java
@@ -24,6 +24,7 @@ import org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.util.AdapterUtil;
+import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.event.Notifier;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.om.monitor.NotifyingMonitor;
@@ -71,7 +72,6 @@ public class CDOAdminClientRepositoryImpl extends Notifier implements CDOAdminCl
private IDGenerationLocation idGenerationLocation;
- @SuppressWarnings("unused")
public CDOAdminClientRepositoryImpl(CDOAdminClientImpl admin, ExtendedDataInputStream in) throws IOException
{
this.admin = admin;
@@ -93,7 +93,7 @@ public class CDOAdminClientRepositoryImpl extends Notifier implements CDOAdminCl
CDODataInputImpl.Default wrapper = new CDODataInputImpl.Default(in);
rootResourceID = wrapper.readCDOID();
- if (false)
+ if (ObjectUtil.never())
{
// Suppress resource leak warning.
wrapper.close();
diff --git a/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java b/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java
index e0f2fbd013..3fcce7e6d6 100644
--- a/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java
@@ -22,6 +22,7 @@ import org.eclipse.emf.cdo.server.ISynchronizableRepository;
import org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl;
import org.eclipse.net4j.util.AdapterUtil;
+import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.event.Notifier;
@@ -215,7 +216,6 @@ public class CDOAdminServerRepository extends Notifier implements CDOAdminReposi
return delegate.toString();
}
- @SuppressWarnings("unused")
public void write(ExtendedDataOutputStream out) throws IOException
{
out.writeString(getName());
@@ -236,7 +236,7 @@ public class CDOAdminServerRepository extends Notifier implements CDOAdminReposi
CDODataOutputImpl wrapper = new CDODataOutputImpl(out);
wrapper.writeCDOID(getRootResourceID());
- if (false)
+ if (ObjectUtil.never())
{
// Suppress resource leak warning.
wrapper.close();
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ObjectUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ObjectUtil.java
index 53070e3f10..ce928e1035 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ObjectUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ObjectUtil.java
@@ -28,6 +28,14 @@ public final class ObjectUtil
{
}
+ /**
+ * @since 3.6
+ */
+ public static boolean never()
+ {
+ return false;
+ }
+
public static boolean equals(Object o1, Object o2)
{
if (o1 == null)
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java
index 226721e034..f92ee469a3 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/ExtendedIOUtil.java
@@ -11,6 +11,7 @@
package org.eclipse.net4j.util.io;
import org.eclipse.net4j.internal.util.bundle.OM;
+import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.om.trace.ContextTracer;
@@ -94,7 +95,6 @@ public final class ExtendedIOUtil
return b;
}
- @SuppressWarnings("unused")
public static void writeObject(final DataOutput out, Object object) throws IOException
{
ObjectOutput objectOutput = null;
@@ -113,7 +113,7 @@ public final class ExtendedIOUtil
}
});
- if (false)
+ if (ObjectUtil.never())
{
// Suppress resource leak warning.
wrapper.close();
@@ -135,7 +135,6 @@ public final class ExtendedIOUtil
return readObject(in, new ClassLoaderClassResolver(classLoader));
}
- @SuppressWarnings("unused")
public static Object readObject(final DataInput in, final ClassResolver classResolver) throws IOException
{
ObjectInput objectInput = null;
@@ -175,7 +174,7 @@ public final class ExtendedIOUtil
}
};
- if (false)
+ if (ObjectUtil.never())
{
// Suppress resource leak warning.
wrapper.close();

Back to the top