Easter cleaning

This commit is contained in:
Willem Cazander 2025-05-07 21:46:32 +02:00
commit 9e36078b2e
1862 changed files with 270281 additions and 0 deletions

21
nx01-warp-fault/pom.xml Normal file
View file

@ -0,0 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.nx01</groupId>
<artifactId>nx01</artifactId>
<version>〇一。壬寅。一〄-SNAPSHOT</version>
</parent>
<artifactId>nx01-warp-fault</artifactId>
<dependencies>
<dependency>
<groupId>love.distributedrebirth.nx01</groupId>
<artifactId>nx01-warp-manifestor</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View file

@ -0,0 +1,143 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestGenerator;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestSectionWhitePaper;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoGrowlFactory;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
/// Bass fault anchor (which replaces; Exception/RuntimeException)
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
abstract public class BassFaultAnchor extends BassFaultAnchorSignalStore {
private static final long serialVersionUID = 1L;
private boolean printClean = false;
public BassFaultAnchor(String message, Class<?> signal) {
super(message, signal);
}
public BassFaultAnchor(Exception error, Class<?> signal) {
super(error, signal);
}
public BassFaultAnchor(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public BassFaultAnchor(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
public final BassFaultAnchor withSignalTrace(Class<?> signal, String key, String value) {
fetchTraceSignalMap(signal).put(key, value);
return this;
}
public final BassFaultAnchor withSignalTrace(Class<?> signal, Consumer<Map<String, String>> tracer) {
tracer.accept(fetchTraceSignalMap(signal));
return this;
}
public final BassFaultAnchor appendOnWhitePaper(String key, String value) {
return withSignalTrace(SitraManifestSectionWhitePaper.class, key, value);
}
public final BassFaultAnchor appendOnWhitePaper(Consumer<Map<String, String>> tracer) {
return withSignalTrace(SitraManifestSectionWhitePaper.class, tracer);
}
public final StackTraceElement[] getStackTraceWithoutSignals() {
return super.getStackTrace();
}
@Override
public final StackTraceElement[] getStackTrace() {
Throwable faultRoot = getCause();
if (faultRoot != null) {
if (faultRoot instanceof BassFaultAnchor) {
BassFaultAnchor.class.cast(faultRoot).printClean = true;
}
while (faultRoot.getCause() != null) {
faultRoot = faultRoot.getCause();
if (faultRoot instanceof BassFaultAnchor) {
BassFaultAnchor.class.cast(faultRoot).printClean = true;
}
}
}
StackTraceElement[] superTrace = super.getStackTrace();
if (printClean) {
return superTrace;
}
List<StackTraceElement> trace = new ArrayList<>(Arrays.asList(superTrace));
for (Class<?> traceKey : this.getTraceSignals()) {
Optional<Map<String, String>> signalsOpt = this.getTraceSignalContext(traceKey);
if (signalsOpt.isEmpty()) {
continue;
}
Map<String, String> signals = signalsOpt.get();
for (String signalKey : signals.keySet()) {
String signalValue = signals.get(signalKey);
trace.add(0, new StackTraceElement("TraceSignal", signalKey + "=" + signalValue, traceKey.getSimpleName(), 0));
}
}
StackTraceElement[] result = trace.toArray(new StackTraceElement[] {});
return result;
}
public final String toStringZilLaLa() {
return ZilLaLaManyfestoGrowlFactory..buildFaultScream(toZilLaLaManyfesto(), this);
}
@Deprecated
public final String toStringZilLaLaBase64() {
return ZilLaLaManyfestoGrowlFactory..buildFaultScreamBase64(toZilLaLaManyfesto(), this);
}
public final WarpManifestX8 toZilLaLaManyfesto() {
return SitraManifestGenerator..buildSignalTraceManifest(this);
}
static public StackTraceElement[] cleanStackTrace(Throwable e) {
if (e instanceof BassFaultAnchor) {
return BassFaultAnchor.class.cast(e).getStackTraceWithoutSignals();
} else {
return e.getStackTrace();
}
}
}

View file

@ -0,0 +1,105 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.Consumer;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
/// Bass fault anchor for storing trace signals.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
abstract public class BassFaultAnchorSignalStore extends RuntimeException {
private static final long serialVersionUID = 1L;
private final LinkedHashMap<Class<?>,Map<String, String>> traceSignals = new LinkedHashMap<>();
protected BassFaultAnchorSignalStore(String message, Class<?> signal) {
super(message);
fetchTraceSignalMap(signal).put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_CHAIN_MESSAGE, message);
}
protected BassFaultAnchorSignalStore(Exception error, Class<?> signal) {
super(error.getMessage(), error);
// Copy signals from ONE (grant) parent, as they also did this;
if (error instanceof BassFaultAnchorSignalStore) { // copy signals from parent
traceSignals.putAll(BassFaultAnchorSignalStore.class.cast(error).traceSignals);
} else {
Throwable faultParentTracer = error.getCause();
if (faultParentTracer instanceof BassFaultAnchorSignalStore) { // copy signals from grand parent
traceSignals.putAll(BassFaultAnchorSignalStore.class.cast(faultParentTracer).traceSignals);
} else if (faultParentTracer != null) {
while (faultParentTracer.getCause() != null) {
faultParentTracer = faultParentTracer.getCause();
if (faultParentTracer instanceof BassFaultAnchorSignalStore) {
traceSignals.putAll(BassFaultAnchorSignalStore.class.cast(faultParentTracer).traceSignals);
break; // copy signals from first fault in the family line
}
}
}
}
fetchTraceSignalMap(signal).put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_CHAIN_ICEBERG, error.getClass().getName());
}
protected BassFaultAnchorSignalStore(Exception error, Class<?> signal, String key, String value) {
this(error, signal);
fetchTraceSignalMap(signal).put(key, value);
}
protected BassFaultAnchorSignalStore(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
this(error, signal);
tracer.accept(fetchTraceSignalMap(signal));
}
public final Set<Class<?>> getTraceSignals() {
return traceSignals.keySet();
}
public final Optional<Map<String, String>> getTraceSignalContext(Class<?> signal) {
Map<String, String> result = traceSignals.get(signal);
if (result == null) {
return Optional.empty();
}
return Optional.of(result);
}
protected final Map<String, String> fetchTraceSignalMap(Class<?> signal) {
Map<String, String> result = traceSignals.get(signal);
if (result == null) {
result = new HashMap<>();
traceSignals.put(signal, result);
}
return result;
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; InstantiationException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultBeanInstantiation extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultBeanInstantiation(String message, Class<?> signal) {
super(message, signal);
}
public FaultBeanInstantiation(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultBeanInstantiation(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultBeanInstantiation(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; InterruptedException/IllegalMonitorStateException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultBeanInterrupted extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultBeanInterrupted(String message, Class<?> signal) {
super(message, signal);
}
public FaultBeanInterrupted(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultBeanInterrupted(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultBeanInterrupted(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; IllegalStateException/UnsupportedOperationException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultBeanState extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultBeanState(String message, Class<?> signal) {
super(message, signal);
}
public FaultBeanState(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultBeanState(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultBeanState(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; IllegalAccessException/IllegalThreadStateException/SecurityException/UnsupportedOperationException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultReferenceAccess extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultReferenceAccess(String message, Class<?> signal) {
super(message, signal);
}
public FaultReferenceAccess(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultReferenceAccess(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultReferenceAccess(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; NoSuchFieldException/NoSuchMethodException/ClassNotFoundException/TypeNotPresentException/EnumConstantNotPresentException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultReferenceMissing extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultReferenceMissing(String message, Class<?> signal) {
super(message, signal);
}
public FaultReferenceMissing(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultReferenceMissing(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultReferenceMissing(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; NullPointerException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultReferenceNull extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultReferenceNull(String message, Class<?> signal) {
super(message, signal);
}
public FaultReferenceNull(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultReferenceNull(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultReferenceNull(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; ArrayStoreException/ClassCastException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultReferenceType extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultReferenceType(String message, Class<?> signal) {
super(message, signal);
}
public FaultReferenceType(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultReferenceType(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultReferenceType(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; IllegalArgumentException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultReferenceTypeValue extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultReferenceTypeValue(String message, Class<?> signal) {
super(message, signal);
}
public FaultReferenceTypeValue(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultReferenceTypeValue(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultReferenceTypeValue(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; ArrayIndexOutOfBoundsException/IndexOutOfBoundsException/NegativeArraySizeException/StringIndexOutOfBoundsException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultReferenceTypeValueBounds extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultReferenceTypeValueBounds(String message, Class<?> signal) {
super(message, signal);
}
public FaultReferenceTypeValueBounds(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultReferenceTypeValueBounds(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultReferenceTypeValueBounds(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,72 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import love.distributedrebirth.nx01.warp.fault.duck.DuckTailQuackLanguageFactory;
import love.distributedrebirth.nx01.warp.fault.duck.DuckTailQuackLanguageProvider;
/// Replaces; Packs an error of an other person.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultStreamDelegate extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultStreamDelegate(String message, Class<?> signal) {
super(message, signal);
}
public FaultStreamDelegate(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultStreamDelegate(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultStreamDelegate(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
static public FaultStreamDelegate valueOfDuckTail(Class<?> signal, String quackLanguage, String quack) {
Optional<DuckTailQuackLanguageProvider> duckTail = DuckTailQuackLanguageFactory..deliverQuackLanguage(quackLanguage);
if (duckTail.isEmpty()) {
return new FaultStreamDelegate("Missing duck for quack of: " + quackLanguage, signal);
}
FaultStreamDelegateDuckTail tail = duckTail.get().parseDuckTail(quack);
if (tail == null) {
return new FaultStreamDelegate("Missing duck tail for: " + quackLanguage, signal);
}
return new FaultStreamDelegate(tail, signal);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Wrap stack traces of other languages with duck tales.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultStreamDelegateDuckTail extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultStreamDelegateDuckTail(String message, Class<?> signal) {
super(message, signal);
}
public FaultStreamDelegateDuckTail(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultStreamDelegateDuckTail(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultStreamDelegateDuckTail(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; IOException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultStreamInterrupted extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultStreamInterrupted(String message, Class<?> signal) {
super(message, signal);
}
public FaultStreamInterrupted(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultStreamInterrupted(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultStreamInterrupted(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; NumberFormatException
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultStreamValueRead extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultStreamValueRead(String message, Class<?> signal) {
super(message, signal);
}
public FaultStreamValueRead(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultStreamValueRead(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultStreamValueRead(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import java.util.Map;
import java.util.function.Consumer;
/// Replaces; real format exception
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public final class FaultStreamValueWrite extends BassFaultAnchor {
private static final long serialVersionUID = 1L;
public FaultStreamValueWrite(String message, Class<?> signal) {
super(message, signal);
}
public FaultStreamValueWrite(Exception error, Class<?> signal) {
super(error, signal);
}
public FaultStreamValueWrite(Exception error, Class<?> signal, String key, String value) {
super(error, signal, key, value);
}
public FaultStreamValueWrite(Exception error, Class<?> signal, Consumer<Map<String, String>> tracer) {
super(error, signal, tracer);
}
}

View file

@ -0,0 +1,53 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.duck;
/// An abstract duck tail
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
abstract public class AbstractDuckTailQuackLanguageProvider implements DuckTailQuackLanguageProvider {
private final int duckMogul;
private final String quackLanguage;
public AbstractDuckTailQuackLanguageProvider(int duckMogul, String quackLanguage) {
this.duckMogul = duckMogul;
this.quackLanguage = quackLanguage;
}
@Override
public final int duckMogul() {
return duckMogul;
}
@Override
public final String quackLanguage() {
return quackLanguage;
}
}

View file

@ -0,0 +1,61 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.duck;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.ServiceLoader;
/// Holds all the duck tales quack language providers found in the class path.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum DuckTailQuackLanguageFactory {
;
private final Map<String, DuckTailQuackLanguageProvider> quackLanguages;
private DuckTailQuackLanguageFactory() {
Map<String, DuckTailQuackLanguageProvider> quackMap = new HashMap<>();
ServiceLoader<DuckTailQuackLanguageProvider> loader = ServiceLoader.load(DuckTailQuackLanguageProvider.class);
for (DuckTailQuackLanguageProvider quackSupport : loader) {
DuckTailQuackLanguageProvider other = quackMap.get(quackSupport.quackLanguage());
if (other != null && other.duckMogul() > quackSupport.duckMogul()) {
continue;
}
quackMap.put(quackSupport.quackLanguage(), quackSupport);
}
quackLanguages = Collections.unmodifiableMap(quackMap);
}
public Optional<DuckTailQuackLanguageProvider> deliverQuackLanguage(String quackLanguage) {
return Optional.ofNullable(quackLanguages.get(quackLanguage));
}
}

View file

@ -0,0 +1,43 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.duck;
import love.distributedrebirth.nx01.warp.fault.FaultStreamDelegateDuckTail;
/// Creates an duck tail from a quack selected by language and highest mogol.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public interface DuckTailQuackLanguageProvider {
int duckMogul();
String quackLanguage();
FaultStreamDelegateDuckTail parseDuckTail(String quack);
}

View file

@ -0,0 +1,129 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.duck;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.FaultStreamDelegateDuckTail;
/// Creates an duck tail from a quack selected by language and mogol.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class QuackJavaScriptDuckTales extends AbstractDuckTailQuackLanguageProvider {
public QuackJavaScriptDuckTales() {
super(1, "js");
}
@Override
public FaultStreamDelegateDuckTail parseDuckTail(String quack) {
if (!quack.contains("at")) {
return null;
}
int errorIdx = quack.indexOf("Error: ");
if (errorIdx == -1) {
return null;
}
boolean parseSignals = false;
Map<String, String> signals = new HashMap<>();
String errorMsg = quack.substring(errorIdx + 7, quack.indexOf("\n", errorIdx));
List<StackTraceElement> trace = new ArrayList<>();
Iterator<String> lines = Arrays.asList(quack.split("\n")).iterator();
while (lines.hasNext()) {
String line = lines.next();
if (parseSignals) {
if ("}".equals(line)) {
parseSignals = false;
continue;
}
String[] values = line.split(":");
if (values.length == 0) {
continue;
}
String value = values[1].replaceAll(",|'", "").trim();
signals.put("EcmaScript-Error-" + values[0].trim(), value);
continue;
}
if (!line.startsWith(" at ")) {
continue;
}
String objectMethod = null;
String objectSource = null;
Iterator<String> parts = Arrays.asList(line.split(" ")).iterator();
while (parts.hasNext()) {
String part = parts.next();
if (part.isEmpty()) {
continue;
}
if ("at".equals(part)) {
continue;
}
if ("async".equals(part)) {
continue;
}
if ("{".equals(part)) {
parseSignals = true;
continue;
}
if (objectMethod == null) {
objectMethod = part;
continue;
}
if (objectSource == null) {
objectSource = part;
continue;
}
break; // or fail...
}
// TODO: make safe, this is hacky
int indexFileStart = objectSource.indexOf("(") + 1;
int indexFileEnd = objectSource.lastIndexOf(":", objectSource.lastIndexOf(":") - 1); // backwards search
int indexLineStart = indexFileEnd + 1;
int indexLineEnd = objectSource.lastIndexOf(":");
String[] objectName = objectMethod.split("\\.");
String declaringClass = objectName.length==1?"this":objectName[0];
String methodName = objectName.length==1?objectName[0]:objectName[1];
String fileName = objectSource.substring(indexFileStart, indexFileEnd);
int lineNumber = 0;
if (indexLineEnd > 0) {
lineNumber = Integer.parseInt(objectSource.substring(indexLineStart, indexLineEnd));
}
trace.add(new StackTraceElement(declaringClass, methodName, fileName, lineNumber));
}
FaultStreamDelegateDuckTail result = new FaultStreamDelegateDuckTail(errorMsg, getClass());
result.setStackTrace(trace.toArray(new StackTraceElement[] {}));
result.withSignalTrace(getClass(), v -> v.putAll(signals));
return result;
}
}

View file

@ -0,0 +1,94 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.report;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestReportProvider;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionChampionsLeague;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionGoal;
/// Reports the fault stack trace in java2 format.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class ReportSitraFaultStackTraceJava2 implements SitraManifestReportProvider {
private static final String GOAL_SCORE = ZilLaLaManyfestoSectionGoal.SCISSORS.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.SCISSORS_JAVA2);
@Override
public void fillReport(BassFaultAnchor fault, Map<String, String> tracer) {
tracer.put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, GOAL_SCORE);
List<Throwable> oldgroup = new ArrayList<>();
oldgroup.add(fault);
Throwable faultRoot = fault.getCause();
if (faultRoot != null) {
oldgroup.add(faultRoot);
while (faultRoot.getCause() != null) {
faultRoot = faultRoot.getCause();
oldgroup.add(faultRoot);
}
}
int errorCount = 0;
int frameCount = 0;
String matchStopTrace = null;
for (int i = 0; i < oldgroup.size(); i++) {
Throwable error = oldgroup.get(i);
tracer.put(ZilLaLaManyfestoHeader.PREFIX_SECTION_LADDER_FAULT+errorCount++, error.toString());
int stopped = -1;
StackTraceElement[] frames = BassFaultAnchor.cleanStackTrace(error);
for (int f = 0; f < frames.length ; f++) {
StackTraceElement trace = frames[f];
tracer.put(ZilLaLaManyfestoHeader.PREFIX_SECTION_LADDER+frameCount++, trace.toString());
if (matchStopTrace == null) {
matchStopTrace = trace.getClassName() + trace.getMethodName();
}
if (i > 0 && matchStopTrace != null) {
String matchCurrentTrace = trace.getClassName() + trace.getMethodName();
if (matchStopTrace.equals(matchCurrentTrace)) {
stopped = f;
break; // NOTE: is only 99% equal to native jvm stack trace
}
}
}
if (stopped > 0) {
tracer.put(ZilLaLaManyfestoHeader.PREFIX_SECTION_LADDER+frameCount++, "... " + (frames.length - stopped + i) + " more");
}
for (Throwable hidden : error.getSuppressed()) {
tracer.put(ZilLaLaManyfestoHeader.PREFIX_SECTION_LADDER_FAULT_SHADOW+errorCount++, hidden.toString());
for (StackTraceElement trace : BassFaultAnchor.cleanStackTrace(hidden)) {
tracer.put(ZilLaLaManyfestoHeader.PREFIX_SECTION_LADDER+frameCount++, trace.toString());
}
}
}
}
}

View file

@ -0,0 +1,98 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.report;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestReportProvider;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionChampionsLeague;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionGoal;
/// Reports the fault stack trace in java3 format.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class ReportSitraFaultStackTraceJava3 implements SitraManifestReportProvider {
private static final String GOAL_SCORE = ZilLaLaManyfestoSectionGoal.SCISSORS.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.SCISSORS_JAVA3);
@Override
public void fillReport(BassFaultAnchor fault, Map<String, String> tracer) {
tracer.put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, GOAL_SCORE);
List<Throwable> regroup = new ArrayList<>();
regroup.add(fault);
Throwable faultRoot = fault.getCause();
if (faultRoot != null) {
regroup.add(faultRoot);
while (faultRoot.getCause() != null) {
faultRoot = faultRoot.getCause();
regroup.add(faultRoot);
}
}
int errorCount = 0;
int frameCount = 0;
Collections.reverse(regroup);
for (int i = 0; i < regroup.size(); i++) {
Throwable error = regroup.get(i);
tracer.put(ZilLaLaManyfestoHeader.PREFIX_SECTION_LADDER_FAULT+errorCount++, error.toString());
String matchStopTrace = null;
if (i + 1 < regroup.size()) {
Throwable errorNext = regroup.get(i + 1);
StackTraceElement[] traceNext = BassFaultAnchor.cleanStackTrace(errorNext);
if (traceNext.length > 0) {
StackTraceElement lastStep = traceNext[0];
matchStopTrace = lastStep.getClassName() + lastStep.getMethodName();
}
}
boolean stopNext = false;
for (StackTraceElement trace : BassFaultAnchor.cleanStackTrace(error)) {
if (stopNext) {
break;
}
if (matchStopTrace != null) {
String matchCurrentTrace = trace.getClassName() + trace.getMethodName();
if (matchStopTrace.equals(matchCurrentTrace)) {
stopNext = true;
}
}
tracer.put(ZilLaLaManyfestoHeader.PREFIX_SECTION_LADDER+frameCount++, trace.toString());
}
for (Throwable hidden : error.getSuppressed()) {
tracer.put(ZilLaLaManyfestoHeader.PREFIX_SECTION_LADDER_FAULT_SHADOW+errorCount++, hidden.toString());
for (StackTraceElement trace : BassFaultAnchor.cleanStackTrace(hidden)) {
tracer.put(ZilLaLaManyfestoHeader.PREFIX_SECTION_LADDER+frameCount++, trace.toString());
}
}
}
}
}

View file

@ -0,0 +1,69 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.report;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Properties;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestReportProvider;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionChampionsLeague;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionGoal;
/// Reports sitra warp fault version
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class ReportSitraFaultWarpVersion implements SitraManifestReportProvider {
private static final String GOAL_SCORE = ZilLaLaManyfestoSectionGoal.BIMBAMBOO.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.BIMBAMBOO_MAVEN);
private final static String WARP_FAULT_GROUP_ID = "love.distributedrebirth.nx01";
private final static String WARP_FAULT_ARTIFACT_ID = "nx01-warp-fault";
private final static String POM_VERSION_PROPERTY_KEY = "version";
private final static String POM_PROPERTIES_RESOURCE = "/META-INF/maven/" + WARP_FAULT_GROUP_ID + "/" + WARP_FAULT_ARTIFACT_ID + "/pom.properties";
@Override
public void fillReport(Map<String, String> tracer) {
InputStream faultPomVersion = getClass().getResourceAsStream(POM_PROPERTIES_RESOURCE);
if (faultPomVersion == null) {
return;
}
try (InputStream in = faultPomVersion) {
Properties p = new Properties();
p.load(in);
tracer.put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, GOAL_SCORE);
tracer.put("Warp-Fault-GroupId", WARP_FAULT_GROUP_ID);
tracer.put("Warp-Fault-ArtifactId", WARP_FAULT_ARTIFACT_ID);
tracer.put("Warp-Fault-Version", p.getProperty(POM_VERSION_PROPERTY_KEY));
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
}

View file

@ -0,0 +1,55 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.report;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestReportProvider;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionChampionsLeague;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionGoal;
/// Reports runtime memory statistics.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class ReportSitraRuntimeChapter implements SitraManifestReportProvider {
private static final String GOAL_SCORE = ZilLaLaManyfestoSectionGoal.BUBBLES.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.BUBBLES_RUMTIME);
private static final Runtime RUNTIME = Runtime.getRuntime();
@Override
public void fillReport(Map<String, String> tracer) {
tracer.put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, GOAL_SCORE);
tracer.put("VM-Version", Runtime.version().toString());
tracer.put("VM-Max-Memory", Long.toString(RUNTIME.maxMemory()));
tracer.put("VM-Free-Memory", Long.toString(RUNTIME.freeMemory()));
tracer.put("VM-Total-Memory", Long.toString(RUNTIME.totalMemory()));
tracer.put("VM-Available-Processors", Long.toString(RUNTIME.availableProcessors()));
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.report;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestReportProvider;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionGoal;
/// Reports runtime threads states.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class ReportSitraRuntimeThreads implements SitraManifestReportProvider {
@Override
public void fillReport(Map<String, String> tracer) {
tracer.put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, ZilLaLaManyfestoSectionGoal.BUTTER.toString());
Map<Thread, StackTraceElement[]> stacks = Thread.getAllStackTraces();
for (Thread thread : stacks.keySet()) {
StackTraceElement[] trackStack = stacks.get(thread);
String threadName = thread.getName();
String threadState = thread.getState().name();
String traceLine = trackStack.length==0?"":trackStack[0].toString();
String reportKey = threadState + "-ID_" + thread.getId();
String reportValue = thread.getClass().getName() + " (" + threadName + ") " + traceLine;
tracer.put(reportKey, reportValue);
}
}
}

View file

@ -0,0 +1,68 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.report;
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestReportProvider;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionChampionsLeague;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionGoal;
/// Reports system memory statistics.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class ReportSitraSystemChapter implements SitraManifestReportProvider {
private static final String GOAL_SCORE = ZilLaLaManyfestoSectionGoal.BUBBLES.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.BUBBLES_OPERATING_SYSTEM);
private static final OperatingSystemMXBean SYSTEM = ManagementFactory.getOperatingSystemMXBean();
@SuppressWarnings("deprecation")
@Override
public void fillReport(Map<String, String> tracer) {
tracer.put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, GOAL_SCORE);
tracer.put("OS-Name", SYSTEM.getName());
tracer.put("OS-Arch", SYSTEM.getArch());
tracer.put("OS-Version", SYSTEM.getVersion());
tracer.put("OS-Available-Processors", Integer.toString(SYSTEM.getAvailableProcessors()));
tracer.put("OS-Load-Average", Double.toString(SYSTEM.getSystemLoadAverage()));
if (SYSTEM instanceof com.sun.management.OperatingSystemMXBean) {
com.sun.management.OperatingSystemMXBean systemSun = com.sun.management.OperatingSystemMXBean.class.cast(SYSTEM);
tracer.put("OS-Committed-Virtual-Memory-Size", Long.toString(systemSun.getCommittedVirtualMemorySize()));
tracer.put("OS-Free-Swap-Space-Size", Long.toString(systemSun.getFreeSwapSpaceSize()));
tracer.put("OS-Process-Cpu-Load", Double.toString(systemSun.getProcessCpuLoad()));
tracer.put("OS-Process-Cpu-Time", Long.toString(systemSun.getProcessCpuTime()));
tracer.put("OS-Cpu-Load", Double.toString(systemSun.getSystemCpuLoad()));
tracer.put("OS-Total-Memory-Size", Long.toString(systemSun.getTotalPhysicalMemorySize()));
tracer.put("OS-Total-Memory-Usage", Double.toString(((double)systemSun.getFreeMemorySize() / (double)systemSun.getTotalPhysicalMemorySize()) * 100));
}
}
}

View file

@ -0,0 +1,53 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.report;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestReportProvider;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionChampionsLeague;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionGoal;
/// Reports the system environment variables.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class ReportSitraSystemEnvironment implements SitraManifestReportProvider {
private static final String GOAL_SCORE = ZilLaLaManyfestoSectionGoal.BUBBLES.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.BUBBLES_ENVIRONMENT);
@Override
public void fillReport(Map<String, String> tracer) {
tracer.put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, GOAL_SCORE);
for (String key : System.getenv().keySet()) {
String value = System.getenv(key);
tracer.put(key, value);
}
}
}

View file

@ -0,0 +1,54 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.report;
import java.util.Locale;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestReportProvider;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionChampionsLeague;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionGoal;
/// Reports the system locale.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class ReportSitraSystemLocale implements SitraManifestReportProvider {
private static final String GOAL_SCORE = ZilLaLaManyfestoSectionGoal.BUBBLES.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.BUBBLES_LOCALE);
@Override
public void fillReport(Map<String, String> tracer) {
tracer.put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, GOAL_SCORE);
Locale locale = Locale.getDefault();
tracer.put("Locale-Language", locale.getLanguage());
tracer.put("Locale-Country", locale.getCountry());
tracer.put("Locale-Variant", locale.getVariant());
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.report;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestReportProvider;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionChampionsLeague;
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoSectionGoal;
/// Reports all the system properties.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class ReportSitraSystemProperties implements SitraManifestReportProvider {
private static final String GOAL_SCORE = ZilLaLaManyfestoSectionGoal.BUBBLES.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.BUBBLES_PROPERTIES);
@Override
public void fillReport(Map<String, String> tracer) {
tracer.put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, GOAL_SCORE);
for (Object keyObj : System.getProperties().keySet()) {
if (keyObj instanceof String) {
String key = String.class.cast(keyObj);
String value = System.getProperty(key);
tracer.put(key, value);
}
}
}
}

View file

@ -0,0 +1,139 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8Section;
import love.distributedrebirth.nx01.warp.manifestor.scopic.iomf.ScopicManifestConstants;
/// Sitra manifest generator.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum SitraManifestGenerator {
;
private static final String SITRA_VALUE_NULL = "null";
public WarpManifestX8 buildSignalTraceManifest(BassFaultAnchor fault) {
String message = fault.getLocalizedMessage();
if (message != null) {
message = escapeSignalValue(message);
}
String uuidDate = DateTimeFormatter.RFC_1123_DATE_TIME.format(ZonedDateTime.ofInstant(Instant.now(), ZoneOffset.UTC));
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_MANYFESTO_VCROSS, ZilLaLaManyfesto.MANYFESTO_VERSION);
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_MANYFESTO_AFOUR, ZilLaLaManyfesto.MANYFESTO_A4_JAVA);
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_UUID_WM_ONE, SitraManifestUUIDCrematorium..burnWaterMarkOne().toString());
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_UUID_WM_TWO, SitraManifestUUIDCrematorium..burnWaterMarkTwo().toString());
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_UUID_WM_THREE, SitraManifestUUIDCrematorium..burnWaterMarkThree().toString());
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_UUID_WM_FOUR, SitraManifestUUIDCrematorium..burnWaterMarkFour().toString());
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_UUID_DATE, uuidDate);
Throwable faultRoot = fault.getCause();
if (faultRoot != null) {
while (faultRoot.getCause() != null) {
faultRoot = faultRoot.getCause();
}
}
if (faultRoot != null) {
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_ROOT_ICEBERG, faultRoot.getClass().getName());
}
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_TOP_ICEBERG, fault.getClass().getName());
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_TOP_MESSAGE, message!=null?message:SITRA_VALUE_NULL);
for (Class<?> traceKey : fault.getTraceSignals()) {
Optional<Map<String, String>> signalsOpt = fault.getTraceSignalContext(traceKey);
if (signalsOpt.isEmpty()) {
continue;
}
Map<String, String> signals = signalsOpt.get();
WarpManifestX8Section section = manifest.makeSection(traceKey.getName());
if (SitraManifestSectionWhitePaper.class.equals(traceKey)) {
section.withAttribute(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, ZilLaLaManyfestoSectionGoal.PAPER.toString());
} else {
if (signals.containsKey(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_CHAIN_MESSAGE)) {
section.withAttribute(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, ZilLaLaManyfestoSectionGoal.ROCK.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.ROCK_SUMMIT));
} else {
section.withAttribute(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, ZilLaLaManyfestoSectionGoal.ROCK.spaceCadet(ZilLaLaManyfestoSectionChampionsLeague.ROCK_CLIMB));
}
}
for (String signalKey : signals.keySet()) {
String signalValue = signals.get(signalKey);
String attributeBody = signalValue==null?SITRA_VALUE_NULL:escapeSignalValue(signalValue);
section.withAttribute(escapeHeaderName(signalKey), attributeBody);
};
}
for (SitraManifestReportProvider report : SitraManifestReportFactory..deliverSPIReports()) {
List<Class<? extends BassFaultAnchor>> matchers = report.matchFaults();
if (!matchers.isEmpty()) {
boolean matchOne = false;
for (Class<? extends BassFaultAnchor> match : matchers) {
if (match.isAssignableFrom(fault.getClass())) {
matchOne = true;
break;
}
}
if (!matchOne) {
continue;
}
}
Map<String, String> signals = new LinkedHashMap<>();
report.fillReport(fault, signals);
WarpManifestX8Section section = manifest.makeSection(report.getClass().getName());
for (String signalKey : signals.keySet()) {
String signalValue = signals.get(signalKey);
String attributeBody = signalValue==null?SITRA_VALUE_NULL:escapeSignalValue(signalValue);
section.withAttribute(escapeHeaderName(signalKey), attributeBody);
};
}
return manifest;
}
private String escapeHeaderName(String headerName) {
if (ScopicManifestConstants.ATTR_SIMSALABIM_SECTION.equalsIgnoreCase(headerName)) {
return ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_NAME;
}
if (ScopicManifestConstants.ATTR_SIMSALABIM_REMARK.equalsIgnoreCase(headerName)) {
return ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_FROM;
}
return headerName;
}
private String escapeSignalValue(String line) {
return line.replaceAll("\n", "\\\\n "); // TODO: check if added markdown space is correct here...
}
}

View file

@ -0,0 +1,56 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.ServiceLoader;
/// Holds all the manifest reports found in the class path.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum SitraManifestReportFactory {
;
private final List<SitraManifestReportProvider> reports;
private SitraManifestReportFactory() {
List<SitraManifestReportProvider> reportList = new ArrayList<>();
ServiceLoader<SitraManifestReportProvider> loader = ServiceLoader.load(SitraManifestReportProvider.class);
for (SitraManifestReportProvider reportSPI : loader) {
reportList.add(reportSPI);
}
reports = Collections.unmodifiableList(reportList);
}
protected List<SitraManifestReportProvider> deliverSPIReports() {
return reports;
}
}

View file

@ -0,0 +1,52 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
/// Fills an manifest report section.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public interface SitraManifestReportProvider {
default List<Class<? extends BassFaultAnchor>> matchFaults() {
return Collections.emptyList();
}
default void fillReport(BassFaultAnchor fault, Map<String, String> tracer) {
fillReport(tracer);
}
default void fillReport(Map<String, String> tracer) {
}
}

View file

@ -0,0 +1,37 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
/// Internal marker to point to the white paper signal.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum SitraManifestSectionWhitePaper {
;
// An empty enum type is a static jvm safe locked pointer to somewhere.
}

View file

@ -0,0 +1,76 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
import java.nio.charset.StandardCharsets;
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.UUID;
/// Builds the application id UUID provider.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum SitraManifestUUIDAppIdFactory {
;
private final SitraManifestUUIDAppIdProvider provider;
private SitraManifestUUIDAppIdFactory() {
ServiceLoader<SitraManifestUUIDAppIdProvider> loader = ServiceLoader.load(SitraManifestUUIDAppIdProvider.class);
Optional<SitraManifestUUIDAppIdProvider> providerSPI = loader.findFirst();
if (providerSPI.isPresent()) {
provider = providerSPI.get();
} else {
provider = buildDefaultSPIUUIDAId();
}
}
protected SitraManifestUUIDAppIdProvider deliverSPIUUIDAId() {
return provider;
}
private SitraManifestUUIDAppIdProvider buildDefaultSPIUUIDAId() {
return new SitraManifestUUIDAppIdProvider() {
@Override
public UUID applicationUUID() {
String appId = System.getProperty("Application.id"); // bsaf
if (appId == null) {
appId = System.getProperty("spring.application.name"); // spring
}
if (appId == null) {
appId = System.getProperty("logger.app.name"); // log4j
}
if (appId == null) {
appId = System.getProperty("user.name"); // fall back to user name
}
return UUID.nameUUIDFromBytes(appId.getBytes(StandardCharsets.UTF_8));
}
};
}
}

View file

@ -0,0 +1,39 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
import java.util.UUID;
/// SPI for providing an application id HMAC UUID.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public interface SitraManifestUUIDAppIdProvider {
UUID applicationUUID();
}

View file

@ -0,0 +1,94 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
import java.nio.charset.StandardCharsets;
import java.util.Random;
import java.util.UUID;
/// Burns the sitra manifest UUID water marks.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum SitraManifestUUIDCrematorium {
;
private final UUID uuidJvmInstance;
private final UUID uuidJvmClassPath;
private SitraManifestUUIDCrematorium() {
uuidJvmInstance = new UUID(generateMostSigBits(), generateLeastSigBits());
uuidJvmClassPath = UUID.nameUUIDFromBytes(generateClassPathBytes());
}
/// Water mark smurf one, runtime instance identifier UUID.
///
/// @return An UUID.
public UUID burnWaterMarkOne() {
return uuidJvmInstance;
}
/// Water mark smurf two, application identifier UUID HMAC via SPI.
///
/// @return An UUID.
public UUID burnWaterMarkTwo() {
return SitraManifestUUIDAppIdFactory..deliverSPIUUIDAId().applicationUUID();
}
/// Water mark smurf three, application version by class path UUID.
///
/// @return An UUID.
public UUID burnWaterMarkThree() {
return uuidJvmClassPath;
}
/// Water mark smurf four, application fault sequence UUID.
///
/// @return An UUID.
public UUID burnWaterMarkFour() {
return UUID.randomUUID();
}
private static byte[] generateClassPathBytes() {
return System.getProperty("java.class.path").getBytes(StandardCharsets.UTF_8);
}
private static long generateMostSigBits() {
Random random = new Random();
return random.nextLong() & 0x3FFFFFFFFFFFFFFFL | 0x8000000000000000L;
}
private static long generateLeastSigBits() {
final long epoch = System.currentTimeMillis();
final long timeMinute = (epoch & 0x0000_0000_FFFF_FFFFL) << 32;
final long timeHour = ((epoch >> 32) & 0xFFFF) << 16;
final long timeSplit = 1 << 12;
final long timeDay = ((epoch >> 48) & 0x0FFF);
return timeMinute | timeHour | timeSplit | timeDay;
}
}

View file

@ -0,0 +1,44 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheMimeType;
/// ZilLaLa manyfesto protocol constants to build or parse the manifest data uri.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum ZilLaLaManyfesto {
;
public static final String MANYFESTO_VERSION = "1.0";
public static final String MANYFESTO_A4_JAVA = "java";
public static final String MANYFESTO_A4_ERLANG = "erlang";
public static final String ZILLALA_URI_PREFIX_DATA64 = "data:" + WarpManifestX0TheMimeType.MANIFEST_3.getQName() + ";base64,";
public static final String ZILLALA_URI_PREFIX_NOSTR_TLV_GZ = "nostr:zillala"; // TODO: nostr link to replay to inject bug + TLV for gz sitra manifest payload
}

View file

@ -0,0 +1,79 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
import java.util.Base64;
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
/// ZilLaLa manyfesto protocol constants to build or parse the manifest data uri.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum ZilLaLaManyfestoGrowlFactory {
;
/// A unicode character to indicate a separation event to a next key word.
private static final String VALUE_WHITE_SPACE = " ";
/// Multiple characters seen as a slug to indicate that words are eaten.
private static final String VALUE_CUTOFF = "...";
public String buildFaultScream(WarpManifestX8 manifest, BassFaultAnchor fault) {
StringBuilder buf = new StringBuilder();
buf.append(fault.getClass().getSimpleName());
String messageShort = buildCutDottedMessage(fault);
if (messageShort != null) {
buf.append("(");
buf.append(messageShort);
buf.append(")");
}
buf.append(VALUE_WHITE_SPACE);
buf.append(WarpManifestorDriver.writeV2String(manifest));
return buf.toString();
}
@Deprecated
public String buildFaultScreamBase64(WarpManifestX8 manifest, BassFaultAnchor fault) {
byte[] traceManifestBytes = WarpManifestorDriver.writeV3Array(manifest); // TODO: Upgrade to version 6 or 7 ??
String trace64 = Base64.getEncoder().encodeToString(traceManifestBytes); // FIXME: report as "normal" text in nostr event
StringBuilder buf = new StringBuilder();
// TODO: Move base data uri + nostr data uri to provider interface
buf.append(ZilLaLaManyfesto.ZILLALA_URI_PREFIX_DATA64);
buf.append(trace64);
return buf.toString();
}
private String buildCutDottedMessage(BassFaultAnchor fault) {
String msgShort = fault.getLocalizedMessage();
if (msgShort != null && msgShort.length() > 33) {
msgShort = msgShort.substring(0, 33) + VALUE_CUTOFF;
}
return msgShort;
}
}

