id
stringlengths
7
14
source
stringlengths
135
41.2k
target
stringlengths
36
20.4k
context_text
stringlengths
183
4k
prompt_context
stringlengths
0
1.52k
source_ctx
stringlengths
198
41.2k
ctx_included
bool
2 classes
static_status
stringclasses
2 values
static_context
stringlengths
1.96k
252k
3468420_206
class CollisionPlaneRoadModel extends PlaneRoadModel { @Override public void addObjectAt(RoadUser obj, Point pos) { if (obj instanceof MovingRoadUser) { checkArgument(!isOccupied(pos), "Cannot add an object on an occupied position: %s.", pos); blockingRegistry.addAt((MovingRoadUser) obj, po...
boolean fail = false; model.addObjectAt(ru1, new Point(1, 1)); try { model.addObjectAt(ru2, new Point(1, 1)); } catch (final IllegalArgumentException e) { fail = true; assertThat(e.getMessage()) .contains("Cannot add an object on an occupied position:"); } assertThat(fa...
[FOCAL] @Override public void CollisionPlaneRoadModel.addObjectAt(RoadUser obj, Point pos) [CLASS] class CollisionPlaneRoadModel extends PlaneRoadModel [METRICS] loc=9 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=1 [CALLS-INTERNAL] boolean isOccupied(Point pos) [CALLS-EXTERNAL] checkArgument/3 (inherited), blocki...
/* static context [FOCAL] @Override public void CollisionPlaneRoadModel.addObjectAt(RoadUser obj, Point pos) [PATH1] if(obj instanceof MovingRoadUser)=T [PATH2] if(obj instanceof MovingRoadUser)=F [INPUTS] branches=obj | result=- [COLLABORATORS] field blockingRegistry addAt/2 [CALLS-INTERNAL] boolean isOccupied(Point p...
/* static context [FOCAL] @Override public void CollisionPlaneRoadModel.addObjectAt(RoadUser obj, Point pos) [PATH1] if(obj instanceof MovingRoadUser)=T [PATH2] if(obj instanceof MovingRoadUser)=F [INPUTS] branches=obj | result=- [COLLABORATORS] field blockingRegistry addAt/2 [CALLS-INTERNAL] boolean isOccupied(Point p...
true
ok
{"focal": {"class": "CollisionPlaneRoadModel", "name": "addObjectAt", "signature": "void addObjectAt(RoadUser obj, Point pos)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "obj", "type": "RoadUser"}, {"name": "pos", "type": "Point"}], "return_type": "void"}, "class_info": {"name": "CollisionPl...
3471752_7
class HashUtils { @NotNull public static String computeSha256Hash(@NotNull final byte[] bytes) throws NoSuchAlgorithmException { return computeHash(bytes, "SHA-256"); } private HashUtils(); @NotNull public static String computeMd5Hash(final byte[] bytes); private static String byteTo...
try { Assert.assertEquals(EXPECTED_PHOTO_HASH_SHA256, HashUtils.computeSha256Hash(PHOTO_BYTES)); Assert.assertEquals(EXPECTED_TEXT_HASH_SHA256, HashUtils.computeSha256Hash(TEXT_BYTES)); } catch (NoSuchAlgorithmException e) { Assert.fail("Call to FluxtreamCaptu...
[FOCAL] @NotNull public static String HashUtils.computeSha256Hash(byte[] bytes) [CLASS] class HashUtils [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String computeHash(byte[] bytes, String algorithm) [EXCEPTIONS] declares NoSuchAlgorithmException [INPUTS] branches=- | result=byt...
/* static context [FOCAL] @NotNull public static String HashUtils.computeSha256Hash(byte[] bytes) [INPUTS] branches=- | result=bytes [EXCEPTIONS] declares NoSuchAlgorithmException [CALLS-INTERNAL] String computeHash(byte[] bytes, String algorithm) */
/* static context [FOCAL] @NotNull public static String HashUtils.computeSha256Hash(byte[] bytes) [INPUTS] branches=- | result=bytes [EXCEPTIONS] declares NoSuchAlgorithmException [CALLS-INTERNAL] String computeHash(byte[] bytes, String algorithm) */ class HashUtils { @NotNull public static String computeSha25...
true
ok
{"focal": {"class": "HashUtils", "name": "computeSha256Hash", "signature": "String computeSha256Hash(byte[] bytes) throws NoSuchAlgorithmException", "start_line": 3, "modifiers": "@NotNull public static", "params": [{"name": "bytes", "type": "byte[]"}], "return_type": "String"}, "class_info": {"name": "HashUtils", "kin...
3472718_65
class StandaloneExp extends Exp { public abstract String getCode()@Override public abstract String getCode(); public abstract String getCode()public StandaloneExp append(StandaloneExp other); public abstract String getCode()public StandaloneExp append(NestedExp other); public abstract String getCode()public void...
assertEquals("\n$_ = $proceed($$);", StandaloneExp.PROCEED_AND_ASSIGN.getCode()); } }
[FOCAL] public abstract String StandaloneExp.getCode() [CLASS] class StandaloneExp extends Exp [METRICS] loc=1 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CLASS-MEMBERS] String getCode(); StandaloneExp append(StandaloneExp other); String getCode(); StandaloneExp append(NestedExp other); String getCode(); void...
/* static context [FOCAL] public abstract String StandaloneExp.getCode() */
/* static context [FOCAL] public abstract String StandaloneExp.getCode() */ class StandaloneExp extends Exp { public abstract String getCode()@Override public abstract String getCode(); public abstract String getCode()public StandaloneExp append(StandaloneExp other); public abstract String getCode()public Standal...
true
partial
{"focal": {"class": "StandaloneExp", "name": "getCode", "signature": "String getCode()", "start_line": 4, "modifiers": "public abstract", "params": [], "return_type": "String"}, "class_info": {"name": "StandaloneExp", "kind": "class", "modifiers": "", "superclass": "Exp", "interfaces": null, "fields": [], "members": [{...
3477759_76
class AdminController { @RequestMapping(params = "resume", method = RequestMethod.GET) public String resumeGame(Model model) { timerService.resume(); return getAdminPage(model); } public AdminController(); AdminController(TimerService timerService, GameSettingsService gameSettin...
when(timerService.isPaused()).thenReturn(GAME_ACTIVE); String jsp = controller.resumeGame(model); assertEquals("admin", jsp); verify(model).addAttribute("paused", GAME_ACTIVE); verify(timerService).resume(); } }
[FOCAL] @RequestMapping(params = "resume", method = RequestMethod.GET) public String AdminController.resumeGame(Model model) [CLASS] class AdminController [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String getAdminPage(Model model) [CALLS-EXTERNAL] TimerService.resume/0 [FIELDS...
/* static context [FOCAL] @RequestMapping(params = "resume", method = RequestMethod.GET) public String AdminController.resumeGame(Model model) [INPUTS] branches=- | result=model [COLLABORATORS] field timerService:TimerService resume/0 [CALLS-INTERNAL] String getAdminPage(Model model) [FIELDS] read=timerService:TimerSer...
/* static context [FOCAL] @RequestMapping(params = "resume", method = RequestMethod.GET) public String AdminController.resumeGame(Model model) [INPUTS] branches=- | result=model [COLLABORATORS] field timerService:TimerService resume/0 [CALLS-INTERNAL] String getAdminPage(Model model) [FIELDS] read=timerService:TimerSer...
true
ok
{"focal": {"class": "AdminController", "name": "resumeGame", "signature": "String resumeGame(Model model)", "start_line": 3, "modifiers": "@RequestMapping(params = \"resume\", method = RequestMethod.GET) public", "params": [{"name": "model", "type": "Model"}], "return_type": "String"}, "class_info": {"name": "AdminCont...
3510405_18
class ShortUrl implements Serializable { public void setFullUrl(String fullUrl) { this.fullUrl = fullUrl; } private static int safeLongToInt(long l); public static Long shortCodeToId(String shortCode); public Long getId(); public void setId(Long id); public String getFullUrl(); @Transien...
shortUrl.setFullUrl("http://repasky.name"); constraintViolations = validator.validate(shortUrl); assertEquals(0, constraintViolations.size()); } }
[FOCAL] public void ShortUrl.setFullUrl(String fullUrl) [CLASS] class ShortUrl implements Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [FIELDS] write=fullUrl [STATE] fullUrl via getFullUrl() [DATAFLOW] fullUrl@param->L2 [CLASS-MEMBERS] int safeLongToInt(long l); Long shortCodeToId(S...
/* static context [FOCAL] public void ShortUrl.setFullUrl(String fullUrl) [STATE] fullUrl via getFullUrl() [FIELDS] write=fullUrl */
/* static context [FOCAL] public void ShortUrl.setFullUrl(String fullUrl) [STATE] fullUrl via getFullUrl() [FIELDS] write=fullUrl */ class ShortUrl implements Serializable { public void setFullUrl(String fullUrl) { this.fullUrl = fullUrl; } private static int safeLongToInt(long l); public static Lon...
true
ok
{"focal": {"class": "ShortUrl", "name": "setFullUrl", "signature": "void setFullUrl(String fullUrl)", "start_line": 3, "modifiers": "public", "params": [{"name": "fullUrl", "type": "String"}], "return_type": "void"}, "class_info": {"name": "ShortUrl", "kind": "class", "modifiers": "", "superclass": null, "interfaces": ...
3513261_56
class XCodeContext implements IXCodeContext { public String getProvisioningProfile() { return getSettings().getAllSettings().get(Settings.ManagedSetting.PROVISIONING_PROFILE.name()); } public XCodeContext(List<String> buildActions, File projectRootDirectory, PrintStream out, Settings settings, Op...
Map<String, String> managedOptions = new HashMap<String, String>(); managedOptions.put(Options.ManagedOption.CONFIGURATION.getOptionName(), "Release"); managedOptions.put(Options.ManagedOption.SDK.getOptionName(), "mysdk"); managedOptions.put(Options.ManagedOption.PROJECT.getOptionName(), "MyLibrary.xco...
[FOCAL] public String XCodeContext.getProvisioningProfile() [CLASS] class XCodeContext implements IXCodeContext [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Settings getSettings() [CALLS-EXTERNAL] getSettings().getAllSettings().get/1, getSettings().getAllSettings/0, Settings.Man...
/* static context [FOCAL] public String XCodeContext.getProvisioningProfile() [CALLS-INTERNAL] Settings getSettings() [CALLS-EXTERNAL] getSettings().getAllSettings().get/1, getSettings().getAllSettings/0, Settings.ManagedSetting.PROVISIONING_PROFILE.name/0 */
/* static context [FOCAL] public String XCodeContext.getProvisioningProfile() [CALLS-INTERNAL] Settings getSettings() [CALLS-EXTERNAL] getSettings().getAllSettings().get/1, getSettings().getAllSettings/0, Settings.ManagedSetting.PROVISIONING_PROFILE.name/0 */ class XCodeContext implements IXCodeContext { public Stri...
true
ok
{"focal": {"class": "XCodeContext", "name": "getProvisioningProfile", "signature": "String getProvisioningProfile()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "XCodeContext", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "IXCodeContext"...
3523632_78
class ObjectUtil { public static int hashCode(Object... objects) { return Arrays.hashCode(objects); } public static boolean equals(@Nullable Object a, @Nullable Object b); public static String toPrettyString(Object value); private static String primitiveArrayToString(Object value, Class componentType); privat...
assertThat(ObjectUtil.hashCode("a", "b") - ObjectUtil.hashCode("a", "a")).isEqualTo(1); } }
[FOCAL] public static int ObjectUtil.hashCode(Object... objects) [CLASS] class ObjectUtil [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Arrays.hashCode/1 [INPUTS] branches=- | result=objects [DATAFLOW] objects@param->L2 [CLASS-MEMBERS] boolean equals(Object a, Object b); String t...
/* static context [FOCAL] public static int ObjectUtil.hashCode(Object... objects) [INPUTS] branches=- | result=objects [CALLS-EXTERNAL] Arrays.hashCode/1 */
/* static context [FOCAL] public static int ObjectUtil.hashCode(Object... objects) [INPUTS] branches=- | result=objects [CALLS-EXTERNAL] Arrays.hashCode/1 */ class ObjectUtil { public static int hashCode(Object... objects) { return Arrays.hashCode(objects); } public static boolean equals(@Nullable Object a, @Nul...
true
ok
{"focal": {"class": "ObjectUtil", "name": "hashCode", "signature": "int hashCode(Object... objects)", "start_line": 3, "modifiers": "public static", "params": [{"name": "objects", "type": "Object..."}], "return_type": "int"}, "class_info": {"name": "ObjectUtil", "kind": "class", "modifiers": "", "superclass": null, "in...
3526892_12
class ProbabilityDistributions { static public Double calculateLabelCost(String calcLabel, Map<String, Double> labelProbabilities, CostMatrix<String> costMatrix) { if (calcLabel == null) { return Double.NaN; } double sum = 0.; for (String label: costMatrix.getKnownValues()) { double cost = costMatrix...
String calcLabel = "OK"; Map<String, Double> labelProbabilities = new HashMap<String, Double>(); labelProbabilities.put("OK", 0.5); labelProbabilities.put("LOK", 0.0); labelProbabilities.put("HOK", 1.); CostMatrix<String> costMatrix = new CostMatrix<String>(); costMatrix.add("OK", "OK", 1.); costMatrix...
[FOCAL] static public Double ProbabilityDistributions.calculateLabelCost(String calcLabel, Map<String, Double> labelProbabilities, CostMatrix<String> costMatrix) [CLASS] class ProbabilityDistributions [METRICS] loc=13 cc=3 branches=1 loops=1 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] CostMatrix<String>.getKnownValue...
/* static context [FOCAL] static public Double ProbabilityDistributions.calculateLabelCost(String calcLabel, Map<String, Double> labelProbabilities, CostMatrix<String> costMatrix) [PATH1] if(calcLabel == null)=F -> foreach(String label : costMatrix.getKnownValues())=T -> exit loop -> return sum [PATH2] if(calcLabel == ...
/* static context [FOCAL] static public Double ProbabilityDistributions.calculateLabelCost(String calcLabel, Map<String, Double> labelProbabilities, CostMatrix<String> costMatrix) [PATH1] if(calcLabel == null)=F -> foreach(String label : costMatrix.getKnownValues())=T -> exit loop -> return sum [PATH2] if(calcLabel == ...
true
ok
{"focal": {"class": "ProbabilityDistributions", "name": "calculateLabelCost", "signature": "Double calculateLabelCost(String calcLabel, Map<String, Double> labelProbabilities, CostMatrix<String> costMatrix)", "start_line": 3, "modifiers": "static public", "params": [{"name": "calcLabel", "type": "String"}, {"name": "la...
3536819_44
class PropertiesWrapper implements Properties { @Nullable @Override public Object getPropertyUnchecked(@NotNull String name) { try { return getProperty(name); } catch (Exception e) { return null; } } private PropertiesWrapper(@NotNull Object object)...
assertNull(comprehensive.getPropertyUnchecked("custom.fake")); } }
[FOCAL] @Nullable @Override public Object PropertiesWrapper.getPropertyUnchecked(String name) [CLASS] class PropertiesWrapper implements Properties [METRICS] loc=9 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] Object getProperty(String name) [EXCEPTIONS] catches Exception e [PATH1] try-body thro...
/* static context [FOCAL] @Nullable @Override public Object PropertiesWrapper.getPropertyUnchecked(String name) [PATH1] try-body throws -> return null [PATH2] return getProperty(name) [INPUTS] branches=- | result=name [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] Object getProperty(String name) */
/* static context [FOCAL] @Nullable @Override public Object PropertiesWrapper.getPropertyUnchecked(String name) [PATH1] try-body throws -> return null [PATH2] return getProperty(name) [INPUTS] branches=- | result=name [EXCEPTIONS] catches Exception e [CALLS-INTERNAL] Object getProperty(String name) */ class PropertiesW...
true
ok
{"focal": {"class": "PropertiesWrapper", "name": "getPropertyUnchecked", "signature": "Object getPropertyUnchecked(String name)", "start_line": 3, "modifiers": "@Nullable @Override public", "params": [{"name": "name", "type": "String"}], "return_type": "Object"}, "class_info": {"name": "PropertiesWrapper", "kind": "cla...
3548254_1
class GeoToWktConverter { public static String convertToWktString(Geoshape fieldValue) throws BackendException { if (fieldValue.getType() == Geoshape.Type.POINT) { Geoshape.Point point = fieldValue.getPoint(); return "POINT(" + point.getLongitude() + " " + point.getLatitude() + ")";...
Geoshape p1 = Geoshape.point(35.4, 48.9); //no spaces, no negative values Geoshape p2 = Geoshape.point(-35.4,48.9); //negative longitude value Geoshape p3 = Geoshape.point(35.4, -48.9); //negative latitude value String wkt1 = "POINT(48.9 35.4)"; String actualWkt1 = GeoToWktConve...
[FOCAL] public static String GeoToWktConverter.convertToWktString(Geoshape fieldValue) [CLASS] class GeoToWktConverter [METRICS] loc=8 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-EXTERNAL] Geoshape.getType/0, Geoshape.getPoint/0, Geoshape.Point.getLongitude/0, Geoshape.Point.getLatitude/0 [NEW] Permanen...
/* static context [FOCAL] public static String GeoToWktConverter.convertToWktString(Geoshape fieldValue) [THROWS-WHEN] PermanentBackendException when !(fieldValue.getType() == Geoshape.Type.POINT) [PATH1] if(fieldValue.getType() == Geoshape.Type.POINT)=T -> return "POINT(" + point.getLongitude() + " " + point.getLatitu...
/* static context [FOCAL] public static String GeoToWktConverter.convertToWktString(Geoshape fieldValue) [THROWS-WHEN] PermanentBackendException when !(fieldValue.getType() == Geoshape.Type.POINT) [PATH1] if(fieldValue.getType() == Geoshape.Type.POINT)=T -> return "POINT(" + point.getLongitude() + " " + point.getLatitu...
true
ok
{"focal": {"class": "GeoToWktConverter", "name": "convertToWktString", "signature": "String convertToWktString(Geoshape fieldValue) throws BackendException", "start_line": 3, "modifiers": "public static", "params": [{"name": "fieldValue", "type": "Geoshape"}], "return_type": "String"}, "class_info": {"name": "GeoToWktC...
3551455_26
class Functions { public static <T> Function<List<T>, T> firstOfList() { return list -> list.get(0); } private Functions(); public static Function<List<T>, T> lastOfList(); public static Function<List<T>, T> nthOfList(int index); public static Function<List<T>, List<T>> permutationOfList( int....
assertEquals('a', firstOfList().apply(ONE)); assertEquals('a', firstOfList().apply(TWO)); assertEquals('a', firstOfList().apply(THREE)); } }
[FOCAL] public static Function<List<T>, T> Functions.firstOfList() [CLASS] class Functions [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] list.get/1 [COLLABORATORS] field list get/1 [CLASS-MEMBERS] Functions(); Function<List<T>, T> lastOfList(); Function<List<T>, T> nthOfList(int ...
/* static context [FOCAL] public static Function<List<T>, T> Functions.firstOfList() [COLLABORATORS] field list get/1 [CALLS-EXTERNAL] list.get/1 */
/* static context [FOCAL] public static Function<List<T>, T> Functions.firstOfList() [COLLABORATORS] field list get/1 [CALLS-EXTERNAL] list.get/1 */ class Functions { public static <T> Function<List<T>, T> firstOfList() { return list -> list.get(0); } private Functions(); public static Function<List<T>,...
true
ok
{"focal": {"class": "Functions", "name": "firstOfList", "signature": "Function<List<T>, T> firstOfList()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "Function<List<T>, T>"}, "class_info": {"name": "Functions", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "f...
3570915_4
class SmartTimeFormat extends TimeFormat { public static int[] parseToHourAndMinutes(final String timeString) throws ParseException { String time = timeString; time = Strings.nullToEmpty(time).trim(); if (time.length() == 0) { throw new ParseException("String is empty",...
int[] hoursAndMinutes = SmartTimeFormat.parseToHourAndMinutes("9,75"); assertEquals(hoursAndMinutes[0], 9); assertEquals(hoursAndMinutes[1], 45); } }
[FOCAL] public static int[] SmartTimeFormat.parseToHourAndMinutes(String timeString) [CLASS] class SmartTimeFormat extends TimeFormat [METRICS] loc=21 cc=4 branches=2 loops=1 returns=1 throws=2 nesting=2 [CALLS-INTERNAL] String normalize(String timeString) [CALLS-EXTERNAL] Strings.nullToEmpty(time).trim/0, Strings.null...
/* static context [FOCAL] public static int[] SmartTimeFormat.parseToHourAndMinutes(String timeString) [THROWS-WHEN] ParseException when time.length() == 0 [THROWS-WHEN] ParseException when !(time.length() == 0) && splitted.length != 2 [PATH1] if(time.length() == 0)=F -> if(splitted.length != 2)=F -> for(i < 2)=T -> ex...
/* static context [FOCAL] public static int[] SmartTimeFormat.parseToHourAndMinutes(String timeString) [THROWS-WHEN] ParseException when time.length() == 0 [THROWS-WHEN] ParseException when !(time.length() == 0) && splitted.length != 2 [PATH1] if(time.length() == 0)=F -> if(splitted.length != 2)=F -> for(i < 2)=T -> ex...
true
ok
{"focal": {"class": "SmartTimeFormat", "name": "parseToHourAndMinutes", "signature": "int[] parseToHourAndMinutes(String timeString) throws ParseException", "start_line": 3, "modifiers": "public static", "params": [{"name": "timeString", "type": "String"}], "return_type": "int[]"}, "class_info": {"name": "SmartTimeForm...
3580492_6
class GameOfLife { public void nextCycle() throws GameOfLifeException { // We initialize the next state as a x + 1, y + 1 of current state // We do this so next cells can be born around past state emptyMatrix(auxMatrix, MAX_X, MAX_Y); for(int i = 0; i < MAX_X; i++) { for(int j = 0; j < MAX_Y; j++) { if...
byte[] bytes = new byte[] { -52, 51 }; GameOfLife gameOfLife = new GameOfLife(4, bytes, 8, 8, 10); assertEquals(1, gameOfLife.getMatrix()[0][0]); assertEquals(1, gameOfLife.getMatrix()[0][1]); assertEquals(0, gameOfLife.getMatrix()[0][2]); assertEquals(0, gameOfLife.getMatrix()[0][3]); assertEquals(1, ga...
[FOCAL] public void GameOfLife.nextCycle() [CLASS] class GameOfLife [METRICS] loc=83 cc=24 branches=15 loops=8 returns=0 throws=2 nesting=4 [CALLS-INTERNAL] void adjustUpLeft(byte[][] matrix, byte[][] tempMatrix, int maxX, int maxY); void emptyMatrix(byte[][] matrix, int maxX, int maxY); void saveCurrentState() [CALLS-...
class GameOfLife { public void nextCycle() throws GameOfLifeException { // We initialize the next state as a x + 1, y + 1 of current state // We do this so next cells can be born around past state emptyMatrix(auxMatrix, MAX_X, MAX_Y); for(int i = 0; i < MAX_X; i++) { for(int j = 0; j < MAX_Y; j++) { if...
false
ok
{"focal": {"class": "GameOfLife", "name": "nextCycle", "signature": "void nextCycle() throws GameOfLifeException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "GameOfLife", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "m...
3590026_7
class DefaultRopContext implements RopContext { public ServiceMethodHandler getServiceMethodHandler(String methodName, String version) { return serviceHandlerMap.get(ServiceMethodHandler.methodWithVersion(methodName, version)); } public DefaultRopContext(ApplicationContext context); public v...
ApplicationContext context = mock(ApplicationContext.class); when(context.getBeanNamesForType(Object.class)).thenReturn(new String[]{"service1"}); Class withGroupServiceClass = WithGroupService.class; when(context.getType("service1")).thenReturn(withGroupServiceClass); RopContex...
[FOCAL] public ServiceMethodHandler DefaultRopContext.getServiceMethodHandler(String methodName, String version) [CLASS] class DefaultRopContext implements RopContext [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] serviceHandlerMap.get/1, ServiceMethodHandler.methodWithVersion/2 [...
/* static context [FOCAL] public ServiceMethodHandler DefaultRopContext.getServiceMethodHandler(String methodName, String version) [INPUTS] branches=- | result=methodName, version [COLLABORATORS] field serviceHandlerMap get/1 [CALLS-EXTERNAL] serviceHandlerMap.get/1, ServiceMethodHandler.methodWithVersion/2 */
/* static context [FOCAL] public ServiceMethodHandler DefaultRopContext.getServiceMethodHandler(String methodName, String version) [INPUTS] branches=- | result=methodName, version [COLLABORATORS] field serviceHandlerMap get/1 [CALLS-EXTERNAL] serviceHandlerMap.get/1, ServiceMethodHandler.methodWithVersion/2 */ class De...
true
ok
{"focal": {"class": "DefaultRopContext", "name": "getServiceMethodHandler", "signature": "ServiceMethodHandler getServiceMethodHandler(String methodName, String version)", "start_line": 3, "modifiers": "public", "params": [{"name": "methodName", "type": "String"}, {"name": "version", "type": "String"}], "return_type": ...
3590271_2
class PluginManager extends HasEventBus { public static PluginManager getInstance() { if (ourInstance == null) { ourInstance = new PluginManager(); } return ourInstance; } private PluginManager(); public void loadPlugins(); private Collection<? extends Plugin>...
PluginManager manager = PluginManager.getInstance(); try { // private Collection<? extends Plugin> sortDependencies(Collection<? extends Plugin> plugins) { Method sort = manager.getClass().getDeclaredMethod("sortDependencies", Iterable.class); sort.setAccessible...
[FOCAL] public static PluginManager PluginManager.getInstance() [CLASS] class PluginManager extends HasEventBus [METRICS] loc=6 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [NEW] PluginManager [PATH1] if(ourInstance == null)=T -> return ourInstance [PATH2] if(ourInstance == null)=F -> return ourInstance [DATAFL...
/* static context [FOCAL] public static PluginManager PluginManager.getInstance() [PATH1] if(ourInstance == null)=T -> return ourInstance [PATH2] if(ourInstance == null)=F -> return ourInstance [NEW] PluginManager */
/* static context [FOCAL] public static PluginManager PluginManager.getInstance() [PATH1] if(ourInstance == null)=T -> return ourInstance [PATH2] if(ourInstance == null)=F -> return ourInstance [NEW] PluginManager */ class PluginManager extends HasEventBus { public static PluginManager getInstance() { if (...
true
ok
{"focal": {"class": "PluginManager", "name": "getInstance", "signature": "PluginManager getInstance()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "PluginManager"}, "class_info": {"name": "PluginManager", "kind": "class", "modifiers": "", "superclass": "HasEventBus", "interfaces": null,...
3603171_2
class HttpClientFactory { CloseableHttpClient getHttpClient(final ProxyConfiguration proxyConfiguration, final HttpClientConfiguration httpClientConfiguration) throws SmartlingApiException { HttpClientBuilder httpClientBuilder = getHttpClientBuilder(); if (hasActiveProxyConfiguration(proxyConfigur...
ArgumentCaptor<CredentialsProvider> credentialsProviderCaptor = ArgumentCaptor.forClass(CredentialsProvider.class); ArgumentCaptor<HttpHost> httpHostArgumentCaptor = ArgumentCaptor.forClass(HttpHost.class); PowerMockito.when(httpClientBuilder.setProxy(httpHostArgumentCaptor.capture())).thenRetur...
[FOCAL] CloseableHttpClient HttpClientFactory.getHttpClient(ProxyConfiguration proxyConfiguration, HttpClientConfiguration httpClientConfiguration) [CLASS] class HttpClientFactory [METRICS] loc=33 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] HttpClientBuilder getHttpClientBuilder(); SSLContext ...
/* static context [FOCAL] CloseableHttpClient HttpClientFactory.getHttpClient(ProxyConfiguration proxyConfiguration, HttpClientConfiguration httpClientConfiguration) [PATH1] if(hasActiveProxyConfiguration(proxyConfiguration))=T -> if(proxyAuthenticationRequired(proxyConfiguration))=T -> if(httpConfigurationRequired(htt...
/* static context [FOCAL] CloseableHttpClient HttpClientFactory.getHttpClient(ProxyConfiguration proxyConfiguration, HttpClientConfiguration httpClientConfiguration) [PATH1] if(hasActiveProxyConfiguration(proxyConfiguration))=T -> if(proxyAuthenticationRequired(proxyConfiguration))=T -> if(httpConfigurationRequired(htt...
true
ok
{"focal": {"class": "HttpClientFactory", "name": "getHttpClient", "signature": "CloseableHttpClient getHttpClient(ProxyConfiguration proxyConfiguration, HttpClientConfiguration httpClientConfiguration) throws SmartlingApiException", "start_line": 3, "modifiers": "", "params": [{"name": "proxyConfiguration", "type": "Pr...
3610576_0
class SortJob implements Tool, Configurable { @Override public int run(String[] args) throws Exception { if(args.length != 2) { System.out.println("Invalid number of arguments\n\n" + "Usage: IdentityJob <input_path> <output_path>\n\n"); return -1; } String input = args[0]; String output = args[1...
trash(OUTPUT); File iFile = new File(INPUT); Charset utf8 = Charset.forName("UTF-8"); String inputStr = "A-This is\nB-the file\nC-content\n"; Files.write(inputStr, iFile, utf8); ToolRunner.run(new SortJob(), new String[]{INPUT, OUTPUT}); String outputStr = Files.toString(new File(OUTPUT, ...
[FOCAL] @Override public int SortJob.run(String[] args) [CLASS] class SortJob implements Tool, Configurable [METRICS] loc=21 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-INTERNAL] Schema getSchema() [CALLS-EXTERNAL] System.out.println/1, FileSystem.get(conf).delete/2, FileSystem.get/1, TupleMRBuilder.add...
/* static context [FOCAL] @Override public int SortJob.run(String[] args) [PATH1] if(args.length != 2)=T -> return -1 [PATH2] if(args.length != 2)=F -> return 0 [INPUTS] branches=args | result=- [EXCEPTIONS] declares Exception [CALLS-INTERNAL] Schema getSchema() [NEW] Path, TupleMRBuilder, IdentityReducer, HadoopInputF...
/* static context [FOCAL] @Override public int SortJob.run(String[] args) [PATH1] if(args.length != 2)=T -> return -1 [PATH2] if(args.length != 2)=F -> return 0 [INPUTS] branches=args | result=- [EXCEPTIONS] declares Exception [CALLS-INTERNAL] Schema getSchema() [NEW] Path, TupleMRBuilder, IdentityReducer, HadoopInputF...
true
ok
{"focal": {"class": "SortJob", "name": "run", "signature": "int run(String[] args) throws Exception", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "args", "type": "String[]"}], "return_type": "int"}, "class_info": {"name": "SortJob", "kind": "class", "modifiers": "", "superclass": null, "interf...
3628180_31
class UserService { public User getUserByUsername(String username) { User currentUser = authenticationService.getCurrentUser(); String domain = DomainUtil.getDomainFromLogin(currentUser.getLogin()); String login = DomainUtil.getLoginFromUsernameAndDomain(username, domain); return ge...
mockAuthenticationOnUserService("jdubois@ippon.fr"); User user = userService.getUserByUsername("jdubois"); assertThat(user.getStatusCount(), is(2L)); assertThat(user.getFollowersCount(), is(3L)); assertThat(user.getFriendsCount(), is(4L)); } }
[FOCAL] public User UserService.getUserByUsername(String username) [CLASS] class UserService [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] User getUserByLogin(String login) [CALLS-EXTERNAL] authenticationService.getCurrentUser/0, DomainUtil.getDomainFromLogin/1, User.getLogin/0, ...
/* static context [FOCAL] public User UserService.getUserByUsername(String username) [INPUTS] branches=- | result=username [COLLABORATORS] field authenticationService getCurrentUser/0 [CALLS-INTERNAL] User getUserByLogin(String login) [CALLS-EXTERNAL] authenticationService.getCurrentUser/0, DomainUtil.getDomainFromLogi...
/* static context [FOCAL] public User UserService.getUserByUsername(String username) [INPUTS] branches=- | result=username [COLLABORATORS] field authenticationService getCurrentUser/0 [CALLS-INTERNAL] User getUserByLogin(String login) [CALLS-EXTERNAL] authenticationService.getCurrentUser/0, DomainUtil.getDomainFromLogi...
true
ok
{"focal": {"class": "UserService", "name": "getUserByUsername", "signature": "User getUserByUsername(String username)", "start_line": 3, "modifiers": "public", "params": [{"name": "username", "type": "String"}], "return_type": "User"}, "class_info": {"name": "UserService", "kind": "class", "modifiers": "", "superclass"...
3644569_17
class EntityMappingExtractorImpl implements EntityMappingExtractor { public Fields extractFields(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot extract entity mapping, type is null!"); } final Entity entityAnnotation = type.getAnnotation(Entity.class); if (entityAnnotation == n...
final Fields extract = extractor.extractFields(EntityWithoutProperties.class); assertThat("Non-entites should not generate any mapped fields.", extract.isEmpty(), is(true)); } }
[FOCAL] public Fields EntityMappingExtractorImpl.extractFields(Class<?> type) [CLASS] class EntityMappingExtractorImpl implements EntityMappingExtractor [METRICS] loc=23 cc=6 branches=3 loops=1 returns=1 throws=3 nesting=3 [CALLS-EXTERNAL] Class<?>.getAnnotation/1, Class<?>.getDeclaredFields/0, FieldMappingExtractorImp...
/* static context [FOCAL] public Fields EntityMappingExtractorImpl.extractFields(Class<?> type) [THROWS-WHEN] NullPointerException when type == null [THROWS-WHEN] MappingException when !(type == null) && entityAnnotation == null [THROWS-WHEN] e when !(type == null) && !(entityAnnotation == null) && foreach(Field field ...
/* static context [FOCAL] public Fields EntityMappingExtractorImpl.extractFields(Class<?> type) [THROWS-WHEN] NullPointerException when type == null [THROWS-WHEN] MappingException when !(type == null) && entityAnnotation == null [THROWS-WHEN] e when !(type == null) && !(entityAnnotation == null) && foreach(Field field ...
true
ok
{"focal": {"class": "EntityMappingExtractorImpl", "name": "extractFields", "signature": "Fields extractFields(Class<?> type)", "start_line": 3, "modifiers": "public", "params": [{"name": "type", "type": "Class<?>"}], "return_type": "Fields"}, "class_info": {"name": "EntityMappingExtractorImpl", "kind": "class", "modifi...
3645037_2
class ProxyGrantingTicketStorageImpl implements ProxyGrantingTicketStorage { @Override public String retrieve(final String proxyGrantingTicketIou) { if (CommonUtils.isBlank(proxyGrantingTicketIou)) { return null; } final ProxyGrantingTicketHolder holder = this.cache.get(pro...
Assert.assertNull(this.storage.retrieve(null)); } }
[FOCAL] @Override public String ProxyGrantingTicketStorageImpl.retrieve(String proxyGrantingTicketIou) [CLASS] class ProxyGrantingTicketStorageImpl implements ProxyGrantingTicketStorage [METRICS] loc=18 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] CommonUtils.isBlank/1, this.cache.get/1, logger...
/* static context [FOCAL] @Override public String ProxyGrantingTicketStorageImpl.retrieve(String proxyGrantingTicketIou) [PATH1] if(CommonUtils.isBlank(proxyGrantingTicketIou))=F -> if(holder == null)=T -> return null [PATH2] if(CommonUtils.isBlank(proxyGrantingTicketIou))=F -> if(holder == null)=F -> return holder.get...
/* static context [FOCAL] @Override public String ProxyGrantingTicketStorageImpl.retrieve(String proxyGrantingTicketIou) [PATH1] if(CommonUtils.isBlank(proxyGrantingTicketIou))=F -> if(holder == null)=T -> return null [PATH2] if(CommonUtils.isBlank(proxyGrantingTicketIou))=F -> if(holder == null)=F -> return holder.get...
true
ok
{"focal": {"class": "ProxyGrantingTicketStorageImpl", "name": "retrieve", "signature": "String retrieve(String proxyGrantingTicketIou)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "proxyGrantingTicketIou", "type": "String"}], "return_type": "String"}, "class_info": {"name": "ProxyGrantingTick...
3649012_0
class FFPojoAnnotationFieldManager { public Class<?> getClassDecorator(Class<? extends Annotation> clazzPositionalFieldAnnotation){ if (!isFFPojoAnnotationField(clazzPositionalFieldAnnotation)){ throw new FFPojoException(String.format("The class %s not seem a DelimitedField or PositionalField a...
Class<?> decorator = annotationFieldManager.getClassDecorator(DateDelimitedField.class); Truth.assert_().that(decorator).isEqualTo(InternalDateDecorator.class); } }
[FOCAL] public Class<?> FFPojoAnnotationFieldManager.getClassDecorator(Class<? extends Annotation> clazzPositionalFieldAnnotation) [CLASS] class FFPojoAnnotationFieldManager [METRICS] loc=10 cc=2 branches=1 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] boolean isFFPojoAnnotationField(Class<? extends Annotation>...
/* static context [FOCAL] public Class<?> FFPojoAnnotationFieldManager.getClassDecorator(Class<? extends Annotation> clazzPositionalFieldAnnotation) [THROWS-WHEN] FFPojoException when !isFFPojoAnnotationField(clazzPositionalFieldAnnotation) [PATH1] if(!isFFPojoAnnotationField(clazzPositionalFieldAnnotation))=T -> throw...
/* static context [FOCAL] public Class<?> FFPojoAnnotationFieldManager.getClassDecorator(Class<? extends Annotation> clazzPositionalFieldAnnotation) [THROWS-WHEN] FFPojoException when !isFFPojoAnnotationField(clazzPositionalFieldAnnotation) [PATH1] if(!isFFPojoAnnotationField(clazzPositionalFieldAnnotation))=T -> throw...
true
ok
{"focal": {"class": "FFPojoAnnotationFieldManager", "name": "getClassDecorator", "signature": "Class<?> getClassDecorator(Class<? extends Annotation> clazzPositionalFieldAnnotation)", "start_line": 3, "modifiers": "public", "params": [{"name": "clazzPositionalFieldAnnotation", "type": "Class<? extends Annotation>"}], "...
3655926_5
class URIcompliance { static String extractPersistentId(URI objURI) { String URIstr = objURI.toString(); Matcher m = genericURIpattern1Pat.matcher(URIstr); if (m.matches()) { return m.group(1); } else { return null; } } private static void validateIdVersion(String displayId, String version); st...
if (extractPersistentId(uri6)==null) { return; } assert(false); } }
[FOCAL] static String URIcompliance.extractPersistentId(URI objURI) [CLASS] class URIcompliance [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] URI.toString/0, genericURIpattern1Pat.matcher/1, Matcher.matches/0, Matcher.group/1 [PATH1] if(m.matches())=T -> return m.group(1) [PATH2...
/* static context [FOCAL] static String URIcompliance.extractPersistentId(URI objURI) [PATH1] if(m.matches())=T -> return m.group(1) [PATH2] if(m.matches())=F -> return null [INPUTS] branches=objURI | result=objURI [COLLABORATORS] param objURI:URI toString/0; field genericURIpattern1Pat matcher/1 [CALLS-EXTERNAL] URI.t...
/* static context [FOCAL] static String URIcompliance.extractPersistentId(URI objURI) [PATH1] if(m.matches())=T -> return m.group(1) [PATH2] if(m.matches())=F -> return null [INPUTS] branches=objURI | result=objURI [COLLABORATORS] param objURI:URI toString/0; field genericURIpattern1Pat matcher/1 [CALLS-EXTERNAL] URI.t...
true
ok
{"focal": {"class": "URIcompliance", "name": "extractPersistentId", "signature": "String extractPersistentId(URI objURI)", "start_line": 3, "modifiers": "static", "params": [{"name": "objURI", "type": "URI"}], "return_type": "String"}, "class_info": {"name": "URIcompliance", "kind": "class", "modifiers": "", "superclas...
3657930_2715
class TreeUtil { public static boolean isNodeType(Tree tree, String typeName, Tree typeRoot) { String primaryName = TreeUtil.getName(tree, JCR_PRIMARYTYPE); if (typeName.equals(primaryName)) { return true; } else if (primaryName != null) { Tree type = typeRoot.getChi...
Tree tree = mockTree(PathUtils.ROOT_PATH, true); assertFalse(TreeUtil.isNodeType(tree, NT_REP_ROOT, typeRoot)); } }
[FOCAL] public static boolean TreeUtil.isNodeType(Tree tree, String typeName, Tree typeRoot) [CLASS] class TreeUtil [METRICS] loc=24 cc=7 branches=5 loops=1 returns=5 throws=0 nesting=3 [CALLS-INTERNAL] Iterable<String> getNames(Tree tree, String name) [CALLS-EXTERNAL] TreeUtil.getName/2, String.equals/1, Tree.getChild...
/* static context [FOCAL] public static boolean TreeUtil.isNodeType(Tree tree, String typeName, Tree typeRoot) [PATH1] if(typeName.equals(primaryName))=F -> if(primaryName != null)=T -> if(contains(getNames(type, REP_SUPERTYPES), typeName))#1=F -> foreach(String mixinName : getNames(tree, JCR_MIXINTYPES))=T -> if(typeN...
/* static context [FOCAL] public static boolean TreeUtil.isNodeType(Tree tree, String typeName, Tree typeRoot) [PATH1] if(typeName.equals(primaryName))=F -> if(primaryName != null)=T -> if(contains(getNames(type, REP_SUPERTYPES), typeName))#1=F -> foreach(String mixinName : getNames(tree, JCR_MIXINTYPES))=T -> if(typeN...
true
ok
{"focal": {"class": "TreeUtil", "name": "isNodeType", "signature": "boolean isNodeType(Tree tree, String typeName, Tree typeRoot)", "start_line": 3, "modifiers": "public static", "params": [{"name": "tree", "type": "Tree"}, {"name": "typeName", "type": "String"}, {"name": "typeRoot", "type": "Tree"}], "return_type": "b...
3661343_12
class GroupingHelper { public <KeyT> Map<KeyT, ValueT> groupUnique(Function<ValueT, KeyT> keyExtractor) { Map<KeyT, ValueT> groupedEntities = new HashMap<>(); for (ValueT value : collection) { final KeyT key = keyExtractor.apply(value); if (groupedEntities.get(key) != null) ...
Map<Integer, Integer> expected = new HashMap<>(); expected.put(2, 1); expected.put(4, 2); expected.put(6, 3); final Map<Integer, Integer> result = GROUPING_HELPER.groupUnique(number -> number * 2); Assert.assertEquals("Unexpected map content", expected, r...
[FOCAL] public Map<KeyT, ValueT> GroupingHelper.groupUnique(Function<ValueT, KeyT> keyExtractor) [CLASS] class GroupingHelper [METRICS] loc=11 cc=3 branches=1 loops=1 returns=1 throws=1 nesting=2 [CALLS-EXTERNAL] Function<ValueT, KeyT>.apply/1, Map<KeyT, ValueT>.get/1, Map<KeyT, ValueT>.put/2 [NEW] HashMap<>, Duplicate...
/* static context [FOCAL] public Map<KeyT, ValueT> GroupingHelper.groupUnique(Function<ValueT, KeyT> keyExtractor) [THROWS-WHEN] DuplicateElementException when foreach(ValueT value : collection)=T && groupedEntities.get(key) != null [PATH1] foreach(ValueT value : collection)=T -> if(groupedEntities.get(key) != null)=F ...
/* static context [FOCAL] public Map<KeyT, ValueT> GroupingHelper.groupUnique(Function<ValueT, KeyT> keyExtractor) [THROWS-WHEN] DuplicateElementException when foreach(ValueT value : collection)=T && groupedEntities.get(key) != null [PATH1] foreach(ValueT value : collection)=T -> if(groupedEntities.get(key) != null)=F ...
true
ok
{"focal": {"class": "GroupingHelper", "name": "groupUnique", "signature": "Map<KeyT, ValueT> groupUnique(Function<ValueT, KeyT> keyExtractor)", "start_line": 3, "modifiers": "public", "params": [{"name": "keyExtractor", "type": "Function<ValueT, KeyT>"}], "return_type": "Map<KeyT, ValueT>"}, "class_info": {"name": "Gro...
3664810_0
class RepositoryEntityController extends AbstractRepositoryRestController implements ApplicationEventPublisherAware { @RequestMapping(value = BASE_MAPPING + "/{id}", method = RequestMethod.GET) public ResponseEntity<EntityModel<?>> getItemResource(RootResourceInformation resourceInformation, @BackendId Serializab...
KeyValuePersistentEntity<?, ?> entity = mappingContext .getRequiredPersistentEntity(RepositoryPropertyReferenceControllerUnitTests.Sample.class); ResourceMappings mappings = new PersistentEntitiesResourceMappings( new PersistentEntities(Collections.singleton(mappingContext))); ResourceMetadata metadata...
[FOCAL] @RequestMapping(value = BASE_MAPPING + "/{id}", method = RequestMethod.GET) public ResponseEntity<EntityModel<?>> RepositoryEntityController.getItemResource(RootResourceInformation resourceInformation, Serializable id, PersistentEntityResourceAssembler assembler, HttpHeaders headers) [CLASS] class RepositoryEnt...
/* static context [FOCAL] @RequestMapping(value = BASE_MAPPING + "/{id}", method = RequestMethod.GET) public ResponseEntity<EntityModel<?>> RepositoryEntityController.getItemResource(RootResourceInformation resourceInformation, Serializable id, PersistentEntityResourceAssembler assembler, HttpHeaders headers) [INPUTS] ...
/* static context [FOCAL] @RequestMapping(value = BASE_MAPPING + "/{id}", method = RequestMethod.GET) public ResponseEntity<EntityModel<?>> RepositoryEntityController.getItemResource(RootResourceInformation resourceInformation, Serializable id, PersistentEntityResourceAssembler assembler, HttpHeaders headers) [INPUTS] ...
true
ok
{"focal": {"class": "RepositoryEntityController", "name": "getItemResource", "signature": "ResponseEntity<EntityModel<?>> getItemResource(RootResourceInformation resourceInformation, Serializable id, PersistentEntityResourceAssembler assembler, HttpHeaders headers) throws HttpRequestMethodNotSupportedException", "start...
3674743_1
class LogglyBatchAppender extends AbstractLogglyAppender<E> implements LogglyBatchAppenderMBean { @Override public int getDiscardedBucketsCount() { return outputStream.getDiscardedBucketCount(); } @Override protected void append(E eventObject); @Override public void start(); @Override ...
// assert nothing yet discarded (because nothing is yet sent) assertEquals(0, appender.getDiscardedBucketsCount()); // send stuff and wait for it to be received final int NUM_MSGS = 40; appendFullBuckets(NUM_MSGS); httpServer.waitForRequests(MAX_BUCKETS); // assert excess buckets (those > ...
[FOCAL] @Override public int LogglyBatchAppender.getDiscardedBucketsCount() [CLASS] class LogglyBatchAppender extends AbstractLogglyAppender<E> implements LogglyBatchAppenderMBean [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] outputStream.getDiscardedBucketCount/0 [COLLABORATORS]...
/* static context [FOCAL] @Override public int LogglyBatchAppender.getDiscardedBucketsCount() [COLLABORATORS] field outputStream getDiscardedBucketCount/0 [CALLS-EXTERNAL] outputStream.getDiscardedBucketCount/0 */
/* static context [FOCAL] @Override public int LogglyBatchAppender.getDiscardedBucketsCount() [COLLABORATORS] field outputStream getDiscardedBucketCount/0 [CALLS-EXTERNAL] outputStream.getDiscardedBucketCount/0 */ class LogglyBatchAppender extends AbstractLogglyAppender<E> implements LogglyBatchAppenderMBean { @Ov...
true
ok
{"focal": {"class": "LogglyBatchAppender", "name": "getDiscardedBucketsCount", "signature": "int getDiscardedBucketsCount()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "int"}, "class_info": {"name": "LogglyBatchAppender", "kind": "class", "modifiers": "", "superclass": "AbstractLogg...
3690150_69
class UiUtils { public String pageLink(String providerName, String pageName) { return pageLink(providerName, pageName, null); } public void includeCss(String file); public void includeCss(String providerName, String file); public void includeCss(String providerName, String file, Integer priority); public void...
String link = ui.pageLink("mymoduleid", "myPage?param=val#mySection", null); Assert.assertTrue(link.endsWith("/mymoduleid/myPage.page?param=val#mySection")); } }
[FOCAL] public String UiUtils.pageLink(String providerName, String pageName) [CLASS] class UiUtils [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] String pageLink(String providerName, String pageName, Map<String, Object> params) [INPUTS] branches=- | result=pageName, providerName [...
/* static context [FOCAL] public String UiUtils.pageLink(String providerName, String pageName) [INPUTS] branches=- | result=pageName, providerName [CALLS-INTERNAL] String pageLink(String providerName, String pageName, Map<String, Object> params) */
/* static context [FOCAL] public String UiUtils.pageLink(String providerName, String pageName) [INPUTS] branches=- | result=pageName, providerName [CALLS-INTERNAL] String pageLink(String providerName, String pageName, Map<String, Object> params) */ class UiUtils { public String pageLink(String providerName, String pa...
true
ok
{"focal": {"class": "UiUtils", "name": "pageLink", "signature": "String pageLink(String providerName, String pageName)", "start_line": 3, "modifiers": "public", "params": [{"name": "providerName", "type": "String"}, {"name": "pageName", "type": "String"}], "return_type": "String"}, "class_info": {"name": "UiUtils", "ki...
3691193_14
class AllComponentsState { @Transactional public void setComponentState(String componentId, ComponentType type, boolean enabled) { log.debug("Setting Component State : componentId = " + componentId + " type = " + type + " enabled " + enabled); ComponentState componentState; synchronize...
String componentId = "componentId"; ComponentType componentType = ComponentType.APP; Criteria mockCriteria = mock(Criteria.class); DbSession mockSession = mock(DbSession.class); when(sessionFactory.getCurrentSession()).thenReturn(mockSession); when(mockSession.createCrite...
[FOCAL] @Transactional public void AllComponentsState.setComponentState(String componentId, ComponentType type, boolean enabled) [CLASS] class AllComponentsState [METRICS] loc=17 cc=2 branches=1 loops=0 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] ComponentState getComponentState(String componentId, ComponentType type...
/* static context [FOCAL] @Transactional public void AllComponentsState.setComponentState(String componentId, ComponentType type, boolean enabled) [PATH1] if(componentState == null)=T [PATH2] if(componentState == null)=F [INPUTS] branches=componentId, type | result=- [COLLABORATORS] field sessionFactory:DbSessionFactor...
/* static context [FOCAL] @Transactional public void AllComponentsState.setComponentState(String componentId, ComponentType type, boolean enabled) [PATH1] if(componentState == null)=T [PATH2] if(componentState == null)=F [INPUTS] branches=componentId, type | result=- [COLLABORATORS] field sessionFactory:DbSessionFactor...
true
ok
{"focal": {"class": "AllComponentsState", "name": "setComponentState", "signature": "void setComponentState(String componentId, ComponentType type, boolean enabled)", "start_line": 3, "modifiers": "@Transactional public", "params": [{"name": "componentId", "type": "String"}, {"name": "type", "type": "ComponentType"}, {...
3699746_62
class OsgiDefaultProducer extends DefaultProducer { @Override protected void doStop() throws Exception { ServiceHelper.stopService(processor); services.stopTracking(); super.doStop(); } public OsgiDefaultProducer(OsgiDefaultEndpoint endpoint, Map<String, Object> props); @...
OsgiDefaultProducer producer = createProducer(Collections.singletonMap("key", (Object) "value")); ServiceHelper.startService(producer); ServiceHelper.stopService(producer); verify(producer.getApplicationBundleContext()).removeServiceListener(Matchers.any(ServiceListener.class)); } ...
[FOCAL] @Override protected void OsgiDefaultProducer.doStop() [CLASS] class OsgiDefaultProducer extends DefaultProducer [METRICS] loc=6 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] ServiceHelper.stopService/1, services.stopTracking/0, DefaultProducer.doStop/0 [EXCEPTIONS] declares Exception [CO...
/* static context [FOCAL] @Override protected void OsgiDefaultProducer.doStop() [COLLABORATORS] field services stopTracking/0 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] ServiceHelper.stopService/1, services.stopTracking/0, DefaultProducer.doStop/0 */
/* static context [FOCAL] @Override protected void OsgiDefaultProducer.doStop() [COLLABORATORS] field services stopTracking/0 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] ServiceHelper.stopService/1, services.stopTracking/0, DefaultProducer.doStop/0 */ class OsgiDefaultProducer extends DefaultProducer { @Overr...
true
ok
{"focal": {"class": "OsgiDefaultProducer", "name": "doStop", "signature": "void doStop() throws Exception", "start_line": 3, "modifiers": "@Override protected", "params": [], "return_type": "void"}, "class_info": {"name": "OsgiDefaultProducer", "kind": "class", "modifiers": "", "superclass": "DefaultProducer", "interfa...
3706353_2
class OmitIndexingFilter implements IndexingFilter { @Override public NutchDocument filter(NutchDocument doc, Parse parse, Text url, CrawlDatum datum, Inlinks inlinks) throws IndexingException { // Prepare data String realUrl = new String(url.getBytes()).substring(0, url.getLength()); Metadata metadata = pars...
// Prepare data Parse parse = mock(Parse.class); Configuration configuration = mock(Configuration.class); ParseData parseData = new ParseData(); parseData.setParseMeta(metadata); // Mock data when(parse.getData()).thenReturn(parseData); when(configuration.get(anyString())).thenReturn(""); when(con...
[FOCAL] @Override public NutchDocument OmitIndexingFilter.filter(NutchDocument doc, Parse parse, Text url, CrawlDatum datum, Inlinks inlinks) [CLASS] class OmitIndexingFilter implements IndexingFilter [METRICS] loc=58 cc=13 branches=8 loops=2 returns=7 throws=0 nesting=5 [CALLS-EXTERNAL] new String(url.getBytes()).subs...
/* static context [FOCAL] @Override public NutchDocument OmitIndexingFilter.filter(NutchDocument doc, Parse parse, Text url, CrawlDatum datum, Inlinks inlinks) [PATH1] if(omitIndexingFilterConfiguration.getFilteringType() == FilteringType.WHITELIST)=F -> if(omitIndexingFilterConfiguration.getFilteringType() == Filterin...
/* static context [FOCAL] @Override public NutchDocument OmitIndexingFilter.filter(NutchDocument doc, Parse parse, Text url, CrawlDatum datum, Inlinks inlinks) [PATH1] if(omitIndexingFilterConfiguration.getFilteringType() == FilteringType.WHITELIST)=F -> if(omitIndexingFilterConfiguration.getFilteringType() == Filterin...
true
ok
{"focal": {"class": "OmitIndexingFilter", "name": "filter", "signature": "NutchDocument filter(NutchDocument doc, Parse parse, Text url, CrawlDatum datum, Inlinks inlinks) throws IndexingException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "doc", "type": "NutchDocument"}, {"name": "parse", ...
3710234_51
class Lexer { public List<RobotLine> lex() throws CoreException { try { System.out.println("Lexing " + filename); CountingLineReader contents = new CountingLineReader(filestream); String line; int lineNo = 0; int charPos = 0; while (nu...
Lexer lexer = new Lexer("x"); List<RobotLine> lines = lexer.lex(); assertEquals(1, lines.size()); RobotLine line1 = lines.get(0); assertThat(line1.lineNo, is(0)); assertThat(line1.lineCharPos, is(0)); assertThat(line1.arguments.size(), is(1)); } }
[FOCAL] public List<RobotLine> Lexer.lex() [CLASS] class Lexer [METRICS] loc=34 cc=7 branches=1 loops=1 returns=2 throws=3 nesting=3 [CALLS-INTERNAL] void lexLine(String line, int lineNo, int charPos) [CALLS-EXTERNAL] System.out.println/1, CountingLineReader.readLine/0, monitor.isCanceled/0, CountingLineReader.getCharP...
/* static context [FOCAL] public List<RobotLine> Lexer.lex() [THROWS-WHEN] RuntimeException when try-body throws [THROWS-WHEN] RuntimeException when null != (line = contents.readLine()) && !monitor.isCanceled() && try-body throws && throw new RuntimeException("Error when lexing line " + lineNo + ": '" + l... [THROWS-WH...
/* static context [FOCAL] public List<RobotLine> Lexer.lex() [THROWS-WHEN] RuntimeException when try-body throws [THROWS-WHEN] RuntimeException when null != (line = contents.readLine()) && !monitor.isCanceled() && try-body throws && throw new RuntimeException("Error when lexing line " + lineNo + ": '" + l... [THROWS-WH...
true
ok
{"focal": {"class": "Lexer", "name": "lex", "signature": "List<RobotLine> lex() throws CoreException", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<RobotLine>"}, "class_info": {"name": "Lexer", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members...
3713233_87
class ClassMetaExtractor { public ClassMeta extract(String sourceCodeString) { Assertion.on("sourceCodeString").mustNotBeNull(sourceCodeString); ClassMeta meta = new ClassMeta(); String modifiedSourceCodeString = TrimFilterUtil.doAllFilters(sourceCodeString); // -----------------...
ClassMetaExtractor target = new ClassMetaExtractor(config); String sourceCodeString = null; try { target.extract(sourceCodeString); fail(); } catch (JUnitHelperCoreException e) { } } }
[FOCAL] public ClassMeta ClassMetaExtractor.extract(String sourceCodeString) [CLASS] class ClassMetaExtractor [METRICS] loc=102 cc=20 branches=11 loops=8 returns=1 throws=0 nesting=5 [CALLS-INTERNAL] String renameIfDuplicatedToConstructorArgNames(String argName, List<String> constructorArgs, List<String> methodArgs); b...
/* static context [FOCAL] public ClassMeta ClassMetaExtractor.extract(String sourceCodeString) [PATH1] if(matcherGroupingPackageName.find())=T -> for(i < lenForOutOfBrace)=T -> if(current == '<')=T -> if(current == '>')=T -> if(depth <= 0)=T -> exit loop -> if(!isClass && !meta.isEnum)=T -> for(i < splittedBySpace.leng...
/* static context [FOCAL] public ClassMeta ClassMetaExtractor.extract(String sourceCodeString) [PATH1] if(matcherGroupingPackageName.find())=T -> for(i < lenForOutOfBrace)=T -> if(current == '<')=T -> if(current == '>')=T -> if(depth <= 0)=T -> exit loop -> if(!isClass && !meta.isEnum)=T -> for(i < splittedBySpace.leng...
true
ok
{"focal": {"class": "ClassMetaExtractor", "name": "extract", "signature": "ClassMeta extract(String sourceCodeString)", "start_line": 3, "modifiers": "public", "params": [{"name": "sourceCodeString", "type": "String"}], "return_type": "ClassMeta"}, "class_info": {"name": "ClassMetaExtractor", "kind": "class", "modifier...
3713238_183
class Minus extends AbstractRhsFunctionHandler { @Override public Symbol execute(RhsFunctionContext context, List<Symbol> arguments) throws RhsFunctionException { RhsFunctions.checkAllArgumentsAreNumeric(getName(), arguments); RhsFunctions.checkArgumentCount(this, arguments); ...
Minus minus = new Minus(); assertEquals(-33, minus.execute(rhsFuncContext, Symbols.asList(syms, 33)).asInteger().getValue()); } }
[FOCAL] @Override public Symbol Minus.execute(RhsFunctionContext context, List<Symbol> arguments) [CLASS] class Minus extends AbstractRhsFunctionHandler [METRICS] loc=62 cc=7 branches=5 loops=1 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] RhsFunctions.checkAllArgumentsAreNumeric/2, getName/0 (inherited), RhsFunctions....
/* static context [FOCAL] @Override public Symbol Minus.execute(RhsFunctionContext context, List<Symbol> arguments) [PATH1] if(arguments.size() == 1)=F -> if(ic != null)#1=T -> for(index < arguments.size())=T -> if(ic != null)#2=T -> if(float_found)#1=T -> exit loop -> return float_found ? syms.createDouble(f) : syms.c...
/* static context [FOCAL] @Override public Symbol Minus.execute(RhsFunctionContext context, List<Symbol> arguments) [PATH1] if(arguments.size() == 1)=F -> if(ic != null)#1=T -> for(index < arguments.size())=T -> if(ic != null)#2=T -> if(float_found)#1=T -> exit loop -> return float_found ? syms.createDouble(f) : syms.c...
true
ok
{"focal": {"class": "Minus", "name": "execute", "signature": "Symbol execute(RhsFunctionContext context, List<Symbol> arguments) throws RhsFunctionException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "context", "type": "RhsFunctionContext"}, {"name": "arguments", "type": "List<Symbol>"}], "...
3722315_4
class UPortalURLServiceImpl implements IURLService { @Override public String getLocationUrl(Location location, PortletRequest request) { try { final String encodedLocation = URLEncoder.encode(location.getIdentifier(), "UTF-8"); return portalContext.concat("/s/location?id=").conc...
Location location = new Location(); location.setIdentifier("ABC"); String url = urlService.getLocationUrl(location, request); assertEquals("/context/s/location?id=ABC", url); } }
[FOCAL] @Override public String UPortalURLServiceImpl.getLocationUrl(Location location, PortletRequest request) [CLASS] class UPortalURLServiceImpl implements IURLService [METRICS] loc=10 cc=2 branches=0 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] URLEncoder.encode/2, Location.getIdentifier/0, portalContext.c...
/* static context [FOCAL] @Override public String UPortalURLServiceImpl.getLocationUrl(Location location, PortletRequest request) [PATH1] try-body throws -> return null [PATH2] return portalContext.concat("/s/location?id=").concat(encodedLocation) [INPUTS] branches=- | result=location | unused=request [COLLABORATORS] p...
/* static context [FOCAL] @Override public String UPortalURLServiceImpl.getLocationUrl(Location location, PortletRequest request) [PATH1] try-body throws -> return null [PATH2] return portalContext.concat("/s/location?id=").concat(encodedLocation) [INPUTS] branches=- | result=location | unused=request [COLLABORATORS] p...
true
ok
{"focal": {"class": "UPortalURLServiceImpl", "name": "getLocationUrl", "signature": "String getLocationUrl(Location location, PortletRequest request)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "location", "type": "Location"}, {"name": "request", "type": "PortletRequest"}], "return_type": "S...
3724388_103
class IOUtil extends WWIO { public static ByteBuffer readByteBuffer(URL url) throws IOException { ByteBuffer byteBuffer = null; if (URLUtil.isForResourceWithExtension(url, "zip")) { //try opening the file as a zip file; if this fails, log a warning and read file directly into the buffer InputStream is = ...
ByteBuffer byteBuffer = IOUtil.readByteBuffer(getClass().getResource("bytes.out")); assertNotNull(byteBuffer); assertEquals(1, byteBuffer.get()); assertEquals(2, byteBuffer.get()); assertEquals(3, byteBuffer.get()); assertEquals(4, byteBuffer.get()); assertEquals(5, byteBuffer.get()); } }
[FOCAL] public static ByteBuffer IOUtil.readByteBuffer(URL url) [CLASS] class IOUtil extends WWIO [METRICS] loc=30 cc=5 branches=3 loops=0 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] URLUtil.isForResourceWithExtension/2, URL.openStream/0, ZipRetriever.readZipStream/2, Exception.getLocalizedMessage/0, Logging.logger()...
/* static context [FOCAL] public static ByteBuffer IOUtil.readByteBuffer(URL url) [PATH1] if(URLUtil.isForResourceWithExtension(url, "zip"))=T -> try-body throws -> if(is != null)=T -> if(byteBuffer == null)=T -> return byteBuffer [PATH2] if(URLUtil.isForResourceWithExtension(url, "zip"))=F -> if(byteBuffer == null)=F ...
/* static context [FOCAL] public static ByteBuffer IOUtil.readByteBuffer(URL url) [PATH1] if(URLUtil.isForResourceWithExtension(url, "zip"))=T -> try-body throws -> if(is != null)=T -> if(byteBuffer == null)=T -> return byteBuffer [PATH2] if(URLUtil.isForResourceWithExtension(url, "zip"))=F -> if(byteBuffer == null)=F ...
true
ok
{"focal": {"class": "IOUtil", "name": "readByteBuffer", "signature": "ByteBuffer readByteBuffer(URL url) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "url", "type": "URL"}], "return_type": "ByteBuffer"}, "class_info": {"name": "IOUtil", "kind": "class", "modifiers": "", "super...
3726486_7
class HashCalculator { public HashCalculationResult calculateSuperHash(File file) throws IOException { // Ignore files smaller than 0.5kb long fileSize = file.length(); if (fileSize <= FILE_MIN_SIZE_THRESHOLD) { logger.debug("Ignored file " + file.getName() + " (" + FileUtils.by...
HashCalculator hashCalculator = new HashCalculator(); File originFile = new File(URLDecoder.decode(getClass().getResource("/superHash/origin.txt").getFile(), "utf-8")); HashCalculationResult originFileHashResult = hashCalculator.calculateSuperHash(originFile); File whitespaceChangesFile...
[FOCAL] public HashCalculationResult HashCalculator.calculateSuperHash(File file) [CLASS] class HashCalculator [METRICS] loc=21 cc=4 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-INTERNAL] HashCalculationResult calculateSuperHash(byte[] bytes) [CALLS-EXTERNAL] File.length/0, logger.debug/1, File.getName/0, Fil...
/* static context [FOCAL] public HashCalculationResult HashCalculator.calculateSuperHash(File file) [PATH1] if(fileSize <= FILE_MIN_SIZE_THRESHOLD)=F -> if(fileSize >= FILE_MAX_SIZE_THRESHOLD)=F -> try-body throws -> return result [PATH2] if(fileSize <= FILE_MIN_SIZE_THRESHOLD)=T -> return null [PATH3] if(fileSize <= F...
/* static context [FOCAL] public HashCalculationResult HashCalculator.calculateSuperHash(File file) [PATH1] if(fileSize <= FILE_MIN_SIZE_THRESHOLD)=F -> if(fileSize >= FILE_MAX_SIZE_THRESHOLD)=F -> try-body throws -> return result [PATH2] if(fileSize <= FILE_MIN_SIZE_THRESHOLD)=T -> return null [PATH3] if(fileSize <= F...
true
ok
{"focal": {"class": "HashCalculator", "name": "calculateSuperHash", "signature": "HashCalculationResult calculateSuperHash(File file) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "file", "type": "File"}], "return_type": "HashCalculationResult"}, "class_info": {"name": "HashCalculator...
3728202_22
class ApiController extends AbstractApiController { protected void setResultOptions(AbstractEntry entry, Integer count, Integer startIndex, String sortBy) { entry.setFiltered(false); entry.setSorted(sortBy != null); if (sortBy != null) { entry.sortEntryCollection(sortBy); } entry.setUpdated...
AbstractEntry entry = new PersonEntry(new Person(), 1, 1, "name", 5); controller.setResultOptions(entry, 3, 2, "name"); assertEquals(1, entry.getTotalResults()); } }
[FOCAL] protected void ApiController.setResultOptions(AbstractEntry entry, Integer count, Integer startIndex, String sortBy) [CLASS] class ApiController extends AbstractApiController [METRICS] loc=28 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] AbstractEntry.setFiltered/1, AbstractEntry.setSort...
/* static context [FOCAL] protected void ApiController.setResultOptions(AbstractEntry entry, Integer count, Integer startIndex, String sortBy) [PATH1] if(sortBy != null)=T -> if(startIndex > 0 || count > 0)=T [PATH2] if(sortBy != null)=F -> if(startIndex > 0 || count > 0)=F [INPUTS] branches=count, entry, sortBy | resu...
/* static context [FOCAL] protected void ApiController.setResultOptions(AbstractEntry entry, Integer count, Integer startIndex, String sortBy) [PATH1] if(sortBy != null)=T -> if(startIndex > 0 || count > 0)=T [PATH2] if(sortBy != null)=F -> if(startIndex > 0 || count > 0)=F [INPUTS] branches=count, entry, sortBy | resu...
true
ok
{"focal": {"class": "ApiController", "name": "setResultOptions", "signature": "void setResultOptions(AbstractEntry entry, Integer count, Integer startIndex, String sortBy)", "start_line": 3, "modifiers": "protected", "params": [{"name": "entry", "type": "AbstractEntry"}, {"name": "count", "type": "Integer"}, {"name": "...
3728381_27
class NdefMessageEncoder { public byte[] encodeSingle(Record record) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); encodeSingle(record, baos); return baos.toByteArray(); } public NdefMessageEncoder(NdefRecordEncoder ndefRecordEncoder); public void encodeSingle(Record record, ByteArrayOutputS...
byte[] single = encoder.encodeSingle(new UriRecord( "http://www.verylongurl.com/aljhsldfkjhasldfkhjaljhsldfkjhasldf" + "khjaljhsldfkjhasldfkhjaljhsldfkjhasldfkhjaljhsldfkjhasldfkhjaljhsldfkjhasldfkhjal" + "jhsldfkjhasldfkhjaljhsldfkjhasldfkhjaljhsldfkjhasldfkhjaljhsldfkjhasldfkhjaljhsldf" + "kj...
[FOCAL] public byte[] NdefMessageEncoder.encodeSingle(Record record) [CLASS] class NdefMessageEncoder [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] void encodeSingle(Record record, ByteArrayOutputStream out) [CALLS-EXTERNAL] ByteArrayOutputStream.toByteArray/0 [NEW] ByteArrayOutp...
/* static context [FOCAL] public byte[] NdefMessageEncoder.encodeSingle(Record record) [CALLS-INTERNAL] void encodeSingle(Record record, ByteArrayOutputStream out) [NEW] ByteArrayOutputStream [CALLS-EXTERNAL] ByteArrayOutputStream.toByteArray/0 */
/* static context [FOCAL] public byte[] NdefMessageEncoder.encodeSingle(Record record) [CALLS-INTERNAL] void encodeSingle(Record record, ByteArrayOutputStream out) [NEW] ByteArrayOutputStream [CALLS-EXTERNAL] ByteArrayOutputStream.toByteArray/0 */ class NdefMessageEncoder { public byte[] encodeSingle(Record record) {...
true
ok
{"focal": {"class": "NdefMessageEncoder", "name": "encodeSingle", "signature": "byte[] encodeSingle(Record record)", "start_line": 3, "modifiers": "public", "params": [{"name": "record", "type": "Record"}], "return_type": "byte[]"}, "class_info": {"name": "NdefMessageEncoder", "kind": "class", "modifiers": "", "supercl...
3732883_60
class ApiNode implements Node { @Override public NodePath getNodePath() { String name = getName(); ApiNode parent = context.getParentNode(); NodePath path = isRoot() ? NodePath.root() : NodePath.path(name); if (parent != null) { path = parent.getNodePath().append(pa...
root.addChild("child0").addChild("child0-0"); assertEquals("/child0", root.getChild("child0").getNodePath().toString()); assertEquals("/child0/child0-0", root.getChild("child0").getChild("child0-0").getNodePath().toString()); } }
[FOCAL] @Override public NodePath ApiNode.getNodePath() [CLASS] class ApiNode implements Node [METRICS] loc=12 cc=2 branches=1 loops=0 returns=1 throws=0 nesting=1 [CALLS-INTERNAL] String getName(); boolean isRoot() [CALLS-EXTERNAL] context.getParentNode/0, NodePath.root/0, NodePath.path/1, parent.getNodePath().append/...
/* static context [FOCAL] @Override public NodePath ApiNode.getNodePath() [PATH1] if(parent != null)=T -> return path [PATH2] if(parent != null)=F -> return path [COLLABORATORS] field context getParentNode/0 [CALLS-INTERNAL] String getName(); boolean isRoot() [CALLS-EXTERNAL] context.getParentNode/0, NodePath.root/0, N...
/* static context [FOCAL] @Override public NodePath ApiNode.getNodePath() [PATH1] if(parent != null)=T -> return path [PATH2] if(parent != null)=F -> return path [COLLABORATORS] field context getParentNode/0 [CALLS-INTERNAL] String getName(); boolean isRoot() [CALLS-EXTERNAL] context.getParentNode/0, NodePath.root/0, N...
true
ok
{"focal": {"class": "ApiNode", "name": "getNodePath", "signature": "NodePath getNodePath()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "NodePath"}, "class_info": {"name": "ApiNode", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Node", "fields": [{"name": "navi...
3742443_2
class Gq implements Identifiable, Group<Gq> { @Override public Group.Element<Gq> getIdentityElement() { return element(BigInteger.ONE); } public Gq(GqSetup setup); private Group.Element<Gq> element(BigInteger element); @Override public Group.Element<Gq> getGenerator(); @Override public String getIdentity()...
Group.Element<Gq> identity = group.getIdentityElement(); assertEquals(group, identity.getGroup()); } }
[FOCAL] @Override public Group.Element<Gq> Gq.getIdentityElement() [CLASS] class Gq implements Identifiable, Group<Gq> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Group.Element<Gq> element(BigInteger element) [CLASS-MEMBERS] Gq(GqSetup setup); Group.Element<Gq> element(BigInteg...
/* static context [FOCAL] @Override public Group.Element<Gq> Gq.getIdentityElement() [CALLS-INTERNAL] Group.Element<Gq> element(BigInteger element) */
/* static context [FOCAL] @Override public Group.Element<Gq> Gq.getIdentityElement() [CALLS-INTERNAL] Group.Element<Gq> element(BigInteger element) */ class Gq implements Identifiable, Group<Gq> { @Override public Group.Element<Gq> getIdentityElement() { return element(BigInteger.ONE); } public Gq(GqSetup setu...
true
ok
{"focal": {"class": "Gq", "name": "getIdentityElement", "signature": "Group.Element<Gq> getIdentityElement()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Group.Element<Gq>"}, "class_info": {"name": "Gq", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Identifiab...
3743376_249
class Community extends DSpaceObject implements DSpaceObjectLegacySupport { void setLogo(Bitstream logo) { this.logo = logo; setModified(); } protected Community(); void addSubCommunity(Community subCommunity); public void removeSubCommunity(Community subCommunity); public B...
// Disallow current Community WRITE perms doThrow(new AuthorizeException()).when(authorizeServiceSpy).authorizeAction(context, c, Constants.WRITE); File f = new File(testProps.get("test.bitstream").toString()); communityService.setLogo(context, c, new FileInputStream(f)); fail("...
[FOCAL] void Community.setLogo(Bitstream logo) [CLASS] class Community extends DSpaceObject implements DSpaceObjectLegacySupport [METRICS] loc=4 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] setModified/0 (inherited) [FIELDS] write=logo [STATE] logo via getLogo() [DATAFLOW] logo@param->L2 [CLASS...
/* static context [FOCAL] void Community.setLogo(Bitstream logo) [STATE] logo via getLogo() [FIELDS] write=logo [CALLS-EXTERNAL] setModified/0 (inherited) */
/* static context [FOCAL] void Community.setLogo(Bitstream logo) [STATE] logo via getLogo() [FIELDS] write=logo [CALLS-EXTERNAL] setModified/0 (inherited) */ class Community extends DSpaceObject implements DSpaceObjectLegacySupport { void setLogo(Bitstream logo) { this.logo = logo; setModified(); ...
true
ok
{"focal": {"class": "Community", "name": "setLogo", "signature": "void setLogo(Bitstream logo)", "start_line": 3, "modifiers": "", "params": [{"name": "logo", "type": "Bitstream"}], "return_type": "void"}, "class_info": {"name": "Community", "kind": "class", "modifiers": "", "superclass": "DSpaceObject", "interfaces": ...
3743505_14
class DropboxAPI { public List<Entry> search(String path, String query, int fileLimit, boolean includeDeleted) throws DropboxException { assertAuthenticated(); if (fileLimit <= 0) { fileLimit = SEARCH_DEFAULT_LIMIT; } String target = "/search/" + session.ge...
try { // Should be too short, and give an error api.search("/", "", 1000, false); assert false: "Short (empty) search string did not throw an error."; } catch (DropboxServerException e) { if (e.error != DropboxServerException._400_BAD_REQUEST) { ...
[FOCAL] public List<Entry> DropboxAPI.search(String path, String query, int fileLimit, boolean includeDeleted) [CLASS] class DropboxAPI [METRICS] loc=34 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] void assertAuthenticated() [CALLS-EXTERNAL] session.getAccessType/0, String.valueOf/1, session.ge...
/* static context [FOCAL] public List<Entry> DropboxAPI.search(String path, String query, int fileLimit, boolean includeDeleted) [PATH1] if(fileLimit <= 0)=T -> if(response instanceof JSONArray)=T -> foreach(Object next : jresp)=T -> if(next instanceof Map)=T -> exit loop -> return ret [PATH2] if(fileLimit <= 0)=F -> i...
/* static context [FOCAL] public List<Entry> DropboxAPI.search(String path, String query, int fileLimit, boolean includeDeleted) [PATH1] if(fileLimit <= 0)=T -> if(response instanceof JSONArray)=T -> foreach(Object next : jresp)=T -> if(next instanceof Map)=T -> exit loop -> return ret [PATH2] if(fileLimit <= 0)=F -> i...
true
ok
{"focal": {"class": "DropboxAPI", "name": "search", "signature": "List<Entry> search(String path, String query, int fileLimit, boolean includeDeleted) throws DropboxException", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}, {"name": "query", "type": "String"}, {"name": "fileLimit...
3744706_7
class ResourceLoader { public InputStream getResourceAsStream(String name) throws IOException { if (name.startsWith("classpath:")) return openClasspathResource(name); else if (name.startsWith("file:")) return openFileResource(name); else return op...
logger.info("testWarInternalRelativePathNoBasedir()"); ResourceLoader loader = new ResourceLoader(war); // without a basedir, relative paths are relative to the root of the WAR in = loader.getResourceAsStream("WEB-INF/web.xml"); assertNotNull("returned resource", in); ...
[FOCAL] public InputStream ResourceLoader.getResourceAsStream(String name) [CLASS] class ResourceLoader [METRICS] loc=10 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] InputStream openClasspathResource(String name); InputStream openFileResource(String name); InputStream openWarResource(String nam...
/* static context [FOCAL] public InputStream ResourceLoader.getResourceAsStream(String name) [PATH1] if(name.startsWith("classpath:"))=F -> if(name.startsWith("file:"))=T -> return openFileResource(name) [PATH2] if(name.startsWith("classpath:"))=T -> return openClasspathResource(name) [PATH3] if(name.startsWith("classp...
/* static context [FOCAL] public InputStream ResourceLoader.getResourceAsStream(String name) [PATH1] if(name.startsWith("classpath:"))=F -> if(name.startsWith("file:"))=T -> return openFileResource(name) [PATH2] if(name.startsWith("classpath:"))=T -> return openClasspathResource(name) [PATH3] if(name.startsWith("classp...
true
ok
{"focal": {"class": "ResourceLoader", "name": "getResourceAsStream", "signature": "InputStream getResourceAsStream(String name) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "name", "type": "String"}], "return_type": "InputStream"}, "class_info": {"name": "ResourceLoader", "kind": "cl...
3750999_3
class ProfileTemplate extends AbstractTemplate implements ProfileOperations { public XingProfile getUserProfile() { return getProfileById("me"); } public ProfileTemplate(String xingBaseUrl, RestOperations restOperations, ObjectMapper objectMapper); public ProfileTemplate(RestOperations restO...
mockServer.expect(requestTo(XingTemplate.DEFAULT_BASE_URL + ProfileTemplate.USERS_URL.replaceFirst("\\{id\\}", "me"))).andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("testdata/profile.json", getClass()), MediaType.APPLICATION_JSON)); XingProfile userProfile = xing.profileOperations().getUs...
[FOCAL] public XingProfile ProfileTemplate.getUserProfile() [CLASS] class ProfileTemplate extends AbstractTemplate implements ProfileOperations [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] XingProfile getProfileById(String id) [CLASS-MEMBERS] ProfileTemplate(String xingBaseUrl, ...
/* static context [FOCAL] public XingProfile ProfileTemplate.getUserProfile() [CALLS-INTERNAL] XingProfile getProfileById(String id) */
/* static context [FOCAL] public XingProfile ProfileTemplate.getUserProfile() [CALLS-INTERNAL] XingProfile getProfileById(String id) */ class ProfileTemplate extends AbstractTemplate implements ProfileOperations { public XingProfile getUserProfile() { return getProfileById("me"); } public Profile...
true
ok
{"focal": {"class": "ProfileTemplate", "name": "getUserProfile", "signature": "XingProfile getUserProfile()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "XingProfile"}, "class_info": {"name": "ProfileTemplate", "kind": "class", "modifiers": "", "superclass": "AbstractTemplate", "interfaces": "...
3756907_0
class BackoffSleeper { public BackoffSleeper(long minWait, long maxWait, double backoffMultiplier) { if (minWait <= 0) { throw new IllegalArgumentException("Minimum wait must be at least 1 ms"); } if (maxWait <= minWait) { throw new IllegalArgumentExc...
BackoffSleeper sleeper = new BackoffSleeper(50, 230, 2.0); long now = System.currentTimeMillis(); sleeper.sleep(); Assert.assertEquals(now + 50, System.currentTimeMillis(), 50); sleeper.sleep(); Assert.assertEquals(now + 150, System.currentTimeMillis(), 100); slee...
[FOCAL] public BackoffSleeper.BackoffSleeper(long minWait, long maxWait, double backoffMultiplier) [CLASS] class BackoffSleeper [METRICS] loc=18 cc=4 branches=3 loops=0 returns=0 throws=3 nesting=1 [CALLS-INTERNAL] void reset() [NEW] IllegalArgumentException [EXCEPTIONS] throws IllegalArgumentException [THROWS-WHEN] Il...
/* static context [FOCAL] public BackoffSleeper.BackoffSleeper(long minWait, long maxWait, double backoffMultiplier) [THROWS-WHEN] IllegalArgumentException when minWait <= 0 [THROWS-WHEN] IllegalArgumentException when !(minWait <= 0) && maxWait <= minWait [THROWS-WHEN] IllegalArgumentException when !(minWait <= 0) && !...
/* static context [FOCAL] public BackoffSleeper.BackoffSleeper(long minWait, long maxWait, double backoffMultiplier) [THROWS-WHEN] IllegalArgumentException when minWait <= 0 [THROWS-WHEN] IllegalArgumentException when !(minWait <= 0) && maxWait <= minWait [THROWS-WHEN] IllegalArgumentException when !(minWait <= 0) && !...
true
ok
{"focal": {"class": "BackoffSleeper", "name": "BackoffSleeper", "signature": "BackoffSleeper(long minWait, long maxWait, double backoffMultiplier)", "start_line": 3, "modifiers": "public", "params": [{"name": "minWait", "type": "long"}, {"name": "maxWait", "type": "long"}, {"name": "backoffMultiplier", "type": "double"...
3765814_1
class ExtensionObjectMapper { public static <T> T getOtherAttribute(Map<QName, String> otherAttributes, String attributeName) { T otherAttribute = null; for (QName qname : otherAttributes.keySet()) { String value = otherAttributes.get(qname); String key = qname.getLocalPart(...
String crazyName = ExtensionObjectMapper.getOtherAttribute(unMarshalledLb.getOtherAttributes(), "crazyName"); Assert.assertEquals("foo", crazyName); } }
[FOCAL] public static T ExtensionObjectMapper.getOtherAttribute(Map<QName, String> otherAttributes, String attributeName) [CLASS] class ExtensionObjectMapper [METRICS] loc=12 cc=3 branches=1 loops=1 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] Map<QName, String>.keySet/0, Map<QName, String>.get/1, QName.getLocalPart/0...
/* static context [FOCAL] public static T ExtensionObjectMapper.getOtherAttribute(Map<QName, String> otherAttributes, String attributeName) [PATH1] foreach(QName qname : otherAttributes.keySet())=T -> if(key.equalsIgnoreCase(attributeName))=T -> exit loop -> return otherAttribute [PATH2] foreach(QName qname : otherAttr...
/* static context [FOCAL] public static T ExtensionObjectMapper.getOtherAttribute(Map<QName, String> otherAttributes, String attributeName) [PATH1] foreach(QName qname : otherAttributes.keySet())=T -> if(key.equalsIgnoreCase(attributeName))=T -> exit loop -> return otherAttribute [PATH2] foreach(QName qname : otherAttr...
true
ok
{"focal": {"class": "ExtensionObjectMapper", "name": "getOtherAttribute", "signature": "T getOtherAttribute(Map<QName, String> otherAttributes, String attributeName)", "start_line": 3, "modifiers": "public static", "params": [{"name": "otherAttributes", "type": "Map<QName, String>"}, {"name": "attributeName", "type": "...
3772264_10
class RiemannReporter extends ScheduledReporter { @Override public void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, ...
reporter.report(map("gauge", gauge(1.1)), this.<Counter>map(), this.<Histogram>map(), this.<Meter>map(), this.<Timer>map()); final InOrder inOrder = inOrder(riemann, eventDSL, client); inOrder.verify...
[FOCAL] @Override public void RiemannReporter.report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) [CLASS] class RiemannReporter extends ScheduledReporter [METRICS] loc=40 cc=7 branches=0 l...
/* static context [FOCAL] @Override public void RiemannReporter.report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) [PATH1] foreach(Map.Entry<String, Gauge> entry : gauges.entrySet())=T ->...
/* static context [FOCAL] @Override public void RiemannReporter.report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) [PATH1] foreach(Map.Entry<String, Gauge> entry : gauges.entrySet())=T ->...
true
ok
{"focal": {"class": "RiemannReporter", "name": "report", "signature": "void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers)", "start_line": 3, "modifiers": "@Override public", "params"...
3781210_16
class UserTemplate implements UserOperations { public UserCredentials createUser() { return createUser(null); } public UserTemplate(RestOperations restOperations); public UserCredentials createUser(UserConfig userConfig); public void modifyUser(String userId, UserConfig userConfig); public void resetPasswor...
masterKeyMockServer.expect(requestTo("https://go.urbanairship.com/api/user")) .andExpect(method(POST)) .andRespond(withResponse(jsonResource("data/user-credentials"), responseHeaders, HttpStatus.CREATED, "Created")); UserCredentials credentials = urbanAirship.userOperations().createUser(); assertEquals("htt...
[FOCAL] public UserCredentials UserTemplate.createUser() [CLASS] class UserTemplate implements UserOperations [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] UserCredentials createUser(UserConfig userConfig) [CLASS-MEMBERS] UserTemplate(RestOperations restOperations); UserCredentia...
/* static context [FOCAL] public UserCredentials UserTemplate.createUser() [CALLS-INTERNAL] UserCredentials createUser(UserConfig userConfig) */
/* static context [FOCAL] public UserCredentials UserTemplate.createUser() [CALLS-INTERNAL] UserCredentials createUser(UserConfig userConfig) */ class UserTemplate implements UserOperations { public UserCredentials createUser() { return createUser(null); } public UserTemplate(RestOperations restOperations); p...
true
ok
{"focal": {"class": "UserTemplate", "name": "createUser", "signature": "UserCredentials createUser()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "UserCredentials"}, "class_info": {"name": "UserTemplate", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "UserOperations", "fi...
3787360_8
class StompFrameDecoder extends ReplayingDecoder<VoidEnum> { public static String unescapeHeader(String string) { if (string == null) return string; string = string.replace("\\n", "\n"); string = string.replace("\\c", ":"); string = string.replace("\\\\", "\\"); return string; } public StompFrameDe...
assertNull(StompFrameDecoder.unescapeHeader(null)); } }
[FOCAL] public static String StompFrameDecoder.unescapeHeader(String string) [CLASS] class StompFrameDecoder extends ReplayingDecoder<VoidEnum> [METRICS] loc=10 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] String.replace/2 [PATH1] if(string == null)=T -> return string [PATH2] if(string == null)...
/* static context [FOCAL] public static String StompFrameDecoder.unescapeHeader(String string) [PATH1] if(string == null)=T -> return string [PATH2] if(string == null)=F -> return string [INPUTS] branches=string | result=string [CALLS-EXTERNAL] String.replace/2 */
/* static context [FOCAL] public static String StompFrameDecoder.unescapeHeader(String string) [PATH1] if(string == null)=T -> return string [PATH2] if(string == null)=F -> return string [INPUTS] branches=string | result=string [CALLS-EXTERNAL] String.replace/2 */ class StompFrameDecoder extends ReplayingDecoder<VoidEn...
true
ok
{"focal": {"class": "StompFrameDecoder", "name": "unescapeHeader", "signature": "String unescapeHeader(String string)", "start_line": 3, "modifiers": "public static", "params": [{"name": "string", "type": "String"}], "return_type": "String"}, "class_info": {"name": "StompFrameDecoder", "kind": "class", "modifiers": "",...
3798663_0
class SqlMapQuery implements RepositoryQuery { @Override public Object execute(Object[] parameters) { Object parameterObject = parametersParsing(parameters); if (StatementType.SELECT.equals(statementType)) { if (!queryMethod.isPageQuery() && !queryMethod.isCollectionQuery()) { return templa...
when(mappedStatement.getStatementType()).thenReturn(StatementType.SELECT); when(queryMethod.isCollectionQuery()).thenReturn(true); new SqlMapQuery(queryMethod, delegate, template).execute(null); verify(template).queryForList(namedQueryName, null); } }
[FOCAL] @Override public Object SqlMapQuery.execute(Object[] parameters) [CLASS] class SqlMapQuery implements RepositoryQuery [METRICS] loc=22 cc=7 branches=6 loops=0 returns=5 throws=1 nesting=4 [CALLS-INTERNAL] Object parametersParsing(Object[] parameters) [CALLS-EXTERNAL] StatementType.SELECT.equals/1, QueryMethod.i...
/* static context [FOCAL] @Override public Object SqlMapQuery.execute(Object[] parameters) [THROWS-WHEN] UnsupportedOperationException when StatementType.SELECT.equals(statementType) && !(!queryMethod.isPageQuery() && !queryMethod.isCollectionQuery()) && !queryMethod.isCollectionQuery() [THROWS-WHEN] UnsupportedOperati...
/* static context [FOCAL] @Override public Object SqlMapQuery.execute(Object[] parameters) [THROWS-WHEN] UnsupportedOperationException when StatementType.SELECT.equals(statementType) && !(!queryMethod.isPageQuery() && !queryMethod.isCollectionQuery()) && !queryMethod.isCollectionQuery() [THROWS-WHEN] UnsupportedOperati...
true
ok
{"focal": {"class": "SqlMapQuery", "name": "execute", "signature": "Object execute(Object[] parameters)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "parameters", "type": "Object[]"}], "return_type": "Object"}, "class_info": {"name": "SqlMapQuery", "kind": "class", "modifiers": "", "superclas...
3806452_12
class SimpleVersion implements Comparable<SimpleVersion>, Serializable { public static String getCurrentJavaVirtualMachineSpecificationVersion() { return System.getProperty("java.vm.specification.version", "1.8"); } public SimpleVersion(final Integer major, final Integer medium); public fina...
Assert.assertNotNull(SimpleVersion.getCurrentJavaVirtualMachineSpecificationVersion()); } }
[FOCAL] public static String SimpleVersion.getCurrentJavaVirtualMachineSpecificationVersion() [CLASS] class SimpleVersion implements Comparable<SimpleVersion>, Serializable [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] System.getProperty/2 [CLASS-MEMBERS] SimpleVersion(Integer ma...
/* static context [FOCAL] public static String SimpleVersion.getCurrentJavaVirtualMachineSpecificationVersion() [CALLS-EXTERNAL] System.getProperty/2 */
/* static context [FOCAL] public static String SimpleVersion.getCurrentJavaVirtualMachineSpecificationVersion() [CALLS-EXTERNAL] System.getProperty/2 */ class SimpleVersion implements Comparable<SimpleVersion>, Serializable { public static String getCurrentJavaVirtualMachineSpecificationVersion() { return ...
true
ok
{"focal": {"class": "SimpleVersion", "name": "getCurrentJavaVirtualMachineSpecificationVersion", "signature": "String getCurrentJavaVirtualMachineSpecificationVersion()", "start_line": 3, "modifiers": "public static", "params": [], "return_type": "String"}, "class_info": {"name": "SimpleVersion", "kind": "class", "modi...
3808230_16
class CachingDocumentNIO implements DocumentReader<T>, DocumentWriter<T> { @Override public boolean deleteDocumentFile(DatabaseDocument<T> d, String fileName) { return writer.deleteDocumentFile(d, fileName); } public CachingDocumentNIO(DatabaseConnector<T> backing, Cache<T> cache); public CachingDocumentNI...
io.deleteDocumentFile(doc1, "file"); verify(writer, times(1)).deleteDocumentFile(doc1, "file"); verifyNoMoreInteractions(cache); } }
[FOCAL] @Override public boolean CachingDocumentNIO.deleteDocumentFile(DatabaseDocument<T> d, String fileName) [CLASS] class CachingDocumentNIO implements DocumentReader<T>, DocumentWriter<T> [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] DocumentWriter<TestType>.deleteDocumentFil...
/* static context [FOCAL] @Override public boolean CachingDocumentNIO.deleteDocumentFile(DatabaseDocument<T> d, String fileName) [INPUTS] branches=- | result=d, fileName, writer [COLLABORATORS] field writer:DocumentWriter<TestType> deleteDocumentFile/2 [FIELDS] read=writer:DocumentWriter<TestType> [CALLS-EXTERNAL] Docu...
/* static context [FOCAL] @Override public boolean CachingDocumentNIO.deleteDocumentFile(DatabaseDocument<T> d, String fileName) [INPUTS] branches=- | result=d, fileName, writer [COLLABORATORS] field writer:DocumentWriter<TestType> deleteDocumentFile/2 [FIELDS] read=writer:DocumentWriter<TestType> [CALLS-EXTERNAL] Docu...
true
ok
{"focal": {"class": "CachingDocumentNIO", "name": "deleteDocumentFile", "signature": "boolean deleteDocumentFile(DatabaseDocument<T> d, String fileName)", "start_line": 4, "modifiers": "@Override public", "params": [{"name": "d", "type": "DatabaseDocument<T>"}, {"name": "fileName", "type": "String"}], "return_type": "b...
3817774_2
class MockNats implements Nats { @Override public Request request(String subject, long timeout, TimeUnit unit, MessageHandler... messageHandlers) { return request(subject, "", timeout, unit, messageHandlers); } @Override public boolean isConnected(); @Override public boolean isClosed(); @Override public void ...
final Nats nats = new MockNats(); final String subject = "test"; final String response = "This is a response."; nats.subscribe(subject, new MessageHandler() { @Override public void onMessage(Message message) { message.reply(response); } }); final boolean[] flag = new boolean[] { false }; nat...
[FOCAL] @Override public Request MockNats.request(String subject, long timeout, TimeUnit unit, MessageHandler... messageHandlers) [CLASS] class MockNats implements Nats [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Request request(String subject, String message, long timeout, Tim...
/* static context [FOCAL] @Override public Request MockNats.request(String subject, long timeout, TimeUnit unit, MessageHandler... messageHandlers) [INPUTS] branches=- | result=messageHandlers, subject, timeout, unit [CALLS-INTERNAL] Request request(String subject, String message, long timeout, TimeUnit unit, MessageHa...
/* static context [FOCAL] @Override public Request MockNats.request(String subject, long timeout, TimeUnit unit, MessageHandler... messageHandlers) [INPUTS] branches=- | result=messageHandlers, subject, timeout, unit [CALLS-INTERNAL] Request request(String subject, String message, long timeout, TimeUnit unit, MessageHa...
true
ok
{"focal": {"class": "MockNats", "name": "request", "signature": "Request request(String subject, long timeout, TimeUnit unit, MessageHandler... messageHandlers)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "subject", "type": "String"}, {"name": "timeout", "type": "long"}, {"name": "unit", "ty...
3833897_2
class DomainObjectAllocator { public <T extends AbstractDomainObject> T allocateObject(Class<T> objClass, Object oid) { if (objClass == null) { throw new RuntimeException("Cannot allocate object '" + oid + "'. Class not found"); } if (Modifier.isAbstract( objClass.getModifiers()...
DomainObjectAllocator allocator = new DomainObjectAllocator(MyADO.class); AbstractDomainObject object = allocator.allocateObject(MyDO.class, "xpto"); assertEquals(object.getClass(), MyDO.class); assertEquals(object.getExternalId(), "xpto"); } }
[FOCAL] public T DomainObjectAllocator.allocateObject(Class<T> objClass, Object oid) [CLASS] class DomainObjectAllocator [METRICS] loc=13 cc=4 branches=2 loops=0 returns=1 throws=3 nesting=1 [CALLS-INTERNAL] Constructor<T> getInstantiatorOf(Class<T> clazz) [CALLS-EXTERNAL] Modifier.isAbstract/1, Class<T>.getModifiers/0...
/* static context [FOCAL] public T DomainObjectAllocator.allocateObject(Class<T> objClass, Object oid) [THROWS-WHEN] RuntimeException when objClass == null [THROWS-WHEN] RuntimeException when !(objClass == null) && Modifier.isAbstract( objClass.getModifiers() ) [THROWS-WHEN] RuntimeException when !(objClass == null) &&...
/* static context [FOCAL] public T DomainObjectAllocator.allocateObject(Class<T> objClass, Object oid) [THROWS-WHEN] RuntimeException when objClass == null [THROWS-WHEN] RuntimeException when !(objClass == null) && Modifier.isAbstract( objClass.getModifiers() ) [THROWS-WHEN] RuntimeException when !(objClass == null) &&...
true
ok
{"focal": {"class": "DomainObjectAllocator", "name": "allocateObject", "signature": "T allocateObject(Class<T> objClass, Object oid)", "start_line": 3, "modifiers": "public", "params": [{"name": "objClass", "type": "Class<T>"}, {"name": "oid", "type": "Object"}], "return_type": "T"}, "class_info": {"name": "DomainObjec...
3836962_11
class JSAbstractOperations { static Double ToNumber(Object arg) { if (arg == null) { return 0.0d; } else if (Boolean.TRUE.equals(arg)) { return 1.0d; } else if (Boolean.FALSE.equals(arg)) { return 0.0d; } else if (arg instanceof String) { return ToNumber((String) arg); } else if (arg instanc...
assertEquals(0.0, ToNumber(false), 0.0); assertEquals(Double.POSITIVE_INFINITY, 1 / ToNumber(false), 0.0); assertEquals(1.0, ToNumber(true), 1.0); } }
[FOCAL] static Double JSAbstractOperations.ToNumber(Object arg) [CLASS] class JSAbstractOperations [METRICS] loc=20 cc=6 branches=5 loops=0 returns=6 throws=0 nesting=5 [CALLS-INTERNAL] Double ToNumber(String arg); Object ToPrimitive(Object arg, String hint) [CALLS-EXTERNAL] Boolean.TRUE.equals/1, Boolean.FALSE.equals/...
/* static context [FOCAL] static Double JSAbstractOperations.ToNumber(Object arg) [PATH1] if(arg == null)=F -> if(Boolean.TRUE.equals(arg))=F -> if(Boolean.FALSE.equals(arg))=F -> if(arg instanceof String)=F -> if(arg instanceof Number)=T -> return ((Number) arg).doubleValue() [PATH2] if(arg == null)=T -> return 0.0d [...
/* static context [FOCAL] static Double JSAbstractOperations.ToNumber(Object arg) [PATH1] if(arg == null)=F -> if(Boolean.TRUE.equals(arg))=F -> if(Boolean.FALSE.equals(arg))=F -> if(arg instanceof String)=F -> if(arg instanceof Number)=T -> return ((Number) arg).doubleValue() [PATH2] if(arg == null)=T -> return 0.0d [...
true
ok
{"focal": {"class": "JSAbstractOperations", "name": "ToNumber", "signature": "Double ToNumber(Object arg)", "start_line": 3, "modifiers": "static", "params": [{"name": "arg", "type": "Object"}], "return_type": "Double"}, "class_info": {"name": "JSAbstractOperations", "kind": "class", "modifiers": "", "superclass": null...
3842880_1
class CombinationProcessor implements AnalysisProcessor { @Override public void run(IProgressMonitor monitor) { Date startTime = new Date(); // Prepare data matrix to combine IMatrix data = analysis.getData().get(); // Dimension to combine using the module map MatrixD...
CombinationAnalysis analysis = getAnalysis(); // Keep the correct results IMatrix resultsOk = analysis.getResults().get(); analysis.setResults(null); try { AnalysisProcessor processor = new CombinationProcessor(analysis); processor.run(getProgressMonito...
[FOCAL] @Override public void CombinationProcessor.run(IProgressMonitor monitor) [CLASS] class CombinationProcessor implements AnalysisProcessor [METRICS] loc=49 cc=4 branches=2 loops=1 returns=0 throws=0 nesting=2 [CALLS-INTERNAL] IMatrix combine(IProgressMonitor monitor, IMatrix data, MatrixDimensionKey combineDimens...
/* static context [FOCAL] @Override public void CombinationProcessor.run(IProgressMonitor monitor) [PATH1] if(analysis.getGroupsMap() == null)=T -> if(pvalueLayer == null)=T -> foreach(IMatrixLayer layer : data.getLayers())=T -> exit loop [PATH2] if(analysis.getGroupsMap() == null)=F -> if(pvalueLayer == null)=F [PATH3...
/* static context [FOCAL] @Override public void CombinationProcessor.run(IProgressMonitor monitor) [PATH1] if(analysis.getGroupsMap() == null)=T -> if(pvalueLayer == null)=T -> foreach(IMatrixLayer layer : data.getLayers())=T -> exit loop [PATH2] if(analysis.getGroupsMap() == null)=F -> if(pvalueLayer == null)=F [PATH3...
true
ok
{"focal": {"class": "CombinationProcessor", "name": "run", "signature": "void run(IProgressMonitor monitor)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "monitor", "type": "IProgressMonitor"}], "return_type": "void"}, "class_info": {"name": "CombinationProcessor", "kind": "class", "modifiers"...
3847504_139
class SearchQueryImpl implements SearchQuery { public SearchQuery withPathPrefix(String path) { clearExpectations(); if (path.endsWith("/")) path = path.substring(0, path.length() - 1); this.pathPrefix = path; if (pathPrefix == null) throw new IllegalArgumentException("Path prefix must no...
String prefix = "/path/prefix"; query.withPathPrefix(prefix); assertEquals(prefix, query.getPathPrefix()); } }
[FOCAL] public SearchQuery SearchQueryImpl.withPathPrefix(String path) [CLASS] class SearchQueryImpl implements SearchQuery [METRICS] loc=11 cc=4 branches=3 loops=0 returns=1 throws=1 nesting=1 [CALLS-INTERNAL] void clearExpectations() [CALLS-EXTERNAL] String.endsWith/1, String.substring/2, String.length/0, pathPrefix....
/* static context [FOCAL] public SearchQuery SearchQueryImpl.withPathPrefix(String path) [THROWS-WHEN] IllegalArgumentException when path.endsWith("/") && pathPrefix == null [THROWS-WHEN] IllegalArgumentException when !path.endsWith("/") && pathPrefix == null [PATH1] if(path.endsWith("/"))=T -> if(pathPrefix == null)=F...
/* static context [FOCAL] public SearchQuery SearchQueryImpl.withPathPrefix(String path) [THROWS-WHEN] IllegalArgumentException when path.endsWith("/") && pathPrefix == null [THROWS-WHEN] IllegalArgumentException when !path.endsWith("/") && pathPrefix == null [PATH1] if(path.endsWith("/"))=T -> if(pathPrefix == null)=F...
true
ok
{"focal": {"class": "SearchQueryImpl", "name": "withPathPrefix", "signature": "SearchQuery withPathPrefix(String path)", "start_line": 3, "modifiers": "public", "params": [{"name": "path", "type": "String"}], "return_type": "SearchQuery"}, "class_info": {"name": "SearchQueryImpl", "kind": "class", "modifiers": "", "sup...
3859251_23
class LogManagerProperties extends Properties { @Override public synchronized Object remove(final Object key) { final Object def = preWrite(key); final Object man = super.remove(key); return man == null ? def : man; } LogManagerProperties(final Properties parent, final String...
String prefix = LogManagerPropertiesTest.class.getName(); LogManager manager = LogManager.getLogManager(); try { String key = prefix.concat(".dummy"); Properties parent = new Properties(); parent.put(key, "value"); parent.put("", "empty"); ...
[FOCAL] @Override public synchronized Object LogManagerProperties.remove(Object key) [CLASS] class LogManagerProperties extends Properties [METRICS] loc=6 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] Object preWrite(Object key) [CALLS-EXTERNAL] Properties.remove/1 [INPUTS] branches=- | result=k...
/* static context [FOCAL] @Override public synchronized Object LogManagerProperties.remove(Object key) [INPUTS] branches=- | result=key [CALLS-INTERNAL] Object preWrite(Object key) [CALLS-EXTERNAL] Properties.remove/1 */
/* static context [FOCAL] @Override public synchronized Object LogManagerProperties.remove(Object key) [INPUTS] branches=- | result=key [CALLS-INTERNAL] Object preWrite(Object key) [CALLS-EXTERNAL] Properties.remove/1 */ class LogManagerProperties extends Properties { @Override public synchronized Object remov...
true
ok
{"focal": {"class": "LogManagerProperties", "name": "remove", "signature": "Object remove(Object key)", "start_line": 3, "modifiers": "@Override public synchronized", "params": [{"name": "key", "type": "Object"}], "return_type": "Object"}, "class_info": {"name": "LogManagerProperties", "kind": "class", "modifiers": "",...
3869967_60
class MongoAppSessionRepository extends CrudRepositoryBase<AppSession, String> implements AppSessionRepository { @Override public <S extends AppSession> S add(final S appSession) { Preconditions.checkNotNull(appSession, "Cannot add null AppSession"); Preconditions.checkNotNull(appSession.getId(), "Cannot add App...
final AppSession appSession = SecurityFactory.eINSTANCE.createAppSession(); appSession.setId("00000000"); appSession.setCreationTime(new DateTime()); appSession.setStatus(AppSessionStatus.ACTIVE); appSession.setIpAddress("127.0.0.1"); appSession.setTimeout(1800000L); appSession.setAccessTime(new DateTime(...
[FOCAL] @Override public S MongoAppSessionRepository.add(S appSession) [CLASS] class MongoAppSessionRepository extends CrudRepositoryBase<AppSession, String> implements AppSessionRepository [METRICS] loc=13 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Preconditions.checkNotNull/2, S.getId/0, lo...
/* static context [FOCAL] @Override public S MongoAppSessionRepository.add(S appSession) [INPUTS] branches=- | result=appSession [COLLABORATORS] param appSession:S getId/0,getPerson/0,getUserAgent/0,getCreationTime/0; field coll insert/1 [NEW] ToDBObject [CALLS-EXTERNAL] Preconditions.checkNotNull/2, S.getId/0, log.inf...
/* static context [FOCAL] @Override public S MongoAppSessionRepository.add(S appSession) [INPUTS] branches=- | result=appSession [COLLABORATORS] param appSession:S getId/0,getPerson/0,getUserAgent/0,getCreationTime/0; field coll insert/1 [NEW] ToDBObject [CALLS-EXTERNAL] Preconditions.checkNotNull/2, S.getId/0, log.inf...
true
ok
{"focal": {"class": "MongoAppSessionRepository", "name": "add", "signature": "S add(S appSession)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "appSession", "type": "S"}], "return_type": "S"}, "class_info": {"name": "MongoAppSessionRepository", "kind": "class", "modifiers": "", "superclass": ...
3885169_5
class User extends AbstractEntity { public boolean verifyPassword(String password) { return new BasicPasswordEncryptor().checkPassword(password, this.password); } public String getFirstname(); public void setFirstname(String firstname); public String getSurname(); public void setSurname(String surname); ...
User user = new UserTestdataBuilder().build(); Assert.assertTrue(user.verifyPassword("secret")); Assert.assertFalse(user.verifyPassword("other")); } }
[FOCAL] public boolean User.verifyPassword(String password) [CLASS] class User extends AbstractEntity [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new BasicPasswordEncryptor().checkPassword/2 [NEW] BasicPasswordEncryptor [FIELDS] read=password [INPUTS] branches=- | result=passwo...
/* static context [FOCAL] public boolean User.verifyPassword(String password) [INPUTS] branches=- | result=password [FIELDS] read=password [NEW] BasicPasswordEncryptor [CALLS-EXTERNAL] new BasicPasswordEncryptor().checkPassword/2 */
/* static context [FOCAL] public boolean User.verifyPassword(String password) [INPUTS] branches=- | result=password [FIELDS] read=password [NEW] BasicPasswordEncryptor [CALLS-EXTERNAL] new BasicPasswordEncryptor().checkPassword/2 */ class User extends AbstractEntity { public boolean verifyPassword(String password) { ...
true
ok
{"focal": {"class": "User", "name": "verifyPassword", "signature": "boolean verifyPassword(String password)", "start_line": 3, "modifiers": "public", "params": [{"name": "password", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "User", "kind": "class", "modifiers": "", "superclass": "AbstractEnt...
3894929_2
class HasXPath extends TypeSafeDiagnosingMatcher<Node> { public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); } public HasXPath(String xPathExpression, Matcher<String> valueMatcher); public HasXPath(String xPathExp...
assertMatches(hasXPath("//emptySomething"), xml); } }
[FOCAL] public HasXPath.HasXPath(String xPathExpression, Matcher<String> valueMatcher) [CLASS] class HasXPath extends TypeSafeDiagnosingMatcher<Node> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [DATAFLOW] valueMatcher@param->L2; xPathExpression@param->L2 [CLASS-MEMBERS] HasXPath(String xPathExp...
/* static context [FOCAL] public HasXPath.HasXPath(String xPathExpression, Matcher<String> valueMatcher) */
/* static context [FOCAL] public HasXPath.HasXPath(String xPathExpression, Matcher<String> valueMatcher) */ class HasXPath extends TypeSafeDiagnosingMatcher<Node> { public HasXPath(String xPathExpression, Matcher<String> valueMatcher) { this(xPathExpression, NO_NAMESPACE_CONTEXT, valueMatcher); } ...
true
ok
{"focal": {"class": "HasXPath", "name": "HasXPath", "signature": "HasXPath(String xPathExpression, Matcher<String> valueMatcher)", "start_line": 3, "modifiers": "public", "params": [{"name": "xPathExpression", "type": "String"}, {"name": "valueMatcher", "type": "Matcher<String>"}], "return_type": null}, "class_info": {...
3900538_7
class TrackMessageSizeDecoder implements ReplayDecoder<String, String> { @Override public Decoded<List<String>> decode(Event type, String message) { if (type.equals(Event.MESSAGE)) { if (skipFirstMessage.getAndSet(false)) return empty; Decoded<List<String>> messages = new Decod...
decoder = new TrackMessageSizeDecoder("^", false); String messages = "37^{\"message\":\"ab\",\"time\":1373900488807}37^{\"message\":\"ab\",\"time\":1373900488808}37^{\"message\":\"ab\",\"time\":1373900488810}"; List<String> expected = new ArrayList<String>() { { add("...
[FOCAL] @Override public Decoded<List<String>> TrackMessageSizeDecoder.decode(Event type, String message) [CLASS] class TrackMessageSizeDecoder implements ReplayDecoder<String, String> [METRICS] loc=45 cc=9 branches=7 loops=1 returns=5 throws=0 nesting=5 [CALLS-EXTERNAL] Event.equals/1, skipFirstMessage.getAndSet/1, me...
/* static context [FOCAL] @Override public Decoded<List<String>> TrackMessageSizeDecoder.decode(Event type, String message) [PATH1] if(type.equals(Event.MESSAGE))=T -> if(skipFirstMessage.getAndSet(false))=F -> if(message.indexOf(charReplacement) != -1)=T -> while(pos < tokens.length)=T -> if(m.length() >= length)=T ->...
/* static context [FOCAL] @Override public Decoded<List<String>> TrackMessageSizeDecoder.decode(Event type, String message) [PATH1] if(type.equals(Event.MESSAGE))=T -> if(skipFirstMessage.getAndSet(false))=F -> if(message.indexOf(charReplacement) != -1)=T -> while(pos < tokens.length)=T -> if(m.length() >= length)=T ->...
true
ok
{"focal": {"class": "TrackMessageSizeDecoder", "name": "decode", "signature": "Decoded<List<String>> decode(Event type, String message)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "type", "type": "Event"}, {"name": "message", "type": "String"}], "return_type": "Decoded<List<String>>"}, "clas...
3910894_1
class GoogleMusicAPI implements IGoogleMusicAPI { @Override public final Collection<Song> getAllSongs() throws IOException, URISyntaxException { final Collection<Song> chunkedCollection = new ArrayList<Song>(); // Map<String, String> fields = new HashMap<String, String>(); ...
// given final int expectedSongListSize = 3; final String expectedSong3Title = "Song Title, With Comma"; final String expectedSong3Artist = "Artist 2"; final String expectedSong3Album = "Album 2"; final int expectedSong3Year = 2014; final String testData = Files...
[FOCAL] @Override public final Collection<Song> GoogleMusicAPI.getAllSongs() [CLASS] class GoogleMusicAPI implements IGoogleMusicAPI [METRICS] loc=77 cc=6 branches=3 loops=2 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] List<String> getJsSongCollectionWrappers(String response) [CALLS-EXTERNAL] FormBuilder.close/0, clie...
/* static context [FOCAL] @Override public final Collection<Song> GoogleMusicAPI.getAllSongs() [PATH1] foreach(String songCollectionWrapperJson : jsSongCollectionWrappers)=T -> foreach(JsonElement songValues : songCollection)=T -> if(!Strings.isNullOrEmpty(gson.fromJson(values.get(2), String.class)))=T -> if(!Strings.i...
/* static context [FOCAL] @Override public final Collection<Song> GoogleMusicAPI.getAllSongs() [PATH1] foreach(String songCollectionWrapperJson : jsSongCollectionWrappers)=T -> foreach(JsonElement songValues : songCollection)=T -> if(!Strings.isNullOrEmpty(gson.fromJson(values.get(2), String.class)))=T -> if(!Strings.i...
true
ok
{"focal": {"class": "GoogleMusicAPI", "name": "getAllSongs", "signature": "Collection<Song> getAllSongs() throws IOException, URISyntaxException", "start_line": 3, "modifiers": "@Override public final", "params": [], "return_type": "Collection<Song>"}, "class_info": {"name": "GoogleMusicAPI", "kind": "class", "modifier...
3913468_1
class EnvironmentVariablesPropertiesSource implements PropertiesSource { @Override public Map<String,String> getProperties() { Map<String,String> envVars = System.getenv(); if (!Collections.isEmpty(envVars)) { return new LinkedHashMap<String, String>(envVars); } r...
mockStaticPartial(System.class, "getenv"); expect(System.getenv()).andReturn(null); replayAll(); Map<String, String> props = new EnvironmentVariablesPropertiesSource().getProperties(); assertEquals(props.size(), 0); } }
[FOCAL] @Override public Map<String,String> EnvironmentVariablesPropertiesSource.getProperties() [CLASS] class EnvironmentVariablesPropertiesSource implements PropertiesSource [METRICS] loc=11 cc=2 branches=1 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] System.getenv/0, Collections.isEmpty/1, java.util.Collect...
/* static context [FOCAL] @Override public Map<String,String> EnvironmentVariablesPropertiesSource.getProperties() [PATH1] if(!Collections.isEmpty(envVars))=T -> return new LinkedHashMap<String, String>(envVars) [PATH2] if(!Collections.isEmpty(envVars))=F -> return java.util.Collections.emptyMap() [NEW] LinkedHashMap<S...
/* static context [FOCAL] @Override public Map<String,String> EnvironmentVariablesPropertiesSource.getProperties() [PATH1] if(!Collections.isEmpty(envVars))=T -> return new LinkedHashMap<String, String>(envVars) [PATH2] if(!Collections.isEmpty(envVars))=F -> return java.util.Collections.emptyMap() [NEW] LinkedHashMap<S...
true
ok
{"focal": {"class": "EnvironmentVariablesPropertiesSource", "name": "getProperties", "signature": "Map<String,String> getProperties()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "Map<String,String>"}, "class_info": {"name": "EnvironmentVariablesPropertiesSource", "kind": "class", "m...
3933009_4
class SpaceCreationInvitationGroupVisibilityPlugin extends GroupVisibilityPlugin { @Override public boolean hasPermission(Identity userIdentity, Group group) { if (userACL.getSuperUser().equals(userIdentity.getUserId()) || userIdentity.getMemberships() .stream() ...
// Given UserACL userACL = mock(UserACL.class); when(userACL.getSuperUser()).thenReturn("john"); SpacesAdministrationService spacesAdministrationService = mock(SpacesAdministrationService.class); when(spacesAdministrationService.getSpacesAdministratorsMemberships()).thenReturn(Arrays.asList(new Memb...
[FOCAL] @Override public boolean SpaceCreationInvitationGroupVisibilityPlugin.hasPermission(Identity userIdentity, Group group) [CLASS] class SpaceCreationInvitationGroupVisibilityPlugin extends GroupVisibilityPlugin [METRICS] loc=27 cc=3 branches=2 loops=0 returns=2 throws=0 nesting=1 [CALLS-EXTERNAL] userACL.getSuper...
/* static context [FOCAL] @Override public boolean SpaceCreationInvitationGroupVisibilityPlugin.hasPermission(Identity userIdentity, Group group) [PATH1] if((userACL.getSuperUser().equals(userIdentity.getUserId()) || userIdentity.getMemberships() .stream() .anyMatch(userMem...)=F -> if(spacesAdministratorsGroups == nul...
/* static context [FOCAL] @Override public boolean SpaceCreationInvitationGroupVisibilityPlugin.hasPermission(Identity userIdentity, Group group) [PATH1] if((userACL.getSuperUser().equals(userIdentity.getUserId()) || userIdentity.getMemberships() .stream() .anyMatch(userMem...)=F -> if(spacesAdministratorsGroups == nul...
true
ok
{"focal": {"class": "SpaceCreationInvitationGroupVisibilityPlugin", "name": "hasPermission", "signature": "boolean hasPermission(Identity userIdentity, Group group)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "userIdentity", "type": "Identity"}, {"name": "group", "type": "Group"}], "return_t...
3934425_27
class Utils { public static String getPathOnly(String fullPath) { if (fullPath == null || fullPath.isEmpty()) return fullPath; int index = fullPath.indexOf('?'); if (index == -1) { index = fullPath.indexOf('#'); return index == -1 ? fullPath : fullPath.substring...
assertNull(Utils.getPathOnly(null)); assertTrue(Utils.getPathOnly("").isEmpty()); String path = "/path"; assertEquals(path, Utils.getPathOnly("/path?query#fragment")); assertEquals(path, Utils.getPathOnly("/path?query")); assertEquals(path, Utils.getPathOnly("/path")); assertEq...
[FOCAL] public static String Utils.getPathOnly(String fullPath) [CLASS] class Utils [METRICS] loc=13 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=1 [CALLS-EXTERNAL] String.isEmpty/0, String.indexOf/1, String.substring/2 [PATH1] if(fullPath == null || fullPath.isEmpty())=F -> if(index == -1)=T -> return index == -...
/* static context [FOCAL] public static String Utils.getPathOnly(String fullPath) [PATH1] if(fullPath == null || fullPath.isEmpty())=F -> if(index == -1)=T -> return index == -1 ? fullPath : fullPath.substring(0, index) [PATH2] if(fullPath == null || fullPath.isEmpty())=T -> return fullPath [PATH3] if(fullPath == null ...
/* static context [FOCAL] public static String Utils.getPathOnly(String fullPath) [PATH1] if(fullPath == null || fullPath.isEmpty())=F -> if(index == -1)=T -> return index == -1 ? fullPath : fullPath.substring(0, index) [PATH2] if(fullPath == null || fullPath.isEmpty())=T -> return fullPath [PATH3] if(fullPath == null ...
true
ok
{"focal": {"class": "Utils", "name": "getPathOnly", "signature": "String getPathOnly(String fullPath)", "start_line": 3, "modifiers": "public static", "params": [{"name": "fullPath", "type": "String"}], "return_type": "String"}, "class_info": {"name": "Utils", "kind": "class", "modifiers": "", "superclass": null, "inte...
3935296_8
class ForumServiceUtils { @SuppressWarnings("unchecked") public static List<String> getUserPermission(String[] userGroupMembership) throws Exception { List<String> users = getFromCache(userGroupMembership); if (users != null) { return users; } users = new ArrayList<String>(); if (userGro...
List<String> emptyList = ForumServiceUtils.getUserPermission(null); assertNotNull(emptyList); assertEquals(0, emptyList.size()); } }
[FOCAL] @SuppressWarnings("unchecked") public static List<String> ForumServiceUtils.getUserPermission(String[] userGroupMembership) [CLASS] class ForumServiceUtils [METRICS] loc=88 cc=23 branches=14 loops=8 returns=3 throws=0 nesting=8 [CALLS-INTERNAL] List<String> getFromCache(String[] userGroupMembership); PageList g...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static List<String> ForumServiceUtils.getUserPermission(String[] userGroupMembership) [PATH1] if(users != null)=F -> if((userGroupMembership == null || userGroupMembership.length <= 0 || (userGroupMembership.length == 1 && userGroupMembe...)=F -> foreach(S...
/* static context [FOCAL] @SuppressWarnings("unchecked") public static List<String> ForumServiceUtils.getUserPermission(String[] userGroupMembership) [PATH1] if(users != null)=F -> if((userGroupMembership == null || userGroupMembership.length <= 0 || (userGroupMembership.length == 1 && userGroupMembe...)=F -> foreach(S...
true
ok
{"focal": {"class": "ForumServiceUtils", "name": "getUserPermission", "signature": "List<String> getUserPermission(String[] userGroupMembership) throws Exception", "start_line": 3, "modifiers": "@SuppressWarnings(\"unchecked\") public static", "params": [{"name": "userGroupMembership", "type": "String[]"}], "return_typ...
3935748_24
class PermissionsGroupVisibilityPlugin extends GroupVisibilityPlugin { public boolean hasPermission(Identity userIdentity, Group group) { Collection<MembershipEntry> userMemberships = userIdentity.getMemberships(); return userACL.getSuperUser().equals(userIdentity.getUserId()) || userMemberships.stre...
// Given UserACL userACL = mock(UserACL.class); when(userACL.getSuperUser()).thenReturn("root"); when(userACL.getAdminGroups()).thenReturn("/platform/administrators"); GroupVisibilityPlugin plugin = new PermissionsGroupVisibilityPlugin(userACL); Identity userIdentity = new Identity("john", Arra...
[FOCAL] public boolean PermissionsGroupVisibilityPlugin.hasPermission(Identity userIdentity, Group group) [CLASS] class PermissionsGroupVisibilityPlugin extends GroupVisibilityPlugin [METRICS] loc=12 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Identity.getMemberships/0, userACL.getSuperUser()....
/* static context [FOCAL] public boolean PermissionsGroupVisibilityPlugin.hasPermission(Identity userIdentity, Group group) [INPUTS] branches=- | result=group, userIdentity [COLLABORATORS] param userIdentity:Identity getMemberships/0,getUserId/0; field userACL getSuperUser/0,getAdminGroups/0; field userMembership getGr...
/* static context [FOCAL] public boolean PermissionsGroupVisibilityPlugin.hasPermission(Identity userIdentity, Group group) [INPUTS] branches=- | result=group, userIdentity [COLLABORATORS] param userIdentity:Identity getMemberships/0,getUserId/0; field userACL getSuperUser/0,getAdminGroups/0; field userMembership getGr...
true
ok
{"focal": {"class": "PermissionsGroupVisibilityPlugin", "name": "hasPermission", "signature": "boolean hasPermission(Identity userIdentity, Group group)", "start_line": 3, "modifiers": "public", "params": [{"name": "userIdentity", "type": "Identity"}, {"name": "group", "type": "Group"}], "return_type": "boolean"}, "cla...
3937364_5
class AccountSetupService { public boolean mustSkipAccountSetup() { if (skipSetup == null) { SettingValue accountSetupNode = settingService.get(Context.GLOBAL, Scope.GLOBAL, ACCOUNT_SETUP_NODE); String propertySetupSkip = PropertyManager.getProperty(ACCOUNT_SETUP_SKIP_PROPERTY); if (propertySe...
// Given PropertyManager.setProperty(AccountSetupService.ACCOUNT_SETUP_SKIP_PROPERTY, "true"); AccountSetupService accountSetupService = new AccountSetupService(settingService, organizationService); // When boolean mustSkip = accountSetupService.mustSkipAccountSetup(); // Then assertTrue(...
[FOCAL] public boolean AccountSetupService.mustSkipAccountSetup() [CLASS] class AccountSetupService [METRICS] loc=15 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2 [CALLS-EXTERNAL] SettingService.get/3, PropertyManager.getProperty/1, LOG.debug/1, String.equals/1, PropertyManager.isDevelopping/0 [FIELDS] read=sett...
/* static context [FOCAL] public boolean AccountSetupService.mustSkipAccountSetup() [PATH1] if(skipSetup == null)=T -> if(propertySetupSkip == null)=T -> return skipSetup [PATH2] if(skipSetup == null)=F -> return skipSetup [PATH3] if(skipSetup == null)=T -> if(propertySetupSkip == null)=F -> return skipSetup [INPUTS] b...
/* static context [FOCAL] public boolean AccountSetupService.mustSkipAccountSetup() [PATH1] if(skipSetup == null)=T -> if(propertySetupSkip == null)=T -> return skipSetup [PATH2] if(skipSetup == null)=F -> return skipSetup [PATH3] if(skipSetup == null)=T -> if(propertySetupSkip == null)=F -> return skipSetup [INPUTS] b...
true
ok
{"focal": {"class": "AccountSetupService", "name": "mustSkipAccountSetup", "signature": "boolean mustSkipAccountSetup()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "AccountSetupService", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nul...
3943003_2
class FileProvider { public String filePathFromURL(URL url) { if (url == null) { throw new IllegalArgumentException("url is null"); } // Old solution does not deal well with "<" | ">" | "#" | "%" | // <"> "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`" since they may occur // inside an URL b...
// setup: URL url = new URL("file:///With%20Space/File.jar"); // exercise: String actual = (new FileProvider()).filePathFromURL(url); // verify: assertThat( actual, PlatformUtil.onWindows() ? matchesPattern("\\A/[A-Z]:/With Space/File\\.jar\\z") : equalTo(...
[FOCAL] public String FileProvider.filePathFromURL(URL url) [CLASS] class FileProvider [METRICS] loc=20 cc=3 branches=1 loops=0 returns=2 throws=1 nesting=1 [CALLS-EXTERNAL] new File(URLDecoder.decode(url.getPath(), "UTF-8")).toURI/0, URLDecoder.decode/2, URL.getPath/0, URI.getPath/0, Assertions.UNREACHABLE/0 [NEW] Ill...
/* static context [FOCAL] public String FileProvider.filePathFromURL(URL url) [THROWS-WHEN] IllegalArgumentException when url == null [PATH1] if(url == null)=F -> try-body throws -> return null [PATH2] if(url == null)=T -> throw new IllegalArgumentException("url is null") [PATH3] if(url == null)=F -> return uri.getPath...
/* static context [FOCAL] public String FileProvider.filePathFromURL(URL url) [THROWS-WHEN] IllegalArgumentException when url == null [PATH1] if(url == null)=F -> try-body throws -> return null [PATH2] if(url == null)=T -> throw new IllegalArgumentException("url is null") [PATH3] if(url == null)=F -> return uri.getPath...
true
ok
{"focal": {"class": "FileProvider", "name": "filePathFromURL", "signature": "String filePathFromURL(URL url)", "start_line": 3, "modifiers": "public", "params": [{"name": "url", "type": "URL"}], "return_type": "String"}, "class_info": {"name": "FileProvider", "kind": "class", "modifiers": "", "superclass": null, "inter...
3946094_2
class HelloBean implements HelloLocal { @Override public String sayHello() { Pojo pojo = new Pojo(); pojo.version(); return "Hello"; } } class HelloBeanTest { @Test public void testSayHello_String() {
HelloBean b = new HelloBean(); assertTrue(b.sayHello().equals("Hello")); } }
[FOCAL] @Override public String HelloBean.sayHello() [CLASS] class HelloBean implements HelloLocal [METRICS] loc=8 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Pojo.version/0 [NEW] Pojo [DATAFLOW] pojo@L4->L5 [TEST] HelloBeanTest: @Test public void testSayHello_String()
/* static context [FOCAL] @Override public String HelloBean.sayHello() [NEW] Pojo [CALLS-EXTERNAL] Pojo.version/0 */
/* static context [FOCAL] @Override public String HelloBean.sayHello() [NEW] Pojo [CALLS-EXTERNAL] Pojo.version/0 */ class HelloBean implements HelloLocal { @Override public String sayHello() { Pojo pojo = new Pojo(); pojo.version(); return "Hello"; } } class Hel...
true
ok
{"focal": {"class": "HelloBean", "name": "sayHello", "signature": "String sayHello()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "HelloBean", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "HelloLocal", "fields": [], "members": ...
3951979_0
class FetchChartDataHandler implements ActionHandler<FetchChartData, FetchChartData.Result> { protected List<DataPoint> downsample(long duration, Aggregator aggregator, List<DataPoint> points) { List<DataPoint> result = Lists.newArrayList(); int offset = 0; long maxSampleTimestamp = 0; for (int...
FetchChartDataHandler handler = new FetchChartDataHandler(); List<DataPoint> points = Lists.newArrayList(); for (int i = 0; i < 10; i++) { points.add(new DataPoint(i, i * 10)); } List<DataPoint> downsampledPoints = handler.downsample(3, new Aggregators.AvgAggregator(), points); assertEqu...
[FOCAL] protected List<DataPoint> FetchChartDataHandler.downsample(long duration, Aggregator aggregator, List<DataPoint> points) [CLASS] class FetchChartDataHandler implements ActionHandler<FetchChartData, FetchChartData.Result> [METRICS] loc=25 cc=5 branches=3 loops=1 returns=1 throws=0 nesting=3 [CALLS-EXTERNAL] List...
/* static context [FOCAL] protected List<DataPoint> FetchChartDataHandler.downsample(long duration, Aggregator aggregator, List<DataPoint> points) [PATH1] for(i < points.size())=T -> if(dataPoint.getTimestamp() > maxSampleTimestamp)=T -> if(i > offset)=T -> exit loop -> if(points.size() > offset)=T -> return result [PA...
/* static context [FOCAL] protected List<DataPoint> FetchChartDataHandler.downsample(long duration, Aggregator aggregator, List<DataPoint> points) [PATH1] for(i < points.size())=T -> if(dataPoint.getTimestamp() > maxSampleTimestamp)=T -> if(i > offset)=T -> exit loop -> if(points.size() > offset)=T -> return result [PA...
true
ok
{"focal": {"class": "FetchChartDataHandler", "name": "downsample", "signature": "List<DataPoint> downsample(long duration, Aggregator aggregator, List<DataPoint> points)", "start_line": 4, "modifiers": "protected", "params": [{"name": "duration", "type": "long"}, {"name": "aggregator", "type": "Aggregator"}, {"name": "...
3978781_357
class LiveDataReactiveStreams { @NonNull public static <T> LiveData<T> fromPublisher(@NonNull Publisher<T> publisher) { return new PublisherLiveData<>(publisher); } private LiveDataReactiveStreams(); @NonNull public static Publisher<T> toPublisher( @NonNull LifecycleOwner lif...
Flowable<String> input = Flowable.just("foo") .concatWith(Flowable.just("bar", "baz").observeOn(sBackgroundScheduler)); LiveData<String> liveData = LiveDataReactiveStreams.fromPublisher(input); liveData.observe(mLifecycleOwner, mObserver); assertThat(mLiveDataOutput, is...
[FOCAL] @NonNull public static LiveData<T> LiveDataReactiveStreams.fromPublisher(Publisher<T> publisher) [CLASS] class LiveDataReactiveStreams [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [NEW] PublisherLiveData<> [INPUTS] branches=- | result=publisher [DATAFLOW] publisher@param->L3 [CLASS-MEMBE...
/* static context [FOCAL] @NonNull public static LiveData<T> LiveDataReactiveStreams.fromPublisher(Publisher<T> publisher) [INPUTS] branches=- | result=publisher [NEW] PublisherLiveData<> */
/* static context [FOCAL] @NonNull public static LiveData<T> LiveDataReactiveStreams.fromPublisher(Publisher<T> publisher) [INPUTS] branches=- | result=publisher [NEW] PublisherLiveData<> */ class LiveDataReactiveStreams { @NonNull public static <T> LiveData<T> fromPublisher(@NonNull Publisher<T> publisher) { ...
true
ok
{"focal": {"class": "LiveDataReactiveStreams", "name": "fromPublisher", "signature": "LiveData<T> fromPublisher(Publisher<T> publisher)", "start_line": 3, "modifiers": "@NonNull public static", "params": [{"name": "publisher", "type": "Publisher<T>"}], "return_type": "LiveData<T>"}, "class_info": {"name": "LiveDataReac...
3988459_66
class SetCookieField extends HeaderField { public boolean isHttpOnly() { return httpOnly == null ? false : httpOnly; } public SetCookieField(String name, String value, String domain, String path, DateTimeRFC6265 expiration, Boolean secure, Boolean httpOnly); public ...
// given SetCookieField cookieField = new SetCookieField(null, null, null, null, (String) null, null, Boolean.TRUE); // then assertTrue(cookieField.isHttpOnly()); } }
[FOCAL] public boolean SetCookieField.isHttpOnly() [CLASS] class SetCookieField extends HeaderField [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] SetCookieField(String name, String value, String domain, String path, DateTimeRFC6265 expiration, Boolean secure, Boolean httpOnly); Se...
/* static context [FOCAL] public boolean SetCookieField.isHttpOnly() */
/* static context [FOCAL] public boolean SetCookieField.isHttpOnly() */ class SetCookieField extends HeaderField { public boolean isHttpOnly() { return httpOnly == null ? false : httpOnly; } public SetCookieField(String name, String value, String domain, String path, Dat...
true
ok
{"focal": {"class": "SetCookieField", "name": "isHttpOnly", "signature": "boolean isHttpOnly()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "boolean"}, "class_info": {"name": "SetCookieField", "kind": "class", "modifiers": "", "superclass": "HeaderField", "interfaces": null, "fields": [], "mem...
3993813_9
class NioJournalFileRecord implements NioJournalConstants { public static FindResult findNextRecord(UUID delimiter, ByteBuffer source) { final byte hook = RECORD_DELIMITER_PREFIX[0]; if (source.hasRemaining()) { do { if (source.get() == hook) { int o...
final byte[] chunk = new byte[8 * 1024]; final byte[] recordBytes = recordToBytes(); final ByteBuffer byteBuffer = wrap(chunk); for (int i = (chunk.length - recordBytes.length) + 1; i < chunk.length; i++) { createNoise(chunk); arraycopy(recordBytes, 0, chunk, i,...
[FOCAL] public static FindResult NioJournalFileRecord.findNextRecord(UUID delimiter, ByteBuffer source) [CLASS] class NioJournalFileRecord implements NioJournalConstants [METRICS] loc=38 cc=8 branches=4 loops=1 returns=3 throws=0 nesting=5 [CALLS-INTERNAL] int extractCrc32FromRecord(ByteBuffer sourceAtPayloadPosition);...
/* static context [FOCAL] public static FindResult NioJournalFileRecord.findNextRecord(UUID delimiter, ByteBuffer source) [PATH1] if(source.hasRemaining())=T -> if(source.get() == hook)=T -> switch(readStatus)=case FoundHeaderWithDifferentDelimiter -> if(trace)=T -> do_while(source.hasRemaining())=F -> return new FindR...
/* static context [FOCAL] public static FindResult NioJournalFileRecord.findNextRecord(UUID delimiter, ByteBuffer source) [PATH1] if(source.hasRemaining())=T -> if(source.get() == hook)=T -> switch(readStatus)=case FoundHeaderWithDifferentDelimiter -> if(trace)=T -> do_while(source.hasRemaining())=F -> return new FindR...
true
ok
{"focal": {"class": "NioJournalFileRecord", "name": "findNextRecord", "signature": "FindResult findNextRecord(UUID delimiter, ByteBuffer source)", "start_line": 3, "modifiers": "public static", "params": [{"name": "delimiter", "type": "UUID"}, {"name": "source", "type": "ByteBuffer"}], "return_type": "FindResult"}, "cl...
3996100_2
class CamelLoader implements Loader { @Override public String key() { return "camel"; } @Override public List<Diagram> load(String input, FileType fileType); private List<Diagram> camelContextToDiagram(String input, FileType fileType); } class CamelLoaderTest { @Test public void get...
Loader loader = LoaderHelper.getLoader("camel"); assertTrue(loader instanceof CamelLoader); assertEquals("camel", loader.key()); } }
[FOCAL] @Override public String CamelLoader.key() [CLASS] class CamelLoader implements Loader [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] List<Diagram> load(String input, FileType fileType); List<Diagram> camelContextToDiagram(String input, FileType fileType) [TEST] CamelLoaderT...
/* static context [FOCAL] @Override public String CamelLoader.key() */
/* static context [FOCAL] @Override public String CamelLoader.key() */ class CamelLoader implements Loader { @Override public String key() { return "camel"; } @Override public List<Diagram> load(String input, FileType fileType); private List<Diagram> camelContextToDiagram(String input, Fil...
true
ok
{"focal": {"class": "CamelLoader", "name": "key", "signature": "String key()", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "String"}, "class_info": {"name": "CamelLoader", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Loader", "fields": [], "members": [{"name": ...
3999381_29
class AbstractTrie implements Trie { @Override public int findShortestWord(CharSequence chars, int start, int end, StringBuilder word) { for(int i = start; i < end; i++){ Iterator<String> it = commonPrefixSearch(chars.subSequence(i, end).toString()).iterator(); //* if(it.hasNext()){ if(word != null) word...
String[] expected = { "ソフトウェア", "オープンソース", "ソフトウェア", "Linux", "Linux", "ファイル", "ファイル", "ファイル", "Linux" }; Trie t = trieWithWords("ソフトウェア", "ソフトウェアコンテナ", "オープンソース", "オープンソースソフトウェア", "Linux", "Linuxカーネル", "Linuxコンテナ", "Linuxコンテナ技術", "ファイル", "ファイルシステム"); List<String> actual = new ArrayList<>(...
[FOCAL] @Override public int AbstractTrie.findShortestWord(CharSequence chars, int start, int end, StringBuilder word) [CLASS] class AbstractTrie implements Trie [METRICS] loc=27 cc=4 branches=2 loops=1 returns=2 throws=0 nesting=3 [CALLS-EXTERNAL] commonPrefixSearch(chars.subSequence(i, end).toString()).iterator/0, co...
/* static context [FOCAL] @Override public int AbstractTrie.findShortestWord(CharSequence chars, int start, int end, StringBuilder word) [PATH1] for(i < end)=T -> if(it.hasNext())=T -> if(word != null)=T -> return i [PATH2] for(i < end)=T -> if(it.hasNext())=F -> exit loop -> return -1 [PATH3] for(i < end)=F -> return ...
/* static context [FOCAL] @Override public int AbstractTrie.findShortestWord(CharSequence chars, int start, int end, StringBuilder word) [PATH1] for(i < end)=T -> if(it.hasNext())=T -> if(word != null)=T -> return i [PATH2] for(i < end)=T -> if(it.hasNext())=F -> exit loop -> return -1 [PATH3] for(i < end)=F -> return ...
true
ok
{"focal": {"class": "AbstractTrie", "name": "findShortestWord", "signature": "int findShortestWord(CharSequence chars, int start, int end, StringBuilder word)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "chars", "type": "CharSequence"}, {"name": "start", "type": "int"}, {"name": "end", "type...
4001968_2
class Annotation { public java.util.Map<String, AnnotationProperty> getProperties() { return properties; } public Annotation(Class<?> annotationClass, boolean visible, java.util.Map<String, AnnotationProperty> properties); public Class<?> getAnnotationClass(); public boolean isVisible();...
Mirror<ArrayAnnotatedObject> mirror = Mirrors.newMirrorFactory().getMirror(ArrayAnnotatedObject.class); final List<Annotation> annotations = mirror.getProperty("property").getAnnotations(); Assert.assertEquals(1, annotations.size()); final Annotation annotation = annotations.iterator().n...
[FOCAL] public java.util.Map<String, AnnotationProperty> Annotation.getProperties() [CLASS] class Annotation [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] Annotation(Class<?> annotationClass, boolean visible, java.util.Map<String, AnnotationProperty> properties); Class<?> getAnnot...
/* static context [FOCAL] public java.util.Map<String, AnnotationProperty> Annotation.getProperties() */
/* static context [FOCAL] public java.util.Map<String, AnnotationProperty> Annotation.getProperties() */ class Annotation { public java.util.Map<String, AnnotationProperty> getProperties() { return properties; } public Annotation(Class<?> annotationClass, boolean visible, java.util.Map<String, An...
true
ok
{"focal": {"class": "Annotation", "name": "getProperties", "signature": "java.util.Map<String, AnnotationProperty> getProperties()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "java.util.Map<String, AnnotationProperty>"}, "class_info": {"name": "Annotation", "kind": "class", "modifiers": "", "...
4016036_0
class DeltaSnapshot { public List<DeltaSQLStatementSnapshot> getDeltaSqlStatementSnapshots() { return deltaSQLStatementSnapshots; } public DeltaSnapshot(); public DeltaSnapshot(Snapshot snapshotA, Snapshot snapshotB, boolean condenseInstances...
Calendar fiveMinutesAgo = new GregorianCalendar(); fiveMinutesAgo.add(Calendar.MINUTE, -5); Calendar now = new GregorianCalendar(); Snapshot snapshotA = new Snapshot(fiveMinutesAgo); Snapshot snapshotB = new Snapshot(now); SQLStatement sqlStatement = SQLHelper.getSQLSta...
[FOCAL] public List<DeltaSQLStatementSnapshot> DeltaSnapshot.getDeltaSqlStatementSnapshots() [CLASS] class DeltaSnapshot [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] DeltaSnapshot(); DeltaSnapshot(Snapshot snapshotA, Snapshot snapshotB, boolean condenseInstances, boolean condense...
/* static context [FOCAL] public List<DeltaSQLStatementSnapshot> DeltaSnapshot.getDeltaSqlStatementSnapshots() */
/* static context [FOCAL] public List<DeltaSQLStatementSnapshot> DeltaSnapshot.getDeltaSqlStatementSnapshots() */ class DeltaSnapshot { public List<DeltaSQLStatementSnapshot> getDeltaSqlStatementSnapshots() { return deltaSQLStatementSnapshots; } public DeltaSnapshot(); public DeltaSnapshot(S...
true
ok
{"focal": {"class": "DeltaSnapshot", "name": "getDeltaSqlStatementSnapshots", "signature": "List<DeltaSQLStatementSnapshot> getDeltaSqlStatementSnapshots()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<DeltaSQLStatementSnapshot>"}, "class_info": {"name": "DeltaSnapshot", "kind": "class", ...
4021268_10
class ScaleSymbolList { public String getName() { return name; } public void setName(String value); public String getComment(); public void setComment(String value); public List<String> getScaleSymbol(); public void setScaleSymbol(List<String> aScaleSymbol); } class ScaleSymbolListTest { @Test public ...
try { if (inputElement == null) { unmarshalInput(); } String symbolListName = inputElement.getName(); assertEquals("List name incoorect", "Western Chromatic Symbols", symbolListName); } catch (Exception e) { fail(e.getMessage()); } } }
[FOCAL] public String ScaleSymbolList.getName() [CLASS] class ScaleSymbolList [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] void setName(String value); String getComment(); void setComment(String value); List<String> getScaleSymbol(); void setScaleSymbol(List<String> aScaleSymbol)...
/* static context [FOCAL] public String ScaleSymbolList.getName() */
/* static context [FOCAL] public String ScaleSymbolList.getName() */ class ScaleSymbolList { public String getName() { return name; } public void setName(String value); public String getComment(); public void setComment(String value); public List<String> getScaleSymbol(); public void setScaleSymbol(List<Str...
true
ok
{"focal": {"class": "ScaleSymbolList", "name": "getName", "signature": "String getName()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ScaleSymbolList", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [], "members": [{"name"...
4023244_0
class ReflectionUtils { public static boolean implementsInterface(final Class type, final Class interfaceClass) { return interfaceClass.isAssignableFrom(type); } public static Field[] getDeclaredAndInheritedFields(final Class type, final boolean returnFinalFields); public static List<Metho...
Assert.assertTrue(ReflectionUtils.implementsInterface(ArrayList.class, List.class)); Assert.assertTrue(ReflectionUtils.implementsInterface(ArrayList.class, Collection.class)); Assert.assertFalse(ReflectionUtils.implementsInterface(Set.class, List.class)); } }
[FOCAL] public static boolean ReflectionUtils.implementsInterface(Class type, Class interfaceClass) [CLASS] class ReflectionUtils [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] Class.isAssignableFrom/1 [INPUTS] branches=- | result=interfaceClass, type [COLLABORATORS] param interfa...
/* static context [FOCAL] public static boolean ReflectionUtils.implementsInterface(Class type, Class interfaceClass) [INPUTS] branches=- | result=interfaceClass, type [COLLABORATORS] param interfaceClass:Class isAssignableFrom/1 [CALLS-EXTERNAL] Class.isAssignableFrom/1 */
/* static context [FOCAL] public static boolean ReflectionUtils.implementsInterface(Class type, Class interfaceClass) [INPUTS] branches=- | result=interfaceClass, type [COLLABORATORS] param interfaceClass:Class isAssignableFrom/1 [CALLS-EXTERNAL] Class.isAssignableFrom/1 */ class ReflectionUtils { public static bo...
true
ok
{"focal": {"class": "ReflectionUtils", "name": "implementsInterface", "signature": "boolean implementsInterface(Class type, Class interfaceClass)", "start_line": 3, "modifiers": "public static", "params": [{"name": "type", "type": "Class"}, {"name": "interfaceClass", "type": "Class"}], "return_type": "boolean"}, "class...
4024302_13
class PojoSlice implements Slice { public void onStart() { if (target instanceof HazelcastInstanceAware) { ((HazelcastInstanceAware) target).setHazelcastInstance(hazelcastInstance); } if (target instanceof SliceLifecycleListener) { ((SliceLifecycleListener) target)....
HazelcastInstanceAware pojo = mock(HazelcastInstanceAware.class); HazelcastInstance hazelcastInstance = null;//Hazelcast.getDefaultInstance(); PojoSlice slice = new PojoSlice(pojo); slice.onStart(); verify(pojo).setHazelcastInstance(hazelcastInstance); verifyNoMoreIntera...
[FOCAL] public void PojoSlice.onStart() [CLASS] class PojoSlice implements Slice [METRICS] loc=9 cc=3 branches=2 loops=0 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] ((HazelcastInstanceAware) target).setHazelcastInstance/1, ((SliceLifecycleListener) target).onStart/0 [PATH1] if(target instanceof HazelcastInstanceAware...
/* static context [FOCAL] public void PojoSlice.onStart() [PATH1] if(target instanceof HazelcastInstanceAware)=T -> if(target instanceof SliceLifecycleListener)=T [PATH2] if(target instanceof HazelcastInstanceAware)=F -> if(target instanceof SliceLifecycleListener)=F [CALLS-EXTERNAL] ((HazelcastInstanceAware) target).s...
/* static context [FOCAL] public void PojoSlice.onStart() [PATH1] if(target instanceof HazelcastInstanceAware)=T -> if(target instanceof SliceLifecycleListener)=T [PATH2] if(target instanceof HazelcastInstanceAware)=F -> if(target instanceof SliceLifecycleListener)=F [CALLS-EXTERNAL] ((HazelcastInstanceAware) target).s...
true
ok
{"focal": {"class": "PojoSlice", "name": "onStart", "signature": "void onStart()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "PojoSlice", "kind": "class", "modifiers": "", "superclass": null, "interfaces": "Slice", "fields": [], "members": [{"name": "PojoSlice"...
4026983_1
class ControlMessage { public String toJson() { return new Gson().toJson(this); } public ControlMessage(int leftSpeed, int rightSpeed, boolean lights, int panServoAngle, int tiltServoAngle, boolean takePicture, boolean servos, boolean rawValues); private synchronized static int getNextId(); public stat...
String value = "{\"id\":1,\"leftSpeed\":5,\"rightSpeed\":-4,\"panServoAngle\":42,\"tiltServoAngle\":10,\"lights\":true,\"takePicture\":false,\"servos\":true,\"rawValues\":false,\"timestamp\":10}"; assertThat(controlMessage.toJson(), is(value)); } }
[FOCAL] public String ControlMessage.toJson() [CLASS] class ControlMessage [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] new Gson().toJson/1 [NEW] Gson [CLASS-MEMBERS] ControlMessage(int leftSpeed, int rightSpeed, boolean lights, int panServoAngle, int tiltServoAngle, boolean tak...
/* static context [FOCAL] public String ControlMessage.toJson() [NEW] Gson [CALLS-EXTERNAL] new Gson().toJson/1 */
/* static context [FOCAL] public String ControlMessage.toJson() [NEW] Gson [CALLS-EXTERNAL] new Gson().toJson/1 */ class ControlMessage { public String toJson() { return new Gson().toJson(this); } public ControlMessage(int leftSpeed, int rightSpeed, boolean lights, int panServoAngle, int tiltServoAngle, b...
true
ok
{"focal": {"class": "ControlMessage", "name": "toJson", "signature": "String toJson()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "String"}, "class_info": {"name": "ControlMessage", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [{"name": "controlMessage",...
4031229_11
class ReporterUtil { public static File getFileOutputDir(final URI baseUri, final File outputDir, final TestRunCoverageStatistics runStats) { final URI relativeTestUri = baseUri.relativize(runStats.test); return new File(outputDir, relativeTestUri.toString()).getParentFile().getAbsoluteFile(); ...
final URI test = URI.create(FILE_PREFIX + Joiner.on("/").join(PARENT_DIR_PATH, "src", "main", "javascript", "MyTest.html")); final TestRunCoverageStatistics stats = new TestRunCoverageStatistics(test); final File actual = getFileOutputDir(BASE_URI, OUTPUT_DIR, stats).getAbsoluteFile(); ...
[FOCAL] public static File ReporterUtil.getFileOutputDir(URI baseUri, File outputDir, TestRunCoverageStatistics runStats) [CLASS] class ReporterUtil [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] URI.relativize/1, new File(outputDir, relativeTestUri.toString()).getParent....getAbs...
/* static context [FOCAL] public static File ReporterUtil.getFileOutputDir(URI baseUri, File outputDir, TestRunCoverageStatistics runStats) [INPUTS] branches=- | result=baseUri, outputDir, runStats [COLLABORATORS] param baseUri:URI relativize/1 [NEW] File [CALLS-EXTERNAL] URI.relativize/1, new File(outputDir, relativeT...
/* static context [FOCAL] public static File ReporterUtil.getFileOutputDir(URI baseUri, File outputDir, TestRunCoverageStatistics runStats) [INPUTS] branches=- | result=baseUri, outputDir, runStats [COLLABORATORS] param baseUri:URI relativize/1 [NEW] File [CALLS-EXTERNAL] URI.relativize/1, new File(outputDir, relativeT...
true
ok
{"focal": {"class": "ReporterUtil", "name": "getFileOutputDir", "signature": "File getFileOutputDir(URI baseUri, File outputDir, TestRunCoverageStatistics runStats)", "start_line": 3, "modifiers": "public static", "params": [{"name": "baseUri", "type": "URI"}, {"name": "outputDir", "type": "File"}, {"name": "runStats",...
4057303_5
class Manager { public T getAssociatedInstance(final String typeId) throws DempsyException { if(LOGGER.isTraceEnabled()) LOGGER.trace("Trying to find " + clazz.getSimpleName() + " associated with the transport \"{}\"", typeId); T ret = null; synchronized(registered) { ...
try (final ServiceManager<SomeInterface> manager = new ServiceManager<>(SomeInterface.class);) { manager.start(new TestInfrastructure("testManager", null, null, null)); final SomeInterface retrieved = manager.getAssociatedInstance(typeId); assertEquals(expectedClass, retriev...
[FOCAL] public T Manager.getAssociatedInstance(String typeId) [CLASS] class Manager [METRICS] loc=20 cc=4 branches=3 loops=0 returns=1 throws=0 nesting=3 [CALLS-INTERNAL] T makeInstance(String typeId) [CALLS-EXTERNAL] Logger.isTraceEnabled/0, Logger.trace/2, clazz.getSimpleName/0, registered.get/1, registered.put/2 [FI...
/* static context [FOCAL] public T Manager.getAssociatedInstance(String typeId) [PATH1] if(LOGGER.isTraceEnabled())#1=T -> if(ret == null)=T -> if(LOGGER.isTraceEnabled())#2=T -> return ret [PATH2] if(LOGGER.isTraceEnabled())#1=F -> if(ret == null)=F -> return ret [PATH3] if(LOGGER.isTraceEnabled())#1=T -> if(ret == nu...
/* static context [FOCAL] public T Manager.getAssociatedInstance(String typeId) [PATH1] if(LOGGER.isTraceEnabled())#1=T -> if(ret == null)=T -> if(LOGGER.isTraceEnabled())#2=T -> return ret [PATH2] if(LOGGER.isTraceEnabled())#1=F -> if(ret == null)=F -> return ret [PATH3] if(LOGGER.isTraceEnabled())#1=T -> if(ret == nu...
true
ok
{"focal": {"class": "Manager", "name": "getAssociatedInstance", "signature": "T getAssociatedInstance(String typeId) throws DempsyException", "start_line": 3, "modifiers": "public", "params": [{"name": "typeId", "type": "String"}], "return_type": "T"}, "class_info": {"name": "Manager", "kind": "class", "modifiers": "",...
4060867_7
class RESTBrowseController extends RESTAbstractController { public void getVideos(HttpServletRequest request, HttpServletResponse response) throws Exception { XMLBuilder builder = createXMLBuilder(request, response, true); builder.add("videos", true); builder.endAll(); response.get...
StringWriter sw = new StringWriter(); HttpServletRequest request = mock(HttpServletRequest.class); HttpServletResponse response = mock(HttpServletResponse.class); when(response.getWriter()).thenReturn(new PrintWriter(sw)); browseController.getVideos(request, response); ...
[FOCAL] public void RESTBrowseController.getVideos(HttpServletRequest request, HttpServletResponse response) [CLASS] class RESTBrowseController extends RESTAbstractController [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] createXMLBuilder/3 (inherited), XMLBuilder.add/2, XMLBuilde...
/* static context [FOCAL] public void RESTBrowseController.getVideos(HttpServletRequest request, HttpServletResponse response) [COLLABORATORS] param response:HttpServletResponse getWriter/0 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] createXMLBuilder/3 (inherited), XMLBuilder.add/2, XMLBuilder.endAll/0, response.g...
/* static context [FOCAL] public void RESTBrowseController.getVideos(HttpServletRequest request, HttpServletResponse response) [COLLABORATORS] param response:HttpServletResponse getWriter/0 [EXCEPTIONS] declares Exception [CALLS-EXTERNAL] createXMLBuilder/3 (inherited), XMLBuilder.add/2, XMLBuilder.endAll/0, response.g...
true
ok
{"focal": {"class": "RESTBrowseController", "name": "getVideos", "signature": "void getVideos(HttpServletRequest request, HttpServletResponse response) throws Exception", "start_line": 3, "modifiers": "public", "params": [{"name": "request", "type": "HttpServletRequest"}, {"name": "response", "type": "HttpServletRespon...
4090170_0
class CascadingFieldsGenerator { public void generate(Schema schema, Writer output) throws IOException { final VelocityContext context = new VelocityContext(); context.put("schema", schema); context.put("this", this); engine.mergeTemplate(path + "fields.vm", "UTF-8", context, outpu...
final CascadingFieldsGenerator gen = new CascadingFieldsGenerator(); final Schema schema = getSchema(); final Writer writer = new StringWriter(); gen.generate(schema, writer); writer.close(); final String actual = writer.toString(); final String expected = Resou...
[FOCAL] public void CascadingFieldsGenerator.generate(Schema schema, Writer output) [CLASS] class CascadingFieldsGenerator [METRICS] loc=7 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [CALLS-EXTERNAL] VelocityContext.put/2, engine.mergeTemplate/4 [NEW] VelocityContext [EXCEPTIONS] declares IOException [COLLABOR...
/* static context [FOCAL] public void CascadingFieldsGenerator.generate(Schema schema, Writer output) [COLLABORATORS] field engine mergeTemplate/4 [EXCEPTIONS] declares IOException [NEW] VelocityContext [CALLS-EXTERNAL] VelocityContext.put/2, engine.mergeTemplate/4 */
/* static context [FOCAL] public void CascadingFieldsGenerator.generate(Schema schema, Writer output) [COLLABORATORS] field engine mergeTemplate/4 [EXCEPTIONS] declares IOException [NEW] VelocityContext [CALLS-EXTERNAL] VelocityContext.put/2, engine.mergeTemplate/4 */ class CascadingFieldsGenerator { public void g...
true
ok
{"focal": {"class": "CascadingFieldsGenerator", "name": "generate", "signature": "void generate(Schema schema, Writer output) throws IOException", "start_line": 3, "modifiers": "public", "params": [{"name": "schema", "type": "Schema"}, {"name": "output", "type": "Writer"}], "return_type": "void"}, "class_info": {"name"...
4101951_1
class DtoConfig { public List<DtoProperty> getProperties() { if (properties == null) { properties = list(); final List<PropConfig> pcs = getPropertiesConfig(); if (getDomainType() != null) { addPropertiesFromDomainObject(pcs); addChainedPropertiesFromDomainObject(pcs); } ...
// given two properties oracle.addProperty("com.domain.Foo", "a", "java.lang.String"); oracle.addProperty("com.domain.Foo", "b", "java.lang.String"); // and an override to skip b addDto("FooDto", domain("Foo"), properties("-b, *")); // then we have only 1 final DtoConfig dc = rootConfig.getD...
[FOCAL] public List<DtoProperty> DtoConfig.getProperties() [CLASS] class DtoConfig [METRICS] loc=13 cc=3 branches=2 loops=0 returns=1 throws=0 nesting=2 [CALLS-INTERNAL] List<PropConfig> getPropertiesConfig(); String getDomainType(); void addChainedPropertiesFromDomainObject(List<PropConfig> pcs); void addLeftOverExten...
/* static context [FOCAL] public List<DtoProperty> DtoConfig.getProperties() [PATH1] if(properties == null)=T -> if(getDomainType() != null)=T -> return properties [PATH2] if(properties == null)=F -> return properties [PATH3] if(properties == null)=T -> if(getDomainType() != null)=F -> return properties [CALLS-INTERNAL...
/* static context [FOCAL] public List<DtoProperty> DtoConfig.getProperties() [PATH1] if(properties == null)=T -> if(getDomainType() != null)=T -> return properties [PATH2] if(properties == null)=F -> return properties [PATH3] if(properties == null)=T -> if(getDomainType() != null)=F -> return properties [CALLS-INTERNAL...
true
ok
{"focal": {"class": "DtoConfig", "name": "getProperties", "signature": "List<DtoProperty> getProperties()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "List<DtoProperty>"}, "class_info": {"name": "DtoConfig", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fields": [...
4103388_44
class JSwordPassageServiceImpl implements JSwordPassageService { @Override public OsisWrapper getOsisText(final String version, final String reference) { return getOsisText(version, reference, new ArrayList<LookupOption>(0), null, NONE); } @Inject public JSwordPassageServiceImpl(final JSwordV...
final Book currentBook = Books.installed().getBook("KJV"); final BookData bookData = new BookData(currentBook, currentBook.getKey("Romans 1:4")); final Element osisFragment = bookData.getOsisFragment(); final XMLOutputter xmlOutputter = new XMLOutputter(Format.getPrettyFormat()); ...
[FOCAL] @Override public OsisWrapper JSwordPassageServiceImpl.getOsisText(String version, String reference) [CLASS] class JSwordPassageServiceImpl implements JSwordPassageService [METRICS] loc=4 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-INTERNAL] OsisWrapper getOsisText(String version, Key reference, ...
class JSwordPassageServiceImpl implements JSwordPassageService { @Override public OsisWrapper getOsisText(final String version, final String reference) { return getOsisText(version, reference, new ArrayList<LookupOption>(0), null, NONE); } @Inject public JSwordPassageServiceImpl(final JSwordV...
false
ok
{"focal": {"class": "JSwordPassageServiceImpl", "name": "getOsisText", "signature": "OsisWrapper getOsisText(String version, String reference)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "version", "type": "String"}, {"name": "reference", "type": "String"}], "return_type": "OsisWrapper"}, "c...
4112450_11
class UnitsParser { public boolean parse(String input) { String[] split = input.split(" "); if(split.length != 4) { if(LOGGER.isInfoEnabled()) LOGGER.info("Could not parse '"+input+"': 4 tokens expected"); return false; } String u = ...
System.out.println("parse"); String units = "seconds since 1980-1-1 0:0:0"; UnitsParser instance = new UnitsParser(); boolean ret = instance.parse(units); assertTrue(ret); System.out.println(instance); } }
[FOCAL] public boolean UnitsParser.parse(String input) [CLASS] class UnitsParser [METRICS] loc=37 cc=9 branches=6 loops=0 returns=5 throws=0 nesting=2 [CALLS-EXTERNAL] String.split/1, LOGGER.isInfoEnabled/0, LOGGER.info/1, Units.valueOf/1, String.toLowerCase/0, units.getMultiplier/0, Exception.getMessage/0, "since".equ...
/* static context [FOCAL] public boolean UnitsParser.parse(String input) [PATH1] if(split.length != 4)=F -> if(! "since".equals(split[1]))=F -> try-body throws -> if(LOGGER.isInfoEnabled())#4=T -> return false [PATH2] if(split.length != 4)=T -> if(LOGGER.isInfoEnabled())#1=T -> return false [PATH3] if(split.length != 4...
/* static context [FOCAL] public boolean UnitsParser.parse(String input) [PATH1] if(split.length != 4)=F -> if(! "since".equals(split[1]))=F -> try-body throws -> if(LOGGER.isInfoEnabled())#4=T -> return false [PATH2] if(split.length != 4)=T -> if(LOGGER.isInfoEnabled())#1=T -> return false [PATH3] if(split.length != 4...
true
ok
{"focal": {"class": "UnitsParser", "name": "parse", "signature": "boolean parse(String input)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "String"}], "return_type": "boolean"}, "class_info": {"name": "UnitsParser", "kind": "class", "modifiers": "", "superclass": null, "interfaces": nu...
4114494_1
class CoverageClassVisitor extends ClassVisitor implements Opcodes { public int getClassId() { return classId; } public CoverageClassVisitor(ClassVisitor classVisitor, int classId); @Override public void visit(int version, int access, String name, String signature, String superName, String[]...
for(int i = 0; i <= Short.MAX_VALUE;i++) { int cid = Registry.registerClass("class" + i, getClass().getClassLoader(), "class" + i + ".java"); ArrayList<String> methodNames = new ArrayList<String>(); methodNames.add("<init>"); methodNames.add("main"); ...
[FOCAL] public int CoverageClassVisitor.getClassId() [CLASS] class CoverageClassVisitor extends ClassVisitor implements Opcodes [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CLASS-MEMBERS] CoverageClassVisitor(ClassVisitor classVisitor, int classId); void visit(int version, int access, String na...
/* static context [FOCAL] public int CoverageClassVisitor.getClassId() */
/* static context [FOCAL] public int CoverageClassVisitor.getClassId() */ class CoverageClassVisitor extends ClassVisitor implements Opcodes { public int getClassId() { return classId; } public CoverageClassVisitor(ClassVisitor classVisitor, int classId); @Override public void visit(int vers...
true
ok
{"focal": {"class": "CoverageClassVisitor", "name": "getClassId", "signature": "int getClassId()", "start_line": 3, "modifiers": "public", "params": [], "return_type": "int"}, "class_info": {"name": "CoverageClassVisitor", "kind": "class", "modifiers": "", "superclass": "ClassVisitor", "interfaces": "Opcodes", "fields"...
4117239_0
class Queue extends BaseQueue<VALUE, VALUE> { public Queue(Variable<ImmutableList<VALUE>> input, Variable<ImmutableList<VALUE>> output, Variable<Boolean> frozen) { super(input, output, frozen); } public Queue(Variable<ImmutableList<VALUE>> input, Variable<ImmutableList<VALUE>> output, Variable<Boolean> fro...
DriverFactory<ImmutableList<Integer>> listFactory = new BasicFactory<ImmutableList<Integer>>(); DriverFactory<Boolean> boolFactory = new BasicFactory<Boolean>(); QueueExecutable<Integer> queue = QueueExecutable.getQueueByName("integers", listFactory, boolFactory); queue.append(10); queue.append(11)...
[FOCAL] public Queue.Queue(Variable<ImmutableList<VALUE>> input, Variable<ImmutableList<VALUE>> output, Variable<Boolean> frozen) [CLASS] class Queue extends BaseQueue<VALUE, VALUE> [METRICS] loc=3 cc=1 branches=0 loops=0 returns=0 throws=0 nesting=0 [DATAFLOW] frozen@param->L2; input@param->L2; output@param->L2 [CLASS...
/* static context [FOCAL] public Queue.Queue(Variable<ImmutableList<VALUE>> input, Variable<ImmutableList<VALUE>> output, Variable<Boolean> frozen) */
/* static context [FOCAL] public Queue.Queue(Variable<ImmutableList<VALUE>> input, Variable<ImmutableList<VALUE>> output, Variable<Boolean> frozen) */ class Queue extends BaseQueue<VALUE, VALUE> { public Queue(Variable<ImmutableList<VALUE>> input, Variable<ImmutableList<VALUE>> output, Variable<Boolean> frozen) { ...
true
ok
{"focal": {"class": "Queue", "name": "Queue", "signature": "Queue(Variable<ImmutableList<VALUE>> input, Variable<ImmutableList<VALUE>> output, Variable<Boolean> frozen)", "start_line": 3, "modifiers": "public", "params": [{"name": "input", "type": "Variable<ImmutableList<VALUE>>"}, {"name": "output", "type": "Variable<...
4120901_37
class HadoopWorkflowDirectoryFilter implements InitializingBean { public boolean filter(File file) { return file.getParentFile().getAbsolutePath().contains(springHadoopWorkflowDirectoryName); } public String getSpringHadoopWorkflowDirectoryName(); public void setSpringHadoopWorkflowDirectoryName(String springHa...
String value = "test"; filter.setSpringHadoopWorkflowDirectoryName(value); File file = new File("src/test/resources/org/springframework/data/hadoop/admin/util/test/context.xml"); boolean filtered = filter.filter(file); Assert.assertTrue(filtered); } }
[FOCAL] public boolean HadoopWorkflowDirectoryFilter.filter(File file) [CLASS] class HadoopWorkflowDirectoryFilter implements InitializingBean [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] file.getParentFile().getAbsolutePath().contains/1, file.getParentFile().getAbsolutePath/0, ...
/* static context [FOCAL] public boolean HadoopWorkflowDirectoryFilter.filter(File file) [INPUTS] branches=- | result=file [COLLABORATORS] param file:File getParentFile/0 [CALLS-EXTERNAL] file.getParentFile().getAbsolutePath().contains/1, file.getParentFile().getAbsolutePath/0, File.getParentFile/0 */
/* static context [FOCAL] public boolean HadoopWorkflowDirectoryFilter.filter(File file) [INPUTS] branches=- | result=file [COLLABORATORS] param file:File getParentFile/0 [CALLS-EXTERNAL] file.getParentFile().getAbsolutePath().contains/1, file.getParentFile().getAbsolutePath/0, File.getParentFile/0 */ class HadoopWorkf...
true
ok
{"focal": {"class": "HadoopWorkflowDirectoryFilter", "name": "filter", "signature": "boolean filter(File file)", "start_line": 3, "modifiers": "public", "params": [{"name": "file", "type": "File"}], "return_type": "boolean"}, "class_info": {"name": "HadoopWorkflowDirectoryFilter", "kind": "class", "modifiers": "", "sup...
4131741_2
class CacheControlHandlerInterceptor extends HandlerInterceptorAdapter implements HandlerInterceptor { @Override public final boolean preHandle( final HttpServletRequest request, final HttpServletResponse response, final Object handler) throws Exception { this.assignCacheControlHeader(request, respons...
final HandlerMethod handler = new HandlerMethod( controller, controller.getClass().getMethod("handlePubliclyCachedPageAndRevalidatedRequest")); interceptor.preHandle(request, response, handler); System.err.println("CC: " + response.getHeader("Cache-Control")); assertNotNull(response.getHead...
[FOCAL] @Override public final boolean CacheControlHandlerInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) [CLASS] class CacheControlHandlerInterceptor extends HandlerInterceptorAdapter implements HandlerInterceptor [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws...
/* static context [FOCAL] @Override public final boolean CacheControlHandlerInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) [INPUTS] branches=- | result=handler, request, response [EXCEPTIONS] declares Exception [CALLS-INTERNAL] void assignCacheControlHeader(HttpServletRe...
/* static context [FOCAL] @Override public final boolean CacheControlHandlerInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) [INPUTS] branches=- | result=handler, request, response [EXCEPTIONS] declares Exception [CALLS-INTERNAL] void assignCacheControlHeader(HttpServletRe...
true
ok
{"focal": {"class": "CacheControlHandlerInterceptor", "name": "preHandle", "signature": "boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception", "start_line": 3, "modifiers": "@Override public final", "params": [{"name": "request", "type": "HttpServletRequest"}, {"...
4138309_2
class Event { public static Event<?> fromJson(String json) throws IOException { return JSONUtil.toObject(json, new TypeReference<Event<?>>() {}); } public Event(int eventId, Type type, long timestamp, T payload); private Event(Type type, T payload); public Event(); public int getId(); public Typ...
String json = "{\n" + " \"type\" : \"JOB_STARTED\",\n" + " \"payload\" : {\n" + " \"name\" : \"scope-29\",\n" + " \"job\" : {\n" + " \"runtime\" : \"default\",\n" + " \"id\" : \"job_l...
[FOCAL] public static Event<?> Event.fromJson(String json) [CLASS] class Event [METRICS] loc=3 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] JSONUtil.toObject/2 [NEW] TypeReference<Event<?>> [EXCEPTIONS] declares IOException [INPUTS] branches=- | result=json [DATAFLOW] json@param->L2 [CLASS-MEMB...
/* static context [FOCAL] public static Event<?> Event.fromJson(String json) [INPUTS] branches=- | result=json [EXCEPTIONS] declares IOException [NEW] TypeReference<Event<?>> [CALLS-EXTERNAL] JSONUtil.toObject/2 */
/* static context [FOCAL] public static Event<?> Event.fromJson(String json) [INPUTS] branches=- | result=json [EXCEPTIONS] declares IOException [NEW] TypeReference<Event<?>> [CALLS-EXTERNAL] JSONUtil.toObject/2 */ class Event { public static Event<?> fromJson(String json) throws IOException { return JSONUtil.to...
true
ok
{"focal": {"class": "Event", "name": "fromJson", "signature": "Event<?> fromJson(String json) throws IOException", "start_line": 3, "modifiers": "public static", "params": [{"name": "json", "type": "String"}], "return_type": "Event<?>"}, "class_info": {"name": "Event", "kind": "class", "modifiers": "", "superclass": nu...
4139627_0
class StartLetterCountMP implements Cloneable { @Override public StartLetterCountMP clone() throws CloneNotSupportedException { return (StartLetterCountMP)super.clone(); } @MessageHandler public LetterCount handleFirstCharacter(Letter letter); private StartLetterCountMP mp; } class StartLet...
StartLetterCountMP clone1 = mp.clone(); StartLetterCountMP clone2 = mp.clone(); Assert.assertNotNull(clone1); Assert.assertNotNull(clone2); Assert.assertNull(clone1.character); Assert.assertNull(clone2.character); clone1.character = new Character('T'); Assert.asse...
[FOCAL] @Override public StartLetterCountMP StartLetterCountMP.clone() [CLASS] class StartLetterCountMP implements Cloneable [METRICS] loc=5 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] super.clone/0 [EXCEPTIONS] declares CloneNotSupportedException [CLASS-MEMBERS] LetterCount handleFirstCharact...
/* static context [FOCAL] @Override public StartLetterCountMP StartLetterCountMP.clone() [EXCEPTIONS] declares CloneNotSupportedException [CALLS-EXTERNAL] super.clone/0 */
/* static context [FOCAL] @Override public StartLetterCountMP StartLetterCountMP.clone() [EXCEPTIONS] declares CloneNotSupportedException [CALLS-EXTERNAL] super.clone/0 */ class StartLetterCountMP implements Cloneable { @Override public StartLetterCountMP clone() throws CloneNotSupportedException { retu...
true
ok
{"focal": {"class": "StartLetterCountMP", "name": "clone", "signature": "StartLetterCountMP clone() throws CloneNotSupportedException", "start_line": 3, "modifiers": "@Override public", "params": [], "return_type": "StartLetterCountMP"}, "class_info": {"name": "StartLetterCountMP", "kind": "class", "modifiers": "", "su...
4167742_80
class DefaultValueChecker implements ValueChecker { @Override public AlertType checkValue(BigDecimal value, BigDecimal warn, BigDecimal error) { boolean isHighValueWorse = isTheValueBeingHighWorse(warn, error); if (isBeyondThreshold(value, error, isHighValueWorse)) { ...
assertThat(checker.checkValue(bd("0.16"), bd("0.15"), bd("0.20")), is(AlertType.WARN)); } }
[FOCAL] @Override public AlertType DefaultValueChecker.checkValue(BigDecimal value, BigDecimal warn, BigDecimal error) [CLASS] class DefaultValueChecker implements ValueChecker [METRICS] loc=14 cc=3 branches=2 loops=0 returns=3 throws=0 nesting=2 [CALLS-INTERNAL] boolean isBeyondThreshold(BigDecimal value, BigDecimal t...
/* static context [FOCAL] @Override public AlertType DefaultValueChecker.checkValue(BigDecimal value, BigDecimal warn, BigDecimal error) [PATH1] if(isBeyondThreshold(value, error, isHighValueWorse))=F -> if(isBeyondThreshold(value, warn, isHighValueWorse))=T -> return AlertType.WARN [PATH2] if(isBeyondThreshold(value, ...
/* static context [FOCAL] @Override public AlertType DefaultValueChecker.checkValue(BigDecimal value, BigDecimal warn, BigDecimal error) [PATH1] if(isBeyondThreshold(value, error, isHighValueWorse))=F -> if(isBeyondThreshold(value, warn, isHighValueWorse))=T -> return AlertType.WARN [PATH2] if(isBeyondThreshold(value, ...
true
ok
{"focal": {"class": "DefaultValueChecker", "name": "checkValue", "signature": "AlertType checkValue(BigDecimal value, BigDecimal warn, BigDecimal error)", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "value", "type": "BigDecimal"}, {"name": "warn", "type": "BigDecimal"}, {"name": "error", "type...
4169493_3
class PreProcessMatrix { public void escapeColNames() throws Exception { ArrayList<String> newColNames = new ArrayList<String>(); for (String s : this.colNames) { newColNames.add(NameConvention.escapeEntityNameStrict(s)); this.colNames = newColNames; } } public PreProcessMatrix(File in); public v...
PreProcessMatrix pm = new PreProcessMatrix(this.testMatrix); pm.escapeColNames(); File result = pm.getResult(); String actual = readFile(result); String expected = "\tcol1\tcol2\tcol3\n"; expected += "234row1\tval1\tval2\tval3\n"; expected += "&row2\tval4\tval5\tval6\n"; expected += "678row3#\tval7\tval...
[FOCAL] public void PreProcessMatrix.escapeColNames() [CLASS] class PreProcessMatrix [METRICS] loc=9 cc=2 branches=0 loops=1 returns=0 throws=0 nesting=1 [CALLS-EXTERNAL] ArrayList<String>.add/1, NameConvention.escapeEntityNameStrict/1 [NEW] ArrayList<String> [FIELDS] read=colNames | write=colNames [EXCEPTIONS] declare...
/* static context [FOCAL] public void PreProcessMatrix.escapeColNames() [PATH1] foreach(String s : this.colNames)=T -> exit loop [PATH2] foreach(String s : this.colNames)=F [STATE] colNames [EXCEPTIONS] declares Exception [FIELDS] read=colNames | write=colNames [NEW] ArrayList<String> [CALLS-EXTERNAL] ArrayList<String>...
/* static context [FOCAL] public void PreProcessMatrix.escapeColNames() [PATH1] foreach(String s : this.colNames)=T -> exit loop [PATH2] foreach(String s : this.colNames)=F [STATE] colNames [EXCEPTIONS] declares Exception [FIELDS] read=colNames | write=colNames [NEW] ArrayList<String> [CALLS-EXTERNAL] ArrayList<String>...
true
ok
{"focal": {"class": "PreProcessMatrix", "name": "escapeColNames", "signature": "void escapeColNames() throws Exception", "start_line": 3, "modifiers": "public", "params": [], "return_type": "void"}, "class_info": {"name": "PreProcessMatrix", "kind": "class", "modifiers": "", "superclass": null, "interfaces": null, "fie...
4180644_100
class HibernateDrugGroupDAO implements DrugGroupDAO { @Override public List<DrugGroup> getDrugGroupByName(String name) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugGroup.class); criteria.add(Restrictions.like("name", name)); criteria.add(Restrictions.like("ret...
String name = "TestDrugGroup1"; String result = dao.getDrugGroupByName(name).get(0).getName(); assertEquals(name, result); } }
[FOCAL] @Override public List<DrugGroup> HibernateDrugGroupDAO.getDrugGroupByName(String name) [CLASS] class HibernateDrugGroupDAO implements DrugGroupDAO [METRICS] loc=10 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 [CALLS-EXTERNAL] sessionFactory.getCurrentSession().createCriteria/1, sessionFactory.getCurrent...
/* static context [FOCAL] @Override public List<DrugGroup> HibernateDrugGroupDAO.getDrugGroupByName(String name) [COLLABORATORS] field sessionFactory getCurrentSession/0 [EXCEPTIONS] declares DAOException [NEW] ArrayList<DrugGroup> [CALLS-EXTERNAL] sessionFactory.getCurrentSession().createCriteria/1, sessionFactory.get...
/* static context [FOCAL] @Override public List<DrugGroup> HibernateDrugGroupDAO.getDrugGroupByName(String name) [COLLABORATORS] field sessionFactory getCurrentSession/0 [EXCEPTIONS] declares DAOException [NEW] ArrayList<DrugGroup> [CALLS-EXTERNAL] sessionFactory.getCurrentSession().createCriteria/1, sessionFactory.get...
true
ok
{"focal": {"class": "HibernateDrugGroupDAO", "name": "getDrugGroupByName", "signature": "List<DrugGroup> getDrugGroupByName(String name) throws DAOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "name", "type": "String"}], "return_type": "List<DrugGroup>"}, "class_info": {"name": "Hibe...
4182801_87
class ConditionalConversion extends FormatConversionBase { @Override public int format(FormatterAPI formatter, Object value, Locale locale, String flags, int width, int precision, String formatString, int position) throws IOException { ensureNoWidth(width); ensureNoPrecision(precision); ...
assertThat(format(null, "[yes][no]"), is("no")); } }
[FOCAL] @Override public int ConditionalConversion.format(FormatterAPI formatter, Object value, Locale locale, String flags, int width, int precision, String formatString, int position) [CLASS] class ConditionalConversion extends FormatConversionBase [METRICS] loc=7 cc=1 branches=0 loops=0 returns=1 throws=0 nesting=0 ...
/* static context [FOCAL] @Override public int ConditionalConversion.format(FormatterAPI formatter, Object value, Locale locale, String flags, int width, int precision, String formatString, int position) [INPUTS] branches=- | result=formatString, formatter, position, value | unused=locale [EXCEPTIONS] declares IOExcept...
/* static context [FOCAL] @Override public int ConditionalConversion.format(FormatterAPI formatter, Object value, Locale locale, String flags, int width, int precision, String formatString, int position) [INPUTS] branches=- | result=formatString, formatter, position, value | unused=locale [EXCEPTIONS] declares IOExcept...
true
ok
{"focal": {"class": "ConditionalConversion", "name": "format", "signature": "int format(FormatterAPI formatter, Object value, Locale locale, String flags, int width, int precision, String formatString, int position) throws IOException", "start_line": 3, "modifiers": "@Override public", "params": [{"name": "formatter", ...