Skip to content

Commit e29354f

Browse files
committed
Address log4j2 string to format review and add license to css files
1 parent 1567024 commit e29354f

File tree

3 files changed

+44
-6
lines changed

3 files changed

+44
-6
lines changed

server/src/main/java/org/apache/cloudstack/gui/theme/GuiThemeServiceImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ protected void persistGuiThemeDetails(long guiThemeId, String commonNames, Strin
166166

167167
protected void persistDetailValueIfNotNull(long guiThemeId, String providedParameter, String type) {
168168
if (providedParameter == null) {
169-
logger.trace(String.format("GUI theme provided parameter `%s` is null; therefore, it will be ignored.", type));
169+
logger.trace("GUI theme provided parameter `{}` is null; therefore, it will be ignored.", type);
170170
return;
171171
}
172172
for (String splitParameter : StringUtils.deleteWhitespace(providedParameter).split(",")) {
@@ -258,7 +258,7 @@ protected void validateJsonConfiguration(String jsonConfig) {
258258
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
259259
entries.stream().forEach(entry -> validateJsonAttributes(entry, jsonObject));
260260
} catch (JsonSyntaxException exception) {
261-
logger.error(String.format("The following exception was thrown while parsing the JSON object: [%s].", exception.getMessage()));
261+
logger.error("The following exception was thrown while parsing the JSON object: [{}].", exception.getMessage());
262262
throw new CloudRuntimeException("Specified JSON configuration is not a valid JSON object.");
263263
}
264264
}
@@ -272,7 +272,7 @@ private void validateJsonAttributes(Map.Entry<String, JsonElement> entry, JsonOb
272272
String entryKey = entry.getKey();
273273

274274
if (entryValue.isJsonPrimitive() && ALLOWED_PRIMITIVE_PROPERTIES.contains(entryKey)) {
275-
logger.trace("The JSON attribute [%s] is a valid option.");
275+
logger.trace("The JSON attribute [{}] is a valid option.", entryKey);
276276
jsonObject.add(entryKey, entryValue);
277277
} else if (entryValue.isJsonObject() && ERROR.equals(entryKey)) {
278278
validateErrorAttribute(entry, jsonObject);
@@ -330,7 +330,7 @@ protected JsonObject createJsonObject(Set<Map.Entry<String, JsonElement>> entrie
330330
}
331331

332332
protected void warnOfInvalidJsonAttribute(String entryKey) {
333-
logger.warn(String.format("The JSON attribute [%s] is not a valid option, therefore, it will be ignored.", entryKey));
333+
logger.warn("The JSON attribute [{}] is not a valid option, therefore, it will be ignored.", entryKey);
334334
}
335335

336336
/**
@@ -407,7 +407,7 @@ protected GuiThemeJoinVO persistGuiTheme(Long guiThemeId, String name, String de
407407
guiThemeVO.setRecursiveDomains(recursiveDomains);
408408
}
409409

410-
logger.trace(String.format("Persisting GUI theme [%s] with CSS [%s] and JSON configuration [%s].", guiThemeVO, guiThemeVO.getCss(), guiThemeVO.getJsonConfiguration()));
410+
logger.trace("Persisting GUI theme [{}] with CSS [{}] and JSON configuration [{}].", guiThemeVO, guiThemeVO.getCss(), guiThemeVO.getJsonConfiguration());
411411

412412
guiThemeDao.persist(guiThemeVO);
413413
guiThemeDetailsDao.expungeByGuiThemeId(guiThemeId);
@@ -433,7 +433,7 @@ public void removeGuiTheme(RemoveGuiThemeCmd cmd) {
433433
if (guiThemeVO != null) {
434434
guiThemeDao.remove(guiThemeId);
435435
} else {
436-
logger.error(String.format("Unable to find a GUI theme with the specified ID [%s].", guiThemeId));
436+
logger.error("Unable to find a GUI theme with the specified ID [{}].", guiThemeId);
437437
throw new CloudRuntimeException("Unable to find a GUI theme with the specified ID.");
438438
}
439439
}

ui/public/css/apache-theme.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
221

322
:root {

ui/public/css/dark-theme.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
221

322
:root {

0 commit comments

Comments
 (0)