Skip to content

Commit

Permalink
Create Parser.java
Browse files Browse the repository at this point in the history
  • Loading branch information
atfield90 authored Apr 19, 2022
1 parent c041753 commit 21f6ed9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/src/main/java/net/sourceforge/jnlp/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,15 @@ protected void addInfo(InformationDesc info, XmlNode node, String mod, Object va
private IconDesc getIcon(XmlNode node) throws ParseException {
int width = Integer.parseInt(getAttribute(node, IconDesc.WIDTH_ATTRIBUTE, "-1"));
int height = Integer.parseInt(getAttribute(node, IconDesc.HEIGHT_ATTRIBUTE, "-1"));
int size = Integer.parseInt(getAttribute(node, IconDesc.SIZE_ATTRIBUTE, "-1"));
int size = -1;
String sizeInString = getAttribute(node, IconDesc.SIZE_ATTRIBUTE, "-1");
try {
size = Integer.parseInt(sizeInString);
} catch (NumberFormatException numberFormatException) {
String[] widthXheight = sizeInString.split("x");
width = Integer.parseInt(WidthXHeight[0]);
height = Integer.parseInt(WidthXHeight[1]);
}
int depth = Integer.parseInt(getAttribute(node, IconDesc.DEPTH_ATTRIBUTE, "-1"));
URL location = getRequiredURL(node, IconDesc.HREF_ATTRIBUTE, base, strict);

Expand Down

0 comments on commit 21f6ed9

Please sign in to comment.