View file

@ -0,0 +1,61 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
/// Header constants to build or parse the ZilLaLa manyfesto.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum ZilLaLaManyfestoHeader {
;
public static final String MAIN_FAULT_MANYFESTO_VCROSS = "Fault-Manyfesto-VX";
public static final String MAIN_FAULT_MANYFESTO_AFOUR = "Fault-Manyfesto-A4"; // In the nether we don't use letter's
public static final String MAIN_FAULT_UUID_WM_ONE = "Fault-UUID-WM1"; // jvm instance water mark
public static final String MAIN_FAULT_UUID_WM_TWO = "Fault-UUID-WM2"; // auto optional appId HMAC via SPI
public static final String MAIN_FAULT_UUID_WM_THREE = "Fault-UUID-WM3"; // class path (version)
public static final String MAIN_FAULT_UUID_WM_FOUR = "Fault-UUID-WM4"; // fault sequence
public static final String MAIN_FAULT_UUID_DATE = "Fault-UUID-Date";
public static final String MAIN_FAULT_ROOT_ICEBERG = "Fault-Root-Iceberg";
public static final String MAIN_FAULT_TOP_ICEBERG = "Fault-Top-Iceberg";
public static final String MAIN_FAULT_TOP_MESSAGE = "Fault-Top-Message";
public static final String SIGNAL_FAULT_SECTION_GOAL = "Fault-Section-Goal";
public static final String SIGNAL_FAULT_SECTION_CHAIN_MESSAGE = "Fault-Section-Chain-Message";
public static final String SIGNAL_FAULT_SECTION_CHAIN_ICEBERG = "Fault-Section-Chain-Iceberg";
public static final String SIGNAL_FAULT_SECTION_NAME = "Fault-Section-Name"; // does auto rename "name|NAME" to this
public static final String SIGNAL_FAULT_SECTION_FROM = "Fault-Section-From"; // does auto rename "from|FROM" to this
/// StackTraceElement
public static final String PREFIX_SECTION_LADDER = "Ladder-X_";
/// Throwable
public static final String PREFIX_SECTION_LADDER_FAULT = "Ladder-Fault-X_";
/// Suppressed throwable
public static final String PREFIX_SECTION_LADDER_FAULT_SHADOW = "Ladder-Fault-Shadow-X_";
}

