Skip to content

Commit e22b3ff

Browse files
committed
fix bugs
1 parent 9a6439b commit e22b3ff

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

checks/src/main/java/com/omegar/lint/checks/detector/code_guidelines/kotlin_rules/exception/ExceptionCatchDetector.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ExceptionCatchDetector : Detector(), Detector.UastScanner {
5151
body,
5252
context.getNameLocation(body),
5353
ISSUE.getExplanation(TextFormat.TEXT),
54-
createEmptyBodyFix(string)
54+
createEmptyBodyFix()
5555
)
5656
}
5757
val parameters = node.parameters
@@ -63,7 +63,7 @@ class ExceptionCatchDetector : Detector(), Detector.UastScanner {
6363
body,
6464
context.getLocation(it as UElement),
6565
GENERALIZED_EXCEPTION_MESSAGE,
66-
createEmptyBodyFix(string)
66+
createEmptyBodyFix()
6767
)
6868
}
6969
}
@@ -72,7 +72,7 @@ class ExceptionCatchDetector : Detector(), Detector.UastScanner {
7272
}
7373
}
7474

75-
private fun createEmptyBodyFix(bodyString: String): LintFix {
75+
private fun createEmptyBodyFix(): LintFix {
7676
return LintFix.create()
7777
.replace()
7878
.text("}")

checks/src/main/java/com/omegar/lint/checks/detector/project_guidelines/file_name/class/NameFileUpperCamelCaseDetector.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ class NameFileUpperCamelCaseDetector : Detector(), Detector.UastScanner {
3434
override fun createUastHandler(context: JavaContext): UElementHandler {
3535
return object : UElementHandler() {
3636
override fun visitClass(node: UClass) {
37-
/**
38-
* UpperCamelCase check
39-
*/
4037
val name = node.name ?: return
4138

4239
if (name.contains(WRONG_NAME_REGEX)) {
@@ -62,12 +59,12 @@ class NameFileUpperCamelCaseDetector : Detector(), Detector.UastScanner {
6259

6360

6461
private fun getNewName(oldName: String): String {
65-
lateinit var resultName: String
62+
var resultName = ""
6663
val charArray = oldName.toCharArray()
6764

6865
for (i in 1 until oldName.length) {
6966
val currentChar = charArray[i]
70-
val previousChar = charArray[i-1]
67+
val previousChar = charArray[i - 1]
7168

7269
resultName += if (currentChar.isUpperCase() && previousChar.isUpperCase()) {
7370
currentChar.toLowerCase()

0 commit comments

Comments
 (0)