Skip to content

Commit

Permalink
Address some Lint warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
EMaksymenko committed Dec 3, 2023
1 parent 607b962 commit 5af264e
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class MainActivity: AppCompatActivity(), NavigationView.OnNavigationItemSelected
private fun loadTutorial(globeFragment: Class<out Fragment>, url: String, titleId: Int) {
try {
setTitle(titleId)
val globe = globeFragment.newInstance()
val globe = globeFragment.getDeclaredConstructor().newInstance()
supportFragmentManager
.beginTransaction()
.replace(R.id.globe_container, globe) // replace (destroy) existing fragment (if any)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@file:JsExport
@file:Suppress("OPT_IN_USAGE", "NON_EXPORTABLE_TYPE")

package earth.worldwind.tutorials

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ actual open class MilStd2525Placemark actual constructor(
*
* @return A new [PlacemarkAttributes] bundle representing the MIL-STD-2525 symbol.
*/
@JvmStatic
actual fun getPlacemarkAttributes(
symbolCode: String, symbolModifiers: Map<String, String>?, symbolAttributes: Map<String, String>?
): PlacemarkAttributes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import earth.worldwind.shape.*
import earth.worldwind.util.Logger
import kotlin.math.roundToInt

actual open class MilStd2525TacticalGraphic actual constructor(
actual open class MilStd2525TacticalGraphic @JvmOverloads actual constructor(
sidc: String, locations: List<Location>,
boundingSector: Sector, modifiers: Map<String, String>?, attributes: Map<String, String>?
) : AbstractMilStd2525TacticalGraphic(sidc, locations, boundingSector, modifiers, attributes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ open class Matrix3 private constructor(
*
* @return this matrix set to the inverse of the specified matrix
*/
fun invertMatrix(matrix: Matrix3): Matrix3 {
@Suppress("UNUSED_PARAMETER")
fun invertMatrix(matrix: Matrix3): Matrix3 {
TODO("Matrix3.invertMatrix is not implemented")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ abstract class AbstractGraticuleLayer(name: String): AbstractLayer(name) {
altitudeMode = AltitudeMode.CLAMP_TO_GROUND
}

@Suppress("UNUSED_PARAMETER")
fun createTextRenderable(position: Position, label: String, resolution: Double) = Label(position, label).apply {
altitudeMode = AltitudeMode.CLAMP_TO_GROUND
// priority = resolution * 1e6 // TODO Implement priority
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package earth.worldwind.shape.milstd2525

import earth.worldwind.geom.Position
import earth.worldwind.shape.PlacemarkAttributes
import kotlin.jvm.JvmStatic

expect open class MilStd2525Placemark(
symbolCode: String,
Expand All @@ -11,10 +10,8 @@ expect open class MilStd2525Placemark(
symbolAttributes: Map<String, String>? = null
) : AbstractMilStd2525Placemark {
companion object {
@JvmStatic
fun clearSymbolCache()

@JvmStatic
fun getPlacemarkAttributes(
symbolCode: String,
symbolModifiers: Map<String, String>? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package earth.worldwind.shape.milstd2525

import earth.worldwind.geom.Location
import earth.worldwind.geom.Sector
import kotlin.jvm.JvmOverloads

expect open class MilStd2525TacticalGraphic @JvmOverloads constructor(
expect open class MilStd2525TacticalGraphic(
sidc: String, locations: List<Location>, boundingSector: Sector = defaultBoundingSector(locations),
modifiers: Map<String, String>? = null, attributes: Map<String, String>? = null
) : AbstractMilStd2525TacticalGraphic
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package earth.worldwind.util

import kotlin.jvm.JvmOverloads
import kotlin.jvm.JvmStatic

expect object Logger {
val ERROR: Int
val WARN: Int
val INFO: Int
val DEBUG: Int

@JvmStatic
fun isLoggable(priority: Int): Boolean

/**
Expand All @@ -20,14 +16,9 @@ expect object Logger {
* @param message The message to log. Nothing is logged if the message is null or undefined.
* @param tr Optional exception
*/
@JvmStatic
@JvmOverloads
fun log(priority: Int, message: String, tr: Throwable? = null)

@JvmStatic
@JvmOverloads
fun logMessage(level: Int, className: String, methodName: String, message: String, tr: Throwable? = null): String

@JvmStatic
fun makeMessage(className: String, methodName: String, message: String): String
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import earth.worldwind.shape.*
import earth.worldwind.util.Logger
import java.awt.geom.Point2D

actual open class MilStd2525TacticalGraphic actual constructor(
actual open class MilStd2525TacticalGraphic @JvmOverloads actual constructor(
sidc: String, locations: List<Location>,
boundingSector: Sector, modifiers: Map<String, String>?, attributes: Map<String, String>?
) : AbstractMilStd2525TacticalGraphic(sidc, locations, boundingSector, modifiers, attributes) {
Expand Down

0 comments on commit 5af264e

Please sign in to comment.