auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public MesosCloud( String mesosMasterUrl, String frameworkName, String frameworkId, String role, String agentUser, String jenkinsURL, List<? extends MesosAgentSpecTemplate> mesosAgentSpecTemplates) throws InterruptedException, ExecutionException, IOException { super("MesosCloud", null); try { this.master = mesosMasterUrl; this.jenkinsURL = new URL(jenkinsURL); } catch (MalformedURLException e) { throw new RuntimeException( String.format("Mesos Cloud URL validation failed for Jenkins %s", jenkinsURL), e); } if (selfIsMesosTask()) { String mesosSandbox = System.getenv("MESOS_SANDBOX"); this.sslCert = Optional.ofNullable(loadDcosCert(mesosSandbox)); this.dcosAuthorization = Optional.ofNullable(loadDcosAuthorization()); } else { this.sslCert = Optional.empty(); this.dcosAuthorization = Optional.empty(); } this.agentUser = agentUser; this.role = role; this.mesosAgentSpecTemplates = mesosAgentSpecTemplates; this.frameworkName = frameworkName; this.frameworkId = frameworkId; if (StringUtils.isEmpty(this.frameworkId)) { logger.info("Framework ID was null."); this.frameworkId = UUID.randomUUID().toString(); } this.mesosApi = MesosApi.getInstance( this.master, this.jenkinsURL, this.agentUser, this.frameworkName, this.frameworkId, this.role, this.sslCert, this.dcosAuthorization); }

Target:
public MesosCloud( String mesosMasterUrl, String frameworkName, String frameworkId, String role, String agentUser, String jenkinsURL, List<? extends MesosAgentSpecTemplate> mesosAgentSpecTemplates) throws InterruptedException, ExecutionException, IOException { super("MesosCloud", null); try { this.master = mesosMasterUrl; this.jenkinsURL = new URL(jenkinsURL); } catch (MalformedURLException e) { throw new RuntimeException( String.format("Mesos Cloud URL validation failed for Jenkins %s", jenkinsURL), e); } if (selfIsMesosTask()) { String mesosSandbox = System.getenv("MESOS_SANDBOX"); this.sslCert = Optional.ofNullable(loadDcosCert(mesosSandbox)); this.dcosAuthorization = Optional.ofNullable(loadDcosAuthorization()); } else { this.sslCert = Optional.empty(); this.dcosAuthorization = Optional.empty(); } this.agentUser = agentUser; this.role = role; this.mesosAgentSpecTemplates = mesosAgentSpecTemplates; this.frameworkName = frameworkName; this.frameworkId = frameworkId; if (StringUtils.isEmpty(this.frameworkId)) { this.frameworkId = UUID.randomUUID().toString(); } this.mesosApi = MesosApi.getInstance( this.master, this.jenkinsURL, this.agentUser, this.frameworkName, this.frameworkId, this.role, this.sslCert, this.dcosAuthorization); }
Source:
private FlumeEventAvroEventDeserializer(Context context, ResettableInputStream ris) { this.ris = ris; schemaType = AvroSchemaType.valueOf( context.getString(CONFIG_SCHEMA_TYPE_KEY, AvroSchemaType.HASH.toString()).toUpperCase(Locale.ENGLISH)); if (schemaType == AvroSchemaType.LITERAL) { logger.warn(CONFIG_SCHEMA_TYPE_KEY + " set to " + AvroSchemaType.LITERAL.toString() + ", so storing full Avro " + "schema in the header of each event, which may be inefficient. " + "Consider using the hash of the schema " + "instead of the literal schema."); } }

Target:
private FlumeEventAvroEventDeserializer(Context context, ResettableInputStream ris) { super(context, ris); }
Source:
private ILogicalExpression data(ILogicalExpression expr) throws SystemException { ILogicalExpression atomizedExpr = new ScalarFunctionCallExpression(BuiltinFunctions.FN_DATA_1, Collections.singletonList(mutable(expr))); return atomizedExpr; }

Target:
private ILogicalExpression data(ILogicalExpression expr) throws SystemException { return new ScalarFunctionCallExpression(BuiltinFunctions.FN_DATA_1, Collections.singletonList(mutable(expr))); }
Source:
public void testSortingUpdatesPreferences() { assertThat(preferencesService.getPreferences().getGameListSorting(), hasSize(0)); instance.initializeGameTable(FXCollections.observableArrayList( GameBuilder.create().defaultValues().get(), GameBuilder.create().defaultValues().state(GameStatus.CLOSED).get() )); TableColumn<Game, ?> column = instance.gamesTable.getColumns().get(0); column.setSortType(SortType.ASCENDING); instance.gamesTable.getSortOrder().add(column); assertThat(preferencesService.getPreferences().getGameListSorting(), hasSize(1)); }

Target:
public void testSortingUpdatesPreferences() { assertThat(preferencesService.getPreferences().getGameListSorting(), hasSize(0)); instance.initializeGameTable(FXCollections.observableArrayList( GameBuilder.create().defaultValues().get(), GameBuilder.create().defaultValues().state(GameStatus.CLOSED).get() )); TableColumn<Game, ?> column = instance.gamesTable.getColumns().get(0); column.setSortType(SortType.ASCENDING); instance.gamesTable.getSortOrder().add(column); assertThat(preferencesService.getPreferences().getGameListSorting(), hasSize(1)); assertThat( preferencesService.getPreferences().getGameListSorting().get(0), equalTo(new Pair<>("passwordProtectionColumn", SortType.ASCENDING)) ); }
Source:
public <T> T getDefaultPlugin(Class<T> pluginType) { if (pluginType == InstantiatorProvider.class) { String className = DEFAULT_PLUGINS.get(InstantiatorProvider2.class.getName()); return (T)new InstantiatorProvider2Wrapper(create(InstantiatorProvider2.class, className)); } else { String className = DEFAULT_PLUGINS.get(pluginType.getName()); return create(pluginType, className); } }

