Skip to content

Commit 3bd3a52

Browse files
Vladlisromani
authored andcommitted
spelling: fix some typos in code/javadoc/comments
1 parent 5b16c53 commit 3bd3a52

22 files changed

+53
-53
lines changed

src/main/java/com/puppycrawl/tools/checkstyle/AstTreeStringPrinter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private static String printTree(DetailAST ast) {
160160
*/
161161
private static String getNodeInfo(DetailAST node) {
162162
return TokenUtils.getTokenName(node.getType())
163-
+ " -> " + excapeAllControlChars(node.getText())
163+
+ " -> " + escapeAllControlChars(node.getText())
164164
+ " [" + node.getLineNo() + ':' + node.getColumnNo() + ']';
165165
}
166166

@@ -198,11 +198,11 @@ private static String getIndentation(DetailAST ast) {
198198
}
199199

200200
/**
201-
* Replace all control chars with excaped symbols.
201+
* Replace all control chars with escaped symbols.
202202
* @param text the String to process.
203-
* @return the processed String with all control chars excaped.
203+
* @return the processed String with all control chars escaped.
204204
*/
205-
private static String excapeAllControlChars(String text) {
205+
private static String escapeAllControlChars(String text) {
206206
final String textWithoutNewlines = NEWLINE.matcher(text).replaceAll("\\\\n");
207207
final String textWithoutReturns = RETURN.matcher(textWithoutNewlines).replaceAll("\\\\r");
208208
return TAB.matcher(textWithoutReturns).replaceAll("\\\\t");

src/main/java/com/puppycrawl/tools/checkstyle/AuditEventDefaultFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private static int calculateBufferLength(AuditEvent event, int severityLevelName
8585

8686
/**
8787
* Returns check name without 'Check' suffix.
88-
* @param event audit ivent.
88+
* @param event audit event.
8989
* @return check name without 'Check' suffix.
9090
*/
9191
private static String getCheckShortName(AuditEvent event) {

src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public static String printTree(DetailNode ast, String rootPrefix, String prefix)
119119
}
120120
messageBuilder.append(getIndentation(node))
121121
.append(JavadocUtils.getTokenName(node.getType())).append(" -> ")
122-
.append(JavadocUtils.excapeAllControlChars(node.getText())).append(" [")
122+
.append(JavadocUtils.escapeAllControlChars(node.getText())).append(" [")
123123
.append(node.getLineNumber()).append(':').append(node.getColumnNumber())
124124
.append(']').append(LINE_SEPARATOR)
125125
.append(printTree(JavadocUtils.getFirstChild(node), rootPrefix, prefix));

src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ private Object createObject(String className) throws CheckstyleException {
231231
instance = declaredConstructor.newInstance();
232232
}
233233
catch (final ReflectiveOperationException ex) {
234-
throw new CheckstyleException("Unable to instatiate " + className, ex);
234+
throw new CheckstyleException("Unable to instantiate " + className, ex);
235235
}
236236
}
237237

@@ -245,7 +245,7 @@ private static void fillShortToFullModuleNamesMap() {
245245
fillChecksFromAnnotationPackage();
246246
fillChecksFromBlocksPackage();
247247
fillChecksFromCodingPackage();
248-
fillChecksFromDesingPackage();
248+
fillChecksFromDesignPackage();
249249
fillChecksFromHeaderPackage();
250250
fillChecksFromImportsPackage();
251251
fillChecksFromIndentationPackage();
@@ -394,7 +394,7 @@ private static void fillChecksFromCodingPackage() {
394394
/**
395395
* Fill short-to-full module names map with Checks from design package.
396396
*/
397-
private static void fillChecksFromDesingPackage() {
397+
private static void fillChecksFromDesignPackage() {
398398
NAME_TO_FULL_MODULE_NAME.put("DesignForExtensionCheck",
399399
BASE_PACKAGE + ".checks.design.DesignForExtensionCheck");
400400
NAME_TO_FULL_MODULE_NAME.put("FinalClassCheck",

src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private static Set<ExternalResource> loadExternalResources(Set<String> resourceL
267267
}
268268
catch (CheckstyleException ex) {
269269
// if exception happened (configuration resource was not found, connection is not
270-
// available, resouce is broken, etc), we need to calculate hash sum based on
270+
// available, resource is broken, etc), we need to calculate hash sum based on
271271
// exception object content in order to check whether problem is resolved later
272272
// and/or the configuration is changed.
273273
contentHashSum = getHashCodeBasedOnObjectContent(ex);
@@ -282,7 +282,7 @@ private static Set<ExternalResource> loadExternalResources(Set<String> resourceL
282282
/**
283283
* Loads the content of external resource.
284284
* @param location external resource location.
285-
* @return array of bytes which respresents the content of external resource in binary form.
285+
* @return array of bytes which represents the content of external resource in binary form.
286286
* @throws CheckstyleException if error while loading occurs.
287287
*/
288288
private static byte[] loadExternalResource(String location) throws CheckstyleException {

src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,11 @@ public void destroy() {
462462

463463
@Override
464464
public Set<String> getExternalResourceLocations() {
465-
final Set<String> orinaryChecksResources = getExternalResourceLocations(ordinaryChecks);
465+
final Set<String> ordinaryChecksResources = getExternalResourceLocations(ordinaryChecks);
466466
final Set<String> commentChecksResources = getExternalResourceLocations(commentChecks);
467-
final int resultListSize = orinaryChecksResources.size() + commentChecksResources.size();
467+
final int resultListSize = ordinaryChecksResources.size() + commentChecksResources.size();
468468
final Set<String> resourceLocations = new HashSet<>(resultListSize);
469-
resourceLocations.addAll(orinaryChecksResources);
469+
resourceLocations.addAll(ordinaryChecksResources);
470470
resourceLocations.addAll(commentChecksResources);
471471
return resourceLocations;
472472
}

src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private static void registerIntegralTypes(ConvertUtilsBean cub) {
132132
*/
133133
private static void registerCustomTypes(ConvertUtilsBean cub) {
134134
cub.register(new PatternConverter(), Pattern.class);
135-
cub.register(new ServerityLevelConverter(), SeverityLevel.class);
135+
cub.register(new SeverityLevelConverter(), SeverityLevel.class);
136136
cub.register(new ScopeConverter(), Scope.class);
137137
cub.register(new UriConverter(), URI.class);
138138
cub.register(new RelaxedAccessModifierArrayConverter(), AccessModifier[].class);
@@ -285,7 +285,7 @@ public Object convert(Class type, Object value) {
285285
}
286286

287287
/** A converter that converts strings to severity level. */
288-
private static class ServerityLevelConverter implements Converter {
288+
private static class SeverityLevelConverter implements Converter {
289289
@SuppressWarnings({"unchecked", "rawtypes"})
290290
@Override
291291
public Object convert(Class type, Object value) {

src/main/java/com/puppycrawl/tools/checkstyle/api/ExternalResourceHolder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public interface ExternalResourceHolder {
4040
* ATTENTION!
4141
* If 'getExternalResourceLocations()' return null, there will be
4242
* {@link NullPointerException} in {@link Checker}.
43-
* Such behaviour will signal that your module (check or filter) is designed incorrectrly.
44-
* It make sence to return an empty set from 'getExternalResourceLocations()'
43+
* Such behaviour will signal that your module (check or filter) is designed incorrectly.
44+
* It make sense to return an empty set from 'getExternalResourceLocations()'
4545
* only for composite modules like {@link com.puppycrawl.tools.checkstyle.TreeWalker}.
4646
* @return a set of external configuration resource locations which are used by the module.
4747
*/

src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public class TranslationCheck extends AbstractFileSetCheck {
130130
private static final Log LOG = LogFactory.getLog(TranslationCheck.class);
131131

132132
/**
133-
* Regexp string for default tranlsation files.
133+
* Regexp string for default translation files.
134134
* For example, messages.properties.
135135
*/
136136
private static final String DEFAULT_TRANSLATION_REGEXP = "^.+\\..+$";
@@ -159,10 +159,10 @@ public class TranslationCheck extends AbstractFileSetCheck {
159159
/** File name format with language code. */
160160
private static final String FILE_NAME_WITH_LANGUAGE_CODE_FORMATTER = "%s_%s.%s";
161161

162-
/** Formatting string to form regexp to validate required tranlsations file names. */
162+
/** Formatting string to form regexp to validate required translations file names. */
163163
private static final String REGEXP_FORMAT_TO_CHECK_REQUIRED_TRANSLATIONS =
164164
"^%1$s\\_%2$s(\\_[A-Z]{2})?\\.%3$s$|^%1$s\\_%2$s\\_[A-Z]{2}\\_[A-Za-z]+\\.%3$s$";
165-
/** Formatting string to form regexp to validate default tranlsations file names. */
165+
/** Formatting string to form regexp to validate default translations file names. */
166166
private static final String REGEXP_FORMAT_TO_CHECK_DEFAULT_TRANSLATIONS = "^%s\\.%s$";
167167

168168
/** The files to process. */
@@ -202,7 +202,7 @@ public void setRequiredTranslations(String... translationCodes) {
202202
}
203203

204204
/**
205-
* Validates the correctness of user specififed language codes for the check.
205+
* Validates the correctness of user specified language codes for the check.
206206
* @param languageCodes user specified language codes for the check.
207207
*/
208208
private void validateUserSpecifiedLanguageCodes(Set<String> languageCodes) {
@@ -411,7 +411,7 @@ else if (languageMatcher.matches()) {
411411
else {
412412
regexp = DEFAULT_TRANSLATION_REGEXP;
413413
}
414-
// We use substring(...) insead of replace(...), so that the regular expression does
414+
// We use substring(...) instead of replace(...), so that the regular expression does
415415
// not have to be compiled each time it is used inside 'replace' method.
416416
final String removePattern = regexp.substring("^.+".length(), regexp.length());
417417
return fileName.replaceAll(removePattern, "");

src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public void visitToken(DetailAST ast) {
217217
/**
218218
* Checks if ast is default in annotation
219219
* @param ast ast to test.
220-
* @return true if current ast is default and it is part of annatation.
220+
* @return true if current ast is default and it is part of annotation.
221221
*/
222222
private boolean isDefaultInAnnotation(DetailAST ast) {
223223
boolean isDefaultInAnnotation = false;

0 commit comments

Comments
 (0)