File tree Expand file tree Collapse file tree 5 files changed +48
-0
lines changed
src/main/kotlin/com/baeldung/kotlin/k2 Expand file tree Collapse file tree 5 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
4
+
5
+ <modelVersion >4.0.0</modelVersion >
6
+ <artifactId >k2-compiler</artifactId >
7
+ <name >k2-compiler</name >
8
+
9
+ <parent >
10
+ <groupId >com.baeldung</groupId >
11
+ <artifactId >kotlin-modules</artifactId >
12
+ <version >1.0.0-SNAPSHOT</version >
13
+ </parent >
14
+
15
+ <properties >
16
+ <kotlin .version>2.0.0</kotlin .version>
17
+ </properties >
18
+
19
+ </project >
Original file line number Diff line number Diff line change
1
+ class ChildClass : ParentClass () {
2
+ fun greeting (s : String ) = hello(s)
3
+ }
Original file line number Diff line number Diff line change
1
+ import java.lang.reflect.InvocationTargetException
2
+
3
+ fun translateExecution (exception : Throwable ? ): Throwable ? {
4
+ val isInvocationTargetException = exception is InvocationTargetException
5
+
6
+ if (isInvocationTargetException) {
7
+ return (exception as InvocationTargetException ).targetException
8
+ }
9
+
10
+ return exception
11
+ }
12
+
13
+ fun translateExecutionV2 (exception : Throwable ? ) : Throwable ? {
14
+ val isInvocationTargetException = exception is InvocationTargetException
15
+
16
+ if (isInvocationTargetException) {
17
+ return exception.targetException
18
+ }
19
+
20
+ return exception
21
+ }
Original file line number Diff line number Diff line change
1
+ open class ParentClass {
2
+ internal fun hello (s : String ) = println (" Hello, $s !" )
3
+ }
Original file line number Diff line number Diff line change 385
385
<module >core-kotlin-modules</module >
386
386
<!-- <module>gradle-kotlin-dsl</module> --> <!-- not a Maven module -->
387
387
<!-- <module>jee-kotlin</module> --> <!-- Can't upgrade this project. Arquillian not maintained anymore.-->
388
+ <module >k2-compiler</module >
388
389
<module >koin-guide</module >
389
390
<module >kotlin-kotest</module >
390
391
<module >kotlin-apache-kafka</module >
464
465
<module >core-kotlin-modules</module >
465
466
<!-- <module>gradle-kotlin-dsl</module> --> <!-- not a Maven module -->
466
467
<!-- <module>jee-kotlin</module> --> <!-- Can't upgrade this project. Arquillian not maintained anymore.-->
468
+ <module >k2-compiler</module >
467
469
<module >koin-guide</module >
468
470
<module >kotlin-kotest</module >
469
471
<module >kotlin-apache-kafka</module >
You can’t perform that action at this time.
0 commit comments