Target:
public <T> T getDefaultPlugin(Class<T> pluginType) { if (pluginType == InstantiatorProvider.class) { String className = DEFAULT_PLUGINS.get(InstantiatorProvider2.class.getName()); return pluginType.cast(new InstantiatorProvider2Wrapper(create(InstantiatorProvider2.class, className))); } else { String className = DEFAULT_PLUGINS.get(pluginType.getName()); return create(pluginType, className); } }
Source:
public void testNamespaceOps() throws Exception { String testNamespace = "testnamespace"; String testNamespace2 = "testnamespace2"; assertEquals("", client.defaultNamespace(creds)); assertEquals("accumulo", client.systemNamespace(creds)); client.createNamespace(creds, testNamespace); assertTrue(client.namespaceExists(creds, testNamespace)); assertTrue(client.listNamespaces(creds).contains(testNamespace)); client.renameNamespace(creds, testNamespace, testNamespace2); assertTrue(client.namespaceExists(creds, testNamespace2)); assertFalse(client.namespaceExists(creds, testNamespace)); client.deleteNamespace(creds, testNamespace2); assertFalse(client.namespaceExists(creds, testNamespace2)); }

Target:
public void testNamespaceOps() throws Exception { String testNamespace = "testnamespace"; String testNamespace2 = "testnamespace2"; assertEquals("", client.defaultNamespace(creds)); assertEquals("accumulo", client.systemNamespace(creds)); Set<String> namespaceList = client.listNamespaces(creds); for (String ns : namespaceList) { System.out.println("Found NS: " + ns); } assertEquals(2, namespaceList.size()); assertEquals(2, client.namespaceIdMap(creds).size()); client.createNamespace(creds, testNamespace); assertTrue(client.namespaceExists(creds, testNamespace)); assertTrue(client.listNamespaces(creds).contains(testNamespace)); client.renameNamespace(creds, testNamespace, testNamespace2); assertTrue(client.namespaceExists(creds, testNamespace2)); assertFalse(client.namespaceExists(creds, testNamespace)); client.deleteNamespace(creds, testNamespace2); assertFalse(client.namespaceExists(creds, testNamespace2)); client.createNamespace(creds, testNamespace); String systemTableSplitThreshold = client.getSystemConfiguration(creds).get("table.split.threshold"); Map<String,String> orig = client.getNamespaceProperties(creds, testNamespace); client.setNamespaceProperty(creds, testNamespace, "table.split.threshold", "500M"); Map<String,String> update = client.getNamespaceProperties(creds, testNamespace); assertEquals(update.get("table.split.threshold"), "500M"); assertEquals(systemTableSplitThreshold, client.getSystemConfiguration(creds).get("table.split.threshold")); client.removeNamespaceProperty(creds, testNamespace, "table.split.threshold"); update = client.getNamespaceProperties(creds, testNamespace); assertEquals(orig, update); }
Source:
public void testUndefined() throws Exception { ModelNode node = new ModelNode(); node.get("result"); assertFalse(node, "result != undefined"); assertFalse(node, "result != \"undefined\""); assertFalse(node, "result != 'undefined'"); node.get("result").set("undefined"); assertFalse(node, "result != undefined"); }

Target:
public void testUndefined() throws Exception { ModelNode node = new ModelNode(); node.get("result"); assertFalse(node, "result != undefined"); assertTrue(node, "result != \"undefined\""); assertTrue(node, "result != 'undefined'"); node.get("result").set("undefined"); assertTrue(node, "result != undefined"); }
Source:
public boolean currentUserExists() { Authentication principal = SecurityContextHolder.getContext().getAuthentication(); if (Objects.isNull(principal)) { LOGGER.info("No current user"); return false; } Optional<AthenaProfile> optional = UserProfileUtil.getProfile(principal); return optional.isPresent() && Objects.nonNull(optional.get().getAthenaUser()); }

Target:
public boolean currentUserExists() { Authentication principal = SecurityContextHolder.getContext().getAuthentication(); if (Objects.isNull(principal) || "anonymousUser".equals(principal.getPrincipal())) { LOGGER.debug("No current user"); return false; } Optional<AthenaProfile> optional = UserProfileUtil.getProfile(principal); return optional.isPresent() && Objects.nonNull(optional.get().getAthenaUser()); }
Source:
private void chooseNames() { names.clearAnimation(); if (listState.getNumNames() > 0) { List<Integer> chosenIndexes = NameUtils.getRandomNumsInRange( settings.getNumNamesToChoose(), listState.getNumInstances() - 1); chosenNamesText = listState.chooseNames(chosenIndexes, settings); names.setAlpha(0.0f); names.setText(chosenNamesText); playSound(); } else { UIUtils.showLongToast(R.string.no_names_left, this); } }

Target:
private void chooseNames() { names.clearAnimation(); textToSpeechManager.stopSpeaking(); if (listState.getNumNames() > 0) { List<Integer> chosenIndexes = NameUtils.getRandomNumsInRange( settings.getNumNamesToChoose(), listState.getNumInstances() - 1); chosenNamesText = listState.chooseNames(chosenIndexes, settings); names.setAlpha(0.0f); names.setText(chosenNamesText); playSound(); } else { UIUtils.showLongToast(R.string.no_names_left, this); } }
Source:
public Set<byte[]> zRangeByScore(byte[] key, Range range, Limit limit) { Assert.notNull(range, "Range cannot be null for ZRANGEBYSCORE."); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getMin(), JedisConverters.toBytes("-inf")); byte[] max = JedisConverters.boundaryToBytesForZRange(range.getMax(), JedisConverters.toBytes("+inf")); try { if (isPipelined()) { if (limit != null) { pipeline(new JedisResult(pipeline.zrangeByScore(key, min, max, limit.getOffset(), limit.getCount()))); } else { pipeline(new JedisResult(pipeline.zrangeByScore(key, min, max))); } return null; } if (isQueueing()) { if (limit != null) { transaction(new JedisResult(transaction.zrangeByScore(key, min, max, limit.getOffset(), limit.getCount()))); } else { transaction(new JedisResult(transaction.zrangeByScore(key, min, max))); } return null; } if (limit != null) { return jedis.zrangeByScore(key, min, max, limit.getOffset(), limit.getCount()); } return jedis.zrangeByScore(key, min, max); } catch (Exception ex) { throw convertJedisAccessException(ex); } }

Target:
public Set<byte[]> zRangeByScore(byte[] key, Range range, Limit limit) { Assert.notNull(range, "Range cannot be null for ZRANGEBYSCORE."); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getMin(), JedisConverters.NEGATIVE_INFINITY_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRange(range.getMax(), JedisConverters.POSITIVE_INFINITY_BYTES); try { if (isPipelined()) { if (limit != null) { pipeline(new JedisResult(pipeline.zrangeByScore(key, min, max, limit.getOffset(), limit.getCount()))); } else { pipeline(new JedisResult(pipeline.zrangeByScore(key, min, max))); } return null; } if (isQueueing()) { if (limit != null) { transaction(new JedisResult(transaction.zrangeByScore(key, min, max, limit.getOffset(), limit.getCount()))); } else { transaction(new JedisResult(transaction.zrangeByScore(key, min, max))); } return null; } if (limit != null) { return jedis.zrangeByScore(key, min, max, limit.getOffset(), limit.getCount()); } return jedis.zrangeByScore(key, min, max); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
Source:
public Response labelsLabelIdDelete(String labelId, String ifMatch, String ifUnmodifiedSince) { try { APIAdmin apiAdmin = new APIAdminImpl(); String user = RestApiUtil.getLoggedInUsername(); apiAdmin.deleteLabel(user, labelId); return Response.ok().build(); } catch (APIManagementException e) { String errorMessage = "Error while deleting API : " + labelId; RestApiUtil.handleInternalServerError(errorMessage, log); } return null; }

Target:
public Response labelsLabelIdDelete(String labelId, String ifMatch, String ifUnmodifiedSince) { try { APIAdmin apiAdmin = new APIAdminImpl(); String user = RestApiUtil.getLoggedInUsername(); apiAdmin.deleteLabel(user, labelId); return Response.ok().build(); } catch (APIManagementException e) { String errorMessage = "Error while deleting label : " + labelId; RestApiUtil.handleInternalServerError(errorMessage, e, log); } return null; }
Source:
public WidgetInfos(StyledText textWidget, Canvas canvas) { maxLines= textWidget.getLineCount(); bounds= canvas.getBounds(); int w= 0; int i= 0; while (w < bounds.height && i < maxLines) { w+= JFaceTextUtil.computeLineHeight(textWidget, i); i++; } writable= w; ScrollBar verticalBar= textWidget.getVerticalBar(); if (verticalBar != null && !verticalBar.getVisible()) { int max= verticalBar.getMaximum(); double clientAreaHeight= textWidget.getClientArea().height; if (max > clientAreaHeight) { double percentage= clientAreaHeight / max; thumbHeight= (int) (bounds.height * percentage); } else { thumbHeight= bounds.height; } if (thumbHeight < 0) { thumbHeight= 0; } } else { thumbHeight= verticalBar != null ? Math.max(Math.min(bounds.height, verticalBar.getThumbBounds().height), 0) : 0; } int partialTopIndex= JFaceTextUtil.getPartialTopIndex(textWidget); int topLineHeight= textWidget.getLineHeight(textWidget.getOffsetAtLine(partialTopIndex)); int topLinePixel= textWidget.getLinePixel(partialTopIndex); double topIndex= partialTopIndex - (double) topLinePixel / topLineHeight; int partialBottomIndex= JFaceTextUtil.getPartialBottomIndex(textWidget); int bottomLineHeight= textWidget.getLineHeight(textWidget.getOffsetAtLine(partialBottomIndex)); int bottomLinePixel= textWidget.getLinePixel(partialBottomIndex); double bottomIndex= partialBottomIndex - ((double) bottomLinePixel - textWidget.getClientArea().height) / bottomLineHeight; visibleLines= bottomIndex - topIndex; invisibleLines= maxLines - visibleLines; }

Target:
public WidgetInfos(StyledText textWidget, Canvas canvas) { maxLines= textWidget.getLineCount(); bounds= canvas.getBounds(); int w= 0; for (int i= 0; i < maxLines && w < bounds.height; i++) { w+= JFaceTextUtil.computeLineHeight(textWidget, i); } writable= w; ScrollBar verticalBar= textWidget.getVerticalBar(); if (verticalBar != null && !verticalBar.getVisible()) { int max= verticalBar.getMaximum(); double clientAreaHeight= textWidget.getClientArea().height; if (max > clientAreaHeight) { double percentage= clientAreaHeight / max; thumbHeight= (int) (bounds.height * percentage); } else { thumbHeight= bounds.height; } if (thumbHeight < 0) { thumbHeight= 0; } } else { thumbHeight= verticalBar != null ? Math.max(Math.min(bounds.height, verticalBar.getThumbBounds().height), 0) : 0; } int partialTopIndex= JFaceTextUtil.getPartialTopIndex(textWidget); int topLineHeight= textWidget.getLineHeight(textWidget.getOffsetAtLine(partialTopIndex)); int topLinePixel= textWidget.getLinePixel(partialTopIndex); double topIndex= partialTopIndex - (double) topLinePixel / topLineHeight; int partialBottomIndex= JFaceTextUtil.getPartialBottomIndex(textWidget); int bottomLineHeight= textWidget.getLineHeight(textWidget.getOffsetAtLine(partialBottomIndex)); int bottomLinePixel= textWidget.getLinePixel(partialBottomIndex); double bottomIndex= partialBottomIndex - ((double) bottomLinePixel - textWidget.getClientArea().height) / bottomLineHeight; visibleLines= bottomIndex - topIndex; invisibleLines= maxLines - visibleLines; }
Source:
private Map<String, String> getBundle(String serviceName) { ResourceLoader rb = new ResourceLoader("org.sakaiproject.feedback"); Map<String, String> bundleMap = new HashMap<String, String>(); for (Object key : rb.keySet()) { bundleMap.put((String) key, rb.getString((String) key)); } formatProperties(rb, bundleMap, serviceName); return bundleMap; }

Target:
private Map<String, String> getBundle(String serviceName) { Map<String, String> bundleMap = new HashMap<String, String>(); for (Object key : rb.keySet()) { bundleMap.put((String) key, rb.getString((String) key)); } formatProperties(rb, bundleMap, serviceName); return bundleMap; }
Source:
public List<Checksum> convertToEntityAttribute(String checksumString) { List<Checksum> cs = new ArrayList<>(); if (checksumString != null && !checksumString.isEmpty()) { String[] checksumsArray = checksumString.split(","); try { for (String s : checksumsArray) { cs.add(new Checksum(s.split(":")[0].trim(), s.split(":")[1].trim())); } return cs; } catch (ArrayIndexOutOfBoundsException ex) { LOG.error("Could not parse checksum(s) " + checksumString, ex); return null; } } return null; }

Target:
public List<Checksum> convertToEntityAttribute(String checksumString) { List<Checksum> cs = new ArrayList<>(); if (StringUtils.isNotEmpty(checksumString)) { String[] checksumsArray = checksumString.split(","); try { for (String s : checksumsArray) { cs.add(new Checksum(s.split(":")[0].trim(), s.split(":")[1].trim())); } return cs; } catch (ArrayIndexOutOfBoundsException ex) { LOG.error("Could not parse checksum(s) " + checksumString, ex); return null; } } return null; }
Source:
protected List<Edge> getEdgeList(DDiagram representation) { List<Edge> edges = new ArrayList<Edge>(); for (Iterator<EObject> iterator = representation.eAllContents(); iterator.hasNext(); ) { EObject element = iterator.next(); if (element instanceof Edge) { edges.add((Edge) element); } } return edges; }

Target:
protected List<Edge> getEdgeList(DDiagram representation) { List<Edge> edges = new ArrayList<Edge>(); TreeIterator<EObject> eAllContents = representation.eAllContents(); while (eAllContents.hasNext()) { EObject element = eAllContents.next(); if (element instanceof Edge) { edges.add((Edge) element); eAllContents.prune(); } } return edges; }
Source:
public WebTargetGraphiteClient(WebTarget webTarget) { this.webTarget = webTarget .path("render") .queryParam("from", "-5minutes") .queryParam("until", "-2minutes") .queryParam("format", "json"); }

Target:
public WebTargetGraphiteClient(WebTarget webTarget) { this.webTarget = webTarget .path("render") .queryParam("from", "-5minutes") .queryParam("until", "-1minutes") .queryParam("format", "json"); }
Source:
public final int parseArguments(final Parameters params) throws CmdLineException { final String token = params.getParameter(0); final String[] tokens = token.split(","); if (tokens.length != 3) { throw new CmdLineException(owner, "change should be specified as " + "<project>,<branch>,<change-id>"); } Change.Key key; try { key = Change.Key.parse(tokens[2]); for (Change change : db.changes().byKeyRange(key, key.max())) { if (change.getProject().get().equals(tokens[0]) && change.getDest().getShortName().equals(tokens[1])) { setter.addValue(change.getId()); return 1; } throw new CmdLineException(owner, change.getDest().get() + " " + change.getProject().get()); } } catch (IllegalArgumentException e) { throw new CmdLineException(owner, "Change-Id is not valid"); } catch (OrmException e) { throw new CmdLineException(owner, "Database error: " + e.getMessage()); } throw new CmdLineException(owner, "\"" + token + "\": change not found"); }

Target:
public final int parseArguments(final Parameters params) throws CmdLineException { final String token = params.getParameter(0); final String[] tokens = token.split(","); if (tokens.length != 3) { throw new CmdLineException(owner, "change should be specified as " + "<project>,<branch>,<change-id>"); } try { final Change.Key key = Change.Key.parse(tokens[2]); for (final Change change : db.changes().byKey(key)) { if (change.getProject().get().equals(tokens[0]) && change.getDest().getShortName().equals(tokens[1])) { setter.addValue(change.getId()); return 1; } } } catch (IllegalArgumentException e) { throw new CmdLineException(owner, "Change-Id is not valid"); } catch (OrmException e) { throw new CmdLineException(owner, "Database error: " + e.getMessage()); } throw new CmdLineException(owner, "\"" + token + "\": change not found"); }
Source:
protected void startTraceJaegerListener(String strPort, ReportableEntityHandlerFactory handlerFactory, @Nullable WavefrontSender wfSender, Sampler sampler) { if (tokenAuthenticator.authRequired()) { logger.warning("Port: " + strPort + " is not compatible with HTTP authentication, ignoring"); return; } startAsManagedThread(() -> { activeListeners.inc(); try { TChannel server = new TChannel.Builder("jaeger-collector"). setServerPort(Integer.valueOf(strPort)). build(); server. makeSubChannel("jaeger-collector", Connection.Direction.IN). register("Collector::submitBatches", new JaegerTChannelCollectorHandler(strPort, handlerFactory, wfSender, traceDisabled::get, spanLogsDisabled::get, preprocessors.get(strPort), sampler, traceAlwaysSampleErrors, traceJaegerApplicationName, traceDerivedCustomTagKeys)); server.listen().channel().closeFuture().sync(); server.shutdown(false); } catch (InterruptedException e) { logger.info("Listener on port " + strPort + " shut down."); } catch (Exception e) { logger.log(Level.SEVERE, "Jaeger trace collector exception", e); } finally { activeListeners.dec(); } }, "listener-jaeger-thrift-" + strPort); logger.info("listening on port: " + strPort + " for trace data (Jaeger format over TChannel)"); }

Target:
protected void startTraceJaegerListener(String strPort, ReportableEntityHandlerFactory handlerFactory, @Nullable WavefrontSender wfSender, Sampler sampler) { if (tokenAuthenticator.authRequired()) { logger.warning("Port: " + strPort + " is not compatible with HTTP authentication, ignoring"); return; } startAsManagedThread(() -> { activeListeners.inc(); try { TChannel server = new TChannel.Builder("jaeger-collector"). setServerPort(Integer.valueOf(strPort)). build(); server. makeSubChannel("jaeger-collector", Connection.Direction.IN). register("Collector::submitBatches", new JaegerTChannelCollectorHandler(strPort, handlerFactory, wfSender, traceDisabled::get, spanLogsDisabled::get, preprocessors.get(strPort), sampler, traceAlwaysSampleErrors, traceJaegerApplicationName, traceDerivedCustomTagKeys)); server.listen().channel().closeFuture().sync(); server.shutdown(false); } catch (InterruptedException e) { logger.info("Listener on port " + strPort + " shut down."); } catch (Exception e) { logger.log(Level.SEVERE, "Jaeger trace collector exception", e); } finally { activeListeners.dec(); } }, "listener-jaeger-tchannel-" + strPort); logger.info("listening on port: " + strPort + " for trace data (Jaeger format over TChannel)"); }
Source:
public Response getNoArgs() { return Response.status(Response.Status.BAD_REQUEST.getStatusCode()).entity(new ErrorResponse(Response.Status.BAD_REQUEST.getStatusCode(), "path /{userID} required")).build(); }

Target:
public Response getNoArgs() { return Response.status(Response.Status.BAD_REQUEST).entity(new ErrorResponse(Response.Status.BAD_REQUEST.getStatusCode(), "path /{userID} required")).build(); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Member)) { return false; } if (!getClass().equals(obj.getClass())) { return false; } Member other = (Member) obj; return getId() == other.getId(); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Member)) { return false; } Member other = (Member) obj; return getId() == other.getId(); }
Source:
private void updateStartStopMenuItemState() { if (mMenuItemStartStop == null) { return; } MainApp app = (MainApp) getApplication(); if (app == null) { return; } ClientStumblerService svc = app.getService(); if (svc == null) { return; } boolean isScanning = svc.isScanning(); if (isScanning) { keepScreenOnChanged(ClientPrefs.getInstance().getKeepScreenOn()); } else { keepScreenOnChanged(false); } if (Build.VERSION.SDK_INT >= 11) { Switch s = (Switch) mMenuItemStartStop.getActionView(); s.setOnCheckedChangeListener(null); if (isScanning && !s.isChecked()) { s.setChecked(true); } else if (!isScanning && s.isChecked()) { s.setChecked(false); } s.setOnCheckedChangeListener(mStartStopButtonListener); } else { boolean buttonStateIsScanning = mMenuItemStartStop.getTitle().equals(getString(R.string.stop_scanning)); if (isScanning && !buttonStateIsScanning) { mMenuItemStartStop.setIcon(android.R.drawable.ic_media_pause); mMenuItemStartStop.setTitle(R.string.stop_scanning); } else if (!isScanning && buttonStateIsScanning) { mMenuItemStartStop.setIcon(android.R.drawable.ic_media_play); mMenuItemStartStop.setTitle(R.string.start_scanning); } } mMapFragment.dimToolbar(); }

Target:
private void updateStartStopMenuItemState() { if (mMenuItemStartStop == null) { return; } MainApp app = (MainApp) getApplication(); if (app == null) { return; } ClientStumblerService svc = app.getService(); if (svc == null) { return; } boolean isScanning = svc.isScanning(); if (isScanning) { keepScreenOn(ClientPrefs.getInstance().getKeepScreenOn()); } else { keepScreenOn(false); } if (Build.VERSION.SDK_INT >= 11) { Switch s = (Switch) mMenuItemStartStop.getActionView(); s.setOnCheckedChangeListener(null); if (isScanning && !s.isChecked()) { s.setChecked(true); } else if (!isScanning && s.isChecked()) { s.setChecked(false); } s.setOnCheckedChangeListener(mStartStopButtonListener); } else { boolean buttonStateIsScanning = mMenuItemStartStop.getTitle().equals(getString(R.string.stop_scanning)); if (isScanning && !buttonStateIsScanning) { mMenuItemStartStop.setIcon(android.R.drawable.ic_media_pause); mMenuItemStartStop.setTitle(R.string.stop_scanning); } else if (!isScanning && buttonStateIsScanning) { mMenuItemStartStop.setIcon(android.R.drawable.ic_media_play); mMenuItemStartStop.setTitle(R.string.start_scanning); } } mMapFragment.dimToolbar(); }
Source:
protected Query doToQuery(QueryShardContext context) { final List<String> fields; if (this.fields == null) { fields = Collections.singletonList(context.defaultFields().get(0)); } else { fields = Arrays.stream(this.fields) .filter(x -> context.fieldMapper(x) != null) .filter(x -> context.fieldMapper(x).tokenized()) .filter(x -> SUPPORTED_TYPES.contains(context.fieldMapper(x).typeName())) .map(x -> context.fieldMapper(x).name()) .collect(Collectors.toList()); if (fields.isEmpty()) { throw new QueryShardException(context, "fuzzy_like_this all provided fields are unknown or not tonized"); } if (failOnUnsupportedField && fields.size() != this.fields.length) { List<String> unsupportedFields = Stream.of(this.fields) .filter(x -> !fields.contains(x)) .collect(Collectors.toList()); throw new QueryShardException(context, "fuzzy_like_this some fields are either unknown/untokenized/non-text: {}", unsupportedFields); } } final Analyzer analyzer; if (this.analyzer == null) { analyzer = context.getMapperService().searchAnalyzer(); } else { analyzer = context.getMapperService().getIndexAnalyzers().get(this.analyzer); } FuzzyLikeThisQuery query = new FuzzyLikeThisQuery(maxQueryTerms, analyzer); int maxDist = fuzziness.asDistance(); for (String field : fields) { query.addTerms(likeText, field, maxDist, prefixLength); } query.setIgnoreTF(ignoreTF); return query; }

