Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/plm/core/lang/LangJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ private static String fileNameWithoutExtension(String path)
int beginSolutionIndex = correction.indexOf("/* BEGIN SOLUTION */");

String template;
if (beginSolutionIndex == beginTemplateIndex + 3)
template = "$package\n\n$imports\n\npublic class Entity {\n$dependency\n\t public void run(){\n$body}\n}";
if (beginSolutionIndex == beginTemplateIndex + 5)
template = "$package\n\n$imports\n\npublic class Entity {\n$dependency\n\tpublic void run(){\n$body\t}\n}";
else {
if (beginTemplateIndex < runFunctionI && runFunctionI < endTemplateIndex)
template = "$package\n\n$imports\n\npublic class Entity {\n$dependency\n\t\n$body\n}";
Expand Down Expand Up @@ -365,6 +365,7 @@ public void compileExo(Exercise exo, LogWriter out, StudentOrCorrection whatToCo
String entityCode = sf.getCompilableContent(runtimePatterns, whatToCompile);
entityCode = Pattern.compile("([^a-zA-Z])(Direction)([^a-zA-Z.])").matcher(entityCode).replaceAll("$1int$3");
entityCode = Pattern.compile("this.").matcher(entityCode).replaceAll("");
entityCode = Pattern.compile("@Override").matcher(entityCode).replaceAll("");

File workspace = new File(tempFolder, key.substring(0, key.lastIndexOf('.')).replace('.', '/'));
// noinspection ResultOfMethodCallIgnored
Expand Down
2 changes: 1 addition & 1 deletion src/plm/core/lang/primitives/PrimitiveMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public PrimitiveMethod(Primitive primitive, Method method)

public List<PrimitiveParameter> parameters() { return parameters; }

public boolean hasReturn() { return output != null; }
public boolean hasReturn() { return output != null && output != void.class; }

@Override public boolean equals(Object obj)
{
Expand Down
Loading