为什么netty 4.1找不到LongObjectHashMap和LongObjectMap
Why dose the netty 4.1 can't find LongObjectHashMap and LongObjectMap
我只是从 Github(branch origin/4.1)
克隆了 Netty,但我无法 运行 示例导致此错误
我找不到这个 class 甚至在 netty-common
找不到包裹,在 github
也找不到,我该怎么办?
这些生成... 运行 ./mvnw clean compile
.
可以看到,common/src/script
里面有一个groovy脚本,内容是
String[] templateDirs = [properties["collection.template.dir"],
properties["collection.template.test.dir"]]
String[] outputDirs = [properties["collection.src.dir"],
properties["collection.testsrc.dir"]]
templateDirs.eachWithIndex { templateDir, i ->
convertSources templateDir, outputDirs[i]
}
void convertSources(String templateDir, String outputDir) {
String[] keyPrimitives = ["byte", "char", "short", "int", "long"]
String[] keyObjects = ["Byte", "Character", "Short", "Integer", "Long"]
String[] keyNumberMethod = ["byteValue", "charValue", "shortValue", "intValue", "longValue"]
keyPrimitives.eachWithIndex { keyPrimitive, i ->
convertTemplates templateDir, outputDir, keyPrimitive, keyObjects[i], keyNumberMethod[i]
}
}
void convertTemplates(String templateDir,
String outputDir,
String keyPrimitive,
String keyObject,
String keyNumberMethod) {
def keyName = keyPrimitive.capitalize()
def replaceFrom = "(^.*)K([^.]+)\.template$"
def replaceTo = "\1" + keyName + "\2.java"
def hashCodeFn = keyPrimitive.equals("long") ? "(int) (key ^ (key >>> 32))" : "(int) key"
ant.copy(todir: outputDir) {
fileset(dir: templateDir) {
include(name: "**/*.template")
}
filterset() {
filter(token: "K", value: keyName)
filter(token: "k", value: keyPrimitive)
filter(token: "O", value: keyObject)
filter(token: "KEY_NUMBER_METHOD", value: keyNumberMethod)
filter(token: "HASH_CODE", value: hashCodeFn)
}
regexpmapper(from: replaceFrom, to: replaceTo)
}
}
表示
By reading the scripts in the templates directory through maven's build-helper-maven-plugin
plug-in and codegen.groovy
scripts, you generate the specific classes under the collection package you need.
所以,当你执行mvn clean install
时,它们将以这种方式生成:
我只是从 Github(branch origin/4.1)
克隆了 Netty,但我无法 运行 示例导致此错误
我找不到这个 class 甚至在 netty-common
找不到包裹,在 github
也找不到,我该怎么办?
这些生成... 运行 ./mvnw clean compile
.
可以看到,common/src/script
里面有一个groovy脚本,内容是
String[] templateDirs = [properties["collection.template.dir"],
properties["collection.template.test.dir"]]
String[] outputDirs = [properties["collection.src.dir"],
properties["collection.testsrc.dir"]]
templateDirs.eachWithIndex { templateDir, i ->
convertSources templateDir, outputDirs[i]
}
void convertSources(String templateDir, String outputDir) {
String[] keyPrimitives = ["byte", "char", "short", "int", "long"]
String[] keyObjects = ["Byte", "Character", "Short", "Integer", "Long"]
String[] keyNumberMethod = ["byteValue", "charValue", "shortValue", "intValue", "longValue"]
keyPrimitives.eachWithIndex { keyPrimitive, i ->
convertTemplates templateDir, outputDir, keyPrimitive, keyObjects[i], keyNumberMethod[i]
}
}
void convertTemplates(String templateDir,
String outputDir,
String keyPrimitive,
String keyObject,
String keyNumberMethod) {
def keyName = keyPrimitive.capitalize()
def replaceFrom = "(^.*)K([^.]+)\.template$"
def replaceTo = "\1" + keyName + "\2.java"
def hashCodeFn = keyPrimitive.equals("long") ? "(int) (key ^ (key >>> 32))" : "(int) key"
ant.copy(todir: outputDir) {
fileset(dir: templateDir) {
include(name: "**/*.template")
}
filterset() {
filter(token: "K", value: keyName)
filter(token: "k", value: keyPrimitive)
filter(token: "O", value: keyObject)
filter(token: "KEY_NUMBER_METHOD", value: keyNumberMethod)
filter(token: "HASH_CODE", value: hashCodeFn)
}
regexpmapper(from: replaceFrom, to: replaceTo)
}
}
表示
By reading the scripts in the templates directory through maven's
build-helper-maven-plugin
plug-in andcodegen.groovy
scripts, you generate the specific classes under the collection package you need.
所以,当你执行mvn clean install
时,它们将以这种方式生成: