Skip to content

Commit

Permalink
Merge pull request #13 from Autodesk/master
Browse files Browse the repository at this point in the history
Fixed multi-file processing bug
  • Loading branch information
damercie committed Feb 28, 2018
2 parents 18bb2a8 + 18097d7 commit 12884a2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,11 @@ public MapJsonToPlugin(Integer build, Map<String, FilePath> content, JsonElement

InitiateLoading(group, jContent, schema);
listener.getLogger().println(" - " + relativePath);
files_processed++;
} catch (Exception e){
listener.getLogger().println(" - " + Messages.MapJsonToPlugin_PrintFailedToLoadFile(relativePath));
continue;
}
listener.getLogger().println(" - " + relativePath);
files_processed++;
}
if (files_processed == 0) {
throw new ValidationException(Messages.MapJsonToPlugin_NoValidFileFound());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,14 @@ public Integer getFileHash() {

public boolean isArray() { return (ctype == ClassType.ct_array); }
public String getFullName() {
if (this.name.equalsIgnoreCase("__root__") || this.name.equalsIgnoreCase("__first__")) {
if (this.name.equalsIgnoreCase("__root__")) {
return "";
} else if (this.name.equalsIgnoreCase("__first__")) {
if (this.parent != null) {
return this.parent.getFullName();
} else {
return "";
}
} else {
String fullName = this.parent.getFullName();
if (this.getClassType() == ClassType.ct_fileGrp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,18 +498,18 @@ public static void convertResultJsonObject(int build, JsonObject object, TestGro
}
}
} else if (key.equals("file")) {
JsonElement inObject = enObject.getValue();
if (inObject.isJsonPrimitive()) {
JsonPrimitive primitive = inObject.getAsJsonPrimitive();
if (primitive.isNumber()) {
TestGroup file = fileList.get(primitive.getAsInt());
if (file != null) {
_file = file;
JsonElement inObject = enObject.getValue();
if (inObject.isJsonPrimitive()) {
JsonPrimitive primitive = inObject.getAsJsonPrimitive();
if (primitive.isNumber()) {
TestGroup file = fileList.get(primitive.getAsInt());
if (file != null) {
_file = file;
}
}
}
}
}
}
switch (_type) {
case rt_boolean:
BooleanValue bool_value = new BooleanValue (_file, null, _name, _description, _unit);
Expand Down

0 comments on commit 12884a2

Please sign in to comment.