2012-01-07 2 views
2

Guice의 스택 트레이스는 너무 자세하게 읽을 수있어 매우 고통 스럽습니다. 다음은 예입니다 :Guice가 스택 추적에서 클래스 경로를 숨기도록 구성 할 수 있습니까?

1) No implementation for Set<ItemManipulator<Cat>> annotated with @Assisted(value=) was bound. 
    while locating Set<ItemManipulator<Cat>> annotated with @Assisted(value=) 

이 작업을 수행 할 Guice을 구성 할 수있는 방법이 있나요 : 나는 클래스 경로를 숨길 수 있다면

1) No implementation for java.util.Set<com.mydomain.myapp.android.activities.catbrowser.generalizedbrowser.listview.helpers.databaseitem.itemmanipulators.ItemManipulator<com.mydomain.myapp.flash.Cat>> annotated with @com.google.inject.assistedinject.Assisted(value=) was bound. 
    while locating java.util.Set<com.mydomain.myapp.android.activities.catbrowser.generalizedbrowser.listview.helpers.databaseitem.itemmanipulators.ItemManipulator<com.mydomain.myapp.flash.Cat>> annotated with @com.google.inject.assistedinject.Assisted(value=) 

...

, 그것과 같을 것이다?

답변

2

따라서 대답은 '아니오'입니다.

guice source code을 보면, 오류 메시지 작성을 담당하는 com.google.inject.internal.Errors 클래스가 있습니다.

new Converter<Key>(Key.class) { 
    public String toString(Key key) { 
     if (key.getAnnotationType() != null) { 
     return key.getTypeLiteral() + " annotated with " 
      + (key.getAnnotation() != null ? key.getAnnotation() : key.getAnnotationType()); 
     } else { 
     return key.getTypeLiteral().toString(); 
     } 
    } 
    } 

다음 단계 TypeLiteral#toString 방법을 살펴 보도록한다 :이 클래스에서, Key은 다음과 같은 방식으로 변환되어 부호화되어 MoreTypes#typeToString 구성 할 수없는 정적 메소드이다

@Override public final String toString() { 
    return MoreTypes.typeToString(type); 
    } 

public static String typeToString(Type type) { 
    return type instanceof Class ? ((Class) type).getName() : type.toString(); 
    } 
관련 문제