auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onComplete(Result result) { final long requestTime = System.currentTimeMillis() - start; try { emitter.emit( QueryMetricUtil.makeQueryTimeMetric(jsonMapper, query, req.getRemoteAddr()) .build("request/time", requestTime) ); requestLogger.log( new RequestLogLine( new DateTime(), req.getRemoteAddr(), query, new QueryStats( ImmutableMap.<String, Object>of( "request/time", requestTime, "success", true ) ) ) ); } catch (Exception e) { log.error(e, "Unable to log query [%s]!", query); } super.onComplete(result); }

Target:
public void onComplete(Result result) { final long requestTime = System.currentTimeMillis() - start; try { emitter.emit( DruidMetrics.makeQueryTimeMetric(jsonMapper, query, req.getRemoteAddr()) .build("query/time", requestTime) ); requestLogger.log( new RequestLogLine( new DateTime(), req.getRemoteAddr(), query, new QueryStats( ImmutableMap.<String, Object>of( "query/time", requestTime, "success", true ) ) ) ); } catch (Exception e) { log.error(e, "Unable to log query [%s]!", query); } super.onComplete(result); }
Source:
private void mapBuildToDeploymentConfig(IBuild build) { String imageRef = imageRef(build, project); Collection<IDeploymentConfig> deploymentConfigs = imageRefToDeployConfigs.get(imageRef); if(imageRefToDeployConfigs.containsKey(imageRef) && deploymentConfigs != null) { for (IDeploymentConfig dc : deploymentConfigs) { createRelation(build, dc); } } }

Target:
private void mapBuildToDeploymentConfig(IBuild build) { String imageRef = imageRef(build, project); Collection<IDeploymentConfig> deploymentConfigs = imageRefToDeployConfigs.get(imageRef); if(deploymentConfigs != null) { deploymentConfigs.forEach(dc->createRelation(build, dc)); } }
Source:
private void resetConnectionMoveFeedbackToDefault() { Point newSourceRefPoint = getConnection().getSourceAnchor().getReferencePoint(); getConnection().translateToRelative(newSourceRefPoint); Point newTargetRefPoint = getConnection().getTargetAnchor().getReferencePoint(); getConnection().translateToRelative(newTargetRefPoint); List<Point> points = Lists.newArrayList(); points.add(newSourceRefPoint); points.add(newTargetRefPoint); changeRoutingConstraint(points, newSourceRefPoint, newTargetRefPoint); if (originalAnchor != null) { getConnection().setRoutingConstraint(originalConstraint); originalAnchor = null; } originalConstraint = null; }

Target:
private void resetConnectionMoveFeedbackToDefault() { Point newSourceRefPoint = getConnection().getSourceAnchor().getReferencePoint(); getConnection().translateToRelative(newSourceRefPoint); Point newTargetRefPoint = getConnection().getTargetAnchor().getReferencePoint(); getConnection().translateToRelative(newTargetRefPoint); List<Point> points = Lists.newArrayList(); points.add(newSourceRefPoint); points.add(newTargetRefPoint); changeRoutingConstraint(points, newSourceRefPoint, newTargetRefPoint); }
Source:
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) { if (msg instanceof HttpRequest) { HttpRequest req = (HttpRequest) msg; boolean keepAlive = HttpUtil.isKeepAlive(req); FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, OK, Unpooled.wrappedBuffer(CONTENT)); response.headers().set(CONTENT_TYPE, "text/plain"); response.headers().setInt(CONTENT_LENGTH, response.content().readableBytes()); if (keepAlive) { ctx.write(response); } else { response.headers().set(CONNECTION, CLOSE); ctx.write(response).addListener(ChannelFutureListener.CLOSE); } } }

Target:
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) { if (msg instanceof HttpRequest) { HttpRequest req = (HttpRequest) msg; boolean keepAlive = HttpUtil.isKeepAlive(req); FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, OK, Unpooled.wrappedBuffer(CONTENT)); response.headers().set(CONTENT_TYPE, "text/plain"); response.headers().setInt(CONTENT_LENGTH, response.content().readableBytes()); if (keepAlive && req.protocolVersion().equals(HttpVersion.HTTP_1_0)) { response.headers().set(CONNECTION, KEEP_ALIVE); } else { response.headers().set(CONNECTION, CLOSE); } ChannelFuture f = ctx.write(response); if (!keepAlive) { f.addListener(ChannelFutureListener.CLOSE); } } }
Source:
public void validateAttributeIds(final BindingResult errors, final List<String> attributeIds) { if (attributeIds == null) { return; } for (final String id: attributeIds) { final Attribute attribute = this.germplasmDataManager.getAttributeById(Integer.valueOf(id)); if (attribute == null) { errors.reject("attribute.invalid", ""); return; } } }

Target:
public void validateAttributeIds(final BindingResult errors, final List<String> attributeIds) { if (attributeIds == null || attributeIds.isEmpty()) { return; } final List<Integer> ids = attributeIds.stream().map(attributeId -> Integer.valueOf(attributeId)).distinct().collect(Collectors.toList()); final List<Attribute> attributes = this.germplasmDataManager.getAttributeByIds(ids); if (attributes.size() != ids.size()) { errors.reject("attribute.invalid", ""); return; } }
Source:
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { Object root = context.getDefaultVariable(); if (root instanceof File) { return EvaluationResult.valueOf( new File((File)root, this.path).isDirectory() ); } else if (root instanceof IContainer) { return EvaluationResult.valueOf( ((IContainer)root).getFolder(new Path(this.path)).exists() ); } else if (root instanceof IAdaptable) { IContainer container = ((IAdaptable)root).getAdapter(IContainer.class); return EvaluationResult.valueOf( container.getFolder(new Path(this.path)).exists() ); } return EvaluationResult.FALSE; }

Target:
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { Object root = context.getDefaultVariable(); if (root instanceof File) { return EvaluationResult.valueOf( new File((File)root, this.path).isDirectory() ); } else { IContainer container = Adapters.adapt(root, IContainer.class); return EvaluationResult.valueOf( container.getFolder(new Path(this.path)).exists() ); } }
Source:
private boolean addService(Microservice service) { Map<String, MicroservicesRegistryImpl> microservicesRegistries = org.wso2.msf4j.internal.DataHolder.getInstance().getMicroservicesRegistries(); if (microservicesRegistries.isEmpty()) { log.error("Microservice deployment failed. Microservices Registry doesn't exist to register microservice."); return false; } microservicesRegistries.values().forEach(registry -> registry.addService(service)); log.info("Microservice deployed successfully"); return true; }

Target:
private boolean addService(Microservice service) { Map<String, MicroservicesRegistryImpl> microservicesRegistries = org.wso2.msf4j.internal.DataHolder.getInstance().getMicroservicesRegistries(); if (microservicesRegistries.isEmpty()) { log.error("Microservice deployment failed. Microservices Registry doesn't exist to register microservice."); return false; } microservicesRegistries.values().forEach(registry -> registry.addService(service)); log.info("Microservice deployed successfully", service.getClass().getName()); return true; }
Source:
public void setupMockElide() { HashMapDataStore inMemoryStore = new HashMapDataStore(AsyncQuery.class.getPackage()); Map<String, Class<? extends Check>> checkMappings = new HashMap<>(); elide = new Elide( new ElideSettingsBuilder(inMemoryStore) .withEntityDictionary(new EntityDictionary(checkMappings)) .build()); asyncQueryDao = mock(DefaultAsyncQueryDAO.class); queryObj1 = mock(AsyncQuery.class); queryObj2 = mock(AsyncQuery.class); queryObj3 = mock(AsyncQuery.class); testUser = mock(User.class); AsyncExecutorService.init(elide, 5, 60, asyncQueryDao); service = AsyncExecutorService.getInstance(); asyncQueryUpdateThread = mock(AsyncQueryUpdateThread.class); }

Target:
public void setupMockElide() { HashMapDataStore inMemoryStore = new HashMapDataStore(AsyncQuery.class.getPackage()); Map<String, Class<? extends Check>> checkMappings = new HashMap<>(); elide = new Elide( new ElideSettingsBuilder(inMemoryStore) .withEntityDictionary(new EntityDictionary(checkMappings)) .build()); asyncQueryDao = mock(DefaultAsyncQueryDAO.class); testUser = mock(User.class); AsyncExecutorService.init(elide, 5, 60, asyncQueryDao); service = AsyncExecutorService.getInstance(); asyncQueryUpdateThread = mock(AsyncQueryUpdateThread.class); }
Source:
protected Command getOpenCommand(Request request) { EditPart targetEditPart = getTargetEditPart(request); if (targetEditPart instanceof IGraphicalEditPart) { IGraphicalEditPart editPart = (IGraphicalEditPart) targetEditPart; View view = editPart.getNotationView(); if (view != null) { EObject element = ViewUtil.resolveSemanticElement(view); if (element instanceof DRepresentationDescriptor) { DRepresentationDescriptor descriptor = (DRepresentationDescriptor) element; EditPartViewer viewer = editPart.getViewer(); IEditorPart editor = (IEditorPart) ((DiagramEditDomain) viewer.getEditDomain()).getDiagramEditorPart(); Session session = ((SessionEditorInput) editor.getEditorInput()).getSession(); return new ICommandProxy(new GMFCommandWrapper(session.getTransactionalEditingDomain(), new NavigateToCommand(session, descriptor.getRepresentation()))); } } } return null; }

Target:
protected Command getOpenCommand(Request request) { EditPart targetEditPart = getTargetEditPart(request); if (targetEditPart instanceof IGraphicalEditPart) { IGraphicalEditPart editPart = (IGraphicalEditPart) targetEditPart; View view = editPart.getNotationView(); if (view != null) { EObject element = ViewUtil.resolveSemanticElement(view); if (element instanceof DRepresentationDescriptor) { DRepresentationDescriptor descriptor = (DRepresentationDescriptor) element; Optional<Session> sessionOption = Session.of(descriptor); if (sessionOption.isPresent()) { Session session = sessionOption.get(); return new ICommandProxy(new GMFCommandWrapper(session.getTransactionalEditingDomain(), new NavigateToCommand(session, descriptor.getRepresentation()))); } } } } return null; }
Source:
public Header getLabel() { return (Header)label; }

Target:
public Header getLabel() { return (Header) super.getLabel(); }
Source:
private void checkField(final CertifiedProductSearchDetails product, final Object field, final String errorField) { if (field instanceof Long) { Long fieldCasted = (Long) field; if (fieldCasted.toString().length() > getMaxLength("maxLength." + errorField)) { CertifiedProductSearchDetails productCasted = (CertifiedProductSearchDetails) product; productCasted.getErrorMessages().add(msgUtil.getMessage("listing." + errorField + ".maxlength", String.valueOf(getMaxLength("maxLength." + errorField)), fieldCasted)); } } else if (field instanceof String) { String fieldCasted = (String) field; if (fieldCasted.length() > getMaxLength("maxLength." + errorField)) { CertifiedProductSearchDetails productCasted = (CertifiedProductSearchDetails) product; productCasted.getErrorMessages().add(msgUtil.getMessage("listing." + errorField + ".maxlength", String.valueOf(getMaxLength("maxLength." + errorField)), fieldCasted)); } } }

Target:
private void checkField(final CertifiedProductSearchDetails product, final Object field, final String errorField) { if (field instanceof Long) { Long fieldCasted = (Long) field; if (fieldCasted.toString().length() > getMaxLength("maxLength." + errorField)) { product.getErrorMessages().add(msgUtil.getMessage("listing." + errorField + ".maxlength", String.valueOf(getMaxLength("maxLength." + errorField)), fieldCasted)); } } else if (field instanceof String) { String fieldCasted = (String) field; if (fieldCasted.length() > getMaxLength("maxLength." + errorField)) { product.getErrorMessages().add(msgUtil.getMessage("listing." + errorField + ".maxlength", String.valueOf(getMaxLength("maxLength." + errorField)), fieldCasted)); } } }
Source:
public Mono<Response<AnalyzeSentimentResultCollection>> analyzeSentimentBatch( Iterable<TextDocumentInput> documents, AnalyzeSentimentOptions options) { try { inputDocumentsValidation(documents); return withContext(context -> getAnalyzedSentimentResponse(documents, options == null ? false : options.isIncludeOpinionMining(), options == null ? null : options.getRequestOptions(), context)); } catch (RuntimeException ex) { return monoError(logger, ex); } }

