Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid output type #81

Closed
KonstantinSviridov opened this issue Oct 22, 2014 · 9 comments · Fixed by #85
Closed

Invalid output type #81

KonstantinSviridov opened this issue Oct 22, 2014 · 9 comments · Fixed by #85

Comments

@KonstantinSviridov
Copy link

Hi, guys!
In
https://github.com/INRIA/spoon/blob/master/src/main/java/spoon/OutputType.java
we have NO_OUTPUT("noouput"), which pevents us from using this enum value.

@swolf91
Copy link
Contributor

swolf91 commented Oct 23, 2014

@KonstantinSviridov I don't get your intention with that issue. Is it because of the typo?

@KonstantinSviridov
Copy link
Author

@boeserwolf91
Right. Don't you want to correct typos in your code? :-)

In my code I set command line parameters and I want to write something like

ArrayList<String> lst = new ArrayList<String>();
lst.add("--output-type");
lst.add(OutputType.NO_OUTPUT.toString());

but I can not.

Anyway, I would not have come here because of this typo only :-)

@swolf91
Copy link
Contributor

swolf91 commented Oct 23, 2014

Ah I see. Now I got you :) and just to clarify. It's not my code haha I'm not related to Inria.

I noticed the typo as I provided the pull request #64
I planned to refactor this class after this pull request was merged. I want to modify the method fromString because the names are duplicated. I'll correct the typo if I provide the other pull request after the current one was merged.

@swolf91
Copy link
Contributor

swolf91 commented Oct 23, 2014

@KonstantinSviridov by the way you could write something like the following for a workaround:

ArrayList<String> lst = new ArrayList<String>();
lst.add("--output-type");
lst.add(OutputType.NO_OUTPUT.name().toLowerCase().replaceAll("_",""));

@pschichtel
Copy link
Contributor

It would be best to avoid duplicating the names in the enum

@swolf91
Copy link
Contributor

swolf91 commented Oct 24, 2014

I agree with @pschichtel

@GerardPaligot
Copy link
Contributor

Oh ok, I got it now. This issue is about the typo.

Well, when the PR of @boeserwolf91 will be merged, we'll can fix that typo.

@pschichtel
Copy link
Contributor

@GerardPaligot it would be better to drop the strings entirely

@GerardPaligot
Copy link
Contributor

Indeed, they aren't very useful.

swolf91 added a commit to swolf91/spoon that referenced this issue Oct 27, 2014
swolf91 added a commit to swolf91/spoon that referenced this issue Oct 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants