id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
4349381_2 | {
"fields": [],
"file": "data/src/test/java/fr/ippon/android/opendata/data/distance/AsTheCrowFliesDistanceCalculatorTest.java",
"identifier": "AsTheCrowFliesDistanceCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetDistanceBetweenPointsBigDistance() throws Exception {\n\n\t\t// Statue of Liberty\n\t\tGpsPoint p1 = new GpsPoint(40.6892, -74.0444);\n\t\t// Eiffel Tower\n\t\tGpsPoint p2 = new GpsPoint(48.8583, 2.2945);\n\n\t\tAsTheCrowFliesDistanceCalculator cal = new AsTheCrowFliesDistanceCalculator();\n\t\tdouble distance = cal.getDistanceBetweenPoints(p1, p2);\n\n\t\t// 5837km\n\t\tdouble expectedDistance = 5837 * 1000;\n\t\t// Tolérance de 2%\n\t\tdouble tolerance = 2 * expectedDistance / 100;\n\n\t\tassertEquals(expectedDistance, distance, tolerance);\n\t}",
"class_method_signature": "AsTheCrowFliesDistanceCalculatorTest.testGetDistanceBetweenPointsBigDistance()",
"constructor": false,
"full_signature": "@Test public void testGetDistanceBetweenPointsBigDistance()",
"identifier": "testGetDistanceBetweenPointsBigDistance",
"invocations": [
"getDistanceBetweenPoints",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetDistanceBetweenPointsBigDistance()",
"testcase": true
} | {
"fields": [],
"file": "data/src/main/java/fr/ippon/android/opendata/data/distance/AsTheCrowFliesDistanceCalculator.java",
"identifier": "AsTheCrowFliesDistanceCalculator",
"interfaces": "implements DistanceCalculator",
"methods": [
{
"class_method_signature": "AsTheCrowFliesDistanceCalculator.getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"constructor": false,
"full_signature": "public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"identifier": "getDistanceBetweenPoints",
"modifiers": "public",
"parameters": "(GpsPoint p1, GpsPoint p2)",
"return": "double",
"signature": "double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2) {\n\t\t// http://en.wikipedia.org/wiki/Haversine_formula\n\t\tdouble dLat = Math.toRadians(p2.getLatitude() - p1.getLatitude());\n\t\tdouble dLon = Math.toRadians(p2.getLongitude() - p1.getLongitude());\n\t\tdouble lat1 = Math.toRadians(p1.getLatitude());\n\t\tdouble lat2 = Math.toRadians(p2.getLatitude());\n\n\t\tdouble a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2)\n\t\t\t\t* Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);\n\t\tdouble c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t\tdouble distance = EARTH_RADIUS * c;\n\n\t\treturn distance;\n\t}",
"class_method_signature": "AsTheCrowFliesDistanceCalculator.getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"constructor": false,
"full_signature": "public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"identifier": "getDistanceBetweenPoints",
"invocations": [
"toRadians",
"getLatitude",
"getLatitude",
"toRadians",
"getLongitude",
"getLongitude",
"toRadians",
"getLatitude",
"toRadians",
"getLatitude",
"sin",
"sin",
"sin",
"sin",
"cos",
"cos",
"atan2",
"sqrt",
"sqrt"
],
"modifiers": "public",
"parameters": "(GpsPoint p1, GpsPoint p2)",
"return": "double",
"signature": "double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 4349381,
"size": 5172,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/ippontech/nantes-mobi-parkings"
} |
4349381_3 | {
"fields": [],
"file": "data/src/test/java/fr/ippon/android/opendata/data/distance/BoundingBoxCalculatorTest.java",
"identifier": "BoundingBoxCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetBoundingBox() {\n\t\tBoundingBoxCalculator cal = new BoundingBoxCalculator();\n\t\tGpsPoint center = new GpsPoint(47.21806, -1.55278);\n\t\t\n\t\t// 3km\n\t\tdouble bboxsize = 3 * 1000;\n\t\t// Tolérance de 1.5/1000\n\t\tdouble tolerance = 1.5d * bboxsize / 1000;\n\t\t\n\t\tBoundingBox bbox = cal.getBoundingBox(center, bboxsize);\n\t\tassertNotNull(bbox);\n\n\t\tAsTheCrowFliesDistanceCalculator distanceCalc = new AsTheCrowFliesDistanceCalculator();\n\t\tGpsPoint bottomright = new GpsPoint(bbox.getMin().getLatitude(), bbox\n\t\t\t\t.getMax().getLongitude());\n\t\tGpsPoint topright = new GpsPoint(bbox.getMax().getLatitude(), bbox\n\t\t\t\t.getMax().getLongitude());\n\t\tGpsPoint bottomleft = new GpsPoint(bbox.getMin().getLatitude(), bbox\n\t\t\t\t.getMin().getLongitude());\n\n\t\tdouble distanceLat = distanceCalc.getDistanceBetweenPoints(bottomright,\n\t\t\t\ttopright);\n\t\tassertEquals(bboxsize * 2, distanceLat, tolerance);\n\n\t\tdouble distanceLong = distanceCalc.getDistanceBetweenPoints(\n\t\t\t\tbottomright, bottomleft);\n\t\tassertEquals(bboxsize * 2, distanceLong, tolerance);\n\t}",
"class_method_signature": "BoundingBoxCalculatorTest.testGetBoundingBox()",
"constructor": false,
"full_signature": "@Test public void testGetBoundingBox()",
"identifier": "testGetBoundingBox",
"invocations": [
"getBoundingBox",
"assertNotNull",
"getLatitude",
"getMin",
"getLongitude",
"getMax",
"getLatitude",
"getMax",
"getLongitude",
"getMax",
"getLatitude",
"getMin",
"getLongitude",
"getMin",
"getDistanceBetweenPoints",
"assertEquals",
"getDistanceBetweenPoints",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetBoundingBox()",
"testcase": true
} | {
"fields": [],
"file": "data/src/main/java/fr/ippon/android/opendata/data/distance/BoundingBoxCalculator.java",
"identifier": "BoundingBoxCalculator",
"interfaces": "",
"methods": [
{
"class_method_signature": "BoundingBoxCalculator.getBoundingBox(GpsPoint center, double distance)",
"constructor": false,
"full_signature": "public BoundingBox getBoundingBox(GpsPoint center, double distance)",
"identifier": "getBoundingBox",
"modifiers": "public",
"parameters": "(GpsPoint center, double distance)",
"return": "BoundingBox",
"signature": "BoundingBox getBoundingBox(GpsPoint center, double distance)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public BoundingBox getBoundingBox(GpsPoint center, double distance) {\n\n\t\t// angular distance in radians on a great circle\n\t\tdouble radDist = distance / EARTH_RADIUS;\n\t\tdouble radLat = Math.toRadians(center.getLatitude());\n\t\tdouble radLon = Math.toRadians(center.getLongitude());\n\n\t\tdouble minLat = radLat - radDist;\n\t\tdouble maxLat = radLat + radDist;\n\n\t\tdouble minLon, maxLon;\n\t\tif (minLat > MIN_LATITUDE && maxLat < MAX_LATITUDE) {\n\t\t\tdouble deltaLon = Math.asin(Math.sin(radDist) / Math.cos(radLat));\n\t\t\tminLon = radLon - deltaLon;\n\t\t\tif (minLon < MIN_LONGITUDE) {\n\t\t\t\tminLon += 2d * Math.PI;\n\t\t\t}\n\t\t\tmaxLon = radLon + deltaLon;\n\t\t\tif (maxLon > MAX_LONGITUDE) {\n\t\t\t\tmaxLon -= 2d * Math.PI;\n\t\t\t}\n\t\t} else {\n\t\t\t// a pole is within the distance\n\t\t\tminLat = Math.max(minLat, MIN_LATITUDE);\n\t\t\tmaxLat = Math.min(maxLat, MAX_LATITUDE);\n\t\t\tminLon = MIN_LONGITUDE;\n\t\t\tmaxLon = MAX_LONGITUDE;\n\t\t}\n\n\t\tGpsPoint min = new GpsPoint(Math.toDegrees(minLat),\n\t\t\t\tMath.toDegrees(minLon));\n\t\tGpsPoint max = new GpsPoint(Math.toDegrees(maxLat),\n\t\t\t\tMath.toDegrees(maxLon));\n\n\t\treturn new BoundingBox(min, max);\n\t}",
"class_method_signature": "BoundingBoxCalculator.getBoundingBox(GpsPoint center, double distance)",
"constructor": false,
"full_signature": "public BoundingBox getBoundingBox(GpsPoint center, double distance)",
"identifier": "getBoundingBox",
"invocations": [
"toRadians",
"getLatitude",
"toRadians",
"getLongitude",
"asin",
"sin",
"cos",
"max",
"min",
"toDegrees",
"toDegrees",
"toDegrees",
"toDegrees"
],
"modifiers": "public",
"parameters": "(GpsPoint center, double distance)",
"return": "BoundingBox",
"signature": "BoundingBox getBoundingBox(GpsPoint center, double distance)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 4349381,
"size": 5172,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/ippontech/nantes-mobi-parkings"
} |
4349381_4 | {
"fields": [],
"file": "data/src/test/java/fr/ippon/android/opendata/data/distance/GoogleMapsDirectionDistanceCalculatorTest.java",
"identifier": "GoogleMapsDirectionDistanceCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\t@Ignore(\"Use network for testing\")\n\tpublic void testGetOnlineGoogleRoutes() throws IOException {\n\t\t// Nantes\n\t\tGpsPoint p1 = new GpsPoint(47.2208, -1.5584);\n\t\t// Combourg\n\t\tGpsPoint p2 = new GpsPoint(48.4116, -1.7525);\n\t\tGoogleMapsDirectionDistanceCalculator dist = new GoogleMapsDirectionDistanceCalculator();\n\t\tdouble distance = dist.getDistanceBetweenPoints(p1, p2);\n\t\t\n\t\t// 146km\n\t\tdouble expectedDistance = 146000;\n\t\t// 100 metres\n\t\tdouble tolerance = 100.0d;\n\t\t\n\t\tassertEquals(expectedDistance, distance, tolerance);\n\t}",
"class_method_signature": "GoogleMapsDirectionDistanceCalculatorTest.testGetOnlineGoogleRoutes()",
"constructor": false,
"full_signature": "@Test @Ignore(\"Use network for testing\") public void testGetOnlineGoogleRoutes()",
"identifier": "testGetOnlineGoogleRoutes",
"invocations": [
"getDistanceBetweenPoints",
"assertEquals"
],
"modifiers": "@Test @Ignore(\"Use network for testing\") public",
"parameters": "()",
"return": "void",
"signature": "void testGetOnlineGoogleRoutes()",
"testcase": true
} | {
"fields": [
{
"declarator": "GOOGLE_API = \"http://maps.googleapis.com/maps/api/directions/json\"",
"modifier": "private static final",
"original_string": "private static final String GOOGLE_API = \"http://maps.googleapis.com/maps/api/directions/json\";",
"type": "String",
"var_name": "GOOGLE_API"
}
],
"file": "data/src/main/java/fr/ippon/android/opendata/data/distance/GoogleMapsDirectionDistanceCalculator.java",
"identifier": "GoogleMapsDirectionDistanceCalculator",
"interfaces": "implements\n\t\tDistanceCalculator",
"methods": [
{
"class_method_signature": "GoogleMapsDirectionDistanceCalculator.getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"constructor": false,
"full_signature": "public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"identifier": "getDistanceBetweenPoints",
"modifiers": "public",
"parameters": "(GpsPoint p1, GpsPoint p2)",
"return": "double",
"signature": "double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"testcase": false
},
{
"class_method_signature": "GoogleMapsDirectionDistanceCalculator.appendParameterToUrl(String url, GpsPoint p1, GpsPoint p2)",
"constructor": false,
"full_signature": "protected String appendParameterToUrl(String url, GpsPoint p1, GpsPoint p2)",
"identifier": "appendParameterToUrl",
"modifiers": "protected",
"parameters": "(String url, GpsPoint p1, GpsPoint p2)",
"return": "String",
"signature": "String appendParameterToUrl(String url, GpsPoint p1, GpsPoint p2)",
"testcase": false
},
{
"class_method_signature": "GoogleMapsDirectionDistanceCalculator.getGoogleRoutes(String jsonString)",
"constructor": false,
"full_signature": "protected GoogleRoutes getGoogleRoutes(String jsonString)",
"identifier": "getGoogleRoutes",
"modifiers": "protected",
"parameters": "(String jsonString)",
"return": "GoogleRoutes",
"signature": "GoogleRoutes getGoogleRoutes(String jsonString)",
"testcase": false
},
{
"class_method_signature": "GoogleMapsDirectionDistanceCalculator.inputStreamAsString(InputStream stream)",
"constructor": false,
"full_signature": "protected static String inputStreamAsString(InputStream stream)",
"identifier": "inputStreamAsString",
"modifiers": "protected static",
"parameters": "(InputStream stream)",
"return": "String",
"signature": "String inputStreamAsString(InputStream stream)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2) {\n\n\t\tHttpGet httpRequest = new HttpGet(appendParameterToUrl(GOOGLE_API, p1,\n\t\t\t\tp2));\n\n\t\tHttpClient httpclient = new DefaultHttpClient();\n\t\tHttpResponse response = null;\n\t\tGoogleRoutes pl = null;\n\t\ttry {\n\t\t\tresponse = httpclient.execute(httpRequest);\n\t\t\tString jsonString = inputStreamAsString(response.getEntity()\n\t\t\t\t\t.getContent());\n\t\t\tpl = getGoogleRoutes(jsonString);\n\t\t} catch (ClientProtocolException e) {\n\t\t\t// Impossible de traiter la requete...\n\t\t\t// FIXME Log ou Exception ?\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// FIXME Log ou Exception ?\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Extraction de la seule étape du trajet\n\t\tif (pl != null) {\n\t\t\treturn pl.getLeg(0).getDistance();\n\t\t}\n\n\t\t// FIXME Retour d'un objet complexe capable de contenir (valeur +\n\t\t// statut)\n\t\treturn -1;\n\t}",
"class_method_signature": "GoogleMapsDirectionDistanceCalculator.getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"constructor": false,
"full_signature": "public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"identifier": "getDistanceBetweenPoints",
"invocations": [
"appendParameterToUrl",
"execute",
"inputStreamAsString",
"getContent",
"getEntity",
"getGoogleRoutes",
"printStackTrace",
"printStackTrace",
"getDistance",
"getLeg"
],
"modifiers": "public",
"parameters": "(GpsPoint p1, GpsPoint p2)",
"return": "double",
"signature": "double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 4349381,
"size": 5172,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/ippontech/nantes-mobi-parkings"
} |
4349381_5 | {
"fields": [],
"file": "data/src/test/java/fr/ippon/android/opendata/data/traffic/SegmentTest.java",
"identifier": "SegmentTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void parseSegments() {\n //given\n InputStream is = this.getClass().getResourceAsStream(\n \"/segments.json\");\n\n //when\n List<Segment> segs = Segment.parseSegments(is);\n\n //then\n assertNotNull(segs);\n assertEquals(3, segs.size());\n assertEquals(5, segs.get(2).coords.size());\n assertEquals(\"80\", segs.get(2).name);\n assertNull(segs.get(0).getColorId());\n }",
"class_method_signature": "SegmentTest.parseSegments()",
"constructor": false,
"full_signature": "@Test public void parseSegments()",
"identifier": "parseSegments",
"invocations": [
"getResourceAsStream",
"getClass",
"parseSegments",
"assertNotNull",
"assertEquals",
"size",
"assertEquals",
"size",
"get",
"assertEquals",
"get",
"assertNull",
"getColorId",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void parseSegments()",
"testcase": true
} | {
"fields": [
{
"declarator": "name",
"modifier": "protected",
"original_string": "protected String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "colorId",
"modifier": "protected",
"original_string": "protected Integer colorId;",
"type": "Integer",
"var_name": "colorId"
},
{
"declarator": "lastUpdate",
"modifier": "protected",
"original_string": "protected Date lastUpdate;",
"type": "Date",
"var_name": "lastUpdate"
},
{
"declarator": "coords = new ArrayList<IE6GeoPoint>()",
"modifier": "protected",
"original_string": "protected List<IE6GeoPoint> coords = new ArrayList<IE6GeoPoint>();",
"type": "List<IE6GeoPoint>",
"var_name": "coords"
}
],
"file": "data/src/main/java/fr/ippon/android/opendata/data/traffic/Segment.java",
"identifier": "Segment",
"interfaces": "",
"methods": [
{
"class_method_signature": "Segment.getLastUpdate()",
"constructor": false,
"full_signature": "public Date getLastUpdate()",
"identifier": "getLastUpdate",
"modifiers": "public",
"parameters": "()",
"return": "Date",
"signature": "Date getLastUpdate()",
"testcase": false
},
{
"class_method_signature": "Segment.setLastUpdate(Date lastUpdate)",
"constructor": false,
"full_signature": "public void setLastUpdate(Date lastUpdate)",
"identifier": "setLastUpdate",
"modifiers": "public",
"parameters": "(Date lastUpdate)",
"return": "void",
"signature": "void setLastUpdate(Date lastUpdate)",
"testcase": false
},
{
"class_method_signature": "Segment.getColorId()",
"constructor": false,
"full_signature": "public Integer getColorId()",
"identifier": "getColorId",
"modifiers": "public",
"parameters": "()",
"return": "Integer",
"signature": "Integer getColorId()",
"testcase": false
},
{
"class_method_signature": "Segment.setColorId(Integer colorId)",
"constructor": false,
"full_signature": "public void setColorId(Integer colorId)",
"identifier": "setColorId",
"modifiers": "public",
"parameters": "(Integer colorId)",
"return": "void",
"signature": "void setColorId(Integer colorId)",
"testcase": false
},
{
"class_method_signature": "Segment.getName()",
"constructor": false,
"full_signature": "public String getName()",
"identifier": "getName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getName()",
"testcase": false
},
{
"class_method_signature": "Segment.setName(String name)",
"constructor": false,
"full_signature": "public void setName(String name)",
"identifier": "setName",
"modifiers": "public",
"parameters": "(String name)",
"return": "void",
"signature": "void setName(String name)",
"testcase": false
},
{
"class_method_signature": "Segment.getCoords()",
"constructor": false,
"full_signature": "public List<IE6GeoPoint> getCoords()",
"identifier": "getCoords",
"modifiers": "public",
"parameters": "()",
"return": "List<IE6GeoPoint>",
"signature": "List<IE6GeoPoint> getCoords()",
"testcase": false
},
{
"class_method_signature": "Segment.setCoords(List<IE6GeoPoint> coords)",
"constructor": false,
"full_signature": "public void setCoords(List<IE6GeoPoint> coords)",
"identifier": "setCoords",
"modifiers": "public",
"parameters": "(List<IE6GeoPoint> coords)",
"return": "void",
"signature": "void setCoords(List<IE6GeoPoint> coords)",
"testcase": false
},
{
"class_method_signature": "Segment.parseSegments(InputStream in)",
"constructor": false,
"full_signature": "public static List<Segment> parseSegments(InputStream in)",
"identifier": "parseSegments",
"modifiers": "public static",
"parameters": "(InputStream in)",
"return": "List<Segment>",
"signature": "List<Segment> parseSegments(InputStream in)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<Segment> parseSegments(InputStream in) {\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new InputStreamReader(in, \"UTF-8\"));\n Gson gson = new Gson();\n return gson.fromJson(reader, new TypeToken<List<Segment>>() {}.getType());\n } catch (UnsupportedEncodingException e) {\n return new ArrayList<Segment>();\n }\n }",
"class_method_signature": "Segment.parseSegments(InputStream in)",
"constructor": false,
"full_signature": "public static List<Segment> parseSegments(InputStream in)",
"identifier": "parseSegments",
"invocations": [
"fromJson",
"getType"
],
"modifiers": "public static",
"parameters": "(InputStream in)",
"return": "List<Segment>",
"signature": "List<Segment> parseSegments(InputStream in)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 4349381,
"size": 5172,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/ippontech/nantes-mobi-parkings"
} |
4349381_0 | {
"fields": [
{
"declarator": "api",
"modifier": "protected",
"original_string": "protected BisonFuteApi api;",
"type": "BisonFuteApi",
"var_name": "api"
}
],
"file": "data/src/test/java/fr/ippon/android/opendata/data/trafficfluency/BisonFuteApiTest.java",
"identifier": "BisonFuteApiTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetBisonFuteTrafficStatus() throws ApiReseauException {\n //given\n api.setConnecteur(new FileConnector(\"/TraficStatus.xml\"));\n\n //when\n List<FreewaySegmentFluency> res = api.getBisonFuteTrafficStatus();\n\n //then\n assertNotNull(res);\n assertEquals(44, res.size());\n assertTrue(res.get(0) instanceof FreewaySegmentFluency);\n assertNotNull(((FreewaySegmentFluency) res.get(0)).getTime());\n assertEquals(TrafficStatus.FREE_FlOW, ((FreewaySegmentFluency) res.get(0)).getTrafficStatus());\n assertEquals(\"MWL44.31\", ((FreewaySegmentFluency) res.get(0)).getLocationId());\n }",
"class_method_signature": "BisonFuteApiTest.testGetBisonFuteTrafficStatus()",
"constructor": false,
"full_signature": "@Test public void testGetBisonFuteTrafficStatus()",
"identifier": "testGetBisonFuteTrafficStatus",
"invocations": [
"setConnecteur",
"getBisonFuteTrafficStatus",
"assertNotNull",
"assertEquals",
"size",
"assertTrue",
"get",
"assertNotNull",
"getTime",
"get",
"assertEquals",
"getTrafficStatus",
"get",
"assertEquals",
"getLocationId",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetBisonFuteTrafficStatus()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(BisonFuteApi.class.getSimpleName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(BisonFuteApi.class.getSimpleName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "URL = \"http://www.bison-fute.gouv.fr/diffusions/datex2/base/Nantes_mvs/\"",
"modifier": "private static final",
"original_string": "private static final String URL = \"http://www.bison-fute.gouv.fr/diffusions/datex2/base/Nantes_mvs/\";",
"type": "String",
"var_name": "URL"
},
{
"declarator": "connecteur",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private Connecteur connecteur;",
"type": "Connecteur",
"var_name": "connecteur"
},
{
"declarator": "CMD_SEGMENT_FLUENCY = \"TraficStatus_cigt_nantes_maintenant.xml\"",
"modifier": "private static final",
"original_string": "private static final String CMD_SEGMENT_FLUENCY = \"TraficStatus_cigt_nantes_maintenant.xml\";",
"type": "String",
"var_name": "CMD_SEGMENT_FLUENCY"
}
],
"file": "data/src/main/java/fr/ippon/android/opendata/data/trafficfluency/BisonFuteApi.java",
"identifier": "BisonFuteApi",
"interfaces": "",
"methods": [
{
"class_method_signature": "BisonFuteApi.setConnecteur(Connecteur connecteur)",
"constructor": false,
"full_signature": "protected void setConnecteur(Connecteur connecteur)",
"identifier": "setConnecteur",
"modifiers": "protected",
"parameters": "(Connecteur connecteur)",
"return": "void",
"signature": "void setConnecteur(Connecteur connecteur)",
"testcase": false
},
{
"class_method_signature": "BisonFuteApi.BisonFuteApi()",
"constructor": true,
"full_signature": "public BisonFuteApi()",
"identifier": "BisonFuteApi",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " BisonFuteApi()",
"testcase": false
},
{
"class_method_signature": "BisonFuteApi.getBisonFuteTrafficStatus()",
"constructor": false,
"full_signature": "public List<FreewaySegmentFluency> getBisonFuteTrafficStatus()",
"identifier": "getBisonFuteTrafficStatus",
"modifiers": "public",
"parameters": "()",
"return": "List<FreewaySegmentFluency>",
"signature": "List<FreewaySegmentFluency> getBisonFuteTrafficStatus()",
"testcase": false
},
{
"class_method_signature": "BisonFuteApi.appelApi(String url)",
"constructor": false,
"full_signature": "private List<BasicDataValue> appelApi(String url)",
"identifier": "appelApi",
"modifiers": "private",
"parameters": "(String url)",
"return": "List<BasicDataValue>",
"signature": "List<BasicDataValue> appelApi(String url)",
"testcase": false
},
{
"class_method_signature": "BisonFuteApi.getUrl(String commande)",
"constructor": false,
"full_signature": "private String getUrl(String commande)",
"identifier": "getUrl",
"modifiers": "private",
"parameters": "(String commande)",
"return": "String",
"signature": "String getUrl(String commande)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public List<FreewaySegmentFluency> getBisonFuteTrafficStatus() throws ApiReseauException {\n //FreewaySegmentFluency\n List<FreewaySegmentFluency> freewaySegFluency = new ArrayList<FreewaySegmentFluency>();\n List<BasicDataValue> result = appelApi(getUrl(CMD_SEGMENT_FLUENCY));\n for(BasicDataValue r: result) {\n if(r instanceof FreewaySegmentFluency) {\n freewaySegFluency.add((FreewaySegmentFluency) r);\n }\n }\n return freewaySegFluency;\n }",
"class_method_signature": "BisonFuteApi.getBisonFuteTrafficStatus()",
"constructor": false,
"full_signature": "public List<FreewaySegmentFluency> getBisonFuteTrafficStatus()",
"identifier": "getBisonFuteTrafficStatus",
"invocations": [
"appelApi",
"getUrl",
"add"
],
"modifiers": "public",
"parameters": "()",
"return": "List<FreewaySegmentFluency>",
"signature": "List<FreewaySegmentFluency> getBisonFuteTrafficStatus()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 4349381,
"size": 5172,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/ippontech/nantes-mobi-parkings"
} |
4349381_1 | {
"fields": [],
"file": "data/src/test/java/fr/ippon/android/opendata/data/distance/AsTheCrowFliesDistanceCalculatorTest.java",
"identifier": "AsTheCrowFliesDistanceCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetDistanceBetweenPointsSmallDistance() throws Exception {\n\n\t\t// Haluchère\n\t\tGpsPoint p1 = new GpsPoint(47.2481, -1.5214);\n\t\t// Beaujoire\n\t\tGpsPoint p2 = new GpsPoint(47.2565, -1.5280);\n\n\t\tAsTheCrowFliesDistanceCalculator cal = new AsTheCrowFliesDistanceCalculator();\n\t\tdouble distance = cal.getDistanceBetweenPoints(p1, p2);\n\n\t\t// 1km\n\t\tdouble expectedDistance = 1058.5;\n\t\t// Tolérance de 10cm\n\t\tdouble tolerance = 0.1d;\n\n\t\tassertEquals(expectedDistance, distance, tolerance);\n\t}",
"class_method_signature": "AsTheCrowFliesDistanceCalculatorTest.testGetDistanceBetweenPointsSmallDistance()",
"constructor": false,
"full_signature": "@Test public void testGetDistanceBetweenPointsSmallDistance()",
"identifier": "testGetDistanceBetweenPointsSmallDistance",
"invocations": [
"getDistanceBetweenPoints",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetDistanceBetweenPointsSmallDistance()",
"testcase": true
} | {
"fields": [],
"file": "data/src/main/java/fr/ippon/android/opendata/data/distance/AsTheCrowFliesDistanceCalculator.java",
"identifier": "AsTheCrowFliesDistanceCalculator",
"interfaces": "implements DistanceCalculator",
"methods": [
{
"class_method_signature": "AsTheCrowFliesDistanceCalculator.getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"constructor": false,
"full_signature": "public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"identifier": "getDistanceBetweenPoints",
"modifiers": "public",
"parameters": "(GpsPoint p1, GpsPoint p2)",
"return": "double",
"signature": "double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2) {\n\t\t// http://en.wikipedia.org/wiki/Haversine_formula\n\t\tdouble dLat = Math.toRadians(p2.getLatitude() - p1.getLatitude());\n\t\tdouble dLon = Math.toRadians(p2.getLongitude() - p1.getLongitude());\n\t\tdouble lat1 = Math.toRadians(p1.getLatitude());\n\t\tdouble lat2 = Math.toRadians(p2.getLatitude());\n\n\t\tdouble a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2)\n\t\t\t\t* Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);\n\t\tdouble c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t\tdouble distance = EARTH_RADIUS * c;\n\n\t\treturn distance;\n\t}",
"class_method_signature": "AsTheCrowFliesDistanceCalculator.getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"constructor": false,
"full_signature": "public double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"identifier": "getDistanceBetweenPoints",
"invocations": [
"toRadians",
"getLatitude",
"getLatitude",
"toRadians",
"getLongitude",
"getLongitude",
"toRadians",
"getLatitude",
"toRadians",
"getLatitude",
"sin",
"sin",
"sin",
"sin",
"cos",
"cos",
"atan2",
"sqrt",
"sqrt"
],
"modifiers": "public",
"parameters": "(GpsPoint p1, GpsPoint p2)",
"return": "double",
"signature": "double getDistanceBetweenPoints(GpsPoint p1, GpsPoint p2)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 4349381,
"size": 5172,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/ippontech/nantes-mobi-parkings"
} |
54371579_9 | {
"fields": [],
"file": "presenter/src/test/java/nucleus/presenter/RxPresenterTest.java",
"identifier": "RxPresenterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRestartable() throws Exception {\n RxPresenter presenter = new RxPresenter();\n presenter.create(null);\n\n Func0<Subscription> restartable = mock(Func0.class);\n Subscription subscription = mock(Subscription.class);\n when(restartable.call()).thenReturn(subscription);\n when(subscription.isUnsubscribed()).thenReturn(false);\n presenter.restartable(1, restartable);\n\n verifyNoMoreInteractions(restartable);\n\n presenter.start(1);\n\n verify(restartable, times(1)).call();\n verifyNoMoreInteractions(restartable);\n\n Bundle bundle = BundleMock.mock();\n presenter.onSave(bundle);\n\n presenter = new RxPresenter();\n presenter.create(bundle);\n presenter.restartable(1, restartable);\n\n verify(restartable, times(2)).call();\n verifyNoMoreInteractions(restartable);\n }",
"class_method_signature": "RxPresenterTest.testRestartable()",
"constructor": false,
"full_signature": "@Test public void testRestartable()",
"identifier": "testRestartable",
"invocations": [
"create",
"mock",
"mock",
"thenReturn",
"when",
"call",
"thenReturn",
"when",
"isUnsubscribed",
"restartable",
"verifyNoMoreInteractions",
"start",
"call",
"verify",
"times",
"verifyNoMoreInteractions",
"mock",
"onSave",
"create",
"restartable",
"call",
"verify",
"times",
"verifyNoMoreInteractions"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testRestartable()",
"testcase": true
} | {
"fields": [
{
"declarator": "REQUESTED_KEY = RxPresenter.class.getName() + \"#requested\"",
"modifier": "private static final",
"original_string": "private static final String REQUESTED_KEY = RxPresenter.class.getName() + \"#requested\";",
"type": "String",
"var_name": "REQUESTED_KEY"
},
{
"declarator": "views = BehaviorSubject.create()",
"modifier": "private final",
"original_string": "private final BehaviorSubject<View> views = BehaviorSubject.create();",
"type": "BehaviorSubject<View>",
"var_name": "views"
},
{
"declarator": "subscriptions = new SubscriptionList()",
"modifier": "private",
"original_string": "private SubscriptionList subscriptions = new SubscriptionList();",
"type": "SubscriptionList",
"var_name": "subscriptions"
},
{
"declarator": "restartables = new HashMap<>()",
"modifier": "private final",
"original_string": "private final HashMap<Integer, Func0<Subscription>> restartables = new HashMap<>();",
"type": "HashMap<Integer, Func0<Subscription>>",
"var_name": "restartables"
},
{
"declarator": "restartables4 = new HashMap<>()",
"modifier": "private final",
"original_string": "private final HashMap<Integer, Func4<?, ?, ?, ?, Subscription>> restartables4 = new HashMap<>();",
"type": "HashMap<Integer, Func4<?, ?, ?, ?, Subscription>>",
"var_name": "restartables4"
},
{
"declarator": "workingSubscribers = new HashMap<>()",
"modifier": "private final",
"original_string": "private final HashMap<Integer, Subscription> workingSubscribers = new HashMap<>();",
"type": "HashMap<Integer, Subscription>",
"var_name": "workingSubscribers"
}
],
"file": "presenter/src/main/java/nucleus/presenter/RxPresenter.java",
"identifier": "RxPresenter",
"interfaces": "",
"methods": [
{
"class_method_signature": "RxPresenter.view()",
"constructor": false,
"full_signature": "public Observable<View> view()",
"identifier": "view",
"modifiers": "public",
"parameters": "()",
"return": "Observable<View>",
"signature": "Observable<View> view()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.add(Subscription subscription)",
"constructor": false,
"full_signature": "public void add(Subscription subscription)",
"identifier": "add",
"modifiers": "public",
"parameters": "(Subscription subscription)",
"return": "void",
"signature": "void add(Subscription subscription)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.remove(Subscription subscription)",
"constructor": false,
"full_signature": "public void remove(Subscription subscription)",
"identifier": "remove",
"modifiers": "public",
"parameters": "(Subscription subscription)",
"return": "void",
"signature": "void remove(Subscription subscription)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartable(int restartableId, Func0<Subscription> factory)",
"constructor": false,
"full_signature": "public void restartable(int restartableId, Func0<Subscription> factory)",
"identifier": "restartable",
"modifiers": "public",
"parameters": "(int restartableId, Func0<Subscription> factory)",
"return": "void",
"signature": "void restartable(int restartableId, Func0<Subscription> factory)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartable(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory)",
"constructor": false,
"full_signature": "public void restartable(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory)",
"identifier": "restartable",
"modifiers": "public",
"parameters": "(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory)",
"return": "void",
"signature": "void restartable(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.start(int restartableId)",
"constructor": false,
"full_signature": "public void start(int restartableId)",
"identifier": "start",
"modifiers": "public",
"parameters": "(int restartableId)",
"return": "void",
"signature": "void start(int restartableId)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.start(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4)",
"constructor": false,
"full_signature": "public void start(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4)",
"identifier": "start",
"modifiers": "public",
"parameters": "(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4)",
"return": "void",
"signature": "void start(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.stop(int restartableId)",
"constructor": false,
"full_signature": "public void stop(int restartableId)",
"identifier": "stop",
"modifiers": "public",
"parameters": "(int restartableId)",
"return": "void",
"signature": "void stop(int restartableId)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"identifier": "restartableFirst",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"return": "void",
"signature": "void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableFirst(int restartableId,\n final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,\n final Action2<View, T> onNext,\n @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public void restartableFirst(int restartableId,\n final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,\n final Action2<View, T> onNext,\n @Nullable final Action2<View, Throwable> onError)",
"identifier": "restartableFirst",
"modifiers": "public",
"parameters": "(int restartableId,\n final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,\n final Action2<View, T> onNext,\n @Nullable final Action2<View, Throwable> onError)",
"return": "void",
"signature": "void restartableFirst(int restartableId,\n final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,\n final Action2<View, T> onNext,\n @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"constructor": false,
"full_signature": "public void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"identifier": "restartableFirst",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"return": "void",
"signature": "void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"identifier": "restartableLatestCache",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"return": "void",
"signature": "void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"constructor": false,
"full_signature": "public void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"identifier": "restartableLatestCache",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"return": "void",
"signature": "void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"identifier": "restartableReplay",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"return": "void",
"signature": "void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"constructor": false,
"full_signature": "public void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"identifier": "restartableReplay",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"return": "void",
"signature": "void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.deliverLatestCache()",
"constructor": false,
"full_signature": "public DeliverLatestCache<View, T> deliverLatestCache()",
"identifier": "deliverLatestCache",
"modifiers": "public",
"parameters": "()",
"return": "DeliverLatestCache<View, T>",
"signature": "DeliverLatestCache<View, T> deliverLatestCache()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.deliverFirst()",
"constructor": false,
"full_signature": "public DeliverFirst<View, T> deliverFirst()",
"identifier": "deliverFirst",
"modifiers": "public",
"parameters": "()",
"return": "DeliverFirst<View, T>",
"signature": "DeliverFirst<View, T> deliverFirst()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.deliverReplay()",
"constructor": false,
"full_signature": "public DeliverReplay<View, T> deliverReplay()",
"identifier": "deliverReplay",
"modifiers": "public",
"parameters": "()",
"return": "DeliverReplay<View, T>",
"signature": "DeliverReplay<View, T> deliverReplay()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.split(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public Action1<Delivery<View, T>> split(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"identifier": "split",
"modifiers": "public",
"parameters": "(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"return": "Action1<Delivery<View, T>>",
"signature": "Action1<Delivery<View, T>> split(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.split(Action2<View, T> onNext)",
"constructor": false,
"full_signature": "public Action1<Delivery<View, T>> split(Action2<View, T> onNext)",
"identifier": "split",
"modifiers": "public",
"parameters": "(Action2<View, T> onNext)",
"return": "Action1<Delivery<View, T>>",
"signature": "Action1<Delivery<View, T>> split(Action2<View, T> onNext)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.afterTakeViewDeliverLastestCache()",
"constructor": false,
"full_signature": "public Observable<Delivery<View, T>> afterTakeViewDeliverLastestCache()",
"identifier": "afterTakeViewDeliverLastestCache",
"modifiers": "public",
"parameters": "()",
"return": "Observable<Delivery<View, T>>",
"signature": "Observable<Delivery<View, T>> afterTakeViewDeliverLastestCache()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.afterTakeView()",
"constructor": false,
"full_signature": "public Observable<View> afterTakeView()",
"identifier": "afterTakeView",
"modifiers": "public",
"parameters": "()",
"return": "Observable<View>",
"signature": "Observable<View> afterTakeView()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onCreate(Bundle savedState)",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onCreate(Bundle savedState)",
"identifier": "onCreate",
"modifiers": "@CallSuper @Override protected",
"parameters": "(Bundle savedState)",
"return": "void",
"signature": "void onCreate(Bundle savedState)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restore()",
"constructor": false,
"full_signature": "@Override public void restore()",
"identifier": "restore",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void restore()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onDestroy()",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onDestroy()",
"identifier": "onDestroy",
"modifiers": "@CallSuper @Override protected",
"parameters": "()",
"return": "void",
"signature": "void onDestroy()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onSave(Bundle state)",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onSave(Bundle state)",
"identifier": "onSave",
"modifiers": "@CallSuper @Override protected",
"parameters": "(Bundle state)",
"return": "void",
"signature": "void onSave(Bundle state)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onTakeView(View view)",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onTakeView(View view)",
"identifier": "onTakeView",
"modifiers": "@CallSuper @Override protected",
"parameters": "(View view)",
"return": "void",
"signature": "void onTakeView(View view)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onDropView()",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onDropView()",
"identifier": "onDropView",
"modifiers": "@CallSuper @Override protected",
"parameters": "()",
"return": "void",
"signature": "void onDropView()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.getView()",
"constructor": false,
"full_signature": "@Deprecated @Nullable @Override public View getView()",
"identifier": "getView",
"modifiers": "@Deprecated @Nullable @Override public",
"parameters": "()",
"return": "View",
"signature": "View getView()",
"testcase": false
}
],
"superclass": "extends Presenter<View>"
} | {
"body": "public void restartable(int restartableId, Func0<Subscription> factory) {\n if (workingSubscribers.containsKey(restartableId))\n stop(restartableId);\n restartables.put(restartableId, factory);\n }",
"class_method_signature": "RxPresenter.restartable(int restartableId, Func0<Subscription> factory)",
"constructor": false,
"full_signature": "public void restartable(int restartableId, Func0<Subscription> factory)",
"identifier": "restartable",
"invocations": [
"containsKey",
"stop",
"put"
],
"modifiers": "public",
"parameters": "(int restartableId, Func0<Subscription> factory)",
"return": "void",
"signature": "void restartable(int restartableId, Func0<Subscription> factory)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54371579,
"size": 905,
"stargazer_count": 40,
"stars": null,
"updates": null,
"url": "https://github.com/caifeile/FlowGeek"
} |
54371579_14 | {
"fields": [
{
"declarator": "BASE_VIEW_CLASS = FrameLayout.class",
"modifier": "public static final",
"original_string": "public static final Class<?> BASE_VIEW_CLASS = FrameLayout.class;",
"type": "Class<?>",
"var_name": "BASE_VIEW_CLASS"
},
{
"declarator": "VIEW_CLASS = TestView.class",
"modifier": "public static final",
"original_string": "public static final Class<TestView> VIEW_CLASS = TestView.class;",
"type": "Class<TestView>",
"var_name": "VIEW_CLASS"
},
{
"declarator": "mockPresenter",
"modifier": "private",
"original_string": "private TestPresenter mockPresenter;",
"type": "TestPresenter",
"var_name": "mockPresenter"
},
{
"declarator": "mockDelegate",
"modifier": "private",
"original_string": "private PresenterLifecycleDelegate mockDelegate;",
"type": "PresenterLifecycleDelegate",
"var_name": "mockDelegate"
},
{
"declarator": "mockFactory",
"modifier": "private",
"original_string": "private ReflectionPresenterFactory mockFactory;",
"type": "ReflectionPresenterFactory",
"var_name": "mockFactory"
},
{
"declarator": "tested",
"modifier": "private",
"original_string": "private TestView tested;",
"type": "TestView",
"var_name": "tested"
}
],
"file": "presenter/src/test/java/nucleus/view/NucleusLayoutTest.java",
"identifier": "NucleusLayoutTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getActivityFromWrappedContext() throws Exception {\n Activity activity = mock(Activity.class);\n ContextWrapper wrapper = mock(ContextWrapper.class);\n when(wrapper.getBaseContext()).thenReturn(activity);\n ContextWrapper wrapper2 = mock(ContextWrapper.class);\n when(wrapper2.getBaseContext()).thenReturn(wrapper);\n stub(method(BASE_VIEW_CLASS, \"getContext\")).toReturn(wrapper2);\n assertEquals(activity, tested.getActivity());\n }",
"class_method_signature": "NucleusLayoutTest.getActivityFromWrappedContext()",
"constructor": false,
"full_signature": "@Test public void getActivityFromWrappedContext()",
"identifier": "getActivityFromWrappedContext",
"invocations": [
"mock",
"mock",
"thenReturn",
"when",
"getBaseContext",
"mock",
"thenReturn",
"when",
"getBaseContext",
"toReturn",
"stub",
"method",
"assertEquals",
"getActivity"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getActivityFromWrappedContext()",
"testcase": true
} | {
"fields": [
{
"declarator": "PARENT_STATE_KEY = \"parent_state\"",
"modifier": "private static final",
"original_string": "private static final String PARENT_STATE_KEY = \"parent_state\";",
"type": "String",
"var_name": "PARENT_STATE_KEY"
},
{
"declarator": "PRESENTER_STATE_KEY = \"presenter_state\"",
"modifier": "private static final",
"original_string": "private static final String PRESENTER_STATE_KEY = \"presenter_state\";",
"type": "String",
"var_name": "PRESENTER_STATE_KEY"
},
{
"declarator": "presenterDelegate =\n new PresenterLifecycleDelegate<>(ReflectionPresenterFactory.<P>fromViewClass(getClass()))",
"modifier": "private",
"original_string": "private PresenterLifecycleDelegate<P> presenterDelegate =\n new PresenterLifecycleDelegate<>(ReflectionPresenterFactory.<P>fromViewClass(getClass()));",
"type": "PresenterLifecycleDelegate<P>",
"var_name": "presenterDelegate"
}
],
"file": "presenter/src/main/java/nucleus/view/NucleusLayout.java",
"identifier": "NucleusLayout",
"interfaces": "implements ViewWithPresenter<P>",
"methods": [
{
"class_method_signature": "NucleusLayout.NucleusLayout(Context context)",
"constructor": true,
"full_signature": "public NucleusLayout(Context context)",
"identifier": "NucleusLayout",
"modifiers": "public",
"parameters": "(Context context)",
"return": "",
"signature": " NucleusLayout(Context context)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.NucleusLayout(Context context, AttributeSet attrs)",
"constructor": true,
"full_signature": "public NucleusLayout(Context context, AttributeSet attrs)",
"identifier": "NucleusLayout",
"modifiers": "public",
"parameters": "(Context context, AttributeSet attrs)",
"return": "",
"signature": " NucleusLayout(Context context, AttributeSet attrs)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.NucleusLayout(Context context, AttributeSet attrs, int defStyle)",
"constructor": true,
"full_signature": "public NucleusLayout(Context context, AttributeSet attrs, int defStyle)",
"identifier": "NucleusLayout",
"modifiers": "public",
"parameters": "(Context context, AttributeSet attrs, int defStyle)",
"return": "",
"signature": " NucleusLayout(Context context, AttributeSet attrs, int defStyle)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.getPresenterFactory()",
"constructor": false,
"full_signature": "public PresenterFactory<P> getPresenterFactory()",
"identifier": "getPresenterFactory",
"modifiers": "public",
"parameters": "()",
"return": "PresenterFactory<P>",
"signature": "PresenterFactory<P> getPresenterFactory()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.setPresenterFactory(PresenterFactory<P> presenterFactory)",
"constructor": false,
"full_signature": "@Override public void setPresenterFactory(PresenterFactory<P> presenterFactory)",
"identifier": "setPresenterFactory",
"modifiers": "@Override public",
"parameters": "(PresenterFactory<P> presenterFactory)",
"return": "void",
"signature": "void setPresenterFactory(PresenterFactory<P> presenterFactory)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.getPresenter()",
"constructor": false,
"full_signature": "public P getPresenter()",
"identifier": "getPresenter",
"modifiers": "public",
"parameters": "()",
"return": "P",
"signature": "P getPresenter()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.getActivity()",
"constructor": false,
"full_signature": "public Activity getActivity()",
"identifier": "getActivity",
"modifiers": "public",
"parameters": "()",
"return": "Activity",
"signature": "Activity getActivity()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onSaveInstanceState()",
"constructor": false,
"full_signature": "@Override protected Parcelable onSaveInstanceState()",
"identifier": "onSaveInstanceState",
"modifiers": "@Override protected",
"parameters": "()",
"return": "Parcelable",
"signature": "Parcelable onSaveInstanceState()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onRestoreInstanceState(Parcelable state)",
"constructor": false,
"full_signature": "@Override protected void onRestoreInstanceState(Parcelable state)",
"identifier": "onRestoreInstanceState",
"modifiers": "@Override protected",
"parameters": "(Parcelable state)",
"return": "void",
"signature": "void onRestoreInstanceState(Parcelable state)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onAttachedToWindow()",
"constructor": false,
"full_signature": "@Override protected void onAttachedToWindow()",
"identifier": "onAttachedToWindow",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void onAttachedToWindow()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onDetachedFromWindow()",
"constructor": false,
"full_signature": "@Override protected void onDetachedFromWindow()",
"identifier": "onDetachedFromWindow",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void onDetachedFromWindow()",
"testcase": false
}
],
"superclass": "extends FrameLayout"
} | {
"body": "public Activity getActivity() {\n Context context = getContext();\n while (!(context instanceof Activity) && context instanceof ContextWrapper)\n context = ((ContextWrapper)context).getBaseContext();\n if (!(context instanceof Activity))\n throw new IllegalStateException(\"Expected an activity context, got \" + context.getClass().getSimpleName());\n return (Activity)context;\n }",
"class_method_signature": "NucleusLayout.getActivity()",
"constructor": false,
"full_signature": "public Activity getActivity()",
"identifier": "getActivity",
"invocations": [
"getContext",
"getBaseContext",
"getSimpleName",
"getClass"
],
"modifiers": "public",
"parameters": "()",
"return": "Activity",
"signature": "Activity getActivity()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54371579,
"size": 905,
"stargazer_count": 40,
"stars": null,
"updates": null,
"url": "https://github.com/caifeile/FlowGeek"
} |
54371579_8 | {
"fields": [],
"file": "presenter/src/test/java/nucleus/presenter/RxPresenterTest.java",
"identifier": "RxPresenterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAdd() throws Exception {\n RxPresenter presenter = new RxPresenter();\n Subscription mock = Mockito.mock(Subscription.class);\n when(mock.isUnsubscribed()).thenReturn(false);\n presenter.add(mock);\n presenter.onDestroy();\n verify(mock, times(1)).unsubscribe();\n verify(mock, atLeastOnce()).isUnsubscribed();\n verifyNoMoreInteractions(mock);\n }",
"class_method_signature": "RxPresenterTest.testAdd()",
"constructor": false,
"full_signature": "@Test public void testAdd()",
"identifier": "testAdd",
"invocations": [
"mock",
"thenReturn",
"when",
"isUnsubscribed",
"add",
"onDestroy",
"unsubscribe",
"verify",
"times",
"isUnsubscribed",
"verify",
"atLeastOnce",
"verifyNoMoreInteractions"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testAdd()",
"testcase": true
} | {
"fields": [
{
"declarator": "REQUESTED_KEY = RxPresenter.class.getName() + \"#requested\"",
"modifier": "private static final",
"original_string": "private static final String REQUESTED_KEY = RxPresenter.class.getName() + \"#requested\";",
"type": "String",
"var_name": "REQUESTED_KEY"
},
{
"declarator": "views = BehaviorSubject.create()",
"modifier": "private final",
"original_string": "private final BehaviorSubject<View> views = BehaviorSubject.create();",
"type": "BehaviorSubject<View>",
"var_name": "views"
},
{
"declarator": "subscriptions = new SubscriptionList()",
"modifier": "private",
"original_string": "private SubscriptionList subscriptions = new SubscriptionList();",
"type": "SubscriptionList",
"var_name": "subscriptions"
},
{
"declarator": "restartables = new HashMap<>()",
"modifier": "private final",
"original_string": "private final HashMap<Integer, Func0<Subscription>> restartables = new HashMap<>();",
"type": "HashMap<Integer, Func0<Subscription>>",
"var_name": "restartables"
},
{
"declarator": "restartables4 = new HashMap<>()",
"modifier": "private final",
"original_string": "private final HashMap<Integer, Func4<?, ?, ?, ?, Subscription>> restartables4 = new HashMap<>();",
"type": "HashMap<Integer, Func4<?, ?, ?, ?, Subscription>>",
"var_name": "restartables4"
},
{
"declarator": "workingSubscribers = new HashMap<>()",
"modifier": "private final",
"original_string": "private final HashMap<Integer, Subscription> workingSubscribers = new HashMap<>();",
"type": "HashMap<Integer, Subscription>",
"var_name": "workingSubscribers"
}
],
"file": "presenter/src/main/java/nucleus/presenter/RxPresenter.java",
"identifier": "RxPresenter",
"interfaces": "",
"methods": [
{
"class_method_signature": "RxPresenter.view()",
"constructor": false,
"full_signature": "public Observable<View> view()",
"identifier": "view",
"modifiers": "public",
"parameters": "()",
"return": "Observable<View>",
"signature": "Observable<View> view()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.add(Subscription subscription)",
"constructor": false,
"full_signature": "public void add(Subscription subscription)",
"identifier": "add",
"modifiers": "public",
"parameters": "(Subscription subscription)",
"return": "void",
"signature": "void add(Subscription subscription)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.remove(Subscription subscription)",
"constructor": false,
"full_signature": "public void remove(Subscription subscription)",
"identifier": "remove",
"modifiers": "public",
"parameters": "(Subscription subscription)",
"return": "void",
"signature": "void remove(Subscription subscription)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartable(int restartableId, Func0<Subscription> factory)",
"constructor": false,
"full_signature": "public void restartable(int restartableId, Func0<Subscription> factory)",
"identifier": "restartable",
"modifiers": "public",
"parameters": "(int restartableId, Func0<Subscription> factory)",
"return": "void",
"signature": "void restartable(int restartableId, Func0<Subscription> factory)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartable(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory)",
"constructor": false,
"full_signature": "public void restartable(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory)",
"identifier": "restartable",
"modifiers": "public",
"parameters": "(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory)",
"return": "void",
"signature": "void restartable(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.start(int restartableId)",
"constructor": false,
"full_signature": "public void start(int restartableId)",
"identifier": "start",
"modifiers": "public",
"parameters": "(int restartableId)",
"return": "void",
"signature": "void start(int restartableId)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.start(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4)",
"constructor": false,
"full_signature": "public void start(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4)",
"identifier": "start",
"modifiers": "public",
"parameters": "(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4)",
"return": "void",
"signature": "void start(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.stop(int restartableId)",
"constructor": false,
"full_signature": "public void stop(int restartableId)",
"identifier": "stop",
"modifiers": "public",
"parameters": "(int restartableId)",
"return": "void",
"signature": "void stop(int restartableId)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"identifier": "restartableFirst",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"return": "void",
"signature": "void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableFirst(int restartableId,\n final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,\n final Action2<View, T> onNext,\n @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public void restartableFirst(int restartableId,\n final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,\n final Action2<View, T> onNext,\n @Nullable final Action2<View, Throwable> onError)",
"identifier": "restartableFirst",
"modifiers": "public",
"parameters": "(int restartableId,\n final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,\n final Action2<View, T> onNext,\n @Nullable final Action2<View, Throwable> onError)",
"return": "void",
"signature": "void restartableFirst(int restartableId,\n final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,\n final Action2<View, T> onNext,\n @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"constructor": false,
"full_signature": "public void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"identifier": "restartableFirst",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"return": "void",
"signature": "void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"identifier": "restartableLatestCache",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"return": "void",
"signature": "void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"constructor": false,
"full_signature": "public void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"identifier": "restartableLatestCache",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"return": "void",
"signature": "void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"identifier": "restartableReplay",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"return": "void",
"signature": "void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory,\n final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"constructor": false,
"full_signature": "public void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"identifier": "restartableReplay",
"modifiers": "public",
"parameters": "(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"return": "void",
"signature": "void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.deliverLatestCache()",
"constructor": false,
"full_signature": "public DeliverLatestCache<View, T> deliverLatestCache()",
"identifier": "deliverLatestCache",
"modifiers": "public",
"parameters": "()",
"return": "DeliverLatestCache<View, T>",
"signature": "DeliverLatestCache<View, T> deliverLatestCache()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.deliverFirst()",
"constructor": false,
"full_signature": "public DeliverFirst<View, T> deliverFirst()",
"identifier": "deliverFirst",
"modifiers": "public",
"parameters": "()",
"return": "DeliverFirst<View, T>",
"signature": "DeliverFirst<View, T> deliverFirst()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.deliverReplay()",
"constructor": false,
"full_signature": "public DeliverReplay<View, T> deliverReplay()",
"identifier": "deliverReplay",
"modifiers": "public",
"parameters": "()",
"return": "DeliverReplay<View, T>",
"signature": "DeliverReplay<View, T> deliverReplay()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.split(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"constructor": false,
"full_signature": "public Action1<Delivery<View, T>> split(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"identifier": "split",
"modifiers": "public",
"parameters": "(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"return": "Action1<Delivery<View, T>>",
"signature": "Action1<Delivery<View, T>> split(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.split(Action2<View, T> onNext)",
"constructor": false,
"full_signature": "public Action1<Delivery<View, T>> split(Action2<View, T> onNext)",
"identifier": "split",
"modifiers": "public",
"parameters": "(Action2<View, T> onNext)",
"return": "Action1<Delivery<View, T>>",
"signature": "Action1<Delivery<View, T>> split(Action2<View, T> onNext)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.afterTakeViewDeliverLastestCache()",
"constructor": false,
"full_signature": "public Observable<Delivery<View, T>> afterTakeViewDeliverLastestCache()",
"identifier": "afterTakeViewDeliverLastestCache",
"modifiers": "public",
"parameters": "()",
"return": "Observable<Delivery<View, T>>",
"signature": "Observable<Delivery<View, T>> afterTakeViewDeliverLastestCache()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.afterTakeView()",
"constructor": false,
"full_signature": "public Observable<View> afterTakeView()",
"identifier": "afterTakeView",
"modifiers": "public",
"parameters": "()",
"return": "Observable<View>",
"signature": "Observable<View> afterTakeView()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onCreate(Bundle savedState)",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onCreate(Bundle savedState)",
"identifier": "onCreate",
"modifiers": "@CallSuper @Override protected",
"parameters": "(Bundle savedState)",
"return": "void",
"signature": "void onCreate(Bundle savedState)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.restore()",
"constructor": false,
"full_signature": "@Override public void restore()",
"identifier": "restore",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void restore()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onDestroy()",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onDestroy()",
"identifier": "onDestroy",
"modifiers": "@CallSuper @Override protected",
"parameters": "()",
"return": "void",
"signature": "void onDestroy()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onSave(Bundle state)",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onSave(Bundle state)",
"identifier": "onSave",
"modifiers": "@CallSuper @Override protected",
"parameters": "(Bundle state)",
"return": "void",
"signature": "void onSave(Bundle state)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onTakeView(View view)",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onTakeView(View view)",
"identifier": "onTakeView",
"modifiers": "@CallSuper @Override protected",
"parameters": "(View view)",
"return": "void",
"signature": "void onTakeView(View view)",
"testcase": false
},
{
"class_method_signature": "RxPresenter.onDropView()",
"constructor": false,
"full_signature": "@CallSuper @Override protected void onDropView()",
"identifier": "onDropView",
"modifiers": "@CallSuper @Override protected",
"parameters": "()",
"return": "void",
"signature": "void onDropView()",
"testcase": false
},
{
"class_method_signature": "RxPresenter.getView()",
"constructor": false,
"full_signature": "@Deprecated @Nullable @Override public View getView()",
"identifier": "getView",
"modifiers": "@Deprecated @Nullable @Override public",
"parameters": "()",
"return": "View",
"signature": "View getView()",
"testcase": false
}
],
"superclass": "extends Presenter<View>"
} | {
"body": "public void add(Subscription subscription) {\n subscriptions.add(subscription);\n }",
"class_method_signature": "RxPresenter.add(Subscription subscription)",
"constructor": false,
"full_signature": "public void add(Subscription subscription)",
"identifier": "add",
"invocations": [
"add"
],
"modifiers": "public",
"parameters": "(Subscription subscription)",
"return": "void",
"signature": "void add(Subscription subscription)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54371579,
"size": 905,
"stargazer_count": 40,
"stars": null,
"updates": null,
"url": "https://github.com/caifeile/FlowGeek"
} |
54371579_13 | {
"fields": [
{
"declarator": "BASE_VIEW_CLASS = FrameLayout.class",
"modifier": "public static final",
"original_string": "public static final Class<?> BASE_VIEW_CLASS = FrameLayout.class;",
"type": "Class<?>",
"var_name": "BASE_VIEW_CLASS"
},
{
"declarator": "VIEW_CLASS = TestView.class",
"modifier": "public static final",
"original_string": "public static final Class<TestView> VIEW_CLASS = TestView.class;",
"type": "Class<TestView>",
"var_name": "VIEW_CLASS"
},
{
"declarator": "mockPresenter",
"modifier": "private",
"original_string": "private TestPresenter mockPresenter;",
"type": "TestPresenter",
"var_name": "mockPresenter"
},
{
"declarator": "mockDelegate",
"modifier": "private",
"original_string": "private PresenterLifecycleDelegate mockDelegate;",
"type": "PresenterLifecycleDelegate",
"var_name": "mockDelegate"
},
{
"declarator": "mockFactory",
"modifier": "private",
"original_string": "private ReflectionPresenterFactory mockFactory;",
"type": "ReflectionPresenterFactory",
"var_name": "mockFactory"
},
{
"declarator": "tested",
"modifier": "private",
"original_string": "private TestView tested;",
"type": "TestView",
"var_name": "tested"
}
],
"file": "presenter/src/test/java/nucleus/view/NucleusLayoutTest.java",
"identifier": "NucleusLayoutTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getActivityFromContext() throws Exception {\n Activity activity = mock(Activity.class);\n stub(method(BASE_VIEW_CLASS, \"getContext\")).toReturn(activity);\n assertEquals(activity, tested.getActivity());\n }",
"class_method_signature": "NucleusLayoutTest.getActivityFromContext()",
"constructor": false,
"full_signature": "@Test public void getActivityFromContext()",
"identifier": "getActivityFromContext",
"invocations": [
"mock",
"toReturn",
"stub",
"method",
"assertEquals",
"getActivity"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getActivityFromContext()",
"testcase": true
} | {
"fields": [
{
"declarator": "PARENT_STATE_KEY = \"parent_state\"",
"modifier": "private static final",
"original_string": "private static final String PARENT_STATE_KEY = \"parent_state\";",
"type": "String",
"var_name": "PARENT_STATE_KEY"
},
{
"declarator": "PRESENTER_STATE_KEY = \"presenter_state\"",
"modifier": "private static final",
"original_string": "private static final String PRESENTER_STATE_KEY = \"presenter_state\";",
"type": "String",
"var_name": "PRESENTER_STATE_KEY"
},
{
"declarator": "presenterDelegate =\n new PresenterLifecycleDelegate<>(ReflectionPresenterFactory.<P>fromViewClass(getClass()))",
"modifier": "private",
"original_string": "private PresenterLifecycleDelegate<P> presenterDelegate =\n new PresenterLifecycleDelegate<>(ReflectionPresenterFactory.<P>fromViewClass(getClass()));",
"type": "PresenterLifecycleDelegate<P>",
"var_name": "presenterDelegate"
}
],
"file": "presenter/src/main/java/nucleus/view/NucleusLayout.java",
"identifier": "NucleusLayout",
"interfaces": "implements ViewWithPresenter<P>",
"methods": [
{
"class_method_signature": "NucleusLayout.NucleusLayout(Context context)",
"constructor": true,
"full_signature": "public NucleusLayout(Context context)",
"identifier": "NucleusLayout",
"modifiers": "public",
"parameters": "(Context context)",
"return": "",
"signature": " NucleusLayout(Context context)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.NucleusLayout(Context context, AttributeSet attrs)",
"constructor": true,
"full_signature": "public NucleusLayout(Context context, AttributeSet attrs)",
"identifier": "NucleusLayout",
"modifiers": "public",
"parameters": "(Context context, AttributeSet attrs)",
"return": "",
"signature": " NucleusLayout(Context context, AttributeSet attrs)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.NucleusLayout(Context context, AttributeSet attrs, int defStyle)",
"constructor": true,
"full_signature": "public NucleusLayout(Context context, AttributeSet attrs, int defStyle)",
"identifier": "NucleusLayout",
"modifiers": "public",
"parameters": "(Context context, AttributeSet attrs, int defStyle)",
"return": "",
"signature": " NucleusLayout(Context context, AttributeSet attrs, int defStyle)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.getPresenterFactory()",
"constructor": false,
"full_signature": "public PresenterFactory<P> getPresenterFactory()",
"identifier": "getPresenterFactory",
"modifiers": "public",
"parameters": "()",
"return": "PresenterFactory<P>",
"signature": "PresenterFactory<P> getPresenterFactory()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.setPresenterFactory(PresenterFactory<P> presenterFactory)",
"constructor": false,
"full_signature": "@Override public void setPresenterFactory(PresenterFactory<P> presenterFactory)",
"identifier": "setPresenterFactory",
"modifiers": "@Override public",
"parameters": "(PresenterFactory<P> presenterFactory)",
"return": "void",
"signature": "void setPresenterFactory(PresenterFactory<P> presenterFactory)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.getPresenter()",
"constructor": false,
"full_signature": "public P getPresenter()",
"identifier": "getPresenter",
"modifiers": "public",
"parameters": "()",
"return": "P",
"signature": "P getPresenter()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.getActivity()",
"constructor": false,
"full_signature": "public Activity getActivity()",
"identifier": "getActivity",
"modifiers": "public",
"parameters": "()",
"return": "Activity",
"signature": "Activity getActivity()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onSaveInstanceState()",
"constructor": false,
"full_signature": "@Override protected Parcelable onSaveInstanceState()",
"identifier": "onSaveInstanceState",
"modifiers": "@Override protected",
"parameters": "()",
"return": "Parcelable",
"signature": "Parcelable onSaveInstanceState()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onRestoreInstanceState(Parcelable state)",
"constructor": false,
"full_signature": "@Override protected void onRestoreInstanceState(Parcelable state)",
"identifier": "onRestoreInstanceState",
"modifiers": "@Override protected",
"parameters": "(Parcelable state)",
"return": "void",
"signature": "void onRestoreInstanceState(Parcelable state)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onAttachedToWindow()",
"constructor": false,
"full_signature": "@Override protected void onAttachedToWindow()",
"identifier": "onAttachedToWindow",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void onAttachedToWindow()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onDetachedFromWindow()",
"constructor": false,
"full_signature": "@Override protected void onDetachedFromWindow()",
"identifier": "onDetachedFromWindow",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void onDetachedFromWindow()",
"testcase": false
}
],
"superclass": "extends FrameLayout"
} | {
"body": "public Activity getActivity() {\n Context context = getContext();\n while (!(context instanceof Activity) && context instanceof ContextWrapper)\n context = ((ContextWrapper)context).getBaseContext();\n if (!(context instanceof Activity))\n throw new IllegalStateException(\"Expected an activity context, got \" + context.getClass().getSimpleName());\n return (Activity)context;\n }",
"class_method_signature": "NucleusLayout.getActivity()",
"constructor": false,
"full_signature": "public Activity getActivity()",
"identifier": "getActivity",
"invocations": [
"getContext",
"getBaseContext",
"getSimpleName",
"getClass"
],
"modifiers": "public",
"parameters": "()",
"return": "Activity",
"signature": "Activity getActivity()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54371579,
"size": 905,
"stargazer_count": 40,
"stars": null,
"updates": null,
"url": "https://github.com/caifeile/FlowGeek"
} |
54371579_12 | {
"fields": [
{
"declarator": "BASE_VIEW_CLASS = FrameLayout.class",
"modifier": "public static final",
"original_string": "public static final Class<?> BASE_VIEW_CLASS = FrameLayout.class;",
"type": "Class<?>",
"var_name": "BASE_VIEW_CLASS"
},
{
"declarator": "VIEW_CLASS = TestView.class",
"modifier": "public static final",
"original_string": "public static final Class<TestView> VIEW_CLASS = TestView.class;",
"type": "Class<TestView>",
"var_name": "VIEW_CLASS"
},
{
"declarator": "mockPresenter",
"modifier": "private",
"original_string": "private TestPresenter mockPresenter;",
"type": "TestPresenter",
"var_name": "mockPresenter"
},
{
"declarator": "mockDelegate",
"modifier": "private",
"original_string": "private PresenterLifecycleDelegate mockDelegate;",
"type": "PresenterLifecycleDelegate",
"var_name": "mockDelegate"
},
{
"declarator": "mockFactory",
"modifier": "private",
"original_string": "private ReflectionPresenterFactory mockFactory;",
"type": "ReflectionPresenterFactory",
"var_name": "mockFactory"
},
{
"declarator": "tested",
"modifier": "private",
"original_string": "private TestView tested;",
"type": "TestView",
"var_name": "tested"
}
],
"file": "presenter/src/test/java/nucleus/view/NucleusLayoutTest.java",
"identifier": "NucleusLayoutTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDestroy() throws Exception {\n setUpIsFinishing(true);\n tested.onDetachedFromWindow();\n verify(mockDelegate, times(1)).onPause(true);\n }",
"class_method_signature": "NucleusLayoutTest.testDestroy()",
"constructor": false,
"full_signature": "@Test public void testDestroy()",
"identifier": "testDestroy",
"invocations": [
"setUpIsFinishing",
"onDetachedFromWindow",
"onPause",
"verify",
"times"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testDestroy()",
"testcase": true
} | {
"fields": [
{
"declarator": "PARENT_STATE_KEY = \"parent_state\"",
"modifier": "private static final",
"original_string": "private static final String PARENT_STATE_KEY = \"parent_state\";",
"type": "String",
"var_name": "PARENT_STATE_KEY"
},
{
"declarator": "PRESENTER_STATE_KEY = \"presenter_state\"",
"modifier": "private static final",
"original_string": "private static final String PRESENTER_STATE_KEY = \"presenter_state\";",
"type": "String",
"var_name": "PRESENTER_STATE_KEY"
},
{
"declarator": "presenterDelegate =\n new PresenterLifecycleDelegate<>(ReflectionPresenterFactory.<P>fromViewClass(getClass()))",
"modifier": "private",
"original_string": "private PresenterLifecycleDelegate<P> presenterDelegate =\n new PresenterLifecycleDelegate<>(ReflectionPresenterFactory.<P>fromViewClass(getClass()));",
"type": "PresenterLifecycleDelegate<P>",
"var_name": "presenterDelegate"
}
],
"file": "presenter/src/main/java/nucleus/view/NucleusLayout.java",
"identifier": "NucleusLayout",
"interfaces": "implements ViewWithPresenter<P>",
"methods": [
{
"class_method_signature": "NucleusLayout.NucleusLayout(Context context)",
"constructor": true,
"full_signature": "public NucleusLayout(Context context)",
"identifier": "NucleusLayout",
"modifiers": "public",
"parameters": "(Context context)",
"return": "",
"signature": " NucleusLayout(Context context)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.NucleusLayout(Context context, AttributeSet attrs)",
"constructor": true,
"full_signature": "public NucleusLayout(Context context, AttributeSet attrs)",
"identifier": "NucleusLayout",
"modifiers": "public",
"parameters": "(Context context, AttributeSet attrs)",
"return": "",
"signature": " NucleusLayout(Context context, AttributeSet attrs)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.NucleusLayout(Context context, AttributeSet attrs, int defStyle)",
"constructor": true,
"full_signature": "public NucleusLayout(Context context, AttributeSet attrs, int defStyle)",
"identifier": "NucleusLayout",
"modifiers": "public",
"parameters": "(Context context, AttributeSet attrs, int defStyle)",
"return": "",
"signature": " NucleusLayout(Context context, AttributeSet attrs, int defStyle)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.getPresenterFactory()",
"constructor": false,
"full_signature": "public PresenterFactory<P> getPresenterFactory()",
"identifier": "getPresenterFactory",
"modifiers": "public",
"parameters": "()",
"return": "PresenterFactory<P>",
"signature": "PresenterFactory<P> getPresenterFactory()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.setPresenterFactory(PresenterFactory<P> presenterFactory)",
"constructor": false,
"full_signature": "@Override public void setPresenterFactory(PresenterFactory<P> presenterFactory)",
"identifier": "setPresenterFactory",
"modifiers": "@Override public",
"parameters": "(PresenterFactory<P> presenterFactory)",
"return": "void",
"signature": "void setPresenterFactory(PresenterFactory<P> presenterFactory)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.getPresenter()",
"constructor": false,
"full_signature": "public P getPresenter()",
"identifier": "getPresenter",
"modifiers": "public",
"parameters": "()",
"return": "P",
"signature": "P getPresenter()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.getActivity()",
"constructor": false,
"full_signature": "public Activity getActivity()",
"identifier": "getActivity",
"modifiers": "public",
"parameters": "()",
"return": "Activity",
"signature": "Activity getActivity()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onSaveInstanceState()",
"constructor": false,
"full_signature": "@Override protected Parcelable onSaveInstanceState()",
"identifier": "onSaveInstanceState",
"modifiers": "@Override protected",
"parameters": "()",
"return": "Parcelable",
"signature": "Parcelable onSaveInstanceState()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onRestoreInstanceState(Parcelable state)",
"constructor": false,
"full_signature": "@Override protected void onRestoreInstanceState(Parcelable state)",
"identifier": "onRestoreInstanceState",
"modifiers": "@Override protected",
"parameters": "(Parcelable state)",
"return": "void",
"signature": "void onRestoreInstanceState(Parcelable state)",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onAttachedToWindow()",
"constructor": false,
"full_signature": "@Override protected void onAttachedToWindow()",
"identifier": "onAttachedToWindow",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void onAttachedToWindow()",
"testcase": false
},
{
"class_method_signature": "NucleusLayout.onDetachedFromWindow()",
"constructor": false,
"full_signature": "@Override protected void onDetachedFromWindow()",
"identifier": "onDetachedFromWindow",
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void onDetachedFromWindow()",
"testcase": false
}
],
"superclass": "extends FrameLayout"
} | {
"body": "@Override\n protected void onDetachedFromWindow() {\n super.onDetachedFromWindow();\n presenterDelegate.onDestroy(getActivity().isFinishing());\n }",
"class_method_signature": "NucleusLayout.onDetachedFromWindow()",
"constructor": false,
"full_signature": "@Override protected void onDetachedFromWindow()",
"identifier": "onDetachedFromWindow",
"invocations": [
"onDetachedFromWindow",
"onDestroy",
"isFinishing",
"getActivity"
],
"modifiers": "@Override protected",
"parameters": "()",
"return": "void",
"signature": "void onDetachedFromWindow()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54371579,
"size": 905,
"stargazer_count": 40,
"stars": null,
"updates": null,
"url": "https://github.com/caifeile/FlowGeek"
} |
54371579_7 | {
"fields": [],
"file": "presenter/src/test/java/nucleus/presenter/PresenterTest.java",
"identifier": "PresenterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOnDestroy() throws Exception {\n Presenter.OnDestroyListener listener = mock(Presenter.OnDestroyListener.class);\n Presenter presenter = new Presenter();\n presenter.create(null);\n presenter.addOnDestroyListener(listener);\n presenter.destroy();\n verify(listener, times(1)).onDestroy();\n verifyNoMoreInteractions(listener);\n }",
"class_method_signature": "PresenterTest.testOnDestroy()",
"constructor": false,
"full_signature": "@Test public void testOnDestroy()",
"identifier": "testOnDestroy",
"invocations": [
"mock",
"create",
"addOnDestroyListener",
"destroy",
"onDestroy",
"verify",
"times",
"verifyNoMoreInteractions"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testOnDestroy()",
"testcase": true
} | {
"fields": [
{
"declarator": "view",
"modifier": "@Nullable private",
"original_string": "@Nullable private View view;",
"type": "View",
"var_name": "view"
},
{
"declarator": "onDestroyListeners = new CopyOnWriteArrayList<>()",
"modifier": "private",
"original_string": "private CopyOnWriteArrayList<OnDestroyListener> onDestroyListeners = new CopyOnWriteArrayList<>();",
"type": "CopyOnWriteArrayList<OnDestroyListener>",
"var_name": "onDestroyListeners"
}
],
"file": "presenter/src/main/java/nucleus/presenter/Presenter.java",
"identifier": "Presenter",
"interfaces": "",
"methods": [
{
"class_method_signature": "Presenter.onCreate(@Nullable Bundle savedState)",
"constructor": false,
"full_signature": "protected void onCreate(@Nullable Bundle savedState)",
"identifier": "onCreate",
"modifiers": "protected",
"parameters": "(@Nullable Bundle savedState)",
"return": "void",
"signature": "void onCreate(@Nullable Bundle savedState)",
"testcase": false
},
{
"class_method_signature": "Presenter.onDestroy()",
"constructor": false,
"full_signature": "protected void onDestroy()",
"identifier": "onDestroy",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void onDestroy()",
"testcase": false
},
{
"class_method_signature": "Presenter.onSave(Bundle state)",
"constructor": false,
"full_signature": "protected void onSave(Bundle state)",
"identifier": "onSave",
"modifiers": "protected",
"parameters": "(Bundle state)",
"return": "void",
"signature": "void onSave(Bundle state)",
"testcase": false
},
{
"class_method_signature": "Presenter.onTakeView(View view)",
"constructor": false,
"full_signature": "protected void onTakeView(View view)",
"identifier": "onTakeView",
"modifiers": "protected",
"parameters": "(View view)",
"return": "void",
"signature": "void onTakeView(View view)",
"testcase": false
},
{
"class_method_signature": "Presenter.onDropView()",
"constructor": false,
"full_signature": "protected void onDropView()",
"identifier": "onDropView",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void onDropView()",
"testcase": false
},
{
"class_method_signature": "Presenter.restore()",
"constructor": false,
"full_signature": "public void restore()",
"identifier": "restore",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void restore()",
"testcase": false
},
{
"class_method_signature": "Presenter.addOnDestroyListener(OnDestroyListener listener)",
"constructor": false,
"full_signature": "public void addOnDestroyListener(OnDestroyListener listener)",
"identifier": "addOnDestroyListener",
"modifiers": "public",
"parameters": "(OnDestroyListener listener)",
"return": "void",
"signature": "void addOnDestroyListener(OnDestroyListener listener)",
"testcase": false
},
{
"class_method_signature": "Presenter.removeOnDestroyListener(OnDestroyListener listener)",
"constructor": false,
"full_signature": "public void removeOnDestroyListener(OnDestroyListener listener)",
"identifier": "removeOnDestroyListener",
"modifiers": "public",
"parameters": "(OnDestroyListener listener)",
"return": "void",
"signature": "void removeOnDestroyListener(OnDestroyListener listener)",
"testcase": false
},
{
"class_method_signature": "Presenter.getView()",
"constructor": false,
"full_signature": "@Nullable public View getView()",
"identifier": "getView",
"modifiers": "@Nullable public",
"parameters": "()",
"return": "View",
"signature": "View getView()",
"testcase": false
},
{
"class_method_signature": "Presenter.create(Bundle bundle)",
"constructor": false,
"full_signature": "public void create(Bundle bundle)",
"identifier": "create",
"modifiers": "public",
"parameters": "(Bundle bundle)",
"return": "void",
"signature": "void create(Bundle bundle)",
"testcase": false
},
{
"class_method_signature": "Presenter.destroy()",
"constructor": false,
"full_signature": "public void destroy()",
"identifier": "destroy",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void destroy()",
"testcase": false
},
{
"class_method_signature": "Presenter.save(Bundle state)",
"constructor": false,
"full_signature": "public void save(Bundle state)",
"identifier": "save",
"modifiers": "public",
"parameters": "(Bundle state)",
"return": "void",
"signature": "void save(Bundle state)",
"testcase": false
},
{
"class_method_signature": "Presenter.takeView(View view)",
"constructor": false,
"full_signature": "public void takeView(View view)",
"identifier": "takeView",
"modifiers": "public",
"parameters": "(View view)",
"return": "void",
"signature": "void takeView(View view)",
"testcase": false
},
{
"class_method_signature": "Presenter.dropView()",
"constructor": false,
"full_signature": "public void dropView()",
"identifier": "dropView",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void dropView()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected void onDestroy() {\n }",
"class_method_signature": "Presenter.onDestroy()",
"constructor": false,
"full_signature": "protected void onDestroy()",
"identifier": "onDestroy",
"invocations": [],
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void onDestroy()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 54371579,
"size": 905,
"stargazer_count": 40,
"stars": null,
"updates": null,
"url": "https://github.com/caifeile/FlowGeek"
} |
1535924_3 | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
}
],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ActivatorTest.java",
"identifier": "ActivatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCreateAccessManagerFactoryTrackerOnStartOnlyTheFirstTime() throws Exception {\n BundleContext bundleContext = mock(BundleContext.class);\n\n final AccessManagerFactoryTracker accessManagerFactoryTracker = mock(AccessManagerFactoryTracker.class);\n final ActivatorHelper activatorHelper = mock(ActivatorHelper.class);\n when(activatorHelper.createAccessManagerFactoryTracker()).thenReturn(accessManagerFactoryTracker);\n\n Activator activator = new Activator() {\n @Override\n protected AccessManagerFactoryTracker getAccessManagerFactoryTracker() {\n return null;\n }\n\n @Override\n protected ActivatorHelper getActivatorHelper() {\n return activatorHelper;\n }\n };\n\n activator.start(bundleContext);\n\n verify(activatorHelper).createAccessManagerFactoryTracker();\n }",
"class_method_signature": "ActivatorTest.shouldCreateAccessManagerFactoryTrackerOnStartOnlyTheFirstTime()",
"constructor": false,
"full_signature": "@Test public void shouldCreateAccessManagerFactoryTrackerOnStartOnlyTheFirstTime()",
"identifier": "shouldCreateAccessManagerFactoryTrackerOnStartOnlyTheFirstTime",
"invocations": [
"mock",
"mock",
"mock",
"thenReturn",
"when",
"createAccessManagerFactoryTracker",
"start",
"createAccessManagerFactoryTracker",
"verify"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldCreateAccessManagerFactoryTrackerOnStartOnlyTheFirstTime()",
"testcase": true
} | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
},
{
"declarator": "accessManagerFactoryTracker",
"modifier": "private",
"original_string": "private AccessManagerFactoryTracker accessManagerFactoryTracker;",
"type": "AccessManagerFactoryTracker",
"var_name": "accessManagerFactoryTracker"
},
{
"declarator": "activatorHelper",
"modifier": "private",
"original_string": "private ActivatorHelper activatorHelper;",
"type": "ActivatorHelper",
"var_name": "activatorHelper"
},
{
"declarator": "bundleContext",
"modifier": "private",
"original_string": "private BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/Activator.java",
"identifier": "Activator",
"interfaces": "implements BundleActivator, ServiceListener",
"methods": [
{
"class_method_signature": "Activator.serviceChanged( ServiceEvent event )",
"constructor": false,
"full_signature": "@Override public void serviceChanged( ServiceEvent event )",
"identifier": "serviceChanged",
"modifiers": "@Override public",
"parameters": "( ServiceEvent event )",
"return": "void",
"signature": "void serviceChanged( ServiceEvent event )",
"testcase": false
},
{
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.stop( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void stop( BundleContext bundleContext )",
"identifier": "stop",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void stop( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.getActivatorHelper()",
"constructor": false,
"full_signature": "protected ActivatorHelper getActivatorHelper()",
"identifier": "getActivatorHelper",
"modifiers": "protected",
"parameters": "()",
"return": "ActivatorHelper",
"signature": "ActivatorHelper getActivatorHelper()",
"testcase": false
},
{
"class_method_signature": "Activator.getAccessManagerFactoryTracker()",
"constructor": false,
"full_signature": "protected AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"identifier": "getAccessManagerFactoryTracker",
"modifiers": "protected",
"parameters": "()",
"return": "AccessManagerFactoryTracker",
"signature": "AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void start( BundleContext bundleContext ) throws Exception {\n this.bundleContext = bundleContext;\n\n if (null == activatorHelper) {\n this.activatorHelper = getActivatorHelper();\n }\n\n ServiceReference configurationAdminServiceReference = bundleContext.getServiceReference(CONFIG_ADMIN_NAME);\n\n if (null != configurationAdminServiceReference) {\n activatorHelper.verifyConfiguration(configurationAdminServiceReference);\n } else {\n bundleContext.addServiceListener(this, String.format(\"(%s=%s)\", Constants.OBJECTCLASS, CONFIG_ADMIN_NAME));\n }\n\n AccessManagerFactoryTracker accessManagerFactoryTracker = getAccessManagerFactoryTracker();\n if (null == accessManagerFactoryTracker) {\n accessManagerFactoryTracker = this.accessManagerFactoryTracker = activatorHelper.createAccessManagerFactoryTracker();\n }\n accessManagerFactoryTracker.open();\n\n ClassLoader bundleClassLoader = new BundleClassLoaderFactory(bundleContext).getClassLoader((String[])null);\n I18n.setLocalizationRepository(new ClasspathLocalizationRepository(bundleClassLoader));\n }",
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"invocations": [
"getActivatorHelper",
"getServiceReference",
"verifyConfiguration",
"addServiceListener",
"format",
"getAccessManagerFactoryTracker",
"createAccessManagerFactoryTracker",
"open",
"getClassLoader",
"setLocalizationRepository"
],
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_2 | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
}
],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ActivatorTest.java",
"identifier": "ActivatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldRegisterItselfAsListenerOnStartWhenNoConfigurationAdminServiceReferenceIsFound() throws Exception {\n\n BundleContext bundleContext = mock(BundleContext.class);\n when(bundleContext.getServiceReference(CONFIG_ADMIN_NAME)).thenReturn(null);\n\n Activator activator = new Activator() {\n @Override\n protected AccessManagerFactoryTracker getAccessManagerFactoryTracker() {\n return mock(AccessManagerFactoryTracker.class);\n }\n };\n\n activator.start(bundleContext);\n\n verify(bundleContext).addServiceListener(activator, \"(\" + Constants.OBJECTCLASS + \"=\" + CONFIG_ADMIN_NAME + \")\");\n }",
"class_method_signature": "ActivatorTest.shouldRegisterItselfAsListenerOnStartWhenNoConfigurationAdminServiceReferenceIsFound()",
"constructor": false,
"full_signature": "@Test public void shouldRegisterItselfAsListenerOnStartWhenNoConfigurationAdminServiceReferenceIsFound()",
"identifier": "shouldRegisterItselfAsListenerOnStartWhenNoConfigurationAdminServiceReferenceIsFound",
"invocations": [
"mock",
"thenReturn",
"when",
"getServiceReference",
"mock",
"start",
"addServiceListener",
"verify"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldRegisterItselfAsListenerOnStartWhenNoConfigurationAdminServiceReferenceIsFound()",
"testcase": true
} | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
},
{
"declarator": "accessManagerFactoryTracker",
"modifier": "private",
"original_string": "private AccessManagerFactoryTracker accessManagerFactoryTracker;",
"type": "AccessManagerFactoryTracker",
"var_name": "accessManagerFactoryTracker"
},
{
"declarator": "activatorHelper",
"modifier": "private",
"original_string": "private ActivatorHelper activatorHelper;",
"type": "ActivatorHelper",
"var_name": "activatorHelper"
},
{
"declarator": "bundleContext",
"modifier": "private",
"original_string": "private BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/Activator.java",
"identifier": "Activator",
"interfaces": "implements BundleActivator, ServiceListener",
"methods": [
{
"class_method_signature": "Activator.serviceChanged( ServiceEvent event )",
"constructor": false,
"full_signature": "@Override public void serviceChanged( ServiceEvent event )",
"identifier": "serviceChanged",
"modifiers": "@Override public",
"parameters": "( ServiceEvent event )",
"return": "void",
"signature": "void serviceChanged( ServiceEvent event )",
"testcase": false
},
{
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.stop( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void stop( BundleContext bundleContext )",
"identifier": "stop",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void stop( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.getActivatorHelper()",
"constructor": false,
"full_signature": "protected ActivatorHelper getActivatorHelper()",
"identifier": "getActivatorHelper",
"modifiers": "protected",
"parameters": "()",
"return": "ActivatorHelper",
"signature": "ActivatorHelper getActivatorHelper()",
"testcase": false
},
{
"class_method_signature": "Activator.getAccessManagerFactoryTracker()",
"constructor": false,
"full_signature": "protected AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"identifier": "getAccessManagerFactoryTracker",
"modifiers": "protected",
"parameters": "()",
"return": "AccessManagerFactoryTracker",
"signature": "AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void start( BundleContext bundleContext ) throws Exception {\n this.bundleContext = bundleContext;\n\n if (null == activatorHelper) {\n this.activatorHelper = getActivatorHelper();\n }\n\n ServiceReference configurationAdminServiceReference = bundleContext.getServiceReference(CONFIG_ADMIN_NAME);\n\n if (null != configurationAdminServiceReference) {\n activatorHelper.verifyConfiguration(configurationAdminServiceReference);\n } else {\n bundleContext.addServiceListener(this, String.format(\"(%s=%s)\", Constants.OBJECTCLASS, CONFIG_ADMIN_NAME));\n }\n\n AccessManagerFactoryTracker accessManagerFactoryTracker = getAccessManagerFactoryTracker();\n if (null == accessManagerFactoryTracker) {\n accessManagerFactoryTracker = this.accessManagerFactoryTracker = activatorHelper.createAccessManagerFactoryTracker();\n }\n accessManagerFactoryTracker.open();\n\n ClassLoader bundleClassLoader = new BundleClassLoaderFactory(bundleContext).getClassLoader((String[])null);\n I18n.setLocalizationRepository(new ClasspathLocalizationRepository(bundleClassLoader));\n }",
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"invocations": [
"getActivatorHelper",
"getServiceReference",
"verifyConfiguration",
"addServiceListener",
"format",
"getAccessManagerFactoryTracker",
"createAccessManagerFactoryTracker",
"open",
"getClassLoader",
"setLocalizationRepository"
],
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_13 | {
"fields": [],
"file": "bundles/extensions/webconsole-security-provider/src/test/java/com/sourcesense/stone/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProviderTest.java",
"identifier": "SlingWebConsoleSecurityProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n public void shouldAuthorizeAnyone() throws Exception {\n\n SlingWebConsoleSecurityProvider slingWebConsoleSecurityProvider = new SlingWebConsoleSecurityProvider();\n assertTrue(slingWebConsoleSecurityProvider.authorize(\"anyObject\", \"anyRole\"));\n }",
"class_method_signature": "SlingWebConsoleSecurityProviderTest.shouldAuthorizeAnyone()",
"constructor": false,
"full_signature": "@Test @Ignore public void shouldAuthorizeAnyone()",
"identifier": "shouldAuthorizeAnyone",
"invocations": [
"assertTrue",
"authorize"
],
"modifiers": "@Test @Ignore public",
"parameters": "()",
"return": "void",
"signature": "void shouldAuthorizeAnyone()",
"testcase": true
} | {
"fields": [
{
"declarator": "PROPERTY_FOR_AUTHORIZED_USERS = \"users\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_FOR_AUTHORIZED_USERS = \"users\";",
"type": "String",
"var_name": "PROPERTY_FOR_AUTHORIZED_USERS"
},
{
"declarator": "PROPERTY_DEFAULT_AUTHORIZED_USER = \"admin\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_DEFAULT_AUTHORIZED_USER = \"admin\";",
"type": "String",
"var_name": "PROPERTY_DEFAULT_AUTHORIZED_USER"
},
{
"declarator": "PROPERTY_AUTHORIZED_GROUPS = \"groups\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_AUTHORIZED_GROUPS = \"groups\";",
"type": "String",
"var_name": "PROPERTY_AUTHORIZED_GROUPS"
},
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modifier": "@Reference\n private",
"original_string": "@Reference\n private Repository repository;",
"type": "Repository",
"var_name": "repository"
},
{
"declarator": "users",
"modifier": "@Property( name = PROPERTY_FOR_AUTHORIZED_USERS, cardinality = 20, value = PROPERTY_DEFAULT_AUTHORIZED_USER )\n private",
"original_string": "@Property( name = PROPERTY_FOR_AUTHORIZED_USERS, cardinality = 20, value = PROPERTY_DEFAULT_AUTHORIZED_USER )\n private Set<String> users;",
"type": "Set<String>",
"var_name": "users"
},
{
"declarator": "groups",
"modifier": "@Property( name = PROPERTY_AUTHORIZED_GROUPS, cardinality = 20 )\n private",
"original_string": "@Property( name = PROPERTY_AUTHORIZED_GROUPS, cardinality = 20 )\n private Set<String> groups;",
"type": "Set<String>",
"var_name": "groups"
}
],
"file": "bundles/extensions/webconsole-security-provider/src/main/java/com/sourcesense/stone/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider.java",
"identifier": "SlingWebConsoleSecurityProvider",
"interfaces": "implements WebConsoleSecurityProvider",
"methods": [
{
"class_method_signature": "SlingWebConsoleSecurityProvider.configure( Map<String, Object> config )",
"constructor": false,
"full_signature": "@SuppressWarnings( \"unused\" ) @Activate @Modified private void configure( Map<String, Object> config )",
"identifier": "configure",
"modifiers": "@SuppressWarnings( \"unused\" ) @Activate @Modified private",
"parameters": "( Map<String, Object> config )",
"return": "void",
"signature": "void configure( Map<String, Object> config )",
"testcase": false
},
{
"class_method_signature": "SlingWebConsoleSecurityProvider.authenticate( String userName,\n String password )",
"constructor": false,
"full_signature": "@Override public Object authenticate( String userName,\n String password )",
"identifier": "authenticate",
"modifiers": "@Override public",
"parameters": "( String userName,\n String password )",
"return": "Object",
"signature": "Object authenticate( String userName,\n String password )",
"testcase": false
},
{
"class_method_signature": "SlingWebConsoleSecurityProvider.authorize( Object user,\n String role )",
"constructor": false,
"full_signature": "@Override public boolean authorize( Object user,\n String role )",
"identifier": "authorize",
"modifiers": "@Override public",
"parameters": "( Object user,\n String role )",
"return": "boolean",
"signature": "boolean authorize( Object user,\n String role )",
"testcase": false
},
{
"class_method_signature": "SlingWebConsoleSecurityProvider.toSet( final Object configObj )",
"constructor": false,
"full_signature": "private Set<String> toSet( final Object configObj )",
"identifier": "toSet",
"modifiers": "private",
"parameters": "( final Object configObj )",
"return": "Set<String>",
"signature": "Set<String> toSet( final Object configObj )",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public boolean authorize( Object user,\n String role ) {\n log.info(\"********** Attempting to authorize \" + user + \", with role \" + role);\n return true;\n }",
"class_method_signature": "SlingWebConsoleSecurityProvider.authorize( Object user,\n String role )",
"constructor": false,
"full_signature": "@Override public boolean authorize( Object user,\n String role )",
"identifier": "authorize",
"invocations": [
"info"
],
"modifiers": "@Override public",
"parameters": "( Object user,\n String role )",
"return": "boolean",
"signature": "boolean authorize( Object user,\n String role )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_5 | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
}
],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ActivatorTest.java",
"identifier": "ActivatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotCloseAccessManagerFactoryTrackerOnStopBecauseNotOpened() throws Exception {\n BundleContext bundleContext = mock(BundleContext.class);\n\n final AccessManagerFactoryTracker accessManagerFactoryTracker = mock(AccessManagerFactoryTracker.class);\n\n Activator activator = new Activator() {\n @Override\n protected AccessManagerFactoryTracker getAccessManagerFactoryTracker() {\n return null;\n }\n };\n\n activator.stop(bundleContext);\n\n verify(accessManagerFactoryTracker, never()).close();\n }",
"class_method_signature": "ActivatorTest.shouldNotCloseAccessManagerFactoryTrackerOnStopBecauseNotOpened()",
"constructor": false,
"full_signature": "@Test public void shouldNotCloseAccessManagerFactoryTrackerOnStopBecauseNotOpened()",
"identifier": "shouldNotCloseAccessManagerFactoryTrackerOnStopBecauseNotOpened",
"invocations": [
"mock",
"mock",
"stop",
"close",
"verify",
"never"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldNotCloseAccessManagerFactoryTrackerOnStopBecauseNotOpened()",
"testcase": true
} | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
},
{
"declarator": "accessManagerFactoryTracker",
"modifier": "private",
"original_string": "private AccessManagerFactoryTracker accessManagerFactoryTracker;",
"type": "AccessManagerFactoryTracker",
"var_name": "accessManagerFactoryTracker"
},
{
"declarator": "activatorHelper",
"modifier": "private",
"original_string": "private ActivatorHelper activatorHelper;",
"type": "ActivatorHelper",
"var_name": "activatorHelper"
},
{
"declarator": "bundleContext",
"modifier": "private",
"original_string": "private BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/Activator.java",
"identifier": "Activator",
"interfaces": "implements BundleActivator, ServiceListener",
"methods": [
{
"class_method_signature": "Activator.serviceChanged( ServiceEvent event )",
"constructor": false,
"full_signature": "@Override public void serviceChanged( ServiceEvent event )",
"identifier": "serviceChanged",
"modifiers": "@Override public",
"parameters": "( ServiceEvent event )",
"return": "void",
"signature": "void serviceChanged( ServiceEvent event )",
"testcase": false
},
{
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.stop( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void stop( BundleContext bundleContext )",
"identifier": "stop",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void stop( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.getActivatorHelper()",
"constructor": false,
"full_signature": "protected ActivatorHelper getActivatorHelper()",
"identifier": "getActivatorHelper",
"modifiers": "protected",
"parameters": "()",
"return": "ActivatorHelper",
"signature": "ActivatorHelper getActivatorHelper()",
"testcase": false
},
{
"class_method_signature": "Activator.getAccessManagerFactoryTracker()",
"constructor": false,
"full_signature": "protected AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"identifier": "getAccessManagerFactoryTracker",
"modifiers": "protected",
"parameters": "()",
"return": "AccessManagerFactoryTracker",
"signature": "AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void stop( BundleContext bundleContext ) throws Exception {\n AccessManagerFactoryTracker managerFactoryTracker = getAccessManagerFactoryTracker();\n\n if (null != managerFactoryTracker) {\n managerFactoryTracker.close();\n }\n }",
"class_method_signature": "Activator.stop( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void stop( BundleContext bundleContext )",
"identifier": "stop",
"invocations": [
"getAccessManagerFactoryTracker",
"close"
],
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void stop( BundleContext bundleContext )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_9 | {
"fields": [],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ConfigurationUtilsTest.java",
"identifier": "ConfigurationUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnHomeDirSetUsingPropertySlingHome() throws Exception {\n BundleContext bundleContext = programBundleContextToReturn(null, \"aPath\");\n ConfigurationUtils configurationUtil = new ConfigurationUtils(bundleContext);\n\n File homeDir = configurationUtil.getHomeDir();\n\n assertEquals(\"aPath/modeshape\", homeDir.getPath());\n }",
"class_method_signature": "ConfigurationUtilsTest.shouldReturnHomeDirSetUsingPropertySlingHome()",
"constructor": false,
"full_signature": "@Test public void shouldReturnHomeDirSetUsingPropertySlingHome()",
"identifier": "shouldReturnHomeDirSetUsingPropertySlingHome",
"invocations": [
"programBundleContextToReturn",
"getHomeDir",
"assertEquals",
"getPath"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldReturnHomeDirSetUsingPropertySlingHome()",
"testcase": true
} | {
"fields": [
{
"declarator": "SLING_HOME = \"sling.home\"",
"modifier": "static final",
"original_string": "static final String SLING_HOME = \"sling.home\";",
"type": "String",
"var_name": "SLING_HOME"
},
{
"declarator": "SLING_REPOSITORY_HOME = \"sling.repository.home\"",
"modifier": "static final",
"original_string": "static final String SLING_REPOSITORY_HOME = \"sling.repository.home\";",
"type": "String",
"var_name": "SLING_REPOSITORY_HOME"
},
{
"declarator": "SLING_REPOSITORY_NAME = \"sling.repository.name\"",
"modifier": "private static final",
"original_string": "private static final String SLING_REPOSITORY_NAME = \"sling.repository.name\";",
"type": "String",
"var_name": "SLING_REPOSITORY_NAME"
},
{
"declarator": "MODESHAPE_REPOSITORY_XML = \"modeshape-repository.xml\"",
"modifier": "private static final",
"original_string": "private static final String MODESHAPE_REPOSITORY_XML = \"modeshape-repository.xml\";",
"type": "String",
"var_name": "MODESHAPE_REPOSITORY_XML"
},
{
"declarator": "log = LoggerFactory.getLogger(ConfigurationUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ConfigurationUtils.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "bundleContext",
"modifier": "private final",
"original_string": "private final BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/ConfigurationUtils.java",
"identifier": "ConfigurationUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConfigurationUtils.copyStream(InputStream source, File destFile )",
"constructor": false,
"full_signature": "static void copyStream(InputStream source, File destFile )",
"identifier": "copyStream",
"modifiers": "static",
"parameters": "(InputStream source, File destFile )",
"return": "void",
"signature": "void copyStream(InputStream source, File destFile )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.closeQuietly(Closeable closeable)",
"constructor": false,
"full_signature": "private static void closeQuietly(Closeable closeable)",
"identifier": "closeQuietly",
"modifiers": "private static",
"parameters": "(Closeable closeable)",
"return": "void",
"signature": "void closeQuietly(Closeable closeable)",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.writeFile( InputStream source,\n File destFile )",
"constructor": false,
"full_signature": "private static OutputStream writeFile( InputStream source,\n File destFile )",
"identifier": "writeFile",
"modifiers": "private static",
"parameters": "( InputStream source,\n File destFile )",
"return": "OutputStream",
"signature": "OutputStream writeFile( InputStream source,\n File destFile )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.copyFile( Bundle bundle,\n String entryPath,\n File destFile )",
"constructor": false,
"full_signature": "static void copyFile( Bundle bundle,\n String entryPath,\n File destFile )",
"identifier": "copyFile",
"modifiers": "static",
"parameters": "( Bundle bundle,\n String entryPath,\n File destFile )",
"return": "void",
"signature": "void copyFile( Bundle bundle,\n String entryPath,\n File destFile )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.ConfigurationUtils( BundleContext bundleContext )",
"constructor": true,
"full_signature": " ConfigurationUtils( BundleContext bundleContext )",
"identifier": "ConfigurationUtils",
"modifiers": "",
"parameters": "( BundleContext bundleContext )",
"return": "",
"signature": " ConfigurationUtils( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.getHomeDir()",
"constructor": false,
"full_signature": " File getHomeDir()",
"identifier": "getHomeDir",
"modifiers": "",
"parameters": "()",
"return": "File",
"signature": "File getHomeDir()",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.getRepositoryName()",
"constructor": false,
"full_signature": " String getRepositoryName()",
"identifier": "getRepositoryName",
"modifiers": "",
"parameters": "()",
"return": "String",
"signature": "String getRepositoryName()",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.getConfigFileUrl( File homeDir )",
"constructor": false,
"full_signature": " String getConfigFileUrl( File homeDir )",
"identifier": "getConfigFileUrl",
"modifiers": "",
"parameters": "( File homeDir )",
"return": "String",
"signature": "String getConfigFileUrl( File homeDir )",
"testcase": false
}
],
"superclass": ""
} | {
"body": "File getHomeDir() {\n File homeDir;\n\n String repoHomePath = bundleContext.getProperty(SLING_REPOSITORY_HOME);\n String slingHomePath = bundleContext.getProperty(SLING_HOME);\n\n String repositoryName = getRepositoryName();\n if (repoHomePath != null) {\n homeDir = new File(repoHomePath, repositoryName);\n } else if (slingHomePath != null) {\n homeDir = new File(slingHomePath, repositoryName);\n } else {\n homeDir = new File(repositoryName);\n }\n\n log.info(\"Creating default config for Modeshape in \" + homeDir);\n if (!homeDir.isDirectory()) {\n if (!homeDir.mkdirs()) {\n log.info(\"verifyConfiguration: Cannot create Modeshape home \" + homeDir\n + \", failed creating default configuration\");\n return null;\n }\n }\n\n return homeDir;\n }",
"class_method_signature": "ConfigurationUtils.getHomeDir()",
"constructor": false,
"full_signature": " File getHomeDir()",
"identifier": "getHomeDir",
"invocations": [
"getProperty",
"getProperty",
"getRepositoryName",
"info",
"isDirectory",
"mkdirs",
"info"
],
"modifiers": "",
"parameters": "()",
"return": "File",
"signature": "File getHomeDir()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_8 | {
"fields": [],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ConfigurationUtilsTest.java",
"identifier": "ConfigurationUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnHomeDirSetUsingPropertySlingRepositoryHome() throws Exception {\n BundleContext bundleContext = programBundleContextToReturn(\"aPath\", null);\n ConfigurationUtils configurationUtil = new ConfigurationUtils(bundleContext);\n\n File homeDir = configurationUtil.getHomeDir();\n\n assertEquals(\"aPath/modeshape\", homeDir.getPath());\n }",
"class_method_signature": "ConfigurationUtilsTest.shouldReturnHomeDirSetUsingPropertySlingRepositoryHome()",
"constructor": false,
"full_signature": "@Test public void shouldReturnHomeDirSetUsingPropertySlingRepositoryHome()",
"identifier": "shouldReturnHomeDirSetUsingPropertySlingRepositoryHome",
"invocations": [
"programBundleContextToReturn",
"getHomeDir",
"assertEquals",
"getPath"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldReturnHomeDirSetUsingPropertySlingRepositoryHome()",
"testcase": true
} | {
"fields": [
{
"declarator": "SLING_HOME = \"sling.home\"",
"modifier": "static final",
"original_string": "static final String SLING_HOME = \"sling.home\";",
"type": "String",
"var_name": "SLING_HOME"
},
{
"declarator": "SLING_REPOSITORY_HOME = \"sling.repository.home\"",
"modifier": "static final",
"original_string": "static final String SLING_REPOSITORY_HOME = \"sling.repository.home\";",
"type": "String",
"var_name": "SLING_REPOSITORY_HOME"
},
{
"declarator": "SLING_REPOSITORY_NAME = \"sling.repository.name\"",
"modifier": "private static final",
"original_string": "private static final String SLING_REPOSITORY_NAME = \"sling.repository.name\";",
"type": "String",
"var_name": "SLING_REPOSITORY_NAME"
},
{
"declarator": "MODESHAPE_REPOSITORY_XML = \"modeshape-repository.xml\"",
"modifier": "private static final",
"original_string": "private static final String MODESHAPE_REPOSITORY_XML = \"modeshape-repository.xml\";",
"type": "String",
"var_name": "MODESHAPE_REPOSITORY_XML"
},
{
"declarator": "log = LoggerFactory.getLogger(ConfigurationUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ConfigurationUtils.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "bundleContext",
"modifier": "private final",
"original_string": "private final BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/ConfigurationUtils.java",
"identifier": "ConfigurationUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConfigurationUtils.copyStream(InputStream source, File destFile )",
"constructor": false,
"full_signature": "static void copyStream(InputStream source, File destFile )",
"identifier": "copyStream",
"modifiers": "static",
"parameters": "(InputStream source, File destFile )",
"return": "void",
"signature": "void copyStream(InputStream source, File destFile )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.closeQuietly(Closeable closeable)",
"constructor": false,
"full_signature": "private static void closeQuietly(Closeable closeable)",
"identifier": "closeQuietly",
"modifiers": "private static",
"parameters": "(Closeable closeable)",
"return": "void",
"signature": "void closeQuietly(Closeable closeable)",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.writeFile( InputStream source,\n File destFile )",
"constructor": false,
"full_signature": "private static OutputStream writeFile( InputStream source,\n File destFile )",
"identifier": "writeFile",
"modifiers": "private static",
"parameters": "( InputStream source,\n File destFile )",
"return": "OutputStream",
"signature": "OutputStream writeFile( InputStream source,\n File destFile )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.copyFile( Bundle bundle,\n String entryPath,\n File destFile )",
"constructor": false,
"full_signature": "static void copyFile( Bundle bundle,\n String entryPath,\n File destFile )",
"identifier": "copyFile",
"modifiers": "static",
"parameters": "( Bundle bundle,\n String entryPath,\n File destFile )",
"return": "void",
"signature": "void copyFile( Bundle bundle,\n String entryPath,\n File destFile )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.ConfigurationUtils( BundleContext bundleContext )",
"constructor": true,
"full_signature": " ConfigurationUtils( BundleContext bundleContext )",
"identifier": "ConfigurationUtils",
"modifiers": "",
"parameters": "( BundleContext bundleContext )",
"return": "",
"signature": " ConfigurationUtils( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.getHomeDir()",
"constructor": false,
"full_signature": " File getHomeDir()",
"identifier": "getHomeDir",
"modifiers": "",
"parameters": "()",
"return": "File",
"signature": "File getHomeDir()",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.getRepositoryName()",
"constructor": false,
"full_signature": " String getRepositoryName()",
"identifier": "getRepositoryName",
"modifiers": "",
"parameters": "()",
"return": "String",
"signature": "String getRepositoryName()",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.getConfigFileUrl( File homeDir )",
"constructor": false,
"full_signature": " String getConfigFileUrl( File homeDir )",
"identifier": "getConfigFileUrl",
"modifiers": "",
"parameters": "( File homeDir )",
"return": "String",
"signature": "String getConfigFileUrl( File homeDir )",
"testcase": false
}
],
"superclass": ""
} | {
"body": "File getHomeDir() {\n File homeDir;\n\n String repoHomePath = bundleContext.getProperty(SLING_REPOSITORY_HOME);\n String slingHomePath = bundleContext.getProperty(SLING_HOME);\n\n String repositoryName = getRepositoryName();\n if (repoHomePath != null) {\n homeDir = new File(repoHomePath, repositoryName);\n } else if (slingHomePath != null) {\n homeDir = new File(slingHomePath, repositoryName);\n } else {\n homeDir = new File(repositoryName);\n }\n\n log.info(\"Creating default config for Modeshape in \" + homeDir);\n if (!homeDir.isDirectory()) {\n if (!homeDir.mkdirs()) {\n log.info(\"verifyConfiguration: Cannot create Modeshape home \" + homeDir\n + \", failed creating default configuration\");\n return null;\n }\n }\n\n return homeDir;\n }",
"class_method_signature": "ConfigurationUtils.getHomeDir()",
"constructor": false,
"full_signature": " File getHomeDir()",
"identifier": "getHomeDir",
"invocations": [
"getProperty",
"getProperty",
"getRepositoryName",
"info",
"isDirectory",
"mkdirs",
"info"
],
"modifiers": "",
"parameters": "()",
"return": "File",
"signature": "File getHomeDir()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_4 | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
}
],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ActivatorTest.java",
"identifier": "ActivatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldCloseAccessManagerFactoryTrackerOnStopOnlyWhenOpened() throws Exception {\n BundleContext bundleContext = mock(BundleContext.class);\n\n final AccessManagerFactoryTracker accessManagerFactoryTracker = mock(AccessManagerFactoryTracker.class);\n\n Activator activator = new Activator() {\n @Override\n protected AccessManagerFactoryTracker getAccessManagerFactoryTracker() {\n return accessManagerFactoryTracker;\n }\n };\n\n activator.stop(bundleContext);\n\n verify(accessManagerFactoryTracker).close();\n }",
"class_method_signature": "ActivatorTest.shouldCloseAccessManagerFactoryTrackerOnStopOnlyWhenOpened()",
"constructor": false,
"full_signature": "@Test public void shouldCloseAccessManagerFactoryTrackerOnStopOnlyWhenOpened()",
"identifier": "shouldCloseAccessManagerFactoryTrackerOnStopOnlyWhenOpened",
"invocations": [
"mock",
"mock",
"stop",
"close",
"verify"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldCloseAccessManagerFactoryTrackerOnStopOnlyWhenOpened()",
"testcase": true
} | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
},
{
"declarator": "accessManagerFactoryTracker",
"modifier": "private",
"original_string": "private AccessManagerFactoryTracker accessManagerFactoryTracker;",
"type": "AccessManagerFactoryTracker",
"var_name": "accessManagerFactoryTracker"
},
{
"declarator": "activatorHelper",
"modifier": "private",
"original_string": "private ActivatorHelper activatorHelper;",
"type": "ActivatorHelper",
"var_name": "activatorHelper"
},
{
"declarator": "bundleContext",
"modifier": "private",
"original_string": "private BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/Activator.java",
"identifier": "Activator",
"interfaces": "implements BundleActivator, ServiceListener",
"methods": [
{
"class_method_signature": "Activator.serviceChanged( ServiceEvent event )",
"constructor": false,
"full_signature": "@Override public void serviceChanged( ServiceEvent event )",
"identifier": "serviceChanged",
"modifiers": "@Override public",
"parameters": "( ServiceEvent event )",
"return": "void",
"signature": "void serviceChanged( ServiceEvent event )",
"testcase": false
},
{
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.stop( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void stop( BundleContext bundleContext )",
"identifier": "stop",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void stop( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.getActivatorHelper()",
"constructor": false,
"full_signature": "protected ActivatorHelper getActivatorHelper()",
"identifier": "getActivatorHelper",
"modifiers": "protected",
"parameters": "()",
"return": "ActivatorHelper",
"signature": "ActivatorHelper getActivatorHelper()",
"testcase": false
},
{
"class_method_signature": "Activator.getAccessManagerFactoryTracker()",
"constructor": false,
"full_signature": "protected AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"identifier": "getAccessManagerFactoryTracker",
"modifiers": "protected",
"parameters": "()",
"return": "AccessManagerFactoryTracker",
"signature": "AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void stop( BundleContext bundleContext ) throws Exception {\n AccessManagerFactoryTracker managerFactoryTracker = getAccessManagerFactoryTracker();\n\n if (null != managerFactoryTracker) {\n managerFactoryTracker.close();\n }\n }",
"class_method_signature": "Activator.stop( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void stop( BundleContext bundleContext )",
"identifier": "stop",
"invocations": [
"getAccessManagerFactoryTracker",
"close"
],
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void stop( BundleContext bundleContext )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_12 | {
"fields": [],
"file": "bundles/extensions/webconsole-security-provider/src/test/java/com/sourcesense/stone/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProviderTest.java",
"identifier": "SlingWebConsoleSecurityProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n public void shouldAuthenticateUserWithNameAdminAndPasswordAdmin() throws Exception {\n\n SlingWebConsoleSecurityProvider slingWebConsoleSecurityProvider = new SlingWebConsoleSecurityProvider();\n assertNotNull(slingWebConsoleSecurityProvider.authenticate(\"admin\", \"admin\"));\n }",
"class_method_signature": "SlingWebConsoleSecurityProviderTest.shouldAuthenticateUserWithNameAdminAndPasswordAdmin()",
"constructor": false,
"full_signature": "@Test @Ignore public void shouldAuthenticateUserWithNameAdminAndPasswordAdmin()",
"identifier": "shouldAuthenticateUserWithNameAdminAndPasswordAdmin",
"invocations": [
"assertNotNull",
"authenticate"
],
"modifiers": "@Test @Ignore public",
"parameters": "()",
"return": "void",
"signature": "void shouldAuthenticateUserWithNameAdminAndPasswordAdmin()",
"testcase": true
} | {
"fields": [
{
"declarator": "PROPERTY_FOR_AUTHORIZED_USERS = \"users\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_FOR_AUTHORIZED_USERS = \"users\";",
"type": "String",
"var_name": "PROPERTY_FOR_AUTHORIZED_USERS"
},
{
"declarator": "PROPERTY_DEFAULT_AUTHORIZED_USER = \"admin\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_DEFAULT_AUTHORIZED_USER = \"admin\";",
"type": "String",
"var_name": "PROPERTY_DEFAULT_AUTHORIZED_USER"
},
{
"declarator": "PROPERTY_AUTHORIZED_GROUPS = \"groups\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_AUTHORIZED_GROUPS = \"groups\";",
"type": "String",
"var_name": "PROPERTY_AUTHORIZED_GROUPS"
},
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modifier": "@Reference\n private",
"original_string": "@Reference\n private Repository repository;",
"type": "Repository",
"var_name": "repository"
},
{
"declarator": "users",
"modifier": "@Property( name = PROPERTY_FOR_AUTHORIZED_USERS, cardinality = 20, value = PROPERTY_DEFAULT_AUTHORIZED_USER )\n private",
"original_string": "@Property( name = PROPERTY_FOR_AUTHORIZED_USERS, cardinality = 20, value = PROPERTY_DEFAULT_AUTHORIZED_USER )\n private Set<String> users;",
"type": "Set<String>",
"var_name": "users"
},
{
"declarator": "groups",
"modifier": "@Property( name = PROPERTY_AUTHORIZED_GROUPS, cardinality = 20 )\n private",
"original_string": "@Property( name = PROPERTY_AUTHORIZED_GROUPS, cardinality = 20 )\n private Set<String> groups;",
"type": "Set<String>",
"var_name": "groups"
}
],
"file": "bundles/extensions/webconsole-security-provider/src/main/java/com/sourcesense/stone/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider.java",
"identifier": "SlingWebConsoleSecurityProvider",
"interfaces": "implements WebConsoleSecurityProvider",
"methods": [
{
"class_method_signature": "SlingWebConsoleSecurityProvider.configure( Map<String, Object> config )",
"constructor": false,
"full_signature": "@SuppressWarnings( \"unused\" ) @Activate @Modified private void configure( Map<String, Object> config )",
"identifier": "configure",
"modifiers": "@SuppressWarnings( \"unused\" ) @Activate @Modified private",
"parameters": "( Map<String, Object> config )",
"return": "void",
"signature": "void configure( Map<String, Object> config )",
"testcase": false
},
{
"class_method_signature": "SlingWebConsoleSecurityProvider.authenticate( String userName,\n String password )",
"constructor": false,
"full_signature": "@Override public Object authenticate( String userName,\n String password )",
"identifier": "authenticate",
"modifiers": "@Override public",
"parameters": "( String userName,\n String password )",
"return": "Object",
"signature": "Object authenticate( String userName,\n String password )",
"testcase": false
},
{
"class_method_signature": "SlingWebConsoleSecurityProvider.authorize( Object user,\n String role )",
"constructor": false,
"full_signature": "@Override public boolean authorize( Object user,\n String role )",
"identifier": "authorize",
"modifiers": "@Override public",
"parameters": "( Object user,\n String role )",
"return": "boolean",
"signature": "boolean authorize( Object user,\n String role )",
"testcase": false
},
{
"class_method_signature": "SlingWebConsoleSecurityProvider.toSet( final Object configObj )",
"constructor": false,
"full_signature": "private Set<String> toSet( final Object configObj )",
"identifier": "toSet",
"modifiers": "private",
"parameters": "( final Object configObj )",
"return": "Set<String>",
"signature": "Set<String> toSet( final Object configObj )",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Object authenticate( String userName,\n String password ) {\n final Credentials creds = new SimpleCredentials(userName,\n (password == null) ? new char[0] : password.toCharArray());\n Session session = null;\n ClassLoader ccl = Thread.currentThread().getContextClassLoader();\n try {\n \tThread.currentThread().setContextClassLoader(getClass().getClassLoader());\n session = repository.login(creds);\n return true;\n } catch (LoginException re) {\n log.info(\n \"authenticate: User \"\n + userName\n + \" failed to authenticate with the repository for Web Console access\",\n re);\n } catch (RepositoryException re) {\n log.info(\"authenticate: Generic problem trying grant User \"\n + userName + \" access to the Web Console\", re);\n } finally {\n \tThread.currentThread().setContextClassLoader(ccl);\n if (session != null) {\n session.logout();\n }\n }\n\n // no success (see log)\n return null;\n }",
"class_method_signature": "SlingWebConsoleSecurityProvider.authenticate( String userName,\n String password )",
"constructor": false,
"full_signature": "@Override public Object authenticate( String userName,\n String password )",
"identifier": "authenticate",
"invocations": [
"toCharArray",
"getContextClassLoader",
"currentThread",
"setContextClassLoader",
"currentThread",
"getClassLoader",
"getClass",
"login",
"info",
"info",
"setContextClassLoader",
"currentThread",
"logout"
],
"modifiers": "@Override public",
"parameters": "( String userName,\n String password )",
"return": "Object",
"signature": "Object authenticate( String userName,\n String password )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_7 | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
}
],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ActivatorTest.java",
"identifier": "ActivatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotVerifyConfigurationAndRemoveServiceListenerWhenServiceEventRegisteredIsNotNotified() throws Exception {\n\n final ActivatorHelper activatorHelper = mock(ActivatorHelper.class);\n Activator activator = new Activator() {\n @Override\n protected ActivatorHelper getActivatorHelper() {\n return activatorHelper;\n }\n };\n\n BundleContext bundleContext = mock(BundleContext.class);\n injectBundleContextInto(activator, bundleContext);\n\n ServiceEvent serviceEvent = mock(ServiceEvent.class);\n when(serviceEvent.getType()).thenReturn(ServiceEvent.MODIFIED);\n\n activator.serviceChanged(serviceEvent);\n\n verify(activatorHelper, never()).verifyConfiguration((ServiceReference)anyObject());\n verify(bundleContext, never()).removeServiceListener((ServiceListener)anyObject());\n }",
"class_method_signature": "ActivatorTest.shouldNotVerifyConfigurationAndRemoveServiceListenerWhenServiceEventRegisteredIsNotNotified()",
"constructor": false,
"full_signature": "@Test public void shouldNotVerifyConfigurationAndRemoveServiceListenerWhenServiceEventRegisteredIsNotNotified()",
"identifier": "shouldNotVerifyConfigurationAndRemoveServiceListenerWhenServiceEventRegisteredIsNotNotified",
"invocations": [
"mock",
"mock",
"injectBundleContextInto",
"mock",
"thenReturn",
"when",
"getType",
"serviceChanged",
"verifyConfiguration",
"verify",
"never",
"anyObject",
"removeServiceListener",
"verify",
"never",
"anyObject"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldNotVerifyConfigurationAndRemoveServiceListenerWhenServiceEventRegisteredIsNotNotified()",
"testcase": true
} | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
},
{
"declarator": "accessManagerFactoryTracker",
"modifier": "private",
"original_string": "private AccessManagerFactoryTracker accessManagerFactoryTracker;",
"type": "AccessManagerFactoryTracker",
"var_name": "accessManagerFactoryTracker"
},
{
"declarator": "activatorHelper",
"modifier": "private",
"original_string": "private ActivatorHelper activatorHelper;",
"type": "ActivatorHelper",
"var_name": "activatorHelper"
},
{
"declarator": "bundleContext",
"modifier": "private",
"original_string": "private BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/Activator.java",
"identifier": "Activator",
"interfaces": "implements BundleActivator, ServiceListener",
"methods": [
{
"class_method_signature": "Activator.serviceChanged( ServiceEvent event )",
"constructor": false,
"full_signature": "@Override public void serviceChanged( ServiceEvent event )",
"identifier": "serviceChanged",
"modifiers": "@Override public",
"parameters": "( ServiceEvent event )",
"return": "void",
"signature": "void serviceChanged( ServiceEvent event )",
"testcase": false
},
{
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.stop( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void stop( BundleContext bundleContext )",
"identifier": "stop",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void stop( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.getActivatorHelper()",
"constructor": false,
"full_signature": "protected ActivatorHelper getActivatorHelper()",
"identifier": "getActivatorHelper",
"modifiers": "protected",
"parameters": "()",
"return": "ActivatorHelper",
"signature": "ActivatorHelper getActivatorHelper()",
"testcase": false
},
{
"class_method_signature": "Activator.getAccessManagerFactoryTracker()",
"constructor": false,
"full_signature": "protected AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"identifier": "getAccessManagerFactoryTracker",
"modifiers": "protected",
"parameters": "()",
"return": "AccessManagerFactoryTracker",
"signature": "AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void serviceChanged( ServiceEvent event ) {\n if (ServiceEvent.REGISTERED == event.getType()) {\n\n getActivatorHelper().verifyConfiguration(event.getServiceReference());\n bundleContext.removeServiceListener(this);\n }\n }",
"class_method_signature": "Activator.serviceChanged( ServiceEvent event )",
"constructor": false,
"full_signature": "@Override public void serviceChanged( ServiceEvent event )",
"identifier": "serviceChanged",
"invocations": [
"getType",
"verifyConfiguration",
"getActivatorHelper",
"getServiceReference",
"removeServiceListener"
],
"modifiers": "@Override public",
"parameters": "( ServiceEvent event )",
"return": "void",
"signature": "void serviceChanged( ServiceEvent event )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_11 | {
"fields": [],
"file": "bundles/extensions/webconsole-security-provider/src/test/java/com/sourcesense/stone/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProviderTest.java",
"identifier": "SlingWebConsoleSecurityProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @Ignore\n public void shouldNotAuthenticateUsersWithWrongCredentials() throws Exception {\n\n SlingWebConsoleSecurityProvider slingWebConsoleSecurityProvider = new SlingWebConsoleSecurityProvider();\n assertNull(slingWebConsoleSecurityProvider.authenticate(\"wrong user\", \"wrong password\"));\n }",
"class_method_signature": "SlingWebConsoleSecurityProviderTest.shouldNotAuthenticateUsersWithWrongCredentials()",
"constructor": false,
"full_signature": "@Test @Ignore public void shouldNotAuthenticateUsersWithWrongCredentials()",
"identifier": "shouldNotAuthenticateUsersWithWrongCredentials",
"invocations": [
"assertNull",
"authenticate"
],
"modifiers": "@Test @Ignore public",
"parameters": "()",
"return": "void",
"signature": "void shouldNotAuthenticateUsersWithWrongCredentials()",
"testcase": true
} | {
"fields": [
{
"declarator": "PROPERTY_FOR_AUTHORIZED_USERS = \"users\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_FOR_AUTHORIZED_USERS = \"users\";",
"type": "String",
"var_name": "PROPERTY_FOR_AUTHORIZED_USERS"
},
{
"declarator": "PROPERTY_DEFAULT_AUTHORIZED_USER = \"admin\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_DEFAULT_AUTHORIZED_USER = \"admin\";",
"type": "String",
"var_name": "PROPERTY_DEFAULT_AUTHORIZED_USER"
},
{
"declarator": "PROPERTY_AUTHORIZED_GROUPS = \"groups\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_AUTHORIZED_GROUPS = \"groups\";",
"type": "String",
"var_name": "PROPERTY_AUTHORIZED_GROUPS"
},
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "repository",
"modifier": "@Reference\n private",
"original_string": "@Reference\n private Repository repository;",
"type": "Repository",
"var_name": "repository"
},
{
"declarator": "users",
"modifier": "@Property( name = PROPERTY_FOR_AUTHORIZED_USERS, cardinality = 20, value = PROPERTY_DEFAULT_AUTHORIZED_USER )\n private",
"original_string": "@Property( name = PROPERTY_FOR_AUTHORIZED_USERS, cardinality = 20, value = PROPERTY_DEFAULT_AUTHORIZED_USER )\n private Set<String> users;",
"type": "Set<String>",
"var_name": "users"
},
{
"declarator": "groups",
"modifier": "@Property( name = PROPERTY_AUTHORIZED_GROUPS, cardinality = 20 )\n private",
"original_string": "@Property( name = PROPERTY_AUTHORIZED_GROUPS, cardinality = 20 )\n private Set<String> groups;",
"type": "Set<String>",
"var_name": "groups"
}
],
"file": "bundles/extensions/webconsole-security-provider/src/main/java/com/sourcesense/stone/extensions/webconsolesecurityprovider/internal/SlingWebConsoleSecurityProvider.java",
"identifier": "SlingWebConsoleSecurityProvider",
"interfaces": "implements WebConsoleSecurityProvider",
"methods": [
{
"class_method_signature": "SlingWebConsoleSecurityProvider.configure( Map<String, Object> config )",
"constructor": false,
"full_signature": "@SuppressWarnings( \"unused\" ) @Activate @Modified private void configure( Map<String, Object> config )",
"identifier": "configure",
"modifiers": "@SuppressWarnings( \"unused\" ) @Activate @Modified private",
"parameters": "( Map<String, Object> config )",
"return": "void",
"signature": "void configure( Map<String, Object> config )",
"testcase": false
},
{
"class_method_signature": "SlingWebConsoleSecurityProvider.authenticate( String userName,\n String password )",
"constructor": false,
"full_signature": "@Override public Object authenticate( String userName,\n String password )",
"identifier": "authenticate",
"modifiers": "@Override public",
"parameters": "( String userName,\n String password )",
"return": "Object",
"signature": "Object authenticate( String userName,\n String password )",
"testcase": false
},
{
"class_method_signature": "SlingWebConsoleSecurityProvider.authorize( Object user,\n String role )",
"constructor": false,
"full_signature": "@Override public boolean authorize( Object user,\n String role )",
"identifier": "authorize",
"modifiers": "@Override public",
"parameters": "( Object user,\n String role )",
"return": "boolean",
"signature": "boolean authorize( Object user,\n String role )",
"testcase": false
},
{
"class_method_signature": "SlingWebConsoleSecurityProvider.toSet( final Object configObj )",
"constructor": false,
"full_signature": "private Set<String> toSet( final Object configObj )",
"identifier": "toSet",
"modifiers": "private",
"parameters": "( final Object configObj )",
"return": "Set<String>",
"signature": "Set<String> toSet( final Object configObj )",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public Object authenticate( String userName,\n String password ) {\n final Credentials creds = new SimpleCredentials(userName,\n (password == null) ? new char[0] : password.toCharArray());\n Session session = null;\n ClassLoader ccl = Thread.currentThread().getContextClassLoader();\n try {\n \tThread.currentThread().setContextClassLoader(getClass().getClassLoader());\n session = repository.login(creds);\n return true;\n } catch (LoginException re) {\n log.info(\n \"authenticate: User \"\n + userName\n + \" failed to authenticate with the repository for Web Console access\",\n re);\n } catch (RepositoryException re) {\n log.info(\"authenticate: Generic problem trying grant User \"\n + userName + \" access to the Web Console\", re);\n } finally {\n \tThread.currentThread().setContextClassLoader(ccl);\n if (session != null) {\n session.logout();\n }\n }\n\n // no success (see log)\n return null;\n }",
"class_method_signature": "SlingWebConsoleSecurityProvider.authenticate( String userName,\n String password )",
"constructor": false,
"full_signature": "@Override public Object authenticate( String userName,\n String password )",
"identifier": "authenticate",
"invocations": [
"toCharArray",
"getContextClassLoader",
"currentThread",
"setContextClassLoader",
"currentThread",
"getClassLoader",
"getClass",
"login",
"info",
"info",
"setContextClassLoader",
"currentThread",
"logout"
],
"modifiers": "@Override public",
"parameters": "( String userName,\n String password )",
"return": "Object",
"signature": "Object authenticate( String userName,\n String password )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_10 | {
"fields": [],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ConfigurationUtilsTest.java",
"identifier": "ConfigurationUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldReturnRepositoryNameWhenNoPropertySet() throws Exception {\n BundleContext bundleContext = programBundleContextToReturn(null, null);\n ConfigurationUtils configurationUtil = new ConfigurationUtils(bundleContext);\n\n File homeDir = configurationUtil.getHomeDir();\n\n assertEquals(\"modeshape\", homeDir.getPath());\n }",
"class_method_signature": "ConfigurationUtilsTest.shouldReturnRepositoryNameWhenNoPropertySet()",
"constructor": false,
"full_signature": "@Test public void shouldReturnRepositoryNameWhenNoPropertySet()",
"identifier": "shouldReturnRepositoryNameWhenNoPropertySet",
"invocations": [
"programBundleContextToReturn",
"getHomeDir",
"assertEquals",
"getPath"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldReturnRepositoryNameWhenNoPropertySet()",
"testcase": true
} | {
"fields": [
{
"declarator": "SLING_HOME = \"sling.home\"",
"modifier": "static final",
"original_string": "static final String SLING_HOME = \"sling.home\";",
"type": "String",
"var_name": "SLING_HOME"
},
{
"declarator": "SLING_REPOSITORY_HOME = \"sling.repository.home\"",
"modifier": "static final",
"original_string": "static final String SLING_REPOSITORY_HOME = \"sling.repository.home\";",
"type": "String",
"var_name": "SLING_REPOSITORY_HOME"
},
{
"declarator": "SLING_REPOSITORY_NAME = \"sling.repository.name\"",
"modifier": "private static final",
"original_string": "private static final String SLING_REPOSITORY_NAME = \"sling.repository.name\";",
"type": "String",
"var_name": "SLING_REPOSITORY_NAME"
},
{
"declarator": "MODESHAPE_REPOSITORY_XML = \"modeshape-repository.xml\"",
"modifier": "private static final",
"original_string": "private static final String MODESHAPE_REPOSITORY_XML = \"modeshape-repository.xml\";",
"type": "String",
"var_name": "MODESHAPE_REPOSITORY_XML"
},
{
"declarator": "log = LoggerFactory.getLogger(ConfigurationUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ConfigurationUtils.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "bundleContext",
"modifier": "private final",
"original_string": "private final BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/ConfigurationUtils.java",
"identifier": "ConfigurationUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConfigurationUtils.copyStream(InputStream source, File destFile )",
"constructor": false,
"full_signature": "static void copyStream(InputStream source, File destFile )",
"identifier": "copyStream",
"modifiers": "static",
"parameters": "(InputStream source, File destFile )",
"return": "void",
"signature": "void copyStream(InputStream source, File destFile )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.closeQuietly(Closeable closeable)",
"constructor": false,
"full_signature": "private static void closeQuietly(Closeable closeable)",
"identifier": "closeQuietly",
"modifiers": "private static",
"parameters": "(Closeable closeable)",
"return": "void",
"signature": "void closeQuietly(Closeable closeable)",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.writeFile( InputStream source,\n File destFile )",
"constructor": false,
"full_signature": "private static OutputStream writeFile( InputStream source,\n File destFile )",
"identifier": "writeFile",
"modifiers": "private static",
"parameters": "( InputStream source,\n File destFile )",
"return": "OutputStream",
"signature": "OutputStream writeFile( InputStream source,\n File destFile )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.copyFile( Bundle bundle,\n String entryPath,\n File destFile )",
"constructor": false,
"full_signature": "static void copyFile( Bundle bundle,\n String entryPath,\n File destFile )",
"identifier": "copyFile",
"modifiers": "static",
"parameters": "( Bundle bundle,\n String entryPath,\n File destFile )",
"return": "void",
"signature": "void copyFile( Bundle bundle,\n String entryPath,\n File destFile )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.ConfigurationUtils( BundleContext bundleContext )",
"constructor": true,
"full_signature": " ConfigurationUtils( BundleContext bundleContext )",
"identifier": "ConfigurationUtils",
"modifiers": "",
"parameters": "( BundleContext bundleContext )",
"return": "",
"signature": " ConfigurationUtils( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.getHomeDir()",
"constructor": false,
"full_signature": " File getHomeDir()",
"identifier": "getHomeDir",
"modifiers": "",
"parameters": "()",
"return": "File",
"signature": "File getHomeDir()",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.getRepositoryName()",
"constructor": false,
"full_signature": " String getRepositoryName()",
"identifier": "getRepositoryName",
"modifiers": "",
"parameters": "()",
"return": "String",
"signature": "String getRepositoryName()",
"testcase": false
},
{
"class_method_signature": "ConfigurationUtils.getConfigFileUrl( File homeDir )",
"constructor": false,
"full_signature": " String getConfigFileUrl( File homeDir )",
"identifier": "getConfigFileUrl",
"modifiers": "",
"parameters": "( File homeDir )",
"return": "String",
"signature": "String getConfigFileUrl( File homeDir )",
"testcase": false
}
],
"superclass": ""
} | {
"body": "File getHomeDir() {\n File homeDir;\n\n String repoHomePath = bundleContext.getProperty(SLING_REPOSITORY_HOME);\n String slingHomePath = bundleContext.getProperty(SLING_HOME);\n\n String repositoryName = getRepositoryName();\n if (repoHomePath != null) {\n homeDir = new File(repoHomePath, repositoryName);\n } else if (slingHomePath != null) {\n homeDir = new File(slingHomePath, repositoryName);\n } else {\n homeDir = new File(repositoryName);\n }\n\n log.info(\"Creating default config for Modeshape in \" + homeDir);\n if (!homeDir.isDirectory()) {\n if (!homeDir.mkdirs()) {\n log.info(\"verifyConfiguration: Cannot create Modeshape home \" + homeDir\n + \", failed creating default configuration\");\n return null;\n }\n }\n\n return homeDir;\n }",
"class_method_signature": "ConfigurationUtils.getHomeDir()",
"constructor": false,
"full_signature": " File getHomeDir()",
"identifier": "getHomeDir",
"invocations": [
"getProperty",
"getProperty",
"getRepositoryName",
"info",
"isDirectory",
"mkdirs",
"info"
],
"modifiers": "",
"parameters": "()",
"return": "File",
"signature": "File getHomeDir()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_6 | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
}
],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ActivatorTest.java",
"identifier": "ActivatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldVerifyConfigurationWhenServiceEventRegisteredIsNotifiedAndRemoveServiceListener() throws Exception {\n\n final ActivatorHelper activatorHelper = mock(ActivatorHelper.class);\n Activator activator = new Activator() {\n @Override\n protected ActivatorHelper getActivatorHelper() {\n return activatorHelper;\n }\n };\n\n BundleContext bundleContext = mock(BundleContext.class);\n injectBundleContextInto(activator, bundleContext);\n\n ServiceEvent serviceEvent = mock(ServiceEvent.class);\n when(serviceEvent.getType()).thenReturn(ServiceEvent.REGISTERED);\n\n ServiceReference aServiceReference = null; // It does not matter here\n when(serviceEvent.getServiceReference()).thenReturn(aServiceReference );\n\n\n activator.serviceChanged(serviceEvent);\n\n verify(activatorHelper).verifyConfiguration(aServiceReference);\n verify(bundleContext).removeServiceListener(activator);\n }",
"class_method_signature": "ActivatorTest.shouldVerifyConfigurationWhenServiceEventRegisteredIsNotifiedAndRemoveServiceListener()",
"constructor": false,
"full_signature": "@Test public void shouldVerifyConfigurationWhenServiceEventRegisteredIsNotifiedAndRemoveServiceListener()",
"identifier": "shouldVerifyConfigurationWhenServiceEventRegisteredIsNotifiedAndRemoveServiceListener",
"invocations": [
"mock",
"mock",
"injectBundleContextInto",
"mock",
"thenReturn",
"when",
"getType",
"thenReturn",
"when",
"getServiceReference",
"serviceChanged",
"verifyConfiguration",
"verify",
"removeServiceListener",
"verify"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldVerifyConfigurationWhenServiceEventRegisteredIsNotifiedAndRemoveServiceListener()",
"testcase": true
} | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
},
{
"declarator": "accessManagerFactoryTracker",
"modifier": "private",
"original_string": "private AccessManagerFactoryTracker accessManagerFactoryTracker;",
"type": "AccessManagerFactoryTracker",
"var_name": "accessManagerFactoryTracker"
},
{
"declarator": "activatorHelper",
"modifier": "private",
"original_string": "private ActivatorHelper activatorHelper;",
"type": "ActivatorHelper",
"var_name": "activatorHelper"
},
{
"declarator": "bundleContext",
"modifier": "private",
"original_string": "private BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/Activator.java",
"identifier": "Activator",
"interfaces": "implements BundleActivator, ServiceListener",
"methods": [
{
"class_method_signature": "Activator.serviceChanged( ServiceEvent event )",
"constructor": false,
"full_signature": "@Override public void serviceChanged( ServiceEvent event )",
"identifier": "serviceChanged",
"modifiers": "@Override public",
"parameters": "( ServiceEvent event )",
"return": "void",
"signature": "void serviceChanged( ServiceEvent event )",
"testcase": false
},
{
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.stop( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void stop( BundleContext bundleContext )",
"identifier": "stop",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void stop( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.getActivatorHelper()",
"constructor": false,
"full_signature": "protected ActivatorHelper getActivatorHelper()",
"identifier": "getActivatorHelper",
"modifiers": "protected",
"parameters": "()",
"return": "ActivatorHelper",
"signature": "ActivatorHelper getActivatorHelper()",
"testcase": false
},
{
"class_method_signature": "Activator.getAccessManagerFactoryTracker()",
"constructor": false,
"full_signature": "protected AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"identifier": "getAccessManagerFactoryTracker",
"modifiers": "protected",
"parameters": "()",
"return": "AccessManagerFactoryTracker",
"signature": "AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void serviceChanged( ServiceEvent event ) {\n if (ServiceEvent.REGISTERED == event.getType()) {\n\n getActivatorHelper().verifyConfiguration(event.getServiceReference());\n bundleContext.removeServiceListener(this);\n }\n }",
"class_method_signature": "Activator.serviceChanged( ServiceEvent event )",
"constructor": false,
"full_signature": "@Override public void serviceChanged( ServiceEvent event )",
"identifier": "serviceChanged",
"invocations": [
"getType",
"verifyConfiguration",
"getActivatorHelper",
"getServiceReference",
"removeServiceListener"
],
"modifiers": "@Override public",
"parameters": "( ServiceEvent event )",
"return": "void",
"signature": "void serviceChanged( ServiceEvent event )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_1 | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
}
],
"file": "bundles/jcr/modeshape-server/src/test/java/com/sourcesense/stone/jcr/modeshape/server/impl/ActivatorTest.java",
"identifier": "ActivatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldVerifyConfigurationOnStartWhenConfigurationAdminServiceReferenceIsFound() throws Exception {\n\n ServiceReference configurationAdminServiceReference = mock(ServiceReference.class);\n\n BundleContext bundleContext = mock(BundleContext.class);\n when(bundleContext.getServiceReference(CONFIG_ADMIN_NAME)).thenReturn(configurationAdminServiceReference);\n\n final AccessManagerFactoryTracker accessManagerFactoryTracker = mock(AccessManagerFactoryTracker.class);\n final ActivatorHelper activatorHelper = mock(ActivatorHelper.class);\n when(activatorHelper.createAccessManagerFactoryTracker()).thenReturn(accessManagerFactoryTracker);\n\n Activator activator = new Activator() {\n\n @Override\n protected ActivatorHelper getActivatorHelper() {\n return activatorHelper;\n }\n\n @Override\n protected AccessManagerFactoryTracker getAccessManagerFactoryTracker() {\n return accessManagerFactoryTracker;\n }\n };\n\n activator.start(bundleContext);\n\n verify(activatorHelper).verifyConfiguration(configurationAdminServiceReference);\n }",
"class_method_signature": "ActivatorTest.shouldVerifyConfigurationOnStartWhenConfigurationAdminServiceReferenceIsFound()",
"constructor": false,
"full_signature": "@Test public void shouldVerifyConfigurationOnStartWhenConfigurationAdminServiceReferenceIsFound()",
"identifier": "shouldVerifyConfigurationOnStartWhenConfigurationAdminServiceReferenceIsFound",
"invocations": [
"mock",
"mock",
"thenReturn",
"when",
"getServiceReference",
"mock",
"mock",
"thenReturn",
"when",
"createAccessManagerFactoryTracker",
"start",
"verifyConfiguration",
"verify"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void shouldVerifyConfigurationOnStartWhenConfigurationAdminServiceReferenceIsFound()",
"testcase": true
} | {
"fields": [
{
"declarator": "CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName()",
"modifier": "private static final",
"original_string": "private static final String CONFIG_ADMIN_NAME = ConfigurationAdmin.class.getName();",
"type": "String",
"var_name": "CONFIG_ADMIN_NAME"
},
{
"declarator": "accessManagerFactoryTracker",
"modifier": "private",
"original_string": "private AccessManagerFactoryTracker accessManagerFactoryTracker;",
"type": "AccessManagerFactoryTracker",
"var_name": "accessManagerFactoryTracker"
},
{
"declarator": "activatorHelper",
"modifier": "private",
"original_string": "private ActivatorHelper activatorHelper;",
"type": "ActivatorHelper",
"var_name": "activatorHelper"
},
{
"declarator": "bundleContext",
"modifier": "private",
"original_string": "private BundleContext bundleContext;",
"type": "BundleContext",
"var_name": "bundleContext"
}
],
"file": "bundles/jcr/modeshape-server/src/main/java/com/sourcesense/stone/jcr/modeshape/server/impl/Activator.java",
"identifier": "Activator",
"interfaces": "implements BundleActivator, ServiceListener",
"methods": [
{
"class_method_signature": "Activator.serviceChanged( ServiceEvent event )",
"constructor": false,
"full_signature": "@Override public void serviceChanged( ServiceEvent event )",
"identifier": "serviceChanged",
"modifiers": "@Override public",
"parameters": "( ServiceEvent event )",
"return": "void",
"signature": "void serviceChanged( ServiceEvent event )",
"testcase": false
},
{
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.stop( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void stop( BundleContext bundleContext )",
"identifier": "stop",
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void stop( BundleContext bundleContext )",
"testcase": false
},
{
"class_method_signature": "Activator.getActivatorHelper()",
"constructor": false,
"full_signature": "protected ActivatorHelper getActivatorHelper()",
"identifier": "getActivatorHelper",
"modifiers": "protected",
"parameters": "()",
"return": "ActivatorHelper",
"signature": "ActivatorHelper getActivatorHelper()",
"testcase": false
},
{
"class_method_signature": "Activator.getAccessManagerFactoryTracker()",
"constructor": false,
"full_signature": "protected AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"identifier": "getAccessManagerFactoryTracker",
"modifiers": "protected",
"parameters": "()",
"return": "AccessManagerFactoryTracker",
"signature": "AccessManagerFactoryTracker getAccessManagerFactoryTracker()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void start( BundleContext bundleContext ) throws Exception {\n this.bundleContext = bundleContext;\n\n if (null == activatorHelper) {\n this.activatorHelper = getActivatorHelper();\n }\n\n ServiceReference configurationAdminServiceReference = bundleContext.getServiceReference(CONFIG_ADMIN_NAME);\n\n if (null != configurationAdminServiceReference) {\n activatorHelper.verifyConfiguration(configurationAdminServiceReference);\n } else {\n bundleContext.addServiceListener(this, String.format(\"(%s=%s)\", Constants.OBJECTCLASS, CONFIG_ADMIN_NAME));\n }\n\n AccessManagerFactoryTracker accessManagerFactoryTracker = getAccessManagerFactoryTracker();\n if (null == accessManagerFactoryTracker) {\n accessManagerFactoryTracker = this.accessManagerFactoryTracker = activatorHelper.createAccessManagerFactoryTracker();\n }\n accessManagerFactoryTracker.open();\n\n ClassLoader bundleClassLoader = new BundleClassLoaderFactory(bundleContext).getClassLoader((String[])null);\n I18n.setLocalizationRepository(new ClasspathLocalizationRepository(bundleClassLoader));\n }",
"class_method_signature": "Activator.start( BundleContext bundleContext )",
"constructor": false,
"full_signature": "@Override public void start( BundleContext bundleContext )",
"identifier": "start",
"invocations": [
"getActivatorHelper",
"getServiceReference",
"verifyConfiguration",
"addServiceListener",
"format",
"getAccessManagerFactoryTracker",
"createAccessManagerFactoryTracker",
"open",
"getClassLoader",
"setLocalizationRepository"
],
"modifiers": "@Override public",
"parameters": "( BundleContext bundleContext )",
"return": "void",
"signature": "void start( BundleContext bundleContext )",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
1535924_0 | {
"fields": [],
"file": "bundles/jcr/com.sourcesense.stone.jcr.base/src/test/java/com/sourcesense/stone/jcr/base/NodeTypeLoaderTest.java",
"identifier": "NodeTypeLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testisReRegisterBuiltinNodeType() {\n assertFalse(\"Exception does not match\",\n NodeTypeLoader.isReRegisterBuiltinNodeType(new Exception()));\n assertFalse(\"Plain RepositoryException does not match\",\n NodeTypeLoader.isReRegisterBuiltinNodeType(new RepositoryException()));\n assertFalse(\"Non-reregister RepositoryException does not match\",\n NodeTypeLoader.isReRegisterBuiltinNodeType(new RepositoryException(\"builtin that's it\")));\n assertTrue(\"Reregister RepositoryException matches\",\n NodeTypeLoader.isReRegisterBuiltinNodeType(\n new RepositoryException(\"{http://www.jcp.org/jcr/mix/1.0}language: can't reregister built-in node type\")));\n }",
"class_method_signature": "NodeTypeLoaderTest.testisReRegisterBuiltinNodeType()",
"constructor": false,
"full_signature": "@Test public void testisReRegisterBuiltinNodeType()",
"identifier": "testisReRegisterBuiltinNodeType",
"invocations": [
"assertFalse",
"isReRegisterBuiltinNodeType",
"assertFalse",
"isReRegisterBuiltinNodeType",
"assertFalse",
"isReRegisterBuiltinNodeType",
"assertTrue",
"isReRegisterBuiltinNodeType"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testisReRegisterBuiltinNodeType()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(NodeTypeLoader.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(NodeTypeLoader.class);",
"type": "Logger",
"var_name": "log"
}
],
"file": "bundles/jcr/com.sourcesense.stone.jcr.base/src/main/java/com/sourcesense/stone/jcr/base/NodeTypeLoader.java",
"identifier": "NodeTypeLoader",
"interfaces": "",
"methods": [
{
"class_method_signature": "NodeTypeLoader.registerNodeType(Session session, URL source)",
"constructor": false,
"full_signature": "public static boolean registerNodeType(Session session, URL source)",
"identifier": "registerNodeType",
"modifiers": "public static",
"parameters": "(Session session, URL source)",
"return": "boolean",
"signature": "boolean registerNodeType(Session session, URL source)",
"testcase": false
},
{
"class_method_signature": "NodeTypeLoader.registerNodeType(Session session, InputStream source)",
"constructor": false,
"full_signature": "public static boolean registerNodeType(Session session, InputStream source)",
"identifier": "registerNodeType",
"modifiers": "public static",
"parameters": "(Session session, InputStream source)",
"return": "boolean",
"signature": "boolean registerNodeType(Session session, InputStream source)",
"testcase": false
},
{
"class_method_signature": "NodeTypeLoader.registerNodeType(Session session, String systemId, Reader reader, boolean reregisterExisting)",
"constructor": false,
"full_signature": "public static boolean registerNodeType(Session session, String systemId, Reader reader, boolean reregisterExisting)",
"identifier": "registerNodeType",
"modifiers": "public static",
"parameters": "(Session session, String systemId, Reader reader, boolean reregisterExisting)",
"return": "boolean",
"signature": "boolean registerNodeType(Session session, String systemId, Reader reader, boolean reregisterExisting)",
"testcase": false
},
{
"class_method_signature": "NodeTypeLoader.isReRegisterBuiltinNodeType(Exception e)",
"constructor": false,
"full_signature": "static boolean isReRegisterBuiltinNodeType(Exception e)",
"identifier": "isReRegisterBuiltinNodeType",
"modifiers": "static",
"parameters": "(Exception e)",
"return": "boolean",
"signature": "boolean isReRegisterBuiltinNodeType(Exception e)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static boolean isReRegisterBuiltinNodeType(Exception e) {\n return\n (e instanceof RepositoryException)\n & (e.getMessage() != null && e.getMessage().contains(\"reregister built-in node type\"));\n }",
"class_method_signature": "NodeTypeLoader.isReRegisterBuiltinNodeType(Exception e)",
"constructor": false,
"full_signature": "static boolean isReRegisterBuiltinNodeType(Exception e)",
"identifier": "isReRegisterBuiltinNodeType",
"invocations": [
"getMessage",
"contains",
"getMessage"
],
"modifiers": "static",
"parameters": "(Exception e)",
"return": "boolean",
"signature": "boolean isReRegisterBuiltinNodeType(Exception e)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1535924,
"size": 28399,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/sourcesense/stone"
} |
30044052_183 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static TextileMarkup markup;",
"type": "TextileMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-textile/src/test/java/com/twasyl/slideshowfx/markup/textile/TextileMarkupTest.java",
"identifier": "TextileMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void generateInlineCode() {\n final String result = markup.convertAsHtml(\"@public class Java { }@\");\n\n assertEquals(\"<p><code>public class Java { }</code></p>\", result);\n }",
"class_method_signature": "TextileMarkupTest.generateInlineCode()",
"constructor": false,
"full_signature": "@Test public void generateInlineCode()",
"identifier": "generateInlineCode",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateInlineCode()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(TextileMarkup.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(TextileMarkup.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "slideshowfx-textile/src/main/java/com/twasyl/slideshowfx/markup/textile/TextileMarkup.java",
"identifier": "TextileMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "TextileMarkup.TextileMarkup()",
"constructor": true,
"full_signature": "public TextileMarkup()",
"identifier": "TextileMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " TextileMarkup()",
"testcase": false
},
{
"class_method_signature": "TextileMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n String result = null;\n\n try (final StringWriter writer = new StringWriter()) {\n final DocumentBuilder builder = new HtmlDocumentBuilder(writer);\n final MarkupParser parser = new MarkupParser(new TextileLanguage(), builder);\n\n parser.parse(markupString, false);\n builder.flush();\n writer.flush();\n\n result = writer.toString();\n } catch (IOException e) {\n LOGGER.log(Level.WARNING, \"Error while converting to textile\");\n }\n\n return result;\n }",
"class_method_signature": "TextileMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName",
"parse",
"flush",
"flush",
"toString",
"log"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_70 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/RecentPresentationTest.java",
"identifier": "RecentPresentationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @DisplayName(\"is not equal to a null object\")\n void notEqualToNull() {\n final RecentPresentation presentation = new RecentPresentation(\"presentation1.sfx\", null);\n assertFalse(presentation.equals(null));\n }",
"class_method_signature": "RecentPresentationTest.notEqualToNull()",
"constructor": false,
"full_signature": "@Test @DisplayName(\"is not equal to a null object\") void notEqualToNull()",
"identifier": "notEqualToNull",
"invocations": [
"assertFalse",
"equals"
],
"modifiers": "@Test @DisplayName(\"is not equal to a null object\")",
"parameters": "()",
"return": "void",
"signature": "void notEqualToNull()",
"testcase": true
} | {
"fields": [
{
"declarator": "openedDateTime",
"modifier": "private",
"original_string": "private LocalDateTime openedDateTime;",
"type": "LocalDateTime",
"var_name": "openedDateTime"
},
{
"declarator": "normalizedPath",
"modifier": "private",
"original_string": "private String normalizedPath;",
"type": "String",
"var_name": "normalizedPath"
},
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/RecentPresentation.java",
"identifier": "RecentPresentation",
"interfaces": "implements Comparable<File>",
"methods": [
{
"class_method_signature": "RecentPresentation.RecentPresentation(final String path, final LocalDateTime openedDateTime)",
"constructor": true,
"full_signature": "public RecentPresentation(final String path, final LocalDateTime openedDateTime)",
"identifier": "RecentPresentation",
"modifiers": "public",
"parameters": "(final String path, final LocalDateTime openedDateTime)",
"return": "",
"signature": " RecentPresentation(final String path, final LocalDateTime openedDateTime)",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.getOpenedDateTime()",
"constructor": false,
"full_signature": "public LocalDateTime getOpenedDateTime()",
"identifier": "getOpenedDateTime",
"modifiers": "public",
"parameters": "()",
"return": "LocalDateTime",
"signature": "LocalDateTime getOpenedDateTime()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.setOpenedDateTime(LocalDateTime openedDateTime)",
"constructor": false,
"full_signature": "public void setOpenedDateTime(LocalDateTime openedDateTime)",
"identifier": "setOpenedDateTime",
"modifiers": "public",
"parameters": "(LocalDateTime openedDateTime)",
"return": "void",
"signature": "void setOpenedDateTime(LocalDateTime openedDateTime)",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.getId()",
"constructor": false,
"full_signature": "public String getId()",
"identifier": "getId",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getId()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.getNormalizedPath()",
"constructor": false,
"full_signature": "public String getNormalizedPath()",
"identifier": "getNormalizedPath",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getNormalizedPath()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.equals(Object o)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object o)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(Object o)",
"return": "boolean",
"signature": "boolean equals(Object o)",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.compareTo(File o)",
"constructor": false,
"full_signature": "@Override public int compareTo(File o)",
"identifier": "compareTo",
"modifiers": "@Override public",
"parameters": "(File o)",
"return": "int",
"signature": "int compareTo(File o)",
"testcase": false
}
],
"superclass": "extends File"
} | {
"body": "@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n if (!super.equals(o)) return false;\n\n final RecentPresentation that = (RecentPresentation) o;\n\n return getNormalizedPath().equals(that.getNormalizedPath());\n }",
"class_method_signature": "RecentPresentation.equals(Object o)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object o)",
"identifier": "equals",
"invocations": [
"getClass",
"getClass",
"equals",
"equals",
"getNormalizedPath",
"getNormalizedPath"
],
"modifiers": "@Override public",
"parameters": "(Object o)",
"return": "boolean",
"signature": "boolean equals(Object o)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_27 | {
"fields": [
{
"declarator": "snippetExecutor = new JavaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final JavaSnippetExecutor snippetExecutor = new JavaSnippetExecutor();",
"type": "JavaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-java-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutorTest.java",
"identifier": "JavaSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void emptyClassName() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"\");\n\n assertEquals(\"Snippet\", snippetExecutor.determineClassName(snippet));\n }",
"class_method_signature": "JavaSnippetExecutorTest.emptyClassName()",
"constructor": false,
"full_signature": "@Test public void emptyClassName()",
"identifier": "emptyClassName",
"invocations": [
"put",
"getProperties",
"assertEquals",
"determineClassName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void emptyClassName()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "JAVA_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String JAVA_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "JAVA_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
}
],
"file": "slideshowfx-java-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutor.java",
"identifier": "JavaSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "JavaSnippetExecutor.JavaSnippetExecutor()",
"constructor": true,
"full_signature": "public JavaSnippetExecutor()",
"identifier": "JavaSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " JavaSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<JavaSnippetExecutorOptions>"
} | {
"body": "protected String determineClassName(final CodeSnippet codeSnippet) {\n String className = codeSnippet.getProperties().get(CLASS_NAME_PROPERTY);\n if (className == null || className.isEmpty()) className = \"Snippet\";\n return className;\n }",
"class_method_signature": "JavaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_212 | {
"fields": [],
"file": "slideshowfx-utils/src/test/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombinationTest.java",
"identifier": "SlideshowFXKeyCombinationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAltA() {\n final SlideshowFXKeyCombination combination = SlideshowFXKeyCombination.valueOf(\"Alt+A\");\n assertCombination(UP, DOWN, UP, UP, UP, \"A\", combination);\n }",
"class_method_signature": "SlideshowFXKeyCombinationTest.testAltA()",
"constructor": false,
"full_signature": "@Test public void testAltA()",
"identifier": "testAltA",
"invocations": [
"valueOf",
"assertCombination"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testAltA()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName())",
"modifier": "public static final",
"original_string": "public static final Logger LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "text",
"modifier": "private final",
"original_string": "private final String text;",
"type": "String",
"var_name": "text"
},
{
"declarator": "code",
"modifier": "private final",
"original_string": "private final KeyCode code;",
"type": "KeyCode",
"var_name": "code"
}
],
"file": "slideshowfx-utils/src/main/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombination.java",
"identifier": "SlideshowFXKeyCombination",
"interfaces": "",
"methods": [
{
"class_method_signature": "SlideshowFXKeyCombination.SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"constructor": true,
"full_signature": "public SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"identifier": "SlideshowFXKeyCombination",
"modifiers": "public",
"parameters": "(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"return": "",
"signature": " SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getText()",
"constructor": false,
"full_signature": "public String getText()",
"identifier": "getText",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getDisplayText()",
"constructor": false,
"full_signature": "@Override public String getDisplayText()",
"identifier": "getDisplayText",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getDisplayText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.match(KeyEvent event)",
"constructor": false,
"full_signature": "@Override public boolean match(KeyEvent event)",
"identifier": "match",
"modifiers": "@Override public",
"parameters": "(KeyEvent event)",
"return": "boolean",
"signature": "boolean match(KeyEvent event)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.equals(final Object obj)",
"constructor": false,
"full_signature": "@Override public boolean equals(final Object obj)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(final Object obj)",
"return": "boolean",
"signature": "boolean equals(final Object obj)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
}
],
"superclass": "extends KeyCombination"
} | {
"body": "public static SlideshowFXKeyCombination valueOf(String value) {\n if (value == null) throw new NullPointerException(\"The value can not be null\");\n if (value.isEmpty()) throw new IllegalArgumentException(\"The value can not be empty\");\n\n String determinedText = null;\n KeyCode determinedCode = KeyCode.UNDEFINED;\n\n ModifierValue shiftModifier = ModifierValue.UP;\n ModifierValue controlModifier = ModifierValue.UP;\n ModifierValue shortcutModifier = ModifierValue.UP;\n ModifierValue metaModifier = ModifierValue.UP;\n ModifierValue altModifier = ModifierValue.UP;\n\n final String[] tokens = value.split(\"\\\\+\");\n for (String token : tokens) {\n switch (token) {\n case \"Shortcut\":\n shortcutModifier = ModifierValue.DOWN;\n break;\n case \"Ctrl\":\n controlModifier = ModifierValue.DOWN;\n break;\n case \"Shift\":\n shiftModifier = ModifierValue.DOWN;\n break;\n case \"Meta\":\n metaModifier = ModifierValue.DOWN;\n break;\n case \"Alt\":\n altModifier = ModifierValue.DOWN;\n break;\n default:\n determinedText = token;\n determinedCode = KeyCode.valueOf(determinedText);\n }\n }\n final SlideshowFXKeyCombination combination = new SlideshowFXKeyCombination(determinedText, determinedCode, shiftModifier,\n controlModifier, altModifier, metaModifier, shortcutModifier);\n\n return combination;\n }",
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"invocations": [
"isEmpty",
"split",
"valueOf"
],
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_31 | {
"fields": [
{
"declarator": "snippetExecutor = new JavaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final JavaSnippetExecutor snippetExecutor = new JavaSnippetExecutor();",
"type": "JavaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-java-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutorTest.java",
"identifier": "JavaSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hasImports() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(IMPORTS_PROPERTY, \"import p._\");\n\n assertTrue(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "JavaSnippetExecutorTest.hasImports()",
"constructor": false,
"full_signature": "@Test public void hasImports()",
"identifier": "hasImports",
"invocations": [
"put",
"getProperties",
"assertTrue",
"hasImports"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void hasImports()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "JAVA_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String JAVA_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "JAVA_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
}
],
"file": "slideshowfx-java-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutor.java",
"identifier": "JavaSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "JavaSnippetExecutor.JavaSnippetExecutor()",
"constructor": true,
"full_signature": "public JavaSnippetExecutor()",
"identifier": "JavaSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " JavaSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<JavaSnippetExecutorOptions>"
} | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "JavaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_204 | {
"fields": [
{
"declarator": "baseLocation",
"modifier": "private static",
"original_string": "private static File baseLocation;",
"type": "File",
"var_name": "baseLocation"
},
{
"declarator": "visitor",
"modifier": "private",
"original_string": "private ListFilesFileVisitor visitor;",
"type": "ListFilesFileVisitor",
"var_name": "visitor"
}
],
"file": "slideshowfx-utils/src/test/java/com/twasyl/slideshowfx/utils/io/ListFilesFileVisitorTest.java",
"identifier": "ListFilesFileVisitorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOnFileTree() throws IOException {\n final File emptyDir = baseLocation;\n Files.walkFileTree(emptyDir.toPath(), visitor);\n\n assertEquals(5, visitor.getPaths().size(), visitor.getPaths().stream().map(Path::toString).collect(Collectors.joining(System.lineSeparator())));\n assertTrue(visitor.getPaths().contains(new File(baseLocation, \"dir/dir2\").toPath()));\n assertTrue(visitor.getPaths().contains(new File(baseLocation, \"dir/dir3/file2.txt\").toPath()));\n assertTrue(visitor.getPaths().contains(new File(baseLocation, \"dir/file1.txt\").toPath()));\n assertTrue(visitor.getPaths().contains(new File(baseLocation, \"emptyDir\").toPath()));\n assertTrue(visitor.getPaths().contains(new File(baseLocation, \"file.txt\").toPath()));\n }",
"class_method_signature": "ListFilesFileVisitorTest.testOnFileTree()",
"constructor": false,
"full_signature": "@Test public void testOnFileTree()",
"identifier": "testOnFileTree",
"invocations": [
"walkFileTree",
"toPath",
"assertEquals",
"size",
"getPaths",
"collect",
"map",
"stream",
"getPaths",
"joining",
"lineSeparator",
"assertTrue",
"contains",
"getPaths",
"toPath",
"assertTrue",
"contains",
"getPaths",
"toPath",
"assertTrue",
"contains",
"getPaths",
"toPath",
"assertTrue",
"contains",
"getPaths",
"toPath",
"assertTrue",
"contains",
"getPaths",
"toPath"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testOnFileTree()",
"testcase": true
} | {
"fields": [
{
"declarator": "paths = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Path> paths = new ArrayList<>();",
"type": "List<Path>",
"var_name": "paths"
},
{
"declarator": "nonEmptyDirectories = new HashSet<>()",
"modifier": "private",
"original_string": "private Set<Path> nonEmptyDirectories = new HashSet<>();",
"type": "Set<Path>",
"var_name": "nonEmptyDirectories"
}
],
"file": "slideshowfx-utils/src/main/java/com/twasyl/slideshowfx/utils/io/ListFilesFileVisitor.java",
"identifier": "ListFilesFileVisitor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ListFilesFileVisitor.getPaths()",
"constructor": false,
"full_signature": "public List<Path> getPaths()",
"identifier": "getPaths",
"modifiers": "public",
"parameters": "()",
"return": "List<Path>",
"signature": "List<Path> getPaths()",
"testcase": false
},
{
"class_method_signature": "ListFilesFileVisitor.getFiles()",
"constructor": false,
"full_signature": "public List<File> getFiles()",
"identifier": "getFiles",
"modifiers": "public",
"parameters": "()",
"return": "List<File>",
"signature": "List<File> getFiles()",
"testcase": false
},
{
"class_method_signature": "ListFilesFileVisitor.visitFile(Path file, BasicFileAttributes attrs)",
"constructor": false,
"full_signature": "@Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)",
"identifier": "visitFile",
"modifiers": "@Override public",
"parameters": "(Path file, BasicFileAttributes attrs)",
"return": "FileVisitResult",
"signature": "FileVisitResult visitFile(Path file, BasicFileAttributes attrs)",
"testcase": false
},
{
"class_method_signature": "ListFilesFileVisitor.preVisitDirectory(Path dir, BasicFileAttributes attrs)",
"constructor": false,
"full_signature": "@Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)",
"identifier": "preVisitDirectory",
"modifiers": "@Override public",
"parameters": "(Path dir, BasicFileAttributes attrs)",
"return": "FileVisitResult",
"signature": "FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)",
"testcase": false
},
{
"class_method_signature": "ListFilesFileVisitor.postVisitDirectory(Path dir, IOException exc)",
"constructor": false,
"full_signature": "@Override public FileVisitResult postVisitDirectory(Path dir, IOException exc)",
"identifier": "postVisitDirectory",
"modifiers": "@Override public",
"parameters": "(Path dir, IOException exc)",
"return": "FileVisitResult",
"signature": "FileVisitResult postVisitDirectory(Path dir, IOException exc)",
"testcase": false
}
],
"superclass": "extends SimpleFileVisitor<Path>"
} | {
"body": "public List<Path> getPaths() {\n return paths;\n }",
"class_method_signature": "ListFilesFileVisitor.getPaths()",
"constructor": false,
"full_signature": "public List<Path> getPaths()",
"identifier": "getPaths",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "List<Path>",
"signature": "List<Path> getPaths()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_89 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void saveWithoutOpenedPresentationDate() throws Exception {\n final String path = \"presentation.sfx\";\n\n final RecentPresentation recentPresentation = new RecentPresentation(path, null);\n final ByteArrayInputStream input = new ByteArrayInputStream(new byte[0]);\n final ByteArrayOutputStream output = new ByteArrayOutputStream();\n\n ContextFileWorker.saveRecentPresentation(input, output, recentPresentation);\n\n assertEquals(0, output.size());\n }",
"class_method_signature": "ContextFileWorkerTest.saveWithoutOpenedPresentationDate()",
"constructor": false,
"full_signature": "@Test public void saveWithoutOpenedPresentationDate()",
"identifier": "saveWithoutOpenedPresentationDate",
"invocations": [
"saveRecentPresentation",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void saveWithoutOpenedPresentationDate()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation) throws ContextFileException {\n final Document document = createDocumentFromInput(input);\n\n populateDocumentIfNecessary(document);\n\n final Node recentPresentationsNode = getRecentPresentationsNode(document);\n final Node recentPresentationNode = createNodeFromRecentPresentation(document, recentPresentation);\n\n if (recentPresentationNode != null) {\n recentPresentationsNode.appendChild(recentPresentationNode);\n writeDocument(document, output);\n }\n }",
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"invocations": [
"createDocumentFromInput",
"populateDocumentIfNecessary",
"getRecentPresentationsNode",
"createNodeFromRecentPresentation",
"appendChild",
"writeDocument"
],
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_195 | {
"fields": [
{
"declarator": "snippetExecutor = new GoSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoSnippetExecutor snippetExecutor = new GoSnippetExecutor();",
"type": "GoSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-go-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutorTest.java",
"identifier": "GoSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void formatImportWithDoubleQuotes() {\n assertEquals(\"\\\"fmt\\\"\", snippetExecutor.formatImportLine(\"\\\"fmt\\\"\"));\n }",
"class_method_signature": "GoSnippetExecutorTest.formatImportWithDoubleQuotes()",
"constructor": false,
"full_signature": "@Test public void formatImportWithDoubleQuotes()",
"identifier": "formatImportWithDoubleQuotes",
"invocations": [
"assertEquals",
"formatImportLine"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void formatImportWithDoubleQuotes()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GO_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String GO_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GO_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "PACKAGE_NAME_PROPERTY = \"package\"",
"modifier": "protected static final",
"original_string": "protected static final String PACKAGE_NAME_PROPERTY = \"package\";",
"type": "String",
"var_name": "PACKAGE_NAME_PROPERTY"
}
],
"file": "slideshowfx-go-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutor.java",
"identifier": "GoSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GoSnippetExecutor.GoSnippetExecutor()",
"constructor": true,
"full_signature": "public GoSnippetExecutor()",
"identifier": "GoSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GoSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getStartPackageDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartPackageDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.determinePackageName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determinePackageName(final CodeSnippet codeSnippet)",
"identifier": "determinePackageName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determinePackageName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GoSnippetExecutorOptions>"
} | {
"body": "protected String formatImportLine(final String importLine) {\n final String importLineBeginning = \"\\\"\";\n final String importLineEnding = \"\\\"\";\n\n String formattedImportLine;\n\n if (importLine.startsWith(importLineBeginning)) {\n formattedImportLine = importLine;\n } else {\n formattedImportLine = importLineBeginning.concat(importLine);\n }\n\n if (!importLine.endsWith(importLineEnding)) {\n formattedImportLine = formattedImportLine.concat(importLineEnding);\n }\n\n return formattedImportLine;\n }",
"class_method_signature": "GoSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"invocations": [
"startsWith",
"concat",
"endsWith",
"concat"
],
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_66 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-groovy-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutorTest.java",
"identifier": "GroovySnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void buildSourceCodeWithoutWrapInMethodRunnerButMakeScript() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"TestGroovy\");\n snippet.getProperties().put(IMPORTS_PROPERTY, \"import mypackage\\nmysecondpackage\");\n snippet.getProperties().put(MAKE_SCRIPT, \"true\");\n\n snippet.setCode(\"def run() {\\n\\tprintln(\\\"Hello\\\")\\n}\");\n\n final String expected = IOUtils.read(GroovySnippetExecutorTest.class.getResourceAsStream(\"/com/twasyl/slideshowfx/snippet/executor/groovy/buildSourceCodeWithoutWrapInMethodRunnerButMakeScript_expected.txt\"));\n assertEquals(expected, snippetExecutor.buildSourceCode(snippet));\n }",
"class_method_signature": "GroovySnippetExecutorTest.buildSourceCodeWithoutWrapInMethodRunnerButMakeScript()",
"constructor": false,
"full_signature": "@Test public void buildSourceCodeWithoutWrapInMethodRunnerButMakeScript()",
"identifier": "buildSourceCodeWithoutWrapInMethodRunnerButMakeScript",
"invocations": [
"put",
"getProperties",
"put",
"getProperties",
"put",
"getProperties",
"setCode",
"read",
"getResourceAsStream",
"assertEquals",
"buildSourceCode"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void buildSourceCodeWithoutWrapInMethodRunnerButMakeScript()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GROOVY_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String GROOVY_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GROOVY_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\";",
"type": "String",
"var_name": "WRAP_IN_METHOD_RUNNER"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
},
{
"declarator": "MAKE_SCRIPT = \"makeScript\"",
"modifier": "protected static final",
"original_string": "protected static final String MAKE_SCRIPT = \"makeScript\";",
"type": "String",
"var_name": "MAKE_SCRIPT"
}
],
"file": "slideshowfx-groovy-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutor.java",
"identifier": "GroovySnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GroovySnippetExecutor.GroovySnippetExecutor()",
"constructor": true,
"full_signature": "public GroovySnippetExecutor()",
"identifier": "GroovySnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GroovySnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.makeScript(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean makeScript(final CodeSnippet codeSnippet)",
"identifier": "makeScript",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean makeScript(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getScriptImport()",
"constructor": false,
"full_signature": "protected String getScriptImport()",
"identifier": "getScriptImport",
"modifiers": "protected",
"parameters": "()",
"return": "String",
"signature": "String getScriptImport()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartMainMethod(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartMainMethod(final CodeSnippet codeSnippet)",
"identifier": "getStartMainMethod",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartMainMethod(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GroovySnippetExecutorOptions>"
} | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n boolean someImportsPresent = false;\n\n if (makeScript(codeSnippet)) {\n sourceCode.append(getScriptImport()).append(\"\\n\");\n someImportsPresent = true;\n }\n\n if (hasImports(codeSnippet)) {\n sourceCode.append(getImports(codeSnippet)).append(\"\\n\");\n someImportsPresent = true;\n }\n\n if (someImportsPresent) sourceCode.append(\"\\n\");\n\n sourceCode.append(getStartClassDefinition(codeSnippet)).append(\"\\n\");\n\n if (mustBeWrappedIn(codeSnippet, WRAP_IN_METHOD_RUNNER)) {\n sourceCode.append(\"\\t\").append(getStartMainMethod(codeSnippet)).append(\"\\n\")\n .append(codeSnippet.getCode())\n .append(\"\\n\\t}\");\n } else {\n sourceCode.append(codeSnippet.getCode());\n }\n\n sourceCode.append(\"\\n}\");\n\n return sourceCode.toString();\n }",
"class_method_signature": "GroovySnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"invocations": [
"makeScript",
"append",
"append",
"getScriptImport",
"hasImports",
"append",
"append",
"getImports",
"append",
"append",
"append",
"getStartClassDefinition",
"mustBeWrappedIn",
"append",
"append",
"append",
"append",
"append",
"getStartMainMethod",
"getCode",
"append",
"getCode",
"append",
"toString"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_101 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void purgeRecentPresentationsWhenLessThanSpecified() throws ContextFileException {\n final int numberOfRecentPresentationsToKeep = 4;\n final RecentPresentation recentPresentation1 = new RecentPresentation(\"presentation1.sfx\", LocalDateTime.now());\n final RecentPresentation recentPresentation2 = new RecentPresentation(\"presentation2.sfx\", recentPresentation1.getOpenedDateTime().plusDays(2));\n final RecentPresentation recentPresentation3 = new RecentPresentation(\"presentation3.sfx\", recentPresentation2.getOpenedDateTime().plusDays(2));\n\n final String xml = this.createXmlStringFromRecentPresentations(recentPresentation1, recentPresentation2, recentPresentation3);\n\n final ByteArrayInputStream input = new ByteArrayInputStream(xml.getBytes(UTF_8));\n final ByteArrayOutputStream output = new ByteArrayOutputStream();\n\n final Set<RecentPresentation> presentations = ContextFileWorker.purgeRecentPresentations(input, output, numberOfRecentPresentationsToKeep);\n assertEquals(3, presentations.size());\n\n final Iterator<RecentPresentation> iterator = presentations.iterator();\n RecentPresentation recentPresentation = iterator.next();\n assertNotNull(recentPresentation);\n assertEquals(recentPresentation1.getId(), recentPresentation.getId());\n\n recentPresentation = iterator.next();\n assertNotNull(recentPresentation);\n assertEquals(recentPresentation2.getId(), recentPresentation.getId());\n\n recentPresentation = iterator.next();\n assertNotNull(recentPresentation);\n assertEquals(recentPresentation3.getId(), recentPresentation.getId());\n }",
"class_method_signature": "ContextFileWorkerTest.purgeRecentPresentationsWhenLessThanSpecified()",
"constructor": false,
"full_signature": "@Test public void purgeRecentPresentationsWhenLessThanSpecified()",
"identifier": "purgeRecentPresentationsWhenLessThanSpecified",
"invocations": [
"now",
"plusDays",
"getOpenedDateTime",
"plusDays",
"getOpenedDateTime",
"createXmlStringFromRecentPresentations",
"getBytes",
"purgeRecentPresentations",
"assertEquals",
"size",
"iterator",
"next",
"assertNotNull",
"assertEquals",
"getId",
"getId",
"next",
"assertNotNull",
"assertEquals",
"getId",
"getId",
"next",
"assertNotNull",
"assertEquals",
"getId",
"getId"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void purgeRecentPresentationsWhenLessThanSpecified()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep) throws ContextFileException {\n checkContextFileValidity(contextFile);\n if (numberOfRecentPresentationsToKeep < 0)\n throw new IllegalArgumentException(\"The number of recent presentations to keep can not be negative\");\n\n\n try (final InputStream input = getInputStreamForFile(contextFile);\n final OutputStream output = new FileOutputStream(contextFile)) {\n return purgeRecentPresentations(input, output, numberOfRecentPresentationsToKeep);\n } catch (IOException e) {\n throw new ContextFileException(e);\n }\n }",
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"invocations": [
"checkContextFileValidity",
"getInputStreamForFile",
"purgeRecentPresentations"
],
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_156 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static AsciidoctorMarkup markup;",
"type": "AsciidoctorMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-asciidoctor/src/test/java/com/twasyl/slideshowfx/markup/asciidoctor/AsciidoctorMarkupTest.java",
"identifier": "AsciidoctorMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void generateH1() {\n final String result = markup.convertAsHtml(\"= A title\");\n\n assertEquals(\"<h1>A title</h1>\", result);\n }",
"class_method_signature": "AsciidoctorMarkupTest.generateH1()",
"constructor": false,
"full_signature": "@Test public void generateH1()",
"identifier": "generateH1",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateH1()",
"testcase": true
} | {
"fields": [
{
"declarator": "asciidoctor",
"modifier": "private final",
"original_string": "private final Asciidoctor asciidoctor;",
"type": "Asciidoctor",
"var_name": "asciidoctor"
}
],
"file": "slideshowfx-asciidoctor/src/main/java/com/twasyl/slideshowfx/markup/asciidoctor/AsciidoctorMarkup.java",
"identifier": "AsciidoctorMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "AsciidoctorMarkup.AsciidoctorMarkup()",
"constructor": true,
"full_signature": "public AsciidoctorMarkup()",
"identifier": "AsciidoctorMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " AsciidoctorMarkup()",
"testcase": false
},
{
"class_method_signature": "AsciidoctorMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n final AttributesBuilder attributes = AttributesBuilder.attributes()\n .sectionNumbers(false)\n .noFooter(true)\n .tableOfContents(false)\n .showTitle(false)\n .skipFrontMatter(true)\n .attribute(\"sectids!\", \"\");\n final OptionsBuilder options = OptionsBuilder.options()\n .compact(true)\n .backend(\"html5\")\n .attributes(attributes);\n\n return this.asciidoctor.convert(markupString, options).trim();\n }",
"class_method_signature": "AsciidoctorMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName",
"attribute",
"skipFrontMatter",
"showTitle",
"tableOfContents",
"noFooter",
"sectionNumbers",
"attributes",
"attributes",
"backend",
"compact",
"options",
"trim",
"convert"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_140 | {
"fields": [
{
"declarator": "snippetExecutor = new ScalaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final ScalaSnippetExecutor snippetExecutor = new ScalaSnippetExecutor();",
"type": "ScalaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-scala-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/scala/ScalaSnippetExecutorTest.java",
"identifier": "ScalaSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hasNoImports() {\n final CodeSnippet snippet = new CodeSnippet();\n\n assertFalse(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "ScalaSnippetExecutorTest.hasNoImports()",
"constructor": false,
"full_signature": "@Test public void hasNoImports()",
"identifier": "hasNoImports",
"invocations": [
"assertFalse",
"hasImports"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void hasNoImports()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "SCALA_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String SCALA_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "SCALA_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
}
],
"file": "slideshowfx-scala-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/scala/ScalaSnippetExecutor.java",
"identifier": "ScalaSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ScalaSnippetExecutor.ScalaSnippetExecutor()",
"constructor": true,
"full_signature": "public ScalaSnippetExecutor()",
"identifier": "ScalaSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " ScalaSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<ScalaSnippetExecutorOptions>"
} | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "ScalaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_117 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static HtmlMarkup markup;",
"type": "HtmlMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-html/src/test/java/com/twasyl/slideshowfx/markup/html/HtmlMarkupTest.java",
"identifier": "HtmlMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void generateH2() {\n final String result = markup.convertAsHtml(\"<h2>A title</h2>\");\n\n assertEquals(\"<h2>A title</h2>\", result);\n }",
"class_method_signature": "HtmlMarkupTest.generateH2()",
"constructor": false,
"full_signature": "@Test public void generateH2()",
"identifier": "generateH2",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateH2()",
"testcase": true
} | {
"fields": [],
"file": "slideshowfx-html/src/main/java/com/twasyl/slideshowfx/markup/html/HtmlMarkup.java",
"identifier": "HtmlMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "HtmlMarkup.HtmlMarkup()",
"constructor": true,
"full_signature": "public HtmlMarkup()",
"identifier": "HtmlMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " HtmlMarkup()",
"testcase": false
},
{
"class_method_signature": "HtmlMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n return markupString;\n }",
"class_method_signature": "HtmlMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_5 | {
"fields": [
{
"declarator": "TMP_DIR = new File(\"build/tmp\")",
"modifier": "private static final",
"original_string": "private static final File TMP_DIR = new File(\"build/tmp\");",
"type": "File",
"var_name": "TMP_DIR"
},
{
"declarator": "PLUGIN_FILE",
"modifier": "private static",
"original_string": "private static PluginFile PLUGIN_FILE;",
"type": "PluginFile",
"var_name": "PLUGIN_FILE"
}
],
"file": "slideshowfx-plugin-manager/src/test/java/com/twasyl/slideshowfx/plugin/manager/internal/PluginClassLoaderTest.java",
"identifier": "PluginClassLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testGetResource() throws IOException, ClassNotFoundException {\n final PluginClassLoader pluginClassLoader = PluginClassLoader.newInstance(PLUGIN_FILE);\n\n final Class<?> clazz = pluginClassLoader.loadClass(\"com.twasyl.slideshowfx.dummy.plugin.Dummy\");\n final URL resource = clazz.getResource(\"/com/twasyl/slideshowfx/dummy/plugin/Application.fxml\");\n assertNotNull(resource);\n }",
"class_method_signature": "PluginClassLoaderTest.testGetResource()",
"constructor": false,
"full_signature": "@Test void testGetResource()",
"identifier": "testGetResource",
"invocations": [
"newInstance",
"loadClass",
"getResource",
"assertNotNull"
],
"modifiers": "@Test",
"parameters": "()",
"return": "void",
"signature": "void testGetResource()",
"testcase": true
} | {
"fields": [],
"file": "slideshowfx-plugin-manager/src/main/java/com/twasyl/slideshowfx/plugin/manager/internal/PluginClassLoader.java",
"identifier": "PluginClassLoader",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginClassLoader.PluginClassLoader(URL[] urls)",
"constructor": true,
"full_signature": "private PluginClassLoader(URL[] urls)",
"identifier": "PluginClassLoader",
"modifiers": "private",
"parameters": "(URL[] urls)",
"return": "",
"signature": " PluginClassLoader(URL[] urls)",
"testcase": false
},
{
"class_method_signature": "PluginClassLoader.newInstance(final PluginFile file)",
"constructor": false,
"full_signature": "public static PluginClassLoader newInstance(final PluginFile file)",
"identifier": "newInstance",
"modifiers": "public static",
"parameters": "(final PluginFile file)",
"return": "PluginClassLoader",
"signature": "PluginClassLoader newInstance(final PluginFile file)",
"testcase": false
},
{
"class_method_signature": "PluginClassLoader.onlyFiles()",
"constructor": false,
"full_signature": "private static Predicate<ZipEntry> onlyFiles()",
"identifier": "onlyFiles",
"modifiers": "private static",
"parameters": "()",
"return": "Predicate<ZipEntry>",
"signature": "Predicate<ZipEntry> onlyFiles()",
"testcase": false
},
{
"class_method_signature": "PluginClassLoader.entryToUrl(final PluginFile file, final ZipEntry entry)",
"constructor": false,
"full_signature": "private static URL entryToUrl(final PluginFile file, final ZipEntry entry)",
"identifier": "entryToUrl",
"modifiers": "private static",
"parameters": "(final PluginFile file, final ZipEntry entry)",
"return": "URL",
"signature": "URL entryToUrl(final PluginFile file, final ZipEntry entry)",
"testcase": false
},
{
"class_method_signature": "PluginClassLoader.fileToUrl(final File file)",
"constructor": false,
"full_signature": "private static URL fileToUrl(final File file)",
"identifier": "fileToUrl",
"modifiers": "private static",
"parameters": "(final File file)",
"return": "URL",
"signature": "URL fileToUrl(final File file)",
"testcase": false
}
],
"superclass": "extends URLClassLoader"
} | {
"body": "public static PluginClassLoader newInstance(final PluginFile file) throws IOException {\n if (file == null) throw new NullPointerException(\"The plugin can not be null\");\n\n try (final ZipFile zipFile = new ZipFile(file)) {\n final URL[] urls = zipFile.stream()\n .filter(onlyFiles())\n .map(entry -> entryToUrl(file, entry))\n .filter(Objects::nonNull)\n .collect(Collectors.toList())\n .toArray(new URL[0]);\n\n return new PluginClassLoader(urls);\n }\n }",
"class_method_signature": "PluginClassLoader.newInstance(final PluginFile file)",
"constructor": false,
"full_signature": "public static PluginClassLoader newInstance(final PluginFile file)",
"identifier": "newInstance",
"invocations": [
"toArray",
"collect",
"filter",
"map",
"filter",
"stream",
"onlyFiles",
"entryToUrl",
"toList"
],
"modifiers": "public static",
"parameters": "(final PluginFile file)",
"return": "PluginClassLoader",
"signature": "PluginClassLoader newInstance(final PluginFile file)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_93 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void populateDocumentWhenNoRecentPresentationsTag() throws Exception {\n final String xml = \"<slideshowfx></slideshowfx>\";\n final Document document = createDocumentFromString(xml);\n\n ContextFileWorker.populateDocumentIfNecessary(document);\n\n final XPathFactory xPathFactory = XPathFactory.newInstance();\n final XPath xPath = xPathFactory.newXPath();\n\n final Node recentPresentationsNode = (Node) xPath.evaluate(\"/\" + ROOT_TAG + \"/\" + RECENT_PRESENTATIONS_TAG, document.getDocumentElement(), NODE);\n assertNotNull(recentPresentationsNode);\n }",
"class_method_signature": "ContextFileWorkerTest.populateDocumentWhenNoRecentPresentationsTag()",
"constructor": false,
"full_signature": "@Test public void populateDocumentWhenNoRecentPresentationsTag()",
"identifier": "populateDocumentWhenNoRecentPresentationsTag",
"invocations": [
"createDocumentFromString",
"populateDocumentIfNecessary",
"newInstance",
"newXPath",
"evaluate",
"getDocumentElement",
"assertNotNull"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void populateDocumentWhenNoRecentPresentationsTag()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected static void populateDocumentIfNecessary(final Document document) {\n Element root = document.getDocumentElement();\n if (root == null) {\n root = document.createElement(ROOT_TAG);\n document.appendChild(root);\n }\n\n try {\n final String expression = \"/\" + ROOT_TAG + \"/\" + RECENT_PRESENTATIONS_TAG + \"[1]\";\n Node recentPresentationsNode = (Node) xpath().evaluate(expression, root, NODE);\n\n if (recentPresentationsNode == null) {\n recentPresentationsNode = document.createElement(RECENT_PRESENTATIONS_TAG);\n root.appendChild(recentPresentationsNode);\n }\n } catch (XPathExpressionException e) {\n LOGGER.log(Level.WARNING, \"Can not parse the document properly\", e);\n }\n }",
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"invocations": [
"getDocumentElement",
"createElement",
"appendChild",
"evaluate",
"xpath",
"createElement",
"appendChild",
"log"
],
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_160 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static AsciidoctorMarkup markup;",
"type": "AsciidoctorMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-asciidoctor/src/test/java/com/twasyl/slideshowfx/markup/asciidoctor/AsciidoctorMarkupTest.java",
"identifier": "AsciidoctorMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void generateStrong() {\n final String result = markup.convertAsHtml(\"*Strong text*\");\n\n assertEquals(\"<strong>Strong text</strong>\", result);\n }",
"class_method_signature": "AsciidoctorMarkupTest.generateStrong()",
"constructor": false,
"full_signature": "@Test public void generateStrong()",
"identifier": "generateStrong",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateStrong()",
"testcase": true
} | {
"fields": [
{
"declarator": "asciidoctor",
"modifier": "private final",
"original_string": "private final Asciidoctor asciidoctor;",
"type": "Asciidoctor",
"var_name": "asciidoctor"
}
],
"file": "slideshowfx-asciidoctor/src/main/java/com/twasyl/slideshowfx/markup/asciidoctor/AsciidoctorMarkup.java",
"identifier": "AsciidoctorMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "AsciidoctorMarkup.AsciidoctorMarkup()",
"constructor": true,
"full_signature": "public AsciidoctorMarkup()",
"identifier": "AsciidoctorMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " AsciidoctorMarkup()",
"testcase": false
},
{
"class_method_signature": "AsciidoctorMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n final AttributesBuilder attributes = AttributesBuilder.attributes()\n .sectionNumbers(false)\n .noFooter(true)\n .tableOfContents(false)\n .showTitle(false)\n .skipFrontMatter(true)\n .attribute(\"sectids!\", \"\");\n final OptionsBuilder options = OptionsBuilder.options()\n .compact(true)\n .backend(\"html5\")\n .attributes(attributes);\n\n return this.asciidoctor.convert(markupString, options).trim();\n }",
"class_method_signature": "AsciidoctorMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName",
"attribute",
"skipFrontMatter",
"showTitle",
"tableOfContents",
"noFooter",
"sectionNumbers",
"attributes",
"attributes",
"backend",
"compact",
"options",
"trim",
"convert"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_137 | {
"fields": [
{
"declarator": "snippetExecutor = new ScalaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final ScalaSnippetExecutor snippetExecutor = new ScalaSnippetExecutor();",
"type": "ScalaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-scala-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/scala/ScalaSnippetExecutorTest.java",
"identifier": "ScalaSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void noClassName() {\n final CodeSnippet snippet = new CodeSnippet();\n\n assertEquals(\"Snippet\", snippetExecutor.determineClassName(snippet));\n }",
"class_method_signature": "ScalaSnippetExecutorTest.noClassName()",
"constructor": false,
"full_signature": "@Test public void noClassName()",
"identifier": "noClassName",
"invocations": [
"assertEquals",
"determineClassName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void noClassName()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "SCALA_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String SCALA_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "SCALA_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
}
],
"file": "slideshowfx-scala-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/scala/ScalaSnippetExecutor.java",
"identifier": "ScalaSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ScalaSnippetExecutor.ScalaSnippetExecutor()",
"constructor": true,
"full_signature": "public ScalaSnippetExecutor()",
"identifier": "ScalaSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " ScalaSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<ScalaSnippetExecutorOptions>"
} | {
"body": "protected String determineClassName(final CodeSnippet codeSnippet) {\n String className = codeSnippet.getProperties().get(CLASS_NAME_PROPERTY);\n if (className == null || className.isEmpty()) className = \"Snippet\";\n return className;\n }",
"class_method_signature": "ScalaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_208 | {
"fields": [],
"file": "slideshowfx-utils/src/test/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombinationTest.java",
"identifier": "SlideshowFXKeyCombinationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShortcutA() {\n final SlideshowFXKeyCombination combination = SlideshowFXKeyCombination.valueOf(\"Shortcut+A\");\n assertCombination(UP, UP, UP, UP, DOWN, \"A\", combination);\n }",
"class_method_signature": "SlideshowFXKeyCombinationTest.testShortcutA()",
"constructor": false,
"full_signature": "@Test public void testShortcutA()",
"identifier": "testShortcutA",
"invocations": [
"valueOf",
"assertCombination"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testShortcutA()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName())",
"modifier": "public static final",
"original_string": "public static final Logger LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "text",
"modifier": "private final",
"original_string": "private final String text;",
"type": "String",
"var_name": "text"
},
{
"declarator": "code",
"modifier": "private final",
"original_string": "private final KeyCode code;",
"type": "KeyCode",
"var_name": "code"
}
],
"file": "slideshowfx-utils/src/main/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombination.java",
"identifier": "SlideshowFXKeyCombination",
"interfaces": "",
"methods": [
{
"class_method_signature": "SlideshowFXKeyCombination.SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"constructor": true,
"full_signature": "public SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"identifier": "SlideshowFXKeyCombination",
"modifiers": "public",
"parameters": "(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"return": "",
"signature": " SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getText()",
"constructor": false,
"full_signature": "public String getText()",
"identifier": "getText",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getDisplayText()",
"constructor": false,
"full_signature": "@Override public String getDisplayText()",
"identifier": "getDisplayText",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getDisplayText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.match(KeyEvent event)",
"constructor": false,
"full_signature": "@Override public boolean match(KeyEvent event)",
"identifier": "match",
"modifiers": "@Override public",
"parameters": "(KeyEvent event)",
"return": "boolean",
"signature": "boolean match(KeyEvent event)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.equals(final Object obj)",
"constructor": false,
"full_signature": "@Override public boolean equals(final Object obj)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(final Object obj)",
"return": "boolean",
"signature": "boolean equals(final Object obj)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
}
],
"superclass": "extends KeyCombination"
} | {
"body": "public static SlideshowFXKeyCombination valueOf(String value) {\n if (value == null) throw new NullPointerException(\"The value can not be null\");\n if (value.isEmpty()) throw new IllegalArgumentException(\"The value can not be empty\");\n\n String determinedText = null;\n KeyCode determinedCode = KeyCode.UNDEFINED;\n\n ModifierValue shiftModifier = ModifierValue.UP;\n ModifierValue controlModifier = ModifierValue.UP;\n ModifierValue shortcutModifier = ModifierValue.UP;\n ModifierValue metaModifier = ModifierValue.UP;\n ModifierValue altModifier = ModifierValue.UP;\n\n final String[] tokens = value.split(\"\\\\+\");\n for (String token : tokens) {\n switch (token) {\n case \"Shortcut\":\n shortcutModifier = ModifierValue.DOWN;\n break;\n case \"Ctrl\":\n controlModifier = ModifierValue.DOWN;\n break;\n case \"Shift\":\n shiftModifier = ModifierValue.DOWN;\n break;\n case \"Meta\":\n metaModifier = ModifierValue.DOWN;\n break;\n case \"Alt\":\n altModifier = ModifierValue.DOWN;\n break;\n default:\n determinedText = token;\n determinedCode = KeyCode.valueOf(determinedText);\n }\n }\n final SlideshowFXKeyCombination combination = new SlideshowFXKeyCombination(determinedText, determinedCode, shiftModifier,\n controlModifier, altModifier, metaModifier, shortcutModifier);\n\n return combination;\n }",
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"invocations": [
"isEmpty",
"split",
"valueOf"
],
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_121 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static HtmlMarkup markup;",
"type": "HtmlMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-html/src/test/java/com/twasyl/slideshowfx/markup/html/HtmlMarkupTest.java",
"identifier": "HtmlMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void generateUnorderedList() {\n final String result = markup.convertAsHtml(\"<ul><li>One</li><li>Two</li></ul>\");\n\n assertEquals(\"<ul><li>One</li><li>Two</li></ul>\", result);\n }",
"class_method_signature": "HtmlMarkupTest.generateUnorderedList()",
"constructor": false,
"full_signature": "@Test public void generateUnorderedList()",
"identifier": "generateUnorderedList",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateUnorderedList()",
"testcase": true
} | {
"fields": [],
"file": "slideshowfx-html/src/main/java/com/twasyl/slideshowfx/markup/html/HtmlMarkup.java",
"identifier": "HtmlMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "HtmlMarkup.HtmlMarkup()",
"constructor": true,
"full_signature": "public HtmlMarkup()",
"identifier": "HtmlMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " HtmlMarkup()",
"testcase": false
},
{
"class_method_signature": "HtmlMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n return markupString;\n }",
"class_method_signature": "HtmlMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_199 | {
"fields": [
{
"declarator": "snippetExecutor = new GoSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoSnippetExecutor snippetExecutor = new GoSnippetExecutor();",
"type": "GoSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-go-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutorTest.java",
"identifier": "GoSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void buildSourceCodeWithoutWrapInMain() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(PACKAGE_NAME_PROPERTY, \"sfx\");\n snippet.getProperties().put(IMPORTS_PROPERTY, \"mypackage\\nmysecondpackage\");\n\n snippet.setCode(\"func main() {\\n\\tfmt.Printf(\\\"Hello, world.\\\\n\\\")\\n}\");\n\n final String expected = IOUtils.read(GoSnippetExecutor.class.getResourceAsStream(\"/com/twasyl/slideshowfx/snippet/executor/go/buildSourceCodeWithoutWrapInMain_expected.txt\"));\n assertEquals(expected, snippetExecutor.buildSourceCode(snippet));\n }",
"class_method_signature": "GoSnippetExecutorTest.buildSourceCodeWithoutWrapInMain()",
"constructor": false,
"full_signature": "@Test public void buildSourceCodeWithoutWrapInMain()",
"identifier": "buildSourceCodeWithoutWrapInMain",
"invocations": [
"put",
"getProperties",
"put",
"getProperties",
"setCode",
"read",
"getResourceAsStream",
"assertEquals",
"buildSourceCode"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void buildSourceCodeWithoutWrapInMain()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GO_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String GO_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GO_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "PACKAGE_NAME_PROPERTY = \"package\"",
"modifier": "protected static final",
"original_string": "protected static final String PACKAGE_NAME_PROPERTY = \"package\";",
"type": "String",
"var_name": "PACKAGE_NAME_PROPERTY"
}
],
"file": "slideshowfx-go-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutor.java",
"identifier": "GoSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GoSnippetExecutor.GoSnippetExecutor()",
"constructor": true,
"full_signature": "public GoSnippetExecutor()",
"identifier": "GoSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GoSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getStartPackageDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartPackageDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.determinePackageName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determinePackageName(final CodeSnippet codeSnippet)",
"identifier": "determinePackageName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determinePackageName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GoSnippetExecutorOptions>"
} | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n sourceCode.append(getStartPackageDefinition(codeSnippet)).append(\"\\n\\n\");\n\n if (hasImports(codeSnippet)) {\n sourceCode.append(getImports(codeSnippet)).append(\"\\n\\n\");\n }\n\n if (mustBeWrappedIn(codeSnippet, WRAP_IN_MAIN_PROPERTY)) {\n sourceCode.append(\"func main() {\\n\")\n .append(codeSnippet.getCode())\n .append(\"\\n}\");\n } else {\n sourceCode.append(codeSnippet.getCode());\n }\n\n return sourceCode.toString();\n }",
"class_method_signature": "GoSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"invocations": [
"append",
"append",
"getStartPackageDefinition",
"hasImports",
"append",
"append",
"getImports",
"mustBeWrappedIn",
"append",
"append",
"append",
"getCode",
"append",
"getCode",
"toString"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_85 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void tryToGetRecentPresentationsNodeWhenMissing() throws Exception {\n final String xml = \"<slideshowfx></slideshowfx>\";\n final Document document = createDocumentFromString(xml);\n\n final Node recentPresentationsNode = ContextFileWorker.getRecentPresentationsNode(document);\n\n assertNotNull(recentPresentationsNode);\n assertEquals(RECENT_PRESENTATIONS_TAG, recentPresentationsNode.getNodeName());\n }",
"class_method_signature": "ContextFileWorkerTest.tryToGetRecentPresentationsNodeWhenMissing()",
"constructor": false,
"full_signature": "@Test public void tryToGetRecentPresentationsNodeWhenMissing()",
"identifier": "tryToGetRecentPresentationsNodeWhenMissing",
"invocations": [
"createDocumentFromString",
"getRecentPresentationsNode",
"assertNotNull",
"assertEquals",
"getNodeName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void tryToGetRecentPresentationsNodeWhenMissing()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected static Node getRecentPresentationsNode(final Document document) {\n Node recentPresentationsNode;\n\n final NodeList list = document.getElementsByTagName(RECENT_PRESENTATIONS_TAG);\n if (list != null && list.getLength() > 0) {\n recentPresentationsNode = list.item(0);\n } else {\n recentPresentationsNode = document.createElement(RECENT_PRESENTATIONS_TAG);\n getRootNode(document).appendChild(recentPresentationsNode);\n }\n\n return recentPresentationsNode;\n }",
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"invocations": [
"getElementsByTagName",
"getLength",
"item",
"createElement",
"appendChild",
"getRootNode"
],
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_176 | {
"fields": [],
"file": "slideshowfx-ui-controls/src/test/java/com/twasyl/slideshowfx/ui/controls/validators/ValidatorsTest.java",
"identifier": "ValidatorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isIntegerWithOnlySpaces() {\n assertFalse(isInteger().isValid(\" \"));\n }",
"class_method_signature": "ValidatorsTest.isIntegerWithOnlySpaces()",
"constructor": false,
"full_signature": "@Test public void isIntegerWithOnlySpaces()",
"identifier": "isIntegerWithOnlySpaces",
"invocations": [
"assertFalse",
"isValid",
"isInteger"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void isIntegerWithOnlySpaces()",
"testcase": true
} | {
"fields": [],
"file": "slideshowfx-ui-controls/src/main/java/com/twasyl/slideshowfx/ui/controls/validators/Validators.java",
"identifier": "Validators",
"interfaces": "",
"methods": [
{
"class_method_signature": "Validators.isNotEmpty()",
"constructor": false,
"full_signature": "public static IValidator<String> isNotEmpty()",
"identifier": "isNotEmpty",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isNotEmpty()",
"testcase": false
},
{
"class_method_signature": "Validators.isInteger()",
"constructor": false,
"full_signature": "public static IValidator<String> isInteger()",
"identifier": "isInteger",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isInteger()",
"testcase": false
},
{
"class_method_signature": "Validators.isIntegerOrBlank()",
"constructor": false,
"full_signature": "public static IValidator<String> isIntegerOrBlank()",
"identifier": "isIntegerOrBlank",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isIntegerOrBlank()",
"testcase": false
},
{
"class_method_signature": "Validators.isDouble()",
"constructor": false,
"full_signature": "public static IValidator<String> isDouble()",
"identifier": "isDouble",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isDouble()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static IValidator<String> isInteger() {\n return value -> {\n try {\n Integer.parseInt(value);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n };\n }",
"class_method_signature": "Validators.isInteger()",
"constructor": false,
"full_signature": "public static IValidator<String> isInteger()",
"identifier": "isInteger",
"invocations": [
"parseInt"
],
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isInteger()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_11 | {
"fields": [
{
"declarator": "TMP_DIR = new File(\"build/tmp\")",
"modifier": "private static final",
"original_string": "private static final File TMP_DIR = new File(\"build/tmp\");",
"type": "File",
"var_name": "TMP_DIR"
}
],
"file": "slideshowfx-plugin-manager/src/test/java/com/twasyl/slideshowfx/plugin/manager/PluginManagerTest.java",
"identifier": "PluginManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void uninstallPlugin() throws IOException {\n final File plugin01 = createDummyPlugin(\"plugin-01\", \"Plugin 01\", \"1.0\");\n final File plugin02 = createDummyPlugin(\"plugin-02\", \"Plugin 02\", \"1.0\");\n\n PluginManager.getInstance().installPlugin(plugin02);\n PluginManager.getInstance().installPlugin(plugin01);\n PluginManager.getInstance().uninstallPlugin(new PluginFile(plugin01));\n\n final List<RegisteredPlugin> plugins = PluginManager.getInstance().getPlugins(IPlugin.class);\n assertAll(\n () -> assertNotNull(plugins),\n () -> assertEquals(1, plugins.size()),\n () -> assertEquals(\"1.0\", plugins.get(0).getVersion()),\n () -> assertEquals(\"Plugin 02\", plugins.get(0).getName())\n );\n }",
"class_method_signature": "PluginManagerTest.uninstallPlugin()",
"constructor": false,
"full_signature": "@Test public void uninstallPlugin()",
"identifier": "uninstallPlugin",
"invocations": [
"createDummyPlugin",
"createDummyPlugin",
"installPlugin",
"getInstance",
"installPlugin",
"getInstance",
"uninstallPlugin",
"getInstance",
"getPlugins",
"getInstance",
"assertAll",
"assertNotNull",
"assertEquals",
"size",
"assertEquals",
"getVersion",
"get",
"assertEquals",
"getName",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void uninstallPlugin()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(PluginManager.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(PluginManager.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "singleton = null",
"modifier": "private static",
"original_string": "private static PluginManager singleton = null;",
"type": "PluginManager",
"var_name": "singleton"
},
{
"declarator": "PRESENTATION_FOLDER = \"presentation.folder\"",
"modifier": "public static final",
"original_string": "public static final String PRESENTATION_FOLDER = \"presentation.folder\";",
"type": "String",
"var_name": "PRESENTATION_FOLDER"
},
{
"declarator": "PRESENTATION_RESOURCES_FOLDER = \"presentation.resources.folder\"",
"modifier": "public static final",
"original_string": "public static final String PRESENTATION_RESOURCES_FOLDER = \"presentation.resources.folder\";",
"type": "String",
"var_name": "PRESENTATION_RESOURCES_FOLDER"
},
{
"declarator": "pluginsDirectory",
"modifier": "protected",
"original_string": "protected File pluginsDirectory;",
"type": "File",
"var_name": "pluginsDirectory"
},
{
"declarator": "loadedPlugins = new HashSet<>()",
"modifier": "protected",
"original_string": "protected Set<RegisteredPlugin> loadedPlugins = new HashSet<>();",
"type": "Set<RegisteredPlugin>",
"var_name": "loadedPlugins"
}
],
"file": "slideshowfx-plugin-manager/src/main/java/com/twasyl/slideshowfx/plugin/manager/PluginManager.java",
"identifier": "PluginManager",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginManager.PluginManager()",
"constructor": true,
"full_signature": "protected PluginManager()",
"identifier": "PluginManager",
"modifiers": "protected",
"parameters": "()",
"return": "",
"signature": " PluginManager()",
"testcase": false
},
{
"class_method_signature": "PluginManager.getInstance()",
"constructor": false,
"full_signature": "public static synchronized PluginManager getInstance()",
"identifier": "getInstance",
"modifiers": "public static synchronized",
"parameters": "()",
"return": "PluginManager",
"signature": "PluginManager getInstance()",
"testcase": false
},
{
"class_method_signature": "PluginManager.start()",
"constructor": false,
"full_signature": "public void start()",
"identifier": "start",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void start()",
"testcase": false
},
{
"class_method_signature": "PluginManager.listMostRecentPluginFiles()",
"constructor": false,
"full_signature": "protected Collection<File> listMostRecentPluginFiles()",
"identifier": "listMostRecentPluginFiles",
"modifiers": "protected",
"parameters": "()",
"return": "Collection<File>",
"signature": "Collection<File> listMostRecentPluginFiles()",
"testcase": false
},
{
"class_method_signature": "PluginManager.stop()",
"constructor": false,
"full_signature": "public void stop()",
"identifier": "stop",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void stop()",
"testcase": false
},
{
"class_method_signature": "PluginManager.installPlugin(File file)",
"constructor": false,
"full_signature": "public IPlugin installPlugin(File file)",
"identifier": "installPlugin",
"modifiers": "public",
"parameters": "(File file)",
"return": "IPlugin",
"signature": "IPlugin installPlugin(File file)",
"testcase": false
},
{
"class_method_signature": "PluginManager.startPlugin(RegisteredPlugin plugin)",
"constructor": false,
"full_signature": "protected void startPlugin(RegisteredPlugin plugin)",
"identifier": "startPlugin",
"modifiers": "protected",
"parameters": "(RegisteredPlugin plugin)",
"return": "void",
"signature": "void startPlugin(RegisteredPlugin plugin)",
"testcase": false
},
{
"class_method_signature": "PluginManager.uninstallPlugin(RegisteredPlugin plugin)",
"constructor": false,
"full_signature": "protected void uninstallPlugin(RegisteredPlugin plugin)",
"identifier": "uninstallPlugin",
"modifiers": "protected",
"parameters": "(RegisteredPlugin plugin)",
"return": "void",
"signature": "void uninstallPlugin(RegisteredPlugin plugin)",
"testcase": false
},
{
"class_method_signature": "PluginManager.uninstallPlugin(final PluginFile plugin)",
"constructor": false,
"full_signature": "public void uninstallPlugin(final PluginFile plugin)",
"identifier": "uninstallPlugin",
"modifiers": "public",
"parameters": "(final PluginFile plugin)",
"return": "void",
"signature": "void uninstallPlugin(final PluginFile plugin)",
"testcase": false
},
{
"class_method_signature": "PluginManager.getServices(Class<T> serviceType)",
"constructor": false,
"full_signature": "public List<T> getServices(Class<T> serviceType)",
"identifier": "getServices",
"modifiers": "public",
"parameters": "(Class<T> serviceType)",
"return": "List<T>",
"signature": "List<T> getServices(Class<T> serviceType)",
"testcase": false
},
{
"class_method_signature": "PluginManager.getPlugins(Class<T> pluginType)",
"constructor": false,
"full_signature": "public List<RegisteredPlugin> getPlugins(Class<T> pluginType)",
"identifier": "getPlugins",
"modifiers": "public",
"parameters": "(Class<T> pluginType)",
"return": "List<RegisteredPlugin>",
"signature": "List<RegisteredPlugin> getPlugins(Class<T> pluginType)",
"testcase": false
},
{
"class_method_signature": "PluginManager.getActivePlugins()",
"constructor": false,
"full_signature": "public List<RegisteredPlugin> getActivePlugins()",
"identifier": "getActivePlugins",
"modifiers": "public",
"parameters": "()",
"return": "List<RegisteredPlugin>",
"signature": "List<RegisteredPlugin> getActivePlugins()",
"testcase": false
},
{
"class_method_signature": "PluginManager.getPresentationProperty(String property)",
"constructor": false,
"full_signature": "public Object getPresentationProperty(String property)",
"identifier": "getPresentationProperty",
"modifiers": "public",
"parameters": "(String property)",
"return": "Object",
"signature": "Object getPresentationProperty(String property)",
"testcase": false
},
{
"class_method_signature": "PluginManager.isPluginMostRecent(final RegisteredPlugin plugin)",
"constructor": false,
"full_signature": "protected boolean isPluginMostRecent(final RegisteredPlugin plugin)",
"identifier": "isPluginMostRecent",
"modifiers": "protected",
"parameters": "(final RegisteredPlugin plugin)",
"return": "boolean",
"signature": "boolean isPluginMostRecent(final RegisteredPlugin plugin)",
"testcase": false
},
{
"class_method_signature": "PluginManager.isPluginInAnotherVersionInstalled(final RegisteredPlugin plugin)",
"constructor": false,
"full_signature": "protected boolean isPluginInAnotherVersionInstalled(final RegisteredPlugin plugin)",
"identifier": "isPluginInAnotherVersionInstalled",
"modifiers": "protected",
"parameters": "(final RegisteredPlugin plugin)",
"return": "boolean",
"signature": "boolean isPluginInAnotherVersionInstalled(final RegisteredPlugin plugin)",
"testcase": false
},
{
"class_method_signature": "PluginManager.getPluginInAnotherVersion(final RegisteredPlugin plugin)",
"constructor": false,
"full_signature": "protected RegisteredPlugin getPluginInAnotherVersion(final RegisteredPlugin plugin)",
"identifier": "getPluginInAnotherVersion",
"modifiers": "protected",
"parameters": "(final RegisteredPlugin plugin)",
"return": "RegisteredPlugin",
"signature": "RegisteredPlugin getPluginInAnotherVersion(final RegisteredPlugin plugin)",
"testcase": false
},
{
"class_method_signature": "PluginManager.hasSameName(RegisteredPlugin plugin)",
"constructor": false,
"full_signature": "private Predicate<RegisteredPlugin> hasSameName(RegisteredPlugin plugin)",
"identifier": "hasSameName",
"modifiers": "private",
"parameters": "(RegisteredPlugin plugin)",
"return": "Predicate<RegisteredPlugin>",
"signature": "Predicate<RegisteredPlugin> hasSameName(RegisteredPlugin plugin)",
"testcase": false
},
{
"class_method_signature": "PluginManager.isNotSameVersion(RegisteredPlugin plugin)",
"constructor": false,
"full_signature": "private Predicate<RegisteredPlugin> isNotSameVersion(RegisteredPlugin plugin)",
"identifier": "isNotSameVersion",
"modifiers": "private",
"parameters": "(RegisteredPlugin plugin)",
"return": "Predicate<RegisteredPlugin>",
"signature": "Predicate<RegisteredPlugin> isNotSameVersion(RegisteredPlugin plugin)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected void uninstallPlugin(RegisteredPlugin plugin) {\n this.loadedPlugins.remove(plugin);\n plugin.stop();\n plugin.uninstall();\n }",
"class_method_signature": "PluginManager.uninstallPlugin(RegisteredPlugin plugin)",
"constructor": false,
"full_signature": "protected void uninstallPlugin(RegisteredPlugin plugin)",
"identifier": "uninstallPlugin",
"invocations": [
"remove",
"stop",
"uninstall"
],
"modifiers": "protected",
"parameters": "(RegisteredPlugin plugin)",
"return": "void",
"signature": "void uninstallPlugin(RegisteredPlugin plugin)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_46 | {
"fields": [
{
"declarator": "FILE_LOCATION",
"modifier": "private static",
"original_string": "private static File FILE_LOCATION;",
"type": "File",
"var_name": "FILE_LOCATION"
},
{
"declarator": "MISSING_FILE",
"modifier": "private static",
"original_string": "private static PluginFile MISSING_FILE;",
"type": "PluginFile",
"var_name": "MISSING_FILE"
},
{
"declarator": "EMPTY_FILE",
"modifier": "private static",
"original_string": "private static File EMPTY_FILE;",
"type": "File",
"var_name": "EMPTY_FILE"
},
{
"declarator": "NO_BUNDLE_NAME_FILE",
"modifier": "private static",
"original_string": "private static File NO_BUNDLE_NAME_FILE;",
"type": "File",
"var_name": "NO_BUNDLE_NAME_FILE"
},
{
"declarator": "NO_BUNDLE_VERSION_FILE",
"modifier": "private static",
"original_string": "private static File NO_BUNDLE_VERSION_FILE;",
"type": "File",
"var_name": "NO_BUNDLE_VERSION_FILE"
},
{
"declarator": "NO_BUNDLE_ACTIVATOR_FILE",
"modifier": "private static",
"original_string": "private static File NO_BUNDLE_ACTIVATOR_FILE;",
"type": "File",
"var_name": "NO_BUNDLE_ACTIVATOR_FILE"
},
{
"declarator": "CORRECT_FILE",
"modifier": "private static",
"original_string": "private static File CORRECT_FILE;",
"type": "File",
"var_name": "CORRECT_FILE"
},
{
"declarator": "controller = new PluginCenterController()",
"modifier": "private static final",
"original_string": "private static final PluginCenterController controller = new PluginCenterController();",
"type": "PluginCenterController",
"var_name": "controller"
}
],
"file": "slideshowfx-app/src/test/java/com/twasyl/slideshowfx/controllers/PluginCenterControllerTest.java",
"identifier": "PluginCenterControllerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void fileSeemsInvalidWhenFileNotExists() {\n assertThrows(FileNotFoundException.class, () -> controller.fileSeemsValid(MISSING_FILE));\n }",
"class_method_signature": "PluginCenterControllerTest.fileSeemsInvalidWhenFileNotExists()",
"constructor": false,
"full_signature": "@Test public void fileSeemsInvalidWhenFileNotExists()",
"identifier": "fileSeemsInvalidWhenFileNotExists",
"invocations": [
"assertThrows",
"fileSeemsValid"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void fileSeemsInvalidWhenFileNotExists()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(PluginCenterController.class.getName())",
"modifier": "private static",
"original_string": "private static Logger LOGGER = Logger.getLogger(PluginCenterController.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "plugins",
"modifier": "@FXML\n private",
"original_string": "@FXML\n private TilePane plugins;",
"type": "TilePane",
"var_name": "plugins"
},
{
"declarator": "installPlugin",
"modifier": "@FXML\n private",
"original_string": "@FXML\n private Button installPlugin;",
"type": "Button",
"var_name": "installPlugin"
}
],
"file": "slideshowfx-app/src/main/java/com/twasyl/slideshowfx/controllers/PluginCenterController.java",
"identifier": "PluginCenterController",
"interfaces": "implements Initializable",
"methods": [
{
"class_method_signature": "PluginCenterController.dragFilesOverPluginButton(final DragEvent event)",
"constructor": false,
"full_signature": "@FXML private void dragFilesOverPluginButton(final DragEvent event)",
"identifier": "dragFilesOverPluginButton",
"modifiers": "@FXML private",
"parameters": "(final DragEvent event)",
"return": "void",
"signature": "void dragFilesOverPluginButton(final DragEvent event)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.dropFileOverPluginButton(final DragEvent event)",
"constructor": false,
"full_signature": "@FXML private void dropFileOverPluginButton(final DragEvent event)",
"identifier": "dropFileOverPluginButton",
"modifiers": "@FXML private",
"parameters": "(final DragEvent event)",
"return": "void",
"signature": "void dropFileOverPluginButton(final DragEvent event)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.choosePlugin(final ActionEvent event)",
"constructor": false,
"full_signature": "@FXML private void choosePlugin(final ActionEvent event)",
"identifier": "choosePlugin",
"modifiers": "@FXML private",
"parameters": "(final ActionEvent event)",
"return": "void",
"signature": "void choosePlugin(final ActionEvent event)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.checkChosenPluginFile(final PluginFile pluginFile)",
"constructor": false,
"full_signature": "protected boolean checkChosenPluginFile(final PluginFile pluginFile)",
"identifier": "checkChosenPluginFile",
"modifiers": "protected",
"parameters": "(final PluginFile pluginFile)",
"return": "boolean",
"signature": "boolean checkChosenPluginFile(final PluginFile pluginFile)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.fileSeemsValid(final PluginFile file)",
"constructor": false,
"full_signature": "protected boolean fileSeemsValid(final PluginFile file)",
"identifier": "fileSeemsValid",
"modifiers": "protected",
"parameters": "(final PluginFile file)",
"return": "boolean",
"signature": "boolean fileSeemsValid(final PluginFile file)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.isValueValid(final String value)",
"constructor": false,
"full_signature": "protected boolean isValueValid(final String value)",
"identifier": "isValueValid",
"modifiers": "protected",
"parameters": "(final String value)",
"return": "boolean",
"signature": "boolean isValueValid(final String value)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.populatePluginsView()",
"constructor": false,
"full_signature": "protected void populatePluginsView()",
"identifier": "populatePluginsView",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void populatePluginsView()",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.validatePluginsConfiguration()",
"constructor": false,
"full_signature": "public void validatePluginsConfiguration()",
"identifier": "validatePluginsConfiguration",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void validatePluginsConfiguration()",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.initialize(URL location, ResourceBundle resources)",
"constructor": false,
"full_signature": "@Override public void initialize(URL location, ResourceBundle resources)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(URL location, ResourceBundle resources)",
"return": "void",
"signature": "void initialize(URL location, ResourceBundle resources)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected boolean fileSeemsValid(final PluginFile file) throws FileNotFoundException {\n if (file == null) throw new NullPointerException(\"The file to check can not be null\");\n if (!file.exists()) throw new FileNotFoundException(\"The file to check must exist\");\n\n final RegisteredPlugin plugin = new RegisteredPlugin(file);\n final String name = plugin.getName();\n final String version = plugin.getVersion();\n\n return isValueValid(name) && isValueValid(version);\n }",
"class_method_signature": "PluginCenterController.fileSeemsValid(final PluginFile file)",
"constructor": false,
"full_signature": "protected boolean fileSeemsValid(final PluginFile file)",
"identifier": "fileSeemsValid",
"invocations": [
"exists",
"getName",
"getVersion",
"isValueValid",
"isValueValid"
],
"modifiers": "protected",
"parameters": "(final PluginFile file)",
"return": "boolean",
"signature": "boolean fileSeemsValid(final PluginFile file)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_50 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-groovy-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutorTest.java",
"identifier": "GroovySnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void noClassName() {\n final CodeSnippet snippet = new CodeSnippet();\n\n assertEquals(\"Snippet\", snippetExecutor.determineClassName(snippet));\n }",
"class_method_signature": "GroovySnippetExecutorTest.noClassName()",
"constructor": false,
"full_signature": "@Test public void noClassName()",
"identifier": "noClassName",
"invocations": [
"assertEquals",
"determineClassName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void noClassName()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GROOVY_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String GROOVY_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GROOVY_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\";",
"type": "String",
"var_name": "WRAP_IN_METHOD_RUNNER"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
},
{
"declarator": "MAKE_SCRIPT = \"makeScript\"",
"modifier": "protected static final",
"original_string": "protected static final String MAKE_SCRIPT = \"makeScript\";",
"type": "String",
"var_name": "MAKE_SCRIPT"
}
],
"file": "slideshowfx-groovy-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutor.java",
"identifier": "GroovySnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GroovySnippetExecutor.GroovySnippetExecutor()",
"constructor": true,
"full_signature": "public GroovySnippetExecutor()",
"identifier": "GroovySnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GroovySnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.makeScript(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean makeScript(final CodeSnippet codeSnippet)",
"identifier": "makeScript",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean makeScript(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getScriptImport()",
"constructor": false,
"full_signature": "protected String getScriptImport()",
"identifier": "getScriptImport",
"modifiers": "protected",
"parameters": "()",
"return": "String",
"signature": "String getScriptImport()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartMainMethod(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartMainMethod(final CodeSnippet codeSnippet)",
"identifier": "getStartMainMethod",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartMainMethod(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GroovySnippetExecutorOptions>"
} | {
"body": "protected String determineClassName(final CodeSnippet codeSnippet) {\n String className = codeSnippet.getProperties().get(CLASS_NAME_PROPERTY);\n if (className == null || className.isEmpty()) className = \"Snippet\";\n return className;\n }",
"class_method_signature": "GroovySnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_9 | {
"fields": [],
"file": "slideshowfx-plugin-manager/src/test/java/com/twasyl/slideshowfx/plugin/manager/internal/RegisteredPluginTest.java",
"identifier": "RegisteredPluginTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void pluginIsInstanceOf() throws IOException {\n final File plugin = PluginTestUtils.createDummyPlugin(\"my-plugin\", \"Awesome plugin\", \"1.0\");\n final RegisteredPlugin registeredPlugin = new RegisteredPlugin(new PluginFile(plugin));\n\n assertTrue(registeredPlugin.isInstanceOf(IPlugin.class));\n }",
"class_method_signature": "RegisteredPluginTest.pluginIsInstanceOf()",
"constructor": false,
"full_signature": "@Test void pluginIsInstanceOf()",
"identifier": "pluginIsInstanceOf",
"invocations": [
"createDummyPlugin",
"assertTrue",
"isInstanceOf"
],
"modifiers": "@Test",
"parameters": "()",
"return": "void",
"signature": "void pluginIsInstanceOf()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(RegisteredPlugin.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(RegisteredPlugin.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "file",
"modifier": "private final",
"original_string": "private final PluginFile file;",
"type": "PluginFile",
"var_name": "file"
},
{
"declarator": "name",
"modifier": "private",
"original_string": "private String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private String version;",
"type": "String",
"var_name": "version"
},
{
"declarator": "description",
"modifier": "private",
"original_string": "private String description;",
"type": "String",
"var_name": "description"
},
{
"declarator": "iconName",
"modifier": "private",
"original_string": "private String iconName;",
"type": "String",
"var_name": "iconName"
},
{
"declarator": "instance",
"modifier": "private",
"original_string": "private IPlugin instance;",
"type": "IPlugin",
"var_name": "instance"
},
{
"declarator": "classLoader",
"modifier": "private",
"original_string": "private PluginClassLoader classLoader;",
"type": "PluginClassLoader",
"var_name": "classLoader"
}
],
"file": "slideshowfx-plugin-manager/src/main/java/com/twasyl/slideshowfx/plugin/manager/internal/RegisteredPlugin.java",
"identifier": "RegisteredPlugin",
"interfaces": "implements Comparable<RegisteredPlugin>",
"methods": [
{
"class_method_signature": "RegisteredPlugin.RegisteredPlugin(PluginFile file)",
"constructor": true,
"full_signature": "public RegisteredPlugin(PluginFile file)",
"identifier": "RegisteredPlugin",
"modifiers": "public",
"parameters": "(PluginFile file)",
"return": "",
"signature": " RegisteredPlugin(PluginFile file)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getFile()",
"constructor": false,
"full_signature": "public PluginFile getFile()",
"identifier": "getFile",
"modifiers": "public",
"parameters": "()",
"return": "PluginFile",
"signature": "PluginFile getFile()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getName()",
"constructor": false,
"full_signature": "public String getName()",
"identifier": "getName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getName()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getVersion()",
"constructor": false,
"full_signature": "public String getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getVersion()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getDescription()",
"constructor": false,
"full_signature": "public String getDescription()",
"identifier": "getDescription",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getDescription()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getIconName()",
"constructor": false,
"full_signature": "public String getIconName()",
"identifier": "getIconName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getIconName()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getIcon()",
"constructor": false,
"full_signature": "public byte[] getIcon()",
"identifier": "getIcon",
"modifiers": "public",
"parameters": "()",
"return": "byte[]",
"signature": "byte[] getIcon()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getInstance()",
"constructor": false,
"full_signature": "public IPlugin getInstance()",
"identifier": "getInstance",
"modifiers": "public",
"parameters": "()",
"return": "IPlugin",
"signature": "IPlugin getInstance()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.isInstanceOf(final Class<? extends IPlugin> clazz)",
"constructor": false,
"full_signature": "public boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"identifier": "isInstanceOf",
"modifiers": "public",
"parameters": "(final Class<? extends IPlugin> clazz)",
"return": "boolean",
"signature": "boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.install()",
"constructor": false,
"full_signature": "public boolean install()",
"identifier": "install",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean install()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.uninstall()",
"constructor": false,
"full_signature": "public void uninstall()",
"identifier": "uninstall",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void uninstall()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.isInstalled()",
"constructor": false,
"full_signature": "public boolean isInstalled()",
"identifier": "isInstalled",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isInstalled()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.start()",
"constructor": false,
"full_signature": "public boolean start()",
"identifier": "start",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean start()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.stop()",
"constructor": false,
"full_signature": "public void stop()",
"identifier": "stop",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void stop()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.isStarted()",
"constructor": false,
"full_signature": "public boolean isStarted()",
"identifier": "isStarted",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isStarted()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.compareTo(RegisteredPlugin o)",
"constructor": false,
"full_signature": "@Override public int compareTo(RegisteredPlugin o)",
"identifier": "compareTo",
"modifiers": "@Override public",
"parameters": "(RegisteredPlugin o)",
"return": "int",
"signature": "int compareTo(RegisteredPlugin o)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.equals(Object o)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object o)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(Object o)",
"return": "boolean",
"signature": "boolean equals(Object o)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public boolean isInstanceOf(final Class<? extends IPlugin> clazz) {\n try (final Jar jar = this.file.getJar()) {\n return jar.getEntry(\"META-INF/services/\" + clazz.getName()) != null;\n } catch (IOException e) {\n LOGGER.log(WARNING, \"Can not determine instance of \" + clazz, e);\n return false;\n }\n }",
"class_method_signature": "RegisteredPlugin.isInstanceOf(final Class<? extends IPlugin> clazz)",
"constructor": false,
"full_signature": "public boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"identifier": "isInstanceOf",
"invocations": [
"getJar",
"getEntry",
"getName",
"log"
],
"modifiers": "public",
"parameters": "(final Class<? extends IPlugin> clazz)",
"return": "boolean",
"signature": "boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_8 | {
"fields": [],
"file": "slideshowfx-plugin-manager/src/test/java/com/twasyl/slideshowfx/plugin/manager/internal/RegisteredPluginTest.java",
"identifier": "RegisteredPluginTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void getDescriptionWhenNotUnzipped() throws IOException {\n final File plugin = PluginTestUtils.createDummyPlugin(\"my-plugin\", \"Awesome plugin\", \"1.0\");\n final RegisteredPlugin registeredPlugin = new RegisteredPlugin(new PluginFile(plugin));\n\n final String description = registeredPlugin.getDescription();\n assertTrue(description.startsWith(\"This is a dummy plugin\"), \"Description is: \" + description);\n }",
"class_method_signature": "RegisteredPluginTest.getDescriptionWhenNotUnzipped()",
"constructor": false,
"full_signature": "@Test void getDescriptionWhenNotUnzipped()",
"identifier": "getDescriptionWhenNotUnzipped",
"invocations": [
"createDummyPlugin",
"getDescription",
"assertTrue",
"startsWith"
],
"modifiers": "@Test",
"parameters": "()",
"return": "void",
"signature": "void getDescriptionWhenNotUnzipped()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(RegisteredPlugin.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(RegisteredPlugin.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "file",
"modifier": "private final",
"original_string": "private final PluginFile file;",
"type": "PluginFile",
"var_name": "file"
},
{
"declarator": "name",
"modifier": "private",
"original_string": "private String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private String version;",
"type": "String",
"var_name": "version"
},
{
"declarator": "description",
"modifier": "private",
"original_string": "private String description;",
"type": "String",
"var_name": "description"
},
{
"declarator": "iconName",
"modifier": "private",
"original_string": "private String iconName;",
"type": "String",
"var_name": "iconName"
},
{
"declarator": "instance",
"modifier": "private",
"original_string": "private IPlugin instance;",
"type": "IPlugin",
"var_name": "instance"
},
{
"declarator": "classLoader",
"modifier": "private",
"original_string": "private PluginClassLoader classLoader;",
"type": "PluginClassLoader",
"var_name": "classLoader"
}
],
"file": "slideshowfx-plugin-manager/src/main/java/com/twasyl/slideshowfx/plugin/manager/internal/RegisteredPlugin.java",
"identifier": "RegisteredPlugin",
"interfaces": "implements Comparable<RegisteredPlugin>",
"methods": [
{
"class_method_signature": "RegisteredPlugin.RegisteredPlugin(PluginFile file)",
"constructor": true,
"full_signature": "public RegisteredPlugin(PluginFile file)",
"identifier": "RegisteredPlugin",
"modifiers": "public",
"parameters": "(PluginFile file)",
"return": "",
"signature": " RegisteredPlugin(PluginFile file)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getFile()",
"constructor": false,
"full_signature": "public PluginFile getFile()",
"identifier": "getFile",
"modifiers": "public",
"parameters": "()",
"return": "PluginFile",
"signature": "PluginFile getFile()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getName()",
"constructor": false,
"full_signature": "public String getName()",
"identifier": "getName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getName()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getVersion()",
"constructor": false,
"full_signature": "public String getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getVersion()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getDescription()",
"constructor": false,
"full_signature": "public String getDescription()",
"identifier": "getDescription",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getDescription()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getIconName()",
"constructor": false,
"full_signature": "public String getIconName()",
"identifier": "getIconName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getIconName()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getIcon()",
"constructor": false,
"full_signature": "public byte[] getIcon()",
"identifier": "getIcon",
"modifiers": "public",
"parameters": "()",
"return": "byte[]",
"signature": "byte[] getIcon()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getInstance()",
"constructor": false,
"full_signature": "public IPlugin getInstance()",
"identifier": "getInstance",
"modifiers": "public",
"parameters": "()",
"return": "IPlugin",
"signature": "IPlugin getInstance()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.isInstanceOf(final Class<? extends IPlugin> clazz)",
"constructor": false,
"full_signature": "public boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"identifier": "isInstanceOf",
"modifiers": "public",
"parameters": "(final Class<? extends IPlugin> clazz)",
"return": "boolean",
"signature": "boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.install()",
"constructor": false,
"full_signature": "public boolean install()",
"identifier": "install",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean install()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.uninstall()",
"constructor": false,
"full_signature": "public void uninstall()",
"identifier": "uninstall",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void uninstall()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.isInstalled()",
"constructor": false,
"full_signature": "public boolean isInstalled()",
"identifier": "isInstalled",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isInstalled()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.start()",
"constructor": false,
"full_signature": "public boolean start()",
"identifier": "start",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean start()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.stop()",
"constructor": false,
"full_signature": "public void stop()",
"identifier": "stop",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void stop()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.isStarted()",
"constructor": false,
"full_signature": "public boolean isStarted()",
"identifier": "isStarted",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isStarted()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.compareTo(RegisteredPlugin o)",
"constructor": false,
"full_signature": "@Override public int compareTo(RegisteredPlugin o)",
"identifier": "compareTo",
"modifiers": "@Override public",
"parameters": "(RegisteredPlugin o)",
"return": "int",
"signature": "int compareTo(RegisteredPlugin o)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.equals(Object o)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object o)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(Object o)",
"return": "boolean",
"signature": "boolean equals(Object o)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public String getDescription() {\n if (this.description == null) {\n final String defaultValue = \"\";\n\n try (final Jar jar = this.file.getJar()) {\n if (jar != null) {\n this.description = jar.getManifestAttributeValue(\"Plugin-Description\", defaultValue);\n }\n } catch (IOException e) {\n LOGGER.log(WARNING, \"Error retrieving the description\", e);\n this.description = defaultValue;\n }\n }\n\n return description;\n }",
"class_method_signature": "RegisteredPlugin.getDescription()",
"constructor": false,
"full_signature": "public String getDescription()",
"identifier": "getDescription",
"invocations": [
"getJar",
"getManifestAttributeValue",
"log"
],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getDescription()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_51 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-groovy-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutorTest.java",
"identifier": "GroovySnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void emptyClassName() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"\");\n\n assertEquals(\"Snippet\", snippetExecutor.determineClassName(snippet));\n }",
"class_method_signature": "GroovySnippetExecutorTest.emptyClassName()",
"constructor": false,
"full_signature": "@Test public void emptyClassName()",
"identifier": "emptyClassName",
"invocations": [
"put",
"getProperties",
"assertEquals",
"determineClassName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void emptyClassName()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GROOVY_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String GROOVY_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GROOVY_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\";",
"type": "String",
"var_name": "WRAP_IN_METHOD_RUNNER"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
},
{
"declarator": "MAKE_SCRIPT = \"makeScript\"",
"modifier": "protected static final",
"original_string": "protected static final String MAKE_SCRIPT = \"makeScript\";",
"type": "String",
"var_name": "MAKE_SCRIPT"
}
],
"file": "slideshowfx-groovy-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutor.java",
"identifier": "GroovySnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GroovySnippetExecutor.GroovySnippetExecutor()",
"constructor": true,
"full_signature": "public GroovySnippetExecutor()",
"identifier": "GroovySnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GroovySnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.makeScript(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean makeScript(final CodeSnippet codeSnippet)",
"identifier": "makeScript",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean makeScript(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getScriptImport()",
"constructor": false,
"full_signature": "protected String getScriptImport()",
"identifier": "getScriptImport",
"modifiers": "protected",
"parameters": "()",
"return": "String",
"signature": "String getScriptImport()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartMainMethod(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartMainMethod(final CodeSnippet codeSnippet)",
"identifier": "getStartMainMethod",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartMainMethod(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GroovySnippetExecutorOptions>"
} | {
"body": "protected String determineClassName(final CodeSnippet codeSnippet) {\n String className = codeSnippet.getProperties().get(CLASS_NAME_PROPERTY);\n if (className == null || className.isEmpty()) className = \"Snippet\";\n return className;\n }",
"class_method_signature": "GroovySnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_47 | {
"fields": [
{
"declarator": "FILE_LOCATION",
"modifier": "private static",
"original_string": "private static File FILE_LOCATION;",
"type": "File",
"var_name": "FILE_LOCATION"
},
{
"declarator": "MISSING_FILE",
"modifier": "private static",
"original_string": "private static PluginFile MISSING_FILE;",
"type": "PluginFile",
"var_name": "MISSING_FILE"
},
{
"declarator": "EMPTY_FILE",
"modifier": "private static",
"original_string": "private static File EMPTY_FILE;",
"type": "File",
"var_name": "EMPTY_FILE"
},
{
"declarator": "NO_BUNDLE_NAME_FILE",
"modifier": "private static",
"original_string": "private static File NO_BUNDLE_NAME_FILE;",
"type": "File",
"var_name": "NO_BUNDLE_NAME_FILE"
},
{
"declarator": "NO_BUNDLE_VERSION_FILE",
"modifier": "private static",
"original_string": "private static File NO_BUNDLE_VERSION_FILE;",
"type": "File",
"var_name": "NO_BUNDLE_VERSION_FILE"
},
{
"declarator": "NO_BUNDLE_ACTIVATOR_FILE",
"modifier": "private static",
"original_string": "private static File NO_BUNDLE_ACTIVATOR_FILE;",
"type": "File",
"var_name": "NO_BUNDLE_ACTIVATOR_FILE"
},
{
"declarator": "CORRECT_FILE",
"modifier": "private static",
"original_string": "private static File CORRECT_FILE;",
"type": "File",
"var_name": "CORRECT_FILE"
},
{
"declarator": "controller = new PluginCenterController()",
"modifier": "private static final",
"original_string": "private static final PluginCenterController controller = new PluginCenterController();",
"type": "PluginCenterController",
"var_name": "controller"
}
],
"file": "slideshowfx-app/src/test/java/com/twasyl/slideshowfx/controllers/PluginCenterControllerTest.java",
"identifier": "PluginCenterControllerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isManifestAttributeInvalidWhenNull() {\n assertFalse(controller.isValueValid(null));\n }",
"class_method_signature": "PluginCenterControllerTest.isManifestAttributeInvalidWhenNull()",
"constructor": false,
"full_signature": "@Test public void isManifestAttributeInvalidWhenNull()",
"identifier": "isManifestAttributeInvalidWhenNull",
"invocations": [
"assertFalse",
"isValueValid"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void isManifestAttributeInvalidWhenNull()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(PluginCenterController.class.getName())",
"modifier": "private static",
"original_string": "private static Logger LOGGER = Logger.getLogger(PluginCenterController.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "plugins",
"modifier": "@FXML\n private",
"original_string": "@FXML\n private TilePane plugins;",
"type": "TilePane",
"var_name": "plugins"
},
{
"declarator": "installPlugin",
"modifier": "@FXML\n private",
"original_string": "@FXML\n private Button installPlugin;",
"type": "Button",
"var_name": "installPlugin"
}
],
"file": "slideshowfx-app/src/main/java/com/twasyl/slideshowfx/controllers/PluginCenterController.java",
"identifier": "PluginCenterController",
"interfaces": "implements Initializable",
"methods": [
{
"class_method_signature": "PluginCenterController.dragFilesOverPluginButton(final DragEvent event)",
"constructor": false,
"full_signature": "@FXML private void dragFilesOverPluginButton(final DragEvent event)",
"identifier": "dragFilesOverPluginButton",
"modifiers": "@FXML private",
"parameters": "(final DragEvent event)",
"return": "void",
"signature": "void dragFilesOverPluginButton(final DragEvent event)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.dropFileOverPluginButton(final DragEvent event)",
"constructor": false,
"full_signature": "@FXML private void dropFileOverPluginButton(final DragEvent event)",
"identifier": "dropFileOverPluginButton",
"modifiers": "@FXML private",
"parameters": "(final DragEvent event)",
"return": "void",
"signature": "void dropFileOverPluginButton(final DragEvent event)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.choosePlugin(final ActionEvent event)",
"constructor": false,
"full_signature": "@FXML private void choosePlugin(final ActionEvent event)",
"identifier": "choosePlugin",
"modifiers": "@FXML private",
"parameters": "(final ActionEvent event)",
"return": "void",
"signature": "void choosePlugin(final ActionEvent event)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.checkChosenPluginFile(final PluginFile pluginFile)",
"constructor": false,
"full_signature": "protected boolean checkChosenPluginFile(final PluginFile pluginFile)",
"identifier": "checkChosenPluginFile",
"modifiers": "protected",
"parameters": "(final PluginFile pluginFile)",
"return": "boolean",
"signature": "boolean checkChosenPluginFile(final PluginFile pluginFile)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.fileSeemsValid(final PluginFile file)",
"constructor": false,
"full_signature": "protected boolean fileSeemsValid(final PluginFile file)",
"identifier": "fileSeemsValid",
"modifiers": "protected",
"parameters": "(final PluginFile file)",
"return": "boolean",
"signature": "boolean fileSeemsValid(final PluginFile file)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.isValueValid(final String value)",
"constructor": false,
"full_signature": "protected boolean isValueValid(final String value)",
"identifier": "isValueValid",
"modifiers": "protected",
"parameters": "(final String value)",
"return": "boolean",
"signature": "boolean isValueValid(final String value)",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.populatePluginsView()",
"constructor": false,
"full_signature": "protected void populatePluginsView()",
"identifier": "populatePluginsView",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void populatePluginsView()",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.validatePluginsConfiguration()",
"constructor": false,
"full_signature": "public void validatePluginsConfiguration()",
"identifier": "validatePluginsConfiguration",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void validatePluginsConfiguration()",
"testcase": false
},
{
"class_method_signature": "PluginCenterController.initialize(URL location, ResourceBundle resources)",
"constructor": false,
"full_signature": "@Override public void initialize(URL location, ResourceBundle resources)",
"identifier": "initialize",
"modifiers": "@Override public",
"parameters": "(URL location, ResourceBundle resources)",
"return": "void",
"signature": "void initialize(URL location, ResourceBundle resources)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected boolean isValueValid(final String value) {\n return value != null && !value.trim().isEmpty();\n }",
"class_method_signature": "PluginCenterController.isValueValid(final String value)",
"constructor": false,
"full_signature": "protected boolean isValueValid(final String value)",
"identifier": "isValueValid",
"invocations": [
"isEmpty",
"trim"
],
"modifiers": "protected",
"parameters": "(final String value)",
"return": "boolean",
"signature": "boolean isValueValid(final String value)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_10 | {
"fields": [],
"file": "slideshowfx-plugin-manager/src/test/java/com/twasyl/slideshowfx/plugin/manager/internal/RegisteredPluginTest.java",
"identifier": "RegisteredPluginTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void pluginIsNotInstanceOf() throws IOException {\n final File plugin = PluginTestUtils.createDummyPlugin(\"my-plugin\", \"Awesome plugin\", \"1.0\");\n final RegisteredPlugin registeredPlugin = new RegisteredPlugin(new PluginFile(plugin));\n\n assertFalse(registeredPlugin.isInstanceOf(AbstractPlugin.class));\n }",
"class_method_signature": "RegisteredPluginTest.pluginIsNotInstanceOf()",
"constructor": false,
"full_signature": "@Test void pluginIsNotInstanceOf()",
"identifier": "pluginIsNotInstanceOf",
"invocations": [
"createDummyPlugin",
"assertFalse",
"isInstanceOf"
],
"modifiers": "@Test",
"parameters": "()",
"return": "void",
"signature": "void pluginIsNotInstanceOf()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(RegisteredPlugin.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(RegisteredPlugin.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "file",
"modifier": "private final",
"original_string": "private final PluginFile file;",
"type": "PluginFile",
"var_name": "file"
},
{
"declarator": "name",
"modifier": "private",
"original_string": "private String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private String version;",
"type": "String",
"var_name": "version"
},
{
"declarator": "description",
"modifier": "private",
"original_string": "private String description;",
"type": "String",
"var_name": "description"
},
{
"declarator": "iconName",
"modifier": "private",
"original_string": "private String iconName;",
"type": "String",
"var_name": "iconName"
},
{
"declarator": "instance",
"modifier": "private",
"original_string": "private IPlugin instance;",
"type": "IPlugin",
"var_name": "instance"
},
{
"declarator": "classLoader",
"modifier": "private",
"original_string": "private PluginClassLoader classLoader;",
"type": "PluginClassLoader",
"var_name": "classLoader"
}
],
"file": "slideshowfx-plugin-manager/src/main/java/com/twasyl/slideshowfx/plugin/manager/internal/RegisteredPlugin.java",
"identifier": "RegisteredPlugin",
"interfaces": "implements Comparable<RegisteredPlugin>",
"methods": [
{
"class_method_signature": "RegisteredPlugin.RegisteredPlugin(PluginFile file)",
"constructor": true,
"full_signature": "public RegisteredPlugin(PluginFile file)",
"identifier": "RegisteredPlugin",
"modifiers": "public",
"parameters": "(PluginFile file)",
"return": "",
"signature": " RegisteredPlugin(PluginFile file)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getFile()",
"constructor": false,
"full_signature": "public PluginFile getFile()",
"identifier": "getFile",
"modifiers": "public",
"parameters": "()",
"return": "PluginFile",
"signature": "PluginFile getFile()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getName()",
"constructor": false,
"full_signature": "public String getName()",
"identifier": "getName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getName()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getVersion()",
"constructor": false,
"full_signature": "public String getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getVersion()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getDescription()",
"constructor": false,
"full_signature": "public String getDescription()",
"identifier": "getDescription",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getDescription()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getIconName()",
"constructor": false,
"full_signature": "public String getIconName()",
"identifier": "getIconName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getIconName()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getIcon()",
"constructor": false,
"full_signature": "public byte[] getIcon()",
"identifier": "getIcon",
"modifiers": "public",
"parameters": "()",
"return": "byte[]",
"signature": "byte[] getIcon()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.getInstance()",
"constructor": false,
"full_signature": "public IPlugin getInstance()",
"identifier": "getInstance",
"modifiers": "public",
"parameters": "()",
"return": "IPlugin",
"signature": "IPlugin getInstance()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.isInstanceOf(final Class<? extends IPlugin> clazz)",
"constructor": false,
"full_signature": "public boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"identifier": "isInstanceOf",
"modifiers": "public",
"parameters": "(final Class<? extends IPlugin> clazz)",
"return": "boolean",
"signature": "boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.install()",
"constructor": false,
"full_signature": "public boolean install()",
"identifier": "install",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean install()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.uninstall()",
"constructor": false,
"full_signature": "public void uninstall()",
"identifier": "uninstall",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void uninstall()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.isInstalled()",
"constructor": false,
"full_signature": "public boolean isInstalled()",
"identifier": "isInstalled",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isInstalled()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.start()",
"constructor": false,
"full_signature": "public boolean start()",
"identifier": "start",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean start()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.stop()",
"constructor": false,
"full_signature": "public void stop()",
"identifier": "stop",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void stop()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.isStarted()",
"constructor": false,
"full_signature": "public boolean isStarted()",
"identifier": "isStarted",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isStarted()",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.compareTo(RegisteredPlugin o)",
"constructor": false,
"full_signature": "@Override public int compareTo(RegisteredPlugin o)",
"identifier": "compareTo",
"modifiers": "@Override public",
"parameters": "(RegisteredPlugin o)",
"return": "int",
"signature": "int compareTo(RegisteredPlugin o)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.equals(Object o)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object o)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(Object o)",
"return": "boolean",
"signature": "boolean equals(Object o)",
"testcase": false
},
{
"class_method_signature": "RegisteredPlugin.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public boolean isInstanceOf(final Class<? extends IPlugin> clazz) {\n try (final Jar jar = this.file.getJar()) {\n return jar.getEntry(\"META-INF/services/\" + clazz.getName()) != null;\n } catch (IOException e) {\n LOGGER.log(WARNING, \"Can not determine instance of \" + clazz, e);\n return false;\n }\n }",
"class_method_signature": "RegisteredPlugin.isInstanceOf(final Class<? extends IPlugin> clazz)",
"constructor": false,
"full_signature": "public boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"identifier": "isInstanceOf",
"invocations": [
"getJar",
"getEntry",
"getName",
"log"
],
"modifiers": "public",
"parameters": "(final Class<? extends IPlugin> clazz)",
"return": "boolean",
"signature": "boolean isInstanceOf(final Class<? extends IPlugin> clazz)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_198 | {
"fields": [
{
"declarator": "snippetExecutor = new GoSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoSnippetExecutor snippetExecutor = new GoSnippetExecutor();",
"type": "GoSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-go-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutorTest.java",
"identifier": "GoSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void buildSourceCodeWithoutImportsAndWithoutWrapInMain() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(PACKAGE_NAME_PROPERTY, \"sfx\");\n\n snippet.setCode(\"func main() {\\n\\tfmt.Printf(\\\"Hello, world.\\\\n\\\")\\n}\");\n\n final String expected = IOUtils.read(GoSnippetExecutorTest.class.getResourceAsStream(\"/com/twasyl/slideshowfx/snippet/executor/go/buildSourceCodeWithoutImportsAndWithoutWrapInMain_expected.txt\"));\n assertEquals(expected, snippetExecutor.buildSourceCode(snippet));\n }",
"class_method_signature": "GoSnippetExecutorTest.buildSourceCodeWithoutImportsAndWithoutWrapInMain()",
"constructor": false,
"full_signature": "@Test public void buildSourceCodeWithoutImportsAndWithoutWrapInMain()",
"identifier": "buildSourceCodeWithoutImportsAndWithoutWrapInMain",
"invocations": [
"put",
"getProperties",
"setCode",
"read",
"getResourceAsStream",
"assertEquals",
"buildSourceCode"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void buildSourceCodeWithoutImportsAndWithoutWrapInMain()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GO_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String GO_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GO_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "PACKAGE_NAME_PROPERTY = \"package\"",
"modifier": "protected static final",
"original_string": "protected static final String PACKAGE_NAME_PROPERTY = \"package\";",
"type": "String",
"var_name": "PACKAGE_NAME_PROPERTY"
}
],
"file": "slideshowfx-go-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutor.java",
"identifier": "GoSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GoSnippetExecutor.GoSnippetExecutor()",
"constructor": true,
"full_signature": "public GoSnippetExecutor()",
"identifier": "GoSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GoSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getStartPackageDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartPackageDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.determinePackageName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determinePackageName(final CodeSnippet codeSnippet)",
"identifier": "determinePackageName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determinePackageName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GoSnippetExecutorOptions>"
} | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n sourceCode.append(getStartPackageDefinition(codeSnippet)).append(\"\\n\\n\");\n\n if (hasImports(codeSnippet)) {\n sourceCode.append(getImports(codeSnippet)).append(\"\\n\\n\");\n }\n\n if (mustBeWrappedIn(codeSnippet, WRAP_IN_MAIN_PROPERTY)) {\n sourceCode.append(\"func main() {\\n\")\n .append(codeSnippet.getCode())\n .append(\"\\n}\");\n } else {\n sourceCode.append(codeSnippet.getCode());\n }\n\n return sourceCode.toString();\n }",
"class_method_signature": "GoSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"invocations": [
"append",
"append",
"getStartPackageDefinition",
"hasImports",
"append",
"append",
"getImports",
"mustBeWrappedIn",
"append",
"append",
"append",
"getCode",
"append",
"getCode",
"toString"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_84 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getRecentPresentationsNode() throws Exception {\n final String xml = \"<slideshowfx><recentPresentations></recentPresentations></slideshowfx>\";\n final Document document = createDocumentFromString(xml);\n\n final Node recentPresentationsNode = ContextFileWorker.getRecentPresentationsNode(document);\n\n assertNotNull(recentPresentationsNode);\n assertEquals(RECENT_PRESENTATIONS_TAG, recentPresentationsNode.getNodeName());\n }",
"class_method_signature": "ContextFileWorkerTest.getRecentPresentationsNode()",
"constructor": false,
"full_signature": "@Test public void getRecentPresentationsNode()",
"identifier": "getRecentPresentationsNode",
"invocations": [
"createDocumentFromString",
"getRecentPresentationsNode",
"assertNotNull",
"assertEquals",
"getNodeName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void getRecentPresentationsNode()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected static Node getRecentPresentationsNode(final Document document) {\n Node recentPresentationsNode;\n\n final NodeList list = document.getElementsByTagName(RECENT_PRESENTATIONS_TAG);\n if (list != null && list.getLength() > 0) {\n recentPresentationsNode = list.item(0);\n } else {\n recentPresentationsNode = document.createElement(RECENT_PRESENTATIONS_TAG);\n getRootNode(document).appendChild(recentPresentationsNode);\n }\n\n return recentPresentationsNode;\n }",
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"invocations": [
"getElementsByTagName",
"getLength",
"item",
"createElement",
"appendChild",
"getRootNode"
],
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_177 | {
"fields": [],
"file": "slideshowfx-ui-controls/src/test/java/com/twasyl/slideshowfx/ui/controls/validators/ValidatorsTest.java",
"identifier": "ValidatorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isIntegerWithNumberAndSpace() {\n assertFalse(isInteger().isValid(\"12 \"));\n }",
"class_method_signature": "ValidatorsTest.isIntegerWithNumberAndSpace()",
"constructor": false,
"full_signature": "@Test public void isIntegerWithNumberAndSpace()",
"identifier": "isIntegerWithNumberAndSpace",
"invocations": [
"assertFalse",
"isValid",
"isInteger"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void isIntegerWithNumberAndSpace()",
"testcase": true
} | {
"fields": [],
"file": "slideshowfx-ui-controls/src/main/java/com/twasyl/slideshowfx/ui/controls/validators/Validators.java",
"identifier": "Validators",
"interfaces": "",
"methods": [
{
"class_method_signature": "Validators.isNotEmpty()",
"constructor": false,
"full_signature": "public static IValidator<String> isNotEmpty()",
"identifier": "isNotEmpty",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isNotEmpty()",
"testcase": false
},
{
"class_method_signature": "Validators.isInteger()",
"constructor": false,
"full_signature": "public static IValidator<String> isInteger()",
"identifier": "isInteger",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isInteger()",
"testcase": false
},
{
"class_method_signature": "Validators.isIntegerOrBlank()",
"constructor": false,
"full_signature": "public static IValidator<String> isIntegerOrBlank()",
"identifier": "isIntegerOrBlank",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isIntegerOrBlank()",
"testcase": false
},
{
"class_method_signature": "Validators.isDouble()",
"constructor": false,
"full_signature": "public static IValidator<String> isDouble()",
"identifier": "isDouble",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isDouble()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static IValidator<String> isInteger() {\n return value -> {\n try {\n Integer.parseInt(value);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n };\n }",
"class_method_signature": "Validators.isInteger()",
"constructor": false,
"full_signature": "public static IValidator<String> isInteger()",
"identifier": "isInteger",
"invocations": [
"parseInt"
],
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isInteger()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_120 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static HtmlMarkup markup;",
"type": "HtmlMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-html/src/test/java/com/twasyl/slideshowfx/markup/html/HtmlMarkupTest.java",
"identifier": "HtmlMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void generateStrong() {\n final String result = markup.convertAsHtml(\"<strong>Strong text</strong>\");\n\n assertEquals(\"<strong>Strong text</strong>\", result);\n }",
"class_method_signature": "HtmlMarkupTest.generateStrong()",
"constructor": false,
"full_signature": "@Test public void generateStrong()",
"identifier": "generateStrong",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateStrong()",
"testcase": true
} | {
"fields": [],
"file": "slideshowfx-html/src/main/java/com/twasyl/slideshowfx/markup/html/HtmlMarkup.java",
"identifier": "HtmlMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "HtmlMarkup.HtmlMarkup()",
"constructor": true,
"full_signature": "public HtmlMarkup()",
"identifier": "HtmlMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " HtmlMarkup()",
"testcase": false
},
{
"class_method_signature": "HtmlMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n return markupString;\n }",
"class_method_signature": "HtmlMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_209 | {
"fields": [],
"file": "slideshowfx-utils/src/test/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombinationTest.java",
"identifier": "SlideshowFXKeyCombinationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShiftA() {\n final SlideshowFXKeyCombination combination = SlideshowFXKeyCombination.valueOf(\"Shift+A\");\n assertCombination(DOWN, UP, UP, UP, UP, \"A\", combination);\n }",
"class_method_signature": "SlideshowFXKeyCombinationTest.testShiftA()",
"constructor": false,
"full_signature": "@Test public void testShiftA()",
"identifier": "testShiftA",
"invocations": [
"valueOf",
"assertCombination"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testShiftA()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName())",
"modifier": "public static final",
"original_string": "public static final Logger LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "text",
"modifier": "private final",
"original_string": "private final String text;",
"type": "String",
"var_name": "text"
},
{
"declarator": "code",
"modifier": "private final",
"original_string": "private final KeyCode code;",
"type": "KeyCode",
"var_name": "code"
}
],
"file": "slideshowfx-utils/src/main/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombination.java",
"identifier": "SlideshowFXKeyCombination",
"interfaces": "",
"methods": [
{
"class_method_signature": "SlideshowFXKeyCombination.SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"constructor": true,
"full_signature": "public SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"identifier": "SlideshowFXKeyCombination",
"modifiers": "public",
"parameters": "(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"return": "",
"signature": " SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getText()",
"constructor": false,
"full_signature": "public String getText()",
"identifier": "getText",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getDisplayText()",
"constructor": false,
"full_signature": "@Override public String getDisplayText()",
"identifier": "getDisplayText",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getDisplayText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.match(KeyEvent event)",
"constructor": false,
"full_signature": "@Override public boolean match(KeyEvent event)",
"identifier": "match",
"modifiers": "@Override public",
"parameters": "(KeyEvent event)",
"return": "boolean",
"signature": "boolean match(KeyEvent event)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.equals(final Object obj)",
"constructor": false,
"full_signature": "@Override public boolean equals(final Object obj)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(final Object obj)",
"return": "boolean",
"signature": "boolean equals(final Object obj)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
}
],
"superclass": "extends KeyCombination"
} | {
"body": "public static SlideshowFXKeyCombination valueOf(String value) {\n if (value == null) throw new NullPointerException(\"The value can not be null\");\n if (value.isEmpty()) throw new IllegalArgumentException(\"The value can not be empty\");\n\n String determinedText = null;\n KeyCode determinedCode = KeyCode.UNDEFINED;\n\n ModifierValue shiftModifier = ModifierValue.UP;\n ModifierValue controlModifier = ModifierValue.UP;\n ModifierValue shortcutModifier = ModifierValue.UP;\n ModifierValue metaModifier = ModifierValue.UP;\n ModifierValue altModifier = ModifierValue.UP;\n\n final String[] tokens = value.split(\"\\\\+\");\n for (String token : tokens) {\n switch (token) {\n case \"Shortcut\":\n shortcutModifier = ModifierValue.DOWN;\n break;\n case \"Ctrl\":\n controlModifier = ModifierValue.DOWN;\n break;\n case \"Shift\":\n shiftModifier = ModifierValue.DOWN;\n break;\n case \"Meta\":\n metaModifier = ModifierValue.DOWN;\n break;\n case \"Alt\":\n altModifier = ModifierValue.DOWN;\n break;\n default:\n determinedText = token;\n determinedCode = KeyCode.valueOf(determinedText);\n }\n }\n final SlideshowFXKeyCombination combination = new SlideshowFXKeyCombination(determinedText, determinedCode, shiftModifier,\n controlModifier, altModifier, metaModifier, shortcutModifier);\n\n return combination;\n }",
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"invocations": [
"isEmpty",
"split",
"valueOf"
],
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_136 | {
"fields": [
{
"declarator": "snippetExecutor = new KotlinSnippetExecutor()",
"modifier": "private final",
"original_string": "private final KotlinSnippetExecutor snippetExecutor = new KotlinSnippetExecutor();",
"type": "KotlinSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-kotlin-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/kotlin/KotlinSnippetExecutorTest.java",
"identifier": "KotlinSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void buildSourceCode() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(PACKAGE_NAME_PROPERTY, \"SlideshowFX\");\n snippet.getProperties().put(IMPORTS_PROPERTY, \"import mypackage\\nmysecondpackage\");\n snippet.getProperties().put(WRAP_IN_MAIN_PROPERTY, \"true\");\n\n snippet.setCode(\"println(\\\"Hello\\\")\");\n\n final String expected = IOUtils.read(KotlinSnippetExecutorTest.class.getResourceAsStream(\"/com/twasyl/slideshowfx/snippet/executor/kotlin/buildSourceCode_expected.txt\"));\n assertEquals(expected, snippetExecutor.buildSourceCode(snippet));\n }",
"class_method_signature": "KotlinSnippetExecutorTest.buildSourceCode()",
"constructor": false,
"full_signature": "@Test public void buildSourceCode()",
"identifier": "buildSourceCode",
"invocations": [
"put",
"getProperties",
"put",
"getProperties",
"put",
"getProperties",
"setCode",
"read",
"getResourceAsStream",
"assertEquals",
"buildSourceCode"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void buildSourceCode()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "KOTLIN_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String KOTLIN_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "KOTLIN_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "PACKAGE_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String PACKAGE_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "PACKAGE_NAME_PROPERTY"
}
],
"file": "slideshowfx-kotlin-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/kotlin/KotlinSnippetExecutor.java",
"identifier": "KotlinSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "KotlinSnippetExecutor.KotlinSnippetExecutor()",
"constructor": true,
"full_signature": "public KotlinSnippetExecutor()",
"identifier": "KotlinSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " KotlinSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.hasPackage(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasPackage(final CodeSnippet codeSnippet)",
"identifier": "hasPackage",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasPackage(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getPackage(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getPackage(final CodeSnippet codeSnippet)",
"identifier": "getPackage",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getPackage(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.formatPackageName(final String packageName)",
"constructor": false,
"full_signature": "protected String formatPackageName(final String packageName)",
"identifier": "formatPackageName",
"modifiers": "protected",
"parameters": "(final String packageName)",
"return": "String",
"signature": "String formatPackageName(final String packageName)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<KotlinSnippetExecutorOptions>"
} | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n if (hasPackage(codeSnippet)) {\n sourceCode.append(getPackage(codeSnippet)).append(\"\\n\\n\");\n }\n\n if (hasImports(codeSnippet)) {\n sourceCode.append(getImports(codeSnippet)).append(\"\\n\\n\");\n }\n\n if (mustBeWrappedIn(codeSnippet, WRAP_IN_MAIN_PROPERTY)) {\n sourceCode.append(\"fun main(args: Array<String>) {\\n\")\n .append(codeSnippet.getCode())\n .append(\"\\n}\");\n } else {\n sourceCode.append(codeSnippet.getCode());\n }\n\n return sourceCode.toString();\n }",
"class_method_signature": "KotlinSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"invocations": [
"hasPackage",
"append",
"append",
"getPackage",
"hasImports",
"append",
"append",
"getImports",
"mustBeWrappedIn",
"append",
"append",
"append",
"getCode",
"append",
"getCode",
"toString"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_92 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void populateEmptyDocument() throws Exception {\n final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n final DocumentBuilder builder = factory.newDocumentBuilder();\n final Document document = builder.newDocument();\n\n ContextFileWorker.populateDocumentIfNecessary(document);\n\n final XPathFactory xPathFactory = XPathFactory.newInstance();\n final XPath xPath = xPathFactory.newXPath();\n\n assertNotNull(document.getDocumentElement());\n assertEquals(ROOT_TAG, document.getDocumentElement().getTagName());\n\n final Node recentPresentationsNode = (Node) xPath.evaluate(\"/\" + ROOT_TAG + \"/\" + RECENT_PRESENTATIONS_TAG, document.getDocumentElement(), NODE);\n assertNotNull(recentPresentationsNode);\n }",
"class_method_signature": "ContextFileWorkerTest.populateEmptyDocument()",
"constructor": false,
"full_signature": "@Test public void populateEmptyDocument()",
"identifier": "populateEmptyDocument",
"invocations": [
"newInstance",
"newDocumentBuilder",
"newDocument",
"populateDocumentIfNecessary",
"newInstance",
"newXPath",
"assertNotNull",
"getDocumentElement",
"assertEquals",
"getTagName",
"getDocumentElement",
"evaluate",
"getDocumentElement",
"assertNotNull"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void populateEmptyDocument()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected static void populateDocumentIfNecessary(final Document document) {\n Element root = document.getDocumentElement();\n if (root == null) {\n root = document.createElement(ROOT_TAG);\n document.appendChild(root);\n }\n\n try {\n final String expression = \"/\" + ROOT_TAG + \"/\" + RECENT_PRESENTATIONS_TAG + \"[1]\";\n Node recentPresentationsNode = (Node) xpath().evaluate(expression, root, NODE);\n\n if (recentPresentationsNode == null) {\n recentPresentationsNode = document.createElement(RECENT_PRESENTATIONS_TAG);\n root.appendChild(recentPresentationsNode);\n }\n } catch (XPathExpressionException e) {\n LOGGER.log(Level.WARNING, \"Can not parse the document properly\", e);\n }\n }",
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"invocations": [
"getDocumentElement",
"createElement",
"appendChild",
"evaluate",
"xpath",
"createElement",
"appendChild",
"log"
],
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_161 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static AsciidoctorMarkup markup;",
"type": "AsciidoctorMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-asciidoctor/src/test/java/com/twasyl/slideshowfx/markup/asciidoctor/AsciidoctorMarkupTest.java",
"identifier": "AsciidoctorMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void generateUnorderedList() {\n final String result = markup.convertAsHtml(\"<ul><li>One</li><li>Two</li></ul>\");\n\n assertEquals(\"<ul><li>One</li><li>Two</li></ul>\", result);\n }",
"class_method_signature": "AsciidoctorMarkupTest.generateUnorderedList()",
"constructor": false,
"full_signature": "@Test public void generateUnorderedList()",
"identifier": "generateUnorderedList",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateUnorderedList()",
"testcase": true
} | {
"fields": [
{
"declarator": "asciidoctor",
"modifier": "private final",
"original_string": "private final Asciidoctor asciidoctor;",
"type": "Asciidoctor",
"var_name": "asciidoctor"
}
],
"file": "slideshowfx-asciidoctor/src/main/java/com/twasyl/slideshowfx/markup/asciidoctor/AsciidoctorMarkup.java",
"identifier": "AsciidoctorMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "AsciidoctorMarkup.AsciidoctorMarkup()",
"constructor": true,
"full_signature": "public AsciidoctorMarkup()",
"identifier": "AsciidoctorMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " AsciidoctorMarkup()",
"testcase": false
},
{
"class_method_signature": "AsciidoctorMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n final AttributesBuilder attributes = AttributesBuilder.attributes()\n .sectionNumbers(false)\n .noFooter(true)\n .tableOfContents(false)\n .showTitle(false)\n .skipFrontMatter(true)\n .attribute(\"sectids!\", \"\");\n final OptionsBuilder options = OptionsBuilder.options()\n .compact(true)\n .backend(\"html5\")\n .attributes(attributes);\n\n return this.asciidoctor.convert(markupString, options).trim();\n }",
"class_method_signature": "AsciidoctorMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName",
"attribute",
"skipFrontMatter",
"showTitle",
"tableOfContents",
"noFooter",
"sectionNumbers",
"attributes",
"attributes",
"backend",
"compact",
"options",
"trim",
"convert"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_116 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static HtmlMarkup markup;",
"type": "HtmlMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-html/src/test/java/com/twasyl/slideshowfx/markup/html/HtmlMarkupTest.java",
"identifier": "HtmlMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void generateH1() {\n final String result = markup.convertAsHtml(\"<h1>A title</h1>\");\n\n assertEquals(\"<h1>A title</h1>\", result);\n }",
"class_method_signature": "HtmlMarkupTest.generateH1()",
"constructor": false,
"full_signature": "@Test public void generateH1()",
"identifier": "generateH1",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateH1()",
"testcase": true
} | {
"fields": [],
"file": "slideshowfx-html/src/main/java/com/twasyl/slideshowfx/markup/html/HtmlMarkup.java",
"identifier": "HtmlMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "HtmlMarkup.HtmlMarkup()",
"constructor": true,
"full_signature": "public HtmlMarkup()",
"identifier": "HtmlMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " HtmlMarkup()",
"testcase": false
},
{
"class_method_signature": "HtmlMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n return markupString;\n }",
"class_method_signature": "HtmlMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_4 | {
"fields": [
{
"declarator": "TMP_DIR = new File(\"build/tmp\")",
"modifier": "private static final",
"original_string": "private static final File TMP_DIR = new File(\"build/tmp\");",
"type": "File",
"var_name": "TMP_DIR"
},
{
"declarator": "PLUGIN_FILE",
"modifier": "private static",
"original_string": "private static PluginFile PLUGIN_FILE;",
"type": "PluginFile",
"var_name": "PLUGIN_FILE"
}
],
"file": "slideshowfx-plugin-manager/src/test/java/com/twasyl/slideshowfx/plugin/manager/internal/PluginClassLoaderTest.java",
"identifier": "PluginClassLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testGetClass() throws IOException, ClassNotFoundException {\n final PluginClassLoader pluginClassLoader = PluginClassLoader.newInstance(PLUGIN_FILE);\n final Class<?> clazz = pluginClassLoader.loadClass(\"com.twasyl.slideshowfx.dummy.plugin.Dummy\");\n\n assertAll(\n () -> assertNotNull(clazz),\n () -> assertEquals(\"com.twasyl.slideshowfx.dummy.plugin.Dummy\", clazz.getName()));\n }",
"class_method_signature": "PluginClassLoaderTest.testGetClass()",
"constructor": false,
"full_signature": "@Test void testGetClass()",
"identifier": "testGetClass",
"invocations": [
"newInstance",
"loadClass",
"assertAll",
"assertNotNull",
"assertEquals",
"getName"
],
"modifiers": "@Test",
"parameters": "()",
"return": "void",
"signature": "void testGetClass()",
"testcase": true
} | {
"fields": [],
"file": "slideshowfx-plugin-manager/src/main/java/com/twasyl/slideshowfx/plugin/manager/internal/PluginClassLoader.java",
"identifier": "PluginClassLoader",
"interfaces": "",
"methods": [
{
"class_method_signature": "PluginClassLoader.PluginClassLoader(URL[] urls)",
"constructor": true,
"full_signature": "private PluginClassLoader(URL[] urls)",
"identifier": "PluginClassLoader",
"modifiers": "private",
"parameters": "(URL[] urls)",
"return": "",
"signature": " PluginClassLoader(URL[] urls)",
"testcase": false
},
{
"class_method_signature": "PluginClassLoader.newInstance(final PluginFile file)",
"constructor": false,
"full_signature": "public static PluginClassLoader newInstance(final PluginFile file)",
"identifier": "newInstance",
"modifiers": "public static",
"parameters": "(final PluginFile file)",
"return": "PluginClassLoader",
"signature": "PluginClassLoader newInstance(final PluginFile file)",
"testcase": false
},
{
"class_method_signature": "PluginClassLoader.onlyFiles()",
"constructor": false,
"full_signature": "private static Predicate<ZipEntry> onlyFiles()",
"identifier": "onlyFiles",
"modifiers": "private static",
"parameters": "()",
"return": "Predicate<ZipEntry>",
"signature": "Predicate<ZipEntry> onlyFiles()",
"testcase": false
},
{
"class_method_signature": "PluginClassLoader.entryToUrl(final PluginFile file, final ZipEntry entry)",
"constructor": false,
"full_signature": "private static URL entryToUrl(final PluginFile file, final ZipEntry entry)",
"identifier": "entryToUrl",
"modifiers": "private static",
"parameters": "(final PluginFile file, final ZipEntry entry)",
"return": "URL",
"signature": "URL entryToUrl(final PluginFile file, final ZipEntry entry)",
"testcase": false
},
{
"class_method_signature": "PluginClassLoader.fileToUrl(final File file)",
"constructor": false,
"full_signature": "private static URL fileToUrl(final File file)",
"identifier": "fileToUrl",
"modifiers": "private static",
"parameters": "(final File file)",
"return": "URL",
"signature": "URL fileToUrl(final File file)",
"testcase": false
}
],
"superclass": "extends URLClassLoader"
} | {
"body": "public static PluginClassLoader newInstance(final PluginFile file) throws IOException {\n if (file == null) throw new NullPointerException(\"The plugin can not be null\");\n\n try (final ZipFile zipFile = new ZipFile(file)) {\n final URL[] urls = zipFile.stream()\n .filter(onlyFiles())\n .map(entry -> entryToUrl(file, entry))\n .filter(Objects::nonNull)\n .collect(Collectors.toList())\n .toArray(new URL[0]);\n\n return new PluginClassLoader(urls);\n }\n }",
"class_method_signature": "PluginClassLoader.newInstance(final PluginFile file)",
"constructor": false,
"full_signature": "public static PluginClassLoader newInstance(final PluginFile file)",
"identifier": "newInstance",
"invocations": [
"toArray",
"collect",
"filter",
"map",
"filter",
"stream",
"onlyFiles",
"entryToUrl",
"toList"
],
"modifiers": "public static",
"parameters": "(final PluginFile file)",
"return": "PluginClassLoader",
"signature": "PluginClassLoader newInstance(final PluginFile file)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_141 | {
"fields": [
{
"declarator": "snippetExecutor = new ScalaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final ScalaSnippetExecutor snippetExecutor = new ScalaSnippetExecutor();",
"type": "ScalaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-scala-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/scala/ScalaSnippetExecutorTest.java",
"identifier": "ScalaSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hasEmptyImports() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(IMPORTS_PROPERTY, \"\");\n\n assertFalse(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "ScalaSnippetExecutorTest.hasEmptyImports()",
"constructor": false,
"full_signature": "@Test public void hasEmptyImports()",
"identifier": "hasEmptyImports",
"invocations": [
"put",
"getProperties",
"assertFalse",
"hasImports"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void hasEmptyImports()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "SCALA_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String SCALA_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "SCALA_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
}
],
"file": "slideshowfx-scala-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/scala/ScalaSnippetExecutor.java",
"identifier": "ScalaSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ScalaSnippetExecutor.ScalaSnippetExecutor()",
"constructor": true,
"full_signature": "public ScalaSnippetExecutor()",
"identifier": "ScalaSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " ScalaSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<ScalaSnippetExecutorOptions>"
} | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "ScalaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_157 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static AsciidoctorMarkup markup;",
"type": "AsciidoctorMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-asciidoctor/src/test/java/com/twasyl/slideshowfx/markup/asciidoctor/AsciidoctorMarkupTest.java",
"identifier": "AsciidoctorMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void generateH2() {\n final String result = markup.convertAsHtml(\"== A title\");\n System.out.println(result);\n assertEquals(\"<h2>A title</h2>\", result);\n }",
"class_method_signature": "AsciidoctorMarkupTest.generateH2()",
"constructor": false,
"full_signature": "@Test public void generateH2()",
"identifier": "generateH2",
"invocations": [
"convertAsHtml",
"println",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateH2()",
"testcase": true
} | {
"fields": [
{
"declarator": "asciidoctor",
"modifier": "private final",
"original_string": "private final Asciidoctor asciidoctor;",
"type": "Asciidoctor",
"var_name": "asciidoctor"
}
],
"file": "slideshowfx-asciidoctor/src/main/java/com/twasyl/slideshowfx/markup/asciidoctor/AsciidoctorMarkup.java",
"identifier": "AsciidoctorMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "AsciidoctorMarkup.AsciidoctorMarkup()",
"constructor": true,
"full_signature": "public AsciidoctorMarkup()",
"identifier": "AsciidoctorMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " AsciidoctorMarkup()",
"testcase": false
},
{
"class_method_signature": "AsciidoctorMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) throws IllegalArgumentException {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n final AttributesBuilder attributes = AttributesBuilder.attributes()\n .sectionNumbers(false)\n .noFooter(true)\n .tableOfContents(false)\n .showTitle(false)\n .skipFrontMatter(true)\n .attribute(\"sectids!\", \"\");\n final OptionsBuilder options = OptionsBuilder.options()\n .compact(true)\n .backend(\"html5\")\n .attributes(attributes);\n\n return this.asciidoctor.convert(markupString, options).trim();\n }",
"class_method_signature": "AsciidoctorMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName",
"attribute",
"skipFrontMatter",
"showTitle",
"tableOfContents",
"noFooter",
"sectionNumbers",
"attributes",
"attributes",
"backend",
"compact",
"options",
"trim",
"convert"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_100 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void purgeRecentPresentationsWhenEqualAsSpecified() throws ContextFileException {\n final int numberOfRecentPresentationsToKeep = 3;\n final RecentPresentation recentPresentation1 = new RecentPresentation(\"presentation1.sfx\", LocalDateTime.now());\n final RecentPresentation recentPresentation2 = new RecentPresentation(\"presentation2.sfx\", recentPresentation1.getOpenedDateTime().plusDays(2));\n final RecentPresentation recentPresentation3 = new RecentPresentation(\"presentation3.sfx\", recentPresentation2.getOpenedDateTime().plusDays(2));\n\n final String xml = this.createXmlStringFromRecentPresentations(recentPresentation1, recentPresentation2, recentPresentation3);\n\n final ByteArrayInputStream input = new ByteArrayInputStream(xml.getBytes(UTF_8));\n final ByteArrayOutputStream output = new ByteArrayOutputStream();\n\n final Set<RecentPresentation> presentations = ContextFileWorker.purgeRecentPresentations(input, output, numberOfRecentPresentationsToKeep);\n assertEquals(numberOfRecentPresentationsToKeep, presentations.size());\n\n final Iterator<RecentPresentation> iterator = presentations.iterator();\n RecentPresentation recentPresentation = iterator.next();\n assertNotNull(recentPresentation);\n assertEquals(recentPresentation1.getId(), recentPresentation.getId());\n\n recentPresentation = iterator.next();\n assertNotNull(recentPresentation);\n assertEquals(recentPresentation2.getId(), recentPresentation.getId());\n\n recentPresentation = iterator.next();\n assertNotNull(recentPresentation);\n assertEquals(recentPresentation3.getId(), recentPresentation.getId());\n }",
"class_method_signature": "ContextFileWorkerTest.purgeRecentPresentationsWhenEqualAsSpecified()",
"constructor": false,
"full_signature": "@Test public void purgeRecentPresentationsWhenEqualAsSpecified()",
"identifier": "purgeRecentPresentationsWhenEqualAsSpecified",
"invocations": [
"now",
"plusDays",
"getOpenedDateTime",
"plusDays",
"getOpenedDateTime",
"createXmlStringFromRecentPresentations",
"getBytes",
"purgeRecentPresentations",
"assertEquals",
"size",
"iterator",
"next",
"assertNotNull",
"assertEquals",
"getId",
"getId",
"next",
"assertNotNull",
"assertEquals",
"getId",
"getId",
"next",
"assertNotNull",
"assertEquals",
"getId",
"getId"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void purgeRecentPresentationsWhenEqualAsSpecified()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep) throws ContextFileException {\n checkContextFileValidity(contextFile);\n if (numberOfRecentPresentationsToKeep < 0)\n throw new IllegalArgumentException(\"The number of recent presentations to keep can not be negative\");\n\n\n try (final InputStream input = getInputStreamForFile(contextFile);\n final OutputStream output = new FileOutputStream(contextFile)) {\n return purgeRecentPresentations(input, output, numberOfRecentPresentationsToKeep);\n } catch (IOException e) {\n throw new ContextFileException(e);\n }\n }",
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"invocations": [
"checkContextFileValidity",
"getInputStreamForFile",
"purgeRecentPresentations"
],
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_88 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void saveWithExistingDocument() throws Exception {\n final RecentPresentation recentPresentation1 = new RecentPresentation(\"presentation1.sfx\", LocalDateTime.now());\n final RecentPresentation recentPresentation2 = new RecentPresentation(\"presentation2.sfx\", LocalDateTime.now().plusDays(2));\n\n final String xml = this.createXmlStringFromRecentPresentations(recentPresentation1);\n\n final ByteArrayInputStream input = new ByteArrayInputStream(xml.getBytes(UTF_8));\n final ByteArrayOutputStream output = new ByteArrayOutputStream();\n\n ContextFileWorker.saveRecentPresentation(input, output, recentPresentation2);\n\n final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n final DocumentBuilder builder = factory.newDocumentBuilder();\n final Document document = builder.parse(new ByteArrayInputStream(output.toByteArray()));\n\n final XPathFactory xPathFactory = XPathFactory.newInstance();\n final XPath xPath = xPathFactory.newXPath();\n\n final String baseExpr = new StringBuilder(\"/\").append(ROOT_TAG).append(\"/\").append(RECENT_PRESENTATIONS_TAG).append(\"/\").append(RECENT_PRESENTATION_TAG).append(\"[2]\").toString();\n final String actualFile = (String) xPath.evaluate(baseExpr + \"/\" + FILE_TAG, document.getDocumentElement(), STRING);\n final String actualId = (String) xPath.evaluate(baseExpr + \"/\" + ID_TAG, document.getDocumentElement(), STRING);\n\n assertNotNull(actualId);\n assertEquals(recentPresentation2.getId(), actualId);\n\n assertNotNull(actualFile);\n assertEquals(recentPresentation2.getNormalizedPath(), actualFile);\n\n final LocalDateTime actualOpenedDateTime = LocalDateTime.parse((String) xPath.evaluate(baseExpr + \"/\" + OPENED_DATE_TIME_TAG, document.getDocumentElement(), STRING));\n assertEquals(recentPresentation2.getOpenedDateTime(), actualOpenedDateTime);\n }",
"class_method_signature": "ContextFileWorkerTest.saveWithExistingDocument()",
"constructor": false,
"full_signature": "@Test public void saveWithExistingDocument()",
"identifier": "saveWithExistingDocument",
"invocations": [
"now",
"plusDays",
"now",
"createXmlStringFromRecentPresentations",
"getBytes",
"saveRecentPresentation",
"newInstance",
"newDocumentBuilder",
"parse",
"toByteArray",
"newInstance",
"newXPath",
"toString",
"append",
"append",
"append",
"append",
"append",
"append",
"evaluate",
"getDocumentElement",
"evaluate",
"getDocumentElement",
"assertNotNull",
"assertEquals",
"getId",
"assertNotNull",
"assertEquals",
"getNormalizedPath",
"parse",
"evaluate",
"getDocumentElement",
"assertEquals",
"getOpenedDateTime"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void saveWithExistingDocument()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation) throws ContextFileException {\n final Document document = createDocumentFromInput(input);\n\n populateDocumentIfNecessary(document);\n\n final Node recentPresentationsNode = getRecentPresentationsNode(document);\n final Node recentPresentationNode = createNodeFromRecentPresentation(document, recentPresentation);\n\n if (recentPresentationNode != null) {\n recentPresentationsNode.appendChild(recentPresentationNode);\n writeDocument(document, output);\n }\n }",
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"invocations": [
"createDocumentFromInput",
"populateDocumentIfNecessary",
"getRecentPresentationsNode",
"createNodeFromRecentPresentation",
"appendChild",
"writeDocument"
],
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_194 | {
"fields": [
{
"declarator": "snippetExecutor = new GoSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoSnippetExecutor snippetExecutor = new GoSnippetExecutor();",
"type": "GoSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-go-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutorTest.java",
"identifier": "GoSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void formatImportWithoutDoubleQuotes() {\n assertEquals(\"\\\"fmt\\\"\", snippetExecutor.formatImportLine(\"fmt\"));\n }",
"class_method_signature": "GoSnippetExecutorTest.formatImportWithoutDoubleQuotes()",
"constructor": false,
"full_signature": "@Test public void formatImportWithoutDoubleQuotes()",
"identifier": "formatImportWithoutDoubleQuotes",
"invocations": [
"assertEquals",
"formatImportLine"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void formatImportWithoutDoubleQuotes()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GO_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String GO_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GO_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "PACKAGE_NAME_PROPERTY = \"package\"",
"modifier": "protected static final",
"original_string": "protected static final String PACKAGE_NAME_PROPERTY = \"package\";",
"type": "String",
"var_name": "PACKAGE_NAME_PROPERTY"
}
],
"file": "slideshowfx-go-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutor.java",
"identifier": "GoSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GoSnippetExecutor.GoSnippetExecutor()",
"constructor": true,
"full_signature": "public GoSnippetExecutor()",
"identifier": "GoSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GoSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getStartPackageDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartPackageDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.determinePackageName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determinePackageName(final CodeSnippet codeSnippet)",
"identifier": "determinePackageName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determinePackageName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GoSnippetExecutorOptions>"
} | {
"body": "protected String formatImportLine(final String importLine) {\n final String importLineBeginning = \"\\\"\";\n final String importLineEnding = \"\\\"\";\n\n String formattedImportLine;\n\n if (importLine.startsWith(importLineBeginning)) {\n formattedImportLine = importLine;\n } else {\n formattedImportLine = importLineBeginning.concat(importLine);\n }\n\n if (!importLine.endsWith(importLineEnding)) {\n formattedImportLine = formattedImportLine.concat(importLineEnding);\n }\n\n return formattedImportLine;\n }",
"class_method_signature": "GoSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"invocations": [
"startsWith",
"concat",
"endsWith",
"concat"
],
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_67 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-groovy-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutorTest.java",
"identifier": "GroovySnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void buildSourceCode() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"TestGroovy\");\n snippet.getProperties().put(IMPORTS_PROPERTY, \"import mypackage\\nmysecondpackage\");\n snippet.getProperties().put(WRAP_IN_METHOD_RUNNER, \"true\");\n\n snippet.setCode(\"println(\\\"Hello\\\")\");\n\n final String expected = IOUtils.read(GroovySnippetExecutorTest.class.getResourceAsStream(\"/com/twasyl/slideshowfx/snippet/executor/groovy/buildSourceCode_expected.txt\"));\n assertEquals(expected, snippetExecutor.buildSourceCode(snippet));\n }",
"class_method_signature": "GroovySnippetExecutorTest.buildSourceCode()",
"constructor": false,
"full_signature": "@Test public void buildSourceCode()",
"identifier": "buildSourceCode",
"invocations": [
"put",
"getProperties",
"put",
"getProperties",
"put",
"getProperties",
"setCode",
"read",
"getResourceAsStream",
"assertEquals",
"buildSourceCode"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void buildSourceCode()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GROOVY_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String GROOVY_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GROOVY_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\";",
"type": "String",
"var_name": "WRAP_IN_METHOD_RUNNER"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
},
{
"declarator": "MAKE_SCRIPT = \"makeScript\"",
"modifier": "protected static final",
"original_string": "protected static final String MAKE_SCRIPT = \"makeScript\";",
"type": "String",
"var_name": "MAKE_SCRIPT"
}
],
"file": "slideshowfx-groovy-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutor.java",
"identifier": "GroovySnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GroovySnippetExecutor.GroovySnippetExecutor()",
"constructor": true,
"full_signature": "public GroovySnippetExecutor()",
"identifier": "GroovySnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GroovySnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.makeScript(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean makeScript(final CodeSnippet codeSnippet)",
"identifier": "makeScript",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean makeScript(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getScriptImport()",
"constructor": false,
"full_signature": "protected String getScriptImport()",
"identifier": "getScriptImport",
"modifiers": "protected",
"parameters": "()",
"return": "String",
"signature": "String getScriptImport()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartMainMethod(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartMainMethod(final CodeSnippet codeSnippet)",
"identifier": "getStartMainMethod",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartMainMethod(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GroovySnippetExecutorOptions>"
} | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n boolean someImportsPresent = false;\n\n if (makeScript(codeSnippet)) {\n sourceCode.append(getScriptImport()).append(\"\\n\");\n someImportsPresent = true;\n }\n\n if (hasImports(codeSnippet)) {\n sourceCode.append(getImports(codeSnippet)).append(\"\\n\");\n someImportsPresent = true;\n }\n\n if (someImportsPresent) sourceCode.append(\"\\n\");\n\n sourceCode.append(getStartClassDefinition(codeSnippet)).append(\"\\n\");\n\n if (mustBeWrappedIn(codeSnippet, WRAP_IN_METHOD_RUNNER)) {\n sourceCode.append(\"\\t\").append(getStartMainMethod(codeSnippet)).append(\"\\n\")\n .append(codeSnippet.getCode())\n .append(\"\\n\\t}\");\n } else {\n sourceCode.append(codeSnippet.getCode());\n }\n\n sourceCode.append(\"\\n}\");\n\n return sourceCode.toString();\n }",
"class_method_signature": "GroovySnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"invocations": [
"makeScript",
"append",
"append",
"getScriptImport",
"hasImports",
"append",
"append",
"getImports",
"append",
"append",
"append",
"getStartClassDefinition",
"mustBeWrappedIn",
"append",
"append",
"append",
"append",
"append",
"getStartMainMethod",
"getCode",
"append",
"getCode",
"append",
"toString"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_205 | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ZipUtilsTest.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ZipUtilsTest.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "testResultsDir",
"modifier": "private static",
"original_string": "private static File testResultsDir;",
"type": "File",
"var_name": "testResultsDir"
},
{
"declarator": "resourcesDir",
"modifier": "private static",
"original_string": "private static File resourcesDir;",
"type": "File",
"var_name": "resourcesDir"
}
],
"file": "slideshowfx-utils/src/test/java/com/twasyl/slideshowfx/utils/ZipUtilsTest.java",
"identifier": "ZipUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void zip() throws IOException {\n final File zip = new File(testResultsDir, \"zipped.zip\");\n ZipUtils.zip(resourcesDir, zip);\n\n // Verify all content of the zip\n try (final FileInputStream fileInput = new FileInputStream(zip);\n final ZipInputStream input = new ZipInputStream(fileInput)) {\n\n final int expectedNumberOfEntries = 5;\n int numberOfEntries = 0;\n\n ZipEntry entry;\n\n while ((entry = input.getNextEntry()) != null) {\n numberOfEntries++;\n\n switch (entry.getName()) {\n case \"dir/otherDir/otherDirTest.html\":\n assertFalse(entry.isDirectory(), \"otherDirTest.html is a directory\");\n break;\n case \"dir/dirTest.txt\":\n assertFalse(entry.isDirectory(), \"dirTest.txt is a directory\");\n break;\n case \"archive.zip\":\n assertFalse(entry.isDirectory(), \"archive.zip is a directory\");\n break;\n case \"test.html\":\n assertFalse(entry.isDirectory(), \"test.html is a directory\");\n break;\n case \"test.txt\":\n assertFalse(entry.isDirectory(), \"test.txt is a directory\");\n break;\n default:\n fail(\"Unknown entry name: [\" + entry.getName() + \"]\");\n }\n }\n\n assertEquals(expectedNumberOfEntries, numberOfEntries);\n }\n\n zip.delete();\n }",
"class_method_signature": "ZipUtilsTest.zip()",
"constructor": false,
"full_signature": "@Test public void zip()",
"identifier": "zip",
"invocations": [
"zip",
"getNextEntry",
"getName",
"assertFalse",
"isDirectory",
"assertFalse",
"isDirectory",
"assertFalse",
"isDirectory",
"assertFalse",
"isDirectory",
"assertFalse",
"isDirectory",
"fail",
"getName",
"assertEquals",
"delete"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void zip()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ZipUtils.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ZipUtils.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "slideshowfx-utils/src/main/java/com/twasyl/slideshowfx/utils/ZipUtils.java",
"identifier": "ZipUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ZipUtils.ZipUtils()",
"constructor": true,
"full_signature": "private ZipUtils()",
"identifier": "ZipUtils",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ZipUtils()",
"testcase": false
},
{
"class_method_signature": "ZipUtils.unzip(File archive, File destination)",
"constructor": false,
"full_signature": "public static void unzip(File archive, File destination)",
"identifier": "unzip",
"modifiers": "public static",
"parameters": "(File archive, File destination)",
"return": "void",
"signature": "void unzip(File archive, File destination)",
"testcase": false
},
{
"class_method_signature": "ZipUtils.unzip(InputStream archive, File destination)",
"constructor": false,
"full_signature": "public static void unzip(InputStream archive, File destination)",
"identifier": "unzip",
"modifiers": "public static",
"parameters": "(InputStream archive, File destination)",
"return": "void",
"signature": "void unzip(InputStream archive, File destination)",
"testcase": false
},
{
"class_method_signature": "ZipUtils.zip(File fileToZip, File destination)",
"constructor": false,
"full_signature": "public static void zip(File fileToZip, File destination)",
"identifier": "zip",
"modifiers": "public static",
"parameters": "(File fileToZip, File destination)",
"return": "void",
"signature": "void zip(File fileToZip, File destination)",
"testcase": false
},
{
"class_method_signature": "ZipUtils.isFileInParent(final File file, final File parent)",
"constructor": false,
"full_signature": "protected static boolean isFileInParent(final File file, final File parent)",
"identifier": "isFileInParent",
"modifiers": "protected static",
"parameters": "(final File file, final File parent)",
"return": "boolean",
"signature": "boolean isFileInParent(final File file, final File parent)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static void zip(File fileToZip, File destination) throws IOException {\n if (fileToZip == null) throw new NullPointerException(\"The file to zip can not be null\");\n if (!fileToZip.exists()) throw new FileNotFoundException(\"The file to zip does not exist\");\n if (destination == null) throw new NullPointerException(\"The destination can not be null\");\n\n final ListFilesFileVisitor visitor = new ListFilesFileVisitor();\n Files.walkFileTree(fileToZip.toPath(), visitor);\n final List<File> filesToZip = visitor.getFiles();\n\n\n try (final ZipOutputStream zipOutput = new ZipOutputStream(new FileOutputStream(destination))) {\n ZipEntry entry;\n String entryName;\n final byte[] buffer = new byte[1024];\n int length;\n\n final String prefixToDelete;\n if (fileToZip.isDirectory()) {\n prefixToDelete = fileToZip.getAbsolutePath() + File.separator;\n } else {\n prefixToDelete = \"\";\n }\n\n for (File file : filesToZip) {\n LOGGER.fine(\"Compressing file: \" + file.getAbsolutePath());\n\n entryName = file.getAbsolutePath().substring(prefixToDelete.length(), file.getAbsolutePath().length());\n entryName = entryName.replaceAll(\"\\\\\\\\\", \"/\");\n LOGGER.log(FINEST, \"Entry name: {0}\", entryName);\n\n if (file.isDirectory()) {\n entry = new ZipEntry(entryName + \"/\");\n zipOutput.putNextEntry(entry);\n } else {\n entry = new ZipEntry(entryName);\n zipOutput.putNextEntry(entry);\n\n try (final FileInputStream fileInput = new FileInputStream(file)) {\n while ((length = fileInput.read(buffer)) > 0) {\n zipOutput.write(buffer, 0, length);\n }\n }\n }\n }\n\n zipOutput.closeEntry();\n zipOutput.flush();\n }\n\n LOGGER.fine(\"File compressed\");\n }",
"class_method_signature": "ZipUtils.zip(File fileToZip, File destination)",
"constructor": false,
"full_signature": "public static void zip(File fileToZip, File destination)",
"identifier": "zip",
"invocations": [
"exists",
"walkFileTree",
"toPath",
"getFiles",
"isDirectory",
"getAbsolutePath",
"fine",
"getAbsolutePath",
"substring",
"getAbsolutePath",
"length",
"length",
"getAbsolutePath",
"replaceAll",
"log",
"isDirectory",
"putNextEntry",
"putNextEntry",
"read",
"write",
"closeEntry",
"flush",
"fine"
],
"modifiers": "public static",
"parameters": "(File fileToZip, File destination)",
"return": "void",
"signature": "void zip(File fileToZip, File destination)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_30 | {
"fields": [
{
"declarator": "snippetExecutor = new JavaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final JavaSnippetExecutor snippetExecutor = new JavaSnippetExecutor();",
"type": "JavaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-java-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutorTest.java",
"identifier": "JavaSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hasEmptyImports() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(IMPORTS_PROPERTY, \"\");\n\n assertFalse(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "JavaSnippetExecutorTest.hasEmptyImports()",
"constructor": false,
"full_signature": "@Test public void hasEmptyImports()",
"identifier": "hasEmptyImports",
"invocations": [
"put",
"getProperties",
"assertFalse",
"hasImports"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void hasEmptyImports()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "JAVA_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String JAVA_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "JAVA_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
}
],
"file": "slideshowfx-java-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutor.java",
"identifier": "JavaSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "JavaSnippetExecutor.JavaSnippetExecutor()",
"constructor": true,
"full_signature": "public JavaSnippetExecutor()",
"identifier": "JavaSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " JavaSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<JavaSnippetExecutorOptions>"
} | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "JavaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_213 | {
"fields": [],
"file": "slideshowfx-utils/src/test/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombinationTest.java",
"identifier": "SlideshowFXKeyCombinationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testShortcutMetaA() {\n final SlideshowFXKeyCombination combination = SlideshowFXKeyCombination.valueOf(\"Shortcut+Meta+A\");\n assertCombination(UP, UP, UP, DOWN, DOWN, \"A\", combination);\n }",
"class_method_signature": "SlideshowFXKeyCombinationTest.testShortcutMetaA()",
"constructor": false,
"full_signature": "@Test public void testShortcutMetaA()",
"identifier": "testShortcutMetaA",
"invocations": [
"valueOf",
"assertCombination"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testShortcutMetaA()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName())",
"modifier": "public static final",
"original_string": "public static final Logger LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "text",
"modifier": "private final",
"original_string": "private final String text;",
"type": "String",
"var_name": "text"
},
{
"declarator": "code",
"modifier": "private final",
"original_string": "private final KeyCode code;",
"type": "KeyCode",
"var_name": "code"
}
],
"file": "slideshowfx-utils/src/main/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombination.java",
"identifier": "SlideshowFXKeyCombination",
"interfaces": "",
"methods": [
{
"class_method_signature": "SlideshowFXKeyCombination.SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"constructor": true,
"full_signature": "public SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"identifier": "SlideshowFXKeyCombination",
"modifiers": "public",
"parameters": "(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"return": "",
"signature": " SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getText()",
"constructor": false,
"full_signature": "public String getText()",
"identifier": "getText",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getDisplayText()",
"constructor": false,
"full_signature": "@Override public String getDisplayText()",
"identifier": "getDisplayText",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getDisplayText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.match(KeyEvent event)",
"constructor": false,
"full_signature": "@Override public boolean match(KeyEvent event)",
"identifier": "match",
"modifiers": "@Override public",
"parameters": "(KeyEvent event)",
"return": "boolean",
"signature": "boolean match(KeyEvent event)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.equals(final Object obj)",
"constructor": false,
"full_signature": "@Override public boolean equals(final Object obj)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(final Object obj)",
"return": "boolean",
"signature": "boolean equals(final Object obj)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
}
],
"superclass": "extends KeyCombination"
} | {
"body": "public static SlideshowFXKeyCombination valueOf(String value) {\n if (value == null) throw new NullPointerException(\"The value can not be null\");\n if (value.isEmpty()) throw new IllegalArgumentException(\"The value can not be empty\");\n\n String determinedText = null;\n KeyCode determinedCode = KeyCode.UNDEFINED;\n\n ModifierValue shiftModifier = ModifierValue.UP;\n ModifierValue controlModifier = ModifierValue.UP;\n ModifierValue shortcutModifier = ModifierValue.UP;\n ModifierValue metaModifier = ModifierValue.UP;\n ModifierValue altModifier = ModifierValue.UP;\n\n final String[] tokens = value.split(\"\\\\+\");\n for (String token : tokens) {\n switch (token) {\n case \"Shortcut\":\n shortcutModifier = ModifierValue.DOWN;\n break;\n case \"Ctrl\":\n controlModifier = ModifierValue.DOWN;\n break;\n case \"Shift\":\n shiftModifier = ModifierValue.DOWN;\n break;\n case \"Meta\":\n metaModifier = ModifierValue.DOWN;\n break;\n case \"Alt\":\n altModifier = ModifierValue.DOWN;\n break;\n default:\n determinedText = token;\n determinedCode = KeyCode.valueOf(determinedText);\n }\n }\n final SlideshowFXKeyCombination combination = new SlideshowFXKeyCombination(determinedText, determinedCode, shiftModifier,\n controlModifier, altModifier, metaModifier, shortcutModifier);\n\n return combination;\n }",
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"invocations": [
"isEmpty",
"split",
"valueOf"
],
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_26 | {
"fields": [
{
"declarator": "snippetExecutor = new JavaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final JavaSnippetExecutor snippetExecutor = new JavaSnippetExecutor();",
"type": "JavaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-java-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutorTest.java",
"identifier": "JavaSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void noClassName() {\n final CodeSnippet snippet = new CodeSnippet();\n\n assertEquals(\"Snippet\", snippetExecutor.determineClassName(snippet));\n }",
"class_method_signature": "JavaSnippetExecutorTest.noClassName()",
"constructor": false,
"full_signature": "@Test public void noClassName()",
"identifier": "noClassName",
"invocations": [
"assertEquals",
"determineClassName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void noClassName()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "JAVA_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String JAVA_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "JAVA_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
}
],
"file": "slideshowfx-java-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutor.java",
"identifier": "JavaSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "JavaSnippetExecutor.JavaSnippetExecutor()",
"constructor": true,
"full_signature": "public JavaSnippetExecutor()",
"identifier": "JavaSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " JavaSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<JavaSnippetExecutorOptions>"
} | {
"body": "protected String determineClassName(final CodeSnippet codeSnippet) {\n String className = codeSnippet.getProperties().get(CLASS_NAME_PROPERTY);\n if (className == null || className.isEmpty()) className = \"Snippet\";\n return className;\n }",
"class_method_signature": "JavaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_182 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static TextileMarkup markup;",
"type": "TextileMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-textile/src/test/java/com/twasyl/slideshowfx/markup/textile/TextileMarkupTest.java",
"identifier": "TextileMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void generateH2() {\n final String result = markup.convertAsHtml(\"h2. A title\");\n\n assertEquals(\"<h2 id=\\\"Atitle\\\">A title</h2>\", result);\n }",
"class_method_signature": "TextileMarkupTest.generateH2()",
"constructor": false,
"full_signature": "@Test public void generateH2()",
"identifier": "generateH2",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateH2()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(TextileMarkup.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(TextileMarkup.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "slideshowfx-textile/src/main/java/com/twasyl/slideshowfx/markup/textile/TextileMarkup.java",
"identifier": "TextileMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "TextileMarkup.TextileMarkup()",
"constructor": true,
"full_signature": "public TextileMarkup()",
"identifier": "TextileMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " TextileMarkup()",
"testcase": false
},
{
"class_method_signature": "TextileMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n String result = null;\n\n try (final StringWriter writer = new StringWriter()) {\n final DocumentBuilder builder = new HtmlDocumentBuilder(writer);\n final MarkupParser parser = new MarkupParser(new TextileLanguage(), builder);\n\n parser.parse(markupString, false);\n builder.flush();\n writer.flush();\n\n result = writer.toString();\n } catch (IOException e) {\n LOGGER.log(Level.WARNING, \"Error while converting to textile\");\n }\n\n return result;\n }",
"class_method_signature": "TextileMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName",
"parse",
"flush",
"flush",
"toString",
"log"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_71 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/RecentPresentationTest.java",
"identifier": "RecentPresentationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @DisplayName(\"is not equal to an object of different type\")\n void notEqualToDifferentType() {\n final RecentPresentation presentation = new RecentPresentation(\"presentation1.sfx\", null);\n assertFalse(presentation.equals(\"Hello\"));\n }",
"class_method_signature": "RecentPresentationTest.notEqualToDifferentType()",
"constructor": false,
"full_signature": "@Test @DisplayName(\"is not equal to an object of different type\") void notEqualToDifferentType()",
"identifier": "notEqualToDifferentType",
"invocations": [
"assertFalse",
"equals"
],
"modifiers": "@Test @DisplayName(\"is not equal to an object of different type\")",
"parameters": "()",
"return": "void",
"signature": "void notEqualToDifferentType()",
"testcase": true
} | {
"fields": [
{
"declarator": "openedDateTime",
"modifier": "private",
"original_string": "private LocalDateTime openedDateTime;",
"type": "LocalDateTime",
"var_name": "openedDateTime"
},
{
"declarator": "normalizedPath",
"modifier": "private",
"original_string": "private String normalizedPath;",
"type": "String",
"var_name": "normalizedPath"
},
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/RecentPresentation.java",
"identifier": "RecentPresentation",
"interfaces": "implements Comparable<File>",
"methods": [
{
"class_method_signature": "RecentPresentation.RecentPresentation(final String path, final LocalDateTime openedDateTime)",
"constructor": true,
"full_signature": "public RecentPresentation(final String path, final LocalDateTime openedDateTime)",
"identifier": "RecentPresentation",
"modifiers": "public",
"parameters": "(final String path, final LocalDateTime openedDateTime)",
"return": "",
"signature": " RecentPresentation(final String path, final LocalDateTime openedDateTime)",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.getOpenedDateTime()",
"constructor": false,
"full_signature": "public LocalDateTime getOpenedDateTime()",
"identifier": "getOpenedDateTime",
"modifiers": "public",
"parameters": "()",
"return": "LocalDateTime",
"signature": "LocalDateTime getOpenedDateTime()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.setOpenedDateTime(LocalDateTime openedDateTime)",
"constructor": false,
"full_signature": "public void setOpenedDateTime(LocalDateTime openedDateTime)",
"identifier": "setOpenedDateTime",
"modifiers": "public",
"parameters": "(LocalDateTime openedDateTime)",
"return": "void",
"signature": "void setOpenedDateTime(LocalDateTime openedDateTime)",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.getId()",
"constructor": false,
"full_signature": "public String getId()",
"identifier": "getId",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getId()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.getNormalizedPath()",
"constructor": false,
"full_signature": "public String getNormalizedPath()",
"identifier": "getNormalizedPath",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getNormalizedPath()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.equals(Object o)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object o)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(Object o)",
"return": "boolean",
"signature": "boolean equals(Object o)",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.compareTo(File o)",
"constructor": false,
"full_signature": "@Override public int compareTo(File o)",
"identifier": "compareTo",
"modifiers": "@Override public",
"parameters": "(File o)",
"return": "int",
"signature": "int compareTo(File o)",
"testcase": false
}
],
"superclass": "extends File"
} | {
"body": "@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n if (!super.equals(o)) return false;\n\n final RecentPresentation that = (RecentPresentation) o;\n\n return getNormalizedPath().equals(that.getNormalizedPath());\n }",
"class_method_signature": "RecentPresentation.equals(Object o)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object o)",
"identifier": "equals",
"invocations": [
"getClass",
"getClass",
"equals",
"equals",
"getNormalizedPath",
"getNormalizedPath"
],
"modifiers": "@Override public",
"parameters": "(Object o)",
"return": "boolean",
"signature": "boolean equals(Object o)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_189 | {
"fields": [
{
"declarator": "snippetExecutor = new GoSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoSnippetExecutor snippetExecutor = new GoSnippetExecutor();",
"type": "GoSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-go-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutorTest.java",
"identifier": "GoSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void emptyPackageName() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(PACKAGE_NAME_PROPERTY, \"\");\n\n assertEquals(\"slideshowfx\", snippetExecutor.determinePackageName(snippet));\n }",
"class_method_signature": "GoSnippetExecutorTest.emptyPackageName()",
"constructor": false,
"full_signature": "@Test public void emptyPackageName()",
"identifier": "emptyPackageName",
"invocations": [
"put",
"getProperties",
"assertEquals",
"determinePackageName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void emptyPackageName()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GO_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String GO_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GO_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "PACKAGE_NAME_PROPERTY = \"package\"",
"modifier": "protected static final",
"original_string": "protected static final String PACKAGE_NAME_PROPERTY = \"package\";",
"type": "String",
"var_name": "PACKAGE_NAME_PROPERTY"
}
],
"file": "slideshowfx-go-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutor.java",
"identifier": "GoSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GoSnippetExecutor.GoSnippetExecutor()",
"constructor": true,
"full_signature": "public GoSnippetExecutor()",
"identifier": "GoSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GoSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getStartPackageDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartPackageDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.determinePackageName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determinePackageName(final CodeSnippet codeSnippet)",
"identifier": "determinePackageName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determinePackageName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GoSnippetExecutorOptions>"
} | {
"body": "protected String determinePackageName(final CodeSnippet codeSnippet) {\n String packageName = codeSnippet.getProperties().get(PACKAGE_NAME_PROPERTY);\n if (packageName == null || packageName.isEmpty()) packageName = \"slideshowfx\";\n return packageName;\n }",
"class_method_signature": "GoSnippetExecutor.determinePackageName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determinePackageName(final CodeSnippet codeSnippet)",
"identifier": "determinePackageName",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determinePackageName(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_95 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void findExistingRecentPresentation() throws Exception {\n final RecentPresentation recentPresentation1 = new RecentPresentation(\"presentation1.sfx\", LocalDateTime.now());\n final RecentPresentation recentPresentation2 = new RecentPresentation(\"presentation2.sfx\", recentPresentation1.getOpenedDateTime().plusDays(2));\n\n final String xml = this.createXmlStringFromRecentPresentations(recentPresentation1, recentPresentation2);\n final Document document = createDocumentFromString(xml);\n\n Node node = ContextFileWorker.findRecentPresentationNodeFromID(document, recentPresentation1);\n assertRecentPresentationNode(node, recentPresentation1);\n\n node = ContextFileWorker.findRecentPresentationNodeFromID(document, recentPresentation2);\n assertRecentPresentationNode(node, recentPresentation2);\n }",
"class_method_signature": "ContextFileWorkerTest.findExistingRecentPresentation()",
"constructor": false,
"full_signature": "@Test public void findExistingRecentPresentation()",
"identifier": "findExistingRecentPresentation",
"invocations": [
"now",
"plusDays",
"getOpenedDateTime",
"createXmlStringFromRecentPresentations",
"createDocumentFromString",
"findRecentPresentationNodeFromID",
"assertRecentPresentationNode",
"findRecentPresentationNodeFromID",
"assertRecentPresentationNode"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void findExistingRecentPresentation()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation) throws ContextFileException {\n final StringBuilder expression = new StringBuilder(\"/\").append(ROOT_TAG)\n .append(\"/\").append(RECENT_PRESENTATIONS_TAG)\n .append(\"/\").append(RECENT_PRESENTATION_TAG)\n .append(\"[\").append(ID_TAG).append(\" = '\").append(recentPresentation.getId())\n .append(\"'][1]\");\n\n try {\n return (Node) xpath().evaluate(expression.toString(), document.getDocumentElement(), NODE);\n } catch (XPathExpressionException e) {\n throw new ContextFileException(e);\n }\n }",
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"invocations": [
"append",
"append",
"append",
"append",
"append",
"append",
"append",
"append",
"append",
"append",
"getId",
"evaluate",
"xpath",
"toString",
"getDocumentElement"
],
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_166 | {
"fields": [
{
"declarator": "quiz",
"modifier": "private static",
"original_string": "private static Quiz quiz;",
"type": "Quiz",
"var_name": "quiz"
}
],
"file": "slideshowfx-server/src/test/java/com/twasyl/slideshowfx/server/beans/quiz/QuizTest.java",
"identifier": "QuizTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWithoutAllCorrectAnswers() {\n assertFalse(quiz.checkAnswers(2L));\n }",
"class_method_signature": "QuizTest.testWithoutAllCorrectAnswers()",
"constructor": false,
"full_signature": "@Test public void testWithoutAllCorrectAnswers()",
"identifier": "testWithoutAllCorrectAnswers",
"invocations": [
"assertFalse",
"checkAnswers"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testWithoutAllCorrectAnswers()",
"testcase": true
} | {
"fields": [
{
"declarator": "id = new SimpleLongProperty()",
"modifier": "private",
"original_string": "private LongProperty id = new SimpleLongProperty();",
"type": "LongProperty",
"var_name": "id"
},
{
"declarator": "question = new SimpleObjectProperty<>()",
"modifier": "private",
"original_string": "private ObjectProperty<Question> question = new SimpleObjectProperty<>();",
"type": "ObjectProperty<Question>",
"var_name": "question"
},
{
"declarator": "answers = new SimpleListProperty<>(FXCollections.observableArrayList())",
"modifier": "private",
"original_string": "private ListProperty<Answer> answers = new SimpleListProperty<>(FXCollections.observableArrayList());",
"type": "ListProperty<Answer>",
"var_name": "answers"
}
],
"file": "slideshowfx-server/src/main/java/com/twasyl/slideshowfx/server/beans/quiz/Quiz.java",
"identifier": "Quiz",
"interfaces": "",
"methods": [
{
"class_method_signature": "Quiz.idProperty()",
"constructor": false,
"full_signature": "public LongProperty idProperty()",
"identifier": "idProperty",
"modifiers": "public",
"parameters": "()",
"return": "LongProperty",
"signature": "LongProperty idProperty()",
"testcase": false
},
{
"class_method_signature": "Quiz.getId()",
"constructor": false,
"full_signature": "public long getId()",
"identifier": "getId",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getId()",
"testcase": false
},
{
"class_method_signature": "Quiz.setId(long id)",
"constructor": false,
"full_signature": "public void setId(long id)",
"identifier": "setId",
"modifiers": "public",
"parameters": "(long id)",
"return": "void",
"signature": "void setId(long id)",
"testcase": false
},
{
"class_method_signature": "Quiz.getQuestion()",
"constructor": false,
"full_signature": "public Question getQuestion()",
"identifier": "getQuestion",
"modifiers": "public",
"parameters": "()",
"return": "Question",
"signature": "Question getQuestion()",
"testcase": false
},
{
"class_method_signature": "Quiz.questionProperty()",
"constructor": false,
"full_signature": "public ObjectProperty<Question> questionProperty()",
"identifier": "questionProperty",
"modifiers": "public",
"parameters": "()",
"return": "ObjectProperty<Question>",
"signature": "ObjectProperty<Question> questionProperty()",
"testcase": false
},
{
"class_method_signature": "Quiz.setQuestion(Question question)",
"constructor": false,
"full_signature": "public void setQuestion(Question question)",
"identifier": "setQuestion",
"modifiers": "public",
"parameters": "(Question question)",
"return": "void",
"signature": "void setQuestion(Question question)",
"testcase": false
},
{
"class_method_signature": "Quiz.answersProperty()",
"constructor": false,
"full_signature": "public ListProperty<Answer> answersProperty()",
"identifier": "answersProperty",
"modifiers": "public",
"parameters": "()",
"return": "ListProperty<Answer>",
"signature": "ListProperty<Answer> answersProperty()",
"testcase": false
},
{
"class_method_signature": "Quiz.getAnswers()",
"constructor": false,
"full_signature": "public ObservableList<Answer> getAnswers()",
"identifier": "getAnswers",
"modifiers": "public",
"parameters": "()",
"return": "ObservableList<Answer>",
"signature": "ObservableList<Answer> getAnswers()",
"testcase": false
},
{
"class_method_signature": "Quiz.setAnswers(ObservableList<Answer> answers)",
"constructor": false,
"full_signature": "public void setAnswers(ObservableList<Answer> answers)",
"identifier": "setAnswers",
"modifiers": "public",
"parameters": "(ObservableList<Answer> answers)",
"return": "void",
"signature": "void setAnswers(ObservableList<Answer> answers)",
"testcase": false
},
{
"class_method_signature": "Quiz.getCorrectAnswers()",
"constructor": false,
"full_signature": "public FilteredList<Answer> getCorrectAnswers()",
"identifier": "getCorrectAnswers",
"modifiers": "public",
"parameters": "()",
"return": "FilteredList<Answer>",
"signature": "FilteredList<Answer> getCorrectAnswers()",
"testcase": false
},
{
"class_method_signature": "Quiz.checkAnswers(Long... answersIDs)",
"constructor": false,
"full_signature": "public boolean checkAnswers(Long... answersIDs)",
"identifier": "checkAnswers",
"modifiers": "public",
"parameters": "(Long... answersIDs)",
"return": "boolean",
"signature": "boolean checkAnswers(Long... answersIDs)",
"testcase": false
},
{
"class_method_signature": "Quiz.toJSON()",
"constructor": false,
"full_signature": "public JsonObject toJSON()",
"identifier": "toJSON",
"modifiers": "public",
"parameters": "()",
"return": "JsonObject",
"signature": "JsonObject toJSON()",
"testcase": false
},
{
"class_method_signature": "Quiz.toJSONString()",
"constructor": false,
"full_signature": "public String toJSONString()",
"identifier": "toJSONString",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String toJSONString()",
"testcase": false
},
{
"class_method_signature": "Quiz.build(final String json)",
"constructor": false,
"full_signature": "public static Quiz build(final String json)",
"identifier": "build",
"modifiers": "public static",
"parameters": "(final String json)",
"return": "Quiz",
"signature": "Quiz build(final String json)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public boolean checkAnswers(Long... answersIDs) {\n boolean correct = answersIDs != null && answersIDs.length > 0;\n\n // Avoid unnecessary treatment and variable assignment\n if (correct) {\n final List<Answer> correctAnswers = this.getAnswers().filtered(Answer::isCorrect);\n\n /* If the size of the list of expected answers are not the same that the size of the given ansewers,\n * it is unnecessary to continue.\n */\n correct = correctAnswers.size() == answersIDs.length;\n if (correct) {\n final List<Long> answersIDsList = Arrays.asList(answersIDs);\n\n int index = 0;\n // The \"real\" number of correct answers received.\n int numberOfCorrectAnswersReceived = 0;\n\n /*\n * Loop on every correct answer while everything is correct\n */\n while (index < correctAnswers.size() && correct) {\n correct = answersIDsList.contains(correctAnswers.get(index).getId());\n\n if (correct) numberOfCorrectAnswersReceived++;\n\n index++;\n }\n\n correct = numberOfCorrectAnswersReceived == correctAnswers.size();\n }\n }\n\n return correct;\n }",
"class_method_signature": "Quiz.checkAnswers(Long... answersIDs)",
"constructor": false,
"full_signature": "public boolean checkAnswers(Long... answersIDs)",
"identifier": "checkAnswers",
"invocations": [
"filtered",
"getAnswers",
"size",
"asList",
"size",
"contains",
"getId",
"get",
"size"
],
"modifiers": "public",
"parameters": "(Long... answersIDs)",
"return": "boolean",
"signature": "boolean checkAnswers(Long... answersIDs)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_131 | {
"fields": [
{
"declarator": "snippetExecutor = new KotlinSnippetExecutor()",
"modifier": "private final",
"original_string": "private final KotlinSnippetExecutor snippetExecutor = new KotlinSnippetExecutor();",
"type": "KotlinSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-kotlin-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/kotlin/KotlinSnippetExecutorTest.java",
"identifier": "KotlinSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void formatPackageWithoutPackageKeyword() {\n assertEquals(\"package SlideshowFX\", snippetExecutor.formatPackageName(\"SlideshowFX\"));\n }",
"class_method_signature": "KotlinSnippetExecutorTest.formatPackageWithoutPackageKeyword()",
"constructor": false,
"full_signature": "@Test public void formatPackageWithoutPackageKeyword()",
"identifier": "formatPackageWithoutPackageKeyword",
"invocations": [
"assertEquals",
"formatPackageName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void formatPackageWithoutPackageKeyword()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "KOTLIN_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String KOTLIN_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "KOTLIN_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "PACKAGE_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String PACKAGE_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "PACKAGE_NAME_PROPERTY"
}
],
"file": "slideshowfx-kotlin-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/kotlin/KotlinSnippetExecutor.java",
"identifier": "KotlinSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "KotlinSnippetExecutor.KotlinSnippetExecutor()",
"constructor": true,
"full_signature": "public KotlinSnippetExecutor()",
"identifier": "KotlinSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " KotlinSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.hasPackage(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasPackage(final CodeSnippet codeSnippet)",
"identifier": "hasPackage",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasPackage(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getPackage(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getPackage(final CodeSnippet codeSnippet)",
"identifier": "getPackage",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getPackage(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.formatPackageName(final String packageName)",
"constructor": false,
"full_signature": "protected String formatPackageName(final String packageName)",
"identifier": "formatPackageName",
"modifiers": "protected",
"parameters": "(final String packageName)",
"return": "String",
"signature": "String formatPackageName(final String packageName)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<KotlinSnippetExecutorOptions>"
} | {
"body": "protected String formatPackageName(final String packageName) {\n final String packageLineBeginning = \"package \";\n\n String formattedPackageLine;\n\n if (packageName.startsWith(packageLineBeginning)) {\n formattedPackageLine = packageName;\n } else {\n formattedPackageLine = packageLineBeginning.concat(packageName);\n }\n\n return formattedPackageLine;\n }",
"class_method_signature": "KotlinSnippetExecutor.formatPackageName(final String packageName)",
"constructor": false,
"full_signature": "protected String formatPackageName(final String packageName)",
"identifier": "formatPackageName",
"invocations": [
"startsWith",
"concat"
],
"modifiers": "protected",
"parameters": "(final String packageName)",
"return": "String",
"signature": "String formatPackageName(final String packageName)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_127 | {
"fields": [
{
"declarator": "snippetExecutor = new KotlinSnippetExecutor()",
"modifier": "private final",
"original_string": "private final KotlinSnippetExecutor snippetExecutor = new KotlinSnippetExecutor();",
"type": "KotlinSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-kotlin-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/kotlin/KotlinSnippetExecutorTest.java",
"identifier": "KotlinSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hasPackage() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(PACKAGE_NAME_PROPERTY, \"SlideshowFX\");\n\n assertTrue(snippetExecutor.hasPackage(snippet));\n }",
"class_method_signature": "KotlinSnippetExecutorTest.hasPackage()",
"constructor": false,
"full_signature": "@Test public void hasPackage()",
"identifier": "hasPackage",
"invocations": [
"put",
"getProperties",
"assertTrue",
"hasPackage"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void hasPackage()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(KotlinSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "KOTLIN_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String KOTLIN_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "KOTLIN_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "PACKAGE_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String PACKAGE_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "PACKAGE_NAME_PROPERTY"
}
],
"file": "slideshowfx-kotlin-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/kotlin/KotlinSnippetExecutor.java",
"identifier": "KotlinSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "KotlinSnippetExecutor.KotlinSnippetExecutor()",
"constructor": true,
"full_signature": "public KotlinSnippetExecutor()",
"identifier": "KotlinSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " KotlinSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.hasPackage(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasPackage(final CodeSnippet codeSnippet)",
"identifier": "hasPackage",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasPackage(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getPackage(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getPackage(final CodeSnippet codeSnippet)",
"identifier": "getPackage",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getPackage(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.formatPackageName(final String packageName)",
"constructor": false,
"full_signature": "protected String formatPackageName(final String packageName)",
"identifier": "formatPackageName",
"modifiers": "protected",
"parameters": "(final String packageName)",
"return": "String",
"signature": "String formatPackageName(final String packageName)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "KotlinSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<KotlinSnippetExecutorOptions>"
} | {
"body": "protected boolean hasPackage(final CodeSnippet codeSnippet) {\n final String packageName = codeSnippet.getProperties().get(PACKAGE_NAME_PROPERTY);\n return packageName != null && !packageName.isEmpty();\n }",
"class_method_signature": "KotlinSnippetExecutor.hasPackage(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasPackage(final CodeSnippet codeSnippet)",
"identifier": "hasPackage",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasPackage(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_83 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void createRecentPresentationFromNodeWithoutChildren() {\n final Node node = createRecentPresentationNode();\n final RecentPresentation recentPresentation = ContextFileWorker.buildRecentPresentationFromNode(node);\n\n assertNull(recentPresentation);\n }",
"class_method_signature": "ContextFileWorkerTest.createRecentPresentationFromNodeWithoutChildren()",
"constructor": false,
"full_signature": "@Test public void createRecentPresentationFromNodeWithoutChildren()",
"identifier": "createRecentPresentationFromNodeWithoutChildren",
"invocations": [
"createRecentPresentationNode",
"buildRecentPresentationFromNode",
"assertNull"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void createRecentPresentationFromNodeWithoutChildren()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node) {\n RecentPresentation recentPresentation = null;\n LocalDateTime openedDateTime = null;\n String path = null;\n\n final NodeList children = node.getChildNodes();\n int index = 0;\n\n while (index < children.getLength() && (openedDateTime == null || path == null)) {\n final Node child = children.item(index++);\n\n switch (child.getNodeName()) {\n case OPENED_DATE_TIME_TAG:\n openedDateTime = LocalDateTime.parse(child.getTextContent());\n break;\n case FILE_TAG:\n path = child.getTextContent();\n break;\n default:\n LOGGER.fine(child.getNodeName() + \" not supported\");\n }\n }\n\n if (openedDateTime != null && path != null) {\n recentPresentation = new RecentPresentation(path, openedDateTime);\n }\n\n return recentPresentation;\n }",
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"invocations": [
"getChildNodes",
"getLength",
"item",
"getNodeName",
"parse",
"getTextContent",
"getTextContent",
"fine",
"getNodeName"
],
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_170 | {
"fields": [],
"file": "slideshowfx-ui-controls/src/test/java/com/twasyl/slideshowfx/ui/controls/validators/ValidatorsTest.java",
"identifier": "ValidatorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isNotEmptyWithEmptyString() {\n assertFalse(isNotEmpty().isValid(\"\"));\n }",
"class_method_signature": "ValidatorsTest.isNotEmptyWithEmptyString()",
"constructor": false,
"full_signature": "@Test public void isNotEmptyWithEmptyString()",
"identifier": "isNotEmptyWithEmptyString",
"invocations": [
"assertFalse",
"isValid",
"isNotEmpty"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void isNotEmptyWithEmptyString()",
"testcase": true
} | {
"fields": [],
"file": "slideshowfx-ui-controls/src/main/java/com/twasyl/slideshowfx/ui/controls/validators/Validators.java",
"identifier": "Validators",
"interfaces": "",
"methods": [
{
"class_method_signature": "Validators.isNotEmpty()",
"constructor": false,
"full_signature": "public static IValidator<String> isNotEmpty()",
"identifier": "isNotEmpty",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isNotEmpty()",
"testcase": false
},
{
"class_method_signature": "Validators.isInteger()",
"constructor": false,
"full_signature": "public static IValidator<String> isInteger()",
"identifier": "isInteger",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isInteger()",
"testcase": false
},
{
"class_method_signature": "Validators.isIntegerOrBlank()",
"constructor": false,
"full_signature": "public static IValidator<String> isIntegerOrBlank()",
"identifier": "isIntegerOrBlank",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isIntegerOrBlank()",
"testcase": false
},
{
"class_method_signature": "Validators.isDouble()",
"constructor": false,
"full_signature": "public static IValidator<String> isDouble()",
"identifier": "isDouble",
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isDouble()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static IValidator<String> isNotEmpty() {\n return value -> value != null && !value.isBlank();\n }",
"class_method_signature": "Validators.isNotEmpty()",
"constructor": false,
"full_signature": "public static IValidator<String> isNotEmpty()",
"identifier": "isNotEmpty",
"invocations": [
"isBlank"
],
"modifiers": "public static",
"parameters": "()",
"return": "IValidator<String>",
"signature": "IValidator<String> isNotEmpty()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_17 | {
"fields": [
{
"declarator": "snippetExecutor = new GoloSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoloSnippetExecutor snippetExecutor = new GoloSnippetExecutor();",
"type": "GoloSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-golo-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/golo/GoloSnippetExecutorTest.java",
"identifier": "GoloSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hasEmptyImports() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(IMPORTS_PROPERTY, \"\");\n\n assertFalse(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "GoloSnippetExecutorTest.hasEmptyImports()",
"constructor": false,
"full_signature": "@Test public void hasEmptyImports()",
"identifier": "hasEmptyImports",
"invocations": [
"put",
"getProperties",
"assertFalse",
"hasImports"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void hasEmptyImports()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoloSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoloSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GOLO_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String GOLO_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GOLO_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "MODULE_NAME_PROPERTY = \"module\"",
"modifier": "protected static final",
"original_string": "protected static final String MODULE_NAME_PROPERTY = \"module\";",
"type": "String",
"var_name": "MODULE_NAME_PROPERTY"
}
],
"file": "slideshowfx-golo-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/golo/GoloSnippetExecutor.java",
"identifier": "GoloSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GoloSnippetExecutor.GoloSnippetExecutor()",
"constructor": true,
"full_signature": "public GoloSnippetExecutor()",
"identifier": "GoloSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GoloSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.getStartModuleDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartModuleDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartModuleDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartModuleDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.determineModuleName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineModuleName(final CodeSnippet codeSnippet)",
"identifier": "determineModuleName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineModuleName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GoloSnippetExecutorOptions>"
} | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "GoloSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_40 | {
"fields": [],
"file": "slideshowfx-icons/src/test/java/com/twasyl/slideshowfx/icons/FontAwesomeTest.java",
"identifier": "FontAwesomeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void obtainRegularFontFile() throws URISyntaxException {\n assertFontAwesomeUrl(FontAwesome.getFontAwesomeFontFile(REGULAR));\n }",
"class_method_signature": "FontAwesomeTest.obtainRegularFontFile()",
"constructor": false,
"full_signature": "@Test public void obtainRegularFontFile()",
"identifier": "obtainRegularFontFile",
"invocations": [
"assertFontAwesomeUrl",
"getFontAwesomeFontFile"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void obtainRegularFontFile()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(FontAwesome.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(FontAwesome.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "FACTORY = new StyleablePropertyFactory<>(Text.getClassCssMetaData())",
"modifier": "private static final",
"original_string": "private static final StyleablePropertyFactory<FontAwesome> FACTORY = new StyleablePropertyFactory<>(Text.getClassCssMetaData());",
"type": "StyleablePropertyFactory<FontAwesome>",
"var_name": "FACTORY"
},
{
"declarator": "FONTAWESOME_VERSION = \"5.14.0\"",
"modifier": "private static final",
"original_string": "private static final String FONTAWESOME_VERSION = \"5.14.0\";",
"type": "String",
"var_name": "FONTAWESOME_VERSION"
},
{
"declarator": "FONTAWESOME_ROOT = \"/com/twasyl/slideshowfx/icons/fontawesome/\" + FONTAWESOME_VERSION.replaceAll(\"\\\\.\", \"_\") + \"/\"",
"modifier": "private static final",
"original_string": "private static final String FONTAWESOME_ROOT = \"/com/twasyl/slideshowfx/icons/fontawesome/\" + FONTAWESOME_VERSION.replaceAll(\"\\\\.\", \"_\") + \"/\";",
"type": "String",
"var_name": "FONTAWESOME_ROOT"
},
{
"declarator": "FONT_CACHE = new HashMap<>()",
"modifier": "private static final",
"original_string": "private static final Map<FontCacheKey, Font> FONT_CACHE = new HashMap<>();",
"type": "Map<FontCacheKey, Font>",
"var_name": "FONT_CACHE"
},
{
"declarator": "icon = new SimpleObjectProperty<>(Icon.FOLDER_OPEN)",
"modifier": "private final",
"original_string": "private final ObjectProperty<Icon> icon = new SimpleObjectProperty<>(Icon.FOLDER_OPEN);",
"type": "ObjectProperty<Icon>",
"var_name": "icon"
},
{
"declarator": "iconColor =\n FACTORY.createStyleablePaintProperty(this, \"iconColor\", \"-fx-icon-color\", s -> s.iconColor, Color.WHITE)",
"modifier": "private final",
"original_string": "private final StyleableProperty<Paint> iconColor =\n FACTORY.createStyleablePaintProperty(this, \"iconColor\", \"-fx-icon-color\", s -> s.iconColor, Color.WHITE);",
"type": "StyleableProperty<Paint>",
"var_name": "iconColor"
},
{
"declarator": "iconSize = new SimpleStyleableDoubleProperty(\n FACTORY.createSizeCssMetaData(\"-fx-icon-size\", s -> s.iconSize, 10d), this, \"iconSize\")",
"modifier": "private final",
"original_string": "private final StyleableDoubleProperty iconSize = new SimpleStyleableDoubleProperty(\n FACTORY.createSizeCssMetaData(\"-fx-icon-size\", s -> s.iconSize, 10d), this, \"iconSize\");",
"type": "StyleableDoubleProperty",
"var_name": "iconSize"
}
],
"file": "slideshowfx-icons/src/main/java/com/twasyl/slideshowfx/icons/FontAwesome.java",
"identifier": "FontAwesome",
"interfaces": "",
"methods": [
{
"class_method_signature": "FontAwesome.FontAwesome()",
"constructor": true,
"full_signature": "public FontAwesome()",
"identifier": "FontAwesome",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " FontAwesome()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.FontAwesome(final Icon icon)",
"constructor": true,
"full_signature": "public FontAwesome(final Icon icon)",
"identifier": "FontAwesome",
"modifiers": "public",
"parameters": "(final Icon icon)",
"return": "",
"signature": " FontAwesome(final Icon icon)",
"testcase": false
},
{
"class_method_signature": "FontAwesome.FontAwesome(final Icon icon, final Double iconSize)",
"constructor": true,
"full_signature": "public FontAwesome(final Icon icon, final Double iconSize)",
"identifier": "FontAwesome",
"modifiers": "public",
"parameters": "(final Icon icon, final Double iconSize)",
"return": "",
"signature": " FontAwesome(final Icon icon, final Double iconSize)",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getCssMetaData()",
"constructor": false,
"full_signature": "@Override public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()",
"identifier": "getCssMetaData",
"modifiers": "@Override public",
"parameters": "()",
"return": "List<CssMetaData<? extends Styleable, ?>>",
"signature": "List<CssMetaData<? extends Styleable, ?>> getCssMetaData()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getFontAwesomeFont(final Icon icon, final double size)",
"constructor": false,
"full_signature": "protected Font getFontAwesomeFont(final Icon icon, final double size)",
"identifier": "getFontAwesomeFont",
"modifiers": "protected",
"parameters": "(final Icon icon, final double size)",
"return": "Font",
"signature": "Font getFontAwesomeFont(final Icon icon, final double size)",
"testcase": false
},
{
"class_method_signature": "FontAwesome.definePropertyListeners()",
"constructor": false,
"full_signature": "protected void definePropertyListeners()",
"identifier": "definePropertyListeners",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void definePropertyListeners()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.defineBindings()",
"constructor": false,
"full_signature": "protected void defineBindings()",
"identifier": "defineBindings",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void defineBindings()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.iconProperty()",
"constructor": false,
"full_signature": "public ObjectProperty<Icon> iconProperty()",
"identifier": "iconProperty",
"modifiers": "public",
"parameters": "()",
"return": "ObjectProperty<Icon>",
"signature": "ObjectProperty<Icon> iconProperty()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getIcon()",
"constructor": false,
"full_signature": "public Icon getIcon()",
"identifier": "getIcon",
"modifiers": "public",
"parameters": "()",
"return": "Icon",
"signature": "Icon getIcon()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.setIcon(Icon icon)",
"constructor": false,
"full_signature": "public void setIcon(Icon icon)",
"identifier": "setIcon",
"modifiers": "public",
"parameters": "(Icon icon)",
"return": "void",
"signature": "void setIcon(Icon icon)",
"testcase": false
},
{
"class_method_signature": "FontAwesome.iconSizeProperty()",
"constructor": false,
"full_signature": "public DoubleProperty iconSizeProperty()",
"identifier": "iconSizeProperty",
"modifiers": "public",
"parameters": "()",
"return": "DoubleProperty",
"signature": "DoubleProperty iconSizeProperty()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getIconSize()",
"constructor": false,
"full_signature": "public Double getIconSize()",
"identifier": "getIconSize",
"modifiers": "public",
"parameters": "()",
"return": "Double",
"signature": "Double getIconSize()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.setIconSize(Double iconSize)",
"constructor": false,
"full_signature": "public void setIconSize(Double iconSize)",
"identifier": "setIconSize",
"modifiers": "public",
"parameters": "(Double iconSize)",
"return": "void",
"signature": "void setIconSize(Double iconSize)",
"testcase": false
},
{
"class_method_signature": "FontAwesome.iconColorProperty()",
"constructor": false,
"full_signature": "public ObjectProperty<Paint> iconColorProperty()",
"identifier": "iconColorProperty",
"modifiers": "public",
"parameters": "()",
"return": "ObjectProperty<Paint>",
"signature": "ObjectProperty<Paint> iconColorProperty()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getIconColor()",
"constructor": false,
"full_signature": "public Paint getIconColor()",
"identifier": "getIconColor",
"modifiers": "public",
"parameters": "()",
"return": "Paint",
"signature": "Paint getIconColor()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.setIconColor(Paint color)",
"constructor": false,
"full_signature": "public void setIconColor(Paint color)",
"identifier": "setIconColor",
"modifiers": "public",
"parameters": "(Paint color)",
"return": "void",
"signature": "void setIconColor(Paint color)",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getFontAwesomeVersion()",
"constructor": false,
"full_signature": "public static String getFontAwesomeVersion()",
"identifier": "getFontAwesomeVersion",
"modifiers": "public static",
"parameters": "()",
"return": "String",
"signature": "String getFontAwesomeVersion()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getFontAwesomeFontFile(final FontType type)",
"constructor": false,
"full_signature": "public static URL getFontAwesomeFontFile(final FontType type)",
"identifier": "getFontAwesomeFontFile",
"modifiers": "public static",
"parameters": "(final FontType type)",
"return": "URL",
"signature": "URL getFontAwesomeFontFile(final FontType type)",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getFontAwesomeJSFile()",
"constructor": false,
"full_signature": "public static URL getFontAwesomeJSFile()",
"identifier": "getFontAwesomeJSFile",
"modifiers": "public static",
"parameters": "()",
"return": "URL",
"signature": "URL getFontAwesomeJSFile()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getFontAwesomeJSFilename()",
"constructor": false,
"full_signature": "public static String getFontAwesomeJSFilename()",
"identifier": "getFontAwesomeJSFilename",
"modifiers": "public static",
"parameters": "()",
"return": "String",
"signature": "String getFontAwesomeJSFilename()",
"testcase": false
},
{
"class_method_signature": "FontAwesome.getFontAwesomeFile(final String relativePath)",
"constructor": false,
"full_signature": "public static URL getFontAwesomeFile(final String relativePath)",
"identifier": "getFontAwesomeFile",
"modifiers": "public static",
"parameters": "(final String relativePath)",
"return": "URL",
"signature": "URL getFontAwesomeFile(final String relativePath)",
"testcase": false
}
],
"superclass": "extends Text"
} | {
"body": "public static URL getFontAwesomeFontFile(final FontType type) {\n final StringBuilder path = new StringBuilder(\"fonts/fontawesome-\")\n .append(type.name().toLowerCase()).append(\".otf\");\n\n return getFontAwesomeFile(path.toString());\n }",
"class_method_signature": "FontAwesome.getFontAwesomeFontFile(final FontType type)",
"constructor": false,
"full_signature": "public static URL getFontAwesomeFontFile(final FontType type)",
"identifier": "getFontAwesomeFontFile",
"invocations": [
"append",
"append",
"toLowerCase",
"name",
"getFontAwesomeFile",
"toString"
],
"modifiers": "public static",
"parameters": "(final FontType type)",
"return": "URL",
"signature": "URL getFontAwesomeFontFile(final FontType type)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_56 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-groovy-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutorTest.java",
"identifier": "GroovySnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hasNoImports() {\n final CodeSnippet snippet = new CodeSnippet();\n\n assertFalse(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "GroovySnippetExecutorTest.hasNoImports()",
"constructor": false,
"full_signature": "@Test public void hasNoImports()",
"identifier": "hasNoImports",
"invocations": [
"assertFalse",
"hasImports"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void hasNoImports()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GROOVY_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String GROOVY_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GROOVY_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\";",
"type": "String",
"var_name": "WRAP_IN_METHOD_RUNNER"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
},
{
"declarator": "MAKE_SCRIPT = \"makeScript\"",
"modifier": "protected static final",
"original_string": "protected static final String MAKE_SCRIPT = \"makeScript\";",
"type": "String",
"var_name": "MAKE_SCRIPT"
}
],
"file": "slideshowfx-groovy-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutor.java",
"identifier": "GroovySnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GroovySnippetExecutor.GroovySnippetExecutor()",
"constructor": true,
"full_signature": "public GroovySnippetExecutor()",
"identifier": "GroovySnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GroovySnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.makeScript(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean makeScript(final CodeSnippet codeSnippet)",
"identifier": "makeScript",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean makeScript(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getScriptImport()",
"constructor": false,
"full_signature": "protected String getScriptImport()",
"identifier": "getScriptImport",
"modifiers": "protected",
"parameters": "()",
"return": "String",
"signature": "String getScriptImport()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartMainMethod(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartMainMethod(final CodeSnippet codeSnippet)",
"identifier": "getStartMainMethod",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartMainMethod(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GroovySnippetExecutorOptions>"
} | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "GroovySnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_99 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorkerTest.java",
"identifier": "ContextFileWorkerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void purgeRecentPresentations() throws ContextFileException {\n final int numberOfRecentPresentationsToKeep = 2;\n final RecentPresentation recentPresentation1 = new RecentPresentation(\"presentation1.sfx\", LocalDateTime.now());\n final RecentPresentation recentPresentation2 = new RecentPresentation(\"presentation2.sfx\", recentPresentation1.getOpenedDateTime().plusDays(2));\n final RecentPresentation recentPresentation3 = new RecentPresentation(\"presentation3.sfx\", recentPresentation2.getOpenedDateTime().plusDays(2));\n final RecentPresentation recentPresentation4 = new RecentPresentation(\"presentation4.sfx\", null);\n\n final String xml = this.createXmlStringFromRecentPresentations(recentPresentation1, recentPresentation2, recentPresentation3, recentPresentation4);\n\n final ByteArrayInputStream input = new ByteArrayInputStream(xml.getBytes(UTF_8));\n final ByteArrayOutputStream output = new ByteArrayOutputStream();\n\n final Set<RecentPresentation> presentations = ContextFileWorker.purgeRecentPresentations(input, output, numberOfRecentPresentationsToKeep);\n assertEquals(numberOfRecentPresentationsToKeep, presentations.size());\n\n final Iterator<RecentPresentation> iterator = presentations.iterator();\n RecentPresentation recentPresentation = iterator.next();\n assertNotNull(recentPresentation);\n assertEquals(recentPresentation2.getId(), recentPresentation.getId());\n\n recentPresentation = iterator.next();\n assertNotNull(recentPresentation);\n assertEquals(recentPresentation3.getId(), recentPresentation.getId());\n }",
"class_method_signature": "ContextFileWorkerTest.purgeRecentPresentations()",
"constructor": false,
"full_signature": "@Test public void purgeRecentPresentations()",
"identifier": "purgeRecentPresentations",
"invocations": [
"now",
"plusDays",
"getOpenedDateTime",
"plusDays",
"getOpenedDateTime",
"createXmlStringFromRecentPresentations",
"getBytes",
"purgeRecentPresentations",
"assertEquals",
"size",
"iterator",
"next",
"assertNotNull",
"assertEquals",
"getId",
"getId",
"next",
"assertNotNull",
"assertEquals",
"getId",
"getId"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void purgeRecentPresentations()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContextFileWorker.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ContextFileWorker.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "documentBuilder",
"modifier": "private static",
"original_string": "private static DocumentBuilder documentBuilder;",
"type": "DocumentBuilder",
"var_name": "documentBuilder"
},
{
"declarator": "XPATH_FACTORY = XPathFactory.newInstance()",
"modifier": "private static final",
"original_string": "private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();",
"type": "XPathFactory",
"var_name": "XPATH_FACTORY"
},
{
"declarator": "ROOT_TAG = \"slideshowfx\"",
"modifier": "protected static final",
"original_string": "protected static final String ROOT_TAG = \"slideshowfx\";",
"type": "String",
"var_name": "ROOT_TAG"
},
{
"declarator": "RECENT_PRESENTATIONS_TAG = \"recentPresentations\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATIONS_TAG = \"recentPresentations\";",
"type": "String",
"var_name": "RECENT_PRESENTATIONS_TAG"
},
{
"declarator": "RECENT_PRESENTATION_TAG = \"recentPresentation\"",
"modifier": "protected static final",
"original_string": "protected static final String RECENT_PRESENTATION_TAG = \"recentPresentation\";",
"type": "String",
"var_name": "RECENT_PRESENTATION_TAG"
},
{
"declarator": "ID_TAG = \"id\"",
"modifier": "protected static final",
"original_string": "protected static final String ID_TAG = \"id\";",
"type": "String",
"var_name": "ID_TAG"
},
{
"declarator": "FILE_TAG = \"file\"",
"modifier": "protected static final",
"original_string": "protected static final String FILE_TAG = \"file\";",
"type": "String",
"var_name": "FILE_TAG"
},
{
"declarator": "OPENED_DATE_TIME_TAG = \"openedDateTime\"",
"modifier": "protected static final",
"original_string": "protected static final String OPENED_DATE_TIME_TAG = \"openedDateTime\";",
"type": "String",
"var_name": "OPENED_DATE_TIME_TAG"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/ContextFileWorker.java",
"identifier": "ContextFileWorker",
"interfaces": "",
"methods": [
{
"class_method_signature": "ContextFileWorker.ContextFileWorker()",
"constructor": true,
"full_signature": "private ContextFileWorker()",
"identifier": "ContextFileWorker",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " ContextFileWorker()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.xpath()",
"constructor": false,
"full_signature": "private static XPath xpath()",
"identifier": "xpath",
"modifiers": "private static",
"parameters": "()",
"return": "XPath",
"signature": "XPath xpath()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.checkContextFileValidity(final File contextFile)",
"constructor": false,
"full_signature": "private static void checkContextFileValidity(final File contextFile)",
"identifier": "checkContextFileValidity",
"modifiers": "private static",
"parameters": "(final File contextFile)",
"return": "void",
"signature": "void checkContextFileValidity(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromFile(final File contextFile)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"identifier": "readRecentPresentationFromFile",
"modifiers": "public static",
"parameters": "(final File contextFile)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromFile(final File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentationToFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentationToFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentationInFile",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentationInFile(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "public static boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "public static",
"parameters": "(final File contextFile, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final File contextFile, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "saveRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void saveRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"identifier": "updateRecentPresentation",
"modifiers": "protected static",
"parameters": "(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"return": "void",
"signature": "void updateRecentPresentation(final InputStream input, final OutputStream output,\n final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"identifier": "recentPresentationAlreadyPresent",
"modifiers": "protected static",
"parameters": "(final InputStream input, final RecentPresentation recentPresentation)",
"return": "boolean",
"signature": "boolean recentPresentationAlreadyPresent(final InputStream input, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.readRecentPresentationFromStream(final InputStream input)",
"constructor": false,
"full_signature": "protected static Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"identifier": "readRecentPresentationFromStream",
"modifiers": "protected static",
"parameters": "(final InputStream input)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> readRecentPresentationFromStream(final InputStream input)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "public static Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"modifiers": "public static",
"parameters": "(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final InputStream input, final OutputStream output, final long numberOfRecentPresentationsToKeep)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRootNode(final Document document)",
"constructor": false,
"full_signature": "private static Node getRootNode(final Document document)",
"identifier": "getRootNode",
"modifiers": "private static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRootNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationsNode(final Document document)",
"constructor": false,
"full_signature": "protected static Node getRecentPresentationsNode(final Document document)",
"identifier": "getRecentPresentationsNode",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "Node",
"signature": "Node getRecentPresentationsNode(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getRecentPresentationNodes(final Node recentPresentationsNode)",
"constructor": false,
"full_signature": "protected static List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"identifier": "getRecentPresentationNodes",
"modifiers": "protected static",
"parameters": "(final Node recentPresentationsNode)",
"return": "List<Node>",
"signature": "List<Node> getRecentPresentationNodes(final Node recentPresentationsNode)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.buildRecentPresentationFromNode(final Node node)",
"constructor": false,
"full_signature": "protected static RecentPresentation buildRecentPresentationFromNode(final Node node)",
"identifier": "buildRecentPresentationFromNode",
"modifiers": "protected static",
"parameters": "(final Node node)",
"return": "RecentPresentation",
"signature": "RecentPresentation buildRecentPresentationFromNode(final Node node)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.populateDocumentIfNecessary(final Document document)",
"constructor": false,
"full_signature": "protected static void populateDocumentIfNecessary(final Document document)",
"identifier": "populateDocumentIfNecessary",
"modifiers": "protected static",
"parameters": "(final Document document)",
"return": "void",
"signature": "void populateDocumentIfNecessary(final Document document)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"identifier": "createNodeFromRecentPresentation",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node createNodeFromRecentPresentation(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"constructor": false,
"full_signature": "protected static Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"identifier": "findRecentPresentationNodeFromID",
"modifiers": "protected static",
"parameters": "(final Document document, final RecentPresentation recentPresentation)",
"return": "Node",
"signature": "Node findRecentPresentationNodeFromID(final Document document, final RecentPresentation recentPresentation)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.writeDocument(Document document, OutputStream output)",
"constructor": false,
"full_signature": "private static void writeDocument(Document document, OutputStream output)",
"identifier": "writeDocument",
"modifiers": "private static",
"parameters": "(Document document, OutputStream output)",
"return": "void",
"signature": "void writeDocument(Document document, OutputStream output)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDefaultDocumentBodyInputStream()",
"constructor": false,
"full_signature": "private static InputStream createDefaultDocumentBodyInputStream()",
"identifier": "createDefaultDocumentBodyInputStream",
"modifiers": "private static",
"parameters": "()",
"return": "InputStream",
"signature": "InputStream createDefaultDocumentBodyInputStream()",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.getInputStreamForFile(File contextFile)",
"constructor": false,
"full_signature": "private static InputStream getInputStreamForFile(File contextFile)",
"identifier": "getInputStreamForFile",
"modifiers": "private static",
"parameters": "(File contextFile)",
"return": "InputStream",
"signature": "InputStream getInputStreamForFile(File contextFile)",
"testcase": false
},
{
"class_method_signature": "ContextFileWorker.createDocumentFromInput(InputStream input)",
"constructor": false,
"full_signature": "private static Document createDocumentFromInput(InputStream input)",
"identifier": "createDocumentFromInput",
"modifiers": "private static",
"parameters": "(InputStream input)",
"return": "Document",
"signature": "Document createDocumentFromInput(InputStream input)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep) throws ContextFileException {\n checkContextFileValidity(contextFile);\n if (numberOfRecentPresentationsToKeep < 0)\n throw new IllegalArgumentException(\"The number of recent presentations to keep can not be negative\");\n\n\n try (final InputStream input = getInputStreamForFile(contextFile);\n final OutputStream output = new FileOutputStream(contextFile)) {\n return purgeRecentPresentations(input, output, numberOfRecentPresentationsToKeep);\n } catch (IOException e) {\n throw new ContextFileException(e);\n }\n }",
"class_method_signature": "ContextFileWorker.purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"constructor": false,
"full_signature": "static Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"identifier": "purgeRecentPresentations",
"invocations": [
"checkContextFileValidity",
"getInputStreamForFile",
"purgeRecentPresentations"
],
"modifiers": "static",
"parameters": "(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"return": "Set<RecentPresentation>",
"signature": "Set<RecentPresentation> purgeRecentPresentations(final File contextFile, final long numberOfRecentPresentationsToKeep)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_185 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static TextileMarkup markup;",
"type": "TextileMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-textile/src/test/java/com/twasyl/slideshowfx/markup/textile/TextileMarkupTest.java",
"identifier": "TextileMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void generateStrong() {\n final String result = markup.convertAsHtml(\"*Strong text*\");\n\n assertEquals(\"<p><strong>Strong text</strong></p>\", result);\n }",
"class_method_signature": "TextileMarkupTest.generateStrong()",
"constructor": false,
"full_signature": "@Test public void generateStrong()",
"identifier": "generateStrong",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void generateStrong()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(TextileMarkup.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(TextileMarkup.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}
],
"file": "slideshowfx-textile/src/main/java/com/twasyl/slideshowfx/markup/textile/TextileMarkup.java",
"identifier": "TextileMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "TextileMarkup.TextileMarkup()",
"constructor": true,
"full_signature": "public TextileMarkup()",
"identifier": "TextileMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " TextileMarkup()",
"testcase": false
},
{
"class_method_signature": "TextileMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n String result = null;\n\n try (final StringWriter writer = new StringWriter()) {\n final DocumentBuilder builder = new HtmlDocumentBuilder(writer);\n final MarkupParser parser = new MarkupParser(new TextileLanguage(), builder);\n\n parser.parse(markupString, false);\n builder.flush();\n writer.flush();\n\n result = writer.toString();\n } catch (IOException e) {\n LOGGER.log(Level.WARNING, \"Error while converting to textile\");\n }\n\n return result;\n }",
"class_method_signature": "TextileMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName",
"parse",
"flush",
"flush",
"toString",
"log"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_76 | {
"fields": [],
"file": "slideshowfx-global-configuration/src/test/java/com/twasyl/slideshowfx/global/configuration/RecentPresentationTest.java",
"identifier": "RecentPresentationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @DisplayName(\"is equal to itself using compareTo\")\n void compareToIsEqual() {\n final RecentPresentation presentation1 = new RecentPresentation(\"presentation1.sfx\", null);\n assertEquals(0, presentation1.compareTo(presentation1));\n }",
"class_method_signature": "RecentPresentationTest.compareToIsEqual()",
"constructor": false,
"full_signature": "@Test @DisplayName(\"is equal to itself using compareTo\") void compareToIsEqual()",
"identifier": "compareToIsEqual",
"invocations": [
"assertEquals",
"compareTo"
],
"modifiers": "@Test @DisplayName(\"is equal to itself using compareTo\")",
"parameters": "()",
"return": "void",
"signature": "void compareToIsEqual()",
"testcase": true
} | {
"fields": [
{
"declarator": "openedDateTime",
"modifier": "private",
"original_string": "private LocalDateTime openedDateTime;",
"type": "LocalDateTime",
"var_name": "openedDateTime"
},
{
"declarator": "normalizedPath",
"modifier": "private",
"original_string": "private String normalizedPath;",
"type": "String",
"var_name": "normalizedPath"
},
{
"declarator": "id",
"modifier": "private",
"original_string": "private String id;",
"type": "String",
"var_name": "id"
}
],
"file": "slideshowfx-global-configuration/src/main/java/com/twasyl/slideshowfx/global/configuration/RecentPresentation.java",
"identifier": "RecentPresentation",
"interfaces": "implements Comparable<File>",
"methods": [
{
"class_method_signature": "RecentPresentation.RecentPresentation(final String path, final LocalDateTime openedDateTime)",
"constructor": true,
"full_signature": "public RecentPresentation(final String path, final LocalDateTime openedDateTime)",
"identifier": "RecentPresentation",
"modifiers": "public",
"parameters": "(final String path, final LocalDateTime openedDateTime)",
"return": "",
"signature": " RecentPresentation(final String path, final LocalDateTime openedDateTime)",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.getOpenedDateTime()",
"constructor": false,
"full_signature": "public LocalDateTime getOpenedDateTime()",
"identifier": "getOpenedDateTime",
"modifiers": "public",
"parameters": "()",
"return": "LocalDateTime",
"signature": "LocalDateTime getOpenedDateTime()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.setOpenedDateTime(LocalDateTime openedDateTime)",
"constructor": false,
"full_signature": "public void setOpenedDateTime(LocalDateTime openedDateTime)",
"identifier": "setOpenedDateTime",
"modifiers": "public",
"parameters": "(LocalDateTime openedDateTime)",
"return": "void",
"signature": "void setOpenedDateTime(LocalDateTime openedDateTime)",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.getId()",
"constructor": false,
"full_signature": "public String getId()",
"identifier": "getId",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getId()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.getNormalizedPath()",
"constructor": false,
"full_signature": "public String getNormalizedPath()",
"identifier": "getNormalizedPath",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getNormalizedPath()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.equals(Object o)",
"constructor": false,
"full_signature": "@Override public boolean equals(Object o)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(Object o)",
"return": "boolean",
"signature": "boolean equals(Object o)",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
},
{
"class_method_signature": "RecentPresentation.compareTo(File o)",
"constructor": false,
"full_signature": "@Override public int compareTo(File o)",
"identifier": "compareTo",
"modifiers": "@Override public",
"parameters": "(File o)",
"return": "int",
"signature": "int compareTo(File o)",
"testcase": false
}
],
"superclass": "extends File"
} | {
"body": "@Override\n public int compareTo(File o) {\n if (o != null && o instanceof RecentPresentation) {\n final RecentPresentation other = (RecentPresentation) o;\n return this.getNormalizedPath().compareTo(other.getNormalizedPath());\n }\n\n return 1;\n }",
"class_method_signature": "RecentPresentation.compareTo(File o)",
"constructor": false,
"full_signature": "@Override public int compareTo(File o)",
"identifier": "compareTo",
"invocations": [
"compareTo",
"getNormalizedPath",
"getNormalizedPath"
],
"modifiers": "@Override public",
"parameters": "(File o)",
"return": "int",
"signature": "int compareTo(File o)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_21 | {
"fields": [
{
"declarator": "snippetExecutor = new GoloSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoloSnippetExecutor snippetExecutor = new GoloSnippetExecutor();",
"type": "GoloSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-golo-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/golo/GoloSnippetExecutorTest.java",
"identifier": "GoloSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void importsWithAndWithoutKeyword() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(IMPORTS_PROPERTY, \"import mypackage\\nmysecondpackage\");\n\n assertEquals(\"import mypackage\\nimport mysecondpackage\", snippetExecutor.getImports(snippet));\n }",
"class_method_signature": "GoloSnippetExecutorTest.importsWithAndWithoutKeyword()",
"constructor": false,
"full_signature": "@Test public void importsWithAndWithoutKeyword()",
"identifier": "importsWithAndWithoutKeyword",
"invocations": [
"put",
"getProperties",
"assertEquals",
"getImports"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void importsWithAndWithoutKeyword()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoloSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoloSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GOLO_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String GOLO_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GOLO_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "MODULE_NAME_PROPERTY = \"module\"",
"modifier": "protected static final",
"original_string": "protected static final String MODULE_NAME_PROPERTY = \"module\";",
"type": "String",
"var_name": "MODULE_NAME_PROPERTY"
}
],
"file": "slideshowfx-golo-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/golo/GoloSnippetExecutor.java",
"identifier": "GoloSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GoloSnippetExecutor.GoloSnippetExecutor()",
"constructor": true,
"full_signature": "public GoloSnippetExecutor()",
"identifier": "GoloSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GoloSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.getStartModuleDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartModuleDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartModuleDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartModuleDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoloSnippetExecutor.determineModuleName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineModuleName(final CodeSnippet codeSnippet)",
"identifier": "determineModuleName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineModuleName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GoloSnippetExecutorOptions>"
} | {
"body": "protected String getImports(final CodeSnippet codeSnippet) throws IOException {\n final StringJoiner imports = new StringJoiner(\"\\n\");\n\n try (final StringReader stringReader = new StringReader(codeSnippet.getProperties().get(IMPORTS_PROPERTY));\n final BufferedReader reader = new DefaultCharsetReader(stringReader)) {\n\n reader.lines()\n .filter(line -> !line.trim().isEmpty())\n .forEach(line -> imports.add(formatImportLine(line)));\n }\n\n return imports.toString();\n }",
"class_method_signature": "GoloSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"invocations": [
"get",
"getProperties",
"forEach",
"filter",
"lines",
"isEmpty",
"trim",
"add",
"formatImportLine",
"toString"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_214 | {
"fields": [],
"file": "slideshowfx-utils/src/test/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombinationTest.java",
"identifier": "SlideshowFXKeyCombinationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMetaShortcutA() {\n final SlideshowFXKeyCombination combination = SlideshowFXKeyCombination.valueOf(\"Meta+Shortcut+A\");\n assertCombination(UP, UP, UP, DOWN, DOWN, \"A\", combination);\n }",
"class_method_signature": "SlideshowFXKeyCombinationTest.testMetaShortcutA()",
"constructor": false,
"full_signature": "@Test public void testMetaShortcutA()",
"identifier": "testMetaShortcutA",
"invocations": [
"valueOf",
"assertCombination"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMetaShortcutA()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName())",
"modifier": "public static final",
"original_string": "public static final Logger LOGGER = Logger.getLogger(SlideshowFXKeyCombination.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "text",
"modifier": "private final",
"original_string": "private final String text;",
"type": "String",
"var_name": "text"
},
{
"declarator": "code",
"modifier": "private final",
"original_string": "private final KeyCode code;",
"type": "KeyCode",
"var_name": "code"
}
],
"file": "slideshowfx-utils/src/main/java/com/twasyl/slideshowfx/utils/keys/SlideshowFXKeyCombination.java",
"identifier": "SlideshowFXKeyCombination",
"interfaces": "",
"methods": [
{
"class_method_signature": "SlideshowFXKeyCombination.SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"constructor": true,
"full_signature": "public SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"identifier": "SlideshowFXKeyCombination",
"modifiers": "public",
"parameters": "(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"return": "",
"signature": " SlideshowFXKeyCombination(final String text, final KeyCode code, final ModifierValue shift, final ModifierValue control,\n final ModifierValue alt, final ModifierValue meta, final ModifierValue shortcut)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getText()",
"constructor": false,
"full_signature": "public String getText()",
"identifier": "getText",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.getDisplayText()",
"constructor": false,
"full_signature": "@Override public String getDisplayText()",
"identifier": "getDisplayText",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getDisplayText()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.match(KeyEvent event)",
"constructor": false,
"full_signature": "@Override public boolean match(KeyEvent event)",
"identifier": "match",
"modifiers": "@Override public",
"parameters": "(KeyEvent event)",
"return": "boolean",
"signature": "boolean match(KeyEvent event)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.equals(final Object obj)",
"constructor": false,
"full_signature": "@Override public boolean equals(final Object obj)",
"identifier": "equals",
"modifiers": "@Override public",
"parameters": "(final Object obj)",
"return": "boolean",
"signature": "boolean equals(final Object obj)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXKeyCombination.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int hashCode()",
"testcase": false
}
],
"superclass": "extends KeyCombination"
} | {
"body": "public static SlideshowFXKeyCombination valueOf(String value) {\n if (value == null) throw new NullPointerException(\"The value can not be null\");\n if (value.isEmpty()) throw new IllegalArgumentException(\"The value can not be empty\");\n\n String determinedText = null;\n KeyCode determinedCode = KeyCode.UNDEFINED;\n\n ModifierValue shiftModifier = ModifierValue.UP;\n ModifierValue controlModifier = ModifierValue.UP;\n ModifierValue shortcutModifier = ModifierValue.UP;\n ModifierValue metaModifier = ModifierValue.UP;\n ModifierValue altModifier = ModifierValue.UP;\n\n final String[] tokens = value.split(\"\\\\+\");\n for (String token : tokens) {\n switch (token) {\n case \"Shortcut\":\n shortcutModifier = ModifierValue.DOWN;\n break;\n case \"Ctrl\":\n controlModifier = ModifierValue.DOWN;\n break;\n case \"Shift\":\n shiftModifier = ModifierValue.DOWN;\n break;\n case \"Meta\":\n metaModifier = ModifierValue.DOWN;\n break;\n case \"Alt\":\n altModifier = ModifierValue.DOWN;\n break;\n default:\n determinedText = token;\n determinedCode = KeyCode.valueOf(determinedText);\n }\n }\n final SlideshowFXKeyCombination combination = new SlideshowFXKeyCombination(determinedText, determinedCode, shiftModifier,\n controlModifier, altModifier, metaModifier, shortcutModifier);\n\n return combination;\n }",
"class_method_signature": "SlideshowFXKeyCombination.valueOf(String value)",
"constructor": false,
"full_signature": "public static SlideshowFXKeyCombination valueOf(String value)",
"identifier": "valueOf",
"invocations": [
"isEmpty",
"split",
"valueOf"
],
"modifiers": "public static",
"parameters": "(String value)",
"return": "SlideshowFXKeyCombination",
"signature": "SlideshowFXKeyCombination valueOf(String value)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_37 | {
"fields": [
{
"declarator": "snippetExecutor = new JavaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final JavaSnippetExecutor snippetExecutor = new JavaSnippetExecutor();",
"type": "JavaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-java-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutorTest.java",
"identifier": "JavaSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void buildSourceCodeWithoutImportsAndWithoutWrapInMain() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(CLASS_NAME_PROPERTY, \"TestJava\");\n\n snippet.setCode(\"public static void main(String ... args) {\\n\\tSystem.out.println(\\\"Hello\\\");\\n}\");\n\n final String expected = IOUtils.read(JavaSnippetExecutorTest.class.getResourceAsStream(\"/com/twasyl/slideshowfx/snippet/executor/java/buildSourceCodeWithoutImportsAndWithoutWrapInMain_expected.txt\"));\n assertEquals(expected, snippetExecutor.buildSourceCode(snippet));\n }",
"class_method_signature": "JavaSnippetExecutorTest.buildSourceCodeWithoutImportsAndWithoutWrapInMain()",
"constructor": false,
"full_signature": "@Test public void buildSourceCodeWithoutImportsAndWithoutWrapInMain()",
"identifier": "buildSourceCodeWithoutImportsAndWithoutWrapInMain",
"invocations": [
"put",
"getProperties",
"setCode",
"read",
"getResourceAsStream",
"assertEquals",
"buildSourceCode"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void buildSourceCodeWithoutImportsAndWithoutWrapInMain()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(JavaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "JAVA_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String JAVA_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "JAVA_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
}
],
"file": "slideshowfx-java-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/java/JavaSnippetExecutor.java",
"identifier": "JavaSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "JavaSnippetExecutor.JavaSnippetExecutor()",
"constructor": true,
"full_signature": "public JavaSnippetExecutor()",
"identifier": "JavaSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " JavaSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "JavaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<JavaSnippetExecutorOptions>"
} | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n if (hasImports(codeSnippet)) {\n sourceCode.append(getImports(codeSnippet)).append(\"\\n\\n\");\n }\n\n sourceCode.append(getStartClassDefinition(codeSnippet)).append(\"\\n\");\n\n if (mustBeWrappedIn(codeSnippet, WRAP_IN_MAIN_PROPERTY)) {\n sourceCode.append(\"\\tpublic static void main(String ... args) {\\n\")\n .append(codeSnippet.getCode())\n .append(\"\\n\\t}\");\n } else {\n sourceCode.append(codeSnippet.getCode());\n }\n\n sourceCode.append(\"\\n}\");\n\n return sourceCode.toString();\n }",
"class_method_signature": "JavaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"invocations": [
"hasImports",
"append",
"append",
"getImports",
"append",
"append",
"getStartClassDefinition",
"mustBeWrappedIn",
"append",
"append",
"append",
"getCode",
"append",
"getCode",
"append",
"toString"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_202 | {
"fields": [
{
"declarator": "baseLocation",
"modifier": "private static",
"original_string": "private static File baseLocation;",
"type": "File",
"var_name": "baseLocation"
},
{
"declarator": "visitor",
"modifier": "private",
"original_string": "private ListFilesFileVisitor visitor;",
"type": "ListFilesFileVisitor",
"var_name": "visitor"
}
],
"file": "slideshowfx-utils/src/test/java/com/twasyl/slideshowfx/utils/io/ListFilesFileVisitorTest.java",
"identifier": "ListFilesFileVisitorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWalkOnExistingFile() throws IOException {\n final File file = new File(baseLocation, \"file.txt\");\n Files.walkFileTree(file.toPath(), visitor);\n\n assertFalse(visitor.getPaths().isEmpty());\n assertEquals(file.toPath(), visitor.getPaths().get(0));\n }",
"class_method_signature": "ListFilesFileVisitorTest.testWalkOnExistingFile()",
"constructor": false,
"full_signature": "@Test public void testWalkOnExistingFile()",
"identifier": "testWalkOnExistingFile",
"invocations": [
"walkFileTree",
"toPath",
"assertFalse",
"isEmpty",
"getPaths",
"assertEquals",
"toPath",
"get",
"getPaths"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testWalkOnExistingFile()",
"testcase": true
} | {
"fields": [
{
"declarator": "paths = new ArrayList<>()",
"modifier": "private",
"original_string": "private List<Path> paths = new ArrayList<>();",
"type": "List<Path>",
"var_name": "paths"
},
{
"declarator": "nonEmptyDirectories = new HashSet<>()",
"modifier": "private",
"original_string": "private Set<Path> nonEmptyDirectories = new HashSet<>();",
"type": "Set<Path>",
"var_name": "nonEmptyDirectories"
}
],
"file": "slideshowfx-utils/src/main/java/com/twasyl/slideshowfx/utils/io/ListFilesFileVisitor.java",
"identifier": "ListFilesFileVisitor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ListFilesFileVisitor.getPaths()",
"constructor": false,
"full_signature": "public List<Path> getPaths()",
"identifier": "getPaths",
"modifiers": "public",
"parameters": "()",
"return": "List<Path>",
"signature": "List<Path> getPaths()",
"testcase": false
},
{
"class_method_signature": "ListFilesFileVisitor.getFiles()",
"constructor": false,
"full_signature": "public List<File> getFiles()",
"identifier": "getFiles",
"modifiers": "public",
"parameters": "()",
"return": "List<File>",
"signature": "List<File> getFiles()",
"testcase": false
},
{
"class_method_signature": "ListFilesFileVisitor.visitFile(Path file, BasicFileAttributes attrs)",
"constructor": false,
"full_signature": "@Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)",
"identifier": "visitFile",
"modifiers": "@Override public",
"parameters": "(Path file, BasicFileAttributes attrs)",
"return": "FileVisitResult",
"signature": "FileVisitResult visitFile(Path file, BasicFileAttributes attrs)",
"testcase": false
},
{
"class_method_signature": "ListFilesFileVisitor.preVisitDirectory(Path dir, BasicFileAttributes attrs)",
"constructor": false,
"full_signature": "@Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)",
"identifier": "preVisitDirectory",
"modifiers": "@Override public",
"parameters": "(Path dir, BasicFileAttributes attrs)",
"return": "FileVisitResult",
"signature": "FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)",
"testcase": false
},
{
"class_method_signature": "ListFilesFileVisitor.postVisitDirectory(Path dir, IOException exc)",
"constructor": false,
"full_signature": "@Override public FileVisitResult postVisitDirectory(Path dir, IOException exc)",
"identifier": "postVisitDirectory",
"modifiers": "@Override public",
"parameters": "(Path dir, IOException exc)",
"return": "FileVisitResult",
"signature": "FileVisitResult postVisitDirectory(Path dir, IOException exc)",
"testcase": false
}
],
"superclass": "extends SimpleFileVisitor<Path>"
} | {
"body": "public List<Path> getPaths() {\n return paths;\n }",
"class_method_signature": "ListFilesFileVisitor.getPaths()",
"constructor": false,
"full_signature": "public List<Path> getPaths()",
"identifier": "getPaths",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "List<Path>",
"signature": "List<Path> getPaths()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_193 | {
"fields": [
{
"declarator": "snippetExecutor = new GoSnippetExecutor()",
"modifier": "private final",
"original_string": "private final GoSnippetExecutor snippetExecutor = new GoSnippetExecutor();",
"type": "GoSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-go-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutorTest.java",
"identifier": "GoSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void hasImports() {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.getProperties().put(IMPORTS_PROPERTY, \"fmt\");\n\n assertTrue(snippetExecutor.hasImports(snippet));\n }",
"class_method_signature": "GoSnippetExecutorTest.hasImports()",
"constructor": false,
"full_signature": "@Test public void hasImports()",
"identifier": "hasImports",
"invocations": [
"put",
"getProperties",
"assertTrue",
"hasImports"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void hasImports()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GoSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GO_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String GO_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GO_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "PACKAGE_NAME_PROPERTY = \"package\"",
"modifier": "protected static final",
"original_string": "protected static final String PACKAGE_NAME_PROPERTY = \"package\";",
"type": "String",
"var_name": "PACKAGE_NAME_PROPERTY"
}
],
"file": "slideshowfx-go-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/go/GoSnippetExecutor.java",
"identifier": "GoSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GoSnippetExecutor.GoSnippetExecutor()",
"constructor": true,
"full_signature": "public GoSnippetExecutor()",
"identifier": "GoSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GoSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.getStartPackageDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartPackageDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartPackageDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GoSnippetExecutor.determinePackageName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determinePackageName(final CodeSnippet codeSnippet)",
"identifier": "determinePackageName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determinePackageName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GoSnippetExecutorOptions>"
} | {
"body": "protected boolean hasImports(final CodeSnippet codeSnippet) {\n final String imports = codeSnippet.getProperties().get(IMPORTS_PROPERTY);\n return imports != null && !imports.isEmpty();\n }",
"class_method_signature": "GoSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"invocations": [
"get",
"getProperties",
"isEmpty"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_60 | {
"fields": [
{
"declarator": "snippetExecutor = new GroovySnippetExecutor()",
"modifier": "private final",
"original_string": "private final GroovySnippetExecutor snippetExecutor = new GroovySnippetExecutor();",
"type": "GroovySnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-groovy-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutorTest.java",
"identifier": "GroovySnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void formatImportWithImportKeyword() {\n assertEquals(\"import mypackage\", snippetExecutor.formatImportLine(\"import mypackage\"));\n }",
"class_method_signature": "GroovySnippetExecutorTest.formatImportWithImportKeyword()",
"constructor": false,
"full_signature": "@Test public void formatImportWithImportKeyword()",
"identifier": "formatImportWithImportKeyword",
"invocations": [
"assertEquals",
"formatImportLine"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void formatImportWithImportKeyword()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(GroovySnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "GROOVY_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "private static final",
"original_string": "private static final String GROOVY_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "GROOVY_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_METHOD_RUNNER = \"wrapInMethodRunner\";",
"type": "String",
"var_name": "WRAP_IN_METHOD_RUNNER"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
},
{
"declarator": "MAKE_SCRIPT = \"makeScript\"",
"modifier": "protected static final",
"original_string": "protected static final String MAKE_SCRIPT = \"makeScript\";",
"type": "String",
"var_name": "MAKE_SCRIPT"
}
],
"file": "slideshowfx-groovy-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/groovy/GroovySnippetExecutor.java",
"identifier": "GroovySnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "GroovySnippetExecutor.GroovySnippetExecutor()",
"constructor": true,
"full_signature": "public GroovySnippetExecutor()",
"identifier": "GroovySnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " GroovySnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.makeScript(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean makeScript(final CodeSnippet codeSnippet)",
"identifier": "makeScript",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean makeScript(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getScriptImport()",
"constructor": false,
"full_signature": "protected String getScriptImport()",
"identifier": "getScriptImport",
"modifiers": "protected",
"parameters": "()",
"return": "String",
"signature": "String getScriptImport()",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "GroovySnippetExecutor.getStartMainMethod(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartMainMethod(final CodeSnippet codeSnippet)",
"identifier": "getStartMainMethod",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartMainMethod(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<GroovySnippetExecutorOptions>"
} | {
"body": "protected String formatImportLine(final String importLine) {\n final String importLineBeginning = \"import \";\n\n String formattedImportLine;\n\n if (importLine.startsWith(importLineBeginning)) {\n formattedImportLine = importLine;\n } else {\n formattedImportLine = importLineBeginning.concat(importLine);\n }\n\n return formattedImportLine;\n }",
"class_method_signature": "GroovySnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"invocations": [
"startsWith",
"concat"
],
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_107 | {
"fields": [
{
"declarator": "markup",
"modifier": "private static",
"original_string": "private static MarkdownMarkup markup;",
"type": "MarkdownMarkup",
"var_name": "markup"
}
],
"file": "slideshowfx-markdown/src/test/java/com/twasyl/slideshowfx/markup/markdown/MarkdownMarkupTest.java",
"identifier": "MarkdownMarkupTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void generateStrong() {\n final String result = markup.convertAsHtml(\"*Strong text*\");\n\n assertEquals(\"<p><em>Strong text</em></p>\", result);\n }",
"class_method_signature": "MarkdownMarkupTest.generateStrong()",
"constructor": false,
"full_signature": "@Test void generateStrong()",
"identifier": "generateStrong",
"invocations": [
"convertAsHtml",
"assertEquals"
],
"modifiers": "@Test",
"parameters": "()",
"return": "void",
"signature": "void generateStrong()",
"testcase": true
} | {
"fields": [
{
"declarator": "extensions",
"modifier": "private final",
"original_string": "private final List<Extension> extensions;",
"type": "List<Extension>",
"var_name": "extensions"
}
],
"file": "slideshowfx-markdown/src/main/java/com/twasyl/slideshowfx/markup/markdown/MarkdownMarkup.java",
"identifier": "MarkdownMarkup",
"interfaces": "",
"methods": [
{
"class_method_signature": "MarkdownMarkup.MarkdownMarkup()",
"constructor": true,
"full_signature": "public MarkdownMarkup()",
"identifier": "MarkdownMarkup",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " MarkdownMarkup()",
"testcase": false
},
{
"class_method_signature": "MarkdownMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
}
],
"superclass": "extends AbstractMarkup"
} | {
"body": "@Override\n public String convertAsHtml(String markupString) {\n if (markupString == null)\n throw new IllegalArgumentException(\"Can not convert \" + getName() + \" to HTML : the String is null\");\n\n final Parser parser = Parser.builder().extensions(extensions).build();\n final Node node = parser.parse(markupString);\n final HtmlRenderer renderer = HtmlRenderer.builder().extensions(extensions).build();\n return renderer.render(node).trim();\n }",
"class_method_signature": "MarkdownMarkup.convertAsHtml(String markupString)",
"constructor": false,
"full_signature": "@Override public String convertAsHtml(String markupString)",
"identifier": "convertAsHtml",
"invocations": [
"getName",
"build",
"extensions",
"builder",
"parse",
"build",
"extensions",
"builder",
"trim",
"render"
],
"modifiers": "@Override public",
"parameters": "(String markupString)",
"return": "String",
"signature": "String convertAsHtml(String markupString)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_150 | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SlideshowFXHandlerTest.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(SlideshowFXHandlerTest.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "handler",
"modifier": "private",
"original_string": "private SlideshowFXHandler handler;",
"type": "SlideshowFXHandler",
"var_name": "handler"
},
{
"declarator": "DEFAULT_LOCALE = Locale.getDefault()",
"modifier": "private static",
"original_string": "private static Locale DEFAULT_LOCALE = Locale.getDefault();",
"type": "Locale",
"var_name": "DEFAULT_LOCALE"
}
],
"file": "slideshowfx-logs/src/test/java/com/twasyl/slideshowfx/logs/SlideshowFXHandlerTest.java",
"identifier": "SlideshowFXHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @DisplayName(\"returns all logs\")\n void returnsAllLogs() {\n LOGGER.log(INFO, \"Information message\");\n LOGGER.warning(\"Warning message\");\n\n assertTrue(handler.getAllLogs().contains(\"INFO: Information message\"));\n assertTrue(handler.getAllLogs().contains(\"WARNING: Warning message\"));\n }",
"class_method_signature": "SlideshowFXHandlerTest.returnsAllLogs()",
"constructor": false,
"full_signature": "@Test @DisplayName(\"returns all logs\") void returnsAllLogs()",
"identifier": "returnsAllLogs",
"invocations": [
"log",
"warning",
"assertTrue",
"contains",
"getAllLogs",
"assertTrue",
"contains",
"getAllLogs"
],
"modifiers": "@Test @DisplayName(\"returns all logs\")",
"parameters": "()",
"return": "void",
"signature": "void returnsAllLogs()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SlideshowFXHandler.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(SlideshowFXHandler.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "propertyChangeSupport = new PropertyChangeSupport(this)",
"modifier": "protected final",
"original_string": "protected final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);",
"type": "PropertyChangeSupport",
"var_name": "propertyChangeSupport"
},
{
"declarator": "latestLog",
"modifier": "protected",
"original_string": "protected String latestLog;",
"type": "String",
"var_name": "latestLog"
},
{
"declarator": "byteOutput",
"modifier": "protected",
"original_string": "protected ByteArrayOutputStream byteOutput;",
"type": "ByteArrayOutputStream",
"var_name": "byteOutput"
}
],
"file": "slideshowfx-logs/src/main/java/com/twasyl/slideshowfx/logs/SlideshowFXHandler.java",
"identifier": "SlideshowFXHandler",
"interfaces": "",
"methods": [
{
"class_method_signature": "SlideshowFXHandler.SlideshowFXHandler()",
"constructor": true,
"full_signature": "public SlideshowFXHandler()",
"identifier": "SlideshowFXHandler",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " SlideshowFXHandler()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXHandler.addPropertyChangeListener(PropertyChangeListener listener)",
"constructor": false,
"full_signature": "public void addPropertyChangeListener(PropertyChangeListener listener)",
"identifier": "addPropertyChangeListener",
"modifiers": "public",
"parameters": "(PropertyChangeListener listener)",
"return": "void",
"signature": "void addPropertyChangeListener(PropertyChangeListener listener)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXHandler.removePropertyChangeListener(PropertyChangeListener listener)",
"constructor": false,
"full_signature": "public void removePropertyChangeListener(PropertyChangeListener listener)",
"identifier": "removePropertyChangeListener",
"modifiers": "public",
"parameters": "(PropertyChangeListener listener)",
"return": "void",
"signature": "void removePropertyChangeListener(PropertyChangeListener listener)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXHandler.getLatestLog()",
"constructor": false,
"full_signature": "public String getLatestLog()",
"identifier": "getLatestLog",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getLatestLog()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXHandler.setLatestLog(String latestLog)",
"constructor": false,
"full_signature": "protected void setLatestLog(String latestLog)",
"identifier": "setLatestLog",
"modifiers": "protected",
"parameters": "(String latestLog)",
"return": "void",
"signature": "void setLatestLog(String latestLog)",
"testcase": false
},
{
"class_method_signature": "SlideshowFXHandler.getAllLogs()",
"constructor": false,
"full_signature": "public synchronized String getAllLogs()",
"identifier": "getAllLogs",
"modifiers": "public synchronized",
"parameters": "()",
"return": "String",
"signature": "String getAllLogs()",
"testcase": false
},
{
"class_method_signature": "SlideshowFXHandler.publish(LogRecord record)",
"constructor": false,
"full_signature": "@Override public synchronized void publish(LogRecord record)",
"identifier": "publish",
"modifiers": "@Override public synchronized",
"parameters": "(LogRecord record)",
"return": "void",
"signature": "void publish(LogRecord record)",
"testcase": false
}
],
"superclass": "extends StreamHandler"
} | {
"body": "public synchronized String getAllLogs() {\n String logs = \"\";\n\n try {\n super.flush();\n logs = new String(this.byteOutput.toByteArray(), this.getEncoding());\n } catch (IOException e) {\n LOGGER.log(WARNING, \"Error retrieving all logs\", e);\n }\n\n return logs;\n }",
"class_method_signature": "SlideshowFXHandler.getAllLogs()",
"constructor": false,
"full_signature": "public synchronized String getAllLogs()",
"identifier": "getAllLogs",
"invocations": [
"flush",
"toByteArray",
"getEncoding",
"log"
],
"modifiers": "public synchronized",
"parameters": "()",
"return": "String",
"signature": "String getAllLogs()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
30044052_146 | {
"fields": [
{
"declarator": "snippetExecutor = new ScalaSnippetExecutor()",
"modifier": "private final",
"original_string": "private final ScalaSnippetExecutor snippetExecutor = new ScalaSnippetExecutor();",
"type": "ScalaSnippetExecutor",
"var_name": "snippetExecutor"
}
],
"file": "slideshowfx-scala-executor/src/test/java/com/twasyl/slideshowfx/snippet/executor/scala/ScalaSnippetExecutorTest.java",
"identifier": "ScalaSnippetExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void buildSourceCodeWithoutImportsAndWithoutWrapInMainAndWithoutClassName() throws IOException {\n final CodeSnippet snippet = new CodeSnippet();\n snippet.setCode(\"def main(args: Array[String]) {\\n\\tprintln(\\\"Hello\\\")\\n}\");\n\n final String expected = IOUtils.read(ScalaSnippetExecutorTest.class.getResourceAsStream(\"/com/twasyl/slideshowfx/snippet/executor/scala/buildSourceCodeWithoutImportsAndWithoutWrapInMainAndWithoutClassName_expected.txt\"));\n assertEquals(expected, snippetExecutor.buildSourceCode(snippet));\n }",
"class_method_signature": "ScalaSnippetExecutorTest.buildSourceCodeWithoutImportsAndWithoutWrapInMainAndWithoutClassName()",
"constructor": false,
"full_signature": "@Test public void buildSourceCodeWithoutImportsAndWithoutWrapInMainAndWithoutClassName()",
"identifier": "buildSourceCodeWithoutImportsAndWithoutWrapInMainAndWithoutClassName",
"invocations": [
"setCode",
"read",
"getResourceAsStream",
"assertEquals",
"buildSourceCode"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void buildSourceCodeWithoutImportsAndWithoutWrapInMainAndWithoutClassName()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ScalaSnippetExecutor.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "SCALA_HOME_PROPERTY_SUFFIX = \".home\"",
"modifier": "protected static final",
"original_string": "protected static final String SCALA_HOME_PROPERTY_SUFFIX = \".home\";",
"type": "String",
"var_name": "SCALA_HOME_PROPERTY_SUFFIX"
},
{
"declarator": "WRAP_IN_MAIN_PROPERTY = \"wrapInMain\"",
"modifier": "protected static final",
"original_string": "protected static final String WRAP_IN_MAIN_PROPERTY = \"wrapInMain\";",
"type": "String",
"var_name": "WRAP_IN_MAIN_PROPERTY"
},
{
"declarator": "IMPORTS_PROPERTY = \"imports\"",
"modifier": "protected static final",
"original_string": "protected static final String IMPORTS_PROPERTY = \"imports\";",
"type": "String",
"var_name": "IMPORTS_PROPERTY"
},
{
"declarator": "CLASS_NAME_PROPERTY = \"class\"",
"modifier": "protected static final",
"original_string": "protected static final String CLASS_NAME_PROPERTY = \"class\";",
"type": "String",
"var_name": "CLASS_NAME_PROPERTY"
}
],
"file": "slideshowfx-scala-executor/src/main/java/com/twasyl/slideshowfx/snippet/executor/scala/ScalaSnippetExecutor.java",
"identifier": "ScalaSnippetExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ScalaSnippetExecutor.ScalaSnippetExecutor()",
"constructor": true,
"full_signature": "public ScalaSnippetExecutor()",
"identifier": "ScalaSnippetExecutor",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " ScalaSnippetExecutor()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getUI(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public Parent getUI(final CodeSnippet codeSnippet)",
"identifier": "getUI",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "Parent",
"signature": "Parent getUI(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getConfigurationUI()",
"constructor": false,
"full_signature": "@Override public Node getConfigurationUI()",
"identifier": "getConfigurationUI",
"modifiers": "@Override public",
"parameters": "()",
"return": "Node",
"signature": "Node getConfigurationUI()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.saveNewOptions()",
"constructor": false,
"full_signature": "@Override public void saveNewOptions()",
"identifier": "saveNewOptions",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void saveNewOptions()",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.execute(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "@Override public ObservableList<String> execute(final CodeSnippet codeSnippet)",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "ObservableList<String>",
"signature": "ObservableList<String> execute(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.createSourceCodeFile(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected File createSourceCodeFile(final CodeSnippet codeSnippet)",
"identifier": "createSourceCodeFile",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "File",
"signature": "File createSourceCodeFile(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.hasImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected boolean hasImports(final CodeSnippet codeSnippet)",
"identifier": "hasImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "boolean",
"signature": "boolean hasImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getImports(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getImports(final CodeSnippet codeSnippet)",
"identifier": "getImports",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getImports(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.formatImportLine(final String importLine)",
"constructor": false,
"full_signature": "protected String formatImportLine(final String importLine)",
"identifier": "formatImportLine",
"modifiers": "protected",
"parameters": "(final String importLine)",
"return": "String",
"signature": "String formatImportLine(final String importLine)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.getStartClassDefinition(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String getStartClassDefinition(final CodeSnippet codeSnippet)",
"identifier": "getStartClassDefinition",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String getStartClassDefinition(final CodeSnippet codeSnippet)",
"testcase": false
},
{
"class_method_signature": "ScalaSnippetExecutor.determineClassName(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String determineClassName(final CodeSnippet codeSnippet)",
"identifier": "determineClassName",
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String determineClassName(final CodeSnippet codeSnippet)",
"testcase": false
}
],
"superclass": "extends AbstractSnippetExecutor<ScalaSnippetExecutorOptions>"
} | {
"body": "protected String buildSourceCode(final CodeSnippet codeSnippet) throws IOException {\n final StringBuilder sourceCode = new StringBuilder();\n\n if (hasImports(codeSnippet)) {\n sourceCode.append(getImports(codeSnippet)).append(\"\\n\\n\");\n }\n\n sourceCode.append(getStartClassDefinition(codeSnippet)).append(\"\\n\");\n\n if (mustBeWrappedIn(codeSnippet, WRAP_IN_MAIN_PROPERTY)) {\n sourceCode.append(\"\\tdef main(args: Array[String]) {\\n\")\n .append(codeSnippet.getCode())\n .append(\"\\n\\t}\");\n } else {\n sourceCode.append(codeSnippet.getCode());\n }\n\n sourceCode.append(\"\\n}\");\n\n return sourceCode.toString();\n }",
"class_method_signature": "ScalaSnippetExecutor.buildSourceCode(final CodeSnippet codeSnippet)",
"constructor": false,
"full_signature": "protected String buildSourceCode(final CodeSnippet codeSnippet)",
"identifier": "buildSourceCode",
"invocations": [
"hasImports",
"append",
"append",
"getImports",
"append",
"append",
"getStartClassDefinition",
"mustBeWrappedIn",
"append",
"append",
"append",
"getCode",
"append",
"getCode",
"append",
"toString"
],
"modifiers": "protected",
"parameters": "(final CodeSnippet codeSnippet)",
"return": "String",
"signature": "String buildSourceCode(final CodeSnippet codeSnippet)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30044052,
"size": 221114,
"stargazer_count": 45,
"stars": null,
"updates": null,
"url": "https://github.com/twasyl/SlideshowFX"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.