我有一个Bean。public class Deal{
    
     private CurrencyPair currencyPair; // 主标准币别对属性
     private CurrencyPair currency1Pair; // 辅1标准币别对属性
     private CurrencyPair currency2Pair; // 辅2标准币别对属性}
findBug工具说“Class com.hr.fxip.common.data.Deal defines non-transient non-serializable instance field 
 currencyPair”有这样的BUG.请问这是什么?怎么改?

解决方案 »

  1.   

    无聊的BUG,它是说field没有指定是不是可序列化的。transient或serializable任加其一。但是这个bug很无聊。个人感觉。
      

  2.   

    要不你就改成  public class Deal implements java.io.Serializable 吧,反正也不会有问题。
      

  3.   

    就是,不影响运行,算什么bug,最多只能算个性能优化!