Skip to content

Commit

Permalink
java: Formatting and final args
Browse files Browse the repository at this point in the history
  • Loading branch information
terryburton committed Aug 3, 2022
1 parent 72aebe8 commit d7adcf5
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions libs/bindings/java/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,34 @@ public class Example {
System.loadLibrary("postscriptbarcode");
}

public static void main(String args[]) {
BWIPP bwipp1 = new BWIPP("../../../build/monolithic_package/barcode.ps");
public static void main(final String args[]) {
BWIPP bwipp1 =
new BWIPP("../../../build/monolithic_package/barcode.ps");

if (bwipp1.get_version() == null) {
System.err.println("Failed to load resource");
System.exit(1);
}
BWIPP bwipp2 = new BWIPP("../../../build/monolithic/barcode.ps");

BWIPP bwipp2 =
new BWIPP("../../../build/monolithic/barcode.ps");

if (bwipp2.get_version() == null) {
System.err.println("Failed to load resource");
System.exit(1);
}

System.out.println("Packaged version: " + bwipp1.get_version());
System.out.println("Unpackaged version: " + bwipp2.get_version());

String ps = bwipp1.emit_all_resources();
System.out.println("Packaged lines: " + ps.split("\r\n|\r|\n").length);
System.out.println("Packaged lines: " +
ps.split("\r\n|\r|\n").length);

ps = bwipp2.emit_all_resources();
System.out.println("Unpackaged lines: " + ps.split("\r\n|\r|\n").length);
System.out.println("Unpackaged lines: " +
ps.split("\r\n|\r|\n").length);

}

}

0 comments on commit d7adcf5

Please sign in to comment.