Target:
protected Query doToQuery(QueryShardContext context) { final List<String> fields; if (this.fields == null) { fields = context.defaultFields(); } else { fields = Arrays.stream(this.fields) .filter(x -> context.fieldMapper(x) != null) .filter(x -> context.fieldMapper(x).tokenized()) .filter(x -> SUPPORTED_TYPES.contains(context.fieldMapper(x).typeName())) .map(x -> context.fieldMapper(x).name()) .collect(Collectors.toList()); if (fields.isEmpty()) { throw new QueryShardException(context, "fuzzy_like_this all provided fields are unknown or not tonized"); } if (failOnUnsupportedField && fields.size() != this.fields.length) { List<String> unsupportedFields = Stream.of(this.fields) .filter(x -> !fields.contains(x)) .collect(Collectors.toList()); throw new QueryShardException(context, "fuzzy_like_this some fields are either unknown/untokenized/non-text: {}", unsupportedFields); } } final Analyzer analyzer; if (this.analyzer == null) { analyzer = context.getMapperService().searchAnalyzer(); } else { analyzer = context.getMapperService().getIndexAnalyzers().get(this.analyzer); } FuzzyLikeThisQuery query = new FuzzyLikeThisQuery(maxQueryTerms, analyzer); int maxDist = fuzziness.asDistance(); for (String field : fields) { query.addTerms(likeText, field, maxDist, prefixLength); } query.setIgnoreTF(ignoreTF); return query; }
Source:
public void onUserSelectionChange(){ String text = scriptPanel.getText().trim(); if (!text.isEmpty()) { executeAction.setEnabled(true); clearAction.setEnabled(true); saveAction.setEnabled(true); findAction.setEnabled(true); } else{ executeAction.setEnabled(false); clearAction.setEnabled(false); saveAction.setEnabled(false); findAction.setEnabled(false); } }

Target:
public void onUserSelectionChange(){ String text = scriptPanel.getText().trim(); if (text.isEmpty()) { executeAction.setEnabled(false); clearAction.setEnabled(false); saveAction.setEnabled(false); findAction.setEnabled(false); } else{ executeAction.setEnabled(true); clearAction.setEnabled(true); saveAction.setEnabled(true); findAction.setEnabled(true); } }
Source:
private static void findRightPlace() { if (allafterdeclarations == null || alldefinitionsoutside == null) return; for(ICPPASTFunctionDeclarator decl: allafterdeclarations) { String decl_name = decl.getName().toString(); for(ICPPASTFunctionDefinition def: alldefinitionsoutside) { String def_name = null; if (def.getDeclarator().getName() instanceof ICPPASTQualifiedName) { ICPPASTQualifiedName qname = (ICPPASTQualifiedName) def.getDeclarator().getName(); def_name = qname.getAllSegments()[1].toString(); } else if (def.getDeclarator().getName() instanceof CPPASTName) { def_name = def.getDeclarator().getName().toString(); } if (decl_name.equals(def_name)) { if (def.getParent() != null && def.getParent() instanceof ICPPASTTemplateDeclaration) { position = (IASTDeclaration) def.getParent(); } else { position = def; } return; } } } }

Target:
private static void findRightPlace() { if (allafterdeclarations == null || alldefinitionsoutside == null) return; for(ICPPASTFunctionDeclarator decl: allafterdeclarations) { String decl_name = decl.getName().toString(); for(ICPPASTFunctionDefinition def: alldefinitionsoutside) { String def_name = null; IASTName name = def.getDeclarator().getName(); if (name != null) def_name = name.getLastName().toString(); if (decl_name.equals(def_name)) { if (def.getParent() != null && def.getParent() instanceof ICPPASTTemplateDeclaration) { position = (IASTDeclaration) def.getParent(); } else { position = def; } return; } } } }
Source:
public boolean isOpen() { return (open.get() && !closing.get()) || opening.get(); }

Target:
public boolean isOpen() { return (open.get() && !closing.get()); }
Source:
private static boolean isDynamicallyGenerated(ExpressionTree tree) { if (tree.is(Tree.Kind.IDENTIFIER)) { Symbol symbol = ((IdentifierTree) tree).symbol(); VariableTree declaration = ((Symbol.VariableSymbol) symbol).declaration(); return declaration != null && (isSecureRandomGenerateSeed(declaration.initializer()) || getReassignments(symbol.declaration(), symbol.usages()).stream() .map(AssignmentExpressionTree::expression) .anyMatch(CipherBlockChainingCheck::isSecureRandomGenerateSeed)); } else { return isSecureRandomGenerateSeed(tree); } }

Target:
private static boolean isDynamicallyGenerated(ExpressionTree tree) { if (tree.is(Tree.Kind.IDENTIFIER)) { Symbol symbol = ((IdentifierTree) tree).symbol(); if (!symbol.isVariableSymbol()) { return false; } VariableTree declaration = ((Symbol.VariableSymbol) symbol).declaration(); return declaration != null && (isSecureRandomGenerateSeed(declaration.initializer()) || getReassignments(declaration, symbol.usages()).stream() .map(AssignmentExpressionTree::expression) .anyMatch(CipherBlockChainingCheck::isSecureRandomGenerateSeed)); } else { return isSecureRandomGenerateSeed(tree); } }
Source:
protected boolean readElement(IConfigurationElement element, boolean add) { String tagName = element.getName(); if (tagName.equals(TAG_PROFILE) || tagName.equals(TAG_PACKAGE)) { Map<String, URI> uriToLocationMap = tagName.equals(TAG_PROFILE) ? ePackageNsURIToProfileLocationMap : ePackageNsURIToPackageLocationMap; String uri = element.getAttribute(ATT_URI); if (uri == null) { logMissingAttribute(element, ATT_URI); } else if (add) { if (uriToLocationMap != null) { String location = element.getAttribute(ATT_LOCATION); if (location != null) { URI profileLocation = URI.createURI(location); if (profileLocation.isRelative()) { profileLocation = URI.createPlatformPluginURI( element.getDeclaringExtension() .getContributor().getName() + '/' + location, false); } uriToLocationMap.put(uri, profileLocation); } } return true; } else { uriToLocationMap.remove(uri); return true; } } return false; }

Target:
protected boolean readElement(IConfigurationElement element, boolean add) { String tagName = element.getName(); if (tagName.equals(TAG_PROFILE) || tagName.equals(TAG_PACKAGE)) { String uri = element.getAttribute(ATT_URI); if (uri == null) { logMissingAttribute(element, ATT_URI); } else if (add) { String location = element.getAttribute(ATT_LOCATION); if (location != null) { URI profileLocation = URI.createURI(location); if (profileLocation.isRelative()) { profileLocation = URI.createPlatformPluginURI( element.getDeclaringExtension() .getContributor().getName() + '/' + location, false); } if (ePackageNsURIToPackageLocationMap != null){ ePackageNsURIToPackageLocationMap.put(uri, profileLocation); } if (tagName.equals(TAG_PROFILE)) { ePackageNsURIToProfileLocationMap.put(uri, profileLocation); } } return true; } else { if (ePackageNsURIToPackageLocationMap != null) { ePackageNsURIToPackageLocationMap.remove(uri); } if (tagName.equals(TAG_PROFILE)) { ePackageNsURIToProfileLocationMap.remove(uri); } return true; } } return false; }
Source:
public boolean getWarningOnLostOrRestoredSignal(){ return prefs.getBoolean("tts_lost_signal", DEFAULT_TTS_WARN_LOST_SIGNAL); }

Target:
public boolean getWarningOnLostOrRestoredSignal(){ return prefs.getBoolean(context.getString(R.string.pref_tts_warning_lost_signal_key), DEFAULT_TTS_WARNING_LOST_SIGNAL); }
Source:
private DebtRemediationFunction remediationFunction(DebtRemediationFunctions drf) { if (func.startsWith("Constant")) { return drf.constantPerIssue(constantCost.replace("mn", "min")); } if ("Linear".equals(func)) { return drf.linear(linearFactor.replace("mn", "min")); } return drf.linearWithOffset(linearFactor.replace("mn", "min"), linearOffset.replace("mn", "min")); }

Target:
private DebtRemediationFunction remediationFunction(DebtRemediationFunctions drf) { if (func.startsWith("Constant")) { return drf.constantPerIssue(constantCost); } if ("Linear".equals(func)) { return drf.linear(linearFactor); } return drf.linearWithOffset(linearFactor, linearOffset); }
Source:
private void addToUnsecuredCookies(AssignmentExpressionTree assignment) { if (assignment.expression().is(Tree.Kind.NEW_CLASS) && assignment.variable().is(Tree.Kind.IDENTIFIER)) { IdentifierTree identifier = (IdentifierTree) assignment.variable(); boolean isMethodVariable = identifier.symbol().isVariableSymbol() && identifier.symbol().owner().isMethodSymbol(); boolean isMatchedType = isCookieClass(identifier.symbolType()) || isCookieClass(assignment.expression().symbolType()); if (isMethodVariable && isMatchedType && isSecureParamFalse((NewClassTree) assignment.expression())) { unsecuredCookies.add((Symbol.VariableSymbol) ((IdentifierTree) assignment.variable()).symbol()); } } }

Target:
private void addToUnsecuredCookies(AssignmentExpressionTree assignment) { if (assignment.expression().is(Tree.Kind.NEW_CLASS) && assignment.variable().is(Tree.Kind.IDENTIFIER)) { IdentifierTree assignmentVariable = (IdentifierTree) assignment.variable(); Symbol assignmentVariableSymbol = assignmentVariable.symbol(); boolean isMethodVariable = assignmentVariableSymbol.isVariableSymbol() && assignmentVariableSymbol.owner().isMethodSymbol(); boolean isMatchedType = isCookieClass(assignmentVariable.symbolType()) || isCookieClass(assignment.expression().symbolType()); if (isMethodVariable && isMatchedType && isSecureParamFalse((NewClassTree) assignment.expression())) { unsecuredCookies.add((Symbol.VariableSymbol) assignmentVariableSymbol); } } }
Source:
private static PRPAIN201306UV02MFMIMT700711UV01RegistrationEvent createRegEvent(Patient patient, PRPAIN201305UV02 query) { II id = new II(); id.getNullFlavor().add("NA"); CS statusCode = new CS(); statusCode.setCode("active"); PRPAIN201306UV02MFMIMT700711UV01RegistrationEvent regEvent = new PRPAIN201306UV02MFMIMT700711UV01RegistrationEvent(); regEvent.getMoodCode().add("EVN"); regEvent.getClassCode().add("REG"); regEvent.getId().add(id); regEvent.setStatusCode(statusCode); regEvent.setSubject1(createSubject1(patient, query)); return regEvent; }

Target:
private static PRPAIN201306UV02MFMIMT700711UV01RegistrationEvent createRegEvent(Patient patient, PRPAIN201305UV02 query) { II id = new II(); id.getNullFlavor().add(NA); CS statusCode = new CS(); statusCode.setCode(STATUS_CD); PRPAIN201306UV02MFMIMT700711UV01RegistrationEvent regEvent = new PRPAIN201306UV02MFMIMT700711UV01RegistrationEvent(); regEvent.getMoodCode().add(REG_MOOD_CODE); regEvent.getClassCode().add(REG_CLASS_CODE); regEvent.getId().add(id); regEvent.setStatusCode(statusCode); regEvent.setSubject1(createSubject1(patient, query)); return regEvent; }
Source:
private void waitForTerminateInstances(Long stackId, List<String> instanceIds, AmazonEC2Client amazonEC2Client) { LOGGER.debug("Polling instance until terminated. [stack: {}, instances: {}]", stackId, instanceIds); Waiter<DescribeInstancesRequest> instanceTerminatedWaiter = amazonEC2Client.waiters().instanceTerminated(); DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest().withInstanceIds(instanceIds); StackCancellationCheck stackCancellationCheck = new StackCancellationCheck(stackId); run(instanceTerminatedWaiter, describeInstancesRequest, stackCancellationCheck, "Instances termination failed"); }

Target:
private void waitForTerminateInstances(Long stackId, List<String> instanceIds, AmazonEC2Client amazonEC2Client) { LOGGER.debug("Polling instance until terminated. [stack: {}, instances: {}]", stackId, instanceIds); Waiter<DescribeInstancesRequest> instanceTerminatedWaiter = amazonEC2Client.waiters().instanceTerminated(); DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest().withInstanceIds(instanceIds); StackCancellationCheck stackCancellationCheck = new StackCancellationCheck(stackId); run(instanceTerminatedWaiter, describeInstancesRequest, stackCancellationCheck, String.format("There was an error when application are deleting instances", String.join(",", instanceIds))); }
Source:
public ViewModelFactory(ArrayMap<Class<? extends ViewModel>, Provider<ViewModel>> viewModelsMap) { this.mViewModelsMap = viewModelsMap; }

Target:
ViewModelFactory(ArrayMap<Class<? extends ViewModel>, Provider<ViewModel>> viewModelsMap) { this.mViewModelsMap = viewModelsMap; }
Source:
public void collectWithParamsForEachTest() throws IOException { List<TagWithParams> tagsWithParams = getTagsWithParameters("{{#each items as |item|}}{{i18n item}}{{/each}}"); assertEquals(tagsWithParams.size(), 1); TagWithParams tagWithParams = tagsWithParams.get(0); assertEquals(tagWithParams.getTagType(), TagType.VAR); assertEquals(tagWithParams.getTag(), "i18n"); assertEquals(tagWithParams.getParams().size(), 1); Param param = tagWithParams.getParams().get(0); RefParam refParam = (RefParam) param; assertEquals(refParam.toString(), "item"); }

Target:
public void collectWithParamsForEachTest() throws IOException { List<Tag> tagsWithParams = getTagsWithParameters("{{#each shoppingCartItems as |item|}}{{i18n item}}{{/each}}"); assertEquals(tagsWithParams.size(), 2); Tag i18NTag = tagsWithParams.get(0); System.out.println("i18nTag.getParams() is "+ i18NTag.getParams()); assertEquals(i18NTag.getTagType(), TagType.VAR); assertEquals(i18NTag.getTag(), "i18n"); assertEquals(i18NTag.getParams().size(), 1); Param i18nParam = i18NTag.getParams().get(0); RefParam i18nRefParam = (RefParam) i18nParam; assertEquals(i18nRefParam.toString(), "item"); Tag eachTag = tagsWithParams.get(1); assertEquals(eachTag.getTagType(), TagType.SECTION); assertEquals(eachTag.getTag(), "each"); assertEquals(eachTag.getParams().size(), 2); System.out.println("eachTag.getParams() is "+ eachTag.getParams()); Param param1 = eachTag.getParams().get(0); RefParam refParam1 = (RefParam) param1; assertEquals(refParam1.toString(), "item"); Param param2 = eachTag.getParams().get(1); RefParam refParam2 = (RefParam) param2; assertEquals(refParam2.toString(), "shoppingCartItems"); }
Source:
public List<String> getUntrackedFolders() { return ((indexDiffFilter == null) ? Collections.<String>emptyList() : indexDiffFilter.getUntrackedFolders()); }

