2014-12-06 13 views
6

this unanswered questionthis other unanswered question中描述的類似問題中,我在Eclipse Luna Service Release 1(4.4.1)(20140925-1800)中讀到「(已恢復)內部不一致性在lambda形狀分析中檢測到「。代碼如下:在lambda形狀分析過程中檢測到內部不一致

public static <T> T findFirst(Iterable<T> list, Predicate<T> condition) { 
    /* ... */ 
} 

public static Integer findFirstPrime(Iterable<Integer> integers) { 
    return findFirst(integers, 
      integer -> { 
       /* return either true or false */ 
      } 
    ); 
} 

警告引發對文本閱讀integer ->。有一個bug report指出這個問題對於Eclipse Mars 4.5是固定的,但是我能在這期間做什麼?如果我想使用@SuppressWarnings,我怎麼知道要提供哪種警告類型?

+1

通常你可以得到擺脫這些警告僅僅是爲了減輕類型推斷實現的負擔,例如像'(整數整數) - > ...',以確保它知道它在做什麼。 – 2015-04-13 08:40:53

回答