Fix small code problems
This commit is contained in:
parent
b0f3908956
commit
dce503bbd6
4 changed files with 15 additions and 9 deletions
|
@ -204,11 +204,14 @@ public class WireFeedInput {
|
|||
public WireFeed build(final File file) throws FileNotFoundException, IOException, IllegalArgumentException, FeedException {
|
||||
WireFeed feed;
|
||||
Reader reader = new FileReader(file);
|
||||
if (xmlHealerOn) {
|
||||
reader = new XmlFixerReader(reader);
|
||||
try {
|
||||
if (xmlHealerOn) {
|
||||
reader = new XmlFixerReader(reader);
|
||||
}
|
||||
feed = this.build(reader);
|
||||
} finally {
|
||||
reader.close();
|
||||
}
|
||||
feed = this.build(reader);
|
||||
reader.close();
|
||||
return feed;
|
||||
}
|
||||
|
||||
|
|
|
@ -185,8 +185,11 @@ public class WireFeedOutput {
|
|||
*/
|
||||
public void output(final WireFeed feed, final File file, final boolean prettyPrint) throws IllegalArgumentException, IOException, FeedException {
|
||||
final Writer writer = new FileWriter(file);
|
||||
this.output(feed, writer, prettyPrint);
|
||||
writer.close();
|
||||
try {
|
||||
this.output(feed, writer, prettyPrint);
|
||||
} finally {
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -518,7 +518,7 @@ public class XmlReader extends Reader {
|
|||
private String calculateHttpEncoding(final String cTMime, final String cTEnc, final String bomEnc, final String xmlGuessEnc, final String xmlEnc,
|
||||
final InputStream is, final boolean lenient) throws IOException {
|
||||
String encoding;
|
||||
if (lenient & xmlEnc != null) {
|
||||
if (lenient && xmlEnc != null) {
|
||||
encoding = xmlEnc;
|
||||
} else {
|
||||
final boolean appXml = isAppXml(cTMime);
|
||||
|
|
|
@ -283,7 +283,7 @@ public class Atom03Generator extends BaseWireFeedGenerator {
|
|||
|
||||
final String rel = link.getRel();
|
||||
if (rel != null) {
|
||||
final Attribute relAttribute = new Attribute("rel", rel.toString());
|
||||
final Attribute relAttribute = new Attribute("rel", rel);
|
||||
linkElement.setAttribute(relAttribute);
|
||||
}
|
||||
|
||||
|
@ -351,7 +351,7 @@ public class Atom03Generator extends BaseWireFeedGenerator {
|
|||
|
||||
final String mode = content.getMode();
|
||||
if (mode != null) {
|
||||
final Attribute modeAttribute = new Attribute("mode", mode.toString());
|
||||
final Attribute modeAttribute = new Attribute("mode", mode);
|
||||
contentElement.setAttribute(modeAttribute);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue