Uploaded image for project: 'Nuxeo Java Client'
  1. Nuxeo Java Client
  2. JAVACLIENT-120

Avoid using raw types

    XMLWordPrintable

    Details

    • Type: Clean up
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 3.0.0
    • Component/s: API

      Description

      There's 163 warnings when open the Java Client in Eclipse IDE. Most of them is about Java generic problem. Here're the list of example warnings shown:

      • NuxeoEntity is a raw type. References to generic type NuxeoEntity<T> should be parameterized
        Operation.java
        public class Operation extends NuxeoEntity {
                                                 ^
        
      • List is a raw type. References to generic type List<E> should be parameterized
        TestRepository.java
        List list = (List) document.getProperties().get("ds:fields");
           ^            ^
        
      • Type safety: The method execute(Callback, Object...) belongs to the raw type NuxeoEntity. References to generic type NuxeoEntity<T> should be parameterized
        Repository.java
        public void fetchDocumentRoot(Callback<Document> callback) {
            execute(callback);
                  ^
        }
        
      • The type parameter T is hiding the type T
        NuxeoResponseConverterFactory.java
        public <T> T readJSON(Reader reader, Class javaType) {
                ^
            try {
                return (T) objectMapper.readValue(reader, javaType);
            } catch (IOException reason) {
                throw new NuxeoClientException("...", reason);
            }
        }
        

      Even though these issues does not have direct impact on Nuxeo users, but the code should be refactored to ensure the good understanding of Java generic in general.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: