Skip to main content
 首页 » 编程设计

groovy中Eclipse Groovy Plugin : A transform used a generics containing ClassNode Entry List, Iterable> 直接用于方法...

2025年05月04日110myhome

应该如何处理这个?

protected List<BasePropCont> getChildren( boolean updCacheOn = false,   
  Entry< List, Iterable >  _subIterEntry = null ) 
{ 
  return null    
  // orig code removed since it seems not to matter 
} 

将以下内容显示为错误:

Groovy:A transform used a generics containing ClassNode

Entry <List, Iterable>  

for the method

protected java.util.List getChildren(boolean updCacheOn, Entry _subIterEntry)  { ... }  

directly.
You are not supposed to do this. Please create a new ClassNode referring to the old ClassNode and use the new ClassNode instead of the old one.
Otherwise the compiler will create wrong descriptors and a potential NullPointerException in TypeResolver in the OpenJDK.
If this is not your own doing, please report this bug to the writer of the transform.

请您参考如下方法:

哈哈...解决方案是使用编辑器保存操作观察自动处理的导入。插件以某种方式删除了一些导入(可能处于编码时出现编译错误的状态),其中包括

import java.util.Map.Entry 

:-/

手动添加即可解决。 其他“消失”的进口也有类似的问题。

(这个奇怪错误的实际原因可能是来自默认 Groovy 导入或范围内的一些(发现的许多)Entry 类)