id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
132938098_55
{ "fields": [ { "declarator": "intRange = new IntRange(1, 3)", "modifier": "private static final", "original_string": "private static final IntRange intRange = new IntRange(1, 3);", "type": "IntRange", "var_name": "intRange" }, { "declarator": "bigLong = 1000000000000L"...
{ "body": "@Test\n public void round() {\n assertEquals(1.0d, NumberHelper.round(1.01d, 1), 0.0d);\n assertEquals(1.0d, NumberHelper.round(0.99d, 1), 0.0d);\n assertNotEquals(1.0d, NumberHelper.round(1.51d, 1), 0.0d);\n assertNotEquals(1.0d, NumberHelper.round(0.49d, 1), 0.0d);\n assertEquals(1.0f, Nu...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/NumberHelper.java", "identifier": "NumberHelper", "interfaces": "", "methods": [ { "class_method_signature": "NumberHelper.boundInteger(int toBound, IntRange range)", "constructor": false, "full_signature": "public stat...
{ "body": "public static double round(double value, int decimalPlaces)\n {\n if (decimalPlaces < 0)\n {\n throw new IllegalArgumentException(\n \"decimalPlaces can not be less than 0: \" + decimalPlaces);\n }\n\n return java.math.BigDecimal.valueOf(value).setScale(decimalPlaces, \n j...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_7
{ "fields": [ { "declarator": "props1", "modifier": "", "original_string": "EnhancedProperties props1;", "type": "EnhancedProperties", "var_name": "props1" }, { "declarator": "starting", "modifier": "", "original_string": "Properties starting;", "type"...
{ "body": "@Test\n public void getArray() {\n String[] expected = new String[] { \"hello\",\"world\" };\n String[] empty = new String[0];\n assertArrayEquals(expected, props1.getArray(\"array\"));\n assertArrayEquals(empty, props1.getArray(\"missing-item\"));\n assertArrayEquals(expected, props1.getAr...
{ "fields": [ { "declarator": "MACRO_START = \"${\"", "modifier": "public static final", "original_string": "public static final String MACRO_START = \"${\";", "type": "String", "var_name": "MACRO_START" }, { "declarator": "MACRO_END = \"}\"", "modifier": "publi...
{ "body": "public String[] getArray(String name, String[] defaultArray)\n {\n String[] toReturn;\n\n String prop = this.getBackingProperty(name);\n if (StringHelper.isNonEmpty(prop))\n {\n toReturn = prop.split(\"\\\\s*,\\\\s*\");\n }\n else\n {\n toReturn = defaultArray;\n }\n\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_14
{ "fields": [ { "declarator": "c1990", "modifier": "", "original_string": "Calendar c1990, c2010, c2030;", "type": "Calendar", "var_name": "c1990" }, { "declarator": "d1990", "modifier": "", "original_string": "Date d1990, d2010, d2030;", "type": "Date...
{ "body": "@Test\n public void isToday() {\n Calendar now = Calendar.getInstance();\n assertTrue(DateHelper.isToday(now));\n \n now.add(Calendar.DAY_OF_YEAR, 1);\n assertFalse(DateHelper.isToday(now));\n }", "class_method_signature": "DateHelperTest.isToday()", "constructor": false, "full_signa...
{ "fields": [ { "declarator": "DEFAULT_DATE_FORMATTERS = new ArrayList<>()", "modifier": "private static final", "original_string": "private static final List<SimpleDateFormat> DEFAULT_DATE_FORMATTERS = new ArrayList<>();", "type": "List<SimpleDateFormat>", "var_name...
{ "body": "public static boolean isToday(Calendar calendar)\n {\n return ( (calendar != null)\n && (getStartOfDay().compareTo(calendar) <= 0)\n && (getEndOfDay().compareTo(calendar) >= 0)\n );\n }", "class_method_signature": "DateHelper.isToday(Calendar calendar)", "constructor": f...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_43
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void wordWrap() {\n // TODO\n }", "class_method_signature": "StringHelperTest.wordWrap()", "constructor": false, "full_signature": "@Test public void wordWrap()", "identifier": "wordWrap", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return": "voi...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static String wordWrap(String input, int width,\n int indentFirstLine, int indentSubsequentLines)\n {\n return wordWrap(input, width, 0, indentFirstLine, indentSubsequentLines);\n }", "class_method_signature": "StringHelper.wordWrap(String input, int width,\n int indentFirstLine, int in...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_34
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void containsIgnoreCase() {\n assertTrue(StringHelper.containsIgnoreCase(sentence, \"This\"));\n assertTrue(StringHelper.containsIgnoreCase(sentence, \"this\"));\n assertTrue(StringHelper.containsIgnoreCase(sentence, \"THIS\"));\n assertFalse(StringHelper.containsIgnoreCase(sent...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static boolean containsIgnoreCase(String container, String searchingFor)\n {\n return isNonEmpty(container) && isNonEmpty(searchingFor)\n && container.toLowerCase().contains(searchingFor.toLowerCase());\n }", "class_method_signature": "StringHelper.containsIgnoreCase(String container, ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_63
{ "fields": [ { "declarator": "slist1", "modifier": "", "original_string": "List<String> slist1;", "type": "List<String>", "var_name": "slist1" }, { "declarator": "slist2", "modifier": "", "original_string": "List<String> slist2;", "type": "List<String...
{ "body": "@Test\n public void toStringArray() {\n // Tests the toStringArray suite.\n \n assertArrayEquals(sarray1, CollectionHelper.toStringArray(slist1));\n assertArrayEquals(sarray2, CollectionHelper.toStringArray(iarray1));\n assertArrayEquals(sarray2, CollectionHelper.toStringArray(barray1));\n ...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/CollectionHelper.java", "identifier": "CollectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "CollectionHelper.getFirst(Iterable<? extends E> objects)", "constructor": false, "full_signature": "p...
{ "body": "public static String[] toStringArray(Collection<String> collectionOfStrings)\n {\n return collectionOfStrings.toArray(new String[collectionOfStrings.size()]);\n }", "class_method_signature": "CollectionHelper.toStringArray(Collection<String> collectionOfStrings)", "constructor": false, "full_sig...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_22
{ "fields": [ { "declarator": "c1990", "modifier": "", "original_string": "Calendar c1990, c2010, c2030;", "type": "Calendar", "var_name": "c1990" }, { "declarator": "d1990", "modifier": "", "original_string": "Date d1990, d2010, d2030;", "type": "Date...
{ "body": "@Test\n public void getDayOfWeek() {\n assertEquals(Calendar.MONDAY, DateHelper.getDayOfWeek(\"MONday\"));\n assertEquals(-1, DateHelper.getDayOfWeek(\"Nosuchday\"));\n \n assertEquals(\"Monday\", DateHelper.getDayOfWeek(Calendar.MONDAY));\n assertNull(DateHelper.getDayOfWeek(-100));\n }",...
{ "fields": [ { "declarator": "DEFAULT_DATE_FORMATTERS = new ArrayList<>()", "modifier": "private static final", "original_string": "private static final List<SimpleDateFormat> DEFAULT_DATE_FORMATTERS = new ArrayList<>();", "type": "List<SimpleDateFormat>", "var_name...
{ "body": "public static int getDayOfWeek(String day)\n {\n if (day != null)\n {\n if (day.equalsIgnoreCase(\"monday\"))\n {\n return Calendar.MONDAY;\n }\n else if (day.equalsIgnoreCase(\"tuesday\"))\n {\n return Calendar.TUESDAY;\n }\n else if (day.equalsIgnor...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_59
{ "fields": [ { "declarator": "slist1", "modifier": "", "original_string": "List<String> slist1;", "type": "List<String>", "var_name": "slist1" }, { "declarator": "slist2", "modifier": "", "original_string": "List<String> slist2;", "type": "List<String...
{ "body": "@Test\n public void toMapFromInterleaved() {\n Map<String, String> result = CollectionHelper.toMapFromInterleaved(sarray1);\n assertEquals(\"Bar\", result.get(\"Foo\"));\n assertEquals(\"Baz\", result.get(\"Goo\"));\n }", "class_method_signature": "CollectionHelperTest.toMapFromInterleaved()",...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/CollectionHelper.java", "identifier": "CollectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "CollectionHelper.getFirst(Iterable<? extends E> objects)", "constructor": false, "full_signature": "p...
{ "body": "@SafeVarargs\n public static <O extends Object> Map<O,O> toMapFromInterleaved(O... sourceArray)\n {\n return toMapFromInterleavedImplementation(false, sourceArray);\n }", "class_method_signature": "CollectionHelper.toMapFromInterleaved(O... sourceArray)", "constructor": false, "full_signature":...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_18
{ "fields": [ { "declarator": "c1990", "modifier": "", "original_string": "Calendar c1990, c2010, c2030;", "type": "Calendar", "var_name": "c1990" }, { "declarator": "d1990", "modifier": "", "original_string": "Date d1990, d2010, d2030;", "type": "Date...
{ "body": "@Test\n public void isLeapYear() {\n assertTrue(DateHelper.isLeapYear(2000));\n assertFalse(DateHelper.isLeapYear(2001));\n assertTrue(DateHelper.isLeapYear(2004));\n assertFalse(DateHelper.isLeapYear(2100));\n }", "class_method_signature": "DateHelperTest.isLeapYear()", "constructor": fa...
{ "fields": [ { "declarator": "DEFAULT_DATE_FORMATTERS = new ArrayList<>()", "modifier": "private static final", "original_string": "private static final List<SimpleDateFormat> DEFAULT_DATE_FORMATTERS = new ArrayList<>();", "type": "List<SimpleDateFormat>", "var_name...
{ "body": "public static boolean isLeapYear(int year)\n {\n return ( ((year % 4 == 0) && (year % ONE_CENTURY != 0))\n || (year % FOUR_CENTURIES == 0)\n );\n }", "class_method_signature": "DateHelper.isLeapYear(int year)", "constructor": false, "full_signature": "public static boolean isLe...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_37
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void startsWithIgnoreCase() {\n assertTrue(StringHelper.startsWithIgnoreCase(sentence, \"This\"));\n assertTrue(StringHelper.startsWithIgnoreCase(sentence, \"this\"));\n assertTrue(StringHelper.startsWithIgnoreCase(sentence, \"THIS\"));\n assertFalse(StringHelper.startsWithIgnor...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static boolean startsWithIgnoreCase(String s, String prefix)\n {\n return ( (isNonEmpty(s))\n && (isNonEmpty(prefix))\n && (s.toLowerCase().startsWith(prefix.toLowerCase()))\n );\n }", "class_method_signature": "StringHelper.startsWithIgnoreCase(String s, String...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_60
{ "fields": [ { "declarator": "slist1", "modifier": "", "original_string": "List<String> slist1;", "type": "List<String>", "var_name": "slist1" }, { "declarator": "slist2", "modifier": "", "original_string": "List<String> slist2;", "type": "List<String...
{ "body": "@Test\n public void toList() {\n // Tests the toList suite.\n \n assertArrayEquals(sarray1, CollectionHelper.toList(sarray1).toArray());\n assertArrayEquals(sarray1, CollectionHelper.toList(slist1).toArray());\n assertArrayEquals(sarray1, CollectionHelper.toList(slist1.iterator()).toArray()...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/CollectionHelper.java", "identifier": "CollectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "CollectionHelper.getFirst(Iterable<? extends E> objects)", "constructor": false, "full_signature": "p...
{ "body": "@SafeVarargs\n public static <E> List<E> toList(E... objects)\n {\n final List<E> list = new ArrayList<>(objects.length);\n Collections.addAll(list, objects);\n return list;\n }", "class_method_signature": "CollectionHelper.toList(E... objects)", "constructor": false, "full_signature": "@...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_21
{ "fields": [ { "declarator": "c1990", "modifier": "", "original_string": "Calendar c1990, c2010, c2030;", "type": "Calendar", "var_name": "c1990" }, { "declarator": "d1990", "modifier": "", "original_string": "Date d1990, d2010, d2030;", "type": "Date...
{ "body": "@Test\n public void parse() {\n // Tests the parse suite.\n \n // TODO\n }", "class_method_signature": "DateHelperTest.parse()", "constructor": false, "full_signature": "@Test public void parse()", "identifier": "parse", "invocations": [], "modifiers": "@Test public", "parameters":...
{ "fields": [ { "declarator": "DEFAULT_DATE_FORMATTERS = new ArrayList<>()", "modifier": "private static final", "original_string": "private static final List<SimpleDateFormat> DEFAULT_DATE_FORMATTERS = new ArrayList<>();", "type": "List<SimpleDateFormat>", "var_name...
{ "body": "public static Calendar parse(String date)\n {\n return parse(date, DEFAULT_DATE_FORMATTERS);\n }", "class_method_signature": "DateHelper.parse(String date)", "constructor": false, "full_signature": "public static Calendar parse(String date)", "identifier": "parse", "invocations": [ "pars...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_8
{ "fields": [ { "declarator": "props1", "modifier": "", "original_string": "EnhancedProperties props1;", "type": "EnhancedProperties", "var_name": "props1" }, { "declarator": "starting", "modifier": "", "original_string": "Properties starting;", "type"...
{ "body": "@Test\n public void macroExpansion() {\n assertEquals(\"hello world\", props1.get(\"expanded\"));\n assertEquals(\"hello world\", props1.get(\"missing-item\", \"hello ${hello}\"));\n }", "class_method_signature": "EnhancedPropertiesTest.macroExpansion()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "MACRO_START = \"${\"", "modifier": "public static final", "original_string": "public static final String MACRO_START = \"${\";", "type": "String", "var_name": "MACRO_START" }, { "declarator": "MACRO_END = \"}\"", "modifier": "publi...
{ "body": "@Override\n public String get(String name)\n {\n return getBackingProperty(name);\n }", "class_method_signature": "EnhancedProperties.get(String name)", "constructor": false, "full_signature": "@Override public String get(String name)", "identifier": "get", "invocations": [ "getBackingP...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_56
{ "fields": [ { "declarator": "slist1", "modifier": "", "original_string": "List<String> slist1;", "type": "List<String>", "var_name": "slist1" }, { "declarator": "slist2", "modifier": "", "original_string": "List<String> slist2;", "type": "List<String...
{ "body": "@Test\n public void limit() {\n List<String> slimited = CollectionHelper.limit(slist1, 2);\n assertEquals(2, slimited.size());\n assertEquals(slist1.get(0), slimited.get(0));\n assertEquals(slist1.get(1), slimited.get(1));\n }", "class_method_signature": "CollectionHelperTest.limit()", "c...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/CollectionHelper.java", "identifier": "CollectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "CollectionHelper.getFirst(Iterable<? extends E> objects)", "constructor": false, "full_signature": "p...
{ "body": "public static <E> List<E> limit(List<E> objects, int limit)\n {\n if (isEmpty(objects) || objects.size() < limit)\n {\n return objects;\n }\n\n return objects.subList(0, limit);\n }", "class_method_signature": "CollectionHelper.limit(List<E> objects, int limit)", "constructor": false...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_4
{ "fields": [ { "declarator": "props1", "modifier": "", "original_string": "EnhancedProperties props1;", "type": "EnhancedProperties", "var_name": "props1" }, { "declarator": "starting", "modifier": "", "original_string": "Properties starting;", "type"...
{ "body": "@Test\n public void getLong() {\n assertEquals(1L, props1.getLong(\"onelong\"));\n assertEquals(2L, props1.getLong(\"missing-item\", 2L));\n }", "class_method_signature": "EnhancedPropertiesTest.getLong()", "constructor": false, "full_signature": "@Test public void getLong()", "identifier":...
{ "fields": [ { "declarator": "MACRO_START = \"${\"", "modifier": "public static final", "original_string": "public static final String MACRO_START = \"${\";", "type": "String", "var_name": "MACRO_START" }, { "declarator": "MACRO_END = \"}\"", "modifier": "publi...
{ "body": "@Override\n public long getLong(String name)\n {\n return getLong(name, 0L);\n }", "class_method_signature": "EnhancedProperties.getLong(String name)", "constructor": false, "full_signature": "@Override public long getLong(String name)", "identifier": "getLong", "invocations": [ "getLon...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_17
{ "fields": [ { "declarator": "c1990", "modifier": "", "original_string": "Calendar c1990, c2010, c2030;", "type": "Calendar", "var_name": "c1990" }, { "declarator": "d1990", "modifier": "", "original_string": "Date d1990, d2010, d2030;", "type": "Date...
{ "body": "@Test\n public void getHumanDuration() {\n assertEquals(\"1 second\",\n DateHelper.getHumanDuration(UtilityConstants.SECOND, 1));\n assertEquals(\n \"1 minute, 1 second\",\n DateHelper.getHumanDuration(UtilityConstants.MINUTE\n + UtilityConstants.SECOND, 2));\n ass...
{ "fields": [ { "declarator": "DEFAULT_DATE_FORMATTERS = new ArrayList<>()", "modifier": "private static final", "original_string": "private static final List<SimpleDateFormat> DEFAULT_DATE_FORMATTERS = new ArrayList<>();", "type": "List<SimpleDateFormat>", "var_name...
{ "body": "public static String getHumanDuration(long milliseconds, int specificity)\n {\n return getHumanDuration(milliseconds, specificity, false);\n }", "class_method_signature": "DateHelper.getHumanDuration(long milliseconds, int specificity)", "constructor": false, "full_signature": "public static Str...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_40
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void trim() {\n assertEquals(\"foo\", StringHelper.trim(\"foo\"));\n assertEquals(\"foo\", StringHelper.trim(\" foo \"));\n assertEquals(\"\", StringHelper.trim((String)null));\n \n assertArrayEquals(array2, StringHelper.trim(array1));\n }", "class_method_signature": "St...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static String trim(String s)\n {\n if (s != null)\n {\n return s.trim();\n }\n\n return \"\";\n }", "class_method_signature": "StringHelper.trim(String s)", "constructor": false, "full_signature": "public static String trim(String s)", "identifier": "trim", "invocations"...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_41
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void isAll() {\n // Tests the suite of isAll methods.\n \n assertTrue(StringHelper.isAllNumeric(\"123\"));\n assertFalse(StringHelper.isAllNumeric(\" 123 \"));\n assertFalse(StringHelper.isAllNumeric(\"123abc\"));\n assertFalse(StringHelper.isAllNumeric(null));\n \n ...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static boolean isAll(String inputString,\n boolean includeAlphaLowerCase,\n boolean includeAlphaUpperCase,\n boolean includeNumericDigits,\n char... characters)\n {\n // Merge the various char arrays we're using as acceptable characters.\n final char[] acceptableCharacters...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_16
{ "fields": [ { "declarator": "c1990", "modifier": "", "original_string": "Calendar c1990, c2010, c2030;", "type": "Calendar", "var_name": "c1990" }, { "declarator": "d1990", "modifier": "", "original_string": "Date d1990, d2010, d2030;", "type": "Date...
{ "body": "@Test\n public void getDifference() {\n // Tests the getDifference suite.\n assertEquals(-20, DateHelper.getDifference(d2010, d1990, UtilityConstants.YEAR));\n assertEquals(20, DateHelper.getDifference(d2010, d2030, UtilityConstants.YEAR));\n\n assertTrue(DateHelper.getDifferenceSince(d2010, U...
{ "fields": [ { "declarator": "DEFAULT_DATE_FORMATTERS = new ArrayList<>()", "modifier": "private static final", "original_string": "private static final List<SimpleDateFormat> DEFAULT_DATE_FORMATTERS = new ArrayList<>();", "type": "List<SimpleDateFormat>", "var_name...
{ "body": "public static int getDifference(Date date1, Date date2, long timeUnitInMillis)\n {\n if ((date1 != null) && (date2 != null))\n {\n long t1 = date1.getTime();\n long t2 = date2.getTime();\n \n return (int)((t2 - t1) / timeUnitInMillis);\n }\n else\n {\n return 0;\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_5
{ "fields": [ { "declarator": "props1", "modifier": "", "original_string": "EnhancedProperties props1;", "type": "EnhancedProperties", "var_name": "props1" }, { "declarator": "starting", "modifier": "", "original_string": "Properties starting;", "type"...
{ "body": "@Test\n public void getFloat() {\n assertEquals(1.0f, props1.getFloat(\"onefloat\"), 0.01f);\n assertEquals(2.0f, props1.getFloat(\"missing-item\", 2.0f), 0.01f);\n }", "class_method_signature": "EnhancedPropertiesTest.getFloat()", "constructor": false, "full_signature": "@Test public void ge...
{ "fields": [ { "declarator": "MACRO_START = \"${\"", "modifier": "public static final", "original_string": "public static final String MACRO_START = \"${\";", "type": "String", "var_name": "MACRO_START" }, { "declarator": "MACRO_END = \"}\"", "modifier": "publi...
{ "body": "public float getFloat(String name)\n {\n return getFloat(name, 0.0F);\n }", "class_method_signature": "EnhancedProperties.getFloat(String name)", "constructor": false, "full_signature": "public float getFloat(String name)", "identifier": "getFloat", "invocations": [ "getFloat" ], "mo...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_57
{ "fields": [ { "declarator": "slist1", "modifier": "", "original_string": "List<String> slist1;", "type": "List<String>", "var_name": "slist1" }, { "declarator": "slist2", "modifier": "", "original_string": "List<String> slist2;", "type": "List<String...
{ "body": "@Test\n public void arrayContains() {\n // Tests the suite of \"arrayContains\" and \"arrayIndexOf\" methods.\n \n assertEquals(0, CollectionHelper.arrayIndexOf(sarray1, \"Foo\"));\n assertEquals(1, CollectionHelper.arrayIndexOf(sarray1, \"Bar\"));\n assertEquals(-1, CollectionHelper.arrayI...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/CollectionHelper.java", "identifier": "CollectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "CollectionHelper.getFirst(Iterable<? extends E> objects)", "constructor": false, "full_signature": "p...
{ "body": "public static <E> boolean arrayContains(E[] array, E valueToFind)\n {\n return (arrayIndexOf(array, valueToFind) >= 0);\n }", "class_method_signature": "CollectionHelper.arrayContains(E[] array, E valueToFind)", "constructor": false, "full_signature": "public static boolean arrayContains(E[] arr...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_9
{ "fields": [ { "declarator": "props1", "modifier": "", "original_string": "EnhancedProperties props1;", "type": "EnhancedProperties", "var_name": "props1" }, { "declarator": "starting", "modifier": "", "original_string": "Properties starting;", "type"...
{ "body": "@Test\n public void focus() {\n EnhancedProperties.Focus focus = props1.focus(\"prefixed.\");\n assertTrue(focus.has(\"one\"));\n assertEquals(1, focus.getInt(\"one\", 0));\n assertFalse(focus.has(\"missing-item\"));\n assertNull(focus.get(\"missing-item\"));\n }", "class_method_signatur...
{ "fields": [ { "declarator": "MACRO_START = \"${\"", "modifier": "public static final", "original_string": "public static final String MACRO_START = \"${\";", "type": "String", "var_name": "MACRO_START" }, { "declarator": "MACRO_END = \"}\"", "modifier": "publi...
{ "body": "public Focus focus(String prefix)\n {\n return new Focus(prefix);\n }", "class_method_signature": "EnhancedProperties.focus(String prefix)", "constructor": false, "full_signature": "public Focus focus(String prefix)", "identifier": "focus", "invocations": [], "modifiers": "public", "para...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_20
{ "fields": [ { "declarator": "c1990", "modifier": "", "original_string": "Calendar c1990, c2010, c2030;", "type": "Calendar", "var_name": "c1990" }, { "declarator": "d1990", "modifier": "", "original_string": "Date d1990, d2010, d2030;", "type": "Date...
{ "body": "@Test\n public void format() {\n // Tests the format suite.\n \n // TODO\n }", "class_method_signature": "DateHelperTest.format()", "constructor": false, "full_signature": "@Test public void format()", "identifier": "format", "invocations": [], "modifiers": "@Test public", "paramet...
{ "fields": [ { "declarator": "DEFAULT_DATE_FORMATTERS = new ArrayList<>()", "modifier": "private static final", "original_string": "private static final List<SimpleDateFormat> DEFAULT_DATE_FORMATTERS = new ArrayList<>();", "type": "List<SimpleDateFormat>", "var_name...
{ "body": "public static String format(Calendar theCalendar,\n int dateStyle, int timeStyle)\n {\n return format(theCalendar, dateStyle, timeStyle, \"\", \"\");\n }", "class_method_signature": "DateHelper.format(Calendar theCalendar,\n int dateStyle, int timeStyle)", "constructor": false, "full_signa...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_61
{ "fields": [ { "declarator": "slist1", "modifier": "", "original_string": "List<String> slist1;", "type": "List<String>", "var_name": "slist1" }, { "declarator": "slist2", "modifier": "", "original_string": "List<String> slist2;", "type": "List<String...
{ "body": "@Test\n public void toSet() {\n // Tests the toSet suite.\n \n Set<String> result = CollectionHelper.toSet(sarray1);\n assertTrue(result.contains(\"Foo\"));\n assertTrue(result.contains(\"Goo\"));\n assertFalse(result.contains(\"Notfound\"));\n\n result = CollectionHelper.toSet(slist1...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/CollectionHelper.java", "identifier": "CollectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "CollectionHelper.getFirst(Iterable<? extends E> objects)", "constructor": false, "full_signature": "p...
{ "body": "@SafeVarargs\n public static <E> Set<E> toSet(E... objects)\n {\n Set<E> set = new HashSet<>(objects.length);\n Collections.addAll(set, objects);\n return set;\n }", "class_method_signature": "CollectionHelper.toSet(E... objects)", "constructor": false, "full_signature": "@SafeVarargs pub...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_36
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void endsWithIgnoreCase() {\n assertTrue(StringHelper.endsWithIgnoreCase(sentence, \".\"));\n assertTrue(StringHelper.endsWithIgnoreCase(sentence, \"ce.\"));\n assertTrue(StringHelper.endsWithIgnoreCase(sentence, \"CE.\"));\n assertFalse(StringHelper.endsWithIgnoreCase(sentence,...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static boolean endsWithIgnoreCase(String s, String suffix)\n {\n return ( (isNonEmpty(s))\n && (isNonEmpty(suffix))\n && (s.toLowerCase().endsWith(suffix.toLowerCase()))\n );\n }", "class_method_signature": "StringHelper.endsWithIgnoreCase(String s, String suffi...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_50
{ "fields": [ { "declarator": "intRange = new IntRange(1, 3)", "modifier": "private static final", "original_string": "private static final IntRange intRange = new IntRange(1, 3);", "type": "IntRange", "var_name": "intRange" }, { "declarator": "bigLong = 1000000000000L"...
{ "body": "@Test\n public void boundLong() {\n assertEquals(1, NumberHelper.boundLong(1, longRange)); \n assertEquals(1, NumberHelper.boundLong(0, longRange)); \n assertEquals(longRange.max, NumberHelper.boundLong(longRange.max, longRange)); \n assertEquals(longRange.max, NumberHelper.boundLong(...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/NumberHelper.java", "identifier": "NumberHelper", "interfaces": "", "methods": [ { "class_method_signature": "NumberHelper.boundInteger(int toBound, IntRange range)", "constructor": false, "full_signature": "public stat...
{ "body": "public static long boundLong(long toBound, LongRange range)\n {\n return boundLong(toBound, range.min, range.max);\n }", "class_method_signature": "NumberHelper.boundLong(long toBound, LongRange range)", "constructor": false, "full_signature": "public static long boundLong(long toBound, LongRang...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_2
{ "fields": [ { "declarator": "props1", "modifier": "", "original_string": "EnhancedProperties props1;", "type": "EnhancedProperties", "var_name": "props1" }, { "declarator": "starting", "modifier": "", "original_string": "Properties starting;", "type"...
{ "body": "@Test\n public void get() {\n assertEquals(\"world\", props1.get(\"hello\"));\n assertEquals(\"test\", props1.get(\"missing-item\", \"test\"));\n }", "class_method_signature": "EnhancedPropertiesTest.get()", "constructor": false, "full_signature": "@Test public void get()", "identifier": "g...
{ "fields": [ { "declarator": "MACRO_START = \"${\"", "modifier": "public static final", "original_string": "public static final String MACRO_START = \"${\";", "type": "String", "var_name": "MACRO_START" }, { "declarator": "MACRO_END = \"}\"", "modifier": "publi...
{ "body": "@Override\n public String get(String name)\n {\n return getBackingProperty(name);\n }", "class_method_signature": "EnhancedProperties.get(String name)", "constructor": false, "full_signature": "@Override public String get(String name)", "identifier": "get", "invocations": [ "getBackingP...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_11
{ "fields": [ { "declarator": "props1", "modifier": "", "original_string": "EnhancedProperties props1;", "type": "EnhancedProperties", "var_name": "props1" }, { "declarator": "starting", "modifier": "", "original_string": "Properties starting;", "type"...
{ "body": "@Test\n public void remove() {\n EnhancedProperties test = new EnhancedProperties();\n test.put(\"hello\", \"world\");\n assertEquals(\"world\", test.get(\"hello\"));\n test.remove(\"hello\");\n assertNull(test.get(\"hello\"));\n }", "class_method_signature": "EnhancedPropertiesTest.remo...
{ "fields": [ { "declarator": "MACRO_START = \"${\"", "modifier": "public static final", "original_string": "public static final String MACRO_START = \"${\";", "type": "String", "var_name": "MACRO_START" }, { "declarator": "MACRO_END = \"}\"", "modifier": "publi...
{ "body": "@Override\n public EnhancedProperties remove(String name)\n {\n backing.remove(name);\n return this;\n }", "class_method_signature": "EnhancedProperties.remove(String name)", "constructor": false, "full_signature": "@Override public EnhancedProperties remove(String name)", "identifier": "r...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_46
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test(expected = NumberFormatException.class)\n public void parseBooleanException() {\n @SuppressWarnings(\"unused\")\n boolean foo = StringHelper.parseBoolean(\"eh?\");\n }", "class_method_signature": "StringHelperTest.parseBooleanException()", "constructor": false, "full_signature": "@Test(...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static boolean parseBoolean(String boolStr)\n {\n if ( (boolStr != null)\n && (boolStr.length() < 50) // Long strings won't be evaluated. \n )\n {\n switch (boolStr.trim().toLowerCase())\n {\n case \"true\":\n case \"yes\":\n case \"1\":\n c...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_31
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void equalsIgnoreCase() {\n assertTrue(StringHelper.equalsIgnoreCase(\"abc\", \"abc\"));\n assertTrue(StringHelper.equalsIgnoreCase(\"abc\", \"ABC\"));\n assertFalse(StringHelper.equalsIgnoreCase(\"123\", \"ABC\"));\n assertFalse(StringHelper.equalsIgnoreCase(\"123\", nullString...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static boolean equalsIgnoreCase(String s1, String[] s2)\n {\n return equalsIgnoreCase(s1, CollectionHelper.toList(s2));\n }", "class_method_signature": "StringHelper.equalsIgnoreCase(String s1, String[] s2)", "constructor": false, "full_signature": "public static boolean equalsIgnoreCase(...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_66
{ "fields": [ { "declarator": "slist1", "modifier": "", "original_string": "List<String> slist1;", "type": "List<String>", "var_name": "slist1" }, { "declarator": "slist2", "modifier": "", "original_string": "List<String> slist2;", "type": "List<String...
{ "body": "@Test\n public void getReducedMap() {\n Map<String, String> result = CollectionHelper.getReducedMap(\n smap1, \"f\", \"Fookey\", \"g\", \"Gookey\");\n \n assertEquals(\"Foo\", result.get(\"Fookey\"));\n assertEquals(\"Goo\", result.get(\"Gookey\"));\n }", "class_method_signature": "C...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/CollectionHelper.java", "identifier": "CollectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "CollectionHelper.getFirst(Iterable<? extends E> objects)", "constructor": false, "full_signature": "p...
{ "body": "public static <E> Map<String,E> getReducedMap(Map<String,E> input, \n String... originalAndNewNames)\n {\n if (originalAndNewNames.length % 2 != 0)\n {\n throw new IllegalArgumentException(\n \"The original and new names array must be of even length. Length of parameter: \" + ori...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_27
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void padArbitraryRight() {\n assertEquals(\"1\", StringHelper.padArbitraryRight('a', \"1\", 0));\n assertEquals(\"1aa\", StringHelper.padArbitraryRight('a', \"1\", 3));\n }", "class_method_signature": "StringHelperTest.padArbitraryRight()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static String padArbitraryRight(char pad, String string, int length)\n {\n // Return the string unchanged if its length equals or exceeds the target\n // length.\n if (string.length() >= length)\n {\n return string;\n }\n\n char[] buffer = new char[length];\n \n // Add ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_26
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void padArbitrary() {\n assertEquals(\"1\", StringHelper.padArbitrary('a', \"1\", 0));\n assertEquals(\"aa1\", StringHelper.padArbitrary('a', \"1\", 3));\n }", "class_method_signature": "StringHelperTest.padArbitrary()", "constructor": false, "full_signature": "@Test public voi...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static String padArbitrary(char pad, String string, int length)\n {\n // Return the string unchanged if its length equals or exceeds the target\n // length.\n if (string.length() >= length)\n {\n return string;\n }\n \n char[] buffer = new char[length];\n \n // Add t...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_67
{ "fields": [ { "declarator": "slist1", "modifier": "", "original_string": "List<String> slist1;", "type": "List<String>", "var_name": "slist1" }, { "declarator": "slist2", "modifier": "", "original_string": "List<String> slist2;", "type": "List<String...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void getReducedMapException() {\n CollectionHelper.getReducedMap(smap1, \"bad\");\n }", "class_method_signature": "CollectionHelperTest.getReducedMapException()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentEx...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/CollectionHelper.java", "identifier": "CollectionHelper", "interfaces": "", "methods": [ { "class_method_signature": "CollectionHelper.getFirst(Iterable<? extends E> objects)", "constructor": false, "full_signature": "p...
{ "body": "public static <E> Map<String,E> getReducedMap(Map<String,E> input, \n String... originalAndNewNames)\n {\n if (originalAndNewNames.length % 2 != 0)\n {\n throw new IllegalArgumentException(\n \"The original and new names array must be of even length. Length of parameter: \" + ori...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_30
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void emptyDefault() {\n assertEquals(\"abc\", StringHelper.emptyDefault(\"\", \"abc\"));\n assertEquals(\"abc\", StringHelper.emptyDefault(null, \"abc\"));\n assertEquals(\"123\", StringHelper.emptyDefault(\"123\", \"abc\"));\n }", "class_method_signature": "StringHelperTest.emp...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static String emptyDefault(String stringToTest,\n String defaultValue)\n {\n if (isEmpty(stringToTest))\n {\n return defaultValue;\n }\n\n return stringToTest;\n }", "class_method_signature": "StringHelper.emptyDefault(String stringToTest,\n String defaultValue)", "const...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_47
{ "fields": [ { "declarator": "nullString = null", "modifier": "private static final", "original_string": "private static final String nullString = null;", "type": "String", "var_name": "nullString" }, { "declarator": "list1", "modifier": "private", "origina...
{ "body": "@Test\n public void replaceSubstrings() {\n String source = \"Th$IS $IS a $SENTENCE\";\n Map<String, Object> macros = new HashMap<>();\n macros.put(\"$IS\", \"is\");\n macros.put(\"$SENTENCE\", \"sentence.\");\n macros.put(\"$UNUSED\", \"unused\");\n \n String[] finds = new String[] {...
{ "fields": [ { "declarator": "NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n }", "modifier": "private static final", "original_string": "private static final String[] NEWLINE_FINDS = new String[]\n {\n \"\\n\", \"\\r\"\n };", "type": "String[]", "var_nam...
{ "body": "public static String replaceSubstrings(String source, String search,\n String replacement)\n {\n return replaceSubstrings(source, search, replacement, true);\n }", "class_method_signature": "StringHelper.replaceSubstrings(String source, String search,\n String replacement)", "constructor": f...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_10
{ "fields": [ { "declarator": "props1", "modifier": "", "original_string": "EnhancedProperties props1;", "type": "EnhancedProperties", "var_name": "props1" }, { "declarator": "starting", "modifier": "", "original_string": "Properties starting;", "type"...
{ "body": "@Test\n public void put() {\n EnhancedProperties test = new EnhancedProperties();\n test.put(\"true\", true);\n assertTrue(test.getBoolean(\"true\"));\n test.put(\"false\", false);\n assertFalse(test.getBoolean(\"false\", true));\n test.put(\"one\", 1);\n assertEquals(1, test.getInt(\...
{ "fields": [ { "declarator": "MACRO_START = \"${\"", "modifier": "public static final", "original_string": "public static final String MACRO_START = \"${\";", "type": "String", "var_name": "MACRO_START" }, { "declarator": "MACRO_END = \"}\"", "modifier": "publi...
{ "body": "@Override\n public EnhancedProperties put(String name, String value)\n {\n return putObject(name, value);\n }", "class_method_signature": "EnhancedProperties.put(String name, String value)", "constructor": false, "full_signature": "@Override public EnhancedProperties put(String name, String val...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_3
{ "fields": [ { "declarator": "props1", "modifier": "", "original_string": "EnhancedProperties props1;", "type": "EnhancedProperties", "var_name": "props1" }, { "declarator": "starting", "modifier": "", "original_string": "Properties starting;", "type"...
{ "body": "@Test\n public void getInt() {\n assertEquals(1, props1.getInt(\"one\"));\n assertEquals(2, props1.getInt(\"two\"));\n assertEquals(3, props1.getInt(\"missing-item\", 3));\n }", "class_method_signature": "EnhancedPropertiesTest.getInt()", "constructor": false, "full_signature": "@Test publ...
{ "fields": [ { "declarator": "MACRO_START = \"${\"", "modifier": "public static final", "original_string": "public static final String MACRO_START = \"${\";", "type": "String", "var_name": "MACRO_START" }, { "declarator": "MACRO_END = \"}\"", "modifier": "publi...
{ "body": "@Override\n public int getInt(String name)\n {\n return getInt(name, 0);\n }", "class_method_signature": "EnhancedProperties.getInt(String name)", "constructor": false, "full_signature": "@Override public int getInt(String name)", "identifier": "getInt", "invocations": [ "getInt" ], ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
132938098_51
{ "fields": [ { "declarator": "intRange = new IntRange(1, 3)", "modifier": "private static final", "original_string": "private static final IntRange intRange = new IntRange(1, 3);", "type": "IntRange", "var_name": "intRange" }, { "declarator": "bigLong = 1000000000000L"...
{ "body": "@Test\n public void parseInt() {\n assertEquals(0, NumberHelper.parseInt(\"abc\"));\n assertEquals(1, NumberHelper.parseInt(\"1\"));\n assertEquals(1, NumberHelper.parseInt(\"abc\", 1));\n assertEquals(-1, NumberHelper.parseInt(\"-1\"));\n assertEquals(0, NumberHelper.parseInt(\"1a\"));\n ...
{ "fields": [], "file": "gemini/src/main/java/com/techempower/helper/NumberHelper.java", "identifier": "NumberHelper", "interfaces": "", "methods": [ { "class_method_signature": "NumberHelper.boundInteger(int toBound, IntRange range)", "constructor": false, "full_signature": "public stat...
{ "body": "public static int parseInt(final String string, final int defaultValue) \n {\n // If the string is null or empty, return default.\n if (StringHelper.isEmpty(string)) \n {\n return defaultValue;\n }\n \n // Check for a sign.\n final boolean negative = string.charAt(0) == '-';\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 132938098, "size": 2358, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/TechEmpower/gemini" }
1951088_0
{ "fields": [ { "declarator": "PHOTOSET_ID = \"72157602790288345\"", "modifier": "private static final", "original_string": "private static final String PHOTOSET_ID = \"72157602790288345\";", "type": "String", "var_name": "PHOTOSET_ID" }, { "declarator": "CHARLES_PHOTO_...
{ "body": "@Test\n\tpublic void testGetInfo() throws FlickrException, IOException, JSONException {\n\t\tPhotoset photoset = f.getPhotosetsInterface().getInfo(PHOTOSET_ID);\n\t\tassertNotNull(photoset);\n\t\tassertEquals(PHOTOSET_ID, photoset.getId());\n\t}", "class_method_signature": "PhotosetsInterfaceTest.testGet...
{ "fields": [ { "declarator": "METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\"", "modifier": "public static final", "original_string": "public static final String METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\";", "type": "String", "var_name": "METHOD_ADD_PHOTO" }, { ...
{ "body": "public Photoset getInfo(String photosetId) throws FlickrException,\n\t\t\tIOException, JSONException {\n\t\tList<Parameter> parameters = new ArrayList<Parameter>();\n\t\tparameters.add(new Parameter(\"method\", METHOD_GET_INFO));\n\n\t\tboolean signed = OAuthUtils.hasSigned();\n\t\tif (signed) {\n\t\t\tpar...
{ "created": null, "fork": null, "fork_count": 30, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 1951088, "size": 5556, "stargazer_count": 41, "stars": null, "updates": null, "url": "https://github.com/yuyang226/FlickrjApi4Android" }
1951088_1
{ "fields": [ { "declarator": "PHOTOSET_ID = \"72157602790288345\"", "modifier": "private static final", "original_string": "private static final String PHOTOSET_ID = \"72157602790288345\";", "type": "String", "var_name": "PHOTOSET_ID" }, { "declarator": "CHARLES_PHOTO_...
{ "body": "@Test\n\tpublic void testGetInfoAuth() throws FlickrException, IOException, JSONException {\n\t\tPhotoset photoset = f.getPhotosetsInterface().getInfo(CHARLES_PHOTO_SET_ID);\n\t\tassertNotNull(photoset);\n\t\tassertEquals(CHARLES_PHOTO_SET_ID, photoset.getId());\n\t\tassertTrue( photoset.getPhotoCount() > ...
{ "fields": [ { "declarator": "METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\"", "modifier": "public static final", "original_string": "public static final String METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\";", "type": "String", "var_name": "METHOD_ADD_PHOTO" }, { ...
{ "body": "public Photoset getInfo(String photosetId) throws FlickrException,\n\t\t\tIOException, JSONException {\n\t\tList<Parameter> parameters = new ArrayList<Parameter>();\n\t\tparameters.add(new Parameter(\"method\", METHOD_GET_INFO));\n\n\t\tboolean signed = OAuthUtils.hasSigned();\n\t\tif (signed) {\n\t\t\tpar...
{ "created": null, "fork": null, "fork_count": 30, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 1951088, "size": 5556, "stargazer_count": 41, "stars": null, "updates": null, "url": "https://github.com/yuyang226/FlickrjApi4Android" }
1951088_2
{ "fields": [ { "declarator": "PHOTOSET_ID = \"72157602790288345\"", "modifier": "private static final", "original_string": "private static final String PHOTOSET_ID = \"72157602790288345\";", "type": "String", "var_name": "PHOTOSET_ID" }, { "declarator": "CHARLES_PHOTO_...
{ "body": "@Test\n\tpublic void testGetList() throws IOException, FlickrException, JSONException {\n\t\tPhotosets photosets = f.getPhotosetsInterface().getList(TestConstants.USER_ID);\n\t\tassertNotNull(photosets);\n\t\tassertFalse(photosets.getPhotosets().isEmpty());\n\t}", "class_method_signature": "PhotosetsInte...
{ "fields": [ { "declarator": "METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\"", "modifier": "public static final", "original_string": "public static final String METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\";", "type": "String", "var_name": "METHOD_ADD_PHOTO" }, { ...
{ "body": "public Photosets getList(String userId) throws IOException,\n\t\t\tFlickrException, JSONException {\n\t\treturn getList(userId,-1,-1);\n\t}", "class_method_signature": "PhotosetsInterface.getList(String userId)", "constructor": false, "full_signature": "public Photosets getList(String userId)", "id...
{ "created": null, "fork": null, "fork_count": 30, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 1951088, "size": 5556, "stargazer_count": 41, "stars": null, "updates": null, "url": "https://github.com/yuyang226/FlickrjApi4Android" }
1951088_3
{ "fields": [ { "declarator": "PHOTOSET_ID = \"72157602790288345\"", "modifier": "private static final", "original_string": "private static final String PHOTOSET_ID = \"72157602790288345\";", "type": "String", "var_name": "PHOTOSET_ID" }, { "declarator": "CHARLES_PHOTO_...
{ "body": "@Test\n\tpublic void testGetList2() throws IOException, FlickrException, JSONException {\n\t\tPhotosets photosets = f.getPhotosetsInterface().getList(TestConstants.USER_ID, 2, 1);\n\t\tassertNotNull(photosets);\n\t\tassertFalse(photosets.getPhotosets().isEmpty());\n\t\tassertTrue( photosets.getPhotosets()...
{ "fields": [ { "declarator": "METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\"", "modifier": "public static final", "original_string": "public static final String METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\";", "type": "String", "var_name": "METHOD_ADD_PHOTO" }, { ...
{ "body": "public Photosets getList(String userId) throws IOException,\n\t\t\tFlickrException, JSONException {\n\t\treturn getList(userId,-1,-1);\n\t}", "class_method_signature": "PhotosetsInterface.getList(String userId)", "constructor": false, "full_signature": "public Photosets getList(String userId)", "id...
{ "created": null, "fork": null, "fork_count": 30, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 1951088, "size": 5556, "stargazer_count": 41, "stars": null, "updates": null, "url": "https://github.com/yuyang226/FlickrjApi4Android" }
1951088_4
{ "fields": [ { "declarator": "PHOTOSET_ID = \"72157602790288345\"", "modifier": "private static final", "original_string": "private static final String PHOTOSET_ID = \"72157602790288345\";", "type": "String", "var_name": "PHOTOSET_ID" }, { "declarator": "CHARLES_PHOTO_...
{ "body": "@Test\n\tpublic void testGetPhotosStringSetOfStringIntIntInt() throws IOException, FlickrException, JSONException {\n\t\tPhotoset photoset = f.getPhotosetsInterface().getPhotos(PHOTOSET_ID, \n\t\t\t\tnull, -1, 10, 1);\n\t\tassertNotNull(photoset);\n\t\tassertFalse(photoset.getPhotoList().isEmpty());\n\t}",...
{ "fields": [ { "declarator": "METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\"", "modifier": "public static final", "original_string": "public static final String METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\";", "type": "String", "var_name": "METHOD_ADD_PHOTO" }, { ...
{ "body": "public Photoset getPhotos(String photosetId, Set<String> extras,\n\t\t\tint privacyFilter, int perPage, int page) throws IOException,\n\t\t\tFlickrException, JSONException {\n\t\tPhotoList photos = new PhotoList();\n\t\tList<Parameter> parameters = new ArrayList<Parameter>();\n\t\tparameters.add(new Parame...
{ "created": null, "fork": null, "fork_count": 30, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 1951088, "size": 5556, "stargazer_count": 41, "stars": null, "updates": null, "url": "https://github.com/yuyang226/FlickrjApi4Android" }
1951088_5
{ "fields": [ { "declarator": "PHOTOSET_ID = \"72157602790288345\"", "modifier": "private static final", "original_string": "private static final String PHOTOSET_ID = \"72157602790288345\";", "type": "String", "var_name": "PHOTOSET_ID" }, { "declarator": "CHARLES_PHOTO_...
{ "body": "@Test\n\tpublic void testGetPhotosStringIntInt() throws IOException, FlickrException, JSONException {\n\t\tPhotoset photoset = f.getPhotosetsInterface().getPhotos(PHOTOSET_ID, 10, 1);\n\t\tassertNotNull(photoset);\n\t\tassertFalse(photoset.getPhotoList().isEmpty());\n\t}", "class_method_signature": "Phot...
{ "fields": [ { "declarator": "METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\"", "modifier": "public static final", "original_string": "public static final String METHOD_ADD_PHOTO = \"flickr.photosets.addPhoto\";", "type": "String", "var_name": "METHOD_ADD_PHOTO" }, { ...
{ "body": "public Photoset getPhotos(String photosetId, Set<String> extras,\n\t\t\tint privacyFilter, int perPage, int page) throws IOException,\n\t\t\tFlickrException, JSONException {\n\t\tPhotoList photos = new PhotoList();\n\t\tList<Parameter> parameters = new ArrayList<Parameter>();\n\t\tparameters.add(new Parame...
{ "created": null, "fork": null, "fork_count": 30, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 1951088, "size": 5556, "stargazer_count": 41, "stars": null, "updates": null, "url": "https://github.com/yuyang226/FlickrjApi4Android" }
49818800_27
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void setLevelShouldReturnSameInstanceOfInterceptor() {\n for (Level level : Level.values()) {\n assertSame(applicationInterceptor, applicationInterceptor.setLevel(level));\n }\n }", "class_method_signature": "HttpLoggingInterceptorTest.setLevelShouldReturnSameInstanceOfIntercepto...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_31
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void basicChunkedResponseBody() throws IOException {\n setLevel(Level.BASIC);\n\n server.enqueue(new MockResponse()\n .setChunkedBody(\"Hello!\", 2)\n .setHeader(\"Content-Type\", PLAIN));\n Response response = client.newCall(request().build()).execute();\n response.b...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_8
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createOkRequest_nonNullRequestHeaders() throws Exception {\n URI uri = new URI(\"https://foo/bar\");\n\n Map<String, List<String>> javaRequestHeaders = new HashMap<>();\n javaRequestHeaders.put(\"Foo\", Arrays.asList(\"Bar\"));\n Request request = JavaApiConverter.createOkRequ...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "public static Request createOkRequest(\n URI uri, String requestMethod, Map<String, List<String>> requestHeaders) {\n // OkHttp's Call API requires a placeholder body; the real body will be streamed separately.\n RequestBody placeholderBody = HttpMethod.requiresRequestBody(requestMethod)\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_46
{ "fields": [ { "declarator": "server = new MockWebServer()", "modifier": "@Rule public", "original_string": "@Rule public MockWebServer server = new MockWebServer();", "type": "MockWebServer", "var_name": "server" }, { "declarator": "fileSystem = new InMemoryFileSystem...
{ "body": "@Test public void networkFailureResponseSourceHeader() throws Exception {\n server.enqueue(new MockResponse().setResponseCode(404));\n\n HttpURLConnection connection = factory.open(server.url(\"/\").url());\n assertResponseHeader(connection, \"NETWORK 404\");\n connection.getErrorStream().close...
{ "fields": [ { "declarator": "client", "modifier": "private", "original_string": "private OkHttpClient client;", "type": "OkHttpClient", "var_name": "client" } ], "file": "okhttp-urlconnection/src/main/java/okhttp3/OkUrlFactory.java", "identifier": "OkUrlFactory", "inter...
{ "body": "public HttpURLConnection open(URL url) {\n return open(url, client.proxy());\n }", "class_method_signature": "OkUrlFactory.open(URL url)", "constructor": false, "full_signature": "public HttpURLConnection open(URL url)", "identifier": "open", "invocations": [ "open", "proxy" ], "m...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_11
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaUrlConnection_connectionChangesForbidden() throws Exception {\n Response okResponse = createArbitraryOkResponse();\n HttpURLConnection httpUrlConnection =\n JavaApiConverter.createJavaUrlConnectionForCachePut(okResponse);\n try {\n httpUrlConnection.connect(...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static HttpURLConnection createJavaUrlConnectionForCachePut(Response okResponse) {\n Request request = okResponse.request();\n // Create an object of the correct class in case the ResponseCache uses instanceof.\n if (request.isHttps()) {\n return new CacheHttpsURLConnection(new CacheHttpURLCo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_4
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createOkResponseForCacheGet() throws Exception {\n final String statusLine = \"HTTP/1.1 200 Fantastic\";\n URI uri = new URI(\"http://foo/bar\");\n Request request = new Request.Builder().url(uri.toURL()).build();\n CacheResponse cacheResponse = new CacheResponse() {\n @O...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static Response createOkResponseForCacheGet(Request request, CacheResponse javaResponse)\n throws IOException {\n\n // Build a cache request for the response to use.\n Headers responseHeaders = createHeaders(javaResponse.getHeaders());\n Headers varyHeaders;\n if (OkHeaders.hasVaryAll(resp...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_50
{ "fields": [ { "declarator": "server = new MockWebServer()", "modifier": "@Rule public", "original_string": "@Rule public MockWebServer server = new MockWebServer();", "type": "MockWebServer", "var_name": "server" }, { "declarator": "fileSystem = new InMemoryFileSystem...
{ "body": "@Test public void noneResponseSourceHeaders() throws Exception {\n server.enqueue(new MockResponse().setBody(\"Isla Nublar\"));\n\n HttpURLConnection connection1 = factory.open(server.url(\"/\").url());\n assertResponseHeader(connection1, \"NETWORK 200\");\n assertResponseBody(connection1, \"Is...
{ "fields": [ { "declarator": "client", "modifier": "private", "original_string": "private OkHttpClient client;", "type": "OkHttpClient", "var_name": "client" } ], "file": "okhttp-urlconnection/src/main/java/okhttp3/OkUrlFactory.java", "identifier": "OkUrlFactory", "inter...
{ "body": "public HttpURLConnection open(URL url) {\n return open(url, client.proxy());\n }", "class_method_signature": "OkUrlFactory.open(URL url)", "constructor": false, "full_signature": "public HttpURLConnection open(URL url)", "identifier": "open", "invocations": [ "open", "proxy" ], "m...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_5
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createOkResponseForCacheGet_withMissingStatusLine() throws Exception {\n URI uri = new URI(\"http://foo/bar\");\n Request request = new Request.Builder().url(uri.toURL()).build();\n CacheResponse cacheResponse = new CacheResponse() {\n @Override public Map<String, List<Strin...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static Response createOkResponseForCacheGet(Request request, CacheResponse javaResponse)\n throws IOException {\n\n // Build a cache request for the response to use.\n Headers responseHeaders = createHeaders(javaResponse.getHeaders());\n Headers varyHeaders;\n if (OkHeaders.hasVaryAll(resp...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_51
{ "fields": [ { "declarator": "server = new MockWebServer()", "modifier": "@Rule public", "original_string": "@Rule public MockWebServer server = new MockWebServer();", "type": "MockWebServer", "var_name": "server" }, { "declarator": "fileSystem = new InMemoryFileSystem...
{ "body": "@Test\n public void setInstanceFollowRedirectsFalse() throws Exception {\n server.enqueue(new MockResponse()\n .setResponseCode(302)\n .addHeader(\"Location: /b\")\n .setBody(\"A\"));\n server.enqueue(new MockResponse()\n .setBody(\"B\"));\n\n HttpURLConnection connect...
{ "fields": [ { "declarator": "client", "modifier": "private", "original_string": "private OkHttpClient client;", "type": "OkHttpClient", "var_name": "client" } ], "file": "okhttp-urlconnection/src/main/java/okhttp3/OkUrlFactory.java", "identifier": "OkUrlFactory", "inter...
{ "body": "public HttpURLConnection open(URL url) {\n return open(url, client.proxy());\n }", "class_method_signature": "OkUrlFactory.open(URL url)", "constructor": false, "full_signature": "public HttpURLConnection open(URL url)", "identifier": "open", "invocations": [ "open", "proxy" ], "m...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_10
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaUrlConnection_requestChangesForbidden() throws Exception {\n Response okResponse = createArbitraryOkResponse();\n HttpURLConnection httpUrlConnection =\n JavaApiConverter.createJavaUrlConnectionForCachePut(okResponse);\n // Check an arbitrary (not complete) set o...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static HttpURLConnection createJavaUrlConnectionForCachePut(Response okResponse) {\n Request request = okResponse.request();\n // Create an object of the correct class in case the ResponseCache uses instanceof.\n if (request.isHttps()) {\n return new CacheHttpsURLConnection(new CacheHttpURLCo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_47
{ "fields": [ { "declarator": "server = new MockWebServer()", "modifier": "@Rule public", "original_string": "@Rule public MockWebServer server = new MockWebServer();", "type": "MockWebServer", "var_name": "server" }, { "declarator": "fileSystem = new InMemoryFileSystem...
{ "body": "@Test public void conditionalCacheHitResponseSourceHeaders() throws Exception {\n server.enqueue(new MockResponse()\n .addHeader(\"Last-Modified: \" + formatDate(0, TimeUnit.SECONDS))\n .addHeader(\"Cache-Control: max-age=0\")\n .setBody(\"Isla Nublar\"));\n server.enqueue(new Mo...
{ "fields": [ { "declarator": "client", "modifier": "private", "original_string": "private OkHttpClient client;", "type": "OkHttpClient", "var_name": "client" } ], "file": "okhttp-urlconnection/src/main/java/okhttp3/OkUrlFactory.java", "identifier": "OkUrlFactory", "inter...
{ "body": "public HttpURLConnection open(URL url) {\n return open(url, client.proxy());\n }", "class_method_signature": "OkUrlFactory.open(URL url)", "constructor": false, "full_signature": "public HttpURLConnection open(URL url)", "identifier": "open", "invocations": [ "open", "proxy" ], "m...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_9
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createOkRequest_nullRequestHeaderKey() throws Exception {\n URI uri = new URI(\"https://foo/bar\");\n\n Map<String, List<String>> javaRequestHeaders = new HashMap<>();\n javaRequestHeaders.put(null, Arrays.asList(\"GET / HTTP 1.1\"));\n javaRequestHeaders.put(\"Foo\", Arrays.a...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "public static Request createOkRequest(\n URI uri, String requestMethod, Map<String, List<String>> requestHeaders) {\n // OkHttp's Call API requires a placeholder body; the real body will be streamed separately.\n RequestBody placeholderBody = HttpMethod.requiresRequestBody(requestMethod)\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_30
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void basicResponseBody() throws IOException {\n setLevel(Level.BASIC);\n\n server.enqueue(new MockResponse()\n .setBody(\"Hello!\")\n .setHeader(\"Content-Type\", PLAIN));\n Response response = client.newCall(request().build()).execute();\n response.body().close();\n\...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_26
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void setLevelShouldPreventNullValue() {\n try {\n applicationInterceptor.setLevel(null);\n fail();\n } catch (NullPointerException expected) {\n assertEquals(\"level == null. Use Level.NONE instead.\", expected.getMessage());\n }\n }", "class_method_signature": "Http...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_40
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void bodyPost() throws IOException {\n setLevel(Level.BODY);\n\n server.enqueue(new MockResponse());\n Request request = request().post(RequestBody.create(PLAIN, \"Hi?\")).build();\n Response response = client.newCall(request).execute();\n response.body().close();\n\n applica...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_17
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaUrlConnection_https_forbiddenFields() throws Exception {\n Request okRequest = createArbitraryOkRequest().newBuilder()\n .url(\"https://secure/request\")\n .build();\n Response okResponse = createArbitraryOkResponse(okRequest);\n HttpsURLConnection httpsUr...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static HttpURLConnection createJavaUrlConnectionForCachePut(Response okResponse) {\n Request request = okResponse.request();\n // Create an object of the correct class in case the ResponseCache uses instanceof.\n if (request.isHttps()) {\n return new CacheHttpsURLConnection(new CacheHttpURLCo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_56
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void postByteEntity() throws Exception {\n server.enqueue(new MockResponse());\n\n final HttpPost post = new HttpPost(server.url(\"/\").url().toURI());\n byte[] body = \"Hello, world!\".getBytes(UTF_8);\n post.setEntity(new ByteArrayEntity(body));\n client.execute(post);\n\n ...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_2
{ "fields": [ { "declarator": "server = new MockWebServer()", "modifier": "@Rule public final", "original_string": "@Rule public final MockWebServer server = new MockWebServer();", "type": "MockWebServer", "var_name": "server" } ], "file": "mockwebserver/src/test/java/okhttp3...
{ "body": "@Test public void hostNameImplicitlyStarts() throws IOException {\n assertNotNull(server.getHostName());\n }", "class_method_signature": "MockWebServerTest.hostNameImplicitlyStarts()", "constructor": false, "full_signature": "@Test public void hostNameImplicitlyStarts()", "identifier": "hostNam...
{ "fields": [ { "declarator": "UNTRUSTED_TRUST_MANAGER = new X509TrustManager() {\n @Override public void checkClientTrusted(X509Certificate[] chain, String authType)\n throws CertificateException {\n throw new CertificateException();\n }\n\n @Override public void checkServerTrusted(X50...
{ "body": "public String getHostName() {\n maybeStart();\n return inetSocketAddress.getHostName();\n }", "class_method_signature": "MockWebServer.getHostName()", "constructor": false, "full_signature": "public String getHostName()", "identifier": "getHostName", "invocations": [ "maybeStart", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_21
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void extractJavaHeaders() throws Exception {\n Request okRequest = createArbitraryOkRequest().newBuilder()\n .addHeader(\"key1\", \"value1_1\")\n .addHeader(\"key2\", \"value2\")\n .addHeader(\"key1\", \"value1_2\")\n .build();\n Map<String, List<String>> java...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static Map<String, List<String>> extractJavaHeaders(Request request) {\n return JavaNetHeaders.toMultimap(request.headers(), null);\n }", "class_method_signature": "JavaApiConverter.extractJavaHeaders(Request request)", "constructor": false, "full_signature": "static Map<String, List<String>> ext...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_60
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void postOverrideContentType() throws Exception {\n server.enqueue(new MockResponse());\n\n HttpPost httpPost = new HttpPost();\n httpPost.setURI(server.url(\"/\").url().toURI());\n httpPost.addHeader(\"Content-Type\", \"application/xml\");\n httpPost.setEntity(new StringEntity(...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_37
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void bodyGet() throws IOException {\n setLevel(Level.BODY);\n\n server.enqueue(new MockResponse());\n Response response = client.newCall(request().build()).execute();\n response.body().close();\n\n applicationLogs\n .assertLogEqual(\"--> GET \" + url + \" HTTP/1.1\")\n ...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_36
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void headersResponseBody() throws IOException {\n setLevel(Level.HEADERS);\n\n server.enqueue(new MockResponse()\n .setBody(\"Hello!\")\n .setHeader(\"Content-Type\", PLAIN));\n Response response = client.newCall(request().build()).execute();\n response.body().close()...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_61
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void contentType() throws Exception {\n server.enqueue(new MockResponse().setBody(\"<html><body><h1>Hello, World!</h1></body></html>\")\n .setHeader(\"Content-Type\", \"text/html\"));\n server.enqueue(new MockResponse().setBody(\"{\\\"Message\\\": { \\\"text\\\": \\\"Hello, World!...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_20
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaCacheResponse_httpsPost() throws Exception {\n Request okRequest =\n createArbitraryOkRequest().newBuilder()\n .url(\"https://secure/request\")\n .post(createRequestBody(\"RequestBody\"))\n .build();\n ResponseBody responseBody = cre...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "public static CacheResponse createJavaCacheResponse(final Response response) {\n final Headers headers = response.headers();\n final ResponseBody body = response.body();\n if (response.request().isHttps()) {\n final Handshake handshake = response.handshake();\n return new SecureCacheResp...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_57
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void postInputStreamEntity() throws Exception {\n server.enqueue(new MockResponse());\n\n final HttpPost post = new HttpPost(server.url(\"/\").url().toURI());\n byte[] body = \"Hello, world!\".getBytes(UTF_8);\n post.setEntity(new InputStreamEntity(new ByteArrayInputStream(body), b...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_3
{ "fields": [ { "declarator": "server = new MockWebServer()", "modifier": "@Rule public final", "original_string": "@Rule public final MockWebServer server = new MockWebServer();", "type": "MockWebServer", "var_name": "server" } ], "file": "mockwebserver/src/test/java/okhttp3...
{ "body": "@Test public void toProxyAddressImplicitlyStarts() throws IOException {\n assertNotNull(server.toProxyAddress());\n }", "class_method_signature": "MockWebServerTest.toProxyAddressImplicitlyStarts()", "constructor": false, "full_signature": "@Test public void toProxyAddressImplicitlyStarts()", "...
{ "fields": [ { "declarator": "UNTRUSTED_TRUST_MANAGER = new X509TrustManager() {\n @Override public void checkClientTrusted(X509Certificate[] chain, String authType)\n throws CertificateException {\n throw new CertificateException();\n }\n\n @Override public void checkServerTrusted(X50...
{ "body": "public Proxy toProxyAddress() {\n maybeStart();\n InetSocketAddress address = new InetSocketAddress(inetSocketAddress.getAddress(), getPort());\n return new Proxy(Proxy.Type.HTTP, address);\n }", "class_method_signature": "MockWebServer.toProxyAddress()", "constructor": false, "full_signatu...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_16
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaUrlConnection_https_extraHttpsMethods() throws Exception {\n Request okRequest = createArbitraryOkRequest().newBuilder()\n .get()\n .url(\"https://secure/request\")\n .build();\n Handshake handshake = Handshake.get(null, CipherSuite.TLS_RSA_WITH_NULL_M...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static HttpURLConnection createJavaUrlConnectionForCachePut(Response okResponse) {\n Request request = okResponse.request();\n // Create an object of the correct class in case the ResponseCache uses instanceof.\n if (request.isHttps()) {\n return new CacheHttpsURLConnection(new CacheHttpURLCo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_41
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void bodyResponseBody() throws IOException {\n setLevel(Level.BODY);\n\n server.enqueue(new MockResponse()\n .setBody(\"Hello!\")\n .setHeader(\"Content-Type\", PLAIN));\n Response response = client.newCall(request().build()).execute();\n response.body().close();\n\n ...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_0
{ "fields": [ { "declarator": "server = new MockWebServer()", "modifier": "@Rule public final", "original_string": "@Rule public final MockWebServer server = new MockWebServer();", "type": "MockWebServer", "var_name": "server" } ], "file": "mockwebserver/src/test/java/okhttp3...
{ "body": "@Test public void shutdownWithoutStart() throws IOException {\n MockWebServer server = new MockWebServer();\n server.shutdown();\n }", "class_method_signature": "MockWebServerTest.shutdownWithoutStart()", "constructor": false, "full_signature": "@Test public void shutdownWithoutStart()", "id...
{ "fields": [ { "declarator": "UNTRUSTED_TRUST_MANAGER = new X509TrustManager() {\n @Override public void checkClientTrusted(X509Certificate[] chain, String authType)\n throws CertificateException {\n throw new CertificateException();\n }\n\n @Override public void checkServerTrusted(X50...
{ "body": "public synchronized void shutdown() throws IOException {\n if (!started) return;\n if (serverSocket == null) throw new IllegalStateException(\"shutdown() before start()\");\n\n // Cause acceptConnections() to break out.\n serverSocket.close();\n\n // Await shutdown.\n try {\n if (!ex...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_54
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void sessionExpired() throws Exception {\n server.enqueue(new MockResponse().setResponseCode(422));\n\n HttpGet request = new HttpGet(server.url(\"/\").url().toURI());\n HttpResponse response = client.execute(request);\n assertEquals(422, response.getStatusLine().getStatusCode());\...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_15
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaUrlConnection_accessibleRequestInfo_POST() throws Exception {\n Request okRequest = createArbitraryOkRequest().newBuilder()\n .post(createRequestBody(\"PostBody\"))\n .build();\n Response okResponse = createArbitraryOkResponse(okRequest);\n HttpURLConnecti...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static HttpURLConnection createJavaUrlConnectionForCachePut(Response okResponse) {\n Request request = okResponse.request();\n // Create an object of the correct class in case the ResponseCache uses instanceof.\n if (request.isHttps()) {\n return new CacheHttpsURLConnection(new CacheHttpURLCo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_42
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void bodyResponseBodyChunked() throws IOException {\n setLevel(Level.BODY);\n\n server.enqueue(new MockResponse()\n .setChunkedBody(\"Hello!\", 2)\n .setHeader(\"Content-Type\", PLAIN));\n Response response = client.newCall(request().build()).execute();\n response.bod...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_39
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void bodyGet205() throws IOException {\n setLevel(Level.BODY);\n bodyGetNoBody(205);\n }", "class_method_signature": "HttpLoggingInterceptorTest.bodyGet205()", "constructor": false, "full_signature": "@Test public void bodyGet205()", "identifier": "bodyGet205", "invocations": ...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_58
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void postEmptyEntity() throws Exception {\n server.enqueue(new MockResponse());\n final HttpPost post = new HttpPost(server.url(\"/\").url().toURI());\n client.execute(post);\n\n RecordedRequest request = server.takeRequest();\n assertEquals(0, request.getBodySize());\n asser...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_19
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaCacheResponse_httpPost() throws Exception {\n Request okRequest =\n createArbitraryOkRequest().newBuilder()\n .url(\"http://insecure/request\")\n .post(createRequestBody(\"RequestBody\"))\n .build();\n ResponseBody responseBody = cre...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "public static CacheResponse createJavaCacheResponse(final Response response) {\n final Headers headers = response.headers();\n final ResponseBody body = response.body();\n if (response.request().isHttps()) {\n final Handshake handshake = response.handshake();\n return new SecureCacheResp...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_35
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void headersPostNoLength() throws IOException {\n setLevel(Level.HEADERS);\n\n server.enqueue(new MockResponse());\n RequestBody body = new RequestBody() {\n @Override public MediaType contentType() {\n return PLAIN;\n }\n\n @Override public void writeTo(Buffered...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_62
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void contentTypeIsCaseInsensitive() throws URISyntaxException, IOException {\n server.enqueue(new MockResponse().setBody(\"{\\\"Message\\\": { \\\"text\\\": \\\"Hello, World!\\\" } }\")\n .setHeader(\"cONTENT-tYPE\", \"application/json\"));\n\n HttpGet request = new HttpGet(server...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_23
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void extractStatusLine() throws Exception {\n Map<String, List<String>> javaResponseHeaders = new HashMap<>();\n javaResponseHeaders.put(null, Arrays.asList(\"StatusLine\"));\n javaResponseHeaders.put(\"key1\", Arrays.asList(\"value1_1\", \"value1_2\"));\n javaResponseHeaders.put(\...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "private static String extractStatusLine(HttpURLConnection httpUrlConnection) {\n // Java specifies that this will be be response header with a null key.\n return httpUrlConnection.getHeaderField(null);\n }", "class_method_signature": "JavaApiConverter.extractStatusLine(HttpURLConnection httpUrlCon...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_22
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void extractOkHeaders() {\n Map<String, List<String>> javaResponseHeaders = new HashMap<>();\n javaResponseHeaders.put(null, Arrays.asList(\"StatusLine\"));\n javaResponseHeaders.put(\"key1\", Arrays.asList(\"value1_1\", \"value1_2\"));\n javaResponseHeaders.put(\"key2\", Arrays.as...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "private static Headers extractOkHeaders(CacheResponse javaResponse) throws IOException {\n Map<String, List<String>> javaResponseHeaders = javaResponse.getHeaders();\n return extractOkHeaders(javaResponseHeaders);\n }", "class_method_signature": "JavaApiConverter.extractOkHeaders(CacheResponse jav...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_63
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void contentEncoding() throws Exception {\n String text = \"{\\\"Message\\\": { \\\"text\\\": \\\"Hello, World!\\\" } }\";\n server.enqueue(new MockResponse().setBody(gzip(text))\n .setHeader(\"Content-Encoding\", \"gzip\"));\n\n HttpGet request = new HttpGet(server.url(\"/\")....
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_34
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void headersPostNoContentType() throws IOException {\n setLevel(Level.HEADERS);\n\n server.enqueue(new MockResponse());\n Request request = request().post(RequestBody.create(null, \"Hi?\")).build();\n Response response = client.newCall(request).execute();\n response.body().close...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_18
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaCacheResponse_httpGet() throws Exception {\n Request okRequest =\n createArbitraryOkRequest().newBuilder()\n .url(\"http://insecure/request\")\n .get()\n .build();\n Response okResponse = createArbitraryOkResponse(okRequest).newBuild...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "public static CacheResponse createJavaCacheResponse(final Response response) {\n final Headers headers = response.headers();\n final ResponseBody body = response.body();\n if (response.request().isHttps()) {\n final Handshake handshake = response.handshake();\n return new SecureCacheResp...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_59
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void putEmptyEntity() throws Exception {\n server.enqueue(new MockResponse());\n final HttpPut put = new HttpPut(server.url(\"/\").url().toURI());\n client.execute(put);\n\n RecordedRequest request = server.takeRequest();\n assertEquals(0, request.getBodySize());\n assertNotN...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_38
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void bodyGet204() throws IOException {\n setLevel(Level.BODY);\n bodyGetNoBody(204);\n }", "class_method_signature": "HttpLoggingInterceptorTest.bodyGet204()", "constructor": false, "full_signature": "@Test public void bodyGet204()", "identifier": "bodyGet204", "invocations": ...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_43
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void bodyResponseNotIdentityEncoded() throws IOException {\n setLevel(Level.BODY);\n\n server.enqueue(new MockResponse()\n .setHeader(\"Content-Encoding\", \"gzip\")\n .setHeader(\"Content-Type\", PLAIN)\n .setBody(new Buffer().write(ByteString.decodeBase64(\n ...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_14
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaUrlConnection_accessibleRequestInfo_GET() throws Exception {\n Request okRequest = createArbitraryOkRequest().newBuilder()\n .get()\n .build();\n Response okResponse = createArbitraryOkResponse(okRequest);\n HttpURLConnection httpUrlConnection =\n J...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static HttpURLConnection createJavaUrlConnectionForCachePut(Response okResponse) {\n Request request = okResponse.request();\n // Create an object of the correct class in case the ResponseCache uses instanceof.\n if (request.isHttps()) {\n return new CacheHttpsURLConnection(new CacheHttpURLCo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_1
{ "fields": [ { "declarator": "server = new MockWebServer()", "modifier": "@Rule public final", "original_string": "@Rule public final MockWebServer server = new MockWebServer();", "type": "MockWebServer", "var_name": "server" } ], "file": "mockwebserver/src/test/java/okhttp3...
{ "body": "@Test public void portImplicitlyStarts() throws IOException {\n assertTrue(server.getPort() > 0);\n }", "class_method_signature": "MockWebServerTest.portImplicitlyStarts()", "constructor": false, "full_signature": "@Test public void portImplicitlyStarts()", "identifier": "portImplicitlyStarts",...
{ "fields": [ { "declarator": "UNTRUSTED_TRUST_MANAGER = new X509TrustManager() {\n @Override public void checkClientTrusted(X509Certificate[] chain, String authType)\n throws CertificateException {\n throw new CertificateException();\n }\n\n @Override public void checkServerTrusted(X50...
{ "body": "public int getPort() {\n maybeStart();\n return port;\n }", "class_method_signature": "MockWebServer.getPort()", "constructor": false, "full_signature": "public int getPort()", "identifier": "getPort", "invocations": [ "maybeStart" ], "modifiers": "public", "parameters": "()", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_55
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void headers() throws Exception {\n server.enqueue(new MockResponse().addHeader(\"Foo\", \"Bar\"));\n server.enqueue(new MockResponse().addHeader(\"Foo\", \"Bar\").addHeader(\"Foo\", \"Baz\"));\n\n HttpGet request1 = new HttpGet(server.url(\"/\").url().toURI());\n HttpResponse resp...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_48
{ "fields": [ { "declarator": "server = new MockWebServer()", "modifier": "@Rule public", "original_string": "@Rule public MockWebServer server = new MockWebServer();", "type": "MockWebServer", "var_name": "server" }, { "declarator": "fileSystem = new InMemoryFileSystem...
{ "body": "@Test public void conditionalCacheMissResponseSourceHeaders() throws Exception {\n server.enqueue(new MockResponse()\n .addHeader(\"Last-Modified: \" + formatDate(0, TimeUnit.SECONDS))\n .addHeader(\"Cache-Control: max-age=0\")\n .setBody(\"Isla Nublar\"));\n server.enqueue(new M...
{ "fields": [ { "declarator": "client", "modifier": "private", "original_string": "private OkHttpClient client;", "type": "OkHttpClient", "var_name": "client" } ], "file": "okhttp-urlconnection/src/main/java/okhttp3/OkUrlFactory.java", "identifier": "OkUrlFactory", "inter...
{ "body": "public HttpURLConnection open(URL url) {\n return open(url, client.proxy());\n }", "class_method_signature": "OkUrlFactory.open(URL url)", "constructor": false, "full_signature": "public HttpURLConnection open(URL url)", "identifier": "open", "invocations": [ "open", "proxy" ], "m...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_33
{ "fields": [ { "declarator": "PLAIN = MediaType.parse(\"text/plain; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType PLAIN = MediaType.parse(\"text/plain; charset=utf-8\");", "type": "MediaType", "var_name": "PLAIN" }, ...
{ "body": "@Test public void headersPost() throws IOException {\n setLevel(Level.HEADERS);\n\n server.enqueue(new MockResponse());\n Request request = request().post(RequestBody.create(PLAIN, \"Hi?\")).build();\n Response response = client.newCall(request).execute();\n response.body().close();\n\n a...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF8" }, { "declarator": "logger", "modifie...
{ "body": "public HttpLoggingInterceptor setLevel(Level level) {\n if (level == null) throw new NullPointerException(\"level == null. Use Level.NONE instead.\");\n this.level = level;\n return this;\n }", "class_method_signature": "HttpLoggingInterceptor.setLevel(Level level)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_64
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void jsonGzipResponse() throws Exception {\n String text = \"{\\\"Message\\\": { \\\"text\\\": \\\"Hello, World!\\\" } }\";\n server.enqueue(new MockResponse().setBody(gzip(text))\n .setHeader(\"Content-Encoding\", \"gzip\")\n .setHeader(\"Content-Type\", \"application/json...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_25
{ "fields": [ { "declarator": "sslContext = SslContextBuilder.localhost()", "modifier": "private", "original_string": "private SSLContext sslContext = SslContextBuilder.localhost();", "type": "SSLContext", "var_name": "sslContext" }, { "declarator": "hostnameVerifier = ...
{ "body": "@Test public void get_httpsGet() throws Exception {\n final URL serverUrl = configureHttpsServer(new MockResponse());\n assertEquals(\"https\", serverUrl.getProtocol());\n\n ResponseCache responseCache = new AbstractResponseCache() {\n @Override public CacheResponse get(URI uri, String method...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final ResponseCache delegate;", "type": "ResponseCache", "var_name": "delegate" } ], "file": "okhttp-android-support/src/main/java/okhttp3/internal/huc/CacheAdapter.java", "id...
{ "body": "@Override public Response get(Request request) throws IOException {\n CacheResponse javaResponse = getJavaCachedResponse(request);\n if (javaResponse == null) {\n return null;\n }\n return JavaApiConverter.createOkResponseForCacheGet(request, javaResponse);\n }", "class_method_signature...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_52
{ "fields": [ { "declarator": "server", "modifier": "private", "original_string": "private MockWebServer server;", "type": "MockWebServer", "var_name": "server" }, { "declarator": "client", "modifier": "private", "original_string": "private OkApacheClient cl...
{ "body": "@Test public void success() throws Exception {\n server.enqueue(new MockResponse().setBody(\"Hello, World!\"));\n\n HttpGet request = new HttpGet(server.url(\"/\").url().toURI());\n HttpResponse response = client.execute(request);\n String actual = EntityUtils.toString(response.getEntity());\n ...
{ "fields": [ { "declarator": "params = new AbstractHttpParams() {\n @Override public Object getParameter(String name) {\n if (name.equals(ConnRouteParams.DEFAULT_PROXY)) {\n Proxy proxy = client.proxy();\n if (proxy == null) {\n return null;\n }\n InetSocketAddr...
{ "body": "@Override public HttpResponse execute(HttpUriRequest request) throws IOException {\n return execute(null, request, (HttpContext) null);\n }", "class_method_signature": "OkApacheClient.execute(HttpUriRequest request)", "constructor": false, "full_signature": "@Override public HttpResponse execute(...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_6
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createOkResponseForCacheGet_secure() throws Exception {\n final String statusLine = \"HTTP/1.1 200 Fantastic\";\n final Principal localPrincipal = LOCAL_CERT.getSubjectX500Principal();\n final List<Certificate> localCertificates = Arrays.<Certificate>asList(LOCAL_CERT);\n fina...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static Response createOkResponseForCacheGet(Request request, CacheResponse javaResponse)\n throws IOException {\n\n // Build a cache request for the response to use.\n Headers responseHeaders = createHeaders(javaResponse.getHeaders());\n Headers varyHeaders;\n if (OkHeaders.hasVaryAll(resp...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }
49818800_13
{ "fields": [ { "declarator": "LOCAL_CERT = certificate(\"\"\n + \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIBWDCCAQKgAwIBAgIJANS1EtICX2AZMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV\\n\"\n + \"BAMTCWxvY2FsaG9zdDAgFw0xMjAxMDIxOTA4NThaGA8yMTExMTIwOTE5MDg1OFow\\n\"\n + \"FDESMBAGA1UEAxMJbG9jYWxob3N0MF...
{ "body": "@Test public void createJavaUrlConnection_responseHeadersOk() throws Exception {\n ResponseBody responseBody = createResponseBody(\"BodyText\");\n Response okResponse = new Response.Builder()\n .request(createArbitraryOkRequest())\n .protocol(Protocol.HTTP_1_1)\n .code(200)\n ...
{ "fields": [ { "declarator": "EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0])", "modifier": "private static final", "original_string": "private static final RequestBody EMPTY_REQUEST_BODY = RequestBody.create(null, new byte[0]);", "type": "RequestBody", "var_name": "EMPTY...
{ "body": "static HttpURLConnection createJavaUrlConnectionForCachePut(Response okResponse) {\n Request request = okResponse.request();\n // Create an object of the correct class in case the ResponseCache uses instanceof.\n if (request.isHttps()) {\n return new CacheHttpsURLConnection(new CacheHttpURLCo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 49818800, "size": 641, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/lizhangqu/PriorityOkHttp" }