Permalink
Browse files

Compilation fixed for the fresh KotlinC

  • Loading branch information...
1 parent 7dd9896 commit 7e80b114a863409a2b602fb3f5361ccbdac91170 @shafirov shafirov committed Sep 20, 2013
View
2 src/KaraLib/src/kara/controllers/Annotations.kt
@@ -21,4 +21,4 @@ Retention(RetentionPolicy.RUNTIME) annotation class Delete(val route : String =
/** Used to annotate route objects, representing alternative URL path component.
Default is / for top level root object or lowercased object name for inner objects
*/
-Retention(RetentionPolicy.RUNTIME) annotation class Path(val path: String? = null)
+Retention(RetentionPolicy.RUNTIME) annotation class Path(val path: String = "")
View
3 src/KaraLib/src/kara/internal/ReflectionUtils.kt
@@ -19,7 +19,8 @@ fun Class<*>.objectInstance() : Any? {
fun Class<*>.routePrefix() : String {
val owner = getEnclosingClass()
val defaultPart = if (owner == null) "" else getSimpleName().toLowerCase()
- val part = getAnnotation(javaClass<Path>())?.path ?: defaultPart
+ val annotatedPath = getAnnotation(javaClass<Path>())?.path
+ val part = if (annotatedPath == null || annotatedPath.isEmpty()) defaultPart else annotatedPath
val base = if (owner == null) "" else owner.routePrefix()
return base.appendPathElement(part)

0 comments on commit 7e80b11

Please sign in to comment.