Skip to content

Commit

Permalink
Fix some check issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jun 5, 2023
1 parent ddca8ab commit b28a681
Showing 1 changed file with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.mapfish.print;
package org.mapfish.print.jasperreports;

import java.util.Stack;

Expand All @@ -7,6 +7,17 @@
*/
public class HumanAlphaSerie {

private HumanAlphaSerie() {
// Raise exception because the class should not be instantiated
throw new AssertionError();
}

/**
* Convert an integer to an alpha index.
*
* @param number the number to convert
* @return the alpha index
*/
public static String toString(int number) {
if (number <= 0) {
return "";
Expand Down Expand Up @@ -34,7 +45,10 @@ public static String toString(int number) {
return convertToString(stack);
}

private static String convertToString(Stack<Integer> array) {
/**
* Convert the stack to a string.
*/
private static String convertToString(final Stack<Integer> array) {
StringBuilder sb = new StringBuilder();

while (!array.isEmpty()) {
Expand All @@ -44,7 +58,10 @@ private static String convertToString(Stack<Integer> array) {
return sb.toString();
}

private static char numberToChar(int number) {
/**
* Convert a number to a char. 1 -> A, 2 -> B, 26 -> Z.
*/
private static char numberToChar(final int number) {
if (number > 26 || number < 0) {
return '\0';
}
Expand Down

0 comments on commit b28a681

Please sign in to comment.