Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
f4b7913d
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f4b7913d
编写于
10月 12, 2015
作者:
M
Michael Bogdanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sanitizeAsJavaIdentifier function moved to JvmAbi
上级
d8be99a3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
14 deletion
+10
-14
compiler/backend/src/org/jetbrains/kotlin/codegen/JvmCodegenUtil.java
...kend/src/org/jetbrains/kotlin/codegen/JvmCodegenUtil.java
+0
-5
compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java
...src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java
+1
-1
compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/PackagePartClassUtils.kt
...org/jetbrains/kotlin/load/kotlin/PackagePartClassUtils.kt
+2
-4
core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/JvmAbi.java
...oader.java/src/org/jetbrains/kotlin/load/java/JvmAbi.java
+6
-0
core/reflection.jvm/src/kotlin/reflect/jvm/internal/RuntimeTypeMapper.kt
....jvm/src/kotlin/reflect/jvm/internal/RuntimeTypeMapper.kt
+1
-4
未找到文件。
compiler/backend/src/org/jetbrains/kotlin/codegen/JvmCodegenUtil.java
浏览文件 @
f4b7913d
...
...
@@ -235,9 +235,4 @@ public class JvmCodegenUtil {
av
.
visit
(
JvmAnnotationNames
.
MODULE_NAME_FIELD_NAME
,
name
);
}
}
@NotNull
public
static
String
sanitizeAsJavaIdentifier
(
@NotNull
String
str
)
{
return
PackagePartClassUtils
.
sanitizeAsJavaIdentifier
(
str
);
}
}
compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java
浏览文件 @
f4b7913d
...
...
@@ -880,7 +880,7 @@ public class JetTypeMapper {
}
if
(!(
descriptor
instanceof
ConstructorDescriptor
)
&&
descriptor
.
getVisibility
()
==
Visibilities
.
INTERNAL
)
{
return
name
+
"$"
+
Jvm
CodegenUtil
.
sanitizeAsJavaIdentifier
(
moduleName
);
return
name
+
"$"
+
Jvm
Abi
.
sanitizeAsJavaIdentifier
(
moduleName
);
}
return
name
;
...
...
compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/PackagePartClassUtils.kt
浏览文件 @
f4b7913d
...
...
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.load.kotlin
import
com.intellij.openapi.util.io.FileUtil
import
com.intellij.openapi.vfs.VirtualFile
import
org.jetbrains.annotations.TestOnly
import
org.jetbrains.kotlin.load.java.JvmAbi
import
org.jetbrains.kotlin.name.FqName
import
org.jetbrains.kotlin.name.Name
import
org.jetbrains.kotlin.psi.JetFile
...
...
@@ -38,10 +39,7 @@ public object PackagePartClassUtils {
if
(
str
.
isEmpty
())
"_$PART_CLASS_NAME_SUFFIX"
else
capitalizeAsJavaClassName
(
sanitizeAsJavaIdentifier
(
str
))
+
PART_CLASS_NAME_SUFFIX
public
@JvmStatic
fun
sanitizeAsJavaIdentifier
(
str
:
String
):
String
=
str
.
replace
(
"[^\\p{L}\\p{Digit}]"
.
toRegex
(),
"_"
)
capitalizeAsJavaClassName
(
JvmAbi
.
sanitizeAsJavaIdentifier
(
str
))
+
PART_CLASS_NAME_SUFFIX
private
@JvmStatic
fun
capitalizeAsJavaClassName
(
str
:
String
):
String
=
// NB use Locale.ENGLISH so that build is locale-independent.
...
...
core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/JvmAbi.java
浏览文件 @
f4b7913d
...
...
@@ -16,6 +16,7 @@
package
org.jetbrains.kotlin.load.java
;
import
kotlin.StringsKt
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.kotlin.name.ClassId
;
import
org.jetbrains.kotlin.name.FqName
;
...
...
@@ -90,5 +91,10 @@ public final class JvmAbi {
char
c
=
name
.
charAt
(
IS_PREFIX
.
length
());
return
!(
'a'
<=
c
&&
c
<=
'z'
);
}
@NotNull
public
static
String
sanitizeAsJavaIdentifier
(
@NotNull
String
str
)
{
return
StringsKt
.
replace
(
str
,
StringsKt
.
toRegex
(
"[^\\p{L}\\p{Digit}]"
),
"_"
);
}
}
core/reflection.jvm/src/kotlin/reflect/jvm/internal/RuntimeTypeMapper.kt
浏览文件 @
f4b7913d
...
...
@@ -120,7 +120,7 @@ internal sealed class JvmPropertySignature {
val
sourceElement
=
containingDeclaration
.
source
as
KotlinJvmBinarySourceElement
val
klass
=
(
sourceElement
.
binaryClass
as
ReflectKotlinClass
).
klass
val
moduleName
=
klass
.
getAnnotation
(
KotlinClass
::
class
.
java
).
moduleName
"$"
+
sanitizeAsJavaIdentifier
(
moduleName
)
"$"
+
JvmAbi
.
sanitizeAsJavaIdentifier
(
moduleName
)
}
else
{
""
...
...
@@ -129,9 +129,6 @@ internal sealed class JvmPropertySignature {
}
}
private
fun
sanitizeAsJavaIdentifier
(
str
:
String
):
String
=
str
.
replace
(
"[^\\p{L}\\p{Digit}]"
.
toRegex
(),
"_"
)
override
fun
asString
():
String
=
string
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录