Skip to content

Commit

Permalink
Remove String Template Preview for Java 23
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Jul 5, 2024
1 parent 87f8336 commit e730c74
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class AuditLog {
public static final String LOG_FILE_PATTERN = "org.apache.sling.commons.log.file.pattern";

public static final String LOG_FOLDER_PATH =
STR."\{AppProperties.WEASIS_PATH}\{File.separator}log\{File.separator}";
AppProperties.WEASIS_PATH + File.separator + "log" + File.separator;

public enum LEVEL {
TRACE,
Expand All @@ -70,11 +70,14 @@ public static WProperties getAuditProperties() {
WProperties p = new WProperties();
p.putBooleanProperty(AuditLog.LOG_FILE_ACTIVATION, true);
p.setProperty(
AuditLog.LOG_FILE, STR."\{AuditLog.LOG_FOLDER_PATH}audit-\{AppProperties.WEASIS_USER}.log");
AuditLog.LOG_FILE,
AuditLog.LOG_FOLDER_PATH + "audit-" + AppProperties.WEASIS_USER + ".log"); // NON-NLS
p.setProperty(AuditLog.LOG_FILE_NUMBER, "10");
p.setProperty(AuditLog.LOG_FILE_SIZE, "20MB"); // NON-NLS
p.setProperty(AuditLog.LOG_CLASSES, "org.weasis.core.api.service.AuditLog");
p.setProperty(AuditLog.LOG_FILE_PATTERN, STR."audit-\{AppProperties.WEASIS_USER}.%i.log.zip");
p.setProperty(
AuditLog.LOG_FILE_PATTERN,
AuditLog.LOG_FOLDER_PATH + "audit-" + AppProperties.WEASIS_USER + ".%i.log.zip"); // NON-NLS
return p;
}

Expand Down Expand Up @@ -174,7 +177,7 @@ public static PatternLayoutEncoder getPatternLayoutEncoder(
encoder.setContext(loggerContext);

String limit = StringUtil.hasText(stackLimit) && !"-1".equals(stackLimit) ? stackLimit : "full";
String str = pattern.replaceAll("ex\\{\\d+}", STR."ex{\{limit}}"); // NON-NLS
String str = pattern.replaceAll("ex\\{\\d+}", "ex{" + limit + "}"); // NON-NLS
encoder.setPattern(str);
encoder.start();
return encoder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,12 @@ public void closeAdditionalWindow() {
}
preferences.setProperty(AuditLog.LOG_LEVEL, level.toString());
preferences.putBooleanProperty(AuditLog.LOG_FILE_ACTIVATION, checkboxFileLog.isSelected());
String logFile =
checkboxFileLog.isSelected() ? STR."\{AuditLog.LOG_FOLDER_PATH}default.log" : "";
String logFile = checkboxFileLog.isSelected() ? AuditLog.LOG_FOLDER_PATH + "default.log" : "";
preferences.setProperty(AuditLog.LOG_FILE, logFile);

if (checkboxFileLog.isSelected()) {
String fileNb = spinner.getValue().toString();
String fileSize = STR."\{spinner1.getValue().toString()}MB";
String fileSize = spinner1.getValue().toString() + "MB";
preferences.setProperty(AuditLog.LOG_FILE_NUMBER, fileNb);
preferences.setProperty(AuditLog.LOG_FILE_SIZE, fileSize);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,9 @@ private JTextPane getErrorPanel(int nbErrors) {
"""
.formatted(
message,
STR."\{
GuiUtils.getUICore()
.getSystemPreferences()
.getProperty("weasis.help.online")}logging",
GuiUtils.getUICore().getSystemPreferences().getProperty("weasis.help.online")
+ "logging",
logOutput);

JTextPane jTextPane1 = GuiUtils.getPanelWithHyperlink(html);
jTextPane1.setBorder(new EmptyBorder(5, 5, 15, 5));
return jTextPane1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public XYChart appendChart(StructRegion region, XYChart dvhChart) {
String sName = region.getLabel();
int k = 2;
while (dvhChart.getSeriesMap().get(sName) != null) {
sName = STR."\{region.getLabel()} \{k}";
sName = region.getLabel() + " " + k;
k++;
}
// Create a line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public IsoDoseRegion(int level, Color color, String name, double planDose) {
setInteriorOpacity(0.2f);
this.absoluteDose = ((this.level) * planDose) / 100.0;
String result =
STR."\{this.level} % / \{String.format("%.6g", this.absoluteDose)} cGy"; // NON-NLS
this.level + " % / " + String.format("%.6g", this.absoluteDose) + " cGy"; // NON-NLS
if (StringUtil.hasText(name)) {
result += STR." [\{name}]";
result += " [" + name + "]";
}
setLabel(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ public Dose getFirstDose() {

public void appendName(String text) {
if (StringUtil.hasText(this.name)) {
this.name += STR." (\{text})";
this.name += " (" + text + ")";
} else if (StringUtil.hasText(this.label)) {
this.name = STR."\{this.label} (\{text})";
this.name = this.label + " (" + text + ")";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ public String toString() {

String type = layer.getRtRoiInterpretedType();
if (StringUtil.hasText(type)) {
resultLabel += STR." [\{type}]";
resultLabel += " [" + type + "]";
}

return getColorBullet(layer.getColor(), resultLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ private static void writeToCsv(List<StructRegion> segRegions) {
CsvExporter csv = new CsvExporter();
csv.addQuotedNameAndSeparator("Label"); // NON-NLS
csv.addQuotedNameAndSeparator("ROI Observation Label"); // NON-NLS
csv.addQuotedNameAndSeparator(STR."\{Messages.getString("thickness")} [mm]");
csv.addQuotedNameAndSeparator(STR."\{Messages.getString("volume")} [cm³]");
csv.addQuotedNameAndSeparator(Messages.getString("thickness") + " [mm]"); // NON-NLS
csv.addQuotedNameAndSeparator(Messages.getString("volume") + " [cm³]"); // NON-NLS
if (hasDvh(segRegions)) {
csv.addQuotedNameAndSeparator(STR."\{Messages.getString("min.dose")} [%]");
csv.addQuotedNameAndSeparator(STR."\{Messages.getString("max.dose")} [%]");
csv.addQuotedName(STR."\{Messages.getString("mean.dose")} [%]");
csv.addQuotedNameAndSeparator(Messages.getString("min.dose") + " [%]");
csv.addQuotedNameAndSeparator(Messages.getString("max.dose") + " [%]");
csv.addQuotedName(Messages.getString("mean.dose") + " [%]");
}
csv.addEndOfLine();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ public final void launch(Type type) throws Exception {
JOptionPane.showOptionDialog(
mainFrame.getWindow(),
String.format(
STR."\{
Messages.getString("WeasisLauncher.update_min")}\n\n\{
Messages.getString("WeasisLauncher.continue_local")}",
"%s\n\n%s",
Messages.getString("WeasisLauncher.update_min"),
Messages.getString("WeasisLauncher.continue_local"),
appName,
minVersion),
null,
Expand Down Expand Up @@ -252,10 +252,10 @@ public final void launch(Type type) throws Exception {
LOGGER.error("State of the framework:");
for (Bundle b : mFelix.getBundleContext().getBundles()) {
LOGGER.error(
STR." * \{
b.getSymbolicName()}-\{
b.getVersion().toString()} \{
State.valueOf(b.getState())}");
" * {}-{} {}",
b.getSymbolicName(),
b.getVersion().toString(),
State.valueOf(b.getState()));
}
resetBundleCache();
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ private void splitArgToCmd(String... args) {
LOGGER.error("Convert URI to file", e);
}
}
arguments.add(STR."dicom:get -l \"\{val}\""); // NON-NLS
arguments.add("dicom:get -l \"" + val + "\""); // NON-NLS
}
}
}
Expand Down

0 comments on commit e730c74

Please sign in to comment.