Commit 08b4402
committed
Fix Java examples using Kotlin-specific syntax
Java examples were incorrectly using Kotlin-specific syntax like listOf() and mapOf(). This commit fixes the issue by:
- Added language-specific parameter support to getParamExample() method in Kotlin.php
- Created getKotlinMapExample() and getJavaMapExample() helper methods for proper syntax generation
- Updated getPermissionExample() to support both Java (Arrays.asList) and Kotlin (listOf) syntax
- Added new javaParamExample Twig filter that generates Java-compatible syntax
- Updated Java example templates to use javaParamExample filter
- Fixed import ordering in Java templates to follow Java conventions (java.* imports first, then project imports)
Now Java examples correctly use:
- Arrays.asList() instead of listOf()
- new HashMap<String, Object>() {{ put() }} instead of mapOf()
- Collections.emptyList() instead of listOf()1 parent 05367bc commit 08b4402
File tree
5 files changed
+266
-110
lines changed- .github/workflows
- src/SDK/Language
- templates
- android/docs/java
- kotlin/docs/java
5 files changed
+266
-110
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
0 commit comments