Target:
public Set<String> getUntrackedFolders() { return ((indexDiffFilter == null) ? Collections.<String> emptySet() : new HashSet<String>(indexDiffFilter.getUntrackedFolders())); }
Source:
public Object prepare(final Object value) { if (value == null || value instanceof String || !stringify) { return value; } else { if (value instanceof Boolean) { return PREFIX_BOOLEAN + value; } else if (value instanceof Integer) { return PREFIX_INT + value; } else if (value instanceof Long) { return PREFIX_LONG + value; } else if (value instanceof Date) { return PREFIX_DATE + newSdf().format((Date) value); } else if (value instanceof URI) { return PREFIX_URI + value.toString(); } else { return PREFIX_SB64 + serializationHelper.serializeToBase64((Serializable) value); } } }

Target:
public Object prepare(final Object value) { if (value == null || value instanceof String || !stringify) { return value; } else { if (value instanceof Boolean) { return PREFIX_BOOLEAN.concat(value.toString()); } else if (value instanceof Integer) { return PREFIX_INT.concat(value.toString()); } else if (value instanceof Long) { return PREFIX_LONG.concat(value.toString()); } else if (value instanceof Date) { return PREFIX_DATE.concat(newSdf().format((Date) value)); } else if (value instanceof URI) { return PREFIX_URI.concat(value.toString()); } else { return PREFIX_SB64.concat(serializationHelper.serializeToBase64((Serializable) value)); } } }
Source:
public ProfileConfiguration getProfileConfig(String profileName) throws UserStoreException { if (profileName != null) { return profileConfigs.get(profileName); } else { return null; } }

Target:
public ProfileConfiguration getProfileConfig(String profileName) throws UserStoreException { if (profileName != null) { return profileConfigs.get(profileName); } else { throw new UserStoreException("profileName value is null."); } }
Source:
public void deleteRootOfTheModel() { final List<EObject> selectedElement = new ArrayList<EObject>(); selectedElement.add(getRootOfTheModel()); getModelExplorerView().revealSemanticElement(selectedElement); RunnableWithResult<IWorkbenchPart> runnable; Display.getDefault().syncExec(runnable = new RunnableWithResult.Impl<IWorkbenchPart>() { public void run() { try { IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IWorkbenchPart activePart = activePage.getActivePart(); setResult(activePart); setStatus(Status.OK_STATUS); } catch (Exception ex) { setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, ex.getMessage())); } } }); Assert.assertEquals(runnable.getStatus().getMessage(), IStatus.OK, runnable.getStatus().getSeverity()); IWorkbenchPart activePart = runnable.getResult(); Assert.assertTrue("The active part is not the ModelExplorer", activePart instanceof ModelExplorerPageBookView); final IStructuredSelection currentSelection = getCurrentSelection(); Assert.assertEquals("Only one element should be selected", currentSelection.size(), 1); Object obj = currentSelection.getFirstElement(); obj = EMFHelper.getEObject(obj); Assert.assertSame(getRootOfTheModel(), obj); final IHandler currentHandler = getActiveHandler(); if (currentHandler == null) { } else { Assert.assertFalse("We can delete the root of the model. It is not the wanted behavior", currentHandler.isEnabled()); } }

Target:
public void deleteRootOfTheModel() { final List<EObject> selectedElement = new ArrayList<EObject>(); selectedElement.add(getRootOfTheModel()); getModelExplorerView().revealSemanticElement(selectedElement); IWorkbenchPart activePart = WorkbenchPartHelper.getCurrentActiveWorkbenchPart(); Assert.assertNotNull("The active part could not be retrieved.", activePart); Assert.assertTrue("The active part is not the ModelExplorer", activePart instanceof ModelExplorerPageBookView); final IStructuredSelection currentSelection = getCurrentSelection(); Assert.assertEquals("Only one element should be selected", currentSelection.size(), 1); Object obj = currentSelection.getFirstElement(); obj = EMFHelper.getEObject(obj); Assert.assertSame(getRootOfTheModel(), obj); final IHandler currentHandler = getActiveHandler(); if (currentHandler == null) { } else { Assert.assertFalse("We can delete the root of the model. It is not the wanted behavior", currentHandler.isEnabled()); } }
Source:
public Calendar getCalendarService(Credential credential) throws GeneralSecurityException, IOException { HttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport(); return new Calendar.Builder( HTTP_TRANSPORT, JSON_FACTORY, credential) .setApplicationName(APPLICATION_NAME) .build(); }

Target:
public Calendar getCalendarService(Credential credential) throws GeneralSecurityException, IOException { HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); return new Calendar.Builder(httpTransport, JSON_FACTORY, credential) .setApplicationName(APPLICATION_NAME) .build(); }
Source:
private static Object[][] failsWithoutWrappers(){ return new Object[][] { {MANGLED_VCF, VCF_INDEX, new VCFCodec()}, {VCF, MANGLED_VCF_INDEX, new VCFCodec()}, }; }

Target:
private static Object[][] failsWithoutWrappers(){ return new Object[][] { {MANGLED_VCF, MANGLED_VCF_INDEX}, {VCF, MANGLED_VCF_INDEX}, {MANGLED_VCF, VCF_INDEX}, {MANGLED_VCF_TABIX_BLOCK_GZIPPED, MANGLED_VCF_TABIX_INDEX}, {VCF_TABIX_BLOCK_GZIPPED, MANGLED_VCF_TABIX_INDEX}, {MANGLED_VCF_TABIX_BLOCK_GZIPPED, VCF_TABIX_INDEX}, }; }
Source:
public Object register(Object obj, Runnable action) { try { Object cleaner = createMtd.invoke(null); registerMtd.invoke(cleaner, obj, action); return cleaner; } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); throw new RuntimeException("Reflection failure: invoke java.lang.ref.Cleaner method failed", e); } }

Target:
public Object register(Object obj, Runnable action) { try { Object cleaner = createMtd.invoke(null); registerMtd.invoke(cleaner, obj, action); return cleaner; } catch (IllegalAccessException | InvocationTargetException e) { throw new RuntimeException("Reflection failure: invoke java.lang.ref.Cleaner method failed", e); } }