martyix
08/21/2017, 5:31 AMval command = """{"type":"Modify", "content":{"levels": { "$identifier": {"$propertyName":"$value"}}}}"""
This is obviously very bad code as any of the variables can easily break JSON. What would be "kotlin-way"? I'm looking for some concise solution. 🙂 Thanks
PS: I use Kotlin 1.1.4diesieben07
08/21/2017, 11:40 AMkarelpeeters
08/21/2017, 11:43 AMleonardootto
08/21/2017, 1:32 PMrsteiger
08/21/2017, 10:58 PMrsteiger
08/21/2017, 11:00 PMlongthanhtran
08/22/2017, 12:13 PMMichael
08/22/2017, 2:39 PMkarelpeeters
08/23/2017, 6:09 PMmfiano
08/24/2017, 3:23 AMtipsy
08/24/2017, 11:37 AMUUID.randomUUID()
?kagomez
08/25/2017, 12:09 AMmuralimohan962
08/26/2017, 8:25 AMbaob
08/26/2017, 9:30 PMbaob
08/27/2017, 11:48 AMsourceSets.main.kotlin.srcDirs = ['src']
but even that doesn’t seem to do itdancancro
08/27/2017, 6:27 PM2017-08-27 14:12:33.623 WARN 62423 --- [ XNIO-2 task-1] .m.m.a.ExceptionHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.VerifyError: Uninitialized object exists on backward branch 82
Exception Details:
Location:
org/exampleapps/greatbig/domain/inout/Article$Companion.fromModel(Lorg/exampleapps/greatbig/domain/Article;Lorg/exampleapps/greatbig/domain/Author;)Lorg/exampleapps/greatbig/domain/inout/Article; @129: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: 2b12 39b8 000f 2c12 3bb8 000f bb00 3d59
0000010: 2bb6 0043 2bb6 0046 2bb6 0049 2bb6 004c
0000020: 2bb6 0050 c000 524e 3a12 3a11 3a10 3a0f
0000030: 3a0e 3a0d 2d3a 04bb 0054 592d 100a b800
0000040: 5ab7 005e c000 603a 0519 04b9 0064 0100
0000050: 3a06 1906 b900 6a01 0099 002b 1906 b900
0000060: 6e01 003a 0719 0519 07c0 0070 3a08 3a13
0000070: 1908 b600 733a 1419 1319 14b9 0077 0200
0000080: 57a7 ffd1 1905 c000 793a 1319 0d19 0e19
0000090: 0f19 1019 1119 1219 132a c000 022b b600
00000a0: 7db6 007f 2ac0 0002 2bb6 0082 b600 7fb2
00000b0: 0088 2bb6 008c 2cb6 0092 2bb6 0095 2cb9
00000c0: 0098 0200 2bb6 0095 b900 9c01 003e 3604
00000d0: 3a05 3a06 3a07 3a08 3a09 3a0a 3a0b 3a0c
00000e0: 190b 190a 1909 1908 190c 1907 1906 1905
00000f0: 1504 1db7 009f b0
Stackmap Table:
full_frame(@82,{Object[#2],Object[#63],Object[#176],Object[#82],Object[#82],Object[#96],Object[#102],Top,Top,Top,Top,Top,Top,Uninitialized[#12],Uninitialized[#12],Object[#178],Object[#178],Object[#178],Object[#178]},{})
same_frame(@132)
d.medina
08/27/2017, 8:42 PMobject AppDataManager : DataManager by dataManager {
private lateinit var dataManager: DataManager
fun init(manager: DataManager) {
dataManager = manager
}
baob
08/27/2017, 10:17 PMjtonic
08/28/2017, 4:37 AMpublic class Profiles {
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Profile(Service1MockedProfile.NAME)
public @interface Service1MockedProfile {
String NAME = “Service1MockedProfile”;
}
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Profile(Service2MockedProfile.NAME)
@interface Service2MockedProfile {
String NAME = “Service2MockedProfile”;
}
}
@Service
@Profiles.Service1MockedProfile
class MyService {}
@ActiveProfiles(profiles = {Service1MockedProfile.NAME})
class MyServiceTest {}
f.babic
08/28/2017, 11:57 AMjtonic
08/28/2017, 6:17 PM@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Profile(Service1MockedProfile.NAME)
public @interface Service1MockedProfile {
String NAME = "Service1MockedProfile";
}
During the migration from Java to Kotlin this is one of the remaining code that still struggling with.karelpeeters
08/28/2017, 6:30 PMSlackbot
08/29/2017, 8:30 PMsaurabha5
08/30/2017, 3:13 PMpoohbar
08/30/2017, 3:14 PMamichalski
08/30/2017, 3:38 PMhalirutan
08/30/2017, 10:42 PMinterface
to hold data-values
public interface SymbolNames {
String BeginPackage = "BeginPackage";
String EndPackage = "EndPackage";
String End = "End";
}
What is the equivalent in Kotlin? When I convert the above to Kotlin it gives me an interface with a companion object. Is this the way to go?techie01
08/31/2017, 7:47 AMarekolek
08/31/2017, 9:55 AMrun
work with references that accept an argument, even though it’s defined as T.run(block: T.() -> R): R = block()
?arekolek
08/31/2017, 9:55 AMrun
work with references that accept an argument, even though it’s defined as T.run(block: T.() -> R): R = block()
?ilya.gorbunov
08/31/2017, 4:15 PM(T) -> R
and T.() -> R
are assignment compatible.arekolek
08/31/2017, 4:22 PMilya.gorbunov
08/31/2017, 4:42 PM