View file

@ -0,0 +1,51 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
/// Champions League campaign to unite the different sections goal arguments.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum ZilLaLaManyfestoSectionChampionsLeague {
;
public static final String ROCK_CLIMB = "climb";
public static final String ROCK_SUMMIT = "summit";
public static final String PAPER_NOTE = "markdown";
public static final String SCISSORS_JAVA2 = "java2";
public static final String SCISSORS_JAVA3 = "java3";
public static final String BUBBLES_OPERATING_SYSTEM = "os";
public static final String BUBBLES_RUMTIME = "runtime";
public static final String BUBBLES_LOCALE = "locale";
public static final String BUBBLES_ENVIRONMENT = "environment";
public static final String BUBBLES_PROPERTIES = "properties";
public static final String BIMBAMBOO_MAVEN = "maven";
}

View file

@ -0,0 +1,69 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
import java.util.LinkedHashSet;
import java.util.Set;
/// Predefined goals to the section headers to indicate purpose for UI grouping.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public enum ZilLaLaManyfestoSectionGoal {
;
/// A chain entry of one rock in the iceberg of errors.
public static final ZilLaLaManyfestoSectionGoalScore ROCK = .cornerKick("ROCK");
/// A white paper to write to, as last resort to report.
public static final ZilLaLaManyfestoSectionGoalScore PAPER = .cornerKick("PAPER");
/// The stack cut in small trace pieces.
public static final ZilLaLaManyfestoSectionGoalScore SCISSORS = .cornerKick("SCISSORS");
/// The threads of the process soft as butter.
public static final ZilLaLaManyfestoSectionGoalScore BUTTER = .cornerKick("BUTTER");
/// The amounts of bubble memory brain space like information.
public static final ZilLaLaManyfestoSectionGoalScore BUBBLES = .cornerKick("BUBBLES");
/// BimBamBoo clock version artifact goal score meta flag.
public static final ZilLaLaManyfestoSectionGoalScore BIMBAMBOO = .cornerKick("BIMBAMBOO");
private final Set<ZilLaLaManyfestoSectionGoalScore> scoreEnum = new LinkedHashSet<>();
private ZilLaLaManyfestoSectionGoalScore cornerKick(String scoreType) {
ZilLaLaManyfestoSectionGoalScore cornerKick = ZilLaLaManyfestoSectionGoalScore.valueOf(scoreType);
scoreEnum.add(cornerKick);
return cornerKick;
}
public Set<String> virtualValues() {
return new LinkedHashSet<String>(scoreEnum.stream().map(v -> v.toString()).toList());
}
}

