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

Make things green again #6

Merged
merged 6 commits into from
Sep 15, 2024
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
File renamed without changes.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/out/
/output/
/COMP-*/
/.idea
xx/.idea
/jcef-bundle/
/elijah-prolific-remnant.iml
/ll.c
Expand All @@ -18,3 +18,4 @@
/lib/standalone/
/lib/test/
/bin/
/IG-*
35 changes: 35 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .run/Core Tests 2.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Core Tests 2" type="JUnit" factoryName="JUnit">
<module name="elijah-prolific-remnant"/>
<option name="PACKAGE_NAME" value=""/>
<option name="MAIN_CLASS_NAME" value=""/>
<option name="METHOD_NAME" value=""/>
<option name="TEST_OBJECT" value="package"/>
<method v="2">
<option name="Make" enabled="true"/>
</method>
</configuration>
</component>
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<url>http://github.com/elijah-team/prolific-remnant/</url>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<jacoco.version>0.8.6</jacoco.version>
<downloadSources>true</downloadSources>
<guava.version>33.1.0-jre</guava.version>
Expand Down Expand Up @@ -400,8 +400,8 @@


<configuration>
<source>16</source>
<target>16</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
Expand Down
141 changes: 97 additions & 44 deletions src/main/java/tripleo/elijah/comp/StdErrSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,114 @@
* http://www.gnu.org/licenses/lgpl.html from `Version 3, 29 June 2007'
*
*/
/**
* Created Mar 25, 2019 at 3:00:39 PM
*/
package tripleo.elijah.comp;

import org.apache.commons.lang3.tuple.Pair;
import tripleo.elijah.comp.i.ErrSink;
import tripleo.elijah.diagnostic.Diagnostic;
import tripleo.elijah_fluffy.util.SimplePrintLoggerToRemoveSoon;

import java.util.ArrayList;
import java.util.List;

/**
* @author tripleo(sb)
* Created Mar 25, 2019 at 3:00:39 PM
*
* @author tripleo(sb)
*/
public class StdErrSink implements ErrSink {
private int _errorCount;
private final ErrorList errorList = new ErrorList();

@Override
public void exception(final Exception e) {
_errorCount++;
SimplePrintLoggerToRemoveSoon.println_err2("exception: " + e);
e.printStackTrace(System.err);
errorList.addException(e);
}

@Override
public void reportError(final String message) {
_errorCount++;
if (CompilationAlways.VOODOO) {
var s = String.format("ERROR: %s%n", message);
SimplePrintLoggerToRemoveSoon.println_err2(s);
}
errorList.addWarning(message);
}

@Override
public void reportWarning(final String message) {
if (CompilationAlways.VOODOO) {
var s = String.format("WARNING: %s%n", message);
SimplePrintLoggerToRemoveSoon.println_err2(s);
}
errorList.addWarning(message);
}

@Override
public int errorCount() {
return _errorCount;
}

@Override
public void info(final String message) {
if (CompilationAlways.VOODOO) {
var s = String.format("INFO: %s%n", message);
SimplePrintLoggerToRemoveSoon.println_err2(s);
}
errorList.addInfo(message);
}

@Override
public void reportDiagnostic(final Diagnostic diagnostic) {
if (diagnostic.severity() == Diagnostic.Severity.ERROR)
_errorCount++;
if (CompilationAlways.VOODOO)
diagnostic.report(System.err);
errorList.addDiagnostic(diagnostic);
}

@Override
public Pair<Desc, Object> _error(final int index) {
return errorList.get(index - 1);
}

@Override
public List<Pair<Desc, Object>> _errors() {
return errorList.__errors();
}

public enum Desc {INFO_STRING, WARNING_STRING, EXCEPTION_STRING, DIAGNOSTIC}

public static class ErrorList {
List<Pair<Desc, Object>> backing = new ArrayList<>();

public void addDiagnostic(final Diagnostic aDiagnostic) {
backing.add(Pair.of(Desc.DIAGNOSTIC, aDiagnostic));
}

public void addInfo(final String aMessage) {
backing.add(Pair.of(Desc.INFO_STRING, aMessage));
}

public void addWarning(final String aMessage) {
backing.add(Pair.of(Desc.WARNING_STRING, aMessage));
}

public void addException(final Exception aE) {
backing.add(Pair.of(Desc.EXCEPTION_STRING, "" + aE));
}

public Pair<Desc, Object> get(final int index) {
return backing.get(index);
}

private int _errorCount;

@Override
public void exception(final Exception e) {
_errorCount++;
SimplePrintLoggerToRemoveSoon.println_err2("exception: " + e);
e.printStackTrace(System.err);
}

@Override
public void reportError(final String s) {
_errorCount++;
if (CompilationAlways.VOODOO)
System.err.printf("ERROR: %s%n", s);
}

@Override
public void reportWarning(final String s) {
if (CompilationAlways.VOODOO)
System.err.printf("WARNING: %s%n", s);
}

@Override
public int errorCount() {
return _errorCount;
}

@Override
public void info(final String message) {
if (CompilationAlways.VOODOO)
System.err.printf("INFO: %s%n", message);
}

@Override
public void reportDiagnostic(final Diagnostic diagnostic) {
if (diagnostic.severity() == Diagnostic.Severity.ERROR)
_errorCount++;
if (CompilationAlways.VOODOO)
diagnostic.report(System.err);
}
public List<Pair<Desc, Object>> __errors() {
return backing;
}
}
}

//
Expand Down
Loading