id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
23831132_96
{ "fields": [], "file": "modules/bluima_pubmed_ws/src/test/java/ch/epfl/bbp/uima/pubmed/PubmedSearchTest.java", "identifier": "PubmedSearchTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNeuron() throws Exception {\n List<PubmedArticleType> articles = Lists\n .newArrayList(new PubmedSearch().search(\"axon\", 5));\n assertEquals(5, articles.size());\n }", "class_method_signature": "PubmedSearchTest.testNeuron()", "constructor": ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(PubmedSearch.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory.getLogger(PubmedSearch.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "servic...
{ "body": "public Iterator<PubmedArticleType> search(String query)\n\t\t\tthrows RemoteException {\n\t\treturn search(query, Integer.MAX_VALUE);\n\t}", "class_method_signature": "PubmedSearch.search(String query)", "constructor": false, "full_signature": "public Iterator<PubmedArticleType> search(String query)"...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_79
{ "fields": [ { "declarator": "LOG = getLogger(LexicaHelperTest.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(LexicaHelperTest.class);", "type": "Logger", "var_name": "LOG" } ], "file": "modules/bluima_lexica/src/test/java/ch...
{ "body": "@Test\n public void testAlternateTokenization() throws Exception {\n\n JcasPipelineBuilder pipeline = new JcasPipelineBuilder();\n pipeline.add(LexicaHelper.getConceptMapper(\"blueonto1/disease\"));\n\n // String test = \"Taybi-Linder\";\n String test = \"Cayler cardiofacial ...
{ "fields": [ { "declarator": "LEXICA_ROOT = BlueUima.BLUE_UIMA_ROOT\n + \"modules/bluima_lexica/\"", "modifier": "public final static", "original_string": "public final static String LEXICA_ROOT = BlueUima.BLUE_UIMA_ROOT\n + \"modules/bluima_lexica/\";", "type": "Str...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static AnalysisEngineDescription getConceptMapper(String path,\n String[] args) throws UIMAException, IOException, SAXException {\n\n String conceptMapper = LEXICA_ROOT + \"desc/\" + path\n + \"ConceptMapper.xml\";\n if (!...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_55
{ "fields": [], "file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/filter/MeasureNormalizerAnnotatorTest.java", "identifier": "MeasureNormalizerAnnotatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n // Checks MEASURE_ is removed from keeps if option set to true\n public void testRemoveMeasure_() throws Exception {\n JCas jCas = getTestCas(\"20\");\n\n Measure m = createAnnot(jCas, Measure.class, 0, 1);\n m.setValue(20f);\n m.setUnit(\"\");\n createAnnot...
{ "fields": [ { "declarator": "MEASURE_MASK = \"MEASURE___\"", "modifier": "public static final", "original_string": "public static final String MEASURE_MASK = \"MEASURE___\";", "type": "String", "var_name": "MEASURE_MASK" }, { "declarator": "MEASURE_DATE = \"Date\"", ...
{ "body": "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n\n // An array is needed because when a Keep is removed, the collection\n // fails\n Keep[] keeps = select(jCas, Keep.class).toArray(new Keep[0]);\n\n for (int i = 0; i < keeps.length; i++) {\...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_114
{ "fields": [], "file": "utils/blue_commons/src/test/java/ch/epfl/bbp/collections/DefaultHashMapTest.java", "identifier": "DefaultHashMapTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() {\n Map<String, List<String>> dm = new DefaultHashMap<String, List<String>>(\n ArrayList.class);\n dm.get(\"nokey\").add(\"one\");\n dm.get(\"nokey\").add(\"two\");\n assertEquals(2, dm.get(\"nokey\").size());\n assertEquals(0,...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "cls", "modifier": "private final", ...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Override\n public V get(Object key) {\n V value = super.get(key);\n if (value == null) {\n if (defaultValue == null) {\n try {\n value = cls.newInstance();\n } catch (Exception e) {\n ...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_43
{ "fields": [], "file": "modules/bluima_mongodb/src/test/java/ch/epfl/bbp/uima/mongo/MongoUtilsTest.java", "identifier": "MongoUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAddFlag() throws Exception {\n String[] conn = MongoTest.getTestConn(\"MongoAddFlag\");\n\n MongoConnection mongo = new MongoConnection(conn);\n MongoUtils.addFlag(17, \"blih\", mongo);\n MongoUtils.addFlag(18, \"blih\", mongo);\n MongoUtils.add...
{ "fields": [], "file": "modules/bluima_mongodb/src/main/java/ch/epfl/bbp/uima/mongo/MongoUtils.java", "identifier": "MongoUtils", "interfaces": "", "methods": [ { "class_method_signature": "MongoUtils.addFlag(int pmid, String flag, MongoConnection mongo)", "constructor": false, "full_si...
{ "body": "public static void addFlag(int pmid, String flag, MongoConnection mongo) {\n BasicDBObject updateQuery = new BasicDBObject(ID, pmid + \"\");\n BasicDBObject fList = new BasicDBObject(MongoFieldMapping.FILTER,\n new BasicDBObject(flag, 1));\n mongo.coll.update(updateQuery...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_102
{ "fields": [], "file": "modules/bluima_pubmed_ws/src/test/java/ch/epfl/bbp/uima/pubmed/CitationParserTest.java", "identifier": "CitationParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n @Ignore// will use GroBid\n public void test() throws Exception {\n Citation c = new CitationParser()\n .parse(\"Thomson AM & Bannister A. Postsynaptic pyramidal target selection by descending layer III pyramidal axons: dual intracellular recordings and biocytin filling ...
{ "fields": [ { "declarator": "client", "modifier": "private", "original_string": "private HttpClient client;", "type": "HttpClient", "var_name": "client" }, { "declarator": "url = \"http://freecite.library.brown.edu/citations/create\"", "modifier": "final static"...
{ "body": "public Citation parse(String citationStr) throws HttpException,\n IOException, ParserConfigurationException, SAXException {\n\n PostMethod method = new PostMethod(url);\n method.addRequestHeader(\"accept\", \"text/xml\");\n method.addParameter(\"citation\", citationStr);\n\n...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_14
{ "fields": [ { "declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())", "modifier": "static final", "original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());", ...
{ "body": "@Test\n public void testWrongIndentation() throws Exception {\n Pair<List<Object>, String> params = PipelineScriptParser\n .parseParams(new IteratorWithPrevious<String>(newArrayList(\n \" a: bla\", \"b: bli\")));\n assertEquals(\n \"only...
{ "fields": [ { "declarator": "LOG = getLogger(PipelineScriptParser.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);", "type": "Logger", "var_name": "LOG" } ], "file": "modules/bluima_scripting/src/m...
{ "body": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it) throws ParseException {\n List<Object> params = new ArrayList<Object>();\n String xml = \"\";\n while (it.hasNext()) {\n String current = it.next();\n if (StringUtils.isBl...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_122
{ "fields": [], "file": "utils/blue_commons/src/test/java/ch/epfl/bbp/FileParseUtilsTest.java", "identifier": "FileParseUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = NumberFormatException.class)\n public void testWrongInput3() {\n parseToIntegerList(\"d\", \" \");\n }", "class_method_signature": "FileParseUtilsTest.testWrongInput3()", "constructor": false, "full_signature": "@Test(expected = NumberFormatException.class) public void t...
{ "fields": [], "file": "utils/blue_commons/src/main/java/ch/epfl/bbp/FileParseUtils.java", "identifier": "FileParseUtils", "interfaces": "", "methods": [ { "class_method_signature": "FileParseUtils.parseToDoubleList(String txt, String separator)", "constructor": false, "full_signature":...
{ "body": "public static List<Integer> parseToIntegerList(String txt, String separator) {\n if (txt.length() == 0)\n return new ArrayList<Integer>();\n String[] split = txt.trim().split(separator);\n List<Integer> ret = new ArrayList<Integer>(split.length);\n for (String s : spl...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_63
{ "fields": [], "file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/utils/PlingStemmerTest.java", "identifier": "PlingStemmerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() throws Exception {\n assertEquals(\"word\", PlingStemmer.stem(\"word\"));\n assertEquals(\"word\", PlingStemmer.stem(\"words\"));\n assertEquals(\"playing\", PlingStemmer.stem(\"playing\"));\n assertEquals(\"fly\", PlingStemmer.stem(\"flies\"));\n ...
{ "fields": [], "file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/utils/PlingStemmer.java", "identifier": "PlingStemmer", "interfaces": "implements Stemmer", "methods": [ { "class_method_signature": "PlingStemmer.stem(String token)", "constructor": false, "full_signature": "@O...
{ "body": "@Override\n public String stem(String token) {\n\treturn javatools.parsers.PlingStemmer.stem(token);\n }", "class_method_signature": "PlingStemmer.stem(String token)", "constructor": false, "full_signature": "@Override public String stem(String token)", "identifier": "stem", "invocations": ...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_34
{ "fields": [], "file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/BioLemmatizerNormalizerAnnotatorTest.java", "identifier": "BioLemmatizerNormalizerAnnotatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOnlyTokens() throws Exception{\n JCas jCas = UimaTests.getTestCas(\"is regulated\");\n\n Measure m = createAnnot(jCas, Measure.class, 0, 1);\n m.setUnit(\"%\");\n m.setValue(20f);\n Keep k = createAnnot(jCas, Keep.class, 0, 1);\n k.setEnc...
{ "fields": [ { "declarator": "LOG = LoggerFactory\n .getLogger(BioLemmatizerNormalizerAnnotator.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory\n .getLogger(BioLemmatizerNormalizerAnnotator.class);", "type": "Logge...
{ "body": "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n\n for (Keep k : select(jCas, Keep.class)) {\n\n Annotation a = k.getEnclosedAnnot(); \n String normalized = null;\n \n // sometimes, Tokens already have a lemma form,...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_22
{ "fields": [ { "declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())", "modifier": "static final", "original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());", ...
{ "body": "@Test\n public void testParseValidPipelines() throws Exception {\n\n for (String validPipeline : newArrayList(//\n \"valid1_simple.pipeline\", //\n \"valid2_arguments.pipeline\", //\n \"valid3_complex.pipeline\", //\n \"valid4_collapsed....
{ "fields": [ { "declarator": "LOG = getLogger(PipelineScriptParser.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);", "type": "Logger", "var_name": "LOG" } ], "file": "modules/bluima_scripting/src/m...
{ "body": "public static Pipeline parse(File scriptFile) throws ParseException,\n IOException {\n return parse(scriptFile, null);\n }", "class_method_signature": "PipelineScriptParser.parse(File scriptFile)", "constructor": false, "full_signature": "public static Pipeline parse(File scriptF...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_75
{ "fields": [], "file": "modules/bluima_regions/src/test/java/w/ch/epfl/bbp/nlp/br/normalize/NormalizeTest.java", "identifier": "NormalizeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n // see table 1: Modifier Descriptions and Examples\n public void testTable1() throws Exception {\n\n Normalize n = new Normalize();\n\n assertTrue(n.processMentionString(\n \"Dorsal and posterior hypothalamic areas\").contains(\n \"dorsal hypothalam...
{ "fields": [ { "declarator": "editors = new LinkedList<MentionEditor>()", "modifier": "", "original_string": "List<MentionEditor> editors = new LinkedList<MentionEditor>();", "type": "List<MentionEditor>", "var_name": "editors" } ], "file": "modules/bluima_regions/src/main/j...
{ "body": "public Set<String> processMentionString(String mention) {\n Set<String> result = new HashSet<String>();\n result.add(mention);\n for (MentionEditor editor : editors) {\n Set<String> newResult = new HashSet<String>();\n for (String mentionEdit : result) {\n ...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_59
{ "fields": [], "file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/utils/StructuredDirectoryTest.java", "identifier": "StructuredDirectoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetSplit() {\n assertArrayEquals(new int[] { 2, 345, 678 },\n StructuredDirectory.getSplit(2345678));\n assertArrayEquals(new int[] { 22, 345, 678 },\n StructuredDirectory.getSplit(22345678));\n assertArrayEquals(new int[] { 0, 1...
{ "fields": [], "file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/utils/StructuredDirectory.java", "identifier": "StructuredDirectory", "interfaces": "", "methods": [ { "class_method_signature": "StructuredDirectory.getSplit(int docId)", "constructor": false, "full_signature":...
{ "body": "public static int[] getSplit(int docId) {\n if (docId <= 0) {\n throw new IllegalArgumentException(\"docId must be positive\");\n }\n int[] ret = new int[3];\n ret[0] = docId / 1000000;\n ret[1] = (docId % 1000000) / 1000;\n ret[2] = docId % 1000;\n ...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_118
{ "fields": [], "file": "utils/blue_commons/src/test/java/ch/epfl/bbp/triechar/TrieDataTest.java", "identifier": "TrieDataTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIterate() {\n\t\t\n\t\tTrieData<Integer> t = new TrieData<Integer>();\n\t\tt.addWord(\"1\", 1);\n\t\tt.addWord(\"2\", 2);\n\t\tt.addWord(\"100\", 100);\n\t\tt.addWord(\"1000\", 1000);\n\t\t\n\t\tfor (TrieNodeData<Integer> trieNodeData : t) {\n\t\t\tSystem.out.println(trieNodeData);...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "root", "modifier": "private", ...
{ "body": "public void addWord(String word, T data) {\n if (!caseSensitive)\n word = word.toLowerCase();\n root.addWord(root, word.toCharArray(), data);\n }", "class_method_signature": "TrieData.addWord(String word, T data)", "constructor": false, "full_signature": "public void addWo...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_18
{ "fields": [ { "declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())", "modifier": "static final", "original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());", ...
{ "body": "@Test\n public void testParseAe2() throws Exception {\n PipelineScriptParser.parseAE(\"ae: \"\n + WhitespaceTokenizerAnnotator.class.getSimpleName(),\n EMPTY_ARGS, new Pipeline());\n }", "class_method_signature": "PipelineScriptParserTest.testParseAe2()", "con...
{ "fields": [ { "declarator": "LOG = getLogger(PipelineScriptParser.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);", "type": "Logger", "var_name": "LOG" } ], "file": "modules/bluima_scripting/src/m...
{ "body": "@SuppressWarnings(\"unchecked\")\n static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline) throws ParseException {\n LOG.info(\"+-parsing line '{}'\", line);\n\n String aeName = line.replaceFirst(\"ae: \", \"\").trim();\n if (aeName.endsWith...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_2
{ "fields": [], "file": "modules/bluima_xml/src/test/java/ch/epfl/bbp/uima/xml/bams/BamsOntologyParserTest.java", "identifier": "BamsOntologyParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() throws Exception {\n BamsOntologyParser.parse();\n\n }", "class_method_signature": "BamsOntologyParserTest.test()", "constructor": false, "full_signature": "@Test public void test()", "identifier": "test", "invocations": [ "parse" ], "modifiers": "@...
{ "fields": [ { "declarator": "LOG = getLogger(BamsOntologyParser.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(BamsOntologyParser.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "onto = new File(\n ...
{ "body": "public static BamsOntology parse() throws JDOMException, IOException {\n return parse(onto);\n }", "class_method_signature": "BamsOntologyParser.parse()", "constructor": false, "full_signature": "public static BamsOntology parse()", "identifier": "parse", "invocations": [ "parse" ...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_3
{ "fields": [], "file": "modules/bluima_xml/src/test/java/ch/epfl/bbp/uima/xml/PubmedXmlParserTest.java", "identifier": "PubmedXmlParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParsePubmedXml() throws Exception {\n\n InputStream is = ResourceHelper\n .getInputStream(\"pubmed_abstracts/16205164.xml\");\n PubmedArticle art = new PubmedXmlParser().parseAsArticle(is);\n\n assertEquals(\n \"High rate of join...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(PubmedXmlParser.class)", "modifier": "", "original_string": "Logger LOG = LoggerFactory.getLogger(PubmedXmlParser.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "unmarshaller", "modifie...
{ "body": "public PubmedArticle parseAsArticle(InputStream is) {\n try {\n PubmedArticleSet parse = parse(is);\n return (PubmedArticle) parse.getPubmedArticleOrPubmedBookArticle()\n .get(0);\n } catch (Exception e) {\n return null;\n }\n }", ...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_19
{ "fields": [ { "declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())", "modifier": "static final", "original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());", ...
{ "body": "@Test\n public void testParseAe_fromCleanup() throws Exception {\n PipelineScriptParser.parseAE(\"ae: \" + BartWriter.class.getName(),\n EMPTY_ARGS, new Pipeline());\n }", "class_method_signature": "PipelineScriptParserTest.testParseAe_fromCleanup()", "constructor": false, ...
{ "fields": [ { "declarator": "LOG = getLogger(PipelineScriptParser.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);", "type": "Logger", "var_name": "LOG" } ], "file": "modules/bluima_scripting/src/m...
{ "body": "@SuppressWarnings(\"unchecked\")\n static void parseAE(String line, IteratorWithPrevious<String> it,\n Pipeline pipeline) throws ParseException {\n LOG.info(\"+-parsing line '{}'\", line);\n\n String aeName = line.replaceFirst(\"ae: \", \"\").trim();\n if (aeName.endsWith...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_58
{ "fields": [], "file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/filter/SentenceFilterAnnotatorTest.java", "identifier": "SentenceFilterAnnotatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() throws Exception {\n\n String testDir = \"target/SentenceFilterAnnotatorTest\"\n + currentTimeMillis();\n new File(testDir).mkdir();\n\n JCas jCas = getTestCas(\"I like neurons. I like cells, too. But not cakes.\");\n setDocId(jCas, 1...
{ "fields": [ { "declarator": "outputDir", "modifier": "@ConfigurationParameter(name = PARAM_OUTPUT_DIR, defaultValue = \"target/\")\n private", "original_string": "@ConfigurationParameter(name = PARAM_OUTPUT_DIR, defaultValue = \"target/\")\n private String outputDir;", "type": "Str...
{ "body": "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n\n StringBuilder sb = new StringBuilder();\n for (Sentence s : select(jCas, Sentence.class)) {\n if (pattern.matcher(s.getCoveredText()).find()) {\n sb.append(s.getCoveredText().re...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_119
{ "fields": [], "file": "utils/blue_commons/src/test/java/ch/epfl/bbp/DateUtilsTest.java", "identifier": "DateUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() {\n assertEquals(\"0 second\", toHuman(123));\n\n assertEquals(\"5 seconds\", toHuman((5 * ONE_SECOND) + 123));\n\n assertEquals(\"1 day, 1 hour\", toHuman(ONE_DAY + ONE_HOUR));\n\n assertEquals(\"1 day and 2 seconds\", toHuman(ONE_DAY + 2 * ONE_SEC...
{ "fields": [ { "declarator": "ONE_SECOND = 1000", "modifier": "public final static", "original_string": "public final static long ONE_SECOND = 1000;", "type": "long", "var_name": "ONE_SECOND" }, { "declarator": "SECONDS = 60", "modifier": "public final static", ...
{ "body": "public static String toHuman(long duration) {\n StringBuffer res = new StringBuffer();\n long temp = 0;\n if (duration >= ONE_SECOND) {\n temp = duration / ONE_DAY;\n if (temp > 0) {\n duration -= temp * ONE_DAY;\n res.append(temp).ap...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_74
{ "fields": [ { "declarator": "LOG = LoggerFactory\n .getLogger(Biocreative2GeneCollectionReaderTest.class)", "modifier": "", "original_string": "Logger LOG = LoggerFactory\n .getLogger(Biocreative2GeneCollectionReaderTest.class);", "type": "Logger", "var_name":...
{ "body": "@Test\n public void testTestCorpus() throws Exception {\n\n CollectionReader cr = CollectionReaderFactory.createReader(\n Biocreative2GeneCollectionReader.class, BlueUima.PARAM_MODE,\n \"test\");\n\n CAS cas = CasCreationUtils\n .createCas(cr.ge...
{ "fields": [ { "declarator": "LOG = LoggerFactory\n .getLogger(Biocreative2GeneCollectionReader.class)", "modifier": "", "original_string": "Logger LOG = LoggerFactory\n .getLogger(Biocreative2GeneCollectionReader.class);", "type": "Logger", "var_name": "LOG" ...
{ "body": "public void getNext(JCas jcas) throws IOException, CollectionException {\n\n // P00027739T0000 Serum gamma glutamyltransferase in the diagnosis...\n String article = articleIt.next();\n int firstSpace = article.indexOf(\" \");\n String articleId = article.substring(0, firstSpace...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_23
{ "fields": [ { "declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())", "modifier": "static final", "original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());", ...
{ "body": "@Test\n public void testParseCorrpted() throws Exception {\n\n for (int i = 1; i < 10; i++) {\n boolean hasEx = false;\n try {\n parse(new File(TEST_PARSE_ROOT + \"corrupted\" + i + \".pipeline\"));\n } catch (ParseException p) {\n ha...
{ "fields": [ { "declarator": "LOG = getLogger(PipelineScriptParser.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);", "type": "Logger", "var_name": "LOG" } ], "file": "modules/bluima_scripting/src/m...
{ "body": "public static Pipeline parse(File scriptFile) throws ParseException,\n IOException {\n return parse(scriptFile, null);\n }", "class_method_signature": "PipelineScriptParser.parse(File scriptFile)", "constructor": false, "full_signature": "public static Pipeline parse(File scriptF...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_35
{ "fields": [], "file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/LanguageDetectionAnnotatorTest.java", "identifier": "LanguageDetectionAnnotatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStandalone() throws Exception {\n\n assertEquals(\"en\",\n LanguageDetectionAnnotator.detect(UimaTests.TEST_SENTENCE));\n assertEquals(\n \"zh-tw\",\n LanguageDetectionAnnotator\n .detect(\"有一個很大的區別...
{ "fields": [ { "declarator": "LOG = LoggerFactory\n .getLogger(LanguageDetectionAnnotator.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory\n .getLogger(LanguageDetectionAnnotator.class);", "type": "Logger", "v...
{ "body": "public static String detect(String text) throws LangDetectException {\n\n Detector detector = DetectorFactory.create(0.5);\n detector.append(text);\n\n return detector.detect();\n }", "class_method_signature": "LanguageDetectionAnnotator.detect(String text)", "constructor": fals...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_123
{ "fields": [], "file": "utils/blue_commons/src/test/java/ch/epfl/bbp/FileParseUtilsTest.java", "identifier": "FileParseUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseIntDouble() throws Exception {\n String f = FileParseUtilsTest.class.getResource(\n \"FileParseUtilsTest_intdouble.txt\").getFile();\n Map<Integer, Double> i_d = FileParseUtils.parseIntDouble(f, \" \");\n assertEquals(3, i_d.size());\n ...
{ "fields": [], "file": "utils/blue_commons/src/main/java/ch/epfl/bbp/FileParseUtils.java", "identifier": "FileParseUtils", "interfaces": "", "methods": [ { "class_method_signature": "FileParseUtils.parseToDoubleList(String txt, String separator)", "constructor": false, "full_signature":...
{ "body": "public static Map<Integer, Double> parseIntDouble(String file,\n String separator) throws FileNotFoundException {\n Map<Integer, Double> ret = new HashMap<Integer, Double>();\n for (String line : new LineReader(new FileInputStream(file))) {\n String[] split = line.split(...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_62
{ "fields": [], "file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/utils/StructuredDirectoryTest.java", "identifier": "StructuredDirectoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDecodeFileName2() throws Exception {\n assertEquals(\"\", 12345678,\n StructuredDirectory.decodeFileName(\"12/345/678.txt\"));\n assertEquals(\"\", 12005008,\n StructuredDirectory.decodeFileName(\"12/5/8.txt\"));\n }", "class_metho...
{ "fields": [], "file": "modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/utils/StructuredDirectory.java", "identifier": "StructuredDirectory", "interfaces": "", "methods": [ { "class_method_signature": "StructuredDirectory.getSplit(int docId)", "constructor": false, "full_signature":...
{ "body": "public static int decodeFileName(File inputFile) throws IOException {\n try {\n int ret = parseInt(removeExtension(inputFile.getName()));\n ret += 1000 * parseInt(inputFile.getParentFile().getName());\n ret += 1000000 * parseInt(inputFile.getParentFile().getParentFil...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_15
{ "fields": [ { "declarator": "EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>())", "modifier": "static final", "original_string": "static final IteratorWithPrevious<String> EMPTY_ARGS = new IteratorWithPrevious<String>(\n new ArrayList<String>());", ...
{ "body": "@Test\n public void testNoCOLUMN() throws Exception {\n Pair<List<Object>, String> params = PipelineScriptParser\n .parseParams(new IteratorWithPrevious<String>(newArrayList(\n \" a: bla\", \"bbbbbla\")));\n assertEquals(\n \"only one pa...
{ "fields": [ { "declarator": "LOG = getLogger(PipelineScriptParser.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(PipelineScriptParser.class);", "type": "Logger", "var_name": "LOG" } ], "file": "modules/bluima_scripting/src/m...
{ "body": "static Pair<List<Object>, String> parseParams(\n IteratorWithPrevious<String> it) throws ParseException {\n List<Object> params = new ArrayList<Object>();\n String xml = \"\";\n while (it.hasNext()) {\n String current = it.next();\n if (StringUtils.isBl...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_42
{ "fields": [ { "declarator": "LOG = getLogger(MongoFieldMappingTest.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(MongoFieldMappingTest.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "conn", "mo...
{ "body": "@Test\n public void test() throws Exception {\n\n JCas jCas = UimaTests.getTokenizedTestCas();\n\n DataTable dt = new DataTable(jCas);\n dt.setTableId(12);\n dt.setPageNumber(13);\n\n StringArray sa = new StringArray(jCas, 4);\n sa.copyFromArray(new String[] { \...
{ "fields": [ { "declarator": "LOG = getLogger(MongoFieldMapping.class)", "modifier": "protected static final", "original_string": "protected static final Logger LOG = getLogger(MongoFieldMapping.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "ID = \"_...
{ "body": "private static void add(Class<? extends Annotation> class1,\n String shortName, String... fieldMappings) {\n\n checkArgument(fieldMappings.length % 2 == 0,\n \"even nr of field mappings! \" + fieldMappings.length);\n\n for (MongoFieldMapping mfm : ALL_MAPPINGS.values...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_103
{ "fields": [], "file": "utils/mallet_utils/src/test/java/cc/mallet/pipe/tsf/transform/CommonNerTokenTransformersTest.java", "identifier": "CommonNerTokenTransformersTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testLowerCaseTransformer() {\n\t\tTokenTransformer transformer = CommonNerTokenTransformers.getLowerCaseTransformer();\n\t\t\n\t\tassertEquals(\"\", transformer.transform(\"\"));\n\t\tassertEquals(\"miau\", transformer.transform(\"miau\"));\n\t\tassertEquals(\"miau\", transformer.trans...
{ "fields": [ { "declarator": "ToLowerCaseTransformer = new TokenTransformer() {\t\t\n\t\t@Override\n\t\tpublic String transform(String token) {\n\t\t\treturn token.toLowerCase();\t\t\t\n\t\t}\n\t}", "modifier": "private static final", "original_string": "private static final TokenTransformer To...
{ "body": "public static TokenTransformer getLowerCaseTransformer() {\n\t\treturn ToLowerCaseTransformer;\n\t}", "class_method_signature": "CommonNerTokenTransformers.getLowerCaseTransformer()", "constructor": false, "full_signature": "public static TokenTransformer getLowerCaseTransformer()", "identifier": "...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_54
{ "fields": [], "file": "modules/bluima_utils/src/test/java/ch/epfl/bbp/uima/filter/MeasureNormalizerAnnotatorTest.java", "identifier": "MeasureNormalizerAnnotatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n // Checks a Measure object normalized text is changed to MEASURE_\n public void testMeasuresIsCorrectlyParsed() throws Exception {\n JCas jCas = getTestCas(\"20%\");\n\n Measure m = createAnnot(jCas, Measure.class, 0, 2);\n m.setUnit(\"%\");\n m.setValue(20f);\n ...
{ "fields": [ { "declarator": "MEASURE_MASK = \"MEASURE___\"", "modifier": "public static final", "original_string": "public static final String MEASURE_MASK = \"MEASURE___\";", "type": "String", "var_name": "MEASURE_MASK" }, { "declarator": "MEASURE_DATE = \"Date\"", ...
{ "body": "@Override\n public void process(JCas jCas) throws AnalysisEngineProcessException {\n\n // An array is needed because when a Keep is removed, the collection\n // fails\n Keep[] keeps = select(jCas, Keep.class).toArray(new Keep[0]);\n\n for (int i = 0; i < keeps.length; i++) {\...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_115
{ "fields": [], "file": "utils/blue_commons/src/test/java/ch/epfl/bbp/triechar/VocabularyTest.java", "identifier": "VocabularyTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testHello() {\n Vocabulary v = new Vocabulary(true);\n int hello = v.addWord(\"hello\");\n assertEquals(0, hello);\n assertEquals(\"hello\", v.getWord(hello));\n assertEquals(1, v.getSize());\n }", "class_method_signature": "VocabularyTest.test...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "nodes", "modifier": "", "orig...
{ "body": "public String getWord(int id) {\n if (nodes == null)\n updateBacktracking();\n TrieNodeData<Integer> node = nodes[id];\n\n StringBuilder sb = new StringBuilder();\n node.getWord(sb);\n\n return sb.toString();\n }", "class_method_signature": "Vocabulary.get...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_97
{ "fields": [], "file": "modules/bluima_pubmed_ws/src/test/java/ch/epfl/bbp/uima/pubmed/PubmedSearchTest.java", "identifier": "PubmedSearchTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNeuron2() throws Exception {\n List<PubmedArticleType> articles = Lists\n .newArrayList(new PubmedSearch().search(\"mouse\", 90));\n assertEquals(90, articles.size());\n }", "class_method_signature": "PubmedSearchTest.testNeuron2()", "construct...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(PubmedSearch.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory.getLogger(PubmedSearch.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "servic...
{ "body": "public Iterator<PubmedArticleType> search(String query)\n\t\t\tthrows RemoteException {\n\t\treturn search(query, Integer.MAX_VALUE);\n\t}", "class_method_signature": "PubmedSearch.search(String query)", "constructor": false, "full_signature": "public Iterator<PubmedArticleType> search(String query)"...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_78
{ "fields": [], "file": "modules/bluima_units/src/test/java/ch/epfl/bbp/uima/units/normalizers/WrittenNumbersNormalizerTest.java", "identifier": "WrittenNumbersNormalizerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() {\n assertEquals(new Long(1), text2num(\"one\"));\n assertEquals(new Long(12), text2num(\"twelve\"));\n assertEquals(new Long(72), text2num(\"seventy two\"));\n assertEquals(new Long(72), text2num(\"seventy-two\"));\n\n assertEquals(new Long(...
{ "fields": [ { "declarator": "small = new HashMap<String, Integer>()", "modifier": "static", "original_string": "static Map<String, Integer> small = new HashMap<String, Integer>();", "type": "Map<String, Integer>", "var_name": "small" }, { "declarator": "magnitude = ne...
{ "body": "public static Long text2num(String s) {\n\n\t\tString[] a = s.split(\"\\\\s|-\");\n\t\tif (a.length == 0)\n\t\t\tthrow new NumberFormatException(\"cannot parse \" + s);\n\n\t\tlong n = 0l, g = 0l;\n\t\tfor (String w : a) {\n\t\t\tif (small.containsKey(w)) {\n\t\t\t\tg += small.get(w);\n\t\t\t} else if (w.e...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_39
{ "fields": [], "file": "modules/bluima_commons/src/test/java/ch/epfl/bbp/uima/ae/LinnaeusAnnotatorTest.java", "identifier": "LinnaeusAnnotatorTest", "interfaces": "", "superclass": "extends TestWithBluimaResource" }
{ "body": "@Test\n public void test2() throws Exception {\n // FIXME rodent not found\n // JCas jCas = getTestCas(\"bla bla rodent bla bla\");\n JCas jCas = getTestCas(\"bla bla rat bla bla\");\n\n createLinnaeusEngine().process(jCas);\n\n Collection<LinnaeusSpecies> sps = select...
{ "fields": [ { "declarator": "matcher", "modifier": "private", "original_string": "private Matcher matcher;", "type": "Matcher", "var_name": "matcher" }, { "declarator": "logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)", "modifier": "private", "origina...
{ "body": "@Override\n public void process(JCas cas) throws AnalysisEngineProcessException {\n\n String text = cas.getDocumentText();\n List<Mention> mentions = matcher.match(text);\n for (Mention mention : mentions) {\n\n String mostProbableID = mention.getMostProbableID();\n ...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
23831132_81
{ "fields": [ { "declarator": "LOG = getLogger(LexicaHelperTest.class)", "modifier": "private static", "original_string": "private static Logger LOG = getLogger(LexicaHelperTest.class);", "type": "Logger", "var_name": "LOG" } ], "file": "modules/bluima_lexica/src/test/java/ch...
{ "body": "@Test\n public void testAll() throws Exception {\n\n FilenameFilter filter = new FilenameFilter() {\n @Override\n public boolean accept(File arg0, String name) {\n if (newArrayList(\".svn\", \"templates\", \".DS_Store\", \"biolexicon\").contains(\n ...
{ "fields": [ { "declarator": "LEXICA_ROOT = BlueUima.BLUE_UIMA_ROOT\n + \"modules/bluima_lexica/\"", "modifier": "public final static", "original_string": "public final static String LEXICA_ROOT = BlueUima.BLUE_UIMA_ROOT\n + \"modules/bluima_lexica/\";", "type": "Str...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static AnalysisEngineDescription getConceptMapper(String path,\n String[] args) throws UIMAException, IOException, SAXException {\n\n String conceptMapper = LEXICA_ROOT + \"desc/\" + path\n + \"ConceptMapper.xml\";\n if (!...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 23831132, "size": 220469, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/BlueBrain/bluima" }
15611804_0
{ "fields": [ { "declarator": "preferences", "modifier": "private", "original_string": "private Preferences preferences;", "type": "Preferences", "var_name": "preferences" }, { "declarator": "dataStoreFlorent", "modifier": "private", "original_string": "priv...
{ "body": "@Test\n public void testGet() throws Exception {\n init();\n\n Credentials credentialsFlorent = dataStoreFlorent.getCredentials(\"dummy\");\n assertNotNull(credentialsFlorent);\n assertEquals(credentialsFlorent.username(), \"florent\");\n assertEquals(credentialsFloren...
{ "fields": [ { "declarator": "preferences", "modifier": "private", "original_string": "private Preferences preferences;", "type": "Preferences", "var_name": "preferences" }, { "declarator": "credentialsHelper", "modifier": "private", "original_string": "pri...
{ "body": "@Override\n public Credentials get(String key) {\n return credentialsHelper.convert(getRemoteCredentials());\n }", "class_method_signature": "PreferencesDataStore.get(String key)", "constructor": false, "full_signature": "@Override public Credentials get(String key)", "identifier": "ge...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15611804, "size": 1073, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/codenvy-legacy/cli" }
15611804_1
{ "fields": [ { "declarator": "preferences", "modifier": "private", "original_string": "private Preferences preferences;", "type": "Preferences", "var_name": "preferences" }, { "declarator": "dataStoreFlorent", "modifier": "private", "original_string": "priv...
{ "body": "@Test(dependsOnMethods = \"testGet\")\n public void testPut() throws Exception {\n init();\n Credentials credentialsFlorent = dataStoreFlorent.getCredentials(\"dummy\");\n\n // change username\n Credentials update = Mockito.mock(Credentials.class);\n doReturn(\"toto\")...
{ "fields": [ { "declarator": "preferences", "modifier": "private", "original_string": "private Preferences preferences;", "type": "Preferences", "var_name": "preferences" }, { "declarator": "credentialsHelper", "modifier": "private", "original_string": "pri...
{ "body": "@Override\n public synchronized Credentials put(String key, Credentials credentials) {\n this.preferences.put(remote, credentialsHelper.convert(credentials));\n return get(key);\n }", "class_method_signature": "PreferencesDataStore.put(String key, Credentials credentials)", "constru...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15611804, "size": 1073, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/codenvy-legacy/cli" }
15611804_6
{ "fields": [ { "declarator": "USELESS_POJO_KEY = \"uselessPojo\"", "modifier": "private static final", "original_string": "private static final String USELESS_POJO_KEY = \"uselessPojo\";", "type": "String", "var_name": "USELESS_POJO_KEY" } ], "file": "preferences/impl/src/te...
{ "body": "@Test\n public void testLessPropertiesThanPojoPreferences() throws IOException {\n FilePreferences filePreferences = getPreferencesFile(\"lessPropertiesThanPojoPreferences.json\");\n FakePojo fakePojo = filePreferences.get(USELESS_POJO_KEY, FakePojo.class);\n assertThat(FakePojo.get...
{ "fields": [ { "declarator": "rootNode", "modifier": "private", "original_string": "private JsonPreferences rootNode;", "type": "JsonPreferences", "var_name": "rootNode" }, { "declarator": "mapper", "modifier": "private final", "original_string": "privat...
{ "body": "@Override\n public <T> T get(String key, Class<T> clazz) {\n return rootNode.get(key, clazz);\n }", "class_method_signature": "FilePreferences.get(String key, Class<T> clazz)", "constructor": false, "full_signature": "@Override public T get(String key, Class<T> clazz)", "identifier": "...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15611804, "size": 1073, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/codenvy-legacy/cli" }
15611804_4
{ "fields": [ { "declarator": "USELESS_POJO_KEY = \"uselessPojo\"", "modifier": "private static final", "original_string": "private static final String USELESS_POJO_KEY = \"uselessPojo\";", "type": "String", "var_name": "USELESS_POJO_KEY" } ], "file": "preferences/impl/src/te...
{ "body": "@Test\n public void testMorePropertiesThanPojoPreferences() throws IOException {\n FilePreferences filePreferences = getPreferencesFile(\"morePropertiesThanPojoPreferences.json\");\n\n FakePojo fakePojo = filePreferences.get(USELESS_POJO_KEY, FakePojo.class);\n\n assertThat(FakePojo...
{ "fields": [ { "declarator": "rootNode", "modifier": "private", "original_string": "private JsonPreferences rootNode;", "type": "JsonPreferences", "var_name": "rootNode" }, { "declarator": "mapper", "modifier": "private final", "original_string": "privat...
{ "body": "@Override\n public <T> T get(String key, Class<T> clazz) {\n return rootNode.get(key, clazz);\n }", "class_method_signature": "FilePreferences.get(String key, Class<T> clazz)", "constructor": false, "full_signature": "@Override public T get(String key, Class<T> clazz)", "identifier": "...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15611804, "size": 1073, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/codenvy-legacy/cli" }
15611804_5
{ "fields": [ { "declarator": "USELESS_POJO_KEY = \"uselessPojo\"", "modifier": "private static final", "original_string": "private static final String USELESS_POJO_KEY = \"uselessPojo\";", "type": "String", "var_name": "USELESS_POJO_KEY" } ], "file": "preferences/impl/src/te...
{ "body": "@Test\n public void testTwoConsumersWithDifferentsPojo() throws IOException {\n FilePreferences filePreferences = getPreferencesFile(\"morePropertiesThanPojoPreferences.json\");\n\n FakePojo fakePojo = filePreferences.get(USELESS_POJO_KEY, FakePojo.class);\n\n assertThat(FakePojo.ge...
{ "fields": [ { "declarator": "rootNode", "modifier": "private", "original_string": "private JsonPreferences rootNode;", "type": "JsonPreferences", "var_name": "rootNode" }, { "declarator": "mapper", "modifier": "private final", "original_string": "privat...
{ "body": "@Override\n public <T> T get(String key, Class<T> clazz) {\n return rootNode.get(key, clazz);\n }", "class_method_signature": "FilePreferences.get(String key, Class<T> clazz)", "constructor": false, "full_signature": "@Override public T get(String key, Class<T> clazz)", "identifier": "...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15611804, "size": 1073, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/codenvy-legacy/cli" }
15611804_2
{ "fields": [ { "declarator": "preferences", "modifier": "private", "original_string": "private Preferences preferences;", "type": "Preferences", "var_name": "preferences" }, { "declarator": "dataStoreFlorent", "modifier": "private", "original_string": "priv...
{ "body": "@Test(dependsOnMethods = \"testPut\")\n public void testOnlyOneInstanceGet() throws Exception {\n init();\n\n Credentials one = dataStoreFlorent.get(\"one\");\n assertNotNull(one);\n Credentials two = dataStoreFlorent.get(\"two\");\n assertNotNull(two);\n\n asse...
{ "fields": [ { "declarator": "preferences", "modifier": "private", "original_string": "private Preferences preferences;", "type": "Preferences", "var_name": "preferences" }, { "declarator": "credentialsHelper", "modifier": "private", "original_string": "pri...
{ "body": "@Override\n public Credentials get(String key) {\n return credentialsHelper.convert(getRemoteCredentials());\n }", "class_method_signature": "PreferencesDataStore.get(String key)", "constructor": false, "full_signature": "@Override public Credentials get(String key)", "identifier": "ge...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15611804, "size": 1073, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/codenvy-legacy/cli" }
15611804_3
{ "fields": [ { "declarator": "USELESS_POJO_KEY = \"uselessPojo\"", "modifier": "private static final", "original_string": "private static final String USELESS_POJO_KEY = \"uselessPojo\";", "type": "String", "var_name": "USELESS_POJO_KEY" } ], "file": "preferences/impl/src/te...
{ "body": "@Test\n public void testPerfectPojoMatchPreferences() throws IOException {\n FilePreferences filePreferences = getPreferencesFile(\"perfectPojoMatchPreferences.json\");\n\n FakePojo fakePojo = filePreferences.get(USELESS_POJO_KEY, FakePojo.class);\n\n assertThat(FakePojo.getDumbInst...
{ "fields": [ { "declarator": "rootNode", "modifier": "private", "original_string": "private JsonPreferences rootNode;", "type": "JsonPreferences", "var_name": "rootNode" }, { "declarator": "mapper", "modifier": "private final", "original_string": "privat...
{ "body": "@Override\n public <T> T get(String key, Class<T> clazz) {\n return rootNode.get(key, clazz);\n }", "class_method_signature": "FilePreferences.get(String key, Class<T> clazz)", "constructor": false, "full_signature": "@Override public T get(String key, Class<T> clazz)", "identifier": "...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 15611804, "size": 1073, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/codenvy-legacy/cli" }
111854037_476
{ "fields": [ { "declarator": "CHANNEL_COUNT_MONO = 1", "modifier": "private static final", "original_string": "private static final int CHANNEL_COUNT_MONO = 1;", "type": "int", "var_name": "CHANNEL_COUNT_MONO" }, { "declarator": "CHANNEL_COUNT_STEREO = 2", "modif...
{ "body": "@Config(minSdk = 21, maxSdk = TARGET_SDK)\n @Test\n public void supportsFloatOutputFromApi21() {\n assertThat(defaultAudioSink.supportsOutput(CHANNEL_COUNT_STEREO, C.ENCODING_PCM_FLOAT))\n .isTrue();\n }", "class_method_signature": "DefaultAudioSinkTest.supportsFloatOutputFromApi21()", "co...
{ "fields": [ { "declarator": "MIN_BUFFER_DURATION_US = 250000", "modifier": "private static final", "original_string": "private static final long MIN_BUFFER_DURATION_US = 250000;", "type": "long", "var_name": "MIN_BUFFER_DURATION_US" }, { "declarator": "MAX_BUFFER_DURA...
{ "body": "@Override\n public boolean supportsOutput(int channelCount, @C.Encoding int encoding) {\n if (Util.isEncodingLinearPcm(encoding)) {\n // AudioTrack supports 16-bit integer PCM output in all platform API versions, and float\n // output from platform API version 21 only. Other integer PCM encod...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111854037, "size": 94663, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PaulWoitaschek/ExoPlayer-Extensions" }
111854037_231
{ "fields": [], "file": "library/core/src/test/java/com/google/android/exoplayer2/util/MimeTypesTest.java", "identifier": "MimeTypesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetMediaMimeType_fromValidCodecs_returnsCorrectMimeType() {\n assertThat(MimeTypes.getMediaMimeType(\"avc1\")).isEqualTo(MimeTypes.VIDEO_H264);\n assertThat(MimeTypes.getMediaMimeType(\"avc1.42E01E\")).isEqualTo(MimeTypes.VIDEO_H264);\n assertThat(MimeTypes.getMediaMimeTyp...
{ "fields": [ { "declarator": "BASE_TYPE_VIDEO = \"video\"", "modifier": "public static final", "original_string": "public static final String BASE_TYPE_VIDEO = \"video\";", "type": "String", "var_name": "BASE_TYPE_VIDEO" }, { "declarator": "BASE_TYPE_AUDIO = \"audio\""...
{ "body": "public static @Nullable String getMediaMimeType(@Nullable String codec) {\n if (codec == null) {\n return null;\n }\n codec = Util.toLowerInvariant(codec.trim());\n if (codec.startsWith(\"avc1\") || codec.startsWith(\"avc3\")) {\n return MimeTypes.VIDEO_H264;\n } else if (codec.sta...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111854037, "size": 94663, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PaulWoitaschek/ExoPlayer-Extensions" }
111854037_475
{ "fields": [ { "declarator": "CHANNEL_COUNT_MONO = 1", "modifier": "private static final", "original_string": "private static final int CHANNEL_COUNT_MONO = 1;", "type": "int", "var_name": "CHANNEL_COUNT_MONO" }, { "declarator": "CHANNEL_COUNT_STEREO = 2", "modif...
{ "body": "@Config(minSdk = OLDEST_SDK, maxSdk = 20)\n @Test\n public void doesNotSupportFloatOutputBeforeApi21() {\n assertThat(defaultAudioSink.supportsOutput(CHANNEL_COUNT_STEREO, C.ENCODING_PCM_FLOAT))\n .isFalse();\n }", "class_method_signature": "DefaultAudioSinkTest.doesNotSupportFloatOutputBefo...
{ "fields": [ { "declarator": "MIN_BUFFER_DURATION_US = 250000", "modifier": "private static final", "original_string": "private static final long MIN_BUFFER_DURATION_US = 250000;", "type": "long", "var_name": "MIN_BUFFER_DURATION_US" }, { "declarator": "MAX_BUFFER_DURA...
{ "body": "@Override\n public boolean supportsOutput(int channelCount, @C.Encoding int encoding) {\n if (Util.isEncodingLinearPcm(encoding)) {\n // AudioTrack supports 16-bit integer PCM output in all platform API versions, and float\n // output from platform API version 21 only. Other integer PCM encod...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111854037, "size": 94663, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PaulWoitaschek/ExoPlayer-Extensions" }
111854037_232
{ "fields": [], "file": "library/core/src/test/java/com/google/android/exoplayer2/util/MimeTypesTest.java", "identifier": "MimeTypesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetMimeTypeFromMp4ObjectType_forValidObjectType_returnsCorrectMimeType() {\n assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0x60)).isEqualTo(MimeTypes.VIDEO_MPEG2);\n assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0x61)).isEqualTo(MimeTypes.VIDEO_MPEG2);\n assertThat...
{ "fields": [ { "declarator": "BASE_TYPE_VIDEO = \"video\"", "modifier": "public static final", "original_string": "public static final String BASE_TYPE_VIDEO = \"video\";", "type": "String", "var_name": "BASE_TYPE_VIDEO" }, { "declarator": "BASE_TYPE_AUDIO = \"audio\""...
{ "body": "@Nullable\n public static String getMimeTypeFromMp4ObjectType(int objectType) {\n switch (objectType) {\n case 0x20:\n return MimeTypes.VIDEO_MP4V;\n case 0x21:\n return MimeTypes.VIDEO_H264;\n case 0x23:\n return MimeTypes.VIDEO_H265;\n case 0x60:\n case 0...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111854037, "size": 94663, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PaulWoitaschek/ExoPlayer-Extensions" }
111854037_233
{ "fields": [], "file": "library/core/src/test/java/com/google/android/exoplayer2/util/MimeTypesTest.java", "identifier": "MimeTypesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetMimeTypeFromMp4ObjectType_forInvalidObjectType_returnsNull() {\n assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0)).isNull();\n assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0x600)).isNull();\n assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0x01)).isNull();\n ...
{ "fields": [ { "declarator": "BASE_TYPE_VIDEO = \"video\"", "modifier": "public static final", "original_string": "public static final String BASE_TYPE_VIDEO = \"video\";", "type": "String", "var_name": "BASE_TYPE_VIDEO" }, { "declarator": "BASE_TYPE_AUDIO = \"audio\""...
{ "body": "@Nullable\n public static String getMimeTypeFromMp4ObjectType(int objectType) {\n switch (objectType) {\n case 0x20:\n return MimeTypes.VIDEO_MP4V;\n case 0x21:\n return MimeTypes.VIDEO_H264;\n case 0x23:\n return MimeTypes.VIDEO_H265;\n case 0x60:\n case 0...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111854037, "size": 94663, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PaulWoitaschek/ExoPlayer-Extensions" }
111854037_474
{ "fields": [ { "declarator": "CHANNEL_COUNT_MONO = 1", "modifier": "private static final", "original_string": "private static final int CHANNEL_COUNT_MONO = 1;", "type": "int", "var_name": "CHANNEL_COUNT_MONO" }, { "declarator": "CHANNEL_COUNT_STEREO = 2", "modif...
{ "body": "@Test\n public void trimsStartAndEndFrames() throws Exception {\n configureDefaultAudioSink(\n CHANNEL_COUNT_STEREO,\n /* trimStartFrames= */ TRIM_100_MS_FRAME_COUNT,\n /* trimEndFrames= */ TRIM_10_MS_FRAME_COUNT);\n defaultAudioSink.handleBuffer(createDefaultSilenceBuffer(), /*...
{ "fields": [ { "declarator": "MIN_BUFFER_DURATION_US = 250000", "modifier": "private static final", "original_string": "private static final long MIN_BUFFER_DURATION_US = 250000;", "type": "long", "var_name": "MIN_BUFFER_DURATION_US" }, { "declarator": "MAX_BUFFER_DURA...
{ "body": "@Override\n @SuppressWarnings(\"ReferenceEquality\")\n public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs)\n throws InitializationException, WriteException {\n Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer);\n\n if (pendingConfiguration != null) {\n ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111854037, "size": 94663, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PaulWoitaschek/ExoPlayer-Extensions" }
111854037_473
{ "fields": [ { "declarator": "CHANNEL_COUNT_MONO = 1", "modifier": "private static final", "original_string": "private static final int CHANNEL_COUNT_MONO = 1;", "type": "int", "var_name": "CHANNEL_COUNT_MONO" }, { "declarator": "CHANNEL_COUNT_STEREO = 2", "modif...
{ "body": "@Test\n public void trimsEndFrames() throws Exception {\n configureDefaultAudioSink(\n CHANNEL_COUNT_STEREO,\n /* trimStartFrames= */ 0,\n /* trimEndFrames= */ TRIM_10_MS_FRAME_COUNT);\n defaultAudioSink.handleBuffer(createDefaultSilenceBuffer(), /* presentationTimeUs= */ 0);\n\...
{ "fields": [ { "declarator": "MIN_BUFFER_DURATION_US = 250000", "modifier": "private static final", "original_string": "private static final long MIN_BUFFER_DURATION_US = 250000;", "type": "long", "var_name": "MIN_BUFFER_DURATION_US" }, { "declarator": "MAX_BUFFER_DURA...
{ "body": "@Override\n @SuppressWarnings(\"ReferenceEquality\")\n public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs)\n throws InitializationException, WriteException {\n Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer);\n\n if (pendingConfiguration != null) {\n ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111854037, "size": 94663, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PaulWoitaschek/ExoPlayer-Extensions" }
111854037_472
{ "fields": [ { "declarator": "CHANNEL_COUNT_MONO = 1", "modifier": "private static final", "original_string": "private static final int CHANNEL_COUNT_MONO = 1;", "type": "int", "var_name": "CHANNEL_COUNT_MONO" }, { "declarator": "CHANNEL_COUNT_STEREO = 2", "modif...
{ "body": "@Test\n public void trimsStartFrames() throws Exception {\n configureDefaultAudioSink(\n CHANNEL_COUNT_STEREO,\n /* trimStartFrames= */ TRIM_100_MS_FRAME_COUNT,\n /* trimEndFrames= */ 0);\n defaultAudioSink.handleBuffer(createDefaultSilenceBuffer(), /* presentationTimeUs= */ 0);...
{ "fields": [ { "declarator": "MIN_BUFFER_DURATION_US = 250000", "modifier": "private static final", "original_string": "private static final long MIN_BUFFER_DURATION_US = 250000;", "type": "long", "var_name": "MIN_BUFFER_DURATION_US" }, { "declarator": "MAX_BUFFER_DURA...
{ "body": "@Override\n @SuppressWarnings(\"ReferenceEquality\")\n public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs)\n throws InitializationException, WriteException {\n Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer);\n\n if (pendingConfiguration != null) {\n ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111854037, "size": 94663, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PaulWoitaschek/ExoPlayer-Extensions" }
3149437_0
{ "fields": [ { "declarator": "provider", "modifier": "private", "original_string": "private KerberosServiceAuthenticationProvider provider;", "type": "KerberosServiceAuthenticationProvider", "var_name": "provider" }, { "declarator": "ticketValidator", "modifier":...
{ "body": "@Test(expected=UsernameNotFoundException.class)\n public void testUsernameNotFound() throws Exception {\n // stubbing\n when(ticketValidator.validateTicket(TEST_TOKEN)).thenReturn(TICKET_VALIDATION);\n when(userDetailsService.loadUserByUsername(TEST_USER)).thenThrow(new UsernameNotF...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(KerberosServiceAuthenticationProvider.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(KerberosServiceAuthenticationProvider.class);", "type": "Log", "var_name": "L...
{ "body": "@Override\n\tpublic Authentication authenticate(Authentication authentication)\n\t\t\tthrows AuthenticationException {\n\t\tKerberosServiceRequestToken auth = (KerberosServiceRequestToken) authentication;\n\t\tbyte[] token = auth.getToken();\n\t\tLOG.debug(\"Try to validate Kerberos Token\");\n\t\tKerberos...
{ "created": null, "fork": null, "fork_count": 177, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3149437, "size": 1363, "stargazer_count": 128, "stars": null, "updates": null, "url": "https://github.com/spring-projects/spring-security-kerberos" }
3149437_1
{ "fields": [ { "declarator": "provider", "modifier": "private", "original_string": "private KerberosServiceAuthenticationProvider provider;", "type": "KerberosServiceAuthenticationProvider", "var_name": "provider" }, { "declarator": "ticketValidator", "modifier":...
{ "body": "@Test(expected=BadCredentialsException.class)\n public void testTicketValidationWrong() throws Exception {\n // stubbing\n when(ticketValidator.validateTicket(TEST_TOKEN)).thenThrow(new BadCredentialsException(\"\"));\n\n // testing\n provider.authenticate(INPUT_TOKEN);\n ...
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(KerberosServiceAuthenticationProvider.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(KerberosServiceAuthenticationProvider.class);", "type": "Log", "var_name": "L...
{ "body": "@Override\n\tpublic Authentication authenticate(Authentication authentication)\n\t\t\tthrows AuthenticationException {\n\t\tKerberosServiceRequestToken auth = (KerberosServiceRequestToken) authentication;\n\t\tbyte[] token = auth.getToken();\n\t\tLOG.debug(\"Try to validate Kerberos Token\");\n\t\tKerberos...
{ "created": null, "fork": null, "fork_count": 177, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3149437, "size": 1363, "stargazer_count": 128, "stars": null, "updates": null, "url": "https://github.com/spring-projects/spring-security-kerberos" }
3149437_2
{ "fields": [ { "declarator": "provider", "modifier": "private", "original_string": "private KerberosAuthenticationProvider provider;", "type": "KerberosAuthenticationProvider", "var_name": "provider" }, { "declarator": "kerberosClient", "modifier": "private", ...
{ "body": "@Test\n public void testLoginOk() throws Exception {\n when(userDetailsService.loadUserByUsername(TEST_USER)).thenReturn(USER_DETAILS);\n when(kerberosClient.login(TEST_USER, TEST_PASSWORD)).thenReturn(JAAS_SUBJECT_HOLDER);\n\n Authentication authenticate = provider.authenticate(INP...
{ "fields": [ { "declarator": "kerberosClient", "modifier": "private", "original_string": "private KerberosClient kerberosClient;", "type": "KerberosClient", "var_name": "kerberosClient" }, { "declarator": "userDetailsService", "modifier": "private", "origin...
{ "body": "@Override\n public Authentication authenticate(Authentication authentication) throws AuthenticationException {\n\t\tUsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;\n\t\tJaasSubjectHolder subjectHolder = kerberosClient.login(auth.getName(), auth.getCredent...
{ "created": null, "fork": null, "fork_count": 177, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3149437, "size": 1363, "stargazer_count": 128, "stars": null, "updates": null, "url": "https://github.com/spring-projects/spring-security-kerberos" }
47405371_5
{ "fields": [ { "declarator": "joinPoint", "modifier": "@Mock", "original_string": "@Mock ProceedingJoinPoint joinPoint;", "type": "ProceedingJoinPoint", "var_name": "joinPoint" }, { "declarator": "methodSignature", "modifier": "@Mock", "original_string": "@...
{ "body": "@Test public void trackableAttributeForCurrentClass() throws Throwable {\n class Foo implements Trackable {\n\n @Override public Map<String, Object> getTrackableAttributes() {\n Map<String, Object> map = new HashMap<>();\n map.put(\"key\", \"value\");\n return map;\n }\n\n...
{ "fields": [ { "declarator": "aspectListener", "modifier": "private static", "original_string": "private static AspectListener aspectListener;", "type": "AspectListener", "var_name": "aspectListener" } ], "file": "tracklytics-runtime/src/main/java/com/orhanobut/tracklytics/T...
{ "body": "@Around(\"methodAnnotatedWithTrackEvent() || constructorAnnotatedTrackEvent()\")\n public Object weaveJoinPointTrackEvent(ProceedingJoinPoint joinPoint) throws Throwable {\n Object result = joinPoint.proceed();\n\n // Local attributes\n final Map<String, Object> attributes = new HashMap<>();\n\n ...
{ "created": null, "fork": null, "fork_count": 40, "is_fork": false, "language": "Java", "license": "Apache License 2.0", "repo_id": 47405371, "size": 442, "stargazer_count": 409, "stars": null, "updates": null, "url": "https://github.com/orhanobut/tracklytics" }
47405371_4
{ "fields": [ { "declarator": "joinPoint", "modifier": "@Mock", "original_string": "@Mock ProceedingJoinPoint joinPoint;", "type": "ProceedingJoinPoint", "var_name": "joinPoint" }, { "declarator": "methodSignature", "modifier": "@Mock", "original_string": "@...
{ "body": "@Test public void methodParameterWithoutAnnotation() throws Throwable {\n class Foo {\n @TrackEvent(\"title\") public void foo(@Attribute(\"Key\") String bar, String param2) {\n }\n }\n\n when(joinPoint.getArgs()).thenReturn(new Object[]{\"sdfsd\"});\n\n invokeMethod(Foo.class, \"foo\...
{ "fields": [ { "declarator": "aspectListener", "modifier": "private static", "original_string": "private static AspectListener aspectListener;", "type": "AspectListener", "var_name": "aspectListener" } ], "file": "tracklytics-runtime/src/main/java/com/orhanobut/tracklytics/T...
{ "body": "@Around(\"methodAnnotatedWithTrackEvent() || constructorAnnotatedTrackEvent()\")\n public Object weaveJoinPointTrackEvent(ProceedingJoinPoint joinPoint) throws Throwable {\n Object result = joinPoint.proceed();\n\n // Local attributes\n final Map<String, Object> attributes = new HashMap<>();\n\n ...
{ "created": null, "fork": null, "fork_count": 40, "is_fork": false, "language": "Java", "license": "Apache License 2.0", "repo_id": 47405371, "size": 442, "stargazer_count": 409, "stars": null, "updates": null, "url": "https://github.com/orhanobut/tracklytics" }
47405371_8
{ "fields": [], "file": "tracklytics-runtime/src/test/java/com/orhanobut/tracklytics/EventTest.java", "identifier": "EventTest", "interfaces": "", "superclass": "" }
{ "body": "@Test public void getAllAttributes() {\n Map<String, Object> attributes = new HashMap<>();\n attributes.put(\"key\", \"value\");\n\n Map<String, Object> superAttributes = new HashMap<>();\n superAttributes.put(\"key1\", \"value1\");\n\n Event event = new Event(\"event_name\", null, null, att...
{ "fields": [ { "declarator": "name", "modifier": "public final", "original_string": "public final String name;", "type": "String", "var_name": "name" }, { "declarator": "filters", "modifier": "public final", "original_string": "public final int[] filters;",...
{ "body": "public Map<String, Object> getAllAttributes() {\n Map<String, Object> allAttributes = new HashMap<>();\n allAttributes.putAll(attributes);\n allAttributes.putAll(superAttributes);\n return allAttributes;\n }", "class_method_signature": "Event.getAllAttributes()", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 40, "is_fork": false, "language": "Java", "license": "Apache License 2.0", "repo_id": 47405371, "size": 442, "stargazer_count": 409, "stars": null, "updates": null, "url": "https://github.com/orhanobut/tracklytics" }
47405371_3
{ "fields": [ { "declarator": "eventSubscriber", "modifier": "@Mock", "original_string": "@Mock EventSubscriber eventSubscriber;", "type": "EventSubscriber", "var_name": "eventSubscriber" }, { "declarator": "trackEvent", "modifier": "@Mock", "original_string...
{ "body": "@Test public void log() throws Throwable {\n EventLogListener logger = mock(EventLogListener.class);\n tracklytics.setEventLogListener(logger);\n\n Map<String, Object> attributes = new HashMap<>();\n attributes.put(\"key\", \"value\");\n\n tracklytics.trackEvent(\"event\", attributes);\n\n ...
{ "fields": [ { "declarator": "superAttributes = new HashMap<>()", "modifier": "private final", "original_string": "private final Map<String, Object> superAttributes = new HashMap<>();", "type": "Map<String, Object>", "var_name": "superAttributes" }, { "declarator": "ev...
{ "body": "private void log(Event event) {\n if (logger == null) return;\n\n @SuppressWarnings(\"StringBufferReplaceableByString\")\n StringBuilder builder = new StringBuilder()\n .append(event.name)\n .append(\"-> \")\n .append(event.attributes.toString())\n .append(\", super att...
{ "created": null, "fork": null, "fork_count": 40, "is_fork": false, "language": "Java", "license": "Apache License 2.0", "repo_id": 47405371, "size": 442, "stargazer_count": 409, "stars": null, "updates": null, "url": "https://github.com/orhanobut/tracklytics" }
47405371_2
{ "fields": [ { "declarator": "eventSubscriber", "modifier": "@Mock", "original_string": "@Mock EventSubscriber eventSubscriber;", "type": "EventSubscriber", "var_name": "eventSubscriber" }, { "declarator": "trackEvent", "modifier": "@Mock", "original_string...
{ "body": "@Test public void trackWithEvent() {\n tracklytics.trackEvent(\"event_name\");\n\n verify(eventSubscriber).onEventTracked(eventCaptor.capture());\n\n assertThat(eventCaptor.getValue().name).isEqualTo(\"event_name\");\n assertThat(eventCaptor.getValue().attributes).isNull();\n }", "class_meth...
{ "fields": [ { "declarator": "superAttributes = new HashMap<>()", "modifier": "private final", "original_string": "private final Map<String, Object> superAttributes = new HashMap<>();", "type": "Map<String, Object>", "var_name": "superAttributes" }, { "declarator": "ev...
{ "body": "public void trackEvent(String eventName) {\n trackEvent(new Event(eventName, null, null, null, superAttributes));\n }", "class_method_signature": "Tracklytics.trackEvent(String eventName)", "constructor": false, "full_signature": "public void trackEvent(String eventName)", "identifier": "trackE...
{ "created": null, "fork": null, "fork_count": 40, "is_fork": false, "language": "Java", "license": "Apache License 2.0", "repo_id": 47405371, "size": 442, "stargazer_count": 409, "stars": null, "updates": null, "url": "https://github.com/orhanobut/tracklytics" }
47405371_1
{ "fields": [ { "declarator": "eventSubscriber", "modifier": "@Mock", "original_string": "@Mock EventSubscriber eventSubscriber;", "type": "EventSubscriber", "var_name": "eventSubscriber" }, { "declarator": "trackEvent", "modifier": "@Mock", "original_string...
{ "body": "@Test public void trackFromAspectEvent() throws Throwable {\n class Foo {\n @TrackEvent(\"event_name\") public void foo() {\n }\n }\n TrackEvent trackEvent = Foo.class.getMethod(\"foo\").getAnnotation(TrackEvent.class);\n\n Map<String, Object> attributes = new HashMap<>();\n attrib...
{ "fields": [ { "declarator": "superAttributes = new HashMap<>()", "modifier": "private final", "original_string": "private final Map<String, Object> superAttributes = new HashMap<>();", "type": "Map<String, Object>", "var_name": "superAttributes" }, { "declarator": "ev...
{ "body": "@Override public void onAspectEventTriggered(TrackEvent trackEvent, Map<String, Object> attributes) {\n trackEvent(new Event(trackEvent, attributes, superAttributes));\n }", "class_method_signature": "Tracklytics.onAspectEventTriggered(TrackEvent trackEvent, Map<String, Object> attributes)", "const...
{ "created": null, "fork": null, "fork_count": 40, "is_fork": false, "language": "Java", "license": "Apache License 2.0", "repo_id": 47405371, "size": 442, "stargazer_count": 409, "stars": null, "updates": null, "url": "https://github.com/orhanobut/tracklytics" }
47405371_0
{ "fields": [ { "declarator": "eventSubscriber", "modifier": "@Mock", "original_string": "@Mock EventSubscriber eventSubscriber;", "type": "EventSubscriber", "var_name": "eventSubscriber" }, { "declarator": "trackEvent", "modifier": "@Mock", "original_string...
{ "body": "@Test public void trackWithoutAnnotation() {\n Map<String, Object> attributes = new HashMap<>();\n attributes.put(\"key\", \"value\");\n\n tracklytics.trackEvent(\"event_name\", attributes);\n\n verify(eventSubscriber).onEventTracked(eventCaptor.capture());\n\n assertThat(eventCaptor.getValu...
{ "fields": [ { "declarator": "superAttributes = new HashMap<>()", "modifier": "private final", "original_string": "private final Map<String, Object> superAttributes = new HashMap<>();", "type": "Map<String, Object>", "var_name": "superAttributes" }, { "declarator": "ev...
{ "body": "public void trackEvent(String eventName) {\n trackEvent(new Event(eventName, null, null, null, superAttributes));\n }", "class_method_signature": "Tracklytics.trackEvent(String eventName)", "constructor": false, "full_signature": "public void trackEvent(String eventName)", "identifier": "trackE...
{ "created": null, "fork": null, "fork_count": 40, "is_fork": false, "language": "Java", "license": "Apache License 2.0", "repo_id": 47405371, "size": 442, "stargazer_count": 409, "stars": null, "updates": null, "url": "https://github.com/orhanobut/tracklytics" }
47405371_7
{ "fields": [ { "declarator": "joinPoint", "modifier": "@Mock", "original_string": "@Mock ProceedingJoinPoint joinPoint;", "type": "ProceedingJoinPoint", "var_name": "joinPoint" }, { "declarator": "methodSignature", "modifier": "@Mock", "original_string": "@...
{ "body": "@Test public void useThisClassWhenCalledFromSuperClass() throws Throwable {\n @FixedAttribute(key = \"key0\", value = \"value0\")\n class Base {\n\n @TrackEvent(\"event\")\n public void base() {\n }\n }\n\n @FixedAttribute(key = \"key\", value = \"value\")\n @FixedAttributes(\...
{ "fields": [ { "declarator": "aspectListener", "modifier": "private static", "original_string": "private static AspectListener aspectListener;", "type": "AspectListener", "var_name": "aspectListener" } ], "file": "tracklytics-runtime/src/main/java/com/orhanobut/tracklytics/T...
{ "body": "@Around(\"methodAnnotatedWithTrackEvent() || constructorAnnotatedTrackEvent()\")\n public Object weaveJoinPointTrackEvent(ProceedingJoinPoint joinPoint) throws Throwable {\n Object result = joinPoint.proceed();\n\n // Local attributes\n final Map<String, Object> attributes = new HashMap<>();\n\n ...
{ "created": null, "fork": null, "fork_count": 40, "is_fork": false, "language": "Java", "license": "Apache License 2.0", "repo_id": 47405371, "size": 442, "stargazer_count": 409, "stars": null, "updates": null, "url": "https://github.com/orhanobut/tracklytics" }
47405371_6
{ "fields": [ { "declarator": "joinPoint", "modifier": "@Mock", "original_string": "@Mock ProceedingJoinPoint joinPoint;", "type": "ProceedingJoinPoint", "var_name": "joinPoint" }, { "declarator": "methodSignature", "modifier": "@Mock", "original_string": "@...
{ "body": "@Test public void ignoreNullValueOnTrackableAttributeForCurrentClass() throws Throwable {\n class Foo implements Trackable {\n\n @Override public Map<String, Object> getTrackableAttributes() {\n return null;\n }\n\n @TrackEvent(\"event\")\n @TrackableAttribute\n public vo...
{ "fields": [ { "declarator": "aspectListener", "modifier": "private static", "original_string": "private static AspectListener aspectListener;", "type": "AspectListener", "var_name": "aspectListener" } ], "file": "tracklytics-runtime/src/main/java/com/orhanobut/tracklytics/T...
{ "body": "@Around(\"methodAnnotatedWithTrackEvent() || constructorAnnotatedTrackEvent()\")\n public Object weaveJoinPointTrackEvent(ProceedingJoinPoint joinPoint) throws Throwable {\n Object result = joinPoint.proceed();\n\n // Local attributes\n final Map<String, Object> attributes = new HashMap<>();\n\n ...
{ "created": null, "fork": null, "fork_count": 40, "is_fork": false, "language": "Java", "license": "Apache License 2.0", "repo_id": 47405371, "size": 442, "stargazer_count": 409, "stars": null, "updates": null, "url": "https://github.com/orhanobut/tracklytics" }
12544638_1
{ "fields": [ { "declarator": "_folder = new TemporaryFolder()", "modifier": "@Rule public", "original_string": "@Rule public TemporaryFolder _folder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "_folder" }, { "declarator": "_firstJar", "modif...
{ "body": "@Test public void shouldProvideJarUrls () throws MalformedURLException, URISyntaxException\n {\n URL[] actualUrls = _classPath.asUrls();\n assertEquals(_firstJar, new File(actualUrls[0].toURI()));\n assertEquals(_secondJar, new File(actualUrls[1].toURI()));\n }", "class_method_...
{ "fields": [ { "declarator": "_classPathEntries", "modifier": "private final", "original_string": "private final Set<File> _classPathEntries;", "type": "Set<File>", "var_name": "_classPathEntries" } ], "file": "core/src/main/java/com/threerings/getdown/data/ClassPath.java", ...
{ "body": "public URL[] asUrls ()\n {\n URL[] urls = new URL[_classPathEntries.size()];\n int i = 0;\n for (File entry : _classPathEntries) {\n urls[i++] = getURL(entry);\n }\n return urls;\n }", "class_method_signature": "ClassPath.asUrls()", "constructor": fal...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_17
{ "fields": [ { "declarator": "_folder = new TemporaryFolder()", "modifier": "@Rule public", "original_string": "@Rule public TemporaryFolder _folder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "_folder" } ], "file": "core/src/test/java/com/threerings/ge...
{ "body": "@Test public void testReadLines () throws IOException\n {\n String data = \"This is a test\\nof a file with\\na few lines\\n\";\n List<String> lines = FileUtil.readLines(new StringReader(data));\n String[] linesBySplit = data.split(\"\\n\");\n assertEquals(linesBySplit.length...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/util/FileUtil.java", "identifier": "FileUtil", "interfaces": "", "methods": [ { "class_method_signature": "FileUtil.renameTo(File source, File dest)", "constructor": false, "full_signature": "public static boolean renameT...
{ "body": "public static List<String> readLines (Reader in)\n throws IOException\n {\n List<String> lines = new ArrayList<>();\n try (BufferedReader bin = new BufferedReader(in)) {\n for (String line = null; (line = bin.readLine()) != null; lines.add(line)) {}\n }\n re...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_21
{ "fields": [], "file": "core/src/test/java/com/threerings/getdown/util/ColorTest.java", "identifier": "ColorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBrightness() {\n assertEquals(0, Color.brightness(0xFF000000), 0.0000001);\n assertEquals(1, Color.brightness(0xFFFFFFFF), 0.0000001);\n assertEquals(0.0117647, Color.brightness(0xFF010203), 0.0000001);\n assertEquals(1, Color.brightness(0xFF00FFC8), 0...
{ "fields": [ { "declarator": "CLEAR = 0x00000000", "modifier": "public static final", "original_string": "public static final int CLEAR = 0x00000000;", "type": "int", "var_name": "CLEAR" }, { "declarator": "WHITE = 0xFFFFFFFF", "modifier": "public static final", ...
{ "body": "public static float brightness (int argb) {\n // TODO: we're ignoring alpha here...\n int red = (argb >> 16) & 0xFF;\n int green = (argb >> 8) & 0xFF;\n int blue = (argb >> 0) & 0xFF;\n int max = Math.max(Math.max(red, green), blue);\n return ((float) max) / 255.0f...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_20
{ "fields": [], "file": "core/src/test/java/com/threerings/getdown/util/StringUtilTest.java", "identifier": "StringUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test public void testCouldBeValidUrl ()\n {\n assertTrue(couldBeValidUrl(\"http://www.foo.com/\"));\n assertTrue(couldBeValidUrl(\"http://www.foo.com/A-B-C/1_2_3/~bar/q.jsp?x=u+i&y=2;3;4#baz%20baz\"));\n assertTrue(couldBeValidUrl(\"https://user:secret@www.foo.com/\"));\n\n ...
{ "fields": [ { "declarator": "XLATE = \"0123456789abcdef\"", "modifier": "protected static final", "original_string": "protected static final String XLATE = \"0123456789abcdef\";", "type": "String", "var_name": "XLATE" } ], "file": "core/src/main/java/com/threerings/getdown/...
{ "body": "public static boolean couldBeValidUrl (String url)\n {\n return url.matches(\"[A-Za-z0-9\\\\-._~:/?#\\\\[\\\\]@!$&'()*+,;=%]+\");\n }", "class_method_signature": "StringUtil.couldBeValidUrl(String url)", "constructor": false, "full_signature": "public static boolean couldBeValidUrl(Strin...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_0
{ "fields": [ { "declarator": "_folder = new TemporaryFolder()", "modifier": "@Rule public", "original_string": "@Rule public TemporaryFolder _folder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "_folder" }, { "declarator": "_firstJar", "modif...
{ "body": "@Test public void shouldCreateValidArgumentString ()\n {\n assertEquals(\n _firstJar.getAbsolutePath() + File.pathSeparator + _secondJar.getAbsolutePath(),\n _classPath.asArgumentString());\n }", "class_method_signature": "ClassPathTest.shouldCreateValidArgumentString()...
{ "fields": [ { "declarator": "_classPathEntries", "modifier": "private final", "original_string": "private final Set<File> _classPathEntries;", "type": "Set<File>", "var_name": "_classPathEntries" } ], "file": "core/src/main/java/com/threerings/getdown/data/ClassPath.java", ...
{ "body": "public String asArgumentString ()\n {\n StringBuilder builder = new StringBuilder();\n String delimiter = \"\";\n for (File entry: _classPathEntries) {\n builder.append(delimiter).append(entry.getAbsolutePath());\n delimiter = File.pathSeparator;\n }\n ...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_16
{ "fields": [], "file": "core/src/test/java/com/threerings/getdown/util/VersionUtilTest.java", "identifier": "VersionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldParseJavaRuntimeVersion ()\n {\n long version = VersionUtil.parseJavaVersion(\n \"(\\\\d+)\\\\.(\\\\d+)\\\\.(\\\\d+)(_\\\\d+)?(-b\\\\d+)?\", \"1.8.0_131-b11\");\n assertEquals(108_013_111, version);\n }", "class_method_signature": "VersionUtilTe...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/util/VersionUtil.java", "identifier": "VersionUtil", "interfaces": "", "methods": [ { "class_method_signature": "VersionUtil.readVersion(File vfile)", "constructor": false, "full_signature": "public static long readVersio...
{ "body": "public static long parseJavaVersion (String versRegex, String versStr)\n {\n Matcher m = Pattern.compile(versRegex).matcher(versStr);\n if (!m.matches()) return 0L;\n\n long vers = 0L;\n for (int ii = 1; ii <= m.groupCount(); ii++) {\n String valstr = m.group(ii);\...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_7
{ "fields": [ { "declarator": "_application", "modifier": "@Mock protected", "original_string": "@Mock protected Application _application;", "type": "Application", "var_name": "_application" }, { "declarator": "_firstJar", "modifier": "@Mock protected", "ori...
{ "body": "@Test public void shouldBuildCachedClassPath () throws IOException\n {\n when(_application.getDigest(_firstJar)).thenReturn(\"first\");\n when(_application.getDigest(_secondJar)).thenReturn(\"second\");\n when(_application.getCodeCacheRetentionDays()).thenReturn(1);\n\n Path ...
{ "fields": [ { "declarator": "CODE_CACHE_DIR = \".cache\"", "modifier": "public static final", "original_string": "public static final String CODE_CACHE_DIR = \".cache\";", "type": "String", "var_name": "CODE_CACHE_DIR" }, { "declarator": "NATIVE_CACHE_DIR = \".ncache\...
{ "body": "public static ClassPath buildCachedClassPath (Application app) throws IOException\n {\n File codeCacheDir = new File(app.getAppDir(), CODE_CACHE_DIR);\n\n // a negative value of code_cache_retention_days allows to clean up the cache forcefully\n long retainMillis = TimeUnit.DAYS.toM...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_11
{ "fields": [], "file": "core/src/test/java/com/threerings/getdown/util/HostWhitelistTest.java", "identifier": "HostWhitelistTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testVerify () throws MalformedURLException\n {\n checkCanVerify(\"foo.com\", \"http://foo.com\", true);\n checkCanVerify(\"foo.com\", \"http://foo.com/\", true);\n checkCanVerify(\"foo.com\", \"http://foo.com/x/y/z\", true);\n checkCanVerify(\"foo.com\"...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/util/HostWhitelist.java", "identifier": "HostWhitelist", "interfaces": "", "methods": [ { "class_method_signature": "HostWhitelist.verify(URL url)", "constructor": false, "full_signature": "public static URL verify(URL ur...
{ "body": "public static URL verify (URL url) throws MalformedURLException\n {\n return verify(Build.hostWhitelist(), url);\n }", "class_method_signature": "HostWhitelist.verify(URL url)", "constructor": false, "full_signature": "public static URL verify(URL url)", "identifier": "verify", "invo...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_6
{ "fields": [ { "declarator": "_application", "modifier": "@Mock protected", "original_string": "@Mock protected Application _application;", "type": "Application", "var_name": "_application" }, { "declarator": "_firstJar", "modifier": "@Mock protected", "ori...
{ "body": "@Test public void shouldBuildDefaultClassPath () throws IOException\n {\n ClassPath classPath = PathBuilder.buildDefaultClassPath(_application);\n String expectedClassPath = _firstJarFile.getAbsolutePath() + File.pathSeparator +\n _secondJarFile.getAbsolutePath();\n asser...
{ "fields": [ { "declarator": "CODE_CACHE_DIR = \".cache\"", "modifier": "public static final", "original_string": "public static final String CODE_CACHE_DIR = \".cache\";", "type": "String", "var_name": "CODE_CACHE_DIR" }, { "declarator": "NATIVE_CACHE_DIR = \".ncache\...
{ "body": "public static ClassPath buildDefaultClassPath (Application app)\n {\n LinkedHashSet<File> classPathEntries = new LinkedHashSet<File>();\n for (Resource resource : app.getActiveCodeResources()) {\n classPathEntries.add(resource.getFinalTarget());\n }\n addClassPathD...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_10
{ "fields": [ { "declarator": "APPBASES = {\n \"http://foobar.com/myapp\",\n \"https://foobar.com/myapp\",\n \"http://foobar.com:8080/myapp\",\n \"https://foobar.com:8080/myapp\"\n }", "modifier": "private static final", "original_string": "private static final Str...
{ "body": "@Test public void testAppbaseOverride () {\n System.setProperty(\"appbase_override\", \"https://barbaz.com/newapp\");\n for (String appbase : APPBASES) {\n assertEquals(\"https://barbaz.com/newapp\", SysProps.overrideAppbase(appbase));\n }\n }", "class_method_signature"...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/data/SysProps.java", "identifier": "SysProps", "interfaces": "", "methods": [ { "class_method_signature": "SysProps.appDir()", "constructor": false, "full_signature": "public static String appDir()", "identifier": "...
{ "body": "public static String appbaseOverride () {\n return System.getProperty(\"appbase_override\");\n }", "class_method_signature": "SysProps.appbaseOverride()", "constructor": false, "full_signature": "public static String appbaseOverride()", "identifier": "appbaseOverride", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_26
{ "fields": [ { "declarator": "extension", "modifier": "@Parameterized.Parameter\n public", "original_string": "@Parameterized.Parameter\n public String extension;", "type": "String", "var_name": "extension" }, { "declarator": "_folder = new TemporaryFolder()", ...
{ "body": "@Test public void shouldRememberWhenFileWasRequested () throws Exception\n {\n File cachedFile = cacheFile();\n String name = cachedFile.getName() + ResourceCache.LAST_ACCESSED_FILE_SUFFIX;\n File lastAccessedFile = new File(cachedFile.getParentFile(), name);\n lastAccessedFi...
{ "fields": [ { "declarator": "_cacheDir", "modifier": "private final", "original_string": "private final File _cacheDir;", "type": "File", "var_name": "_cacheDir" }, { "declarator": "LAST_ACCESSED_FILE_SUFFIX = \".lastAccessed\"", "modifier": "static final", ...
{ "body": "public File cacheFile (File fileToCache, String cacheSubdir, String digest) throws IOException\n {\n File cacheLocation = new File(_cacheDir, cacheSubdir);\n createDirectoryIfNecessary(cacheLocation);\n\n File cachedFile = new File(cacheLocation, digest + getFileSuffix(fileToCache))...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_9
{ "fields": [ { "declarator": "APPBASES = {\n \"http://foobar.com/myapp\",\n \"https://foobar.com/myapp\",\n \"http://foobar.com:8080/myapp\",\n \"https://foobar.com:8080/myapp\"\n }", "modifier": "private static final", "original_string": "private static final Str...
{ "body": "@Test public void testAppbaseDomain () {\n System.setProperty(\"appbase_domain\", \"https://barbaz.com\");\n for (String appbase : APPBASES) {\n assertEquals(\"https://barbaz.com/myapp\", SysProps.overrideAppbase(appbase));\n }\n System.setProperty(\"appbase_domain\",...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/data/SysProps.java", "identifier": "SysProps", "interfaces": "", "methods": [ { "class_method_signature": "SysProps.appDir()", "constructor": false, "full_signature": "public static String appDir()", "identifier": "...
{ "body": "public static String appbaseDomain () {\n return System.getProperty(\"appbase_domain\");\n }", "class_method_signature": "SysProps.appbaseDomain()", "constructor": false, "full_signature": "public static String appbaseDomain()", "identifier": "appbaseDomain", "invocations": [ "getPr...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_25
{ "fields": [ { "declarator": "extension", "modifier": "@Parameterized.Parameter\n public", "original_string": "@Parameterized.Parameter\n public String extension;", "type": "String", "var_name": "extension" }, { "declarator": "_folder = new TemporaryFolder()", ...
{ "body": "@Test public void shouldNotCacheTheSameFile () throws Exception\n {\n File cachedFile = cacheFile();\n cachedFile.setLastModified(YESTERDAY);\n long expectedLastModified = cachedFile.lastModified();\n // caching it another time\n File sameCachedFile = cacheFile();\n ...
{ "fields": [ { "declarator": "_cacheDir", "modifier": "private final", "original_string": "private final File _cacheDir;", "type": "File", "var_name": "_cacheDir" }, { "declarator": "LAST_ACCESSED_FILE_SUFFIX = \".lastAccessed\"", "modifier": "static final", ...
{ "body": "public File cacheFile (File fileToCache, String cacheSubdir, String digest) throws IOException\n {\n File cacheLocation = new File(_cacheDir, cacheSubdir);\n createDirectoryIfNecessary(cacheLocation);\n\n File cachedFile = new File(cacheLocation, digest + getFileSuffix(fileToCache))...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_13
{ "fields": [], "file": "core/src/test/java/com/threerings/getdown/util/VersionUtilTest.java", "identifier": "VersionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldParseJavaVersion8 ()\n {\n long version = VersionUtil.parseJavaVersion(\n \"(\\\\d+)(?:\\\\.(\\\\d+)(?:\\\\.(\\\\d+)(_\\\\d+)?)?)?\", \"1.8\");\n assertEquals(1_080_000, version);\n }", "class_method_signature": "VersionUtilTest.shouldParseJavaV...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/util/VersionUtil.java", "identifier": "VersionUtil", "interfaces": "", "methods": [ { "class_method_signature": "VersionUtil.readVersion(File vfile)", "constructor": false, "full_signature": "public static long readVersio...
{ "body": "public static long parseJavaVersion (String versRegex, String versStr)\n {\n Matcher m = Pattern.compile(versRegex).matcher(versStr);\n if (!m.matches()) return 0L;\n\n long vers = 0L;\n for (int ii = 1; ii <= m.groupCount(); ii++) {\n String valstr = m.group(ii);\...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_5
{ "fields": [ { "declarator": "CWD = System.getProperty(\"user.dir\")", "modifier": "static", "original_string": "static String CWD = System.getProperty(\"user.dir\");", "type": "String", "var_name": "CWD" }, { "declarator": "TESTID = \"testid\"", "modifier": "sta...
{ "body": "@Test public void testArgvDirIdArgs () {\n List<EnvConfig.Note> notes = new ArrayList<>();\n String[] args = { CWD, TESTID, \"one\", \"two\" };\n EnvConfig cfg = EnvConfig.create(args, notes);\n // debugNotes(notes);\n checkNoNotes(notes);\n checkDir(cfg);\n ...
{ "fields": [ { "declarator": "appDir", "modifier": "public final", "original_string": "public final File appDir;", "type": "File", "var_name": "appDir" }, { "declarator": "appId", "modifier": "public final", "original_string": "public final String appId;", ...
{ "body": "public static EnvConfig create (String[] argv, List<Note> notes) {\n String appDir = null, appDirProv = null;\n String appId = null, appIdProv = null;\n String appBase = null, appBaseProv = null;\n\n // start with bootstrap.properties config, if avaialble\n try {\n ...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_12
{ "fields": [], "file": "core/src/test/java/com/threerings/getdown/util/VersionUtilTest.java", "identifier": "VersionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldParseJavaVersion ()\n {\n long version = VersionUtil.parseJavaVersion(\n \"(\\\\d+)(?:\\\\.(\\\\d+)(?:\\\\.(\\\\d+)(_\\\\d+)?)?)?\", \"1.8.0_152\");\n assertEquals(1_080_152, version);\n }", "class_method_signature": "VersionUtilTest.shouldParse...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/util/VersionUtil.java", "identifier": "VersionUtil", "interfaces": "", "methods": [ { "class_method_signature": "VersionUtil.readVersion(File vfile)", "constructor": false, "full_signature": "public static long readVersio...
{ "body": "public static long parseJavaVersion (String versRegex, String versStr)\n {\n Matcher m = Pattern.compile(versRegex).matcher(versStr);\n if (!m.matches()) return 0L;\n\n long vers = 0L;\n for (int ii = 1; ii <= m.groupCount(); ii++) {\n String valstr = m.group(ii);\...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_4
{ "fields": [ { "declarator": "CWD = System.getProperty(\"user.dir\")", "modifier": "static", "original_string": "static String CWD = System.getProperty(\"user.dir\");", "type": "String", "var_name": "CWD" }, { "declarator": "TESTID = \"testid\"", "modifier": "sta...
{ "body": "@Test public void testArgvDirArgs () {\n List<EnvConfig.Note> notes = new ArrayList<>();\n String[] args = { CWD, \"\", \"one\", \"two\" };\n EnvConfig cfg = EnvConfig.create(args, notes);\n // debugNotes(notes);\n checkNoNotes(notes);\n checkDir(cfg);\n che...
{ "fields": [ { "declarator": "appDir", "modifier": "public final", "original_string": "public final File appDir;", "type": "File", "var_name": "appDir" }, { "declarator": "appId", "modifier": "public final", "original_string": "public final String appId;", ...
{ "body": "public static EnvConfig create (String[] argv, List<Note> notes) {\n String appDir = null, appDirProv = null;\n String appId = null, appIdProv = null;\n String appBase = null, appBaseProv = null;\n\n // start with bootstrap.properties config, if avaialble\n try {\n ...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_24
{ "fields": [ { "declarator": "extension", "modifier": "@Parameterized.Parameter\n public", "original_string": "@Parameterized.Parameter\n public String extension;", "type": "String", "var_name": "extension" }, { "declarator": "_folder = new TemporaryFolder()", ...
{ "body": "@Test public void shouldTrackFileUsage () throws IOException\n {\n String name = \"abc123\" + extension + ResourceCache.LAST_ACCESSED_FILE_SUFFIX;\n File lastAccessedFile = new File(cacheFile().getParentFile(), name);\n assertTrue(lastAccessedFile.exists());\n }", "class_method...
{ "fields": [ { "declarator": "_cacheDir", "modifier": "private final", "original_string": "private final File _cacheDir;", "type": "File", "var_name": "_cacheDir" }, { "declarator": "LAST_ACCESSED_FILE_SUFFIX = \".lastAccessed\"", "modifier": "static final", ...
{ "body": "public File cacheFile (File fileToCache, String cacheSubdir, String digest) throws IOException\n {\n File cacheLocation = new File(_cacheDir, cacheSubdir);\n createDirectoryIfNecessary(cacheLocation);\n\n File cachedFile = new File(cacheLocation, digest + getFileSuffix(fileToCache))...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_8
{ "fields": [ { "declarator": "APPBASES = {\n \"http://foobar.com/myapp\",\n \"https://foobar.com/myapp\",\n \"http://foobar.com:8080/myapp\",\n \"https://foobar.com:8080/myapp\"\n }", "modifier": "private static final", "original_string": "private static final Str...
{ "body": "@Test public void testStartDelay () {\n\n assertEquals(0, SysProps.startDelay());\n\n System.setProperty(\"delay\", \"x\");\n assertEquals(0, SysProps.startDelay());\n\n System.setProperty(\"delay\", \"-7\");\n assertEquals(0, SysProps.startDelay());\n\n System.set...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/data/SysProps.java", "identifier": "SysProps", "interfaces": "", "methods": [ { "class_method_signature": "SysProps.appDir()", "constructor": false, "full_signature": "public static String appDir()", "identifier": "...
{ "body": "public static int startDelay () {\n return Math.min(Math.max(Integer.getInteger(\"delay\", 0), 0), 60 * 24);\n }", "class_method_signature": "SysProps.startDelay()", "constructor": false, "full_signature": "public static int startDelay()", "identifier": "startDelay", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_15
{ "fields": [], "file": "core/src/test/java/com/threerings/getdown/util/VersionUtilTest.java", "identifier": "VersionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldParseJavaVersion10 ()\n {\n long version = VersionUtil.parseJavaVersion(\n \"(\\\\d+)(?:\\\\.(\\\\d+)(?:\\\\.(\\\\d+)(_\\\\d+)?)?)?\", \"10\");\n assertEquals(10_000_000, version);\n }", "class_method_signature": "VersionUtilTest.shouldParseJava...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/util/VersionUtil.java", "identifier": "VersionUtil", "interfaces": "", "methods": [ { "class_method_signature": "VersionUtil.readVersion(File vfile)", "constructor": false, "full_signature": "public static long readVersio...
{ "body": "public static long parseJavaVersion (String versRegex, String versStr)\n {\n Matcher m = Pattern.compile(versRegex).matcher(versStr);\n if (!m.matches()) return 0L;\n\n long vers = 0L;\n for (int ii = 1; ii <= m.groupCount(); ii++) {\n String valstr = m.group(ii);\...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_3
{ "fields": [ { "declarator": "CWD = System.getProperty(\"user.dir\")", "modifier": "static", "original_string": "static String CWD = System.getProperty(\"user.dir\");", "type": "String", "var_name": "CWD" }, { "declarator": "TESTID = \"testid\"", "modifier": "sta...
{ "body": "@Test public void testArgvDirId () {\n List<EnvConfig.Note> notes = new ArrayList<>();\n String[] args = { CWD, TESTID };\n EnvConfig cfg = EnvConfig.create(args, notes);\n // debugNotes(notes);\n checkNoNotes(notes);\n checkDir(cfg);\n checkAppId(cfg, TESTI...
{ "fields": [ { "declarator": "appDir", "modifier": "public final", "original_string": "public final File appDir;", "type": "File", "var_name": "appDir" }, { "declarator": "appId", "modifier": "public final", "original_string": "public final String appId;", ...
{ "body": "public static EnvConfig create (String[] argv, List<Note> notes) {\n String appDir = null, appDirProv = null;\n String appId = null, appIdProv = null;\n String appBase = null, appBaseProv = null;\n\n // start with bootstrap.properties config, if avaialble\n try {\n ...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_19
{ "fields": [ { "declarator": "_folder = new TemporaryFolder()", "modifier": "@Rule public", "original_string": "@Rule public TemporaryFolder _folder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "_folder" } ], "file": "core/src/test/java/com/threerings/ge...
{ "body": "@Test public void shouldRecursivelyWalkOverFilesAndFolders () throws IOException\n {\n _folder.newFile(\"a.txt\");\n new File(_folder.newFolder(\"b\"), \"b.txt\").createNewFile();\n\n class CountingVisitor implements FileUtil.Visitor {\n int fileCount = 0;\n @O...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/util/FileUtil.java", "identifier": "FileUtil", "interfaces": "", "methods": [ { "class_method_signature": "FileUtil.renameTo(File source, File dest)", "constructor": false, "full_signature": "public static boolean renameT...
{ "body": "public static void walkTree (File root, Visitor visitor)\n {\n File[] children = root.listFiles();\n if (children == null) return;\n Deque<File> stack = new ArrayDeque<>(Arrays.asList(children));\n while (!stack.isEmpty()) {\n File currentFile = stack.pop();\n ...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_23
{ "fields": [ { "declarator": "extension", "modifier": "@Parameterized.Parameter\n public", "original_string": "@Parameterized.Parameter\n public String extension;", "type": "String", "var_name": "extension" }, { "declarator": "_folder = new TemporaryFolder()", ...
{ "body": "@Test public void shouldCacheFile () throws IOException\n {\n assertEquals(\"abc123\" + extension, cacheFile().getName());\n }", "class_method_signature": "ResourceCacheTest.shouldCacheFile()", "constructor": false, "full_signature": "@Test public void shouldCacheFile()", "identifier":...
{ "fields": [ { "declarator": "_cacheDir", "modifier": "private final", "original_string": "private final File _cacheDir;", "type": "File", "var_name": "_cacheDir" }, { "declarator": "LAST_ACCESSED_FILE_SUFFIX = \".lastAccessed\"", "modifier": "static final", ...
{ "body": "public File cacheFile (File fileToCache, String cacheSubdir, String digest) throws IOException\n {\n File cacheLocation = new File(_cacheDir, cacheSubdir);\n createDirectoryIfNecessary(cacheLocation);\n\n File cachedFile = new File(cacheLocation, digest + getFileSuffix(fileToCache))...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_22
{ "fields": [ { "declarator": "extension", "modifier": "@Parameterized.Parameter\n public", "original_string": "@Parameterized.Parameter\n public String extension;", "type": "String", "var_name": "extension" }, { "declarator": "_folder = new TemporaryFolder()", ...
{ "body": "@Test public void shouldKeepFilesInCacheIfRententionPeriodIsNotReached ()\n {\n GarbageCollector.collect(_folder.getRoot(), TimeUnit.DAYS.toMillis(1));\n assertTrue(_cachedFile.exists());\n assertTrue(_lastAccessedFile.exists());\n }", "class_method_signature": "GarbageCollecto...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/cache/GarbageCollector.java", "identifier": "GarbageCollector", "interfaces": "", "methods": [ { "class_method_signature": "GarbageCollector.collect(File cacheDir, final long retentionPeriodMillis)", "constructor": false, ...
{ "body": "public static void collect (File cacheDir, final long retentionPeriodMillis)\n {\n FileUtil.walkTree(cacheDir, new FileUtil.Visitor() {\n @Override public void visit (File file) {\n File cachedFile = getCachedFile(file);\n File lastAccessedFile = getLastAc...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_18
{ "fields": [ { "declarator": "_folder = new TemporaryFolder()", "modifier": "@Rule public", "original_string": "@Rule public TemporaryFolder _folder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "_folder" } ], "file": "core/src/test/java/com/threerings/ge...
{ "body": "@Test public void shouldCopyFile () throws IOException\n {\n File source = _folder.newFile(\"source.txt\");\n File target = new File(_folder.getRoot(), \"target.txt\");\n assertFalse(target.exists());\n FileUtil.copy(source, target);\n assertTrue(target.exists());\n ...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/util/FileUtil.java", "identifier": "FileUtil", "interfaces": "", "methods": [ { "class_method_signature": "FileUtil.renameTo(File source, File dest)", "constructor": false, "full_signature": "public static boolean renameT...
{ "body": "public static void copy (File source, File target) throws IOException {\n try (FileInputStream in = new FileInputStream(source);\n FileOutputStream out = new FileOutputStream(target)) {\n StreamUtil.copy(in, out);\n }\n }", "class_method_signature": "FileUtil.copy(...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_14
{ "fields": [], "file": "core/src/test/java/com/threerings/getdown/util/VersionUtilTest.java", "identifier": "VersionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldParseJavaVersion9 ()\n {\n long version = VersionUtil.parseJavaVersion(\n \"(\\\\d+)(?:\\\\.(\\\\d+)(?:\\\\.(\\\\d+)(_\\\\d+)?)?)?\", \"9\");\n assertEquals(9_000_000, version);\n }", "class_method_signature": "VersionUtilTest.shouldParseJavaVer...
{ "fields": [], "file": "core/src/main/java/com/threerings/getdown/util/VersionUtil.java", "identifier": "VersionUtil", "interfaces": "", "methods": [ { "class_method_signature": "VersionUtil.readVersion(File vfile)", "constructor": false, "full_signature": "public static long readVersio...
{ "body": "public static long parseJavaVersion (String versRegex, String versStr)\n {\n Matcher m = Pattern.compile(versRegex).matcher(versStr);\n if (!m.matches()) return 0L;\n\n long vers = 0L;\n for (int ii = 1; ii <= m.groupCount(); ii++) {\n String valstr = m.group(ii);\...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
12544638_2
{ "fields": [ { "declarator": "CWD = System.getProperty(\"user.dir\")", "modifier": "static", "original_string": "static String CWD = System.getProperty(\"user.dir\");", "type": "String", "var_name": "CWD" }, { "declarator": "TESTID = \"testid\"", "modifier": "sta...
{ "body": "@Test public void testArgvDir () {\n List<EnvConfig.Note> notes = new ArrayList<>();\n String[] args = { CWD };\n EnvConfig cfg = EnvConfig.create(args, notes);\n // debugNotes(notes);\n checkNoNotes(notes);\n checkDir(cfg);\n checkNoAppId(cfg);\n che...
{ "fields": [ { "declarator": "appDir", "modifier": "public final", "original_string": "public final File appDir;", "type": "File", "var_name": "appDir" }, { "declarator": "appId", "modifier": "public final", "original_string": "public final String appId;", ...
{ "body": "public static EnvConfig create (String[] argv, List<Note> notes) {\n String appDir = null, appDirProv = null;\n String appId = null, appIdProv = null;\n String appBase = null, appBaseProv = null;\n\n // start with bootstrap.properties config, if avaialble\n try {\n ...
{ "created": null, "fork": null, "fork_count": 114, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12544638, "size": 3100, "stargazer_count": 389, "stars": null, "updates": null, "url": "https://github.com/threerings/getdown" }
3040093_9
{ "fields": [], "file": "result-spi/src/test/java/no/sesat/search/result/StringChopperTest.java", "identifier": "StringChopperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void CDATA() {\n assertEquals(\"<b>and<![CDATA[ <xml>&& fisk]]> <br/>wonk</b>\", StringChopper.chop(\"<b>and<![CDATA[ <xml>&& fisk]]> <br/>wonk\", -1, true));\n }", "class_method_signature": "StringChopperTest.CDATA()", "constructor": false, "full_signature": "@Test public...
{ "fields": [], "file": "result-spi/src/main/java/no/sesat/search/result/StringChopper.java", "identifier": "StringChopper", "interfaces": "", "methods": [ { "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "pub...
{ "body": "public static String chop(final String input, final int length) {\n return chop(input, length, false);\n }", "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "public static String chop(final String input, final int...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_5
{ "fields": [], "file": "result-spi/src/test/java/no/sesat/search/result/StringChopperTest.java", "identifier": "StringChopperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void Simple() {\n assertEquals(\"<b>and</b><br/>fisk\", StringChopper.chop(\"<b>and</b><br/>fisk\", -1, true));\n assertEquals(\"<b>and</b><br/>fisk\", StringChopper.chop(\"<b>and</b><br/>fisk\", 0, true));\n }", "class_method_signature": "StringChopperTest.Simple()", ...
{ "fields": [], "file": "result-spi/src/main/java/no/sesat/search/result/StringChopper.java", "identifier": "StringChopper", "interfaces": "", "methods": [ { "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "pub...
{ "body": "public static String chop(final String input, final int length) {\n return chop(input, length, false);\n }", "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "public static String chop(final String input, final int...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_17
{ "fields": [ { "declarator": "rule = null", "modifier": "private", "original_string": "private AnalysisRule rule = null;", "type": "AnalysisRule", "var_name": "rule" }, { "declarator": "truePredicate = PredicateUtils.truePredicate()", "modifier": "private", ...
{ "body": "@Test\n public void testAddPredicateScore() {\n rule.addPredicateScore(truePredicate, 0);\n }", "class_method_signature": "AnalysisRuleTest.testAddPredicateScore()", "constructor": false, "full_signature": "@Test public void testAddPredicateScore()", "identifier": "testAddPredicateScor...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(AnalysisRule.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(AnalysisRule.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "predicat...
{ "body": "public void addPredicateScore(final Predicate predicate, final int score) {\n final PredicateScore pScore = new PredicateScore(predicate, score);\n predicates.put(pScore, predicate);\n }", "class_method_signature": "AnalysisRule.addPredicateScore(final Predicate predicate, final int scor...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_16
{ "fields": [ { "declarator": "LOG = Logger.getLogger(FactoryReloadsTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(FactoryReloadsTest.class);", "type": "Logger", "var_name": "LOG" } ], "file": "core-api...
{ "body": "@Test\n public void testRemoveAll() {\n\n FactoryReloads.performReloads(genericContext(), ReloadArg.SITE_CONFIGURATION);\n FactoryReloads.performReloads(genericContext(), ReloadArg.SEARCH_TAB_FACTORY);\n FactoryReloads.performReloads(genericContext(), ReloadArg.SEARCH_MODE_FACTORY);...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(FactoryReloads.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(FactoryReloads.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "WARN...
{ "body": "@SuppressWarnings(\"fallthrough\")\n public static void performReloads(\n final SiteContext genericCxt,\n final ReloadArg reload){\n\n final Site site = genericCxt.getSite();\n\n switch(reload){\n case ALL:\n case SITE_CONFIGURATION:\n\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_4
{ "fields": [], "file": "result-spi/src/test/java/no/sesat/search/result/StringChopperTest.java", "identifier": "StringChopperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void SimpleEmpty() {\n assertEquals(null, StringChopper.chop(null, -1, false));\n assertEquals(\"\", StringChopper.chop(\"\", -1, false));\n assertEquals(\"\", StringChopper.chop(\"\", 0, false));\n assertEquals(\"\", StringChopper.chop(\"\", 1, false));\n ...
{ "fields": [], "file": "result-spi/src/main/java/no/sesat/search/result/StringChopper.java", "identifier": "StringChopper", "interfaces": "", "methods": [ { "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "pub...
{ "body": "public static String chop(final String input, final int length) {\n return chop(input, length, false);\n }", "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "public static String chop(final String input, final int...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_8
{ "fields": [], "file": "result-spi/src/test/java/no/sesat/search/result/StringChopperTest.java", "identifier": "StringChopperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void Unbalanced() {\n assertEquals(\"<b>and</b>\", StringChopper.chop(\"<b>and\", -1, true));\n assertEquals(\"fisk<b>and</b>\", StringChopper.chop(\"fisk<b>and\", -1, true));\n }", "class_method_signature": "StringChopperTest.Unbalanced()", "constructor": false, "f...
{ "fields": [], "file": "result-spi/src/main/java/no/sesat/search/result/StringChopper.java", "identifier": "StringChopper", "interfaces": "", "methods": [ { "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "pub...
{ "body": "public static String chop(final String input, final int length) {\n return chop(input, length, false);\n }", "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "public static String chop(final String input, final int...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_3
{ "fields": [], "file": "run-handler-control-spi/src/test/java/no/sesat/search/run/handler/RunHandlerFactoryTest.java", "identifier": "RunHandlerFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n final public void testGetController() throws Exception {\n final DataModelFactory factory = DataModelFactory.instanceOf(new DataModelFactory.Context() {\n public Site getSite() {\n return Site.DEFAULT;\n }\n\n public PropertiesLoader newProp...
{ "fields": [], "file": "run-handler-control-spi/src/main/java/no/sesat/search/run/handler/RunHandlerFactory.java", "identifier": "RunHandlerFactory", "interfaces": "", "methods": [ { "class_method_signature": "RunHandlerFactory.RunHandlerFactory()", "constructor": true, "full_signature"...
{ "body": "public static RunHandler getController(\n final RunHandler.Context context,\n final RunHandlerConfig config){\n\n final String name = \"no.sesat.search.run.handler.\"\n + config.getClass().getAnnotation(Controller.class).value();\n\n try{\n\n fi...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_11
{ "fields": [], "file": "result-spi/src/test/java/no/sesat/search/result/StringChopperTest.java", "identifier": "StringChopperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void CDATAChopWholeWord() {\n assertEquals(\"<b>and<![CDATA[ <xml>&& ...]]></b>\", StringChopper.chop(\"<b>and<![CDATA[ <xml>&& fisk]]> <br/>wonk\", 14, false));\n }", "class_method_signature": "StringChopperTest.CDATAChopWholeWord()", "constructor": false, "full_signature...
{ "fields": [], "file": "result-spi/src/main/java/no/sesat/search/result/StringChopper.java", "identifier": "StringChopper", "interfaces": "", "methods": [ { "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "pub...
{ "body": "public static String chop(final String input, final int length) {\n return chop(input, length, false);\n }", "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "public static String chop(final String input, final int...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_10
{ "fields": [], "file": "result-spi/src/test/java/no/sesat/search/result/StringChopperTest.java", "identifier": "StringChopperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void CDATAChop() {\n assertEquals(\"<b>and<![CDATA[ <xm]]></b>\", StringChopper.chop(\"<b>and<![CDATA[ <xml>&& fisk]]> <br/>wonk\", 7, true));\n }", "class_method_signature": "StringChopperTest.CDATAChop()", "constructor": false, "full_signature": "@Test public void CDATAC...
{ "fields": [], "file": "result-spi/src/main/java/no/sesat/search/result/StringChopper.java", "identifier": "StringChopper", "interfaces": "", "methods": [ { "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "pub...
{ "body": "public static String chop(final String input, final int length) {\n return chop(input, length, false);\n }", "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "public static String chop(final String input, final int...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_2
{ "fields": [], "file": "generic.sesam/search-command-control/default/src/test/java/no/sesat/search/mode/command/YahooIdpSearchCommandTest.java", "identifier": "YahooIdpSearchCommandTest", "interfaces": "", "superclass": "extends AbstractSearchCommandTest" }
{ "body": "@Test\n public void testSiteRestriction() throws Exception{\n\n assertEquals(\n \"Site filter not found\",\n \"aftonbladet.se\",\n executeTestOfQuery(\"site:aftonbladet.se banan\", \"+banan\", \"+site:aftonbladet.se\")\n .getFilterBuilde...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(YahooIdpSearchCommand.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(YahooIdpSearchCommand.class);", "type": "Logger", "var_name": "LOG" }, { "decl...
{ "body": "@Override\n protected String getFilter() {\n return super.getFilter();\n }", "class_method_signature": "YahooIdpSearchCommand.getFilter()", "constructor": false, "full_signature": "@Override protected String getFilter()", "identifier": "getFilter", "invocations": [ "getFilter" ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_13
{ "fields": [], "file": "result-spi/src/test/java/no/sesat/search/result/StringChopperTest.java", "identifier": "StringChopperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void Directive() {\n assertEquals(\"<?xml version=\\\"1.0\\\" encoding=\\\"iso-8859-1\\\"?><attrib name=\\\"allowed_types\\\"> fisk</attrib>\",\n StringChopper.chop(\"<?xml version=\\\"1.0\\\" encoding=\\\"iso-8859-1\\\"?><attrib name=\\\"allowed_types\\\"> fisk\", -1,...
{ "fields": [], "file": "result-spi/src/main/java/no/sesat/search/result/StringChopper.java", "identifier": "StringChopper", "interfaces": "", "methods": [ { "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "pub...
{ "body": "public static String chop(final String input, final int length) {\n return chop(input, length, false);\n }", "class_method_signature": "StringChopper.chop(final String input, final int length)", "constructor": false, "full_signature": "public static String chop(final String input, final int...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }
3040093_1
{ "fields": [], "file": "generic.sesam/search-command-control/default/src/test/java/no/sesat/search/mode/command/YahooWebSearchCommandTest.java", "identifier": "YahooWebSearchCommandTest", "interfaces": "", "superclass": "extends AbstractSearchCommandTest" }
{ "body": "@Test\n public void testSiteRestriction() throws Exception{\n\n assertEquals(\n \"Site filter not found\",\n \"aftonbladet.se\",\n executeTestOfQuery(\"site:aftonbladet.se banan\", \"banan\", \"+site:aftonbladet.se\")\n .getFilterBuilder...
{ "fields": [ { "declarator": "LOG = Logger.getLogger(YahooWebSearchCommand.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = Logger.getLogger(YahooWebSearchCommand.class);", "type": "Logger", "var_name": "LOG" }, { "decl...
{ "body": "@Override\n protected String getFilter() {\n return super.getFilter();\n }", "class_method_signature": "YahooWebSearchCommand.getFilter()", "constructor": false, "full_signature": "@Override protected String getFilter()", "identifier": "getFilter", "invocations": [ "getFilter" ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 3040093, "size": 17994, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/michaelsembwever/Possom" }