auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DeviceStatusBreakdown getDeviceStatusBreakdown(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken) { final Jedis jedis = jedisPool.getResource(); final DateTime currentTs = DateTime.now(DateTimeZone.UTC); Long normalCount = 0L; try { normalCount = jedis.zcount("devices", currentTs.minusDays(1).getMillis(), currentTs.getMillis()); } catch (Exception e) { LOGGER.error("Failed to get active senses count", e.getMessage()); } finally { jedisPool.returnResource(jedis); } return new DeviceStatusBreakdown(normalCount, -1L, -1L); }

Target:
public DeviceStatusBreakdown getDeviceStatusBreakdown(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken) { final Jedis jedis = jedisPool.getResource(); final DateTime currentTs = DateTime.now(DateTimeZone.UTC); Long normalCount = 0L; try { normalCount = jedis.zcount("devices", currentTs.minusDays(1).getMillis(), currentTs.getMillis()); } catch (Exception e) { LOGGER.error("Failed to get active senses count because {}", e.getMessage()); } finally { jedisPool.returnResource(jedis); } return new DeviceStatusBreakdown(normalCount, -1L, -1L); }
Source:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); ChoiceColor choice = new ChoiceColor(); if (controller != null && controller.choose(outcome, choice, game)) { FilterCreaturePermanent filter = new FilterCreaturePermanent(choice.getColor().getDescription()+" creatures"); filter.add(new ColorPredicate(choice.getColor())); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { int amount = game.getBattlefield().countAll(filter , playerId, game); if (amount > 0) { Player player = game.getPlayer(playerId); if (player != null) { player.damage(amount, source.getSourceId(), game, false, true); } } } return true; } return false; }

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); ChoiceColor choice = new ChoiceColor(); if (controller != null && controller.choose(outcome, choice, game) && choice.getColor() != null) { FilterCreaturePermanent filter = new FilterCreaturePermanent(choice.getColor().getDescription()+" creatures"); filter.add(new ColorPredicate(choice.getColor())); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { int amount = game.getBattlefield().countAll(filter , playerId, game); if (amount > 0) { Player player = game.getPlayer(playerId); if (player != null) { player.damage(amount, source.getSourceId(), game, false, true); } } } return true; } return false; }
Source:
private void fillTableHeaders(List<DataColumn> columns) { for (int i = 0; i < columns.size(); i++) { TableColumn<ObservableList<StringProperty>, String> fxColumn = createColumn(i, columns.get(i).getName()); fxColumn.setPrefWidth(100); tableView.getColumns().add(fxColumn); } }

Target:
private void fillTableHeaders(List<DataColumn> columns) { for (int i = 0; i < columns.size(); i++) { TableColumn<ObservableList<StringProperty>, String> fxColumn = createColumn(i, columns.get(i).getName()); fxColumn.getStyleClass().add("table-column"); tableView.getColumns().add(fxColumn); } }
Source:
DeploymentHandlerUtil.ContentItem addFromContentAdditionParameter(OperationContext context, ModelNode contentItemNode, String name) throws OperationFailedException { byte[] hash; InputStream in = getInputStream(context, contentItemNode); InputStream transformed = null; try { try { transformed = deploymentTransformer == null ? in : deploymentTransformer.transform(in, name); hash = contentRepository.addContent(transformed); } catch (IOException e) { throw createFailureException(e.toString()); } catch(Throwable t) { InputStream originalInput = getInputStream(context, contentItemNode); try { hash = contentRepository.addContent(originalInput); } catch (IOException e){ throw createFailureException(e.toString()); } finally { StreamUtils.safeClose(originalInput); } } } finally { StreamUtils.safeClose(in); StreamUtils.safeClose(transformed); } return new DeploymentHandlerUtil.ContentItem(hash); }

Target:
DeploymentHandlerUtil.ContentItem addFromContentAdditionParameter(OperationContext context, ModelNode contentItemNode, String name) throws OperationFailedException { byte[] hash; InputStream in = getInputStream(context, contentItemNode); InputStream transformed = null; try { try { transformed = deploymentTransformer == null ? in : doTransformation(context, contentItemNode, name, in); hash = contentRepository.addContent(transformed); } catch (IOException e) { throw createFailureException(e.toString()); } } finally { StreamUtils.safeClose(in); StreamUtils.safeClose(transformed); } return new DeploymentHandlerUtil.ContentItem(hash); }
Source:
private Function<PollingContext<OperationResult>, Mono<OperationResult>> streamActivationOperation( Function<ContentType, Mono<OperationResult>> activationOperation, Flux<ByteBuffer> form, FormContentType contentType) { return pollingContext -> { Mono<OperationResult> operationResultMono; try { if (contentType != null) { final ContentType givenContentType = ContentType.fromString(contentType.toString()); operationResultMono = activationOperation.apply(givenContentType); } else { operationResultMono = detectContentType(form) .flatMap(detectedContentType -> activationOperation.apply(detectedContentType)); } operationResultMono.onErrorMap(Utility::mapToHttpResponseExceptionIfExist); } catch (RuntimeException ex) { operationResultMono = monoError(logger, ex); } return operationResultMono; }; }

Target:
private Function<PollingContext<OperationResult>, Mono<OperationResult>> streamActivationOperation( Function<ContentType, Mono<OperationResult>> activationOperation, Flux<ByteBuffer> form, FormContentType contentType) { return pollingContext -> { try { Objects.requireNonNull(form, "'form' is required and cannot be null."); if (contentType != null) { return activationOperation.apply(ContentType.fromString(contentType.toString())) .onErrorMap(Utility::mapToHttpResponseExceptionIfExist); } else { return detectContentType(form) .flatMap(activationOperation::apply) .onErrorMap(Utility::mapToHttpResponseExceptionIfExist); } } catch (RuntimeException ex) { return monoError(logger, ex); } }; }
Source:
public void setIOSamplingRate(int rate) throws TimeoutException, XBeeException { if (rate < 0) throw new IllegalArgumentException("Rate must be >= 0."); if (!connectionInterface.isOpen()) throw new InterfaceNotOpenException(); ATCommandResponse response = null; try { if (isRemote()) response = sendATCommand(new ATCommand("IR", ByteUtils.intToByteArray(rate)), XBeeTransmitOptions.APPLY_CHANGES); else response = sendATCommand(new ATCommand("IR", ByteUtils.intToByteArray(rate))); } catch (IOException e) { throw new XBeeException("Error writing in the communication interface.", e); } checkATCommandResponseIsValid(response); }

Target:
public void setIOSamplingRate(int rate) throws TimeoutException, XBeeException { if (rate < 0 || rate > 0xFFFF) throw new IllegalArgumentException("Rate must be between 0 and 0xFFFF."); if (!connectionInterface.isOpen()) throw new InterfaceNotOpenException(); ATCommandResponse response = null; try { if (isRemote()) response = sendATCommand(new ATCommand("IR", ByteUtils.intToByteArray(rate)), XBeeTransmitOptions.APPLY_CHANGES); else response = sendATCommand(new ATCommand("IR", ByteUtils.intToByteArray(rate))); } catch (IOException e) { throw new XBeeException("Error writing in the communication interface.", e); } checkATCommandResponseIsValid(response); }
Source:
public int read(ByteBuffer dst, long position) throws IOException { int readBytes = sageFileChannel.read(dst, position - fileOffsets[currFileIndex]); if (dst.hasRemaining()) { ensureProperFile(false); if (readBytes == -1) readBytes = 0; readBytes += sageFileChannel.read(dst, position + readBytes - fileOffsets[currFileIndex]); } return readBytes; }

Target:
public int read(ByteBuffer dst, long position) throws IOException { int readBytes = 0; int count = (int)Math.min(size() - position, (long)dst.remaining()); try { while (count > readBytes) { ensureProperFile(false, position); readBytes += sageFileChannel.read(dst, position + readBytes - fileOffsets[currFileIndex]); } } finally { ensureProperFile(false); } return readBytes; }
Source:
private int[] recordTravelTimesForTarget (int target, int[] percentileTravelTimesMinutes) { if (percentileTravelTimesMinutes.length != nPercentiles) { throw new ParameterException(percentileTravelTimesMinutes.length + " percentile values supplied; expected" + " " + nPercentiles); } if (travelTimes != null) { travelTimes.setTarget(target, percentileTravelTimesMinutes); } if (calculateAccessibility) { Grid grid = (Grid) accessibilityAccumulator.destinationPointSets[0]; int x = target % grid.width; int y = target / grid.width; double amount = grid.grid[x][y]; for (int p = 0; p < nPercentiles; p++) { if (percentileTravelTimesMinutes[p] < maxTripDurationMinutes) { accessibilityAccumulator.incrementAccessibility(0, 0, p, amount); } } } return percentileTravelTimesMinutes; }

Target:
private int[] recordTravelTimesForTarget (int target, int[] percentileTravelTimesMinutes) { if (percentileTravelTimesMinutes.length != nPercentiles) { throw new ParameterException(percentileTravelTimesMinutes.length + " percentile values supplied; expected" + " " + nPercentiles); } if (calculateTravelTimes) { travelTimeResult.setTarget(target, percentileTravelTimesMinutes); } if (calculateAccessibility) { PointSet pointSet = accessibilityResult.destinationPointSets[0]; double amount = pointSet.getOpportunityCount(target); for (int p = 0; p < nPercentiles; p++) { if (percentileTravelTimesMinutes[p] < maxTripDurationMinutes) { accessibilityResult.incrementAccessibility(0, 0, p, amount); } } } return percentileTravelTimesMinutes; }
Source:
Schema(String name, Pattern pathRegex, String path, String documentation, SchemaValidator schemaValidator, Allowance ephemeral, Allowance sequential, Allowance watched, boolean canBeDeleted, Map<String, String> metadata) { Preconditions.checkNotNull(pathRegex, "pathRegex cannot both be null"); Preconditions.checkNotNull(path, "path cannot both be null"); this.pathRegex = pathRegex; this.fixedPath = fixPath(path); this.metadata = ImmutableMap.copyOf(Preconditions.checkNotNull(metadata, "metadata cannot be null")); this.name = Preconditions.checkNotNull(name, "name cannot be null"); this.documentation = Preconditions.checkNotNull(documentation, "documentation cannot be null"); this.schemaValidator = Preconditions.checkNotNull(schemaValidator, "dataValidator cannot be null"); this.ephemeral = Preconditions.checkNotNull(ephemeral, "ephemeral cannot be null"); this.sequential = Preconditions.checkNotNull(sequential, "sequential cannot be null"); this.watched = Preconditions.checkNotNull(watched, "watched cannot be null"); this.canBeDeleted = canBeDeleted; }

Target:
Schema(String name, Pattern pathRegex, String path, String documentation, SchemaValidator schemaValidator, Allowance ephemeral, Allowance sequential, Allowance watched, boolean canBeDeleted, Map<String, String> metadata) { Preconditions.checkArgument((pathRegex != null) || (path != null), "pathRegex and path cannot both be null"); this.pathRegex = pathRegex; this.fixedPath = fixPath(path); this.metadata = ImmutableMap.copyOf(Preconditions.checkNotNull(metadata, "metadata cannot be null")); this.name = Preconditions.checkNotNull(name, "name cannot be null"); this.documentation = Preconditions.checkNotNull(documentation, "documentation cannot be null"); this.schemaValidator = Preconditions.checkNotNull(schemaValidator, "dataValidator cannot be null"); this.ephemeral = Preconditions.checkNotNull(ephemeral, "ephemeral cannot be null"); this.sequential = Preconditions.checkNotNull(sequential, "sequential cannot be null"); this.watched = Preconditions.checkNotNull(watched, "watched cannot be null"); this.canBeDeleted = canBeDeleted; }
Source:
public boolean contains(ItemGroup ctx, AbstractProject<?,?> job, EnvVars environment) { String expandedJobs = getExpandedJobs(jobs, environment); if(!expandedJobs.contains(job.getName())) return false; String name = job.getFullName(); for (AbstractProject<?, ?> project : getJobList(ctx, environment)) { if (project.getFullName().equals(name)) return true; } return false; }

Target:
public boolean contains(ItemGroup ctx, AbstractProject<?,?> job, EnvVars environment) { String expandedJobs = getExpandedJobs(jobs, environment); if (expandedJobs == null) return false; if(!expandedJobs.contains(job.getName())) return false; String name = job.getFullName(); for (AbstractProject<?, ?> project : getJobList(ctx)) { if (project.getFullName().equals(name)) return true; } return false; }
Source:
private byte[] httpGet(String requestUrl) throws IOException { GetMethod getMethod = new GetMethod(requestUrl); try { int responseCode = httpClient.executeMethod(getMethod); LOG.debug("Received response code for the get request on the url : {}", responseCode, requestUrl); byte[] response = getMethod.getResponseBody(); if (responseCode != 200) { throw new SamzaException(String.format("Received response code: %s for get request on: %s, with message: %s.", responseCode, requestUrl, StringUtils.newStringUtf8(response))); } return response; } finally { getMethod.releaseConnection(); } }

Target:
private byte[] httpGet(String requestUrl) throws IOException { GetMethod getMethod = new GetMethod(requestUrl); try { int responseCode = httpClient.executeMethod(getMethod); LOG.debug("Received response code: for the get request on the url: {}", responseCode, requestUrl); byte[] response = getMethod.getResponseBody(); if (responseCode != HttpStatus.SC_OK) { throw new SamzaException(String.format("Received response code: %s for get request on: %s, with message: %s.", responseCode, requestUrl, StringUtils.newStringUtf8(response))); } return response; } finally { getMethod.releaseConnection(); } }
Source:
public void addMapItem(MapItem mItem) { if (mMap != null) { if (MapItem.class.isAssignableFrom(mItem.getClass())) { int type = mItem.getMapItemType(); switch (type) { case 0: break; case MapItem.MARKERTYPE: if (mItem.getMarkerText() != null) { IconGenerator iconGenerator = new IconGenerator(mContext); iconGenerator.setBackground(mContext.getResources().getDrawable(R.drawable.usermarker)); iconGenerator.setTextAppearance(10); Bitmap bitmap = iconGenerator.makeIcon(mItem.getMarkerText()); Marker marker = mMap.addMarker(mItem.getMarkerOptions().icon(BitmapDescriptorFactory.fromBitmap(bitmap))); if (mItem.isDynamic()) { dynamicMarkers.add(marker); } } else { Marker marker; if (mItem.isVehicle()) { marker = mMap.addMarker(mItem.getMarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.maps_shuttle_indicator))); } else { if (isMapExpanded) { marker = mMap.addMarker(mItem.getMarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.map_stops))); } else { marker = mMap.addMarker(mItem.getMarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.map_pin))); } } if (mItem.isDynamic()) { dynamicMarkers.add(marker); } else { staticMarkers.add(marker); } } break; case MapItem.POLYLINETYPE: Polyline polyline = mMap.addPolyline(mItem.getPolylineOptions()); if (mItem.isDynamic()) { dynamicLines.add(polyline); } break; case MapItem.POLYGONTYPE: Polygon polygon = mMap.addPolygon(mItem.getPolygonOptions()); if (mItem.isDynamic()) { dynamicPolygons.add(polygon); } break; } } } }

Target:
public void addMapItem(MapItem mItem) { if (mMap != null) { if (MapItem.class.isAssignableFrom(mItem.getClass())) { int type = mItem.getMapItemType(); switch (type) { case 0: break; case MapItem.MARKERTYPE: if (mItem.getMarkerText() != null) { IconGenerator iconGenerator = new IconGenerator(mContext); iconGenerator.setBackground(mContext.getResources().getDrawable(R.drawable.usermarker)); iconGenerator.setTextAppearance(10); Bitmap bitmap = iconGenerator.makeIcon(mItem.getMarkerText()); Marker marker = mMap.addMarker(mItem.getMarkerOptions().icon(BitmapDescriptorFactory.fromBitmap(bitmap))); if (mItem.isDynamic()) { dynamicMarkers.add(marker); } } else { Marker marker; if (mItem.isVehicle()) { marker = mMap.addMarker(mItem.getMarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.maps_shuttle_indicator))); } else { if (!isMapExpanded) { marker = mMap.addMarker(mItem.getMarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.map_stops))); } else { marker = mMap.addMarker(mItem.getMarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.map_pin))); } } if (mItem.isDynamic()) { dynamicMarkers.add(marker); } else { staticMarkers.add(marker); } } break; case MapItem.POLYLINETYPE: Polyline polyline = mMap.addPolyline(mItem.getPolylineOptions()); if (mItem.isDynamic()) { dynamicLines.add(polyline); } break; case MapItem.POLYGONTYPE: Polygon polygon = mMap.addPolygon(mItem.getPolygonOptions()); if (mItem.isDynamic()) { dynamicPolygons.add(polygon); } break; } } } }
Source:
public Credential changePassword(Credential password, ChangePassword changePassword, Policy policy) { if (policy.isOption(Policy.AUTHORIZED_FOR_ALL_ACCOUNTS) || transformationService.compare(changePassword.getOldSecret(), password.getSecretValue())){ password.setSecretValue(transformationService.transform(changePassword.getNewSecret(), EncryptionConstants.HASH)); password = objectManager.persist(password); validatePassword(changePassword.getNewSecret()); return password; } throw new ClientVisibleException(ResponseCodes.BAD_REQUEST, "InvalidOldPassword"); }

Target:
public Credential changePassword(Credential password, ChangePassword changePassword, Policy policy) { if (policy.isOption(Policy.AUTHORIZED_FOR_ALL_ACCOUNTS) || transformationService.compare(changePassword.getOldSecret(), password.getSecretValue())){ password.setSecretValue(transformationService.transform(changePassword.getNewSecret(), EncryptionConstants.HASH)); password = objectManager.persist(password); return password; } throw new ClientVisibleException(ResponseCodes.BAD_REQUEST, "InvalidOldPassword"); }
Source:
public void testLibraryAliquotTableWarnings() { testLibraryAliquotTableWarningOnPoolWithError(801L, "(MISSING INDEX)"); testLibraryAliquotTableWarningOnPoolWithError(802L, "(NEAR-DUPLICATE INDICES)"); testLibraryAliquotTableWarningOnPoolWithError(803L, "DUPLICATE INDICES"); }

Target:
public void testLibraryAliquotTableWarnings() { testLibraryAliquotTableWarningOnPoolWithError(801L, "MISSING INDEX"); testLibraryAliquotTableWarningOnPoolWithError(802L, "Near-Duplicate Indices"); testLibraryAliquotTableWarningOnPoolWithError(803L, "DUPLICATE INDICES"); }
Source:
private String processColorDefinition(State state, List<ColorArray> colorList) { if(colorList == null) return null; if(colorList.size() == 0) return null; String colorString = null; if(colorList.size() == 1 && colorList.get(0).getState() == null) colorString = colorList.get(0).getArg(); else { for (ColorArray color : colorList) { State cmpState = state; if(color.getState() == null) { logger.error("Error parsing color"); continue; } if(color.getItem() != null) { Item item; try { item = itemRegistry.getItem(color.getItem()); cmpState = item.getState(); } catch (ItemNotFoundException e) { logger.error("Cannot retrieve color item for widget", color.getItem()); } } String value; if(color.getSign() != null) value = color.getSign() + color.getState(); else value = color.getState(); if (matchStateToValue(cmpState, value, color.getCondition()) == true) { colorString = color.getArg(); break; } } } if(colorString == null) return null; if(colorString.startsWith("\"") && colorString.endsWith("\"")) colorString = colorString.substring(1, colorString.length()-1); return colorString; }

Target:
private String processColorDefinition(State state, List<ColorArray> colorList) { if(colorList == null) { return null; } if(colorList.size() == 0) { return null; } String colorString = null; if(colorList.size() == 1 && colorList.get(0).getState() == null) { colorString = colorList.get(0).getArg(); } else { for (ColorArray color : colorList) { State cmpState = state; if(color.getState() == null) { logger.error("Error parsing color"); continue; } if(color.getItem() != null) { Item item; try { item = itemRegistry.getItem(color.getItem()); cmpState = item.getState(); } catch (ItemNotFoundException e) { logger.warn("Cannot retrieve color item for widget", color.getItem()); } } String value; if(color.getSign() != null) value = color.getSign() + color.getState(); else value = color.getState(); if (matchStateToValue(cmpState, value, color.getCondition()) == true) { colorString = color.getArg(); break; } } } if(colorString == null) return null; if(colorString.startsWith("\"") && colorString.endsWith("\"")) colorString = colorString.substring(1, colorString.length()-1); return colorString; }
Source:
public Task<T> batchable(final String desc, final K key) { return Task.async(desc, ctx -> { final SettablePromise<T> result = Promises.settable(); Long planId = ctx.getPlanId(); BatchBuilder<K, T> builder = _batches.get(planId); if (builder == null) { builder = Batch.builder(); BatchBuilder<K, T> existingBuilder = _batches.putIfAbsent(planId, builder); if (existingBuilder != null) { builder = existingBuilder; } } builder.add(key, ctx.getShallowTraceBuilder(), result); return result; }); }

Target:
public Task<T> batchable(final String desc, final K key) { return Task.async("batch: " + desc, ctx -> { final SettablePromise<T> result = Promises.settable(); Long planId = ctx.getPlanId(); BatchBuilder<K, T> builder = _batches.get(planId); if (builder == null) { builder = Batch.builder(); BatchBuilder<K, T> existingBuilder = _batches.putIfAbsent(planId, builder); if (existingBuilder != null) { builder = existingBuilder; } } builder.add(key, ctx.getShallowTraceBuilder(), result); return result; }); }
Source:
public void testMergeSegments_BothClaimedByProcessor() throws Exception { initProcessor(TrackingEventProcessorConfiguration.forParallelProcessing(2)); tokenStore.initializeTokenSegments(testSubject.getName(), 2); List<EventMessage<?>> handledEvents = new CopyOnWriteArrayList<>(); when(mockHandler.handle(any())).thenAnswer(i -> handledEvents.add(i.getArgument(0))); publishEvents(10); testSubject.start(); waitForActiveThreads(2); assertTrue("Expected merge to succeed", testSubject.mergeSegment(0).join()); assertArrayEquals(new int[]{0}, tokenStore.fetchSegments(testSubject.getName())); waitForSegmentStart(0); while (!testSubject.processingStatus().get(0).isCaughtUp()) { Thread.sleep(10); } assertWithin(5, TimeUnit.SECONDS, () -> assertEquals(10, handledEvents.size())); Thread.sleep(100); assertEquals(10, handledEvents.size()); }

Target:
public void testMergeSegments_BothClaimedByProcessor() throws Exception { initProcessor(TrackingEventProcessorConfiguration.forParallelProcessing(2)); tokenStore.initializeTokenSegments(testSubject.getName(), 2); List<EventMessage<?>> handledEvents = new CopyOnWriteArrayList<>(); when(mockHandler.handle(any())).thenAnswer(i -> handledEvents.add(i.getArgument(0))); publishEvents(10); testSubject.start(); waitForActiveThreads(2); assertTrue("Expected merge to succeed", testSubject.mergeSegment(0).join()); assertArrayEquals(new int[]{0}, tokenStore.fetchSegments(testSubject.getName())); waitForSegmentStart(0); while (!testSubject.processingStatus().get(0).isCaughtUp()) { Thread.sleep(10); } assertWithin(5, TimeUnit.SECONDS, () -> assertEquals("Expected all 10 messages to be handled", 10, handledEvents.stream().map(EventMessage::getIdentifier).distinct().count())); Thread.sleep(100); assertEquals("Number of handler invocations doesn't match number of unique events", 10, handledEvents.size()); }
Source:
private synchronized void reloadData() { _allDatastreamTasks = new HashMap<>(); List<String> connectorTypes = _zkclient.getChildren(_path); connectorTypes.removeAll(Arrays.asList("datastream", "instances", "liveinstances")); connectorTypes.forEach(connectorType -> { if (!_allDatastreamTasks.containsKey(connectorType)) { _allDatastreamTasks.put(connectorType, new ArrayList<>()); } String path = KeyBuilder.connector(_cluster, connectorType); List<String> tasksForConnector = _zkclient.getChildren(path); tasksForConnector.forEach(taskName -> { String p = KeyBuilder.connectorTask(_cluster, connectorType, taskName); String content = _zkclient.ensureReadData(p); LOG.info("@@@ content: " + content); DatastreamTask t = DatastreamTask.fromJson(content); _allDatastreamTasks.get(connectorType).add(t); }); }); }

Target:
private synchronized void reloadData() { _allDatastreamTasks = new HashMap<>(); List<String> connectorTypes = _zkclient.getChildren(_path); connectorTypes.forEach(connectorType -> { if (!_allDatastreamTasks.containsKey(connectorType)) { _allDatastreamTasks.put(connectorType, new ArrayList<>()); } String path = KeyBuilder.connector(_cluster, connectorType); List<String> tasksForConnector = _zkclient.getChildren(path); tasksForConnector.forEach(taskName -> { String p = KeyBuilder.connectorTask(_cluster, connectorType, taskName); String content = _zkclient.ensureReadData(p); DatastreamTask t = DatastreamTask.fromJson(content); _allDatastreamTasks.get(connectorType).add(t); }); }); }
Source:
public boolean isTrue(State state, String[] params) { if (!params[1].equalsIgnoreCase("")) { ObjectInstance container = state.getObject(params[1]); Set<String> contents = ContainerFactory.getContentNames(container); if (contents.isEmpty()) { return false; } ObjectInstance toPeel = null; for (String name : contents) { toPeel = state.getObject(name); boolean match = false; List<IngredientRecipe> ingredientContents = this.topLevelIngredient.getConstituentIngredients(); for (IngredientRecipe content: ingredientContents) { if (content.getName().equals(toPeel.getName())) { if (!content.hasToolAttribute(PeelAction.PEELED)) { return false; } match = true; break; } } if (!match) { AbstractMap<String, IngredientRecipe> necessaryTraits = this.topLevelIngredient.getNecessaryTraits(); Set<String> toPeelTraits = IngredientFactory.getTraits(toPeel); for (Entry<String, IngredientRecipe> entry : necessaryTraits.entrySet()) { String trait = entry.getKey(); if (toPeelTraits.contains(trait)) { if (entry.getValue().hasToolAttribute(PeelAction.PEELED)) { match = true; break; } } } if (!match) { return false; } } } return true; } else { List<IngredientRecipe> contents = topLevelIngredient.getConstituentIngredients(); for (IngredientRecipe content : contents) { if (content.hasToolAttribute(PeelAction.PEELED)) { return true; } } AbstractMap<String, IngredientRecipe> traitMap = topLevelIngredient.getConstituentNecessaryTraits(); for (IngredientRecipe ing : traitMap.values()) { if (ing.hasToolAttribute(PeelAction.PEELED)) { return true; } } return false; } }

Target:
public boolean isTrue(State state, String[] params) { if (!params[1].equalsIgnoreCase("")) { ObjectInstance container = state.getObject(params[1]); Set<String> contents = ContainerFactory.getContentNames(container); if (contents.isEmpty()) { return false; } ObjectInstance toPeel = null; for (String name : contents) { toPeel = state.getObject(name); boolean match = false; List<IngredientRecipe> ingredientContents = this.topLevelIngredient.getConstituentIngredients(); for (IngredientRecipe content: ingredientContents) { if (content.getName().equals(toPeel.getName())) { if (!content.hasToolAttribute(PeelAction.PEELED)) { return false; } match = true; break; } } if (!match) { AbstractMap<String, IngredientRecipe> necessaryTraits = this.topLevelIngredient.getNecessaryTraits(); Set<String> toPeelTraits = IngredientFactory.getTraits(toPeel); for (Entry<String, IngredientRecipe> entry : necessaryTraits.entrySet()) { String trait = entry.getKey(); if (toPeelTraits.contains(trait)) { if (entry.getValue().hasToolAttribute(PeelAction.PEELED)) { match = true; break; } } } if (!match) { return false; } } } return true; } else { List<IngredientRecipe> contents = topLevelIngredient.getConstituentIngredients(); for (IngredientRecipe ing : contents) { if (ing.hasToolAttribute(PeelAction.PEELED)) { return true; } } AbstractMap<String, IngredientRecipe> traitMap = topLevelIngredient.getConstituentNecessaryTraits(); for (IngredientRecipe ing : traitMap.values()) { if (ing.hasToolAttribute(PeelAction.PEELED)) { return true; } } return false; } }
Source:
public void testSatisfiedThenLostNetworkRequestDoesNotTriggerOnUnavailable() { NetworkRequest nr = new NetworkRequest.Builder().addTransportType( NetworkCapabilities.TRANSPORT_WIFI).build(); final TestNetworkCallback networkCallback = new TestNetworkCallback(); final int requestTimeoutMs = 50; mCm.requestNetwork(nr, networkCallback, requestTimeoutMs); mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI); mWiFiNetworkAgent.connect(false); final int assertTimeoutMs = requestTimeoutMs + TEST_CALLBACK_TIMEOUT_MS; networkCallback.expectAvailableCallbacks(mWiFiNetworkAgent, false, false, assertTimeoutMs); mWiFiNetworkAgent.disconnect(); networkCallback.expectCallback(CallbackState.LOST, mWiFiNetworkAgent); networkCallback.assertNoCallback(); }

Target:
public void testSatisfiedThenLostNetworkRequestDoesNotTriggerOnUnavailable() { NetworkRequest nr = new NetworkRequest.Builder().addTransportType( NetworkCapabilities.TRANSPORT_WIFI).build(); final TestNetworkCallback networkCallback = new TestNetworkCallback(); final int requestTimeoutMs = 50; mCm.requestNetwork(nr, networkCallback, requestTimeoutMs); mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI); mWiFiNetworkAgent.connect(false); networkCallback.expectAvailableCallbacks(mWiFiNetworkAgent, false, false, TEST_CALLBACK_TIMEOUT_MS); mWiFiNetworkAgent.disconnect(); networkCallback.expectCallback(CallbackState.LOST, mWiFiNetworkAgent); networkCallback.assertNoCallback(); }
Source:
public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException, IllegalArgumentException { try { MinioClient minioClient = new MinioClient( "<LINK_0>", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); minioClient.disableObjectLegalHold( DisableObjectLegalHoldArgs.builder() .bucket("my-bucketname") .object("my-objectname") .build()); System.out.println( " Is object legal hold is enabled " + minioClient.isObjectLegalHoldEnabled( IsObjectLegalHoldEnabledArgs.builder() .bucket("my-bucketname") .object("my-objectname") .versionId("object-versionId") .build())); } catch (MinioException e) { System.out.println("Error occurred: " + e); } }

Target:
public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException, IllegalArgumentException { try { MinioClient minioClient = new MinioClient( "<LINK_0>", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); minioClient.disableObjectLegalHold( DisableObjectLegalHoldArgs.builder() .bucket("my-bucketname") .object("my-objectname") .build()); System.out.println("Legal hold disabled on object successfully "); } catch (MinioException e) { System.out.println("Error occurred: " + e); } }
Source:
protected void setSource(ClosableObservable<T1> source) { cancelSubscription(); closeSource(); this.source = source; sourceObserver.onConnectionStatus(false); sourceObserver.onConnectionStatus(source.isConnected()); T1 value = source.getValue(); if (value != null) sourceObserver.onValue(value); Exception error = source.currentError(); if (error != null) sourceObserver.onError(error); sourceSubscription = source.addObserver(sourceObserver); }

Target:
protected synchronized void setSource(ClosableObservable<T1> source) { cancelSubscription(); closeSource(); this.source = source; sourceObserver.onConnectionStatus(false); sourceObserver.onConnectionStatus(source.isConnected()); T1 value = source.getValue(); if (value != null) sourceObserver.onValue(value); Exception error = source.currentError(); if (error != null) sourceObserver.onError(error); sourceSubscription = source.addObserver(sourceObserver); }
Source:
IterableResponse<EventData> receive(int maximumMessageCount) { return new IterableResponse<>(Flux.empty()); }

Target:
public IterableResponse<EventData> receive(int maximumMessageCount) { return new IterableResponse<>(Flux.empty()); }
Source:
public void testIsSolidTumor() throws Exception { TumorType tumorType = new TumorType(); MainType mainType = new MainType(); tumorType.setMainType(mainType); assertFalse("Empty tumor type is not solid tumor", TumorTypeUtils.isSolidTumor(tumorType)); mainType.setName("Melanoma"); assertTrue("Melanoma is solid tumor", TumorTypeUtils.isSolidTumor(tumorType)); mainType.setName("Leukemia"); assertFalse("Leukemia is not solid tumor", TumorTypeUtils.isSolidTumor(tumorType)); mainType.setName("Leukemia"); tumorType.setTissue("EYE"); assertTrue("Tissue has higher priority than main type", TumorTypeUtils.isSolidTumor(tumorType)); }

Target:
public void testIsSolidTumor() throws Exception { TumorType tumorType = new TumorType(); MainType mainType = new MainType(); tumorType.setMainType(mainType); assertFalse("Empty tumor type is solid tumor, but it should not be.", TumorTypeUtils.isSolidTumor(tumorType)); mainType.setName("Melanoma"); assertTrue("Melanoma is not solid tumor, but it should be.", TumorTypeUtils.isSolidTumor(tumorType)); mainType.setName("Leukemia"); assertFalse("Leukemia is solid tumor, but it should not be.", TumorTypeUtils.isSolidTumor(tumorType)); mainType.setName("Leukemia"); tumorType.setTissue("EYE"); assertTrue("Tissue does not have higher priority than main type, but it should have.", TumorTypeUtils.isSolidTumor(tumorType)); }
Source:
public void subtract(final AbstractHistogram otherHistogram) throws ArrayIndexOutOfBoundsException, IllegalArgumentException { if (highestEquivalentValue(otherHistogram.getMaxValue()) > highestEquivalentValue(valueFromIndex(this.countsArrayLength - 1))) { throw new ArrayIndexOutOfBoundsException( "The other histogram includes values that do not fit in this histogram's range."); } for (int i = 0; i < otherHistogram.countsArrayLength; i++) { long otherCount = otherHistogram.getCountAtIndex(i); if (otherCount > 0) { long otherValue = otherHistogram.valueFromIndex(i); if (getCountAtValue(otherValue) < otherCount) { throw new IllegalArgumentException("otherHistogram count (" + otherCount + ") at value " + otherValue + " is larger than this one's (" + getCountAtValue(otherValue) + ")"); } recordValueWithCount(otherValue, -otherCount); } } if ((getCountAtValue(getMaxValue()) <= 0) || getCountAtValue(getMinNonZeroValue()) <= 0) { establishInternalTackingValues(); } }

Target:
public void subtract(final AbstractHistogram otherHistogram) throws ArrayIndexOutOfBoundsException, IllegalArgumentException { if (highestEquivalentValue(otherHistogram.getMaxValue()) > highestEquivalentValue(valueFromIndex(this.countsArrayLength - 1))) { throw new IllegalArgumentException( "The other histogram includes values that do not fit in this histogram's range."); } for (int i = 0; i < otherHistogram.countsArrayLength; i++) { long otherCount = otherHistogram.getCountAtIndex(i); if (otherCount > 0) { long otherValue = otherHistogram.valueFromIndex(i); if (getCountAtValue(otherValue) < otherCount) { throw new IllegalArgumentException("otherHistogram count (" + otherCount + ") at value " + otherValue + " is larger than this one's (" + getCountAtValue(otherValue) + ")"); } recordValueWithCount(otherValue, -otherCount); } } if ((getCountAtValue(getMaxValue()) <= 0) || getCountAtValue(getMinNonZeroValue()) <= 0) { establishInternalTackingValues(); } }
Source:
public GHDiscussion wrapUp(GHTeam team) throws IOException { this.root = team.root; this.organization = team.getOrganization(); this.team = team; return this; }

Target:
GHDiscussion wrapUp(GHTeam team) { this.team = team; return this; }
Source:
public void testCountsBySpan(String acc, List<Chunk> chunks, int numberAlignments, int numberUnalignments) { if (!SRAAccession.isSupported()) return; SamReader reader = SamReaderFactory.make().validationStringency(ValidationStringency.SILENT).open( SamInputResource.of(new SRAAccession(acc)) ); final SAMRecordIterator samRecordIterator = ((SamReader.Indexing) reader).iterator(new BAMFileSpan(chunks)); int countAlignments = 0, countUnalignments = 0; while (true) { boolean hasRecord = samRecordIterator.hasNext(); SAMRecord record = null; try { record = samRecordIterator.next(); Assert.assertTrue(hasRecord); } catch (NoSuchElementException e) { Assert.assertFalse(hasRecord); } Assert.assertEquals(hasRecord, record != null); if (record == null) { break; } if (record.getReadUnmappedFlag()) { countUnalignments++; } else { countAlignments++; } } Assert.assertEquals(numberAlignments, countAlignments); Assert.assertEquals(numberUnalignments, countUnalignments); }

