Giter Site home page Giter Site logo

Comments (8)

seintur avatar seintur commented on May 22, 2024

Hi,

I'd prefer the keep the Java 7 syntax to keep an as strong as possible consistency between the source code and the pretty-printed one.

Else if you replace the Java 7 syntax by Java 6, one could argue the other constructs, e.g. Java 5 foreach or generics, should also be replaced by a Java 4 compatible syntax.

Lionel.

from spoon.

swolf91 avatar swolf91 commented on May 22, 2024

I would like to have the ability to set up the target java version. If I set java 6 it'll try to write everything with tha java 6 syntax. The same goes for java 5, 7 and 8. I think everything lower than java 5 isn't that important anymore.

That would help to converter a project from java 6 to java 7 or the other way around.

from spoon.

GerardPaligot avatar GerardPaligot commented on May 22, 2024

@boeserwolf91 Your proposal is very interesting: transform some projects from a Java version to another version but, for me, it is a different feature. I'm agree with @seintur. By default (and for the scope of this issue about the compatibility of java 7), we keep the Java version of the source project ready to be spooned. And I create another issue to keep your idea @boeserwolf91 for the future.

Ok for everyone?

from spoon.

seintur avatar seintur commented on May 22, 2024

+1

from spoon.

swolf91 avatar swolf91 commented on May 22, 2024

yes, I'm okay with it @GerardPaligot 👍

from spoon.

seintur avatar seintur commented on May 22, 2024

Hi @monperrus

You changed the title of this issue to "Java 7: pretty-print...". This suggests that you consider this as a pretty-printing issue.

Couldn't we consider that this a transformation issue?

For example, we could design processors that transform a Java 7 program to a Java 6 compliant one, the same for Java 5 to Java 4, etc. By this way, the question of the compliance to a particular version of Java would be handled at the processor level. Note that this wouldn't prevent the "kernel" of Spoon of applying the processor if requested by the command line arguments, or Maven parameters, specified by the developer.

WDYT?

from spoon.

monperrus avatar monperrus commented on May 22, 2024

Hi Lionel @seintur,

I want to make it clear that there are two different issues:

  • having a good model of multi-catch blocks, see issue #108, which will be solved by @GerardPaligot's promising PR #98
  • pretty-printing multi-catch

The former is much more important than the latter, since Spoon rewritten code is not meant to be read (no preservation of formatting, of comments, poor support of "imports")

from spoon.

GerardPaligot avatar GerardPaligot commented on May 22, 2024

The PR #98 is now finished. The output of a multi catch is a valid Java 7 syntax. This PR can be closed when the PR will be merged.

from spoon.

Related Issues (20)

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.