Skip to content

Instantly share code, notes, and snippets.

@CC007
CC007 / Main.java
Created October 5, 2023 23:08
Question regarding overriding methods with sealed class/interface parameters
public class Main {
public static void main(String[] args) {
// These are objects of the only 2 classes that implement Parent
// `sealed` defines that there can't be any other classes that implement Parent
Child1 child1 = new Child1();
Child2 child2 = new Child2();
// I can call myMethod(child1) and myMethod(child2) on myClass
MyInterface myClass = new MyClass();
myClass.myMethod(child1);
myClass.myMethod(child2);
@CC007
CC007 / manifold plugin error
Created September 1, 2023 23:23
This happened when putting auto as generic parameter in a Map
During querying provider External annotations (class com.intellij.codeInsight.ExternalAnnotationLineMarkerProvider)
java.lang.RuntimeException: Throwable in afterComputation
at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:126)
at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:42)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:66)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:245)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:69)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
@CC007
CC007 / Demo7.java
Created August 27, 2023 19:17
error when using multiple classes in one source file
package com.github.cc007;
import lombok.ToString;
import manifold.ext.props.rt.api.set;
import manifold.ext.props.rt.api.var;
import static manifold.ext.props.rt.api.PropOption.Package;
import static manifold.ext.props.rt.api.PropOption.Private;
import static manifold.ext.props.rt.api.PropOption.Protected;
@CC007
CC007 / Demo7.java
Created August 26, 2023 19:40
Possibly unintended behavior for manifold-prop annotation parameters
package com.github.cc007;
import lombok.ToString;
import manifold.ext.props.rt.api.get;
import static manifold.ext.props.rt.api.PropOption.Public;
public class Demo7 {
// added lombok annotation to interact with the class fields from inside the class
@CC007
CC007 / Demo7.java
Created August 26, 2023 19:19
Inconsistency between compiler and IntelliJ highlighting
package com.github.cc007;
import lombok.ToString;
import manifold.ext.props.rt.api.PropOption;
import manifold.ext.props.rt.api.get;
import manifold.ext.props.rt.api.set;
import manifold.ext.props.rt.api.val;
import manifold.ext.props.rt.api.var;
import static manifold.ext.props.rt.api.PropOption.Private;
@CC007
CC007 / gist:c4aae646e469ce62843a098320e7293d
Created February 4, 2018 02:53
Factory Floor Scenario blueprint
0eNq1Xdty2kgQ/Rc9Q0pzn/GvbKVSGMu2ajGwEqTiSvnfVxiIlc1odPp4eXLZhkNPa/o6Z5qf1f3m2Oy7dnuo7n5W7Xq37au7v35Wffu0XW1Ofzu87pvqrmoPzUu1qLarl9NvzY991/T98tCttv1+1x2W983mUL0tqnb70Pyo7tTbYhZk1ffNy/2m3T4tX1br53bbLM0IQr99XVTN9tAe2uYs1Psvr9+2x5f7phs+4w9x+v2mPRyG/y2q/a4f3rjbnj59AFsqu6heh5/uixs+4qHtmvX53/4k6X+Q9dxCM/jmjO/n0Q2BrmF0S6ArGN0R6DWM7sXoeb3YDHZgscM8dhRjmyx2TidJsMvNF3fVRwbp9CCEYjpYvUqx4IB+ldwgbRZc58AJezSXPW3nn58iDFInHJ6wSB1xeE/ABxz+wypfmof2+LJsNsPru3a93O82TUF2l93hkZDW49ImAt7B8Lom4K9hbd6ItOLhEemJoKkNDv+nlR6HPKF76nbDz7kP+G/MX1wzkt3xsD+eEpc/P5CxW42vh7FbhcN7sWHpgmHpQMT9lNd9Dp6xW9wF68RLD8Cbmtqa9czWbLcTO9MQhqwi/DCM5uERbRlR2n6NJUjabpjc18EO1DDJLx5djOelR+DFofYqe9YjmMjXSMijTKJdor/8UkSuJKr5msjOJ5BW8fDAtrOarxcdIL3hS7rszrCEFeKhwn6iAkWepaeFR9CJMIo7bkuYZMDRE40OaMbVtGYQdMJCPawZRxiow9ENjY5oxtKaQdAJY7W4ZghbxSOQCzQ6oplIawZBZwpVWDOeCac4uqLRAc14TWsGQZfbao0rRm6qAq07FhxRi2fVgoDTjV1ELXRnF5E8sZID4IFu9gI5Y6CbvYjkmiinR1FjtrMTDNtNRqS3hPT5LEzPtwKCE5RJfqKUzi5DbrJ4shfkJovn2EFusngiGZKwiC51qyPTN5ooHDWw76PcagVVcJRHVkFdFpn271QVPG9XkYi1uOOPRLDFPX/0jKocv63