Target:
public Mono<Response<AnalyzeSentimentResultCollection>> analyzeSentimentBatch( Iterable<TextDocumentInput> documents, AnalyzeSentimentOptions options) { try { inputDocumentsValidation(documents); return withContext(context -> getAnalyzedSentimentResponse(documents, options, context)); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
@Override public String toString() { return "MetaData{metadata=" + metadata + '}'; }

Target:
public String toString() { return "MetaData{metadata=" + metadata + '}'; }
Source:
public static <T> NotifyingFuture<Void> andThen(final NotifyingFuture<T> future, final Runnable after, final ExecutorService executorService) { final NotifyingFutureImpl<Void> result = new NotifyingFutureImpl<>(); final CountDownLatch countDownLatch = new CountDownLatch(1); Future afterFuture = executorService.submit(new Runnable() { @Override public void run() { try { countDownLatch.await(); future.get(); after.run(); result.notifyDone(null); } catch (InterruptedException e) { future.cancel(true); Thread.currentThread().interrupt(); } catch (Exception e) { result.notifyException(e); } } }); result.setFuture(afterFuture); FutureListener<T> listener = new FutureListener<T>() { @Override public void futureDone(Future<T> future) { countDownLatch.countDown(); } }; if (future.isDone()) { listener.futureDone(future); } else { future.attachListener(listener); } return result; }

Target:
public static <T> NotifyingFuture<Void> andThen(final NotifyingFuture<T> future, final Runnable after, final ExecutorService executorService) { final NotifyingFutureImpl<Void> result = new NotifyingFutureImpl<>(); final CountDownLatch countDownLatch = new CountDownLatch(1); Future afterFuture = executorService.submit(new Runnable() { @Override public void run() { try { countDownLatch.await(); future.get(); after.run(); result.notifyDone(null); } catch (InterruptedException e) { future.cancel(true); Thread.currentThread().interrupt(); } catch (Exception e) { result.notifyException(e); } } }); result.setFuture(afterFuture); FutureListener<T> listener = new FutureListener<T>() { @Override public void futureDone(Future<T> future) { countDownLatch.countDown(); } }; future.attachListener(listener); return result; }
Source:
public boolean doMonitor(ServiceEmitter emitter) { final ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder(); MonitorUtils.addDimensionsToBuilder( builder, dimensions ); emitter.emit(builder.build("jetty/numConns", activeConnections.get())); return true; }

Target:
public boolean doMonitor(ServiceEmitter emitter) { final ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder(); MonitorUtils.addDimensionsToBuilder( builder, dimensions ); emitter.emit(builder.build("jetty/numOpenConnections", activeConnections.get())); return true; }
Source:
public TextView getDayOfMonthTextView() { if (dayOfMonthTextView == null) { throw new IllegalStateException( "You have to setDayMonthOfView in your custom DayViewAdapter." ); } return dayOfMonthTextView; }

Target:
public TextView getDayOfMonthTextView() { if (dayOfMonthTextView == null) { throw new IllegalStateException( "You have to setDayOfMonthTextView in your custom DayViewAdapter." ); } return dayOfMonthTextView; }
Source:
public CompletableFuture<Object> executeClientCommand(ExecuteCommandParams params) { return executeCliendCommandTransmitter.executeClientCommand(params); }

Target:
public CompletableFuture<Object> executeClientCommand(ExecuteCommandParams params) { return executeCliendCommandTransmitter.executeClientCommand(convertParams(params)); }
Source:
public SettableFuture schedule(SourceScheduler scheduler) { checkState(initialScheduled); List<Lifespan> recentlyCompletedDriverGroups; synchronized (this) { recentlyCompletedDriverGroups = ImmutableList.copyOf(this.recentlyCompletedDriverGroups); this.recentlyCompletedDriverGroups.clear(); newDriverGroupReady = SettableFuture.create(); } for (Lifespan driverGroup : recentlyCompletedDriverGroups) { if (!driverGroups.hasNext()) { break; } int driverGroupId = driverGroups.nextInt(); checkState(!bucketNodeMap.getAssignedNode(driverGroupId).isPresent()); Node nodeForCompletedDriverGroup = bucketNodeMap.getAssignedNode(driverGroup.getId()).get(); bucketNodeMap.assignOrChangeBucketToNode(driverGroupId, nodeForCompletedDriverGroup); scheduler.startLifespan(Lifespan.driverGroup(driverGroupId), partitionHandles.get(driverGroupId)); } if (!driverGroups.hasNext()) { scheduler.noMoreLifespans(); } return newDriverGroupReady; }

Target:
public SettableFuture schedule(SourceScheduler scheduler) { checkState(initialScheduled); List<Lifespan> recentlyCompletedDriverGroups; synchronized (this) { recentlyCompletedDriverGroups = ImmutableList.copyOf(this.recentlyCompletedDriverGroups); this.recentlyCompletedDriverGroups.clear(); newDriverGroupReady = SettableFuture.create(); } for (Lifespan driverGroup : recentlyCompletedDriverGroups) { if (!driverGroups.hasNext()) { break; } int driverGroupId = driverGroups.nextInt(); Node nodeForCompletedDriverGroup = bucketNodeMap.getAssignedNode(driverGroup.getId()).orElseThrow(IllegalStateException::new); bucketNodeMap.assignBucketToNode(driverGroupId, nodeForCompletedDriverGroup); scheduler.startLifespan(Lifespan.driverGroup(driverGroupId), partitionHandles.get(driverGroupId)); } if (!driverGroups.hasNext()) { scheduler.noMoreLifespans(); } return newDriverGroupReady; }
Source:
private void stopVms() { List<VM> vmsInPool = DbFacade.getInstance().getVmDao().getAllForVmPool(getVmPoolId()); for (VM vm : vmsInPool) { if (!vm.isDown()) { CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.StopVm, withRootCommandInfo(new StopVmParameters(vm.getId(), StopVmTypeEnum.NORMAL), getActionType()), cloneContextAndDetachFromParent()); } } }

Target:
private boolean stopVms() { for (VM vm : getVmsInPool()) { if (!vm.isDown()) { VdcReturnValueBase result = runInternalAction( VdcActionType.StopVm, withRootCommandInfo(new StopVmParameters(vm.getId(), StopVmTypeEnum.NORMAL), getActionType()), cloneContextAndDetachFromParent()); if (!result.getSucceeded()) { return false; } } } }
Source:
private Dictionary<String, Object> copyConfigProperties( Dictionary<String, Object> properties, String factoryPid) { Dictionary<String, Object> copiedProperties = new Hashtable<>(); ObjectClassDefinition objectClassDefinition = getObjectClassDefinition(factoryPid); if (objectClassDefinition == null) { return copiedProperties; } Stream.of(objectClassDefinition) .map(ocd -> ocd.getAttributeDefinitions(ObjectClassDefinition.ALL)) .flatMap(Arrays::stream) .map(AttributeDefinition::getID) .filter(id -> properties.get(id) != null) .forEach(id -> copiedProperties.put(id, properties.get(id))); return copiedProperties; }

Target:
private Dictionary<String, Object> copyConfigProperties( Dictionary<String, Object> properties, String factoryPid) { final Dictionary<String, Object> copiedProperties = new Hashtable<>(); ObjectClassDefinition objectClassDefinition = getObjectClassDefinition(factoryPid); if (objectClassDefinition == null) { LOGGER.debug( "ObjectClassDefinition not found for factoryPid: {}. Unable to copy properties.", factoryPid); throw new IllegalStateException( "ObjectClassDefinition not found for factoryPid: " + factoryPid); } Stream.of(objectClassDefinition) .map(ocd -> ocd.getAttributeDefinitions(ObjectClassDefinition.ALL)) .flatMap(Arrays::stream) .map(AttributeDefinition::getID) .forEach(id -> copyIfDefined(id, properties, copiedProperties)); copyIfDefined( RegistryConstants.CONFIGURATION_REGISTRY_ID_PROPERTY, properties, copiedProperties); return copiedProperties; }
Source:
public void resourceOffers(final SchedulerDriver driver, final List<Offer> offers) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("> resourceOffers(driver : {}, offers : {})", driver, protoToString(offers)); } configuration.getSeedManager().syncSeeds(clock.now().getMillis()); for (final Offer offer : offers) { final Marker marker = MarkerFactory.getMarker("offerId:" + offer.getId().getValue() + ",hostname:" + offer.getHostname()); final boolean offerUsed = evaluateOffer(driver, marker, offer); if (!offerUsed) { LOGGER.trace(marker, "Declining Offer: {}", offer.getId().getValue()); driver.declineOffer(offer.getId()); } } if (LOGGER.isDebugEnabled()) { LOGGER.debug("< resourceOffers(driver : {}, offers : {})", driver, protoToString(offers)); } }

Target:
public void resourceOffers(final SchedulerDriver driver, final List<Offer> offers) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("> resourceOffers(driver : {}, offers : {})", driver, protoToString(offers)); } for (final Offer offer : offers) { final Marker marker = MarkerFactory.getMarker("offerId:" + offer.getId().getValue() + ",hostname:" + offer.getHostname()); final boolean offerUsed = evaluateOffer(driver, marker, offer); if (!offerUsed) { LOGGER.trace(marker, "Declining Offer: {}", offer.getId().getValue()); driver.declineOffer(offer.getId()); } } if (LOGGER.isDebugEnabled()) { LOGGER.debug("< resourceOffers(driver : {}, offers : {})", driver, protoToString(offers)); } }
Source:
public void setUp() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException{ virusInputStream = setupInputStream(ATTACHMENT_TEST_FILE_PATH + File.separator + VIRUS_FILE_NAME); goodInputStream = setupInputStream(ATTACHMENT_TEST_FILE_PATH + File.separator + GOOD_FILE_NAME); noteVirus = setupMockNote(String.valueOf(new Guid())); attachmentService = new CuAttachmentServiceImpl(); attachmentService.setKualiConfigurationService(buildMockConfigurationService()); attachmentService.setAttachmentDao(buildMockAttachmentDao()); attachmentService.setNoteService(buildMockNoteService()); attachmentService.setAntiVirusService(buildMockAntiVirusService()); attachment = new Attachment(); attachment.setObjectId(String.valueOf(new Guid())); attachment.setAttachmentIdentifier(attachment.getObjectId()); Note noteGood = setupMockNote(String.valueOf(new Guid())); attachment.setNote(noteGood); createAttachmentFile(noteGood, GOOD_FILE_NAME); createAttachmentFile(noteVirus, VIRUS_FILE_NAME); }

Target:
public void setUp() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException { virusInputStream = setupInputStream(ATTACHMENT_TEST_FILE_PATH + File.separator + VIRUS_FILE_NAME); goodInputStream = setupInputStream(ATTACHMENT_TEST_FILE_PATH + File.separator + GOOD_FILE_NAME); errorInputStream = setupInputStream(ATTACHMENT_TEST_FILE_PATH + File.separator + ERROR_FILE_NAME); noteVirus = setupMockNote(String.valueOf(new Guid())); attachmentService = new CuAttachmentServiceImpl(); attachmentService.setKualiConfigurationService(buildMockConfigurationService()); attachmentService.setAttachmentDao(buildMockAttachmentDao()); attachmentService.setNoteService(buildMockNoteService()); attachmentService.setAntiVirusService(buildMockAntiVirusService()); attachment = new Attachment(); attachment.setObjectId(String.valueOf(new Guid())); attachment.setAttachmentIdentifier(attachment.getObjectId()); Note noteGood = setupMockNote(String.valueOf(new Guid())); attachment.setNote(noteGood); createAttachmentFile(noteGood, GOOD_FILE_NAME); createAttachmentFile(noteVirus, VIRUS_FILE_NAME); }
Source:
public void write_record_bulk() { final RecordStorage<I> storage = getStorage(); final int bulkSize = 5; final Map<I, EntityRecordWithStorageFields> initial = new HashMap<>(bulkSize); for (int i = 0; i < bulkSize; i++) { final I id = newId(); final EntityRecord record = newStorageRecord(id); initial.put(id, new EntityRecordWithStorageFields(record)); } storage.write(initial); final Collection<EntityRecord> actual = newLinkedList( storage.readMultiple(initial.keySet()) ); final Collection<EntityRecord> expected = Collections2.transform(initial.values(), new Function<EntityRecordWithStorageFields, EntityRecord>() { @Override public EntityRecord apply(@Nullable EntityRecordWithStorageFields record) { assertNotNull(record); return record.getRecord(); } }); assertEquals(expected.size(), actual.size()); assertTrue(actual.containsAll(expected)); close(storage); }

