Sonar.sh CMDJAVA loop issue

SonarQube 7.9.2 LTS, running on RHEL
In comparing the sonar.sh packaged w/LTS 6.7.x to 7.9.x, observed the following addition:
CMDJAVA="java"
# read java command from wrapper.conf as first uncommented line containing "wrapper.java.command="
grep "wrapper.java.command=" "$WRAPPER_CONF" | grep -v "^#" | while read -r line; do
CMDJAVA="${line#*=}"
break
done

Seem like a potential infinite loop situation. This would be cleaner perhaps:

CMDJAVA=$(grep -v '^#' "$WRAPPER_CONF" | grep -m 1 "wrapper.java.command=" | cut -d= -f2)

and inside forcestopit(),

${CMDJAVA:-java} -classpath ...

EDIT: In fact, it seems you have a potentially bigger issue. wrapper takes the last value, not the first, so your will end up picking an inconsistent one if multiples are listed.

steps to reproduce:
wrapper.conf:
# Path to JVM executable. By default it must be available in PATH.
# Can be an absolute path, for example:
#wrapper.java.command=/path/to/my/jdk/bin/java
#wrapper.java.command=/apps/infra/java/jdk1.8/bin/java
wrapper.java.command=/apps/infra/java/jdk11/bin/java
wrapper.java.command=/apps/infra/java/jdk1.8/bin/java

./soanr.sh start:

logs show:
/apps/infra/java/jdk1.8.0_241/jre/bin/java ...

Alternative:
grep -v '^#' "$WRAPPER_CONF" | grep "wrapper.java.command=" | tail -1 | cut -d= -f2