Code in sun.net.www.protocol.mailto.Handler#parseURL can be simplified.
Manual cycle could be replaced with String.isBlank
boolean nogood = false;
if (file == null || file.isEmpty())
nogood = true;
else {
boolean allwhites = true;
for (int i = 0; i < file.length(); i++)
if (!Character.isWhitespace(file.charAt(i)))
allwhites = false;
if (allwhites)
nogood = true;
}
if (nogood)
throw new RuntimeException("No email address");
Manual cycle could be replaced with String.isBlank
boolean nogood = false;
if (file == null || file.isEmpty())
nogood = true;
else {
boolean allwhites = true;
for (int i = 0; i < file.length(); i++)
if (!Character.isWhitespace(file.charAt(i)))
allwhites = false;
if (allwhites)
nogood = true;
}
if (nogood)
throw new RuntimeException("No email address");