Target:
public void write_record_bulk() { final RecordStorage<I> storage = getStorage(); final int bulkSize = 5; final Map<I, EntityRecordWithColumns> initial = new HashMap<>(bulkSize); for (int i = 0; i < bulkSize; i++) { final I id = newId(); final EntityRecord record = newStorageRecord(id); initial.put(id, EntityRecordWithColumns.of(record)); } storage.write(initial); final Collection<EntityRecord> actual = newLinkedList( storage.readMultiple(initial.keySet()) ); final Collection<EntityRecord> expected = Collections2.transform(initial.values(), RECORD_EXTRACTOR_FUNCTION); assertEquals(expected.size(), actual.size()); assertTrue(actual.containsAll(expected)); close(storage); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Parameter)) return false; Parameter parameter = (Parameter) o; return Objects.equals(key, parameter.key) && Objects.equals(value, parameter.value); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Parameter)) return false; Parameter parameter = (Parameter) o; return Objects.equals(key, parameter.key); }
Source:
public void onScrollChanged(int oldScrollY, int scrollY, boolean isHumanScroll) { if (webview == null) { return; } onScrolled(oldScrollY, scrollY); if (scrollY <= webview.getHeight()) { ensureDisplayed(); return; } int animMargin = 0; int scrollDelta = scrollY - oldScrollY; if (!isHumanScroll) { animMargin = 0; } else if (gravity == Gravity.BOTTOM) { if (oldScrollY < scrollY) { animMargin = Math.min(hideableView.getHeight(), (int) hideableView.getTranslationY() + scrollDelta); } else { animMargin = Math.max(0, (int) hideableView.getTranslationY() + scrollDelta); } } else if (gravity == Gravity.TOP) { if (oldScrollY > scrollY) { animMargin = Math.min(0, (int) hideableView.getTranslationY() - scrollDelta); } else { animMargin = Math.max(-hideableView.getHeight(), (int) hideableView.getTranslationY() - scrollDelta); } } hideableView.setTranslationY(animMargin); }

Target:
public void onScrollChanged(int oldScrollY, int scrollY, boolean isHumanScroll) { if (webView == null) { return; } onScrolled(oldScrollY, scrollY); if (scrollY <= webView.getHeight()) { ensureDisplayed(); return; } int animMargin = 0; int scrollDelta = scrollY - oldScrollY; if (!isHumanScroll) { animMargin = 0; } else if (gravity == Gravity.BOTTOM) { if (oldScrollY < scrollY) { animMargin = Math.min(hideableView.getHeight(), (int) hideableView.getTranslationY() + scrollDelta); } else { animMargin = Math.max(0, (int) hideableView.getTranslationY() + scrollDelta); } } else if (gravity == Gravity.TOP) { if (oldScrollY > scrollY) { animMargin = Math.min(0, (int) hideableView.getTranslationY() - scrollDelta); } else { animMargin = Math.max(-hideableView.getHeight(), (int) hideableView.getTranslationY() - scrollDelta); } } hideableView.setTranslationY(animMargin); }
Source:
public ValidationResult isLunDiskVisible(final LUNs lun, VDS vds) { GetDeviceListVDSCommandParameters parameters = new GetDeviceListVDSCommandParameters(vds.getId(), lun.getLunType()); List<LUNs> luns = (List<LUNs>) getVdsBroker().RunVdsCommand( VDSCommandType.GetDeviceList, parameters).getReturnValue(); boolean lunExists = CollectionUtils.exists(luns, new Predicate() { @Override public boolean evaluate(Object o) { return ((LUNs) o).getId().equals(lun.getId()); } }); return lunExists ? ValidationResult.VALID : new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_NOT_VALID); }

Target:
public ValidationResult isLunDiskVisible(final LUNs lun, VDS vds) { List<LUNs> luns = executeGetDeviceList(vds.getId(), lun.getLunType()); boolean lunExists = CollectionUtils.exists(luns, new Predicate() { @Override public boolean evaluate(Object o) { return ((LUNs) o).getId().equals(lun.getId()); } }); return lunExists ? ValidationResult.VALID : new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_INVALID); }
Source:
public String evaluate(DeferredObject[] arguments) throws HiveException{ String text; String lang = "en"; if (arguments.length >= 0 && inputsOI != null) { text = inputsOI[0].getPrimitiveJavaObject(arguments[0].get()); if (arguments.length > 1) { lang = inputsOI[1].getPrimitiveJavaObject(arguments[1].get()); } if (text == null) { return EMPTY; } List<String> words = new ArrayList<>(); try ( Analyzer analyzer = analyzersCache.get(lang); TokenStream ts = analyzer.tokenStream(EMPTY, new StringReader(text)); ) { ts.reset(); CharTermAttribute cattr = ts.getAttribute(CharTermAttribute.class); while (ts.incrementToken()) { words.add(cattr.toString()); } } catch (IOException e) { return text; } return Joiner.on(" ").join(words); } return EMPTY; }

Target:
public String evaluate(DeferredObject[] arguments) throws HiveException{ String text; String lang = "en"; if (arguments.length >= 0 && inputsOI != null) { text = inputsOI[0].getPrimitiveJavaObject(arguments[0].get()); if (arguments.length > 1) { lang = inputsOI[1].getPrimitiveJavaObject(arguments[1].get()); } if (text == null) { return EMPTY; } List<String> words = new ArrayList<>(); Analyzer analyzer = analyzersCache.get(lang); if (analyzer == null ) { analyzer = defaultAnalyzer; } try ( TokenStream ts = analyzer.tokenStream(EMPTY, new StringReader(text)); ) { ts.reset(); CharTermAttribute cattr = ts.getAttribute(CharTermAttribute.class); while (ts.incrementToken()) { words.add(cattr.toString()); } } catch (IOException e) { return text; } return Joiner.on(" ").join(words); } return EMPTY; }
Source:
private File compileJava(File source, File... extraDeps) { JavaCompile compile = project.getTasks().create(getNextCompileName(), JavaCompile.class); try { File output = project.file("build/" + compile.getName() + "/"); if (output.exists()) { FileUtils.cleanDirectory(output); } else { output.mkdirs(); } Set<File> files = Sets.newHashSet(this.extraDataFiles); for (File ext : extraDeps) files.add(ext); compile.setClasspath(project.files(files)); if (parent != null) { compile.setSourceCompatibility(parent.getConfig().getSourceCompatibility()); compile.setTargetCompatibility(parent.getConfig().getTargetCompatibility()); } else { final JavaPluginConvention java = project.getConvention().findPlugin(JavaPluginConvention.class); if (java != null) { compile.setSourceCompatibility(java.getSourceCompatibility().toString()); compile.setTargetCompatibility(java.getTargetCompatibility().toString()); } } compile.setDestinationDir(output); compile.setSource(source.isDirectory() ? project.fileTree(source) : project.zipTree(source)); compile.getOutputs().setHistory(new TaskExecutionHistory() { @Override public Set<File> getOutputFiles() { return Sets.newHashSet(); } @Nullable @Override public OverlappingOutputs getOverlappingOutputs() { return null; } @Nullable @Override public OriginTaskExecutionMetadata getOriginExecutionMetadata() { return null; } }); Method compileMethod = JavaCompile.class.getDeclaredMethod("compile"); compileMethod.setAccessible(true); compileMethod.invoke(compile); return output; } catch (Exception e) { e.printStackTrace(); return null; } finally { project.getTasks().remove(compile); } }

