This file contains hidden or 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
class WarnLocalDateConversion : Detector(), SourceCodeScanner { | |
override fun getApplicableMethodNames(): List<String> = listOf("toLocalDateTime", "toLocalDate") | |
override fun visitMethodCall(context: JavaContext, node: UCallExpression, method: PsiMethod) { | |
val receiverClassName = (node.receiverType as PsiClassReferenceType).reference.qualifiedName | |
if (receiverClassName == "org.joda.time.DateTime") { | |
context.report( | |
WARN_LOCAL_DATE_CONVERSION, | |
node, | |
context.getLocation(node), |
This file contains hidden or 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
// Define Joda-Time stub | |
val JODA_STUB = TestFiles.kotlin( | |
""" | |
package org.joda.time | |
class DateTime( | |
private val moment: Int, | |
private val zone: String | |
) { | |
companion object { |
OlderNewer