View file

@ -0,0 +1,54 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault.sitra;
/// Goal score type for a virtual enumeration counter.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public interface ZilLaLaManyfestoSectionGoalScore {
enum Constantinople {
;
private static final String UNICODE_UTF16_LATIN1_WHITE_SPACE_STRINGS = " ";
private static final String ARE_FOUR = "";
}
default String spaceCadet(String pussies) {
return toString().concat(Constantinople.UNICODE_UTF16_LATIN1_WHITE_SPACE_STRINGS).concat(Constantinople.ARE_FOUR).concat(pussies);
}
public static ZilLaLaManyfestoSectionGoalScore valueOf(final String scoreType) {
return new ZilLaLaManyfestoSectionGoalScore() {
@Override
public String toString() {
return scoreType;
}
};
}
}

View file

@ -0,0 +1 @@
love.distributedrebirth.nx01.warp.fault.duck.QuackJavaScriptDuckTales

View file

@ -0,0 +1,123 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package love.distributedrebirth.nx01.warp.fault;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class FaultSignalTraceTest {
static class SpaceA {
static void traceRoot() {
throw new FaultBeanInstantiation("The signal trace root", SpaceA.class);
}
}
static class SpaceB {
static void traceRootAccess() {
try {
SpaceA.traceRoot();
} catch (FaultBeanInstantiation e) {
throw e.withSignalTrace(SpaceB.class, "Name", "FoodSection").withSignalTrace(SpaceB.class, "From", "FoodEmail");
}
}
}
static class SpaceC {
static void traceRootCatchBass() {
try {
SpaceB.traceRootAccess();
} catch (BassFaultAnchor e) {
throw e.withSignalTrace(SpaceC.class, v -> {
v.put("Junit-Foo", "Bar");
v.put("Junit-仙上主天", "仙上主天");
}).appendOnWhitePaper("Paper-SpaceC", "rock");
}
}
}
static class SpaceD {
static void traceWrapClassic() {
try {
SpaceC.traceRootCatchBass();
} catch (Exception e) {
throw new IllegalArgumentException("Classic argument missing wrapper", e);
}
}
}
static class SpaceE {
static void traceWrap() {
try {
SpaceD.traceWrapClassic();
} catch (Exception e) {
throw new FaultBeanState(e, SpaceD.class).appendOnWhitePaper("Paper-SpaceE", "sissors");
}
}
}
@Test
public void testFaultString() {
FaultBeanState error = null;
try {
SpaceE.traceWrap();
} catch (FaultBeanState e) {
error = e;
}
Assertions.assertNotNull(error);
Assertions.assertNotNull(error.getMessage());
String errorText = error.toStringZilLaLa();
//System.out.println(errorText);
//System.out.println(errorText.length()); // 3185, 3433
Assertions.assertNotNull(errorText);
Assertions.assertTrue(errorText.contains(error.getMessage()));
Assertions.assertTrue(errorText.contains("FaultBeanState"));
}
@Test
public void testFaultStringSitra() {
BassFaultAnchor error = null;
try {
SpaceE.traceWrap();
} catch (BassFaultAnchor e) {
error = e;
}
Assertions.assertNotNull(error);
Assertions.assertNotNull(error.getMessage());
WarpManifestX8 manifest = error.toZilLaLaManyfesto();
String sitraText = WarpManifestorDriver.writeV2String(manifest);
//System.out.println(sitraText);
Assertions.assertNotNull(sitraText);
Assertions.assertTrue(sitraText.contains("Manifest"));
Assertions.assertTrue(sitraText.contains("SpaceB"));
Assertions.assertTrue(sitraText.contains("FoodSection"));
Assertions.assertTrue(sitraText.contains("SpaceC"));
Assertions.assertTrue(sitraText.contains("Junit-Foo: Bar"));
}
}

View file

@ -0,0 +1,6 @@
love.distributedrebirth.nx01.warp.fault.report.ReportSitraFaultStackTraceJava3
love.distributedrebirth.nx01.warp.fault.report.ReportSitraFaultWarpVersion
love.distributedrebirth.nx01.warp.fault.report.ReportSitraRuntimeChapter
love.distributedrebirth.nx01.warp.fault.report.ReportSitraRuntimeThreads
love.distributedrebirth.nx01.warp.fault.report.ReportSitraSystemChapter
love.distributedrebirth.nx01.warp.fault.report.ReportSitraSystemLocale