Skip to content

Commit

Permalink
Clean up code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
echrist committed Oct 16, 2013
1 parent 49b22a5 commit 67cfc0a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
21 changes: 10 additions & 11 deletions src/main/java/org/mongeez/reader/FilesetXMLReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@ public List<Resource> getFiles(Resource file) {
digester.addSetNext("changeFiles/file", "add");

ChangeFileSet changeFileSet = (ChangeFileSet) digester.parse(file.getInputStream());
if (changeFileSet != null) {
logger.info("Num of changefiles " + changeFileSet.getChangeFiles().size());

for (ChangeFile changeFile : changeFileSet.getChangeFiles()) {
files.add(file.createRelative(changeFile.getPath()));
}
}
else {
logger.error("The file {} doesn't seem to contain a changeFiles declaration. Are you "
+ "using the correct file to initialize Mongeez?", file.getFilename());
}
if (changeFileSet != null) {
logger.info("Num of changefiles " + changeFileSet.getChangeFiles().size());
for (ChangeFile changeFile : changeFileSet.getChangeFiles()) {
files.add(file.createRelative(changeFile.getPath()));
}
}
else {
logger.error("The file {} doesn't seem to contain a changeFiles declaration. Are you "
+ "using the correct file to initialize Mongeez?", file.getFilename());
}
} catch (IOException e) {
logger.error("IOException", e);
} catch (org.xml.sax.SAXException e) {
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/org/mongeez/reader/XmlChangeSetReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,25 @@ public boolean supports(Resource file) {
}

@Override
public List<ChangeSet> getChangeSets(Resource file) {
public List<ChangeSet> getChangeSets(Resource file) {
List<ChangeSet> changeSets = new ArrayList<ChangeSet>();

try {
ChangeSetList changeFileSet = (ChangeSetList) digester.parse(file.getInputStream());
if (changeFileSet.getList() == null) {
logger.warn("Ignoring change file {}, it does not contain any changeSets", file.getFilename());
}
else {
for (ChangeSet changeSet : changeFileSet.getList()) {
ChangeSetReaderUtil.populateChangeSetResourceInfo(changeSet, file);
}
changeSets.addAll(changeFileSet.getList());
}
if (changeFileSet.getList() == null) {
logger.warn("Ignoring change file {}, it does not contain any changeSets", file.getFilename());
}
else {
for (ChangeSet changeSet : changeFileSet.getList()) {
ChangeSetReaderUtil.populateChangeSetResourceInfo(changeSet, file);
}
changeSets.addAll(changeFileSet.getList());
}
} catch (IOException e) {
logger.error("IOException", e);
} catch (org.xml.sax.SAXException e) {
logger.error("SAXException", e);
}

return changeSets;
}
}

0 comments on commit 67cfc0a

Please sign in to comment.