Target:
public void testCountsBySpan(String acc, List<Chunk> chunks, int numberAlignments, int numberUnalignments) { if (!SRAAccession.isSupported()) return; SamReader reader = SamReaderFactory.make().validationStringency(ValidationStringency.SILENT).open( SamInputResource.of(new SRAAccession(acc)) ); final SAMRecordIterator samRecordIterator = ((SamReader.Indexing) reader).iterator(new BAMFileSpan(chunks)); checkAlignedUnalignedCountsByIterator(samRecordIterator, numberAlignments, numberUnalignments); }
Source:
public void should_reload_profile_config_when_reloading_config() throws Exception { String query = "mockquery"; AtomicReference<String> configSource = new AtomicReference<>(""); DefaultDriverConfigLoader loader = new DefaultDriverConfigLoader( () -> ConfigFactory.parseString( "profiles.slow.request.consistency = ONE\nconfig-reload-interval = 2s\n" + configSource.get()) .withFallback(DEFAULT_CONFIG_SUPPLIER.get()), CoreDriverOption.values()); try (Cluster configCluster = Cluster.builder() .withConfigLoader(loader) .addContactPoints(simulacron.getContactPoints()) .build()) { simulacron.cluster().prime(when(query).then(noRows()).delay(1, TimeUnit.SECONDS)); Session session = configCluster.connect(); try { session.execute(SimpleStatement.builder(query).withConfigProfileName("slow").build()); fail("Expected DriverTimeoutException"); } catch (DriverTimeoutException e) { } configSource.set("profiles.slow.request.timeout = 10s"); TimeUnit.SECONDS.sleep(3); session.execute(SimpleStatement.builder(query).withConfigProfileName("slow").build()); } }

Target:
public void should_reload_profile_config_when_reloading_config() throws Exception { String query = "mockquery"; AtomicReference<String> configSource = new AtomicReference<>(""); DefaultDriverConfigLoader loader = new DefaultDriverConfigLoader( () -> ConfigFactory.parseString( "profiles.slow.request.consistency = ONE\nconfig-reload-interval = 2s\n" + configSource.get()) .withFallback(DEFAULT_CONFIG_SUPPLIER.get()), CoreDriverOption.values()); try (Cluster configCluster = Cluster.builder() .withConfigLoader(loader) .addContactPoints(simulacron.getContactPoints()) .build()) { simulacron.cluster().prime(when(query).then(noRows()).delay(1, TimeUnit.SECONDS)); Session session = configCluster.connect(); try { session.execute(SimpleStatement.builder(query).withConfigProfileName("slow").build()); fail("Expected DriverTimeoutException"); } catch (DriverTimeoutException e) { } configSource.set("profiles.slow.request.timeout = 10s"); waitForConfigChange(configCluster, 3, TimeUnit.SECONDS); session.execute(SimpleStatement.builder(query).withConfigProfileName("slow").build()); } }
Source:
public static String debugHttpResponse(HttpResponse response) throws ClientException { if (isHttpDebug) { String protocol = response.getSysUrl().split("://")[0].toUpperCase() + "/1.1"; StringBuilder debugString = new StringBuilder("< " + protocol + " " + response.getStatus() + "\n< "); Map<String, String> reasponseHeaders = response.getSysHeaders(); for (Entry<String, String> entry : reasponseHeaders.entrySet()) { debugString.append(entry.getKey() + " : " + entry.getValue() + "\n< "); } if (isHttpContentDebug) { debugString.append("\n" + response.getHttpContentString()); } log.info("\n" + debugString); return debugString.toString(); } else { return null; } }

Target:
public static String debugHttpResponse(HttpResponse response) throws ClientException { if (isHttpDebug) { String protocol = response.getSysUrl().split("://")[0].toUpperCase() + "/1.1"; StringBuilder debugString = new StringBuilder("< " + protocol + " " + response.getStatus() + "\n< "); Map<String, String> responseHeaders = response.getSysHeaders(); for (Entry<String, String> entry : responseHeaders.entrySet()) { debugString.append(entry.getKey() + " : " + entry.getValue() + "\n< "); } if (isHttpContentDebug) { debugString.append("\n" + response.getHttpContentString()); } log.info("\n" + debugString); return debugString.toString(); } else { return null; } }
Source:
protected void configureServlets() { filter("/*").through(Key.get(CacheControlFilter.class)); bind(Key.get(CacheControlFilter.class)).in(SINGLETON); serve("/").with(HostPageServlet.class); serve("/Gerrit").with(LegacyGerritServlet.class); serve("/Gerrit/*").with(legacyGerritScreen()); serve("/cat/*").with(CatServlet.class); serve("/logout").with(HttpLogoutServlet.class); serve("/query").with(ChangeQueryServlet.class); serve("/signout").with(HttpLogoutServlet.class); serve("/ssh_info").with(SshInfoServlet.class); serve("/static/*").with(StaticServlet.class); serve("/tools/*").with(ToolServlet.class); filter("/p/*").through(ProjectAccessPathFilter.class); if (authConfig.isTrustContainerAuth()) filter("/p/*").through(ContainerAuthFilter.class); else filter("/p/*").through(ProjectDigestFilter.class); serve("/p/*").with(ProjectServlet.class); serve("/Main.class").with(notFound()); serve("/com/google/gerrit/launcher/*").with(notFound()); serve("/servlet/*").with(notFound()); serve("/all").with(query("status:merged")); serve("/mine").with(screen(PageLinks.MINE)); serve("/open").with(query("status:open")); serve("/watched").with(query("is:watched status:open")); serve("/starred").with(query("is:starred")); serveRegex("^/settings/?$").with(screen(PageLinks.SETTINGS)); serveRegex("^/register/?$").with(screen(PageLinks.REGISTER + "/")); serveRegex("^/([1-9][0-9]*)/?$").with(directChangeById()); serveRegex("^/r/(.+)/?$").with(DirectChangeByCommit.class); }

Target:
protected void configureServlets() { filter("/*").through(Key.get(CacheControlFilter.class)); bind(Key.get(CacheControlFilter.class)).in(SINGLETON); serve("/").with(HostPageServlet.class); serve("/Gerrit").with(LegacyGerritServlet.class); serve("/Gerrit/*").with(legacyGerritScreen()); serve("/cat/*").with(CatServlet.class); serve("/logout").with(HttpLogoutServlet.class); serve("/query").with(ChangeQueryServlet.class); serve("/signout").with(HttpLogoutServlet.class); serve("/ssh_info").with(SshInfoServlet.class); serve("/static/*").with(StaticServlet.class); serve("/tools/*").with(ToolServlet.class); filter("/p/*").through(ProjectAccessPathFilter.class); if (authConfig.isTrustContainerAuth()) { filter("/p/*").through(ContainerAuthFilter.class); } else { filter("/p/*").through(ProjectDigestFilter.class); } serve("/p/*").with(ProjectServlet.class); serve("/Main.class").with(notFound()); serve("/com/google/gerrit/launcher/*").with(notFound()); serve("/servlet/*").with(notFound()); serve("/all").with(query("status:merged")); serve("/mine").with(screen(PageLinks.MINE)); serve("/open").with(query("status:open")); serve("/watched").with(query("is:watched status:open")); serve("/starred").with(query("is:starred")); serveRegex("^/settings/?$").with(screen(PageLinks.SETTINGS)); serveRegex("^/register/?$").with(screen(PageLinks.REGISTER + "/")); serveRegex("^/([1-9][0-9]*)/?$").with(directChangeById()); serveRegex("^/r/(.+)/?$").with(DirectChangeByCommit.class); }
Source:
boolean verify(char[] guess) throws InvalidKeyException { byte[] guessedHashA1 = new byte[guess.length]; for (int i = 0; i < guess.length; i++) { guessedHashA1[i] = (byte)(0xff & guess[i]); } return verify(guessedHashA1); }

