Android Studio에서 Generics Extends를 사용한 클래스에서 발생한 incompatible types 에러 질문드립니다.
조회수 1836회
이클립스 프로젝트를 안드로이드 스튜디오로 옮기는 중인데
Generic을 와일드카드로 상속받은 클래스에서 incompatible types 에러가 발생하네요
에러 메세지는 아래와 같이 나오고
Error:(113, 118) error: incompatible types: Class<LineRecordWriter> cannot be converted to Class<? extends RecordWriter<?,?>>
에러가 발생하는 부분의 코드는 아래와 같습니다.
Class<? extends RecordWriter<?, ?>> clsRecordWriter = (Class<? extends RecordWriter<?, ?>>) LineRecordWriter.class;
LineRecordWriter클래스는 다음과 같이 선언되어있습니다
class LineRecordWriter<K extends WritableComparable<? super K>, V extends Writable> extends RecordWriter<K, V>
Gradle로그에는 이렇게 나오는데
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Error:Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
' -Xlint:deprecation' 이 플래그로 다시 빌드하면 해결이 되는건지
그게 아니라면 어떻게 해결해야하는지 궁금합니다.
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력