fix FB warning: Dead store

Dead store to cmd in aQute.bnd.maven.MavenDeployCmd.run(String[], int)

This instruction assigns a value to a local variable, but the value is
not read or used in any subsequent instruction. Often, this indicates
an error, because the value computed is never used.

Note that Sun's javac compiler often generates dead stores for final
local variables. Because FindBugs is a bytecode-based tool, there is
no easy way to eliminate these false positives.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: next() can't throw NoSuchElementException

aQute.lib.collections.SortedList$It.next() can't throw NoSuchElementException

This class implements the java.util.Iterator interface.
However, its next() method is not capable of throwing
java.util.NoSuchElementException.  The next() method should
be changed so it throws NoSuchElementException if is called
when there are no more elements to return.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: may fail to close stream

aQute.bnd.main.DiffCommand.diff(DiffCommand$diffOptions)
may fail to close stream

The method creates an IO stream object, does not assign it
to any fields, pass it to other methods that might close it,
or return it, and does not appear to close the stream on all
paths out of the method.  This may result in a file descriptor
leak.  It is generally a good idea to use a finally block to
ensure that streams are closed.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
DiffCommand: refactor to have a single finally clause

The finally closes all open resources.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: may fail to close stream

aQute.lib.osgi.PreprocessResource.getBytes() may fail to close stream

The method creates an IO stream object, does not assign it
to any fields, pass it to other methods that might close it,
or return it, and does not appear to close the stream on all
paths out of the method.  This may result in a file descriptor
leak.  It is generally a good idea to use a finally block to
ensure that streams are closed.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: may fail to close stream

aQute.bnd.maven.MavenCommand.bundle(String[], int) may fail to close stream

The method creates an IO stream object, does not assign it
to any fields, pass it to other methods that might close it,
or return it, and does not appear to close the stream on all
paths out of the method.  This may result in a file descriptor
leak.  It is generally a good idea to use a finally block to
ensure that streams are closed.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix #174: HttpConnectorTest needs to use a free (non-fixed) port

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: Write to static field from instance method

Write to static field aQute.jpm.service.ServiceMain.trace
from instance method aQute.jpm.service.ServiceMain.run()

This instance method writes to a static field. This is tricky
to get correct if multiple instances are being manipulated, and
generally bad practice.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
fix FB warning: isn't final but should be

aQute.libg.header.Attrs.TYPED isn't final but should be

A mutable static field could be changed by malicious code
or by accident from another package. The field could be made
final to avoid this vulnerability.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
add findbugs target to ant build

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
findbugs: filter out j2se jars

They cause false findbugs warnings.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
findbugs: ignore 2 valid hard coded absolute paths

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>