auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setVmLeasesAvailability() { TModel model = getModel(); if (model.getSelectedCluster() == null) { return; } Version compVer = model.getSelectedCluster().getCompatibilityVersion(); if (model.getCustomCompatibilityVersion().getSelectedItem() != null) { compVer = model.getCustomCompatibilityVersion().getSelectedItem(); } boolean vmLeasesSupported = AsyncDataProvider.getInstance().isVmLeasesFeatureSupported(compVer); if (!vmLeasesSupported) { model.getLease().setIsChangeable(false, constants.vmLeasesSupported()); } else { boolean isLeaseStorageDomainChangeable = model.getIsHighlyAvailable().getEntity(); StorageDomain leaseStorageDomain = model.getLease().getSelectedItem(); if (leaseStorageDomain != null) { isLeaseStorageDomainChangeable &= leaseStorageDomain.getStatus() == StorageDomainStatus.Active; } model.getLease().setIsChangeable(isLeaseStorageDomainChangeable); if (!model.getIsHighlyAvailable().getEntity()) { model.getLease().setChangeProhibitionReason(constants.vmLeasesNotSupportedWithoutHA()); } if (leaseStorageDomain != null && leaseStorageDomain.getStatus() != StorageDomainStatus.Active) { getModel().getLease().setChangeProhibitionReason(constants.cannotEditNotActiveLeaseDomain()); } } }

Target:
private void setVmLeasesAvailability() { TModel model = getModel(); if (model.getSelectedCluster() == null) { return; } Version compVer = model.getSelectedCluster().getCompatibilityVersion(); if (model.getCustomCompatibilityVersion().getSelectedItem() != null) { compVer = model.getCustomCompatibilityVersion().getSelectedItem(); } boolean vmLeasesSupported = AsyncDataProvider.getInstance().isVmLeasesFeatureSupported(compVer); if (!vmLeasesSupported) { model.getLease().setIsChangeable(false, constants.vmLeasesSupported()); } else { StorageDomain leaseStorageDomain = model.getLease().getSelectedItem(); if (!model.getIsHighlyAvailable().getEntity()) { model.getLease().setIsChangeable(false); model.getLease().setChangeProhibitionReason(constants.vmLeasesNotSupportedWithoutHA()); } else if (leaseStorageDomain != null && leaseStorageDomain.getStatus() != StorageDomainStatus.Active) { model.getLease().setIsChangeable(false); model.getLease().setChangeProhibitionReason(constants.cannotEditNotActiveLeaseDomain()); } else { model.getLease().setIsChangeable(true); } } }
Source:
public boolean checkTraceType(Class<? extends ITmfTrace> traceClass) { List<Element> elements = getElements(TmfXmlStrings.TRACETYPE); if (elements.isEmpty()) { return true; } for (Element element : elements) { String traceTypeId = element.getAttribute(TmfXmlStrings.ID); TraceTypeHelper helper = TmfTraceType.getInstance().getTraceType( traceTypeId); if (helper != null) { if (helper.getTrace().getClass().isAssignableFrom(traceClass)) { return true; } } } return false; }

Target:
public boolean checkTraceType(Class<? extends ITmfTrace> traceClass) { List<Element> elements = getElements(TmfXmlStrings.TRACETYPE); if (elements.isEmpty()) { return true; } for (Element element : elements) { String traceTypeId = element.getAttribute(TmfXmlStrings.ID); TraceTypeHelper helper = TmfTraceType.getInstance().getTraceType(traceTypeId); if (helper != null && helper.getTrace().getClass().isAssignableFrom(traceClass)) { return true; } } return false; }
Source:
public void startRemoteCache(RemoteCacheHolder remoteCacheHolder) { RemoteCacheImpl<?, ?> remoteCache = remoteCacheHolder.remoteCache; OperationsFactory operationsFactory = new OperationsFactory( transportFactory, remoteCache.getName(), remoteCacheHolder.forceReturnValue, codec, listenerNotifier, asyncExecutorService, configuration); remoteCache.init(marshaller, asyncExecutorService, operationsFactory, configuration.keySizeEstimate(), configuration.valueSizeEstimate(), configuration.batchSize()); }

Target:
private void startRemoteCache(RemoteCacheHolder remoteCacheHolder) { RemoteCacheImpl<?, ?> remoteCache = remoteCacheHolder.remoteCache; OperationsFactory operationsFactory = new OperationsFactory( transportFactory, remoteCache.getName(), remoteCacheHolder.forceReturnValue, codec, listenerNotifier, asyncExecutorService, configuration); remoteCache.init(marshaller, asyncExecutorService, operationsFactory, configuration.keySizeEstimate(), configuration.valueSizeEstimate(), configuration.batchSize()); }
Source:
private static boolean isAlternativeStereotype(BeanManagerImpl beanManager, Class<? extends Annotation> stereotype) { final StereotypeModel<? extends Annotation> model = beanManager.getServices().get(MetaAnnotationStore.class).getStereotype(stereotype); if (model.isValid() && model.isAlternative()) { return true; } return false; }

Target:
private boolean isAlternativeStereotype(BeanManagerImpl beanManager, Class<? extends Annotation> stereotype) { final StereotypeModel<? extends Annotation> model = beanManager.getServices().get(MetaAnnotationStore.class).getStereotype(stereotype); if (model.isValid() && model.isAlternative()) { return true; } return false; }
Source:
private static int getGroupNumber(Pattern[] patterns, String name) { int bestIndex = patterns.length; int bestEnd = -1; int bestPos = Integer.MAX_VALUE; for (int i = 0; i < patterns.length; i++) { final Matcher matcher = patterns[i].matcher(name); if (matcher.find()) { if (matcher.start() < bestPos) { bestIndex = i; bestEnd = matcher.end(); bestPos = matcher.start(); } else if (bestEnd < matcher.end()) { bestIndex = i; bestEnd = matcher.end(); } } } return bestIndex; }

Target:
private static int getGroupNumber(Pattern[] patterns, String name) { int bestIndex = patterns.length; int bestEnd = -1; int bestPos = Integer.MAX_VALUE; for (int i = 0; i < patterns.length; i++) { final Matcher matcher = patterns[i].matcher(name); if (matcher.find()) { if (matcher.start() < bestPos) { bestIndex = i; bestEnd = matcher.end(); bestPos = matcher.start(); } else if (matcher.end() > bestEnd) { bestIndex = i; bestEnd = matcher.end(); } } } return bestIndex; }
Source:
public SecurityGroup removeIpPermission(IpProtocol protocol, int startPort, int endPort, Multimap<String, String> tenantIdGroupNamePairs, Iterable<String> ipRanges, Iterable<String> groupIds, SecurityGroup group) { String region = AWSUtils.getRegionFromLocationOrNull(group.getLocation()); String name = group.getName(); String id = Iterables.get(client.getSecurityGroupApi().get().describeSecurityGroupsInRegion(region, name), 0).getId(); IpPermission.Builder builder = IpPermission.builder(); builder.ipProtocol(protocol); builder.fromPort(startPort); builder.toPort(endPort); if (Iterables.size(ipRanges) > 0) { for (String cidr : ipRanges) { builder.cidrBlock(cidr); } } if (tenantIdGroupNamePairs.size() > 0) { for (String userId : tenantIdGroupNamePairs.keySet()) { for (String groupName : tenantIdGroupNamePairs.get(userId)) { builder.tenantIdGroupNamePair(userId, groupName); } } } client.getSecurityGroupApi().get().revokeSecurityGroupIngressInRegion(region, id, builder.build()); return getSecurityGroupById(new RegionAndName(region, group.getName()).slashEncode()); }

Target:
public SecurityGroup removeIpPermission(IpProtocol protocol, int startPort, int endPort, Multimap<String, String> tenantIdGroupNamePairs, Iterable<String> ipRanges, Iterable<String> groupIds, SecurityGroup group) { String region = AWSUtils.getRegionFromLocationOrNull(group.getLocation()); String name = group.getName(); String id = groupNameToId.apply(new RegionAndName(region, name).slashEncode()); IpPermission.Builder builder = IpPermission.builder(); builder.ipProtocol(protocol); builder.fromPort(startPort); builder.toPort(endPort); if (Iterables.size(ipRanges) > 0) { for (String cidr : ipRanges) { builder.cidrBlock(cidr); } } if (tenantIdGroupNamePairs.size() > 0) { for (String userId : tenantIdGroupNamePairs.keySet()) { for (String groupName : tenantIdGroupNamePairs.get(userId)) { builder.tenantIdGroupNamePair(userId, groupName); } } } client.getSecurityGroupApi().get().revokeSecurityGroupIngressInRegion(region, id, builder.build()); return getSecurityGroupById(new RegionAndName(region, group.getName()).slashEncode()); }
Source:
private void writeMetadata(FeatureCollectionResponse featureCollection, String metadataFeatureName, BufferedWriter w) throws IOException { JDBCDataStore dataStore = getDataStoreForFeatureCollection(featureCollection); Connection cx = null; PreparedStatement stmt = null; ResultSet rs = null; try { cx = dataStore.getConnection(Transaction.AUTO_COMMIT); stmt = cx.prepareStatement("select * from " + metadataFeatureName); rs = stmt.executeQuery(); while (rs.next()) { if (rs.getString(1) != null) { w.write(rs.getString(1)); w.newLine(); } } w.newLine(); w.flush(); } catch (SQLException e) { LOGGER.warning(e.getMessage()); } finally { closeSafe(dataStore, cx, stmt, rs); } }

Target:
private void writeMetadata(FeatureCollectionResponse featureCollection, String metadataFeatureName, BufferedWriter w) throws IOException { JDBCDataStore dataStore = getDataStoreForFeatureCollection(featureCollection); Connection cx = null; PreparedStatement stmt = null; ResultSet rs = null; try { cx = dataStore.getConnection(Transaction.AUTO_COMMIT); stmt = cx.prepareStatement("select * from " + metadataFeatureName); rs = stmt.executeQuery(); while (rs.next()) { String value = rs.getString(1); if (value != null) { w.write(value); w.newLine(); } } w.newLine(); w.flush(); } catch (SQLException e) { LOGGER.warning(e.getMessage()); } finally { closeSafe(dataStore, cx, stmt, rs); } }
Source:
public URI getUrl() { if (uriTemplate == null) { return this.url; } final DefaultUriBuilderFactory defaultUriBuilderFactory = new DefaultUriBuilderFactory(); defaultUriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.URI_COMPONENT); return defaultUriBuilderFactory.expand(uriTemplate.toString(), uriVariables); }

Target:
public URI getUrl() { if (uri == null) { return this.url; } return DEFAULT_URI_BUILDER_FACTORY.expand(uri, uriVariables); }
Source:
public Response<DirectoryAsyncClient> createDirectory(String directoryName, Map<String, String> metadata) { throw new UnsupportedOperationException(); }

Target:
public Response<DirectoryClient> createDirectory(String directoryName, Map<String, String> metadata) { throw new UnsupportedOperationException(); }
Source:
private File writeInputStreamToFile(InputStream inputStream) throws IOException { if (inputStream == null) { throw new IllegalArgumentException("Invalid inputStream: " + inputStream); } File file = File.createTempFile("aws-s3", ".tmp"); if (!file.isFile()) { throw new IOException("Error creating a temporary file."); } try (OutputStream outStream = new FileOutputStream(file)) { byte[] buffer = new byte[1024]; int bytesRead; while ((bytesRead = inputStream.read(buffer)) != -1) { outStream.write(buffer, 0, bytesRead); outStream.flush(); } inputStream.close(); } catch (IOException e) { file.delete(); throw new IOException("Error writing the inputStream into a file.", e); } return file; }

Target:
private File writeInputStreamToFile(InputStream inputStream) throws IOException { if (inputStream == null) { throw new IllegalArgumentException("Invalid inputStream: " + inputStream); } File file = File.createTempFile(TransferStatusUpdater.TEMP_FILE_PREFIX, ".tmp"); OutputStream outStream = new FileOutputStream(file); try { byte[] buffer = new byte[1024]; int bytesRead; while ((bytesRead = inputStream.read(buffer)) != -1) { outStream.write(buffer, 0, bytesRead); outStream.flush(); } } catch (IOException ioException) { file.delete(); throw new IOException("Error writing the inputStream into a file.", ioException); } finally { outStream.close(); } return file; }
Source:
private void relaunchTask(SingularityTask task) { taskManager.savePendingTask(task.getTaskRequest().getPendingTask()); }

Target:
private void relaunchTask(SingularityTask task) { SingularityPendingTask pendingTask = task.getTaskRequest().getPendingTask(); SingularityPendingRequest pendingRequest = new SingularityPendingRequestBuilder() .setRequestId(task.getTaskRequest().getRequest().getId()) .setDeployId(task.getTaskRequest().getDeploy().getId()) .setPendingType(PendingType.RETRY) .setUser(pendingTask.getUser()) .setRunId(pendingTask.getRunId()) .setCmdLineArgsList(pendingTask.getCmdLineArgsList()) .setSkipHealthchecks(pendingTask.getSkipHealthchecks()) .setMessage(pendingTask.getMessage()) .setResources(pendingTask.getResources()) .setS3UploaderAdditionalFiles(pendingTask.getS3UploaderAdditionalFiles()) .setRunAsUserOverride(pendingTask.getRunAsUserOverride()) .setEnvOverrides(pendingTask.getEnvOverrides()) .setExtraArtifacts(pendingTask.getExtraArtifacts()) .setActionId(pendingTask.getActionId()) .setRunAt(pendingTask.getPendingTaskId().getNextRunAt()) .setTimestamp(System.currentTimeMillis()) .build(); requestManager.addToPendingQueue(pendingRequest); }
Source:
private static void adjustFeedbackResponseCommentId(FeedbackResponseCommentAttributes response) { FeedbackQuestionAttributes question = feedbackQuestionsPersisted.get(response.feedbackQuestionId); String newId = feedbackQuestionsLogic.getFeedbackQuestion( response.feedbackSessionName, response.courseId, question.questionNumber).getId(); feedbackQuestionIds.putIfAbsent(question.getId(), newId); response.feedbackQuestionId = feedbackQuestionIds.get(question.getId()); }

Target:
private static void adjustFeedbackResponseCommentId(FeedbackResponseCommentAttributes response) { FeedbackQuestionAttributes question = feedbackQuestionsPersisted.get(response.feedbackQuestionId); if (feedbackQuestionIds.containsKey(question.getId())) { response.feedbackQuestionId = feedbackQuestionIds.get(question.getId()); } else { String newId = feedbackQuestionsLogic.getFeedbackQuestion( response.feedbackSessionName, response.courseId, question.questionNumber).getId(); response.feedbackQuestionId = newId; feedbackQuestionIds.put(question.getId(), newId); } }
Source:
List<String> getLogSegmentsNotInJournal() { LogSegment logSegment = log.getFirstSegment(); Offset firstOffsetInJournal = journal.getFirstOffset(); List<String> logSegmentsToReturn = new ArrayList<>(); while (logSegment != null) { if (!logSegment.getName().equals(firstOffsetInJournal.getName())) { logSegmentsToReturn.add(logSegment.getName()); } else { break; } logSegment = log.getNextSegment(logSegment); } return logSegmentsToReturn; }

Target:
List<String> getLogSegmentsNotInJournal() { LogSegment logSegment = log.getFirstSegment(); Offset firstOffsetInJournal = journal.getFirstOffset(); List<String> logSegmentNamesToReturn = new ArrayList<>(); while (logSegment != null) { if (!logSegment.getName().equals(firstOffsetInJournal.getName())) { logSegmentNamesToReturn.add(logSegment.getName()); } else { break; } logSegment = log.getNextSegment(logSegment); } return logSegmentNamesToReturn.size() > 0 ? logSegmentNamesToReturn : null; }
Source:
public int nextAsInt() throws NumberFormatException { long l = nextAsLong(); if (l > Integer.MAX_VALUE) { throw new NumberFormatException(String.format("Token '%d' cannot be interpreted as an integer as it's value is greater than %d.", l, Integer.MAX_VALUE)); } return (int) l; }

Target:
public int nextAsInt() throws NumberFormatException { long asLongValue = nextAsLong(); if (asLongValue < Integer.MIN_VALUE) { throw new NumberFormatException(String.format("Token '%d' cannot be interpreted as an integer as its value is less than %d.", asLongValue, Integer.MIN_VALUE)); } else if (asLongValue > Integer.MAX_VALUE) { throw new NumberFormatException(String.format("Token '%d' cannot be interpreted as an integer as its value is greater than %d.", asLongValue, Integer.MAX_VALUE)); } return (int) asLongValue; }
Source:
public void readFromNBT(NBTTagCompound nbt) { NBTTagCompound causeTag = nbt.getCompoundTag("cause"); try { cause = (Cause) Class.forName(causeTag.getString("class")).newInstance(); } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) { throw new RuntimeException(e); } cause.readFromNBT(causeTag.getCompoundTag("data")); NBTTagList targetsTag = nbt.getTagList("targets", Constants.NBT.TAG_COMPOUND); IntStream.range(0, targetsTag.tagCount()).mapToObj(targetsTag::getCompoundTagAt).map(targetTag -> { Target target; try { target = (Target) Class.forName(targetTag.getString("class")).newInstance(); } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) { throw new RuntimeException(e); } target.readFromNBT(targetTag.getCompoundTag("data")); return target; }).forEach(targets::add); }

Target:
public void readFromNBT(NBTTagCompound nbt) { NBTTagCompound causeTag = nbt.getCompoundTag("cause"); try { cause = NBTUtilBC.readEnum(causeTag.getTag("type"), Cause.EnumCause.class).clazz.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } cause.readFromNBT(causeTag.getCompoundTag("data")); NBTUtilBC.readCompoundList(nbt.getTagList("targets", Constants.NBT.TAG_COMPOUND)).map(targetTag -> { Target target; try { target = NBTUtilBC.readEnum(targetTag.getTag("type"), Target.EnumTarget.class).clazz.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } target.readFromNBT(targetTag.getCompoundTag("data")); return target; }).forEach(targets::add); }
Source:
public void postProcessClassTree(ClassTree tree) { TypesIntoElements.store(processingEnv, this, tree); DeclarationsIntoElements.store(processingEnv, this, tree); if (checker.hasOption("infer") && wholeProgramInference != null) { WholeProgramInference.OutputKind outputKind = "stubs".equals(checker.getOption("infer")) ? WholeProgramInference.OutputKind.STUB : WholeProgramInference.OutputKind.JAIF; wholeProgramInference.saveResults(outputKind); } }

Target:
public void postProcessClassTree(ClassTree tree) { TypesIntoElements.store(processingEnv, this, tree); DeclarationsIntoElements.store(processingEnv, this, tree); if (wholeProgramInference != null) { wholeProgramInference.writeResultsToFile(wpiOutputFormat, this.checker); } }
Source:
public void testBounceOffEventIsOnlySentToDynamicSprites() { final int testXValue = 444; final int testYValue = 555; WhenBounceOffScript firstSpriteWhenBounceOffScript = new WhenBounceOffScript(null); firstSpriteWhenBounceOffScript.setSpriteToBounceOffName(sprite2.getName()); firstSpriteWhenBounceOffScript.addBrick(new PlaceAtBrick(-testXValue, -testYValue)); sprite.addScript(firstSpriteWhenBounceOffScript); sprite.initializeEventThreads(EventId.START); WhenBounceOffScript secondSpriteWhenBounceOffScript = new WhenBounceOffScript(null); secondSpriteWhenBounceOffScript.setSpriteToBounceOffName(sprite.getName()); secondSpriteWhenBounceOffScript.addBrick(new PlaceAtBrick(testXValue, testYValue)); sprite2.addScript(secondSpriteWhenBounceOffScript); sprite2.initializeEventThreads(EventId.START); rule.simulateFullCollision(); while (!allActionsOfAllSpritesAreFinished()) { for (Sprite spriteOfList : project.getDefaultScene().getSpriteList()) { spriteOfList.look.act(1.0f); } } assertNotNull(sprite.look.getLookData()); assertNotNull(sprite2.look.getLookData()); assertNotSame((float) testXValue, sprite2.look.getXInUserInterfaceDimensionUnit()); assertNotSame((float) testYValue, sprite2.look.getYInUserInterfaceDimensionUnit()); assertEquals((float) -testXValue, sprite.look.getXInUserInterfaceDimensionUnit()); assertEquals((float) -testYValue, sprite.look.getYInUserInterfaceDimensionUnit()); }

Target:
public void testBounceOffEventIsOnlySentToDynamicSprites() { final int testXValue = 444; final int testYValue = 555; WhenBounceOffScript firstSpriteWhenBounceOffScript = new WhenBounceOffScript(sprite2.getName()); firstSpriteWhenBounceOffScript.addBrick(new PlaceAtBrick(-testXValue, -testYValue)); sprite.addScript(firstSpriteWhenBounceOffScript); sprite.initializeEventThreads(EventId.START); WhenBounceOffScript secondSpriteWhenBounceOffScript = new WhenBounceOffScript(sprite.getName()); secondSpriteWhenBounceOffScript.addBrick(new PlaceAtBrick(testXValue, testYValue)); sprite2.addScript(secondSpriteWhenBounceOffScript); sprite2.initializeEventThreads(EventId.START); rule.simulateFullCollision(); while (!allActionsOfAllSpritesAreFinished()) { for (Sprite spriteOfList : project.getDefaultScene().getSpriteList()) { spriteOfList.look.act(1.0f); } } assertNotEquals((float) testXValue, sprite2.look.getXInUserInterfaceDimensionUnit()); assertNotEquals((float) testYValue, sprite2.look.getYInUserInterfaceDimensionUnit()); assertEquals((float) -testXValue, sprite.look.getXInUserInterfaceDimensionUnit()); assertEquals((float) -testYValue, sprite.look.getYInUserInterfaceDimensionUnit()); }
Source:
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics) { RevisionInfo[] infos = new RevisionInfo[ids.size()]; List<RevisionInfo> infosToLoad = createRevisionInfos(ids, branchPoint, prefetchDepth, loadOnDemand, infos); List<CDORevision> primaryLoadedRevisions = null; List<InternalCDORevision> additionalRevisions = null; if (infosToLoad != null) { additionalRevisions = loadRevisions(infosToLoad, branchPoint, referenceChunk, prefetchDepth); primaryLoadedRevisions = getResultsAndSynthetics(infosToLoad.toArray(new RevisionInfo[0]), synthetics); } if (primaryLoadedRevisions != null) { List<CDORevision> loadedRevisions = new ArrayList<CDORevision>(primaryLoadedRevisions); if (additionalRevisions != null) { loadedRevisions.addAll(additionalRevisions); } fireEvent(new RevisionsLoadedEvent(this, loadedRevisions)); } return getResultsAndSynthetics(infos, synthetics); }

Target:
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics) { RevisionInfo[] infos = new RevisionInfo[ids.size()]; List<RevisionInfo> infosToLoad = createRevisionInfos(ids, branchPoint, prefetchDepth, loadOnDemand, infos); List<CDORevision> primaryLoadedRevisions = null; List<InternalCDORevision> additionalRevisions = null; if (infosToLoad != null) { additionalRevisions = loadRevisions(infosToLoad, branchPoint, referenceChunk, prefetchDepth); primaryLoadedRevisions = getResultsAndSynthetics(infosToLoad.toArray(new RevisionInfo[0]), null); } if (primaryLoadedRevisions != null) { List<CDORevision> loadedRevisions = new ArrayList<CDORevision>(primaryLoadedRevisions); if (additionalRevisions != null) { loadedRevisions.addAll(additionalRevisions); } fireEvent(new RevisionsLoadedEvent(this, loadedRevisions)); } return getResultsAndSynthetics(infos, synthetics); }
Source:
void maybeAddRoutingKey(String name, Object value) { if (routingKeyValues == null || name == null || value == null || Utils.containsSpecialValue(value)) return; for (int i = 0; i < partitionKey.size(); i++) { if (name.equalsIgnoreCase(partitionKey.get(i).getName())) { routingKeyValues.set(i, value); return; } } }

Target:
void maybeAddRoutingKey(String name, Object value) { if (routingKeyValues == null || name == null || value == null || Utils.containsSpecialValue(value)) return; for (int i = 0; i < partitionKey.size(); i++) { if (Utils.handleId(name).equals(partitionKey.get(i).getName())) { routingKeyValues.set(i, value); return; } } }
Source:
private static String getIdAttribute(View element) { int id = element.getId(); if (id == View.NO_ID) { return null; } String idString = null; if (resourceHasPackage(id)) { Resources r = element.getResources(); if (r != null) { try { String prefix; String prefixSeparator; switch (id & 0xff000000) { case 0x7f000000: prefix = ""; prefixSeparator = ""; break; case 0x01000000: prefix = "android"; prefixSeparator = ":"; break; default: prefix = r.getResourcePackageName(id); prefixSeparator = ":"; break; } String typeName = r.getResourceTypeName(id); String entryName = r.getResourceEntryName(id); StringBuilder sb = new StringBuilder(1 + prefix.length() + prefixSeparator.length() + typeName.length() + 1 + entryName.length()); sb.append("@"); sb.append(prefix); sb.append(prefixSeparator); sb.append(typeName); sb.append("/"); sb.append(entryName); idString = sb.toString(); } catch (Resources.NotFoundException e) { } } } if (idString == null) { idString = "#" + Integer.toHexString(id); } return idString; }

Target:
private static String getIdAttribute(View element) { int id = element.getId(); if (id == View.NO_ID) { return null; } String idString = null; Resources r = element.getResources(); if (r != null) { try { String prefix; String prefixSeparator; switch (getResourcePackageId(id)) { case 0x7f: prefix = ""; prefixSeparator = ""; break; default: prefix = r.getResourcePackageName(id); prefixSeparator = ":"; break; } String typeName = r.getResourceTypeName(id); String entryName = r.getResourceEntryName(id); StringBuilder sb = new StringBuilder( 1 + prefix.length() + prefixSeparator.length() + typeName.length() + 1 + entryName.length()); sb.append("@"); sb.append(prefix); sb.append(prefixSeparator); sb.append(typeName); sb.append("/"); sb.append(entryName); idString = sb.toString(); } catch (Resources.NotFoundException e) { LogUtil.w(e, "Could not retrieve resource info for element: %s", element); } } if (idString == null) { idString = "#" + Integer.toHexString(id); } return idString; }
Source:
public <T extends Object> boolean contains(AttributeDefinition<T> def) { return contains(def.name()); }

Target:
public <T> boolean contains(AttributeDefinition<T> def) { return contains(def.name()); }
Source:
private void handleSelectionChangedFromDiagramEditor(IWorkbenchPart part, ISelection selection) { if(isLinkingEnabled()) { if(part instanceof IEditorPart) { if(selection instanceof IStructuredSelection) { Iterator<?> selectionIterator = ((IStructuredSelection)selection).iterator(); ArrayList<Object> semanticElementList = new ArrayList<Object>(); while(selectionIterator.hasNext()) { Object currentSelection = selectionIterator.next(); Object semanticElement = EMFHelper.getEObject(currentSelection); if(semanticElement != null) { semanticElementList.add(semanticElement); } } if(this instanceof NavigationTarget) { revealElement(semanticElementList); } } } if(part instanceof ModelExplorerPageBookView && !selection.isEmpty()) { if(selection instanceof IStructuredSelection) { IStructuredSelection sSelection = (IStructuredSelection)selection; LinkHelperService linkService = getLinkHelperService(); ILinkHelper[] helpers = linkService.getLinkHelpersFor(sSelection.getFirstElement()); if(helpers.length > 0) { helpers[0].activateEditor(part.getSite().getPage(), sSelection); } } } } }

Target:
private void handleSelectionChangedFromDiagramEditor(IWorkbenchPart part, ISelection selection) { if(isLinkingEnabled()) { if(part instanceof IEditorPart) { if(selection instanceof IStructuredSelection) { Iterator<?> selectionIterator = ((IStructuredSelection)selection).iterator(); ArrayList<Object> semanticElementList = new ArrayList<Object>(); while(selectionIterator.hasNext()) { Object currentSelection = selectionIterator.next(); Object semanticElement = EMFHelper.getEObject(currentSelection); if(semanticElement != null) { semanticElementList.add(semanticElement); } } revealSemanticElement(semanticElementList); } } if(part instanceof ModelExplorerPageBookView && !selection.isEmpty()) { if(selection instanceof IStructuredSelection) { IStructuredSelection sSelection = (IStructuredSelection)selection; LinkHelperService linkService = getLinkHelperService(); ILinkHelper[] helpers = linkService.getLinkHelpersFor(sSelection.getFirstElement()); if(helpers.length > 0) { helpers[0].activateEditor(part.getSite().getPage(), sSelection); } } } } }
Source:
private int getSelectionValue(long time) { int thread = -1; ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace()); if (traces == null) { return thread; } for (ITmfTrace trace : traces) { if (thread > 0) { break; } LttngKernelAnalysisModule module = trace.getAnalysisModules(LttngKernelAnalysisModule.class).get(LttngKernelAnalysisModule.ID); if (module == null) { continue; } ITmfStateSystem ssq = module.getStateSystem(); if (ssq == null) { continue; } if (time >= ssq.getStartTime() && time <= ssq.getCurrentEndTime()) { List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); for (int currentThreadQuark : currentThreadQuarks) { try { ITmfStateInterval currentThreadInterval = ssq.querySingleState(time, currentThreadQuark); int currentThread = currentThreadInterval.getStateValue().unboxInt(); if (currentThread > 0) { int statusQuark = ssq.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThread), Attributes.STATUS); ITmfStateInterval statusInterval = ssq.querySingleState(time, statusQuark); if (statusInterval.getStartTime() == time) { thread = currentThread; break; } } } catch (AttributeNotFoundException e) { e.printStackTrace(); } catch (TimeRangeException e) { e.printStackTrace(); } catch (StateValueTypeException e) { e.printStackTrace(); } catch (StateSystemDisposedException e) { } } } } return thread; }

Target:
private int getSelectionValue(long time) { int thread = -1; ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace()); if (traces == null) { return thread; } for (ITmfTrace trace : traces) { if (thread > 0) { break; } LttngKernelAnalysisModule module = trace.getAnalysisModules(LttngKernelAnalysisModule.class).get(LttngKernelAnalysisModule.ID); if (module == null) { continue; } ITmfStateSystem ssq = module.getStateSystem(); if (ssq == null) { continue; } if (time >= ssq.getStartTime() && time <= ssq.getCurrentEndTime()) { List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); for (int currentThreadQuark : currentThreadQuarks) { try { ITmfStateInterval currentThreadInterval = ssq.querySingleState(time, currentThreadQuark); int currentThread = currentThreadInterval.getStateValue().unboxInt(); if (currentThread > 0) { int statusQuark = ssq.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThread), Attributes.STATUS); ITmfStateInterval statusInterval = ssq.querySingleState(time, statusQuark); if (statusInterval.getStartTime() == time) { thread = currentThread; break; } } } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) { e.printStackTrace(); } catch (StateSystemDisposedException e) { } } } } return thread; }
Source:
protected void onInitUI() { super.onInitUI(); setPageTitle(Util.C.projectListTitle()); initPageHeader(); projects = new ProjectsTable() { @Override protected void initColumnHeaders() { super.initColumnHeaders(); if (Gerrit.getGitwebLink() != null) { table.setText(0, ProjectsTable.C_PROJECT_REPO_BROWSER, Util.C.projectRepoBrowser()); table.getFlexCellFormatter(). addStyleName(0, ProjectsTable.C_PROJECT_REPO_BROWSER, Gerrit.RESOURCES.css().dataHeader()); } } @Override protected void onOpenRow(final int row) { History.newItem(link(getRowItem(row))); } private String link(final ProjectInfo item) { return Dispatcher.toProject(item.name_key()); } @Override protected void insert(int row, ProjectInfo k) { super.insert(row, k); if (Gerrit.getGitwebLink() != null) { table.getFlexCellFormatter(). addStyleName(row, ProjectsTable.C_PROJECT_REPO_BROWSER, Gerrit.RESOURCES.css().dataCell()); } } @Override protected void populate(final int row, final ProjectInfo k) { FlowPanel fp = new FlowPanel(); fp.add(new ProjectSearchLink(k.name_key())); fp.add(new HighlightingInlineHyperlink(k.name(), link(k), subname)); table.setWidget(row, ProjectsTable.C_NAME, fp); table.setText(row, ProjectsTable.C_DESCRIPTION, k.description()); GitwebLink l = Gerrit.getGitwebLink(); if (l != null) { table.setWidget(row, ProjectsTable.C_PROJECT_REPO_BROWSER, new Anchor(l.getLinkName(), false, l.toProject(k .name_key()))); } setRowItem(row, k); } }; projects.setSavePointerId(PageLinks.ADMIN_PROJECTS); add(projects); }

Target:
protected void onInitUI() { super.onInitUI(); setPageTitle(Util.C.projectListTitle()); initPageHeader(); projects = new ProjectsTable() { @Override protected void initColumnHeaders() { super.initColumnHeaders(); if (Gerrit.getGitwebLink() != null) { table.setText(0, ProjectsTable.C_REPO_BROWSER, Util.C.projectRepoBrowser()); table.getFlexCellFormatter(). addStyleName(0, ProjectsTable.C_REPO_BROWSER, Gerrit.RESOURCES.css().dataHeader()); } } @Override protected void onOpenRow(final int row) { History.newItem(link(getRowItem(row))); } private String link(final ProjectInfo item) { return Dispatcher.toProject(item.name_key()); } @Override protected void insert(int row, ProjectInfo k) { super.insert(row, k); if (Gerrit.getGitwebLink() != null) { table.getFlexCellFormatter(). addStyleName(row, ProjectsTable.C_REPO_BROWSER, Gerrit.RESOURCES.css().dataCell()); } } @Override protected void populate(final int row, final ProjectInfo k) { FlowPanel fp = new FlowPanel(); fp.add(new ProjectSearchLink(k.name_key())); fp.add(new HighlightingInlineHyperlink(k.name(), link(k), subname)); table.setWidget(row, ProjectsTable.C_NAME, fp); table.setText(row, ProjectsTable.C_DESCRIPTION, k.description()); GitwebLink l = Gerrit.getGitwebLink(); if (l != null) { table.setWidget(row, ProjectsTable.C_REPO_BROWSER, new Anchor(l.getLinkName(), false, l.toProject(k .name_key()))); } setRowItem(row, k); } }; projects.setSavePointerId(PageLinks.ADMIN_PROJECTS); add(projects); }
Source:
public void setUp() { final Props props = new Props(); final Injector injector = Guice.createInjector(new AbstractModule() { @Override protected void configure() { new AzkabanCommonModule(props); } }); SERVICE_PROVIDER.unsetInjector(); SERVICE_PROVIDER.setInjector(injector); }

Target:
public void setUp() { initServiceProvider(); }
Source:
public WordCountITCase(){ this.config.setInteger(ConfigConstants.LOCAL_INSTANCE_MANAGER_NUMBER_TASK_MANAGER, 2); }

Target:
public WordCountITCase(){ setNumTaskManager(2); }
Source:
public void setRestApiBaseUris(List<String> restApis) { StringBuilder sb = new StringBuilder(); for (String restEndpoint:restApis){ sb.append(restEndpoint); sb.append(" "); } preferences.edit().putString(PreferenceKeys.API_URIS,sb.toString().trim()).commit(); }

Target:
public void setRestApiBaseUris(List<String> restApis) { preferences.edit().putString(PreferenceKeys.API_URIS, Joiner.on(' ').join(restApis)).commit(); }
Source:
public ComputerLauncher createLauncher(@Nonnull JCloudsSlave slave) throws IOException { int maxNumRetries = 5; int retryWaitTime = 15; SlaveOptions opts = slave.getSlaveOptions(); String credentialsId = opts.getCredentialsId(); if (credentialsId == null) { throw new ProvisioningFailedException("No ssh credentials selected", new Throwable()); } String publicAddress = slave.getPublicAddress(); if (publicAddress == null) { throw new IOException("The slave is likely deleted"); } if ("0.0.0.0".equals(publicAddress)) { throw new IOException("Invalid host 0.0.0.0, your host is most likely waiting for an ip address."); } Integer timeout = opts.getStartTimeout(); timeout = timeout == null ? 0 : (timeout / 1000); return new SSHLauncher(publicAddress, 22, credentialsId, opts.getJvmOptions(), null, "", "", timeout, maxNumRetries, retryWaitTime); }

Target:
public ComputerLauncher createLauncher(@Nonnull JCloudsSlave slave) throws IOException { int maxNumRetries = 5; int retryWaitTime = 15; SlaveOptions opts = slave.getSlaveOptions(); String credentialsId = opts.getCredentialsId(); if (credentialsId == null) { throw new ProvisioningFailedException("No ssh credentials selected"); } String publicAddress = slave.getPublicAddress(); if (publicAddress == null) { throw new IOException("The slave is likely deleted"); } if ("0.0.0.0".equals(publicAddress)) { throw new IOException("Invalid host 0.0.0.0, your host is most likely waiting for an ip address."); } Integer timeout = opts.getStartTimeout(); timeout = timeout == null ? 0 : (timeout / 1000); return new SSHLauncher(publicAddress, 22, credentialsId, opts.getJvmOptions(), null, "", "", timeout, maxNumRetries, retryWaitTime); }
Source:
public static <K extends Comparable<? super K>, V> TreeMap<K, V> ofAll(java.util.Map<? extends K, ? extends V> map) { Objects.requireNonNull(map, "map is null"); RedBlackTree<Tuple2<K, V>> result = RedBlackTree.empty(new EntryComparator<>(Comparator.naturalOrder())); for (java.util.Map.Entry<? extends K, ? extends V> entry : map.entrySet()) { result = result.insert(Tuple.of(entry.getKey(), entry.getValue())); } return new TreeMap<>(result); }

Target:
public static <K extends Comparable<? super K>, V> TreeMap<K, V> ofAll(java.util.Map<? extends K, ? extends V> map) { Objects.requireNonNull(map, "map is null"); RedBlackTree<Tuple2<K, V>> result = RedBlackTree.empty(new EntryComparator<>((Comparator<? super K> & Serializable) K::compareTo)); for (java.util.Map.Entry<? extends K, ? extends V> entry : map.entrySet()) { result = result.insert(Tuple.of(entry.getKey(), entry.getValue())); } return new TreeMap<>(result); }
Source:
public TypedOutput toBody(Object source) { OutputStreamWriter osw = null; try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); osw = new OutputStreamWriter(bos, CHARSET); serializer.write(source, osw); osw.flush(); return new TypedByteArray(MIME_TYPE, bos.toByteArray()); } catch (final NullPointerException e) { throw new AssertionError(e); } catch (IOException e) { throw new AssertionError(e); } catch (Exception e) { throw new AssertionError(e); } finally { try { if (osw != null) { osw.close(); } } catch (IOException e) { throw new AssertionError(e); } } }

Target:
public TypedOutput toBody(Object source) { OutputStreamWriter osw = null; try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); osw = new OutputStreamWriter(bos, CHARSET); serializer.write(source, osw); osw.flush(); return new TypedByteArray(MIME_TYPE, bos.toByteArray()); } catch (Exception e) { throw new AssertionError(e); } finally { try { if (osw != null) { osw.close(); } } catch (IOException e) { throw new AssertionError(e); } } }
Source:
public void cancel() { cancelAt = System.nanoTime(); }

Target:
public void cancel() { cancelAtNs = System.nanoTime(); }
Source:
public void testRegister() { abstractRegistry.register(mockUrl); assert abstractRegistry.getRegistered().contains(mockUrl); abstractRegistry.getRegistered().clear(); List<URL> urlList = getList(); for (URL url : urlList) { abstractRegistry.register(url); } Assert.assertThat(abstractRegistry.getRegistered().size(), Matchers.equalTo(urlList.size())); }

Target:
public void testRegister() throws Exception { abstractRegistry.register(mockUrl); assert abstractRegistry.getRegistered().contains(mockUrl); abstractRegistry.getRegistered().clear(); List<URL> urlList = getList(); for (URL url : urlList) { abstractRegistry.register(url); } Assert.assertThat(abstractRegistry.getRegistered().size(), Matchers.equalTo(urlList.size())); }
Source:
public boolean setTypeId(int type, boolean applyPhysics) { return setTypeIdAndData(type, getData(), applyPhysics); }

Target:
public boolean setTypeId(int type, boolean applyPhysics) { return setTypeIdAndData(type, (byte) 0, applyPhysics); }
Source:
private void updateKernelCmdlineAccordingToCheckboxes() { final CpuVendor cpuVendor = getCurrentCpuVendor(); if (cpuVendor == null || getKernelCmdlineBlacklistNouveau().getEntity() == null || getKernelCmdlineIommu().getEntity() == null || getKernelCmdlineKvmNested().getEntity() == null || getKernelCmdlineUnsafeInterrupts().getEntity() == null || getKernelCmdlinePciRealloc().getEntity() == null || getKernelCmdlineFips().getEntity() == null || getKernelCmdlineSmtDisabled().getEntity() == null) { return; } final String kernelCmdline = KernelCmdlineUtil.create( cpuVendor, getKernelCmdlineBlacklistNouveau().getEntity(), getKernelCmdlineIommu().getEntity(), getKernelCmdlineKvmNested().getEntity(), getKernelCmdlineUnsafeInterrupts().getEntity(), getKernelCmdlinePciRealloc().getEntity(), getKernelCmdlineFips().getEntity(), getCurrentKernelCmdLine().getEntity().toLowerCase().contains("boot=uuid=") ? "" : getKernelCmdlineBootUuid().getEntity(), getKernelCmdlineSmtDisabled().getEntity()); kernelCmdlineListener.whilePaused(() -> getKernelCmdline().setEntity(kernelCmdline)); }

Target:
private void updateKernelCmdlineAccordingToCheckboxes() { final CpuVendor cpuVendor = getCurrentCpuVendor(); if (cpuVendor == null || getKernelCmdlineBlacklistNouveau().getEntity() == null || getKernelCmdlineIommu().getEntity() == null || getKernelCmdlineKvmNested().getEntity() == null || getKernelCmdlineUnsafeInterrupts().getEntity() == null || getKernelCmdlinePciRealloc().getEntity() == null || getKernelCmdlineFips().getEntity() == null || getKernelCmdlineSmtDisabled().getEntity() == null) { return; } final String kernelCmdline = KernelCmdlineUtil.create( cpuVendor, getKernelCmdlineBlacklistNouveau().getEntity(), getKernelCmdlineIommu().getEntity(), getKernelCmdlineKvmNested().getEntity(), getKernelCmdlineUnsafeInterrupts().getEntity(), getKernelCmdlinePciRealloc().getEntity(), getKernelCmdlineFips().getEntity(), getKernelCmdlineBootUuid().getEntity(), getKernelCmdlineSmtDisabled().getEntity()); kernelCmdlineListener.whilePaused(() -> getKernelCmdline().setEntity(kernelCmdline)); }
Source:
protected <A extends NuageVspApiClient, B extends NuageVspElementClient, C extends NuageVspSyncClient, D extends NuageVspGuruClient> void loadNuageClient() { try { NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(_relativePath, _cmsUserInfo, _numRetries, _retryInterval, _nuageVspCmsId); _nuageVspApiClient = clientLoader.getNuageVspApiClient(); _nuageVspSyncClient = clientLoader.getNuageVspSyncClient(); _nuageVspGuruClient = clientLoader.getNuageVspGuruClient(); _nuageVspElementClient = clientLoader.getNuageVspElementClient(); _nuageVspManagerClient = clientLoader.getNuageVspManagerClient(); _isNuageVspClientLoaded = true; } catch (ConfigurationException e) { _isNuageVspClientLoaded = false; String errorMessage = "Nuage Vsp Plugin client is not yet installed. Please install NuageVsp plugin client to use NuageVsp plugin in Cloudstack. "; s_logger.warn(errorMessage + e.getMessage()); throw new CloudRuntimeException(errorMessage, e); } }