Target:
private File compileJava(File source, File... extraDeps) { HackyJavaCompile compile = project.getTasks().create(getNextCompileName(), HackyJavaCompile.class); try { File output = project.file("build/" + compile.getName() + "/"); if (output.exists()) { FileUtils.cleanDirectory(output); } else { output.mkdirs(); } Set<File> files = Sets.newHashSet(this.extraDataFiles); for (File ext : extraDeps) files.add(ext); compile.setClasspath(project.files(files)); if (parent != null) { compile.setSourceCompatibility(parent.getConfig().getSourceCompatibility()); compile.setTargetCompatibility(parent.getConfig().getTargetCompatibility()); } else { final JavaPluginConvention java = project.getConvention().findPlugin(JavaPluginConvention.class); if (java != null) { compile.setSourceCompatibility(java.getSourceCompatibility().toString()); compile.setTargetCompatibility(java.getTargetCompatibility().toString()); } } compile.setDestinationDir(output); compile.setSource(source.isDirectory() ? project.fileTree(source) : project.zipTree(source)); compile.doHackyCompile(); return output; } catch (Exception e) { e.printStackTrace(); return null; } finally { project.getTasks().remove(compile); } }
Source:
public void checkPreviewUpdatedAfterDestroyRecreate() { waitFor(mActivityRule.getActivity().mPreviewIdlingResource); pressBackButton(); mIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); mActivityRule.getActivity().startActivity(mIntent); waitFor(new ElapsedTimeIdlingResource(LAUNCH_TIMEOUT_MS)); Assert.assertTrue(mActivityRule.getActivity().mPreviewIdlingResource.isIdleNow()); }

Target:
public void checkPreviewUpdatedAfterDestroyRecreate() { waitFor(mActivityRule.getActivity().mPreviewIdlingResource); pressBackButton(); resetPreviewIdlingResource(); mIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); mActivityRule.launchActivity(mIntent); waitFor(mActivityRule.getActivity().mPreviewIdlingResource); }
Source:
int computeStepCount(final int start) { if (start <= 0) throw new IllegalArgumentException("Only natural numbers are allowed"); if (start == 1) return 0; final int next = start % 2 == 0 ? start / 2 : 3 * start + 1; return 1 + computeStepCount(next); }

Target:
int computeStepCount(final int start) { if (start <= 0) throw new IllegalArgumentException("Only natural numbers are allowed"); if (start == 1) return 0; final int next; if (start % 2 == 0) { next = start / 2; } else { next = 3 * start + 1; } return 1 + computeStepCount(next); }
Source:
public boolean wantsBlood() { return bloodTimer > 0; }

Target:
public boolean wantsBlood() { return false; }
Source:
public StitchList(EntityDictionary entityDictionary) { this.objectLookups = new ConcurrentHashMap<>(); this.todoList = Collections.synchronizedList(new ArrayList<>()); this.entityDictionary = entityDictionary; }

Target:
public StitchList(EntityDictionary entityDictionary) { this.objectLookups = new HashMap<>(); this.todoList = new ArrayList<>(); this.entityDictionary = entityDictionary; }
Source:
public Schema apply(Schema originalSchema) throws SchemaSyncError { Database database = originalSchema.findDatabase(dbName); if ( database != null && !ifNotExists) { throw new SchemaSyncError("Unexpectedly asked to create existing database " + dbName); } Schema newSchema = originalSchema.copy(); database = new Database(dbName, null); newSchema.getDatabases().add(database); return newSchema; }

Target:
public Schema apply(Schema originalSchema) throws SchemaSyncError { Database database = originalSchema.findDatabase(dbName); if ( database != null ) { if ( ifNotExists ) return originalSchema; else throw new SchemaSyncError("Unexpectedly asked to create existing database " + dbName); } Schema newSchema = originalSchema.copy(); database = new Database(dbName, null); newSchema.getDatabases().add(database); return newSchema; }
Source:
public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof String); String notes = (String)checkNotNull(input, "input"); request.setPayload(buildJson(notes)); return request; }

Target:
public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof String); String notes = (String)input; request.setPayload(buildJson(notes)); return request; }
Source:
public String getFailedTotalLow() { return thresholds.failedTotalNormal; }

Target:
public String getFailedTotalLow() { return thresholds.failedTotalLow; }
Source:
public static <A> String join(final String delimiter, final Iterable<A> iterable) { final StringBuilder sb = new StringBuilder(); for (final A i : iterable) { if (sb.length() > 0) sb.append(delimiter); sb.append(i.toString()); } return sb.toString(); }

Target:
public static <A> String join(final String delimiter, final Iterable<A> iterable) { if (delimiter == null || iterable == null) { throw new IllegalArgumentException("join argument is null. delimiter: " + delimiter + " iterable: " + iterable); } final StringBuilder sb = new StringBuilder(); for (final A i : iterable) { if (i == null) continue; if (sb.length() > 0) sb.append(delimiter); sb.append(i.toString()); } return sb.toString(); }
Source:
public static int StaticConditionNulls() { Object a = null; Object b = null; return (a == b) ? 5 : 2; }

