repeating-annotations

Do repeating annotations need a public container?

天大地大妈咪最大 提交于 2019-12-07 13:59:56
问题 I noticed a discrepancy between Eclipse's compiler and javac while using repeating annotations. The repeating annotation and its container were in the same package, but the former was declared public, while the latter remained package-private. Eclipse had no problem with the arrangement, even though the repeating annotation was referenced in another package. javac, on the other hand, refused to compile, saying value() in [container] is defined in an inaccessible class or interface My question

Do repeating annotations need a public container?

半城伤御伤魂 提交于 2019-12-05 19:24:22
I noticed a discrepancy between Eclipse's compiler and javac while using repeating annotations. The repeating annotation and its container were in the same package, but the former was declared public, while the latter remained package-private. Eclipse had no problem with the arrangement, even though the repeating annotation was referenced in another package. javac, on the other hand, refused to compile, saying value() in [container] is defined in an inaccessible class or interface My question is, which one is correct? I couldn't find any rule about this in the JLS. Does that mean it's open to