Target:
protected <A extends NuageVspApiClient, B extends NuageVspElementClient, C extends NuageVspSyncClient, D extends NuageVspGuruClient> void loadNuageClient() { try { NuageVspPluginClientLoader clientLoader = NuageVspPluginClientLoader.getClientLoader(_relativePath, _cmsUserInfo, _numRetries, _retryInterval, _nuageVspCmsId); _nuageVspApiClient = clientLoader.getNuageVspApiClient(); _nuageVspSyncClient = clientLoader.getNuageVspSyncClient(); _nuageVspGuruClient = clientLoader.getNuageVspGuruClient(); _nuageVspElementClient = clientLoader.getNuageVspElementClient(); _nuageVspManagerClient = clientLoader.getNuageVspManagerClient(); _isNuageVspClientLoaded = true; } catch (ConfigurationException e) { _isNuageVspClientLoaded = false; String errorMessage = "Nuage Vsp Plugin client is not yet installed. Please install NuageVsp plugin client to use NuageVsp plugin in Cloudstack. "; s_logger.error(errorMessage, e); throw new CloudRuntimeException(errorMessage, e); } }
Source:
private Event getPayoutEvent(Class<? extends PayoutEvent> eventClass, String connectAccount, StripePayout payout) { if (eventClass == PayoutCreated.class) { GatewayAccountEntity gatewayAccount = gatewayAccountDao.findByCredentialsKeyValue( STRIPE_ACCOUNT_ID_KEY, connectAccount) .orElseThrow(() -> new GatewayAccountNotFoundException( format("Gateway account with Stripe connect account ID %s not found.", connectAccount))); return PayoutCreated.from(gatewayAccount.getId(), payout); } logger.warn("Unsupported payout event class for payout ", eventClass, payout.getId()); return null; }

Target:
private Event getPayoutEvent(Class<? extends PayoutEvent> eventClass, String connectAccount, StripePayout payout) { if (eventClass == PayoutCreated.class) { Optional<GatewayAccountEntity> mayBeGatewayAccount = gatewayAccountDao.findByCredentialsKeyValue( STRIPE_ACCOUNT_ID_KEY, connectAccount); if (mayBeGatewayAccount.isPresent()) { return PayoutCreated.from(mayBeGatewayAccount.get().getId(), payout); } else { logger.error("Gateway account with Stripe connect account ID not found", connectAccount); throw new GatewayAccountNotFoundException( format("Gateway account with Stripe connect account ID %s not found.", connectAccount)); } } logger.warn("Unsupported payout event class for payout ", eventClass, payout.getId()); return null; }
Source:
RunTaskRequest buildRunTaskRequest( final CommandContext commandContext, final CommandRequest commandRequest, final EcsClientConfig clientConfig, final TaskDefinition td) throws ConfigException { final RunTaskRequest runTaskRequest = new RunTaskRequest(); setEcsCluster(clientConfig, runTaskRequest); setEcsGroup(runTaskRequest); setEcsTaskDefinition(commandContext, commandRequest, td, runTaskRequest); setEcsTaskCount(runTaskRequest); setEcsTaskOverride(commandContext, commandRequest, td, runTaskRequest); setEcsTaskLaunchType(clientConfig, runTaskRequest); setEcsNetworkConfiguration(clientConfig, runTaskRequest); setCapacityProviderStrategy(clientConfig, runTaskRequest); return runTaskRequest; }

Target:
RunTaskRequest buildRunTaskRequest( final CommandContext commandContext, final CommandRequest commandRequest, final EcsClientConfig clientConfig, final TaskDefinition td) throws ConfigException { final RunTaskRequest runTaskRequest = new RunTaskRequest(); setEcsCluster(clientConfig, runTaskRequest); setEcsGroup(runTaskRequest); setEcsTaskDefinition(commandContext, commandRequest, td, runTaskRequest); setEcsTaskCount(runTaskRequest); setEcsTaskOverride(commandContext, commandRequest, td, runTaskRequest, clientConfig); setEcsTaskLaunchType(clientConfig, runTaskRequest); setEcsTaskStartedBy(clientConfig, runTaskRequest); setEcsNetworkConfiguration(clientConfig, runTaskRequest); setCapacityProviderStrategy(clientConfig, runTaskRequest); return runTaskRequest; }
Source:
public void testCreatedAt() throws Exception { final MkOrganizations orgs = new MkOrganizations( new MkStorage.InFile(), "testCreatedAt" ); final String createdat = "created_at"; final java.util.Date early = new Github.Time(orgs .get("testCreatedAt").json().getString(createdat) ).date(); final long sleepfor = 1000; Thread.sleep(sleepfor); final java.util.Date later = new Github.Time(orgs .get("testCreatedAt").json().getString(createdat) ).date(); MatcherAssert.assertThat(later, Matchers.greaterThanOrEqualTo(early)); }

Target:
public void testCreatedAt() throws Exception { final MkOrganizations orgs = new MkOrganizations( new MkStorage.InFile(), "testCreatedAt" ); final String created = "created_at"; final Date early = new Github.Time( orgs.get("testCreatedAt") .json() .getString(created) ).date(); TimeUnit.SECONDS.sleep(1L); final Date later = new Github.Time( orgs.get("testCreatedAt") .json() .getString(created) ).date(); MatcherAssert.assertThat(later, Matchers.greaterThanOrEqualTo(early)); }
Source:
public void close() throws Exception { super.close(); if (checkpointLock != null) { synchronized (checkpointLock) { currentReadTime = Long.MAX_VALUE; isRunning = false; } } }

Target:
public void close() { cancel(); }