Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-7225

Cutoff exception message in StateDescriptor

    Details

      Description

      When the type extraction fails in the StateDescriptor constructor an exception is thrown, but the message is cutoff and doesn't contain any advice to remedy the situation.

      try {
      			this.typeInfo = TypeExtractor.createTypeInfo(type);
      		} catch (Exception e) {
      			throw new RuntimeException("Cannot create full type information based on the given class. If the type has generics, please", e);
      		}
      

        Activity

        Hide
        aljoscha Aljoscha Krettek added a comment -

        Fixed in

        • 1.4.0 via 3c756085375a003c7fbf8d477924f5b17efcb115
        • 1.3.2 via 618d544491664e9fb0e67d6e95596895cdc9d56d
        Show
        aljoscha Aljoscha Krettek added a comment - Fixed in 1.4.0 via 3c756085375a003c7fbf8d477924f5b17efcb115 1.3.2 via 618d544491664e9fb0e67d6e95596895cdc9d56d
        Hide
        aljoscha Aljoscha Krettek added a comment -

        Reopen to fix release note.

        Show
        aljoscha Aljoscha Krettek added a comment - Reopen to fix release note.
        Hide
        mingleizhang mingleizhang added a comment -

        Stephan Ewen Sorry, I dont understand what you exactly mean. Do you agree what I mentioned above please make the type to be parameterized by using generics is correct ? But you mean I need construct another StateDescriptor construction method is like following with adding an implemention by TypeHint as a parameter ?

        protected StateDescriptor(String name, TypeHint<T> type, T defaultValue) {
        	this.name = requireNonNull(name, "name must not be null");
        	requireNonNull(type, "type class must not be null");
        	try {
        		this.typeInfo = type.getTypeInfo();
        
        Show
        mingleizhang mingleizhang added a comment - Stephan Ewen Sorry, I dont understand what you exactly mean. Do you agree what I mentioned above please make the type to be parameterized by using generics is correct ? But you mean I need construct another StateDescriptor construction method is like following with adding an implemention by TypeHint as a parameter ? protected StateDescriptor( String name, TypeHint<T> type, T defaultValue) { this .name = requireNonNull(name, "name must not be null " ); requireNonNull(type, "type class must not be null " ); try { this .typeInfo = type.getTypeInfo();
        Hide
        StephanEwen Stephan Ewen added a comment -

        mingleizhang I would suggest to mention using a variant of the method that supports TypeHint instead of Class where applicable.

        Show
        StephanEwen Stephan Ewen added a comment - mingleizhang I would suggest to mention using a variant of the method that supports TypeHint instead of Class where applicable.
        Hide
        mingleizhang mingleizhang added a comment -

        What I correct is like following. What do you think ?

        		try {
        			this.typeInfo = TypeExtractor.createTypeInfo(type);
        		} catch (Exception e) {
        			throw new RuntimeException("Cannot create full type information based on the given class. " +
        				"If the type has generics, please make the type to be parameterized by using generics.", e);
        		}
        
        Show
        mingleizhang mingleizhang added a comment - What I correct is like following. What do you think ? try { this .typeInfo = TypeExtractor.createTypeInfo(type); } catch (Exception e) { throw new RuntimeException( "Cannot create full type information based on the given class. " + "If the type has generics, please make the type to be parameterized by using generics." , e); }

          People

          • Assignee:
            StephanEwen Stephan Ewen
            Reporter:
            Zentol Chesnay Schepler
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development