Target:
boolean verify(char[] guess) throws InvalidKeyException { if (guess == null) { throw new InvalidKeyException("Guess cannot be null"); } byte[] guessedHashA1 = (utf8Encoded ? new String(guess).getBytes(Charsets.UTF_8) : new String(guess).getBytes(Charsets.LATIN_1)); return verify(guessedHashA1); }
Source:
@Override @Before public void setUp() throws Exception { init(); }

Target:
@Before public void setUp() { init(); }
Source:
public static void loadValue(ITimeGraphPresentationProvider presentationProvider, StateItem stateItem) { IPreferenceStore store = getStore(); String rgbKey = getRgbKey(presentationProvider, stateItem); String widthKey = getWidthKey(presentationProvider, stateItem); Map<String, Object> styleMap = stateItem.getStyleMap(); RGB defaultRgb = stateItem.getStateColor(); store.setDefault(rgbKey, RGBAUtil.fromRGBA(new RGBA(defaultRgb.red, defaultRgb.green, defaultRgb.blue, 255))); int rgbColor = store.getInt(rgbKey); float defaultHeight = isLink(stateItem) ? 0.1f : 1.0f; float defaultWidth = (float) stateItem.getStyleMap().getOrDefault(ITimeEventStyleStrings.heightFactor(), defaultHeight); store.setDefault(widthKey, defaultWidth); float width = store.getFloat(widthKey); styleMap.put(ITimeEventStyleStrings.fillColor(), rgbColor); styleMap.put(ITimeEventStyleStrings.heightFactor(), width); }

Target:
public static void loadValue(ITimeGraphPresentationProvider presentationProvider, StateItem stateItem) { IPreferenceStore store = getStore(); String rgbKey = getRgbKey(presentationProvider, stateItem); String widthKey = getWidthKey(presentationProvider, stateItem); Map<String, Object> styleMap = stateItem.getStyleMap(); RGB defaultRgb = stateItem.getStateColor(); String defaultString = store.getDefaultString(rgbKey); if(defaultString.isEmpty()) { store.setDefault(rgbKey, new RGBAColor(defaultRgb.red, defaultRgb.green, defaultRgb.blue, 255).toString()); } int rgbColor = store.getInt(rgbKey); float defaultHeight = isLink(stateItem) ? 0.1f : 1.0f; float defaultWidth = (float) stateItem.getStyleMap().getOrDefault(ITimeEventStyleStrings.heightFactor(), defaultHeight); store.setDefault(widthKey, defaultWidth); float width = store.getFloat(widthKey); styleMap.put(ITimeEventStyleStrings.fillColor(), rgbColor); styleMap.put(ITimeEventStyleStrings.heightFactor(), width); }
Source:
public void shouldMapIntegerSetToStringSet() { Source source = new Source(); source.setAnotherIntegerSet( new HashSet<Integer>( Arrays.asList( 1, 2 ) ).stream() ); Target target = SourceTargetMapper.INSTANCE.sourceToTarget( source ); assertThat( target ).isNotNull(); assertThat( target.getAnotherStringSet() ).containsOnly( "1", "2" ); }

Target:
public void shouldMapIntegerSetToStringSet() { Source source = new Source(); source.setAnotherIntegerStream( new HashSet<Integer>( Arrays.asList( 1, 2 ) ).stream() ); Target target = SourceTargetMapper.INSTANCE.sourceToTarget( source ); assertThat( target ).isNotNull(); assertThat( target.getAnotherStringSet() ).containsOnly( "1", "2" ); }
Source:
public void testBaseOutput() { String[] args = new String[]{ "I=" + TEST_INPUT_VCF1.getAbsolutePath(), "O=" + TEST_OUTPUT, "G=" + TEST_GENOTYPES_VCF1.getAbsolutePath(), "H=" + SUBSETTED_HAPLOTYPE_DATABASE_FOR_TESTING.getAbsolutePath() }; Assert.assertEquals(runPicardCommandLine(args), 0); Assert.assertTrue(MetricsFile.areMetricsEqual(new File(TEST_OUTPUT + ".fingerprinting_summary_metrics"), RESULT_EXAMPLE_SUMMARY)); Assert.assertTrue(MetricsFile.areMetricsEqual(new File(TEST_OUTPUT + ".fingerprinting_detail_metrics"), RESULT_EXAMPLE_DETAIL)); }

Target:
public void testBaseOutput() { String[] args = new String[]{ "I=" + TEST_INPUT_VCF1, "O=" + TEST_OUTPUT, "G=" + TEST_GENOTYPES_VCF1, "H=" + SUBSETTED_HAPLOTYPE_DATABASE_FOR_TESTING }; Assert.assertEquals(runPicardCommandLine(args), 0); Assert.assertTrue(MetricsFile.areMetricsEqual(new File(TEST_OUTPUT + ".fingerprinting_summary_metrics"), RESULT_EXAMPLE_SUMMARY)); Assert.assertTrue(MetricsFile.areMetricsEqual(new File(TEST_OUTPUT + ".fingerprinting_detail_metrics"), RESULT_EXAMPLE_DETAIL)); }
Source:
public Date getLogTime() { return this.logTime; }

Target:
public Date getLogTime() { return new Date(this.logTime.getTime()); }
Source:
VolumeChooser getDelegateChooser(VolumeChooserEnvironment env) { switch (env.getScope()) { case TABLE: return getVolumeChooserForTable(env); default: return getVolumeChooserForScope(env); } }

Target:
VolumeChooser getDelegateChooser(VolumeChooserEnvironment env) { if (env.getScope() == ChooserScope.TABLE) { return getVolumeChooserForTable(env); } return getVolumeChooserForScope(env); }