Target:
public static int StaticConditionNulls() { Object a = getNull(); Object b = getNull(); return (a == b) ? 5 : 2; }
Source:
private void mapFailedTestToTestReport(StringBuilder builder, CaseResult failedTest) { builder.append("## <code>").append(failedTest.getTransformedFullDisplayName().trim()).append("</code>") .append("\n"); if (StringUtils.isNotBlank(failedTest.getErrorDetails())) { builder.append("<pre><code>").append(failedTest.getErrorDetails().trim()).append("</code></pre>") .append("\n"); } if (StringUtils.isNotBlank(failedTest.getErrorStackTrace())) { builder.append("<details><summary>Stack trace</summary>").append("\n") .append("<pre><code>").append(failedTest.getErrorStackTrace().trim()).append("</code></pre>") .append("</details>") .append("\n"); } if (StringUtils.isNotBlank(failedTest.getStderr())) { builder.append("<details><summary>Standard error</summary>").append("\n") .append("<pre><code>").append(failedTest.getStderr().trim()).append("</code></pre>") .append("</details>") .append("\n"); } if (StringUtils.isNotBlank(failedTest.getStdout())) { builder.append("<details><summary>Standard out</summary>").append("\n") .append("<pre><code>").append(failedTest.getStdout().trim()).append("</code></pre>") .append("</details>") .append("\n"); } builder.append("\n"); }

Target:
private void mapFailedTestToTestReport(StringBuilder builder, CaseResult failedTest) { builder.append("## `").append(failedTest.getTransformedFullDisplayName().trim()).append("`") .append("\n"); if (StringUtils.isNotBlank(failedTest.getErrorDetails())) { builder.append(codeTextFencedBlock(failedTest.getErrorDetails())) .append("\n"); } if (StringUtils.isNotBlank(failedTest.getErrorStackTrace())) { builder.append("<details><summary>Stack trace</summary>\n") .append(codeTextFencedBlock(failedTest.getErrorStackTrace())) .append("</details>\n"); } if (StringUtils.isNotBlank(failedTest.getStderr())) { builder.append("<details><summary>Standard error</summary>\n") .append(codeTextFencedBlock(failedTest.getStderr())) .append("</details>\n"); } if (StringUtils.isNotBlank(failedTest.getStdout())) { builder.append("<details><summary>Standard out</summary>\n") .append(codeTextFencedBlock(failedTest.getStdout())) .append("</details>\n"); } builder.append("\n"); }
Source:
public boolean equals(Object o) { if (!(o instanceof DefaultUdtValue)) return false; DefaultUdtValue that = (DefaultUdtValue) o; if (!type.equals(that.type)) return false; if (size() != that.size()) return false; if (size() > 0) { for (int i = 0; i < size(); i++) { if (this.getBytesUnsafe(i) == null || that.getBytesUnsafe(i) == null) { if (this.getBytesUnsafe(i) != that.getBytesUnsafe(i)) { return false; } } else if (!getBytesUnsafe(i).equals(that.getBytesUnsafe(i))) return false; } } return true; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof UdtValue)) { return false; } UdtValue that = (UdtValue) o; if (!this.protocolVersion().equals(that.protocolVersion())) { return false; } if (!type.equals(that.getType())) { return false; } for (int i = 0; i < values.length; i++) { DataType innerThisType = type.getFieldTypes().get(i); DataType innerThatType = that.getType().getFieldTypes().get(i); Object thisValue = that.codecRegistry() .codecFor(innerThisType) .decode(this.getBytesUnsafe(i), this.protocolVersion()); Object thatValue = this.codecRegistry() .codecFor(innerThatType) .decode(that.getBytesUnsafe(i), that.protocolVersion()); if (!Objects.equals(thisValue, thatValue)) { return false; } } return true; }
Source:
private RefactoringWizard(RefactoringContext refactoringContext, Refactoring refactoring, int flags) { Assert.isTrue(flags < LAST); if ((flags & DIALOG_BASED_USER_INTERFACE) == 0) flags |= WIZARD_BASED_USER_INTERFACE; Assert.isTrue((flags & DIALOG_BASED_USER_INTERFACE) != 0 || (flags & WIZARD_BASED_USER_INTERFACE) != 0); fRefactoringContext= refactoringContext; fRefactoring= refactoring; fFlags= flags; setNeedsProgressMonitor(true); setChangeCreationCancelable(true); setDefaultPageImageDescriptor(RefactoringPluginImages.DESC_WIZBAN_REFACTOR); }

Target:
private RefactoringWizard(RefactoringContext refactoringContext, Refactoring refactoring, int flags) { Assert.isTrue(flags < LAST); if ((flags & DIALOG_BASED_USER_INTERFACE) == 0) flags |= WIZARD_BASED_USER_INTERFACE; Assert.isTrue((flags & DIALOG_BASED_USER_INTERFACE) != 0 || (flags & WIZARD_BASED_USER_INTERFACE) != 0); fRefactoringContext= refactoringContext; fRefactoring= refactoring; fFlags= flags; setNeedsProgressMonitor(true); setChangeCreationCancelable(true); setWindowTitle(RefactoringUIMessages.RefactoringWizard_title); setDefaultPageImageDescriptor(RefactoringPluginImages.DESC_WIZBAN_REFACTOR); }
Source:
public void update() { updateFullScale(); if (get(new ResourceUrn("engine:sceneOpaque")).dimensions().areDifferentFrom(fullScale)) { disposeAllFBOs(); createFBOs(); notifySubscribers(); WorldRendererImpl worldRendererImpl = ((WorldRendererImpl)context.get(WorldRenderer.class)); worldRendererImpl.initRenderGraph(); } }

