forked from checkstyle/contribution
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#344: add multi-thread support to CheckstyleReportsPa…
…rser
- Loading branch information
Pavel Bludov
committed
Oct 31, 2020
1 parent
fbccbcb
commit 5c70a4b
Showing
4 changed files
with
177 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
patch-diff-report-tool/src/main/java/com/github/checkstyle/data/SeverityLevel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// checkstyle: Checks Java source code for adherence to a set of rules. | ||
// Copyright (C) 2001-2020 the original author or authors. | ||
// | ||
// This library is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 2.1 of the License, or (at your option) any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public | ||
// License along with this library; if not, write to the Free Software | ||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
package com.github.checkstyle.data; | ||
|
||
/** | ||
* Severity level for a {@link CheckstyleRecord}. | ||
* Used to compare two records in predefined order: "info", "warning", "error", all other. | ||
*/ | ||
public enum SeverityLevel { | ||
|
||
/** Severity level info. */ | ||
INFO, | ||
|
||
/** Severity level warning. */ | ||
WARNING, | ||
|
||
/** Severity level error. */ | ||
ERROR, | ||
|
||
/** All other severity levels. */ | ||
OTHER; | ||
|
||
/** | ||
* SeverityLevel factory method. | ||
* | ||
* @param securityLevelName level name, such as "info", "warning", "error", etc. | ||
* @return the {@code SeverityLevel} associated with {@code securityLevelName} | ||
*/ | ||
public static SeverityLevel getInstance(String securityLevelName) { | ||
final SeverityLevel result; | ||
switch (securityLevelName) { | ||
case "info": | ||
result = INFO; | ||
break; | ||
case "warning": | ||
result = WARNING; | ||
break; | ||
case "error": | ||
result = ERROR; | ||
break; | ||
default: | ||
result = OTHER; | ||
break; | ||
} | ||
return result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters