Skip to content

Commit

Permalink
refact: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Dec 18, 2024
1 parent 049e761 commit f2853fd
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 51 deletions.
9 changes: 5 additions & 4 deletions org.eclipse.tm4e.core.tests/about.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="ISO-8859-1">
<title>About</title>
</head>
<body lang="EN-US">
<body>
<h2>About This Content</h2>

<p>November 30, 2017</p>
Expand Down
7 changes: 3 additions & 4 deletions org.eclipse.tm4e.core/about.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta charset="ISO-8859-1">
<title>About</title>
</head>
<body lang="EN-US">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tm4e.core.theme.RGB;

public class CSSColors {
public final class CSSColors {
private static final Map<String, RGB> NAMED_COLORS = new HashMap<>();
static {
NAMED_COLORS.put("aliceblue", new RGB(240, 248, 255));
Expand Down Expand Up @@ -176,4 +176,7 @@ public class CSSColors {
public static @Nullable RGB getByName(final String name) {
return NAMED_COLORS.get(name);
}

private CSSColors() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void assertOnigRegExpSearch(final String pattern, final String input, fi
}

@Test
void testOnigRegExp() throws Exception {
void testOnigRegExp() {
assertOnigRegExpSearch(
"\\G(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
"ifeq (version,$(firstword $(MAKECMDGOALS))\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private void validateCaptures(final RawGrammar grammar) {
}

@Test
void testParseCapturesJSON() throws Exception {
void testParseCapturesJSON() {
// test capture defined as JSON map
validateCaptures(TMParserJSON.INSTANCE.parse(new StringReader("""
{"patterns": [{
Expand Down Expand Up @@ -136,7 +136,7 @@ void testParseCapturesPList() throws Exception {
}

@Test
void testParseCapturesYAML() throws Exception {
void testParseCapturesYAML() {
// test capture defined as YAML map
validateCaptures(TMParserYAML.INSTANCE.parse(new StringReader("""
---
Expand Down
3 changes: 1 addition & 2 deletions org.eclipse.tm4e.language_pack/about.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>About</title>
Expand All @@ -16,7 +16,6 @@
}
</style>
</head>
</head>
<body>

<h2>About This Content</h2>
Expand Down
9 changes: 5 additions & 4 deletions org.eclipse.tm4e.languageconfiguration/about.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="ISO-8859-1">
<title>About</title>
</head>
<body lang="EN-US">
<body>
<h2>About This Content</h2>

<p>November 30, 2017</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private Text createText(final Composite parent, final String s) {
infoWidget.refresh(null);

final String path = fileText.getText();
if (path.length() == 0) {
if (path.isEmpty()) {
return new Status(IStatus.ERROR, LanguageConfigurationPlugin.PLUGIN_ID,
SelectLanguageConfigurationWizardPage_fileError_noSelection);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ParsingTest {
}

@Test
void testOniguramaFallback() throws Exception {
void testOniguramaFallback() {
final var languageConfiguration = LanguageConfiguration.load(new StringReader("""
{
"onEnterRules": [{
Expand Down Expand Up @@ -117,7 +117,7 @@ public FileVisitResult visitFile(final Path file, final @Nullable BasicFileAttri
}

@Test
void testParseColorizedBracketsPair() throws Exception {
void testParseColorizedBracketsPair() {
final var languageConfiguration = LanguageConfiguration.load(new StringReader("""
{
"colorizedBracketPairs": [
Expand All @@ -135,7 +135,7 @@ void testParseColorizedBracketsPair() throws Exception {
}

@Test
void testIndentationRules() throws Exception {
void testIndentationRules() {
final var languageConfiguration = LanguageConfiguration.load(new StringReader("""
{
"indentationRules": {
Expand Down
9 changes: 4 additions & 5 deletions org.eclipse.tm4e.markdown/about.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta charset="ISO-8859-1">
<title>About</title>
</head>
<body lang="EN-US">
<body>
<h2>About This Content</h2>

<p>
Expand Down
9 changes: 5 additions & 4 deletions org.eclipse.tm4e.registry/about.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="ISO-8859-1">
<title>About</title>
</head>
<body lang="EN-US">
<body>
<h2>About This Content</h2>

<p>November 30, 2017</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ public boolean equals(final @Nullable Object obj) {
if (this == obj)
return true;
return obj instanceof TMScope other
? qualifiedName.equals(other.qualifiedName)
: false;
&& qualifiedName.equals(other.qualifiedName);
}

@Override
Expand Down
9 changes: 4 additions & 5 deletions org.eclipse.tm4e.samples/about.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta charset="ISO-8859-1">
<title>About</title>
</head>
<body lang="EN-US">
<body>
<h2>About This Content</h2>

<p>
Expand Down
9 changes: 4 additions & 5 deletions org.eclipse.tm4e.ui.tests/about.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta charset="ISO-8859-1">
<title>About</title>
</head>
<body lang="EN-US">
<body>
<h2>About This Content</h2>

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.FileOutputStream;
import java.io.IOException;

import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.widgets.Control;
import org.eclipse.tm4e.ui.internal.utils.UI;
import org.eclipse.tm4e.ui.tests.support.TestUtils;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.IDE;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -48,7 +46,7 @@ public void tearDown() throws Exception {
}

@Test
void testTMHighlightInGenericEditor() throws IOException, PartInitException {
void testTMHighlightInGenericEditor() throws Exception {
final var f = TestUtils.createTempFile(".ts");
try (var fileOutputStream = new FileOutputStream(f)) {
fileOutputStream.write("let a = '';\nlet b = 10;\nlet c = true;".getBytes());
Expand All @@ -60,7 +58,7 @@ void testTMHighlightInGenericEditor() throws IOException, PartInitException {
}

@Test
void testTMHighlightInGenericEditorEdit() throws IOException, PartInitException {
void testTMHighlightInGenericEditorEdit() throws Exception {
final var f = TestUtils.createTempFile(".ts");
try (var fileOutputStream = new FileOutputStream(f)) {
fileOutputStream.write("let a = '';".getBytes());
Expand Down
9 changes: 5 additions & 4 deletions org.eclipse.tm4e.ui/about.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="ISO-8859-1">
<title>About</title>
</head>
<body lang="EN-US">
<body>
<h2>About This Content</h2>

<p>November 30, 2017</p>
Expand Down

0 comments on commit f2853fd

Please sign in to comment.