java2python icon indicating copy to clipboard operation
java2python copied to clipboard

Bugs found trying to translate toxiclibs

Open stuaxo opened this issue 12 years ago • 2 comments

I thought I'd point java2python at toxiclibs and see what happens, unfortunately it gets stuck:

# hg clone https://bitbucket.org/postspectacular/toxiclibs

ToneMap https://bitbucket.org/postspectacular/toxiclibs/src/689ddcd9bea39d1f8dddad26e971ae4c12b1198e/src.color/toxi/color/ToneMap.java?at=default

Triggers ValueError: list.remove(x): x not in list


# j2py src.color/toxi/color/ToneMap.java
Traceback (most recent call last):
  File "/home/stu/.virtualenvs/tmp/bin/j2py", line 7, in <module>
    execfile(__file__)
  File "/home/stu/.virtualenvs/tmp/src/java2python/bin/j2py", line 259, in <module>
    sys.exit(runMain(configScript(sys.argv[1:])))
  File "/home/stu/.virtualenvs/tmp/src/java2python/bin/j2py", line 57, in runMain
    return runOneOrMany(options)
  File "/home/stu/.virtualenvs/tmp/src/java2python/bin/j2py", line 83, in runOneOrMany
    return runTransform(options)
  File "/home/stu/.virtualenvs/tmp/src/java2python/bin/j2py", line 128, in runTransform
    transformAST(tree, config)
  File "/home/stu/.virtualenvs/tmp/src/java2python/java2python/compiler/__init__.py", line 37, in transformAST
    call(node, config)
  File "/home/stu/.virtualenvs/tmp/src/java2python/java2python/mod/transform.py", line 96, in lengthToLen
    raise e
ValueError: list.remove(x): x not in list


ColorList generates invalid syntax -

ColorList.#      * Creates a deep copy of the given ColorList. Manipulating the new list or

# WARNING runTransform: Generated source has invalid syntax. expected an indented block (<string>, line 117)

stuaxo avatar Dec 20 '12 14:12 stuaxo

similar errors trying to j2py https://github.com/ggp-org/ggp-base

we need to define translation rule for <string> java syntax

hobson avatar Apr 22 '14 05:04 hobson

And for ArrayList

DisDoh avatar Nov 09 '19 00:11 DisDoh