GithubHelp home page GithubHelp logo

greentube / java-converter Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 6.0 36.07 MB

A java-to-javascript and java-to-C# source to source compiler.

License: MIT License

C# 24.25% JavaScript 17.81% Java 57.63% HTML 0.31%

java-converter's People

Contributors

c0pperdragon avatar chipsy17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

java-converter's Issues

Abstract classes not implementing interface methods

In java it is permitted to declare an abstract class to implement some interface without declaring the interface methods. All those methods are automatically considered to be abstract methods.
In C# this is not allowed and everything needs to be explicitly specified.
Proposed solution: Add those abstract method declarations.

Invoking inner class constructor from method of second inner class

Invoking inner class constructor from method belonging to second inner class does not convert correctly to C#.

Java:


public class A
{
    public class B
    {
    }

    public class C
    {
    	B b;

    	C()
    	{
            b = new B();
    	}
    }
}

C# conversion of class C:


    public class A_0024C: object
    {
        public A _o;
        public A_0024B b_f;

        public A_0024C(A _o):base()
        {
            this._o = _o;
            this.b_f = new A_0024B(this);
        }
    }

That is, C invokes constructor of B replacing A with itself.

Java long constants convert to C# int

Hi there!

With -allowlong option active, the following Java code:


public class Foo
{
    public long bar(int n)
    {
        return 1L << n;
    }
}

is converted to C#:


public class Foo: object
{
    public Foo():base()
    {
    }

    public virtual long bar(int n)
    {
        return 1 << n;
    }
}

That is, constant expression '1L' is converted to expression '1'.
Please fix! :)

Correctly detect auto-unboxing

There are certain cases, where auto-unboxing is not detected by the converter and subsequently non-functioning code is generated (but which is compileable in C#).

example: char c = (char) v.elementAt(0); // v is Vector

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.