-
Notifications
You must be signed in to change notification settings - Fork 96
[eclipse/xtext#1777] ported xtend code to java #1555
Conversation
db412bb
to
5fbd457
Compare
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
5fbd457
to
7297fd4
Compare
throw new IllegalArgumentException("Invalid class name: " + className); | ||
} | ||
this.packageName = packageName; | ||
this.simpleNames = Arrays.asList(className.split("\\.")); |
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.
this.
not needed here, and on the lines 109, 126, 127, 131, and 134.
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.
i kept it for consistency with place right next to it where it is needed cause of name clash with parameter
Class<?> xcore = Class.forName("org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup"); | ||
xcore.getDeclaredMethod("doSetup", new Class[] {}).invoke(null); | ||
} catch (ClassNotFoundException e) { | ||
LOG.error("Couldn't initialize Xcore support. Is it on the classpath?"); |
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.
"Couldn't initialize Xcore support. Is it on the classpath?"
You might like to change the log message to the following - Couldn't initialize Xcore support. It is possible that the library "org.eclipse.emf.ecore.xcore" is missing from the project classpath.
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.
did not want to refactor messages here
Class<?> ecore = Class.forName("org.eclipse.xtext.ecore.EcoreSupportStandaloneSetup"); | ||
ecore.getDeclaredMethod("setup", new Class[] {}).invoke(null); | ||
} catch (ClassNotFoundException e) { | ||
LOG.error("Couldn't initialize Ecore support. Is 'org.eclipse.xtext.ecore' on the classpath?"); |
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.
"Couldn't initialize Ecore support. Is 'org.eclipse.xtext.ecore' on the classpath?" -> Couldn't initialize Ecore support. It is possible that the library "org.eclipse.xtext.ecore" is missing from the project classpath.
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.
did not want to refactor messages here
Object instance = genModelSupport.getDeclaredConstructor().newInstance(); | ||
genModelSupport.getDeclaredMethod("createInjectorAndDoEMFRegistration").invoke(instance); | ||
} catch (ClassNotFoundException e) { | ||
LOG.debug( |
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.
- For CNF, an error message is logged on lines 83, and 98. Here, a debug message is logged
- Just to be consistent with other log messages, you might like to change it to - Couldn't initialize Ecore support. It is possible that the library "org.eclipse.xtext.ecore" is missing from the project classpath.
try { | ||
delegate.cleanFolder(it); | ||
} catch (FileNotFoundException e) { | ||
throw Exceptions.sneakyThrow(e); |
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.
I assume Exceptions.sneakyThrow(e);
was used intentionally here.
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.
Yes, your assumption is correct. We could consider throwing a RuntimeIOException though it wouldn't change much.
public abstract class AbstractXtextResourceSetTest extends AbstractResourceSetTest { | ||
|
||
@Override | ||
protected abstract XtextResourceSet createEmptyResourceSet(); |
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.
Indentation mixed up?
.appendSegment("foo.livecontainertestlanguage"); | ||
barURI = IterableExtensions.head(barProject.getSourceFolders()).getPath().trimSegments(1) | ||
.appendSegment("bar.livecontainertestlanguage"); | ||
Map<String, ResourceDescriptionsData> chunks = Collections.unmodifiableMap(CollectionLiterals.newHashMap( |
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.
I'm not a big fan of this newHashMap(Pair(..))
stuff... given this is only a test, I'm ok with it though.
try { | ||
delegate.cleanFolder(it); | ||
} catch (FileNotFoundException e) { | ||
throw Exceptions.sneakyThrow(e); |
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.
Yes, your assumption is correct. We could consider throwing a RuntimeIOException though it wouldn't change much.
[eclipse/xtext#1777] ported xtend code to java
Signed-off-by: Christian Dietrich christian.dietrich@itemis.de