repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/ExtensibilityTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static com.github.rschmitt.dynamicobject.DynamicObject.toFressianByteArray; impo...
package com.github.rschmitt.dynamicobject; public class ExtensibilityTest { private static final String Edn = "#dh{:dumb [#MyDumbClass{:version 1, :str \"str\"}]}"; @BeforeEach public void setup() { DynamicObject.registerType(DumbClass.class, new DumbClassTranslator()); DynamicObject.re...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
assertEquals(holder, fromFressianByteArray(toFressianByteArray(holder)));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/ExtensibilityTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static com.github.rschmitt.dynamicobject.DynamicObject.toFressianByteArray; impo...
package com.github.rschmitt.dynamicobject; public class ExtensibilityTest { private static final String Edn = "#dh{:dumb [#MyDumbClass{:version 1, :str \"str\"}]}"; @BeforeEach public void setup() { DynamicObject.registerType(DumbClass.class, new DumbClassTranslator()); DynamicObject.re...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
assertEquals(holder, fromFressianByteArray(toFressianByteArray(holder)));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/CollectionsTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toMap; import static java.util.stream.I...
package com.github.rschmitt.dynamicobject; public class CollectionsTest { private static final Random Random = new Random(); private static final Base64.Encoder Encoder = Base64.getEncoder(); @BeforeEach public void setup() { DynamicObject.registerTag(ListSchema.class, "ls"); Dynami...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
ListSchema listSchema = deserialize("{:strings [\"one\" \"two\" \"three\"]}", ListSchema.class);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/CollectionsTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toMap; import static java.util.stream.I...
assertEquals(3, collect.get(1).intValue()); assertEquals(5, collect.get(2).intValue()); binaryRoundTrip(listSchema); } @Test public void setOfStrings() { SetSchema setSchema = deserialize("{:strings #{\"one\" \"two\" \"three\"}}", SetSchema.class); Set<String> string...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
ListSchema built = newInstance(ListSchema.class).ints(builtList);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/BuilderTest.java
// Path: src/test/java/com/github/rschmitt/dynamicobject/TestUtils.java // public static void assertEquivalent(String expected, String actual) { // assertEquals(genericRead(expected), genericRead(actual)); // }
import static com.github.rschmitt.dynamicobject.TestUtils.assertEquivalent; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import clojure.lang.PersistentHashMap;
package com.github.rschmitt.dynamicobject; public class BuilderTest { @Test public void createEmptyInstance() { Buildable obj = DynamicObject.newInstance(Buildable.class); assertEquals(PersistentHashMap.EMPTY, obj.getMap()); assertEquals("{}", DynamicObject.serialize(obj)); } ...
// Path: src/test/java/com/github/rschmitt/dynamicobject/TestUtils.java // public static void assertEquivalent(String expected, String actual) { // assertEquals(genericRead(expected), genericRead(actual)); // } // Path: src/test/java/com/github/rschmitt/dynamicobject/BuilderTest.java import static com.github.rsch...
assertEquivalent("{:f 3.14, :d 3.14, :l 9223372036854775807, :s 127, :i 4}", DynamicObject.serialize(obj));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/CustomKeyTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test;
package com.github.rschmitt.dynamicobject; public class CustomKeyTest { @Test public void customKeywordSupport() { String edn = "{:a-sample-int 5}";
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
KeywordInterface object = deserialize(edn, KeywordInterface.class);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/CustomKeyTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test;
package com.github.rschmitt.dynamicobject; public class CustomKeyTest { @Test public void customKeywordSupport() { String edn = "{:a-sample-int 5}"; KeywordInterface object = deserialize(edn, KeywordInterface.class); assertEquals(5, object.aSampleInt());
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
assertEquals(object, newInstance(KeywordInterface.class).aSampleInt(5));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/SchemaCollectionTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.ArrayList; import j...
package com.github.rschmitt.dynamicobject; public class SchemaCollectionTest { @BeforeEach public void setup() { DynamicObject.registerTag(X.class, "X"); DynamicObject.registerTag(Coll.class, "Coll"); } @AfterEach public void teardown() { DynamicObject.deregisterTag(Coll...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
Coll expected = deserialize("#Coll{:list [#X{:y 1}, #X{:y 2}, #X{:y 3}]}", Coll.class);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/SchemaCollectionTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.ArrayList; import j...
package com.github.rschmitt.dynamicobject; public class SchemaCollectionTest { @BeforeEach public void setup() { DynamicObject.registerTag(X.class, "X"); DynamicObject.registerTag(Coll.class, "Coll"); } @AfterEach public void teardown() { DynamicObject.deregisterTag(Coll...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
list.add(newInstance(X.class).y(1));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/SchemaCollectionTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.ArrayList; import j...
Coll actual = newInstance(Coll.class).set(set); roundTripTest(expected, Coll.class); roundTripTest(actual, Coll.class); assertEquals(expected, actual); assertEquals(set, expected.set()); assertEquals(set, actual.set()); assertEquals(actual.set(), set); a...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
String edn = serialize(obj);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/NestingTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static String serialize(Object o) { // return EdnSerialization.serialize(o); // }
import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.junit.jupiter.api.Test;
package com.github.rschmitt.dynamicobject; public class NestingTest { @Test public void nestedInts() { List<Integer> innerList = new ArrayList<>(); innerList.add(1); innerList.add(2); innerList.add(3); List<List<Integer>> outerList = new ArrayList<>(); outerLi...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static String serialize(Object o) { // return EdnSerialization.serialize(o); // } // Path: src/test/java/com/github/rschmitt/dynamicobject/NestingTest.java import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import...
assertEquals("{:nestedIntegers [[1 2 3]]}", serialize(nested));
rschmitt/dynamic-object
src/main/java/com/github/rschmitt/dynamicobject/Unknown.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // @SuppressWarnings("rawtypes") // public class ClojureStuff { // public static final Map EmptyMap = (Map) read("{}"); // public static final Object EmptySet = read("#{}"); // public static final Object EmptyVector = read("...
import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.util.Map; import com.github.rschmitt.dynamicobject.internal.ClojureStuff;
package com.github.rschmitt.dynamicobject; /** * A generic container for tagged Edn elements. This class preserves everything the Edn reader sees when an unknown * reader tag is encountered. */ public class Unknown { private final String tag; private final Object element; /** * For internal use ...
// Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // @SuppressWarnings("rawtypes") // public class ClojureStuff { // public static final Map EmptyMap = (Map) read("{}"); // public static final Object EmptySet = read("#{}"); // public static final Object EmptyVector = read("...
ClojureStuff.PrOn.invoke(unknown.getElement(), w);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/InstantTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.Instant; import jav...
package com.github.rschmitt.dynamicobject; public class InstantTest { @Test public void dateBuilder() { Date expected = Date.from(Instant.parse("1985-04-12T23:20:50.52Z"));
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
TimeWrapper timeWrapper = newInstance(TimeWrapper.class).date(expected);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/InstantTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.Instant; import jav...
package com.github.rschmitt.dynamicobject; public class InstantTest { @Test public void dateBuilder() { Date expected = Date.from(Instant.parse("1985-04-12T23:20:50.52Z")); TimeWrapper timeWrapper = newInstance(TimeWrapper.class).date(expected); assertEquals(expected, timeWrapper.d...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
assertEquals("{:date #inst \"1985-04-12T23:20:50.520-00:00\"}", serialize(timeWrapper));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/InstantTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.Instant; import jav...
package com.github.rschmitt.dynamicobject; public class InstantTest { @Test public void dateBuilder() { Date expected = Date.from(Instant.parse("1985-04-12T23:20:50.52Z")); TimeWrapper timeWrapper = newInstance(TimeWrapper.class).date(expected); assertEquals(expected, timeWrapper.d...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
TimeWrapper timeWrapper = deserialize(edn, TimeWrapper.class);
rschmitt/dynamic-object
src/main/java/com/github/rschmitt/dynamicobject/internal/Numerics.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Bigint = var("clojure.core/bigint"); // // Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Biginteger = var("clojure.core/biginteger");
import java.math.BigInteger; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import static com.github.rschmitt.dynamicobject.internal.ClojureStuff.Bigint; import static com.github.rschmitt.dynamicobject.internal.ClojureStuff.Biginteger;
package com.github.rschmitt.dynamicobject.internal; /* * This class deals with the numeric types that need to be converted to and from long/double/clojure.lang.BigInt. */ public class Numerics { private static final Set<Class<?>> numericTypes; private static final Map<Class<?>, Class<?>> numericConversions...
// Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Bigint = var("clojure.core/bigint"); // // Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Biginteger = var("clojure.core/biginteger"); // Path: s...
private static final Class<?> BigInt = Bigint.invoke(0).getClass();
rschmitt/dynamic-object
src/main/java/com/github/rschmitt/dynamicobject/internal/Numerics.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Bigint = var("clojure.core/bigint"); // // Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Biginteger = var("clojure.core/biginteger");
import java.math.BigInteger; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import static com.github.rschmitt.dynamicobject.internal.ClojureStuff.Bigint; import static com.github.rschmitt.dynamicobject.internal.ClojureStuff.Biginteger;
types.add(int.class); types.add(Integer.class); types.add(float.class); types.add(Float.class); types.add(short.class); types.add(Short.class); types.add(byte.class); types.add(Byte.class); types.add(BigInteger.class); numericTypes = Collec...
// Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Bigint = var("clojure.core/bigint"); // // Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Biginteger = var("clojure.core/biginteger"); // Path: s...
if (type.equals(BigInt)) return Biginteger.invoke(val);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/TestUtils.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Assoc = var("clojure.core/assoc"); // // Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final Object Default = read(":default"); // // Path: src/main/java/c...
import static com.github.rschmitt.dynamicobject.internal.ClojureStuff.Assoc; import static com.github.rschmitt.dynamicobject.internal.ClojureStuff.Default; import static com.github.rschmitt.dynamicobject.internal.ClojureStuff.EmptyMap; import static com.github.rschmitt.dynamicobject.internal.ClojureStuff.ReadString; im...
package com.github.rschmitt.dynamicobject; public class TestUtils { private static final Object readerOpts = Assoc.invoke(EmptyMap, Default, getUnknownReader()); private static Object getUnknownReader() { return new AFn() { @Override public Object invoke(Object arg1, Object a...
// Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final IFn Assoc = var("clojure.core/assoc"); // // Path: src/main/java/com/github/rschmitt/dynamicobject/internal/ClojureStuff.java // public static final Object Default = read(":default"); // // Path: src/main/java/c...
return ReadString.invoke(readerOpts, str);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/RecursionTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
package com.github.rschmitt.dynamicobject; public class RecursionTest { @BeforeEach public void setup() { try { DynamicObject.deregisterTag(LinkedList.class); } catch (NullPointerException ignore) { } } @Test public void recursion() {
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
LinkedList tail = newInstance(LinkedList.class).value(3);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/RecursionTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
package com.github.rschmitt.dynamicobject; public class RecursionTest { @BeforeEach public void setup() { try { DynamicObject.deregisterTag(LinkedList.class); } catch (NullPointerException ignore) { } } @Test public void recursion() { LinkedList tail = newIns...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
assertEquivalent("{:next {:next {:value 3}, :value 2}, :value 1}", serialize(head));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/RecursionTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
package com.github.rschmitt.dynamicobject; public class RecursionTest { @BeforeEach public void setup() { try { DynamicObject.deregisterTag(LinkedList.class); } catch (NullPointerException ignore) { } } @Test public void recursion() { LinkedList tail = newIns...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
assertEquivalent("{:next {:next {:value 3}, :value 2}, :value 1}", serialize(head));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/RecursionTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
roundTrip(tail, true); roundTrip(middle, true); roundTrip(head, true); assertEquivalent("#LinkedList{:value 3}", serialize(tail)); assertEquivalent("#LinkedList{:next #LinkedList{:value 3}, :value 2}", serialize(middle)); assertEquivalent("#LinkedList{:next #LinkedList{:...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
LinkedList obj1 = DynamicObject.deserialize("{:value 1, :next {:value 2, :next {:value 3}}}", LinkedList.class);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/RecursionTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
roundTrip(tail, false); roundTrip(middle, false); roundTrip(head, false); assertEquivalent("{:next {:next {:value 3}, :value 2}, :value 1}", serialize(head)); assertEquivalent("{:next {:value 3}, :value 2}", serialize(middle)); assertEquivalent("{:value 3}", serialize(t...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
assertEquals(linkedList, fromFressianByteArray(toFressianByteArray(linkedList)));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/RecursionTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
roundTrip(tail, false); roundTrip(middle, false); roundTrip(head, false); assertEquivalent("{:next {:next {:value 3}, :value 2}, :value 1}", serialize(head)); assertEquivalent("{:next {:value 3}, :value 2}", serialize(middle)); assertEquivalent("{:value 3}", serialize(t...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
assertEquals(linkedList, fromFressianByteArray(toFressianByteArray(linkedList)));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/MethodHandleTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // }
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.UUID; import java.util.function.BiFunction; import org.junit.jupiter.api.Test;
package com.github.rschmitt.dynamicobject; public class MethodHandleTest { private static final UUID ReceiptHandle = UUID.randomUUID(); @Test public void buildPolymorphically() { String edn = "{:command \"start the reactor\"}"; QueueMessage queueMessage = deserializeAndAttachMetadata(e...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // Path: src/test/java/com/github/rschmitt/dynamicobject/MethodHandleTest.java import static com.github.rschmitt.dynamicobjec...
T instance = deserialize(edn, type);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/ColliderTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.collider.Collider.clojureList; import static com.github.rschmitt.collider.Collider.clojureMap; import static com.github.rschmitt.collider.Collider.clojureSet; import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.Dyna...
package com.github.rschmitt.dynamicobject; public class ColliderTest { static final Batch emptyBatch = newInstance(Batch.class); static final Instant inst = Instant.parse("1985-04-12T23:20:50.52Z"); @BeforeAll public static void setup() { DynamicObject.registerTag(Batch.class, "batch"); ...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
Batch batch = deserialize("{:map {\"key\" 3}}", Batch.class);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/ColliderTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.collider.Collider.clojureList; import static com.github.rschmitt.collider.Collider.clojureMap; import static com.github.rschmitt.collider.Collider.clojureSet; import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.Dyna...
public void mapBuilders() throws Exception { ClojureMap<String, Integer> map = clojureMap("key", 3); Batch batch = emptyBatch.map2(map); assertEquals(map, batch.map()); fressianRoundTrip(batch); } @Test public void setBuilders() throws Exception { ClojureSet<In...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
Batch actual = fromFressianByteArray(toFressianByteArray(batch));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/ColliderTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.collider.Collider.clojureList; import static com.github.rschmitt.collider.Collider.clojureMap; import static com.github.rschmitt.collider.Collider.clojureSet; import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.Dyna...
public void mapBuilders() throws Exception { ClojureMap<String, Integer> map = clojureMap("key", 3); Batch batch = emptyBatch.map2(map); assertEquals(map, batch.map()); fressianRoundTrip(batch); } @Test public void setBuilders() throws Exception { ClojureSet<In...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
Batch actual = fromFressianByteArray(toFressianByteArray(batch));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/NumberTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
package com.github.rschmitt.dynamicobject; public class NumberTest { @BeforeEach public void setup() { DynamicObject.registerTag(ArbitraryPrecision.class, "ap"); } @Test public void BigDecimal() { String edn = "#ap{:bigDecimal 3.14159M}";
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
ArbitraryPrecision arbitraryPrecision = deserialize(edn, ArbitraryPrecision.class);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/NumberTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
package com.github.rschmitt.dynamicobject; public class NumberTest { @BeforeEach public void setup() { DynamicObject.registerTag(ArbitraryPrecision.class, "ap"); } @Test public void BigDecimal() { String edn = "#ap{:bigDecimal 3.14159M}"; ArbitraryPrecision arbitraryPre...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
assertEquals(edn, serialize(arbitraryPrecision));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/NumberTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
package com.github.rschmitt.dynamicobject; public class NumberTest { @BeforeEach public void setup() { DynamicObject.registerTag(ArbitraryPrecision.class, "ap"); } @Test public void BigDecimal() { String edn = "#ap{:bigDecimal 3.14159M}"; ArbitraryPrecision arbitraryPre...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
assertEquals(newInstance(ArbitraryPrecision.class).bigDecimal(new BigDecimal("3.14159")), arbitraryPrecision);
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/NumberTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
package com.github.rschmitt.dynamicobject; public class NumberTest { @BeforeEach public void setup() { DynamicObject.registerTag(ArbitraryPrecision.class, "ap"); } @Test public void BigDecimal() { String edn = "#ap{:bigDecimal 3.14159M}"; ArbitraryPrecision arbitraryPre...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
Object actual = fromFressianByteArray(toFressianByteArray(expected));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/NumberTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import stati...
package com.github.rschmitt.dynamicobject; public class NumberTest { @BeforeEach public void setup() { DynamicObject.registerTag(ArbitraryPrecision.class, "ap"); } @Test public void BigDecimal() { String edn = "#ap{:bigDecimal 3.14159M}"; ArbitraryPrecision arbitraryPre...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T fromFressianByteArray(byte[] by...
Object actual = fromFressianByteArray(toFressianByteArray(expected));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/OptionalTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static java.util.Arrays.asList; import static org.junit.jupiter.api.Assertions.assertEqual...
package com.github.rschmitt.dynamicobject; public class OptionalTest { @Test public void valuePresent() {
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
OptWrapper instance = deserialize("{:str \"value\"}", OptWrapper.class).validate();
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/OptionalTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static java.util.Arrays.asList; import static org.junit.jupiter.api.Assertions.assertEqual...
package com.github.rschmitt.dynamicobject; public class OptionalTest { @Test public void valuePresent() { OptWrapper instance = deserialize("{:str \"value\"}", OptWrapper.class).validate();
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
OptWrapper expected = newInstance(OptWrapper.class).str(Optional.of("value")).validate();
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/OptionalTest.java
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize; import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance; import static com.github.rschmitt.dynamicobject.DynamicObject.serialize; import static java.util.Arrays.asList; import static org.junit.jupiter.api.Assertions.assertEqual...
assertEquals(some.rawStr(), Optional.of("some string")); assertEquals(nothing.rawStr(), Optional.empty()); } @Test public void intPresent() { OptWrapper instance = deserialize("{:i 24601}", OptWrapper.class).validate(); OptWrapper expected = newInstance(OptWrapper.class).i(O...
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <T> T deserialize(String edn, Class<T> type) { // return EdnSerialization.deserialize(edn, type); // } // // Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java // static <D extends DynamicObject<D>> D newIns...
assertEquals(edn, serialize(instance));
rschmitt/dynamic-object
src/test/java/com/github/rschmitt/dynamicobject/MergeTest.java
// Path: src/test/java/com/github/rschmitt/dynamicobject/TestUtils.java // public static void assertEquivalent(String expected, String actual) { // assertEquals(genericRead(expected), genericRead(actual)); // }
import static com.github.rschmitt.dynamicobject.TestUtils.assertEquivalent; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test;
assertEquals("#M{:a nil}", DynamicObject.serialize(c)); } @Test public void twoFullObjects() { Mergeable a = DynamicObject.deserialize("#M{:a \"first\"}", Mergeable.class); Mergeable b = DynamicObject.deserialize("#M{:a \"second\"}", Mergeable.class); Mergeable c = a.merge(...
// Path: src/test/java/com/github/rschmitt/dynamicobject/TestUtils.java // public static void assertEquivalent(String expected, String actual) { // assertEquals(genericRead(expected), genericRead(actual)); // } // Path: src/test/java/com/github/rschmitt/dynamicobject/MergeTest.java import static com.github.rschmi...
assertEquivalent("#M{:m #M{:a \"inner\"}, :a \"outer\"}", DynamicObject.serialize(c));
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/BashSecretPatternFactoryTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import hudson.tasks.Shell; import org.jenkinsci.plugins.credentialsbinding.test.CredentialsTestUtil; import org.jenkinsci.plugins.credentialsbinding.test.Executables; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow...
/* * The MIT License * * Copyright (c) 2019 CloudBees, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, co...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
assumeThat("bash", is(executable()));
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/BashSecretPatternFactoryTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import hudson.tasks.Shell; import org.jenkinsci.plugins.credentialsbinding.test.CredentialsTestUtil; import org.jenkinsci.plugins.credentialsbinding.test.Executables; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow...
List<String> passwords = new ArrayList<>(10); for (int i = 0; i < 10; i++) { int length = random.nextInt(24) + 8; StringBuilder sb = new StringBuilder(length); for (int j = 0; j < length; j++) { // choose a (printable) character in the closed range [' ...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
j.jenkins.getDescriptorByType(Shell.DescriptorImpl.class).setShell(Executables.getPathToExecutable("bash"));
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/BashSecretPatternFactoryTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import hudson.tasks.Shell; import org.jenkinsci.plugins.credentialsbinding.test.CredentialsTestUtil; import org.jenkinsci.plugins.credentialsbinding.test.Executables; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow...
private WorkflowJob project; private String credentialsId; @BeforeClass public static void assumeBash() { assumeThat("bash", is(executable())); // due to https://github.com/jenkinsci/durable-task-plugin/blob/e75123eda986f20a390d92cc892c3d206e60aefb/src/main/java/org/jenkinsci/plugins/d...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
CredentialsTestUtil.setStringCredentials(j.jenkins, credentialsId, credentials);
jenkinsci/credentials-binding-plugin
src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/UnbindableDir.java
// Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/BindingDescriptor.java // public abstract class BindingDescriptor<C extends StandardCredentials> extends Descriptor<MultiBinding<C>> { // // protected abstract Class<C> type(); // // /** // * Determines whether this {@link MultiBinding} need...
import java.io.IOException; import java.util.UUID; import edu.umd.cs.findbugs.annotations.NonNull; import org.jenkinsci.plugins.credentialsbinding.BindingDescriptor; import org.jenkinsci.plugins.credentialsbinding.MultiBinding.Unbinder; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExte...
package org.jenkinsci.plugins.credentialsbinding.impl; /** * Convenience class for creating a secure temporary directory dedicated to writing credentials file(s), and getting a * corresponding {@link Unbinder} instance. */ public class UnbindableDir { private final FilePath dirPath;
// Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/BindingDescriptor.java // public abstract class BindingDescriptor<C extends StandardCredentials> extends Descriptor<MultiBinding<C>> { // // protected abstract Class<C> type(); // // /** // * Determines whether this {@link MultiBinding} need...
private final Unbinder unbinder;
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/AlmquistShellSecretPatternFactoryTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import hudson.tasks.Shell; import org.jenkinsci.plugins.credentialsbinding.test.CredentialsTestUtil; import org.jenkinsci.plugins.credentialsbinding.test.Executables; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow...
public static final @DataPoint String ANOTHER_SAMPLE_PASSWORD = "a'b\"c\\d(e)#"; public static final @DataPoint String ONE_MORE = "'\"'(foo)'\"'"; public static final @DataPoint String FULL_ASCII = "!\"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\\]^_ `abcdefghijklmno pqrstuvwxyz{|}~"; ...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
assumeThat("ash", is(executable()));
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/AlmquistShellSecretPatternFactoryTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import hudson.tasks.Shell; import org.jenkinsci.plugins.credentialsbinding.test.CredentialsTestUtil; import org.jenkinsci.plugins.credentialsbinding.test.Executables; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow...
for (int i = 0; i < 10; i++) { int length = random.nextInt(24) + 8; StringBuilder sb = new StringBuilder(length); for (int j = 0; j < length; j++) { // choose a (printable) character in the closed range [' ', '~'] // 0x7f is DEL, 0x7e is ~, and...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
j.jenkins.getDescriptorByType(Shell.DescriptorImpl.class).setShell(Executables.getPathToExecutable("ash"));
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/AlmquistShellSecretPatternFactoryTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import hudson.tasks.Shell; import org.jenkinsci.plugins.credentialsbinding.test.CredentialsTestUtil; import org.jenkinsci.plugins.credentialsbinding.test.Executables; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow...
public static void assumeAsh() { // ash = Almquist shell, default one used in Alpine assumeThat("ash", is(executable())); // due to https://github.com/jenkinsci/durable-task-plugin/blob/e75123eda986f20a390d92cc892c3d206e60aefb/src/main/java/org/jenkinsci/plugins/durabletask/BourneShellScript...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
CredentialsTestUtil.setStringCredentials(j.jenkins, credentialsId, credentials);
jenkinsci/credentials-binding-plugin
src/main/java/org/jenkinsci/plugins/credentialsbinding/MultiBinding.java
// Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/CredentialNotFoundException.java // public class CredentialNotFoundException extends AbortException { // public CredentialNotFoundException(String message) { // super(message); // } // }
import com.cloudbees.plugins.credentials.CredentialsProvider; import com.cloudbees.plugins.credentials.common.IdCredentials; import com.cloudbees.plugins.credentials.common.StandardCredentials; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; import hudson.ExtensionPoint;...
/* * The MIT License * * Copyright 2015 Jesse Glick. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, mod...
// Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/CredentialNotFoundException.java // public class CredentialNotFoundException extends AbortException { // public CredentialNotFoundException(String message) { // super(message); // } // } // Path: src/main/java/org/jenkinsci/plugins/c...
public /*abstract*/ Set<String> variables(@NonNull Run<?,?> build) throws CredentialNotFoundException {
jenkinsci/credentials-binding-plugin
src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/ZipFileBinding.java
// Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/BindingDescriptor.java // public abstract class BindingDescriptor<C extends StandardCredentials> extends Descriptor<MultiBinding<C>> { // // protected abstract Class<C> type(); // // /** // * Determines whether this {@link MultiBinding} need...
import hudson.util.FormValidation; import java.io.IOException; import java.io.InputStream; import java.util.Collections; import jenkins.model.Jenkins; import org.apache.commons.io.IOUtils; import org.jenkinsci.Symbol; import org.jenkinsci.plugins.credentialsbinding.BindingDescriptor; import org.jenkinsci.plugins.plainc...
/* * The MIT License * * Copyright 2013 jglick. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, ...
// Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/BindingDescriptor.java // public abstract class BindingDescriptor<C extends StandardCredentials> extends Descriptor<MultiBinding<C>> { // // protected abstract Class<C> type(); // // /** // * Determines whether this {@link MultiBinding} need...
@Extension public static class DescriptorImpl extends BindingDescriptor<FileCredentials> {
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/BatchSecretPatternFactoryTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; import java.io.IOException; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assume.assumeTrue; import hudson.Functions; im...
/* * The MIT License * * Copyright (c) 2019 CloudBees, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, co...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
this.credentialId = CredentialsTestUtil.registerStringCredentials(j.jenkins, password);
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/BashSecretPatternFactory2Test.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.For; import org.jvnet.hudson.test.JenkinsRule; import static org.hamcrest.Matchers.is; import static org.jenkinsci.plugins.credentialsbinding.test.Executables.executable; import static org.junit.Assume.assumeThat; import...
/* * The MIT License * * Copyright (c) 2019 CloudBees, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, co...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
assumeThat("bash", is(executable()));
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/BashSecretPatternFactory2Test.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.For; import org.jvnet.hudson.test.JenkinsRule; import static org.hamcrest.Matchers.is; import static org.jenkinsci.plugins.credentialsbinding.test.Executables.executable; import static org.junit.Assume.assumeThat; import...
/* * The MIT License * * Copyright (c) 2019 CloudBees, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, co...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
j.jenkins.getDescriptorByType(Shell.DescriptorImpl.class).setShell(Executables.getPathToExecutable("bash"));
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/BashSecretPatternFactory2Test.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.For; import org.jvnet.hudson.test.JenkinsRule; import static org.hamcrest.Matchers.is; import static org.jenkinsci.plugins.credentialsbinding.test.Executables.executable; import static org.junit.Assume.assumeThat; import...
/* * The MIT License * * Copyright (c) 2019 CloudBees, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, co...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
String credentialsId = CredentialsTestUtil.registerStringCredentials(j.jenkins, password);
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/PowerShellMaskerProviderTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; import java.io.IOException; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.jenkinsci.plugins.credentialsbinding.test.Executables.execut...
/* * The MIT License * * Copyright (c) 2019 CloudBees, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, co...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
assumeThat("powershell", is(executable()));
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/PowerShellMaskerProviderTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; import java.io.IOException; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.jenkinsci.plugins.credentialsbinding.test.Executables.execut...
/* * The MIT License * * Copyright (c) 2019 CloudBees, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, co...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
this.credentialId = CredentialsTestUtil.registerStringCredentials(j.jenkins, password);
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/BourneShellSecretPatternFactoryTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import org.jenkinsci.plugins.credentialsbinding.test.CredentialsTestUtil; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow.job.WorkflowRun; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rul...
/* * The MIT License * * Copyright (c) 2019 CloudBees, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, co...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
assumeThat("sh", is(executable()));
jenkinsci/credentials-binding-plugin
src/test/java/org/jenkinsci/plugins/credentialsbinding/masking/BourneShellSecretPatternFactoryTest.java
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
import org.jenkinsci.plugins.credentialsbinding.test.CredentialsTestUtil; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow.job.WorkflowRun; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rul...
@Rule public JenkinsRule j = new JenkinsRule(); private WorkflowJob project; private String credentialsId; @BeforeClass public static void assumeBash() { assumeThat("sh", is(executable())); // due to https://github.com/jenkinsci/durable-task-plugin/blob/e75123eda986f20a390d92cc892c...
// Path: src/test/java/org/jenkinsci/plugins/credentialsbinding/test/CredentialsTestUtil.java // public class CredentialsTestUtil { // // /** // * Registers the given value as a {@link StringCredentials} into the default {@link CredentialsProvider}. // * Returns the generated credential id for the regist...
CredentialsTestUtil.setStringCredentials(j.jenkins, credentialsId, credentials);
jenkinsci/credentials-binding-plugin
src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/FileBinding.java
// Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/BindingDescriptor.java // public abstract class BindingDescriptor<C extends StandardCredentials> extends Descriptor<MultiBinding<C>> { // // protected abstract Class<C> type(); // // /** // * Determines whether this {@link MultiBinding} need...
import hudson.model.TaskListener; import java.io.IOException; import org.jenkinsci.Symbol; import org.jenkinsci.plugins.credentialsbinding.BindingDescriptor; import org.jenkinsci.plugins.plaincredentials.FileCredentials; import org.kohsuke.stapler.DataBoundConstructor; import edu.umd.cs.findbugs.annotations.NonNull; im...
FilePath secret = dir.child(credentials.getFileName()); secret.copyFrom(credentials.getContent()); secret.chmod(0400); return secret; } @SuppressWarnings("unused") @Deprecated private static class UnbinderImpl implements Unbinder { private static final long seria...
// Path: src/main/java/org/jenkinsci/plugins/credentialsbinding/BindingDescriptor.java // public abstract class BindingDescriptor<C extends StandardCredentials> extends Descriptor<MultiBinding<C>> { // // protected abstract Class<C> type(); // // /** // * Determines whether this {@link MultiBinding} need...
@Extension public static class DescriptorImpl extends BindingDescriptor<FileCredentials> {
nutritionfactsorg/daily-dozen-android
app/src/main/java/org/nutritionfacts/dailydozen/view/TimeScaleSelector.java
// Path: app/src/main/java/org/nutritionfacts/dailydozen/controller/Bus.java // public class Bus { // public static void register(Object object) { // final EventBus bus = EventBus.getDefault(); // if (!bus.isRegistered(object)) { // bus.register(object); // } // } // // ...
import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.LinearLayout; import org.nutritionfacts.dailydozen.R; import org.nutritionfacts.dailydozen.controll...
@TimeScale.Interface public int getSelectedTimeScale() { switch (binding.timeScaleSpinner.getSelectedItemPosition()) { case TimeScale.MONTHS: return TimeScale.MONTHS; case TimeScale.YEARS: return TimeScale.YEARS; default: ca...
// Path: app/src/main/java/org/nutritionfacts/dailydozen/controller/Bus.java // public class Bus { // public static void register(Object object) { // final EventBus bus = EventBus.getDefault(); // if (!bus.isRegistered(object)) { // bus.register(object); // } // } // // ...
Bus.timeScaleSelected(binding.timeScaleSpinner.getSelectedItemPosition());
nutritionfactsorg/daily-dozen-android
app/src/main/java/org/nutritionfacts/dailydozen/model/pref/UpdateReminderPref.java
// Path: app/src/main/java/org/nutritionfacts/dailydozen/util/DateUtil.java // public class DateUtil { // public static Calendar getCalendarForYearMonthAndDay(final int year, // final int monthOneBased, // ...
import android.content.Context; import android.text.TextUtils; import androidx.annotation.NonNull; import com.google.gson.annotations.SerializedName; import org.nutritionfacts.dailydozen.util.DateUtil; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arra...
package org.nutritionfacts.dailydozen.model.pref; public class UpdateReminderPref { // The default Update Reminder notification displays at 8pm @SerializedName("hourOfDay") private int hourOfDay = 20; // Default to 8pm @SerializedName("minute") private int minute = 0; @SerializedName("rem...
// Path: app/src/main/java/org/nutritionfacts/dailydozen/util/DateUtil.java // public class DateUtil { // public static Calendar getCalendarForYearMonthAndDay(final int year, // final int monthOneBased, // ...
reminderTimesSet.add(DateUtil.formatTime(context, hourOfDay, minute));
nutritionfactsorg/daily-dozen-android
app/src/main/java/org/nutritionfacts/dailydozen/model/Day.java
// Path: app/src/main/java/org/nutritionfacts/dailydozen/exception/InvalidDateException.java // public class InvalidDateException extends Exception { // private final String invalidDateString; // // public InvalidDateException(String invalidDateString) { // this.invalidDateString = invalidDateString; /...
import android.text.TextUtils; import androidx.annotation.NonNull; import com.activeandroid.annotation.Column; import com.activeandroid.annotation.Table; import com.activeandroid.query.Select; import org.nutritionfacts.dailydozen.exception.InvalidDateException; import java.util.ArrayList; import java.util.Collections; ...
// NOTE: This method used to be the following line. However, because of a bug in Caldroid, I had to // change the implementation to return a DateTime with 0 in the time fields instead of null otherwise the // food servings history chart would not show events. // return DateTime.forDateOn...
// Path: app/src/main/java/org/nutritionfacts/dailydozen/exception/InvalidDateException.java // public class InvalidDateException extends Exception { // private final String invalidDateString; // // public InvalidDateException(String invalidDateString) { // this.invalidDateString = invalidDateString; /...
public static Day getByDate(String dateString) throws InvalidDateException {
nutritionfactsorg/daily-dozen-android
app/src/main/java/org/nutritionfacts/dailydozen/adapter/DailyReminderAdapter.java
// Path: app/src/main/java/org/nutritionfacts/dailydozen/controller/Bus.java // public class Bus { // public static void register(Object object) { // final EventBus bus = EventBus.getDefault(); // if (!bus.isRegistered(object)) { // bus.register(object); // } // } // // ...
import android.view.LayoutInflater; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import org.nutritionfacts.dailydozen.controller.Bus; import org.nutritionfacts.dailydozen.databinding.ReminderTimeBinding; import java....
@Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { return new ViewHolder(ReminderTimeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); } @Override public void onBindViewHolder(@NonNull ViewHolder holder, int position) { ...
// Path: app/src/main/java/org/nutritionfacts/dailydozen/controller/Bus.java // public class Bus { // public static void register(Object object) { // final EventBus bus = EventBus.getDefault(); // if (!bus.isRegistered(object)) { // bus.register(object); // } // } // // ...
binding.reminderDelete.setOnClickListener(v -> Bus.reminderRemovedEvent(getAdapterPosition()));
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/BaseOutputDialog.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/TaskType.java // public enum TaskType { // /** // * Indicates the task should only overwrite preferences if the file's // * modification date is earlier than the changes. // */ // LASTMOD, // // /** // * I...
import java.io.File; import java.util.Arrays; import java.util.EnumSet; import java.util.Set; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogSettings; import ...
protected boolean isResizable() { return true; } // TODO: zorzella says: I don't think this overload is doing anything at all. // I refactored it to stop growing upon every invocation, but the whole bit // about "new Point(p.x, p.y * 3 / 2);" which, on face value, seems like an // attempt to make the d...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/TaskType.java // public enum TaskType { // /** // * Indicates the task should only overwrite preferences if the file's // * modification date is earlier than the changes. // */ // LASTMOD, // // /** // * I...
IDialogSettings settings = MechanicPlugin.getDefault().getDialogSettings();
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/BaseOutputDialog.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/TaskType.java // public enum TaskType { // /** // * Indicates the task should only overwrite preferences if the file's // * modification date is earlier than the changes. // */ // LASTMOD, // // /** // * I...
import java.io.File; import java.util.Arrays; import java.util.EnumSet; import java.util.Set; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogSettings; import ...
protected Text createTextBox(Composite parent) { Text text = new Text(parent, SWT.SINGLE | SWT.BORDER); text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); text.addModifyListener(validateOnChange); return text; } @Override protected Control createDialogArea(Composite par...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/TaskType.java // public enum TaskType { // /** // * Indicates the task should only overwrite preferences if the file's // * modification date is earlier than the changes. // */ // LASTMOD, // // /** // * I...
Preconditions.checkState(TaskType.values()[0] == TaskType.LASTMOD);
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyboardBindingsScanner.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java // public class ListCollector<T> implements ICollector<T> { // private final List<T> list = Lists.newArrayList(); // // public static <T> ListCollector<T> create() { // return new ListCollector<T>(); // } /...
import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.logging.Logger; import com.google.eclipse.mechanic.ListCollector; import com.google.eclipse.mechanic.ResourceTaskScanner; i...
/******************************************************************************* * Copyright (C) 2010, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java // public class ListCollector<T> implements ICollector<T> { // private final List<T> list = Lists.newArrayList(); // // public static <T> ListCollector<T> create() { // return new ListCollector<T>(); // } /...
public void scan(IResourceTaskProvider source, TaskCollector collector) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyboardBindingsScanner.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java // public class ListCollector<T> implements ICollector<T> { // private final List<T> list = Lists.newArrayList(); // // public static <T> ListCollector<T> create() { // return new ListCollector<T>(); // } /...
import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.logging.Logger; import com.google.eclipse.mechanic.ListCollector; import com.google.eclipse.mechanic.ResourceTaskScanner; i...
/******************************************************************************* * Copyright (C) 2010, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java // public class ListCollector<T> implements ICollector<T> { // private final List<T> list = Lists.newArrayList(); // // public static <T> ListCollector<T> create() { // return new ListCollector<T>(); // } /...
public void scan(IResourceTaskProvider source, TaskCollector collector) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyboardBindingsScanner.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java // public class ListCollector<T> implements ICollector<T> { // private final List<T> list = Lists.newArrayList(); // // public static <T> ListCollector<T> create() { // return new ListCollector<T>(); // } /...
import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.logging.Logger; import com.google.eclipse.mechanic.ListCollector; import com.google.eclipse.mechanic.ResourceTaskScanner; i...
/******************************************************************************* * Copyright (C) 2010, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java // public class ListCollector<T> implements ICollector<T> { // private final List<T> list = Lists.newArrayList(); // // public static <T> ListCollector<T> create() { // return new ListCollector<T>(); // } /...
ListCollector<IResourceTaskReference> taskCollector = ListCollector.create();
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyboardBindingsScanner.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java // public class ListCollector<T> implements ICollector<T> { // private final List<T> list = Lists.newArrayList(); // // public static <T> ListCollector<T> create() { // return new ListCollector<T>(); // } /...
import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.logging.Logger; import com.google.eclipse.mechanic.ListCollector; import com.google.eclipse.mechanic.ResourceTaskScanner; i...
/******************************************************************************* * Copyright (C) 2010, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ListCollector.java // public class ListCollector<T> implements ICollector<T> { // private final List<T> list = Lists.newArrayList(); // // public static <T> ListCollector<T> create() { // return new ListCollector<T>(); // } /...
ListCollector<IResourceTaskReference> taskCollector = ListCollector.create();
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyBindings.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
import com.google.common.base.Objects; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action; import com.google.eclipse.m...
* Creates a new instance from a defined set of bindings. */ public KeyBindings(Binding[] bindings) { this(MechanicLog.getDefault(), bindings); } KeyBindings(MechanicLog log, Binding[] bindings) { this.log = log; List<Binding> ub = new ArrayList<Binding>(); List<Binding> sb = new ArrayList...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
qualifierForBinding(binding, Action.ADD),
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/SimpleExtensionPointManager.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/MechanicPlugin.java // public class MechanicPlugin extends AbstractUIPlugin { // // // The plug-in ID // public static final String PLUGIN_ID = "com.google.eclipse.mechanic"; // // // The shared instance // private...
import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoin...
/******************************************************************************* * Copyright (C) 2014, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/MechanicPlugin.java // public class MechanicPlugin extends AbstractUIPlugin { // // // The plug-in ID // public static final String PLUGIN_ID = "com.google.eclipse.mechanic"; // // // The shared instance // private...
MechanicPlugin.PLUGIN_ID, extensionPointName);
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyBindingsModel.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
import java.util.List; import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action; import c...
/******************************************************************************* * Copyright (C) 2010, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
return source.getAction() == Action.ADD;
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/DirectoryOrUrlEditor.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/ResourceTaskProviderParser.java // public class ResourceTaskProviderParser { // // private static final Gson gson = new Gson(); // // private final Function<String, String> variableParser; // // /** // * Create a ne...
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.preference.ListEditor; import org.eclipse.swt.widgets.Composite; import com.google.eclipse.mechanic.internal.ResourceTaskProviderParser; import com.google.eclipse.mechanic.internal.VariableManagerStringParser;
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/ResourceTaskProviderParser.java // public class ResourceTaskProviderParser { // // private static final Gson gson = new Gson(); // // private final Function<String, String> variableParser; // // /** // * Create a ne...
new ResourceTaskProviderParser(VariableManagerStringParser.INSTANCE);
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/CompositeResourceTaskProvider.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
import java.util.Collection; import java.util.List; import com.google.common.collect.ImmutableList; import com.google.eclipse.mechanic.ICollector; import com.google.eclipse.mechanic.IResourceTaskProvider; import com.google.eclipse.mechanic.IResourceTaskReference;
package com.google.eclipse.mechanic.internal; /** * Collects from multiple task providers in one go. */ public class CompositeResourceTaskProvider implements IResourceTaskProvider { private final List<IResourceTaskProvider> providers; public CompositeResourceTaskProvider(Collection<IResourceTaskProvider> pro...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
ICollector<IResourceTaskReference> collector) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/CompositeResourceTaskProvider.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
import java.util.Collection; import java.util.List; import com.google.common.collect.ImmutableList; import com.google.eclipse.mechanic.ICollector; import com.google.eclipse.mechanic.IResourceTaskProvider; import com.google.eclipse.mechanic.IResourceTaskReference;
package com.google.eclipse.mechanic.internal; /** * Collects from multiple task providers in one go. */ public class CompositeResourceTaskProvider implements IResourceTaskProvider { private final List<IResourceTaskProvider> providers; public CompositeResourceTaskProvider(Collection<IResourceTaskProvider> pro...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
ICollector<IResourceTaskReference> collector) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/FileTaskProvider.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; import com.google.common.annotations.VisibleForTesting; import com.google.commo...
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
public final class TaskReference implements IResourceTaskReference {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/FileTaskProvider.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; import com.google.common.annotations.VisibleForTesting; import com.google.commo...
} @VisibleForTesting static FileTaskProvider newInstance(File dir, Properties properties) throws IOException { Preconditions.checkNotNull(dir); FileTaskProvider instance = new FileTaskProvider(dir, properties); instance.validateInitialization(); return instance; } /** * REMOVE as we move...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
String localPath, String filter, ICollector<IResourceTaskReference> collector) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/FileTaskProvider.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; import com.google.common.annotations.VisibleForTesting; import com.google.commo...
return dir; } private void validateInitialization() throws IOException { if (!dir.exists()) { throw new FileNotFoundException( String.format("Directory '%s' does not exist.", dir)); } if (!dir.canRead()) { throw new IOException( String.format("Directory '%s' is not r...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
SuffixFileFilter filter = new SuffixFileFilter(filterText);
alfsch/workspacemechanic
parent/examples/com.google.eclipse.mechanic.samples/src/com/google/eclipse/mechanic/samples/InMemoryTaskProvider.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Map; import com.google.common.base.Joiner; import com.google.common.collect.Maps; import com.google.common.hash.Hashing; import com.google.common.io.ByteStreams; import com.google.common.io...
/******************************************************************************* * Copyright (C) 2014, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
ICollector<IResourceTaskReference> collector) {
alfsch/workspacemechanic
parent/examples/com.google.eclipse.mechanic.samples/src/com/google/eclipse/mechanic/samples/InMemoryTaskProvider.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Map; import com.google.common.base.Joiner; import com.google.common.collect.Maps; import com.google.common.hash.Hashing; import com.google.common.io.ByteStreams; import com.google.common.io...
/******************************************************************************* * Copyright (C) 2014, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/ICollector.java // public interface ICollector<T> { // /** // * Add a element to the collector. // */ // void collect(T element); // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IRe...
ICollector<IResourceTaskReference> collector) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/UserChoiceDecisionProvider.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Task.java // public interface Task { // // /** // * Return an id for this task. The id should be unique to any instance that // * behaves differently than another instance. Typically the id would be the // * fully qualified ...
import com.google.eclipse.mechanic.Task; import com.google.eclipse.mechanic.RepairDecisionProvider; import org.eclipse.ui.IWorkbenchWindow; import java.util.Collections; import java.util.List; import java.util.Map;
/******************************************************************************* * Copyright (C) 2009, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Task.java // public interface Task { // // /** // * Return an id for this task. The id should be unique to any instance that // * behaves differently than another instance. Typically the id would be the // * fully qualified ...
private Map<Task, RepairDecisionProvider.Decision> decisions
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/recorder/PreferenceRecorder.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/MechanicPlugin.java // public class MechanicPlugin extends AbstractUIPlugin { // // // The plug-in ID // public static final String PLUGIN_ID = "com.google.eclipse.mechanic"; // // // The shared instance // private...
import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.google.eclipse.mechanic.plugin.core.MechanicPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import...
private List<PreferenceChange> changeLog = Lists.newArrayList(); /** * Starts the process of recording changes to the eclipse preference tree. * Recording may only occur once per recorder. * * @throws CoreException if there is a problem with the preference tree * itself. * @throws Illega...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/MechanicPlugin.java // public class MechanicPlugin extends AbstractUIPlugin { // // // The plug-in ID // public static final String PLUGIN_ID = "com.google.eclipse.mechanic"; // // // The shared instance // private...
throw new CoreException(new Status(IStatus.ERROR, MechanicPlugin.PLUGIN_ID,
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSetQualifier.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action;
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
Action.fromLabel(actionLabel));
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/ExtensionPointScanner.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/CompositeTaskInterface.java // public interface CompositeTaskInterface extends Task, Evaluator, RepairAction { // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/TaskCollector.java // public int...
import java.util.List; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Supplier; import com.google.eclipse.mechanic.CompositeTaskInterface; import com.google.eclipse.mechanic.TaskCollector; import com.google.eclipse.mechanic.TaskScanner;
/******************************************************************************* * Copyright (C) 2009, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/CompositeTaskInterface.java // public interface CompositeTaskInterface extends Task, Evaluator, RepairAction { // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/TaskCollector.java // public int...
public void scan(TaskCollector collector) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/StateSensitiveCache.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IMechanicService.java // public interface IMechanicService { // // /** // * Causes the scannning service to start as soon as possible. // */ // void start(); // // /** // * Causes the scanning service to stop scanning. ...
import java.io.IOException; import java.io.InputStream; import java.net.URI; import com.google.common.base.Preconditions; import com.google.eclipse.mechanic.IMechanicService; import com.google.eclipse.mechanic.IStatusChangeListener; import com.google.eclipse.mechanic.MechanicStatus; import com.google.eclipse.mechanic.S...
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IMechanicService.java // public interface IMechanicService { // // /** // * Causes the scannning service to start as soon as possible. // */ // void start(); // // /** // * Causes the scanning service to stop scanning. ...
private final IStatusChangeListener statusChangeListener;
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/StateSensitiveCache.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IMechanicService.java // public interface IMechanicService { // // /** // * Causes the scannning service to start as soon as possible. // */ // void start(); // // /** // * Causes the scanning service to stop scanning. ...
import java.io.IOException; import java.io.InputStream; import java.net.URI; import com.google.common.base.Preconditions; import com.google.eclipse.mechanic.IMechanicService; import com.google.eclipse.mechanic.IStatusChangeListener; import com.google.eclipse.mechanic.MechanicStatus; import com.google.eclipse.mechanic.S...
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IMechanicService.java // public interface IMechanicService { // // /** // * Causes the scannning service to start as soon as possible. // */ // void start(); // // /** // * Causes the scanning service to stop scanning. ...
public void statusChanged(StatusChangedEvent event) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/StateSensitiveCache.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IMechanicService.java // public interface IMechanicService { // // /** // * Causes the scannning service to start as soon as possible. // */ // void start(); // // /** // * Causes the scanning service to stop scanning. ...
import java.io.IOException; import java.io.InputStream; import java.net.URI; import com.google.common.base.Preconditions; import com.google.eclipse.mechanic.IMechanicService; import com.google.eclipse.mechanic.IStatusChangeListener; import com.google.eclipse.mechanic.MechanicStatus; import com.google.eclipse.mechanic.S...
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IMechanicService.java // public interface IMechanicService { // // /** // * Causes the scannning service to start as soon as possible. // */ // void start(); // // /** // * Causes the scanning service to stop scanning. ...
if (event.getStatus() == MechanicStatus.UPDATING) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/IMechanicPreferences.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskProvider.java // public interface IResourceTaskProvider { // /** // * Collect task references provided by this provider. // * // * <p>In theory this is similar to calling // * {@code collectTaskReferences(".",...
import com.google.eclipse.mechanic.IResourceTaskProvider; import com.google.eclipse.mechanic.Task; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Preferences.IPropertyChangeListener; import java.util.List; import java.util.Set;
/******************************************************************************* * Copyright (C) 2007, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskProvider.java // public interface IResourceTaskProvider { // /** // * Collect task references provided by this provider. // * // * <p>In theory this is similar to calling // * {@code collectTaskReferences(".",...
List<IResourceTaskProvider> getTaskProviders();
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/IMechanicPreferences.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskProvider.java // public interface IResourceTaskProvider { // /** // * Collect task references provided by this provider. // * // * <p>In theory this is similar to calling // * {@code collectTaskReferences(".",...
import com.google.eclipse.mechanic.IResourceTaskProvider; import com.google.eclipse.mechanic.Task; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Preferences.IPropertyChangeListener; import java.util.List; import java.util.Set;
/******************************************************************************* * Copyright (C) 2007, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskProvider.java // public interface IResourceTaskProvider { // /** // * Collect task references provided by this provider. // * // * <p>In theory this is similar to calling // * {@code collectTaskReferences(".",...
void blockItem(Task item);
alfsch/workspacemechanic
parent/tests/com.google.eclipse.mechanic.tests/src/com/google/eclipse/mechanic/plugin/core/MechanicPreferencesTest.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Evaluator.java // public interface Evaluator { // // /** // * @return true if the environment adheres to this test. // */ // public boolean evaluate(); // // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/...
import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; import junit.framework.TestCase; import com.google.eclipse.mechanic.Evaluator; import com.google.eclipse.mechanic.RepairAction; import com.google.eclipse.mechanic.Task; import com.google.eclipse.mechanic.internal....
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Evaluator.java // public interface Evaluator { // // /** // * @return true if the environment adheres to this test. // */ // public boolean evaluate(); // // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/...
private final IMechanicPreferences mechanicPreferences = new MechanicPreferences();
alfsch/workspacemechanic
parent/tests/com.google.eclipse.mechanic.tests/src/com/google/eclipse/mechanic/plugin/core/MechanicPreferencesTest.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Evaluator.java // public interface Evaluator { // // /** // * @return true if the environment adheres to this test. // */ // public boolean evaluate(); // // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/...
import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; import junit.framework.TestCase; import com.google.eclipse.mechanic.Evaluator; import com.google.eclipse.mechanic.RepairAction; import com.google.eclipse.mechanic.Task; import com.google.eclipse.mechanic.internal....
assertEquals(0, mechanicPreferences.getLong(pref)); mechanicPreferences.setLong(pref, 1); assertEquals(1, mechanicPreferences.getLong(pref)); mechanicPreferences.setLong(pref, Long.MAX_VALUE); assertEquals(Long.MAX_VALUE, mechanicPreferences.getLong(pref)); } public void testGetTaskDirectories(...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Evaluator.java // public interface Evaluator { // // /** // * @return true if the environment adheres to this test. // */ // public boolean evaluate(); // // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/...
private Task createTask(final String id) {
alfsch/workspacemechanic
parent/tests/com.google.eclipse.mechanic.tests/src/com/google/eclipse/mechanic/plugin/core/MechanicPreferencesTest.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Evaluator.java // public interface Evaluator { // // /** // * @return true if the environment adheres to this test. // */ // public boolean evaluate(); // // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/...
import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; import junit.framework.TestCase; import com.google.eclipse.mechanic.Evaluator; import com.google.eclipse.mechanic.RepairAction; import com.google.eclipse.mechanic.Task; import com.google.eclipse.mechanic.internal....
public void testContains() { String pref = "XYZPDQ"; assertFalse(mechanicPreferences.contains(pref)); mechanicPreferences.setLong(pref, 1L); assertTrue(mechanicPreferences.contains(pref)); setToDefault(pref); assertFalse(mechanicPreferences.contains(pref)); } //public static int getThread...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Evaluator.java // public interface Evaluator { // // /** // * @return true if the environment adheres to this test. // */ // public boolean evaluate(); // // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/...
public Evaluator getEvaluator() {
alfsch/workspacemechanic
parent/tests/com.google.eclipse.mechanic.tests/src/com/google/eclipse/mechanic/plugin/core/MechanicPreferencesTest.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Evaluator.java // public interface Evaluator { // // /** // * @return true if the environment adheres to this test. // */ // public boolean evaluate(); // // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/...
import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; import junit.framework.TestCase; import com.google.eclipse.mechanic.Evaluator; import com.google.eclipse.mechanic.RepairAction; import com.google.eclipse.mechanic.Task; import com.google.eclipse.mechanic.internal....
assertTrue(mechanicPreferences.contains(pref)); setToDefault(pref); assertFalse(mechanicPreferences.contains(pref)); } //public static int getThreadSleepSeconds() { //public static String doVariableSubstitution(String input) { //public static IStatus validatePreferencesFile(IPath path) { /** ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Evaluator.java // public interface Evaluator { // // /** // * @return true if the environment adheres to this test. // */ // public boolean evaluate(); // // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/...
public RepairAction getRepairAction() {
alfsch/workspacemechanic
parent/tests/com.google.eclipse.mechanic.tests/src/com/google/eclipse/mechanic/plugin/ui/TaskResourceValidatorTest.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/TaskResourceValidator.java // class TaskResourceValidator implements IInputValidator { // static final String PATH_DOES_NOT_EXIST = "The specified path does not exist."; // static final String NOT_A_DIRECTORY = "Not a dire...
import java.io.File; import java.io.IOException; import junit.framework.TestCase; import com.google.eclipse.mechanic.tests.internal.RunAsJUnitTest; import static com.google.eclipse.mechanic.plugin.ui.TaskResourceValidator.*;
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/TaskResourceValidator.java // class TaskResourceValidator implements IInputValidator { // static final String PATH_DOES_NOT_EXIST = "The specified path does not exist."; // static final String NOT_A_DIRECTORY = "Not a dire...
private static final TaskResourceValidator ALL_VALIDATOR = new TaskResourceValidator(true);
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/recorder/PreferenceRecordingService.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/MechanicPlugin.java // public class MechanicPlugin extends AbstractUIPlugin { // // // The plug-in ID // public static final String PLUGIN_ID = "com.google.eclipse.mechanic"; // // // The shared instance // private...
import com.google.eclipse.mechanic.plugin.core.MechanicPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status;
/******************************************************************************* * Copyright (C) 2010, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/MechanicPlugin.java // public class MechanicPlugin extends AbstractUIPlugin { // // // The plug-in ID // public static final String PLUGIN_ID = "com.google.eclipse.mechanic"; // // // The shared instance // private...
MechanicPlugin.PLUGIN_ID,
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/EclBinding.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.collect.Iterables; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action; import com.google.eclipse.mechanic.core.keybinding.KeyBindingsManualFormatter.BindingType; import org.eclipse.core.commands.P...
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
private final BindingType type;
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/EclBinding.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.collect.Iterables; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action; import com.google.eclipse.mechanic.core.keybinding.KeyBindingsManualFormatter.BindingType; import org.eclipse.core.commands.P...
if (!(obj instanceof EclBinding)) { return false; } EclBinding that = (EclBinding)obj; return Objects.equal(this.cid, that.cid) && Objects.equal(this.contextId, that.contextId) && Objects.equal(this.keySequence, that.keySequence) && Objects.equal(this.paramMap, that.paramMa...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
public KbaChangeSetQualifier with(Action action) {
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/MechanicDialog.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Task.java // public interface Task { // // /** // * Return an id for this task. The id should be unique to any instance that // * behaves differently than another instance. Typically the id would be the // * fully qualified ...
import com.google.eclipse.mechanic.Task; import com.google.eclipse.mechanic.RepairDecisionProvider.Decision; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAda...
/******************************************************************************* * Copyright (C) 2007, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Task.java // public interface Task { // // /** // * Return an id for this task. The id should be unique to any instance that // * behaves differently than another instance. Typically the id would be the // * fully qualified ...
private final List<Task> items;
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/MechanicDialog.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Task.java // public interface Task { // // /** // * Return an id for this task. The id should be unique to any instance that // * behaves differently than another instance. Typically the id would be the // * fully qualified ...
import com.google.eclipse.mechanic.Task; import com.google.eclipse.mechanic.RepairDecisionProvider.Decision; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAda...
/******************************************************************************* * Copyright (C) 2007, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Task.java // public interface Task { // // /** // * Return an id for this task. The id should be unique to any instance that // * behaves differently than another instance. Typically the id would be the // * fully qualified ...
private final Map<Task, Decision> userTaskChoices;
alfsch/workspacemechanic
parent/tests/com.google.eclipse.mechanic.tests/src/com/google/eclipse/mechanic/core/keybinding/KeyBindingsManualFormatterTest.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.KbaBindingList; import com.google.eclipse.mechanic.core.ke...
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
Action.ADD.toString());
alfsch/workspacemechanic
parent/tests/com.google.eclipse.mechanic.tests/src/com/google/eclipse/mechanic/core/keybinding/KeyBindingsManualFormatterTest.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.KbaBindingList; import com.google.eclipse.mechanic.core.ke...
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
Map<KbaChangeSetQualifier, KbaChangeSet> map = kbaMap(new KbaBindingList(
alfsch/workspacemechanic
parent/tests/com.google.eclipse.mechanic.tests/src/com/google/eclipse/mechanic/core/keybinding/KeyBindingsManualFormatterTest.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action; import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.KbaBindingList; import com.google.eclipse.mechanic.core.ke...
/******************************************************************************* * Copyright (C) 2011, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java // enum Action { // ADD("add"), // REMOVE("remove"), // ; // // /** // * Label as it appears in the .kbd JSON file // */ // private final String label; // // Action(String label) { /...
String json = KeyBindingsManualFormatter.getBindingsPrintout(BindingType.USER, map, "");
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/TasksExtensionPoint.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/CompositeTaskInterface.java // public interface CompositeTaskInterface extends Task, Evaluator, RepairAction { // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskProvider.java // pu...
import java.util.List; import org.eclipse.core.runtime.Platform; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import com.google.eclipse.mechanic.CompositeTaskInterface; import com.google.eclipse.mechanic.IResourceTaskProvider; import com.google.eclipse.mechanic.plugin.core.MechanicPl...
/******************************************************************************* * Copyright (C) 2009, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/CompositeTaskInterface.java // public interface CompositeTaskInterface extends Task, Evaluator, RepairAction { // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/IResourceTaskProvider.java // pu...
static SimpleExtensionPointManager<CompositeTaskInterface> instance =
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/RootTaskScanner.java
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/TaskCollector.java // public interface TaskCollector extends ICollector<Task> { // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/TaskScanner.java // public interface TaskScanner { // // /**...
import java.util.List; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Supplier; import com.google.eclipse.mechanic.TaskCollector; import com.google.eclipse.mechanic.TaskScanner; import com.google.eclipse.mechanic.plugin.core.MechanicLog;
/******************************************************************************* * Copyright (C) 2007, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/TaskCollector.java // public interface TaskCollector extends ICollector<Task> { // } // // Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/TaskScanner.java // public interface TaskScanner { // // /**...
private final MechanicLog log;