-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Issue 157 enhance parser frontend #447
Issue 157 enhance parser frontend #447
Conversation
Wow!!! |
…ost in the JavaParser state.
@ptitjes it's funny how you suddenly started working on jlato again when I picked up development here :) |
I just realized that if we want self-describing and rereadable providers, that the Provider interface is too bare. |
Stuck issue #448 in here too. |
Hello, the feature look great, but I have a question, You always check if on of the method
|
* Factory for providers of source code for JavaParser. | ||
* Providers that have no parameter for encoding but need it will use UTF-8. | ||
*/ | ||
public abstract class Providers { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why abstract and not final ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh woops...
/** | ||
* Thrown when parsing problems occur during parsing with the static methods on JavaParser. | ||
*/ | ||
public class ParseProblemException extends Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me when I code I prefere to create RuntimeException, Or using an another Pattern because with exception we can't do composition.If you want to talk about, PM me on gitter 😄 otherwise it's fine 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, I think I agree, it's the Java 8 world and we want to use the functional programming features, and checked exceptions are hated there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I agree, checked exceptions are annoying :p
Le sam. 3 sept. 2016 à 17:21, Danny van Bruggen notifications@github.com
a écrit :
In
javaparser-core/src/main/java/com/github/javaparser/ParseProblemException.java
#447 (comment):@@ -0,0 +1,24 @@
+package com.github.javaparser;
+
+import java.util.List;
+
+/**
- * Thrown when parsing problems occur during parsing with the static methods on JavaParser.
- */
+public class ParseProblemException extends Exception {Nah, I think I agree, it's the Java 8 world and we want to use the
functional programming features, and checked exceptions are hated there.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/javaparser/javaparser/pull/447/files/c24b5256f3ebdb0903b48fc0c77106904658a525#r77438130,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJu56OiXlQlQsxaWpQI5-6ByV-jskUIkks5qmZCKgaJpZM4JyGiu
.
…e when doing functional programming
@chmuche - I don't really get your other comment. Did you notice that setSource is gone? It was only there in alpha-1 and wasn't a great design, introducing state where it shouldn't have been. I like Objects.requireNotNull, will make an issue for discussing nullity stuff. |
Needs more work on exception handling, but this gets merged right now because it is causing merge problems. |
# Conflicts: # javaparser-core/src/main/java/com/github/javaparser/ast/visitor/ModifierVisitorAdapter.java
#157 suggests a new interface for JavaParser. This PR contains a reduced version of the suggestion.
There are two interfaces:
Interface 1 has not been changed much. There is a different exception, and that exception can hold multiple parsing problems.
For interface 2:
Things that are significantly different from #157:
Things to do:
Thanks to @ptitjes for thinking this up!