Latest bnd code
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1350613 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/lib/codec/Codec.java b/bundleplugin/src/main/java/aQute/lib/codec/Codec.java
index 6de09cf..6072ebd 100644
--- a/bundleplugin/src/main/java/aQute/lib/codec/Codec.java
+++ b/bundleplugin/src/main/java/aQute/lib/codec/Codec.java
@@ -4,6 +4,7 @@
import java.lang.reflect.*;
public interface Codec {
- Object decode(Reader in, Type type) throws Exception;
+ Object decode(Reader in, Type type) throws Exception;
+
void encode(Type t, Object o, Appendable out) throws Exception;
}
diff --git a/bundleplugin/src/main/java/aQute/lib/codec/HCodec.java b/bundleplugin/src/main/java/aQute/lib/codec/HCodec.java
index f97e695..c174e52 100644
--- a/bundleplugin/src/main/java/aQute/lib/codec/HCodec.java
+++ b/bundleplugin/src/main/java/aQute/lib/codec/HCodec.java
@@ -15,7 +15,7 @@
}
public <T> T decode(InputStream in, Class<T> t) throws Exception {
- return t.cast(decode(in, (Type)t));
+ return t.cast(decode(in, (Type) t));
}
public <T> T decode(Reader in, Class<T> t) throws Exception {
@@ -35,7 +35,8 @@
OutputStreamWriter wr = new OutputStreamWriter(out, "UTF-8");
try {
codec.encode(t, o, wr);
- } finally {
+ }
+ finally {
wr.flush();
}
}
@@ -46,10 +47,12 @@
InputStreamReader rdr = new InputStreamReader(fin, "UTF-8");
try {
return t.cast(decode(rdr, t));
- } finally {
+ }
+ finally {
rdr.close();
}
- } finally {
+ }
+ finally {
fin.close();
}
@@ -61,10 +64,12 @@
Writer wr = new OutputStreamWriter(oout, "UTF-8");
try {
codec.encode(t, o, wr);
- } finally {
+ }
+ finally {
wr.close();
}
- } finally {
+ }
+ finally {
oout.close();
}
}