Target:
public void update() { updateFullScale(); FBO sceneOpaqueFbo = get(READONLY_GBUFFER); if (sceneOpaqueFbo.dimensions().areDifferentFrom(fullScale)) { disposeAllFBOs(); createFBOs(); notifySubscribers(); } }
Source:
private int[] getSourceBands(final ImageSegment imageSegment) { List<Integer> imageBands = new ArrayList<Integer>(); for (int i = 0; i < imageSegment.getNumBands(); i++) { ImageBand band = imageSegment.getImageBandZeroBase(i); if (null != band.getImageRepresentation()) { switch (band.getImageRepresentation()) { case "R": case "G": case "B": imageBands.add(i); break; default: break; } } } if (imageBands.isEmpty()) { for (int i = 0; i < imageSegment.getNumBands(); i++) { ImageBand band = imageSegment.getImageBandZeroBase(i); if (null != band.getImageRepresentation()) { switch (band.getImageRepresentation()) { case "LU": imageBands.add(i); break; default: break; } } } } if (imageBands.isEmpty()) { for (int i = 0; i < imageSegment.getNumBands(); i++) { ImageBand band = imageSegment.getImageBandZeroBase(i); if (null != band.getImageRepresentation()) { switch (band.getImageRepresentation()) { case "M": imageBands.add(i); break; default: break; } } } } int[] imageBandAry = new int[imageBands.size()]; for (int i = 0; i < imageBands.size(); i++) { imageBandAry[i] = imageBands.get(i); } return imageBandAry; }

Target:
int[] getSourceBands(final ImageSegment imageSegment) { List<Integer> imageBands = new ArrayList<Integer>(); for (String[] bandsToFind : BAND_PRIORITY) { if (!imageBands.isEmpty()) { break; } for (int i = 0; i < imageSegment.getNumBands(); i++) { ImageBand band = imageSegment.getImageBandZeroBase(i); if (null != band.getImageRepresentation()) { if (Arrays.asList(bandsToFind).contains(band.getImageRepresentation())) { imageBands.add(i); } } } } int[] imageBandAry = new int[imageBands.size()]; for (int i = 0; i < imageBands.size(); i++) { imageBandAry[i] = imageBands.get(i); } return imageBandAry; }
Source:
public ItemDropHandler getItemHandler() { return (e, p, item) -> { if (isItem(item.getItemStack())) { if (!Slimefun.hasUnlocked(p, SlimefunItems.ENCHANTMENT_RUNE, true)) { return true; } Slimefun.runSync(() -> activate(p, e, item), 20L); return true; } return false; }; }

Target:
public ItemDropHandler getItemHandler() { return (e, p, item) -> { if (isItem(item.getItemStack())) { if (!Slimefun.hasUnlocked(p, this, true)) { return true; } Slimefun.runSync(() -> activate(p, e, item), 20L); return true; } return false; }; }
Source:
public List<Concept> findPossibleValues(String searchText) { List<Concept> concepts = new ArrayList<>(); try { for (ConceptSearchResult searchResult : Context.getConceptService().getConcepts(searchText, Collections.singletonList(Context.getLocale()), false, null, null, null, null, null, null, null)) { concepts.add(searchResult.getConcept()); } } catch (Exception e) { throw new RuntimeException(e); } return concepts; }

Target:
public List<Concept> findPossibleValues(String searchText) { List<Concept> concepts = new ArrayList<>(); try { for (ConceptSearchResult searchResult : Context.getConceptService().getConcepts(searchText, Collections.singletonList(Context.getLocale()), false, null, null, null, null, null, null, null)) { concepts.add(searchResult.getConcept()); } } catch (Exception e) { log.error("Error", e); } return concepts; }
Source:
public static void main(String[] args) { SeqWareWebServiceClient workflowClient = clients.get("workflow"); String numClientsJSON = workflowClient.countREST(); System.out.println("Number of workflows: " + numClientsJSON); SeqWareWebServiceClient sampleClient = clients.get("sample"); String numSamples = sampleClient.countREST(); System.out.println("Number of samples: " + numSamples); List<Sample> samples = (List<Sample>) getSamplesByName("Fifty"); System.out.println(samples.size()); System.out.println("Sample ID: " + samples.get(0).getSampleId()); List<Sample> samples2 = sampleClient.<Sample>getEntitiesWhereFieldMatchesValue(Sample.class,"name", "Fifty"); System.out.println(samples2.size()); System.out.println("Sample ID: " + samples2.get(0).getSampleId()); List<Sample> samples3 = sampleClient.<Sample>getEntitiesWhereFieldMatchesValue(Sample.class,"title", "FiftyFifty"); System.out.println(samples3.size()); System.out.println("Sample ID: " + samples3.get(0).getSampleId()); createStudy(); createLane(); createExperiment(); try { clients.get("studytype").skip("1"); } catch (UniformInterfaceException e) { System.out.println("Exception Message: "+e.getMessage()); System.out.println("Exception Response Entity: "+e.getResponse().getEntity(String.class)); } createSamples(); }

Target:
public static void main(String[] args) { SeqWareWebServiceClient workflowClient = clients.get("workflow"); String numClientsJSON = workflowClient.countREST(); System.out.println("Number of workflows: " + numClientsJSON); SeqWareWebServiceClient sampleClient = clients.get("sample"); String numSamples = sampleClient.countREST(); System.out.println("Number of samples: " + numSamples); List<Sample> samples = (List<Sample>) getSamplesByName("Fifty"); System.out.println(samples.size()); System.out.println("Sample ID: " + samples.get(0).getSampleId()); List<Sample> samples2 = sampleClient.<Sample>getEntitiesWhereFieldMatchesValue(Sample.class,"name", "Fifty"); System.out.println(samples2.size()); System.out.println("Sample ID: " + samples2.get(0).getSampleId()); List<Sample> samples3 = sampleClient.<Sample>getEntitiesWhereFieldMatchesValue(Sample.class,"title", "FiftyFifty"); System.out.println(samples3.size()); System.out.println("Sample ID: " + samples3.get(0).getSampleId()); createStudy(); createLane(); String studyId = "13"; List<Sample> studySamples = getSamplesForStudy(studyId); System.out.println("# samples in study "+studyId+": "+studySamples.size()); System.out.println(studySamples); try { clients.get("studytype").skip("1"); } catch (UniformInterfaceException e) { System.out.println("Exception Message: "+e.getMessage()); System.out.println("Exception Response Entity: "+e.getResponse().getEntity(String.class)); } createSamples(); createWorkflowRun(); }
Source:
String getSqlStatement() { StringBuilder statement = new StringBuilder(); statement.append(getSelectClause()) .append(getJoinClause()) .append(getWhereClause()); if (isOrderedQuery()) { statement.append(getOrderClause()); if (!orderCriteria.isEmpty()) { statement.append(getLimitClause()); } } return statement.toString(); }

Target:
public String getSqlStatement() throws IOException { return getPreparedStatement().toString(); }