eygraber
07/04/2018, 4:04 AMb
in b.isEmpty()
but it does for a
in a.isEmpty()
?
val a: String? = null
val b: String? = null
when {
a == null && b == null -> true
a == null -> b.isEmpty()
b == null -> a.isEmpty()
}
lenois
07/04/2018, 4:13 AM<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>kapt</id>
<goals>
<goal>kapt</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main</sourceDir>
</sourceDirs>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>com.google.dagger</groupId>
<artifactId>dagger-compiler</artifactId>
<version>${dagger.version}</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</execution>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>1.8</jvmTarget>
<compilerPlugins>
<!-- Or "jpa" for JPA support -->
<plugin>no-arg</plugin>
</compilerPlugins>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-noarg</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
these are the errors, there are hundred of them
[Xlint:cantFindType]
[URLClassLoader@4914000c] error can't determine annotations of missing type org.springframework.cache.annotation.Cacheable
when weaving type dagger.internal.codegen.BindingGraphValidator
when weaving classes
when weaving
[Xlint:cantFindType]
[URLClassLoader@4914000c] error can't determine annotations of missing type org.springframework.cache.annotation.CacheEvict
when weaving type dagger.spi.DiagnosticReporter
when weaving classes
when weaving
I tried scouring the internet without any luck, so I thought i'd check and see if anyone here had insights.eygraber
07/04/2018, 5:46 AM<data class>.copy
do anything special in terms of GC, or is it the same as allocating a new object?
If I have a list of objects that are instances of data classes in a performance critical part of my code, and I need to routinely update the value of one of their fields, would I be better off making it a var
and updating it in place, or using copy
?coder82
07/04/2018, 7:15 AMdimsuz
07/04/2018, 10:21 AMElena Shaverdova
07/04/2018, 1:31 PMzmarkan
07/05/2018, 1:08 PMtschuchort
07/05/2018, 5:57 PMyaakov
07/06/2018, 1:15 AMOlekss
07/06/2018, 6:55 AMmarstran
07/06/2018, 10:54 AMunfilteredResultsCache.filterNot { it.value.timeStamp.toEpochSecond(offset) < lastHourEpoch }
, which will only create 1 new collection. Not one collection for every element removed.Sherub Thakur
07/06/2018, 12:19 PMspand
07/06/2018, 12:34 PMmutablemap.entries.removeIf {}
?GarouDan
07/06/2018, 1:52 PMchristophsturm
07/06/2018, 2:52 PMfred.deschenes
07/06/2018, 6:59 PMSystem.out.println((byte) -84 & 0xFF); // 172
println((-84).toByte() and (0xFF).toByte()) // -84
zake
07/06/2018, 8:35 PMorg.antlr.v4.runtime.ANTLRFileStream
instead of org.antlr.runtime.ANTLRFileStream
x80486
07/07/2018, 12:34 AMcompanion object
and having the class annotated with @TestInstance(TestInstance.Lifecycle.PER_CLASS)
...but still, I would like to use the companion object
approach. Is there any workaround for this?mingkangpan
07/07/2018, 4:28 PMkarelpeeters
07/07/2018, 9:59 PM0
returned, I didn't know this was C
!
fun foo(): Int {
a@when (1) {
1 -> return@a
}
return 8
}
println(foo()) //prints 0
karelpeeters
07/08/2018, 1:43 PMredrield
07/08/2018, 3:41 PMList<List<T>>
, is there a way to flatten it while adding items at the boundaries between the lists?eugene.kudelevsky
07/09/2018, 1:22 PMwarriorprincess
07/09/2018, 7:30 PMresult.filterIndexed{ i, n -> nums.indexOf(n) == i }
Shawn
07/10/2018, 3:40 AMDid you mean(0 until N).reversed()
n downTo 0
Sergio Crespo Toubes
07/10/2018, 10:55 AMproducts.sort {
a,b -> }
karelpeeters
07/10/2018, 11:03 AMlist.distinct()
.musachev
07/10/2018, 2:24 PMaballano
07/10/2018, 3:13 PM(1L as Any)::class.java == (1L)::class.java
aballano
07/10/2018, 3:19 PM(1L as Any)::class.java.isAssignableFrom(Long::class.java)
returns falseaballano
07/10/2018, 3:19 PM(1L as Any)::class.java.isAssignableFrom(Long::class.java)
returns falseilya.gorbunov
07/10/2018, 4:36 PMkotlin-reflect
dependnecy) you can check someLong::class.isSubclassOf(Long::class)
or vice versa.aballano
07/11/2018, 11:03 AM(1L)::class.java.isAssignableFrom(Long::class.java)