Skip to content

Commit 11d5bbd

Browse files
authored
Rename static variable
1 parent 9ccc64c commit 11d5bbd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/org/cryptomator/linux/quickaccess/DolphinPlaces.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ public class DolphinPlaces implements QuickAccessService {
5252
</bookmark>""";
5353

5454

55-
private static final Validator xmlValidator;
55+
private static final Validator XML_VALIDATOR;
5656

5757
static {
5858
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
5959
try (var schemaDefinition = DolphinPlaces.class.getResourceAsStream("/xbel-1.0.xsd")) {
6060
Source schemaFile = new StreamSource(schemaDefinition);
61-
xmlValidator = factory.newSchema(schemaFile).newValidator();
61+
XML_VALIDATOR = factory.newSchema(schemaFile).newValidator();
6262
} catch (IOException | SAXException e) {
6363
throw new IllegalStateException("Failed to load included XBEL schema definition file.", e);
6464
}
@@ -75,7 +75,7 @@ public QuickAccessService.QuickAccessEntry add(Path target, String displayName)
7575
}
7676
var placesContent = Files.readString(PLACES_FILE);
7777
//validate
78-
xmlValidator.validate(new StreamSource(new StringReader(placesContent)));
78+
XML_VALIDATOR.validate(new StreamSource(new StringReader(placesContent)));
7979
// modify
8080
int insertIndex = placesContent.lastIndexOf("</xbel"); //cannot be -1 due to validation; we do not match the end tag, since betweent tag name and closing bracket can be whitespaces
8181
try (var writer = Files.newBufferedWriter(TMP_FILE, StandardCharsets.UTF_8, StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) {
@@ -121,7 +121,7 @@ public void remove() throws QuickAccessServiceException {
121121
return; //we assume someone has removed our entry
122122
}
123123
//validate
124-
xmlValidator.validate(new StreamSource(new StringReader(placesContent)));
124+
XML_VALIDATOR.validate(new StreamSource(new StringReader(placesContent)));
125125
//modify
126126
int openingTagIndex = indexOfEntryOpeningTag(placesContent, idIndex);
127127
var contentToWrite1 = placesContent.substring(0, openingTagIndex).stripTrailing();

0 commit comments

Comments
 (0)