Properly type this in the future

Open
#449 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Start at wayang-api/wayang-api-python/src/main/java/org/apache/wayang/api/python/executor/ProcessFeeder.java around line 104 and trace the object types reaching the generic Object branch. Clarify the intended replacement for this fallback and verify serialization behavior for supported inputs; done means the TODO is resolved without changing the existing byte-array, String, or Map.Entry cases.

Written by the indexing model from the issue text.

Description

todo

Properly type this in the future

https://github.com/apache/incubator-wayang/blob/c25c6561bf786d76d0dc717b28cf15885c269232/wayang-api/wayang-api-python/src/main/java/org/apache/wayang/api/python/executor/ProcessFeeder.java#L104


             * Byte Array cases
             */
            else if (obj instanceof Byte[] || obj instanceof byte[]) {
                writeBytes(obj, dataOut);
            }
            /**
             * String case
             * */
            else if (obj instanceof String) {
                writeUTF((String) obj, dataOut);
            }

            // TODO: Properly type this in the future
            else if (obj instanceof Object) {
                writeUTF(String.valueOf(obj), dataOut);
            }

            /**
             * Key, Value case
             * */
            else if (obj instanceof Map.Entry) {
                writeKeyValue((Map.Entry) obj, dataOut);
            }

            else{
                throw new WayangException("Unexpected element type " + obj.getClass());
            }

        } catch (IOException e) {
            e.printStackTrace();
        }

b486b16bbf5753fbec1338c4d5250e7197caa056

Dominant language
Java
Stars
274
Forks
141
Avg merge
5d 16h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/wayang

All issues in apache/wayang

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.