auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void compactTableHighDeltaPct() throws Exception { Table t = newTable("default", "cthdp", false); addBaseFile(t, null, 20L, 20); addDeltaFile(t, null, 21L, 22L, 2); addDeltaFile(t, null, 23L, 24L, 2); burnThroughTransactions("default", "cthdp", 23); long txnid = openTxn(); LockComponent comp = new LockComponent(LockType.SHARED_WRITE, LockLevel.TABLE, "default"); comp.setTablename("cthdp"); comp.setOperationType(DataOperationType.UPDATE); List<LockComponent> components = new ArrayList<LockComponent>(1); components.add(comp); LockRequest req = new LockRequest(components, "me", "localhost"); req.setTxnid(txnid); LockResponse res = txnHandler.lock(req); long writeid = allocateWriteId("default", "cthdp", txnid); assert(writeid==txnid); txnHandler.commitTxn(new CommitTxnRequest(txnid)); startInitiator(); ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest()); List<ShowCompactResponseElement> compacts = rsp.getCompacts(); Assert.assertEquals(1, compacts.size()); Assert.assertEquals("initiated", compacts.get(0).getState()); Assert.assertEquals("cthdp", compacts.get(0).getTablename()); Assert.assertEquals(CompactionType.MAJOR, compacts.get(0).getType()); }

Target:
public void compactTableHighDeltaPct() throws Exception { Table t = newTable("default", "cthdp", false); addBaseFile(t, null, 20L, 20); addDeltaFile(t, null, 21L, 22L, 2); addDeltaFile(t, null, 23L, 24L, 2); burnThroughTransactions("default", "cthdp", 23); long txnid = openTxn(); LockComponent comp = new LockComponent(LockType.SHARED_WRITE, LockLevel.TABLE, "default"); comp.setTablename("cthdp"); comp.setOperationType(DataOperationType.UPDATE); List<LockComponent> components = new ArrayList<LockComponent>(1); components.add(comp); LockRequest req = new LockRequest(components, "me", "localhost"); req.setTxnid(txnid); LockResponse res = txnHandler.lock(req); long writeid = allocateWriteId("default", "cthdp", txnid); Assert.assertEquals(24, writeid); txnHandler.commitTxn(new CommitTxnRequest(txnid)); startInitiator(); ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest()); List<ShowCompactResponseElement> compacts = rsp.getCompacts(); Assert.assertEquals(1, compacts.size()); Assert.assertEquals("initiated", compacts.get(0).getState()); Assert.assertEquals("cthdp", compacts.get(0).getTablename()); Assert.assertEquals(CompactionType.MAJOR, compacts.get(0).getType()); }
Source:
public Block getBlock(int x, int y, int z) { int chunkX = x >> 4; int chunkZ = z >> 4; return getChunk(chunkX, chunkZ).getBlock(x - chunkX * 16, y, z - chunkZ * 16); }

Target:
public Block getBlock(int x, int y, int z) { return null; }
Source:
public boolean isClosed() { return "delete".equals(getAdditionalInfo("osmand_change")); }

Target:
public boolean isClosed() { return OSM_DELETE_VALUE.equals(getAdditionalInfo(OSM_DELETE_TAG)); }
Source:
public void updateHostStatusAfterSuccessfulUpgrade() { VdsDynamic dynamicHostData = hostDao.get(getVdsId()); dynamicHostData.setUpdateAvailable(false); hostDao.update(dynamicHostData); if (getVds().getVdsType() == VDSType.VDS) { reestablishConnectionIfNeeded(); if (getParameters().getInitialStatus() == VDSStatus.Maintenance) { setVdsStatus(VDSStatus.Maintenance); } else { if (getVds().getHighlyAvailableIsConfigured()) { SetHaMaintenanceModeVDSCommandParameters param = new SetHaMaintenanceModeVDSCommandParameters(getVds(), HaMaintenanceMode.LOCAL, false); if (!runVdsCommand(VDSCommandType.SetHaMaintenanceMode, param).getSucceeded()) { log.error("Failed to set local maintenance mode to none for host '{}' after upgrade has ended.", getVdsName()); } } setVdsStatus(VDSStatus.Initializing); } } }

Target:
public void updateHostStatusAfterSuccessfulUpgrade() { VdsDynamic dynamicHostData = hostDao.get(getVdsId()); dynamicHostData.setUpdateAvailable(false); hostDao.update(dynamicHostData); if (getVds().getVdsType() == VDSType.VDS) { reestablishConnectionIfNeeded(); if (getParameters().getInitialStatus() == VDSStatus.Maintenance) { setVdsStatus(VDSStatus.Maintenance); } else { if (getVds().getHighlyAvailableIsConfigured()) { haMaintenanceFailed = setHaLocalMaintenanceMode(getVds(), false); } setVdsStatus(VDSStatus.Initializing); } } }
Source:
public Map<String, PartitionStatistics> getPartitionStatistics(String databaseName, String tableName, Set<String> partitionNames) { return getPartitionsByNames(databaseName, tableName, ImmutableList.copyOf(partitionNames)) .entrySet() .stream() .map(entry -> new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue() .orElseThrow(() -> new PartitionNotFoundException(new SchemaTableName(databaseName, tableName), toPartitionValues(entry.getKey()))))) .collect(toImmutableMap(Entry::getKey, entry -> new PartitionStatistics(getHiveBasicStatistics(entry.getValue().getParameters()), ImmutableMap.of()))); }

Target:
public synchronized Map<String, PartitionStatistics> getPartitionStatistics(String databaseName, String tableName, Set<String> partitionNames) { Table table = getRequiredTable(databaseName, tableName); ImmutableMap.Builder<String, PartitionStatistics> statistics = ImmutableMap.builder(); for (String partitionName : partitionNames) { List<String> partitionValues = extractPartitionKeyValues(partitionName); Path partitionDirectory = getPartitionMetadataDirectory(table, ImmutableList.copyOf(partitionValues)); PartitionMetadata partitionMetadata = readSchemaFile("partition", partitionDirectory, partitionCodec) .orElseThrow(() -> new PartitionNotFoundException(new SchemaTableName(databaseName, tableName), partitionValues)); HiveBasicStatistics basicStatistics = getHiveBasicStatistics(partitionMetadata.getParameters()); statistics.put(partitionName, new PartitionStatistics(basicStatistics, partitionMetadata.getColumnStatistics())); } return statistics.build(); }
Source:
public void testSetValue() { fixture.setValue("dummy"); String result = fixture.getValue(); assertNotNull(result); assertEquals(result, "dummy"); }

Target:
public void testSetValue() { fixture.setValue("dummy"); String result = fixture.getValue(); assertNotNull(result); assertEquals("dummy", result); }
Source:
private int getVisibility(int memberIndex) throws CoreException { int targetVisibilityBytes = memberIndex / VISIBILITY_VALUES_PER_BYTE; int visibilityBlockOffset = memberIndex % VISIBILITY_VALUES_PER_BYTE; int visibilityMask = VISIBILITY_MASK << visibilityBlockOffset * VISIBILITY_BITS; long visibilityOffset = record + MEMBER_VISIBILITIES + targetVisibilityBytes; int currentVisibility = getDB().getByte(visibilityOffset); int maskedVisibility = currentVisibility & visibilityMask; maskedVisibility >>>= visibilityBlockOffset * VISIBILITY_BITS; return maskedVisibility; }

Target:
private int getVisibility(int memberIndex) throws CoreException { int visibilityBitOffset = memberIndex % VISIBILITY_VALUES_PER_BYTE; long visibilityOffset = record + MEMBER_VISIBILITIES + memberIndex / VISIBILITY_VALUES_PER_BYTE; int visibility = getDB().getByte(visibilityOffset); visibility &= VISIBILITY_MASK << visibilityBitOffset * VISIBILITY_BITS; visibility >>>= visibilityBitOffset * VISIBILITY_BITS; return visibility; }
Source:
public SystemTagInventory createNonInherentSystemTag(String resourceUuid, String tag, String resourceType) { if (isTagExisting(resourceUuid, tag, TagType.System, resourceType)) { return null; } validateSystemTag(resourceUuid, resourceType, tag); String sql =String.format("select vo.uuid from %s vo where " + " vo.uuid = :resourceUuid",resourceType); TypedQuery<String> q = dbf.getEntityManager().createQuery(sql, String.class); q.setParameter("resourceUuid",resourceUuid); List<String> resultUuids = q.getResultList(); if (resultUuids.size()<=0){ throw new OperationFailureException(errf.instantiateErrorCode( TagErrors.NOT_MATCH_UUID, "The argument :'resourceType' doesn't match uuid")); } SystemTagVO vo = new SystemTagVO(); vo.setResourceType(resourceType); vo.setUuid(Platform.getUuid()); vo.setResourceUuid(resourceUuid); vo.setInherent(false); vo.setTag(tag); vo.setType(TagType.System); preTagCreated(SystemTagInventory.valueOf(vo)); vo = dbf.persistAndRefresh(vo); SystemTagInventory inv = SystemTagInventory.valueOf(vo); final SystemTagVO finalVo = vo; Defer.guard(new Runnable() { @Override public void run() { dbf.remove(finalVo); } }); fireTagCreated(list(inv)); return inv; }

Target:
public SystemTagInventory createNonInherentSystemTag(String resourceUuid, String tag, String resourceType) { if (isTagExisting(resourceUuid, tag, TagType.System, resourceType)) { return null; } validateSystemTag(resourceUuid, resourceType, tag); SystemTagVO vo = new SystemTagVO(); vo.setResourceType(resourceType); vo.setUuid(Platform.getUuid()); vo.setResourceUuid(resourceUuid); vo.setInherent(false); vo.setTag(tag); vo.setType(TagType.System); preTagCreated(SystemTagInventory.valueOf(vo)); vo = dbf.persistAndRefresh(vo); SystemTagInventory inv = SystemTagInventory.valueOf(vo); final SystemTagVO finalVo = vo; Defer.guard(new Runnable() { @Override public void run() { dbf.remove(finalVo); } }); fireTagCreated(list(inv)); return inv; }
Source:
public ListenableFuture<List<Split>> getNextBatch(int maxSize) { checkState(splitSchedulingStrategy == SplitSchedulingStrategy.ALL_AT_ONCE); ListenableFuture<List<ConnectorSplit>> nextBatch = toListenableFuture(source.getNextBatch(maxSize)); return Futures.transform(nextBatch, splits -> Lists.transform(splits, split -> new Split(connectorId, transactionHandle, split))); }

Target:
public ListenableFuture<List<Split>> getNextBatch(int maxSize) { checkState(splitSchedulingStrategy == UNGROUPED_SCHEDULING); ListenableFuture<List<ConnectorSplit>> nextBatch = toListenableFuture(source.getNextBatch(maxSize)); return Futures.transform(nextBatch, splits -> Lists.transform(splits, split -> new Split(connectorId, transactionHandle, split))); }
Source:
public void checkAttributeSemantics(PerunSessionImpl sess, Member member, Attribute attribute) throws InternalErrorException, WrongReferenceAttributeValueException { if (!attribute.equals(getAttributeValue(sess, member, attribute))) throw new WrongReferenceAttributeValueException(attribute, member, "Attribute value is not the highest value from member's UserExtSources Loas."); }

Target:
public void checkAttributeSemantics(PerunSessionImpl sess, Member member, Attribute attribute) throws InternalErrorException, WrongReferenceAttributeValueException { Attribute currentAttribute = getAttributeValue(sess, member, attribute); if(!attribute.equals(currentAttribute)) throw new WrongReferenceAttributeValueException(attribute, currentAttribute, member, null, member, null, "Attribute value is not the highest value from member's UserExtSources Loas."); }
Source:
public DockerImageName asCompatibleSubstituteFor(DockerImageName otherImageName) { return new DockerImageName(rawName, registry, repo, versioning, otherImageName); }

Target:
public DockerImageName asCompatibleSubstituteFor(DockerImageName otherImageName) { return withCompatibleSubstituteFor(otherImageName); }
Source:
public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<String>(); errors.add(validator.getInvalidityInfoForFeedbackSessionName(feedbackSessionName)); errors.add(validator.getInvalidityInfoForCourseId(courseId)); String error = validator.getInvalidityInfoForEmail(creatorEmail); if (!error.isEmpty()) { StringBuffer stringbuff = new StringBuffer(); stringbuff.append("Invalid creator's email: ").append(error); error = stringbuff.toString(); } errors.add(error); errors.addAll(validator.getValidityInfoForFeedbackParticipantType(giverType, recipientType)); errors.addAll(validator.getValidityInfoForFeedbackResponseVisibility(showResponsesTo, showGiverNameTo, showRecipientNameTo)); return getNonEmptyErrors(errors); }

Target:
public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<String>(); addNonEmptyError(validator.getInvalidityInfoForFeedbackSessionName(feedbackSessionName), errors); addNonEmptyError(validator.getInvalidityInfoForCourseId(courseId), errors); String error = validator.getInvalidityInfoForEmail(creatorEmail); if (!error.isEmpty()) { error = new StringBuffer() .append("Invalid creator's email: ") .append(error) .toString(); } addNonEmptyError(error, errors); errors.addAll(validator.getValidityInfoForFeedbackParticipantType(giverType, recipientType)); errors.addAll(validator.getValidityInfoForFeedbackResponseVisibility(showResponsesTo, showGiverNameTo, showRecipientNameTo)); return errors; }
Source:
protected void checkAttributesMatch(EventEnvelope event) throws IllegalArgumentException { super.checkAttributesMatch(event); ensureExternalMatch(event.context() .getExternal()); }

Target:
protected void checkAttributesMatch(EventEnvelope event) throws IllegalArgumentException { super.checkAttributesMatch(event); ensureExternalMatch(event.isExternal()); }
Source:
void invalidateSessionSecure(String subjectName) { String cacheKey = cookieCache.getCacheKeyBySubjectName(subjectName, securityManager); if (cacheKey == null) { LOGGER.debug( "No cache element found for subject name {}; skipping invalidation.", subjectName); return; } LogoutState logoutState = new LogoutState(getActiveSps(cacheKey)); logoutState.setOriginalIssuer(""); logoutState.setNameId(subjectName); logoutState.setOriginalRequestId(UUID.randomUUID().toString()); String relayState = UUID.randomUUID().toString(); logoutState.setInitialRelayState(relayState); logoutStates.encode(cacheKey, logoutState); cookieCache.removeSamlAssertion(cacheKey); asyncLogoutService.submit(() -> asyncBackchannelLogout(cacheKey, logoutState)); }

Target:
void invalidateSessionSecure(String subjectName) { String cacheKey = cookieCache.getCacheKeyBySubjectName(subjectName, securityManager); if (cacheKey == null) { LOGGER.debug( "No cache element found for subject name {}; skipping invalidation.", subjectName); return; } LogoutState logoutState = new LogoutState(getActiveSps(cacheKey)); logoutState.setNameId(subjectName); logoutState.setOriginalRequestId(UUID.randomUUID().toString()); logoutStates.encode(cacheKey, logoutState); cookieCache.removeSamlAssertion(cacheKey); asyncLogoutService.submit(() -> asyncBackchannelLogout(cacheKey, logoutState)); }
Source:
private static String resolveXDHome() { String resolved = CommandLinePropertySourceOverridingListener.getCurrentEnvironment() .resolvePlaceholders("${xd.home:.}/lib/*"); resolved = StringUtils.cleanPath(resolved).replace(" return "file://" + resolved; }

Target:
private static String resolveXDHome() { Assert.state( CommandLinePropertySourceOverridingListener.getCurrentEnvironment() != null, "Expected to be called in the control flow of " + CommandLinePropertySourceOverridingListener.class.getSimpleName() + ".onApplicationEvent()"); String resolved = CommandLinePropertySourceOverridingListener.getCurrentEnvironment() .resolvePlaceholders("${xd.home:.}/lib/*"); resolved = StringUtils.cleanPath(resolved).replace(" return "file://" + resolved; }
Source:
private void populateSessionsMap(List<StorageDomainDR> storageDRs) { for (final StorageDomainDR storageDR : storageDRs) { if (!geoRepSessionsMap.containsKey(storageDR.getGeoRepSessionId())) { Frontend.getInstance().runQuery(VdcQueryType.GetGlusterVolumeGeoRepSessionById, new IdQueryParameters(storageDR.getGeoRepSessionId()), new AsyncQuery<>(new AsyncCallback<VdcQueryReturnValue>() { @Override public void onSuccess(VdcQueryReturnValue returnValue) { if (returnValue.getReturnValue() != null) { geoRepSessionsMap.put(storageDR.getGeoRepSessionId(), (GlusterGeoRepSession) returnValue.getReturnValue()); } } })); } } }

Target:
private void populateSessionsMap(List<StorageDomainDR> storageDRs) { for (final StorageDomainDR storageDR : storageDRs) { if (!geoRepSessionsMap.containsKey(storageDR.getGeoRepSessionId())) { AsyncDataProvider.getInstance() .getGlusterVolumeGeoRepSessionById(new AsyncQuery<>(new AsyncCallback<GlusterGeoRepSession>() { @Override public void onSuccess(GlusterGeoRepSession geoRepSession) { if (geoRepSession != null) { geoRepSessionsMap.put(storageDR.getGeoRepSessionId(), geoRepSession); } } }), storageDR.getGeoRepSessionId()); } } }
Source:
private static <T> void validateEntry(ReferenceDataId<?> id, Object value) { if (!id.getReferenceDataType().isInstance(value)) { throw new ClassCastException(Messages.format( "Value does not implement parameterized type for identifier '{}' of type '{}'", id, id.getClass().getSimpleName())); } }

Target:
private static <T> void validateEntry(ReferenceDataId<?> id, Object value) { if (!id.getReferenceDataType().isInstance(value)) { if (value == null) { throw new IllegalArgumentException(Messages.format( "Reference data must not be null for identifier '{}'", id)); } throw new ClassCastException(Messages.format( "Value '{}' does not implement parameterized type '{}' for identifier '{}'", value, id.getClass().getSimpleName(), id)); } }
Source:
private XmlSuite createXmlSuite(Class<?> c) { XmlSuite xmlSuite = new XmlSuite(); xmlSuite.setName("TmpSuite"); XmlTest xmlTest = new XmlTest(xmlSuite); xmlTest.setName("TmpTest"); xmlTest.setXmlClasses(Collections.singletonList(new XmlClass(c))); return xmlSuite; }

Target:
private XmlSuite createXmlSuite(Class<?> c) { XmlSuite xmlSuite = new XmlSuite(); xmlSuite.setName("TmpSuite"); xmlSuite.setTimeOut(String.valueOf(defaultTestTimeoutMillis)); XmlTest xmlTest = new XmlTest(xmlSuite); xmlTest.setName("TmpTest"); xmlTest.setXmlClasses(Collections.singletonList(new XmlClass(c))); return xmlSuite; }
Source:
public CondensedAnomalyTimelinesView compress() { if (timeStamps.size() == 0) { return this; } try { if (this.toJsonString().length() > DEFAULT_MAX_LENGTH) { roundUp(); } } catch (JsonProcessingException e) { throw new IllegalStateException("Unable to parse view to json string", e); } return compress(DEFAULT_MAX_LENGTH); }

Target:
public CondensedAnomalyTimelinesView compress() { return compress(DEFAULT_MAX_LENGTH); }
Source:
private Payment getPaymentAgainstAuthorization(String totalAmount) { Address billingAddress = AddressTestCase.createAddress(); CreditCard creditCard = new CreditCard(); creditCard.setBillingAddress(billingAddress); creditCard.setCvv2(617); creditCard.setExpireMonth(01); creditCard.setExpireYear(2017); creditCard.setFirstName("Joe"); creditCard.setLastName("Shopper"); creditCard.setNumber("4422009910903049"); creditCard.setType("visa"); Amount amount = new Amount(); amount.setCurrency("USD"); amount.setTotal(totalAmount); Transaction transaction = new Transaction(); transaction.setAmount(amount); transaction .setDescription("This is the payment transaction description."); List<Transaction> transactions = new ArrayList<Transaction>(); transactions.add(transaction); FundingInstrument fundingInstrument = new FundingInstrument(); fundingInstrument.setCreditCard(creditCard); List<FundingInstrument> fundingInstrumentList = new ArrayList<FundingInstrument>(); fundingInstrumentList.add(fundingInstrument); Payer payer = new Payer(); payer.setFundingInstruments(fundingInstrumentList); payer.setPaymentMethod("credit_card"); Payment payment = new Payment(); payment.setIntent("authorize"); payment.setPayer(payer); payment.setTransactions(transactions); return payment; }

Target:
private Payment getPaymentAgainstAuthorization(String totalAmount) { Address billingAddress = AddressTestCase.createAddress(); CreditCard creditCard = new CreditCard(); creditCard.setBillingAddress(billingAddress); creditCard.setCvv2(617); creditCard.setExpireMonth(01); creditCard.setExpireYear(2020); creditCard.setFirstName("Joe"); creditCard.setLastName("Shopper"); creditCard.setNumber("4422009910903049"); creditCard.setType("visa"); Amount amount = new Amount(); amount.setCurrency("USD"); amount.setTotal(totalAmount); Transaction transaction = new Transaction(); transaction.setAmount(amount); transaction .setDescription("This is the payment transaction description."); List<Transaction> transactions = new ArrayList<Transaction>(); transactions.add(transaction); FundingInstrument fundingInstrument = new FundingInstrument(); fundingInstrument.setCreditCard(creditCard); List<FundingInstrument> fundingInstrumentList = new ArrayList<FundingInstrument>(); fundingInstrumentList.add(fundingInstrument); Payer payer = new Payer(); payer.setFundingInstruments(fundingInstrumentList); payer.setPaymentMethod("credit_card"); Payment payment = new Payment(); payment.setIntent("authorize"); payment.setPayer(payer); payment.setTransactions(transactions); return payment; }
Source:
public Answer execute(final OvsVpcRoutingPolicyConfigCommand command, final LibvirtComputingResource libvirtComputingResource) { try { final Script scriptCommand = new Script(libvirtComputingResource.getOvsTunnelPath(), libvirtComputingResource.getTimeout().getMillis(), s_logger); scriptCommand.add("configure_ovs_bridge_for_routing_policies"); scriptCommand.add("--bridge", command.getBridgeName()); scriptCommand.add("--config", command.getVpcConfigInJson()); final String result = scriptCommand.execute(); if (result.equalsIgnoreCase("SUCCESS")) { return new Answer(command, true, result); } else { return new Answer(command, false, result); } } catch (final Exception e) { s_logger.warn("caught exception while updating host with latest VPC topology", e); return new Answer(command, false, e.getMessage()); } }

Target:
public Answer execute(final OvsVpcRoutingPolicyConfigCommand command, final LibvirtComputingResource libvirtComputingResource) { try { final Script scriptCommand = new Script(libvirtComputingResource.getOvsTunnelPath(), libvirtComputingResource.getTimeout(), s_logger); scriptCommand.add("configure_ovs_bridge_for_routing_policies"); scriptCommand.add("--bridge", command.getBridgeName()); scriptCommand.add("--config", command.getVpcConfigInJson()); final String result = scriptCommand.execute(); if (result.equalsIgnoreCase("SUCCESS")) { return new Answer(command, true, result); } else { return new Answer(command, false, result); } } catch (final Exception e) { s_logger.warn("caught exception while updating host with latest VPC topology", e); return new Answer(command, false, e.getMessage()); } }
Source:
public int compare(SiteNode sn1, SiteNode sn2) { String s1 = sn1.getNodeName(false); String s2 = sn2.getNodeName(false); int initialComparison = s1.compareToIgnoreCase(s2); if (initialComparison == 0) { s1 = sn1.getNodeName(true); s2 = sn2.getNodeName(true); return s1.compareToIgnoreCase(s2); } else { return initialComparison; } }

Target:
public int compare(SiteNode sn1, SiteNode sn2) { String s1 = sn1.getName(); String s2 = sn2.getName(); int initialComparison = s1.compareToIgnoreCase(s2); if (initialComparison == 0) { s1 = sn1.getNodeName(); s2 = sn2.getNodeName(); return s1.compareToIgnoreCase(s2); } return initialComparison; }
Source:
private boolean createProxyClassFiles(TypeMirrors typeMirrors) { boolean success = true; for (ClassMetaData metadata : classCollection.getClasses()) { RealmProxyInterfaceGenerator interfaceGenerator = new RealmProxyInterfaceGenerator(processingEnv, metadata); try { interfaceGenerator.generate(); } catch (IOException e) { Utils.error(e.getMessage(), metadata.getClassElement()); success = false; } RealmProxyClassGenerator sourceCodeGenerator = new RealmProxyClassGenerator(processingEnv, typeMirrors, metadata, classCollection); try { sourceCodeGenerator.generate(); } catch (IOException e) { Utils.error(e.getMessage(), metadata.getClassElement()); success = false; } catch (UnsupportedOperationException e) { Utils.error(e.getMessage(), metadata.getClassElement()); success = false; } } return success; }

Target:
private boolean createProxyClassFiles(TypeMirrors typeMirrors) { for (ClassMetaData metadata : classCollection.getClasses()) { RealmProxyInterfaceGenerator interfaceGenerator = new RealmProxyInterfaceGenerator(processingEnv, metadata); try { interfaceGenerator.generate(); } catch (IOException e) { Utils.error(e.getMessage(), metadata.getClassElement()); return false; } RealmProxyClassGenerator sourceCodeGenerator = new RealmProxyClassGenerator(processingEnv, typeMirrors, metadata, classCollection); try { sourceCodeGenerator.generate(); } catch (IOException | UnsupportedOperationException e) { Utils.error(e.getMessage(), metadata.getClassElement()); return false; } } return true; }
Source:
private void deleteOldBarrierVersions(int numVersionsToLeave) { String path = keyBuilder.getJobModelVersionBarrierPrefix(); LOG.info("jm path=" + path); List<String> znodeIds = zkClient.getChildren(path); LOG.info("ids = " + znodeIds); deleteOldVersionPath(path, znodeIds, numVersionsToLeave, new Comparator<String>() { @Override public int compare(String o1, String o2) { return ZkBarrierForVersionUpgrade.getVersion(o1) - ZkBarrierForVersionUpgrade.getVersion(o2); } }); }

Target:
void deleteOldBarrierVersions(int numVersionsToLeave) { String path = keyBuilder.getJobModelVersionBarrierPrefix(); LOG.info("about to delete old barrier paths from " + path); List<String> znodeIds = zkClient.getChildren(path); LOG.info("List of all zkNodes: " + znodeIds); deleteOldVersionPath(path, znodeIds, numVersionsToLeave, new Comparator<String>() { @Override public int compare(String o1, String o2) { return ZkBarrierForVersionUpgrade.getVersion(o1) - ZkBarrierForVersionUpgrade.getVersion(o2); } }); }
Source:
public void registerService( Object serviceInstance, ServiceProviderErrorMapper errorMapper, ServiceMessageDataDecoder dataDecoder) { Reflect.serviceInterfaces(serviceInstance) .forEach( serviceInterface -> Reflect.serviceMethods(serviceInterface) .forEach( (key, method) -> { Reflect.validateMethodOrThrow(method); MethodInfo methodInfo = new MethodInfo( Reflect.serviceName(serviceInterface), Reflect.methodName(method), Reflect.parameterizedReturnType(method), Reflect.communicationMode(method), method.getParameterCount(), Reflect.requestType(method)); String qualifier = methodInfo.qualifier(); ServiceMethodInvoker invoker = new ServiceMethodInvoker( method, serviceInstance, methodInfo, errorMapper, dataDecoder); if (methodInvokers.containsKey(qualifier)) { LOGGER.warn("<{}> for API <{}> will be replaced by the following methodInvoker: <{}>", methodInvokers.get(qualifier), qualifier, invoker); } methodInvokers.put(methodInfo.qualifier(), invoker); })); }

Target:
public void registerService( Object serviceInstance, ServiceProviderErrorMapper errorMapper, ServiceMessageDataDecoder dataDecoder) { Reflect.serviceInterfaces(serviceInstance) .forEach( serviceInterface -> Reflect.serviceMethods(serviceInterface) .forEach( (key, method) -> { Reflect.validateMethodOrThrow(method); MethodInfo methodInfo = new MethodInfo( Reflect.serviceName(serviceInterface), Reflect.methodName(method), Reflect.parameterizedReturnType(method), Reflect.communicationMode(method), method.getParameterCount(), Reflect.requestType(method)); String qualifier = methodInfo.qualifier(); if (methodInvokers.containsKey(qualifier)) { throw new IllegalStateException( String.format( "MethodInvoker for api '%s' already exists", qualifier)); } ServiceMethodInvoker invoker = new ServiceMethodInvoker( method, serviceInstance, methodInfo, errorMapper, dataDecoder); methodInvokers.put(methodInfo.qualifier(), invoker); })); }
Source:
private void notifyEventTypeSelectionListener(Event e){ for(Listener l : fEventTypeSelectedListeners){ l.handleEvent(e); } }

Target:
private void notifyEventTypeSelectionListener(Event e) { for (Object o : fEventTypeSelectedListeners.getListeners()) { ((Listener) o).handleEvent(e); } }
Source:
protected static void removeNetworkFromHosts(Network network, CommandContext context, List<VdsNetworkInterface> nics) { RemoveNetworkParametersBuilder builder = new RemoveNetworkParametersBuilder(network, context); ArrayList<VdcActionParametersBase> parameters = builder.buildParameters(nics); if (!parameters.isEmpty()) { NetworkParametersBuilder.updateParametersSequencing(parameters); Backend.getInstance().runInternalMultipleActions(VdcActionType.PersistentSetupNetworks, parameters, context); } }

Target:
private static void removeNetworkFromHosts(Network network, CommandContext context, List<VdsNetworkInterface> nics) { RemoveNetworkParametersBuilder builder = new RemoveNetworkParametersBuilder(network, context); ArrayList<VdcActionParametersBase> parameters = builder.buildParameters(nics); if (!parameters.isEmpty()) { NetworkParametersBuilder.updateParametersSequencing(parameters); Backend.getInstance().runInternalMultipleActions(VdcActionType.PersistentSetupNetworks, parameters, context); } }
Source:
public S3AInputStream(S3AReadOpContext ctx, S3ObjectAttributes s3Attributes, long contentLength, AmazonS3 client) { Preconditions.checkArgument(isNotEmpty(s3Attributes.getBucket()), "No Bucket"); Preconditions.checkArgument(isNotEmpty(s3Attributes.getKey()), "No Key"); Preconditions.checkArgument(contentLength >= 0, "Negative content length"); this.context = ctx; this.bucket = s3Attributes.getBucket(); this.key = s3Attributes.getKey(); this.pathStr = ctx.dstFileStatus.getPath().toString(); this.contentLength = contentLength; this.client = client; this.uri = "s3a://" + this.bucket + "/" + this.key; this.streamStatistics = ctx.instrumentation.newInputStreamStatistics(); this.serverSideEncryptionAlgorithm = s3Attributes.getServerSideEncryptionAlgorithm(); this.serverSideEncryptionKey = s3Attributes.getServerSideEncryptionKey(); ChangeDetectionPolicy changeDetectionPolicy = ctx.getChangeDetectionPolicy(); this.changeTracker = new ChangeTracker(uri, changeDetectionPolicy, streamStatistics.getVersionMismatchCounter(), s3Attributes); setInputPolicy(ctx.getInputPolicy()); setReadahead(ctx.getReadahead()); }

Target:
public S3AInputStream(S3AReadOpContext ctx, S3ObjectAttributes s3Attributes, long contentLength, AmazonS3 client) { Preconditions.checkArgument(isNotEmpty(s3Attributes.getBucket()), "No Bucket"); Preconditions.checkArgument(isNotEmpty(s3Attributes.getKey()), "No Key"); Preconditions.checkArgument(contentLength >= 0, "Negative content length"); this.context = ctx; this.bucket = s3Attributes.getBucket(); this.key = s3Attributes.getKey(); this.pathStr = ctx.dstFileStatus.getPath().toString(); this.contentLength = contentLength; this.client = client; this.uri = "s3a://" + this.bucket + "/" + this.key; this.streamStatistics = ctx.instrumentation.newInputStreamStatistics(); this.serverSideEncryptionAlgorithm = s3Attributes.getServerSideEncryptionAlgorithm(); this.serverSideEncryptionKey = s3Attributes.getServerSideEncryptionKey(); this.changeTracker = new ChangeTracker(uri, ctx.getChangeDetectionPolicy(), streamStatistics.getVersionMismatchCounter(), s3Attributes); setInputPolicy(ctx.getInputPolicy()); setReadahead(ctx.getReadahead()); }
Source:
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17) throws StandardException{ if(SanityManager.DEBUG){ SanityManager.THROWASSERT("Fourteen-argument init() not implemented for "+getClass().getName()); } }

Target:
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14, Object arg15, Object arg16, Object arg17) throws StandardException{ if(SanityManager.DEBUG){ SanityManager.THROWASSERT("Seventeen-argument init() not implemented for "+getClass().getName()); } }
Source:
public void deleteAll(){}

Target:
public void deleteAll(){ jdbcTemplate.update("delete * from " + TABLE_NAME); }
Source:
public void testFindQueryResponseTransformersSearchById() { mockQueryResponseTransformer( new ImmutableMap.Builder<String, Object>().put(Constants.SERVICE_ID, "id1").build()); QueryResponseTransformer transformer2 = mockQueryResponseTransformer( new ImmutableMap.Builder<String, Object>().put(Constants.SERVICE_ID, "id2").build()); List<QueryResponseTransformer> transformers = transformerLocator.findQueryResponseTransformers("id2"); assertThat(transformers, hasSize(1)); assertThat(transformers.get(0), is(transformer2)); }

Target:
public void testFindQueryResponseTransformersSearchById() { mockQueryResponseTransformer( new ImmutableMap.Builder<String, Object>().put(Constants.SERVICE_ID, ID1).build()); QueryResponseTransformer transformer2 = mockQueryResponseTransformer( new ImmutableMap.Builder<String, Object>().put(Constants.SERVICE_ID, ID2).build()); List<QueryResponseTransformer> transformers = transformerLocator.findQueryResponseTransformers(ID2); assertThat(transformers, hasSize(1)); assertThat(transformers.get(0), is(transformer2)); }
Source:
private boolean isOriginalStale(int[] preparedTypes) { if (isPreparedTypesSet) { return false; } if (preparedTypes == null) { return false; } if (preparedTypes.length == 0) { return false; } if (preparedTypes.length < originalPreparedTypes.length) { return false; } int maxPos = originalPreparedTypes.length - 1; for (int pos = 0; pos <= maxPos; pos += 1) { if (originalPreparedTypes[pos] == UNSPECIFIED && preparedTypes[pos] != UNSPECIFIED) { return true; } } return false; }

Target:
private boolean isOriginalStale(int[] preparedTypes) { if (isPreparedTypesSet) { return false; } if (preparedTypes == null) { return false; } if (preparedTypes.length == 0) { return false; } if (preparedTypes.length < originalPreparedTypes.length) { return false; } int maxPos = originalPreparedTypes.length - 1; for (int pos = 0; pos <= maxPos; pos++) { if (originalPreparedTypes[pos] == UNSPECIFIED && preparedTypes[pos] != UNSPECIFIED) { return true; } } return false; }
Source:
public Set<Long> visit(ExpressionTree tree, Object... data) { Verify.that(data.length >= 1); Verify.that(data[0] instanceof Store); Store store = (Store) data[0]; AtomicOperation atomic = (AtomicOperation) data[0]; Expression expression = ((Expression) tree.root()); String key = expression.raw().key(); Operator operator = (Operator) expression.raw().operator(); if(key.equals(Constants.JSON_RESERVED_IDENTIFIER_NAME)) { Set<Long> ids; if(operator == Operator.EQUALS) { ids = Sets.newTreeSet(); expression.raw().values().forEach( value -> ids.add(((Number) value).longValue())); } else if(operator == Operator.NOT_EQUALS) { ids = store.getAllRecords(); expression.raw().values().forEach( value -> ids.remove(((Number) value).longValue())); } else { throw new IllegalArgumentException( "Cannot query on record id using " + expression.raw().operator()); } return ids; } else { ArrayBuilder<TObject> values = ArrayBuilder.builder(); expression.values().forEach( value -> values.add(Convert.javaToThrift(value.value()))); Set<Long> results; if(LinkNavigation.isNavigationScheme(key)) { TObject[] builtValues = values.build(); results = Sets.newHashSet(); Set<Long> records = store.getAllRecords(); key = expression.key().toString(); for (long record : records) { Map<Long, Set<TObject>> result = Operations .navigateKeyRecordAtomic(key, record, Time.NONE, atomic); for (Map.Entry<Long, Set<TObject>> entry : result .entrySet()) { for (TObject value : entry.getValue()) { if(value.is(operator, builtValues)) { results.add(record); break; } } } } } else { results = expression.timestamp() == TimestampSymbol.PRESENT ? store.find(key, operator, values.build()) : store.find(expression.raw().timestamp(), key, operator, values.build()); } return results; } }

Target:
public Set<Long> visit(ExpressionTree tree, Object... data) { Verify.that(data.length >= 1); Verify.that(data[0] instanceof Store); Store store = (Store) data[0]; Expression expression = ((Expression) tree.root()); String key = expression.raw().key(); Operator operator = (Operator) expression.raw().operator(); if(key.equals(Constants.JSON_RESERVED_IDENTIFIER_NAME)) { Set<Long> ids; if(operator == Operator.EQUALS) { ids = Sets.newTreeSet(); expression.raw().values().forEach( value -> ids.add(((Number) value).longValue())); } else if(operator == Operator.NOT_EQUALS) { ids = store.getAllRecords(); expression.raw().values().forEach( value -> ids.remove(((Number) value).longValue())); } else { throw new IllegalArgumentException( "Cannot query on record id using " + expression.raw().operator()); } return ids; } else { ArrayBuilder<TObject> values = ArrayBuilder.builder(); expression.values().forEach( value -> values.add(Convert.javaToThrift(value.value()))); Set<Long> results = expression .timestamp() == TimestampSymbol.PRESENT ? store.find(key, operator, values.build()) : store.find(expression.raw().timestamp(), key, operator, values.build()); return results; } }
Source:
public UnimportedModuleNotificationPanel(@NotNull final Project project, @NotNull final VirtualFile subproject) { setText("This folder was not recognized as a Gradle project. Most likely it was not added to settings.gradle."); createActionLabel("Add Now...", new Runnable() { @Override public void run() { myIsImporting.set(true); try { AndroidImportModuleAction.importGradleSubprojectAsModule(subproject, project); } catch (IOException e) { throw Throwables.propagate(e); } finally { myIsImporting.set(false); } } }); }

Target:
public UnimportedModuleNotificationPanel(@NotNull final Project project, @NotNull final VirtualFile subproject) { setText("This folder does not belong to a Gradle project. Make sure it is registered in settings.gradle."); createActionLabel("Add Now...", new Runnable() { @Override public void run() { myIsImporting.set(true); try { AndroidImportModuleAction.importGradleSubprojectAsModule(subproject, project); } catch (IOException e) { throw Throwables.propagate(e); } finally { myIsImporting.set(false); } } }); }
Source:
public void should_create_build_with_given_name() { String jobName = "MyJob"; String buildName = "MyBuild"; String jobDslScript = String.format("job('%s') { wrappers { buildName('%s') } }", jobName, buildName); Job seed = createSeedJobWithJobDsl(jobDslScript); seed.startBuild().waitUntilFinished(); Job job = jenkins.jobs.get(Job.class, jobName); Build build = job.startBuild().waitUntilFinished(); build.open(); WebElement displayNameElement = build.find(by.xpath(" assertTrue(displayNameElement.getText().contains(buildName)); }

Target:
public void should_create_build_with_given_name() { String jobName = "MyJob"; String buildName = "MyBuild"; String jobDslScript = String.format("job('%s') { wrappers { buildName('%s') } }", jobName, buildName); Job seed = createSeedJobWithJobDsl(jobDslScript); seed.startBuild().waitUntilFinished(); Job job = jenkins.jobs.get(Job.class, jobName); Build build = job.startBuild().waitUntilFinished(); build.open(); assertThat(build.getDisplayName(), containsString(buildName)); }
Source:
public Status status() { Cache<String, Status> statusCache = candlepinCache.getStatusCache(); Status cached = statusCache.get("status"); if (cached != null) { return cached; } boolean good = true; try { rulesCurator.getUpdatedFromDB(); } catch (Exception e) { log.error("Error checking database connection", e); good = false; } Status status = new Status(good, version, release, standalone, jsProvider.getRulesVersion(), jsProvider.getRulesSource()); statusCache.put("status", status); return status; }

Target:
public Status status() { Cache<String, Status> statusCache = candlepinCache.getStatusCache(); Status cached = statusCache.get(CandlepinCache.STATUS_KEY); if (cached != null) { return cached; } boolean good = true; try { rulesCurator.getUpdatedFromDB(); } catch (Exception e) { log.error("Error checking database connection", e); good = false; } Status status = new Status(good, version, release, standalone, jsProvider.getRulesVersion(), jsProvider.getRulesSource()); statusCache.put(CandlepinCache.STATUS_KEY, status); return status; }
Source:
public List<TargetTypeBuildScope> getBuildTargetScopes(@NotNull CompileScope baseScope, @NotNull CompilerFilter filter, @NotNull Project project, boolean forceBuild) { if (!hasErlangModules(baseScope) || ErlangCompilerSettings.getInstance(project).isUseRebarCompilerEnabled()) { return Collections.emptyList(); } TargetTypeBuildScope targetsScope = CmdlineProtoUtil.createTargetsScope(TARGET_TYPE_ID, Collections.singletonList(project.getName()), forceBuild); return Collections.singletonList(targetsScope); }

Target:
public List<TargetTypeBuildScope> getBuildTargetScopes(@NotNull CompileScope baseScope, @NotNull CompilerFilter filter, @NotNull Project project, boolean forceBuild) { if (ErlangCompilerSettings.getInstance(project).isUseRebarCompilerEnabled() || !hasErlangModules(baseScope)) { return ContainerUtil.emptyList(); } return Collections.singletonList(CmdlineProtoUtil.createTargetsScope(ErlangModuleBuildOrderTargetType.TYPE_ID, Collections.singletonList(project.getName()), forceBuild)); }
Source:
public void clearAllConnections() { _address.clear(); }

Target:
public synchronized void clearAllConnections() { _address.clear(); }
Source:
public void facebookRequest(HashMap<String, String> params) { final Intent intent = new Intent(this, MainActivity.class); FacebookLoginRequest facebookLoginRequest = new FacebookLoginRequest(this, params, new Response.Listener<Session>() { @Override public void onResponse(Session session) { storeSessionAndStartMainActivity(intent, session); } }, new Response.Listener<APIError>() { @Override public void onResponse(APIError apiError) { viewBlocker.setVisibility(View.GONE); Log.e("Error response", "In the landing page activity for the login request"); } }); mloginNetworkManager.getRequestQueue().add(facebookLoginRequest); }

Target:
public void facebookRequest(HashMap<String, String> params) { final Intent intent = new Intent(this, MainActivity.class); FacebookLoginRequest facebookLoginRequest = new FacebookLoginRequest(this, params, new Response.Listener<Session>() { @Override public void onResponse(Session session) { storeSessionAndStartMainActivity(intent, session); } }, new Response.Listener<APIError>() { @Override public void onResponse(APIError apiError) { viewBlocker.setVisibility(View.GONE); } }); mloginNetworkManager.getRequestQueue().add(facebookLoginRequest); }
Source:
public void updateShortcut(ShortcutDTO shortcutDTO) { final String baseName = shortcutDTO.getInfo().getName(); final File shortcutDirectory = new File(this.shortcutDirectory); final File iconFile = new File(shortcutDirectory, baseName + ".icon"); final File iconBackup = new File(shortcutDirectory, baseName + ".icon_backup"); final URI shortcutIcon = shortcutDTO.getIcon(); if (shortcutIcon != null) { final boolean keepIcon = shortcutIcon.getPath().equals(iconFile.getPath()); if (keepIcon) { try { Files.move(iconFile.toPath(), iconBackup.toPath()); shortcutDTO = new ShortcutDTO.Builder(shortcutDTO).withIcon(iconBackup.toURI()).build(); } catch (IOException e) { LOGGER.error("Could not backup icon."); } } } final File miniatureFile = new File(shortcutDirectory, baseName + ".miniature"); final File miniatureBackup = new File(shortcutDirectory, baseName + ".miniature_backup"); final URI shortcutMiniature = shortcutDTO.getMiniature(); if (shortcutMiniature != null) { final boolean keepMiniature = shortcutMiniature.getPath().equals(miniatureFile.getPath()); if (keepMiniature) { try { Files.move(miniatureFile.toPath(), miniatureBackup.toPath()); shortcutDTO = new ShortcutDTO.Builder(shortcutDTO).withMiniature(miniatureBackup.toURI()).build(); } catch (IOException e) { LOGGER.error("Could not backup miniature."); } } } deleteShortcut(shortcutDTO); createShortcut(shortcutDTO); if (iconBackup.exists()) { iconBackup.delete(); } if (miniatureBackup.exists()) { miniatureBackup.delete(); } }

Target:
public void updateShortcut(ShortcutDTO shortcutDTO) { final String baseName = shortcutDTO.getInfo().getName(); final File shortcutDirectory = new File(this.shortcutDirectory); final File iconFile = new File(shortcutDirectory, baseName + ".icon"); final File iconBackup = new File(shortcutDirectory, baseName + ".icon_backup"); final URI shortcutIcon = shortcutDTO.getIcon(); if (shortcutIcon != null) { final boolean keepIcon = shortcutIcon.getPath().equals(iconFile.getPath()); if (keepIcon) { try { Files.move(iconFile.toPath(), iconBackup.toPath()); shortcutDTO = new ShortcutDTO.Builder(shortcutDTO).withIcon(iconBackup.toURI()).build(); } catch (IOException e) { LOGGER.error("Could not backup icon.", e); } } } final File miniatureFile = new File(shortcutDirectory, baseName + ".miniature"); final File miniatureBackup = new File(shortcutDirectory, baseName + ".miniature_backup"); final URI shortcutMiniature = shortcutDTO.getMiniature(); if (shortcutMiniature != null) { final boolean keepMiniature = shortcutMiniature.getPath().equals(miniatureFile.getPath()); if (keepMiniature) { try { Files.move(miniatureFile.toPath(), miniatureBackup.toPath()); shortcutDTO = new ShortcutDTO.Builder(shortcutDTO).withMiniature(miniatureBackup.toURI()).build(); } catch (IOException e) { LOGGER.error("Could not backup miniature.", e); } } } deleteShortcut(shortcutDTO); createShortcut(shortcutDTO); if (iconBackup.exists()) { iconBackup.delete(); } if (miniatureBackup.exists()) { miniatureBackup.delete(); } }
Source:
public void testCreateEphemeralWithMismatchedSession() throws Exception { final String className = TestHelper.getTestClassName(); final String methodName = TestHelper.getTestMethodName(); final String clusterName = className + "_" + methodName; TestHelper.setupCluster(clusterName, ZK_ADDR, 12918, "localhost", "TestDB", 1, 10, 5, 3, "MasterSlave", true); final long originalSessionId = _zkClient.getSessionId(); final String originalHexSessionId = _zkClient.getHexSessionId(); final String path = "/" + methodName; Assert.assertFalse(_zkClient.exists(path)); ZkTestHelper.expireSession(_zkClient); Assert.assertTrue(TestHelper.verify(() -> { try { return _zkClient.getSessionId() > originalSessionId; } catch (HelixException ex) { return false; } }, 1000L)); try { _zkClient.createEphemeral(path, "Hello Helix", originalHexSessionId); Assert.fail("Ephemeral node should not be created by the expired session."); } catch (ZkSessionMismatchedException expected) { } Assert.assertFalse(_zkClient.exists(path)); }

Target:
public void testCreateEphemeralWithMismatchedSession() throws Exception { final String className = TestHelper.getTestClassName(); final String methodName = TestHelper.getTestMethodName(); final String clusterName = className + "_" + methodName; TestHelper.setupCluster(clusterName, ZK_ADDR, 12918, "localhost", "TestDB", 1, 10, 5, 3, "MasterSlave", true); final long originalSessionId = _zkClient.getSessionId(); final String originalHexSessionId = ZKUtil.toHexSessionId(originalSessionId); final String path = "/" + methodName; Assert.assertFalse(_zkClient.exists(path)); ZkTestHelper.expireSession(_zkClient); Assert.assertTrue(TestHelper.verify(() -> { try { return _zkClient.getSessionId() != originalSessionId; } catch (HelixException ex) { return false; } }, 1000L)); try { _zkClient.createEphemeral(path, "Hello Helix", originalHexSessionId); Assert.fail("Ephemeral node should not be created by the expired session."); } catch (ZkSessionMismatchedException expected) { } catch (Exception unexpected) { Assert.fail("Should not have thrown exception: " + unexpected); } Assert.assertFalse(_zkClient.exists(path)); }
Source:
private String createURI(final boolean usePassword) { StringBuilder sb = new StringBuilder(); appendRootUri(sb, usePassword); if (sb.charAt(sb.length() - 1) != '/') { sb.append('/'); } sb.append(shareName); if (!(getPath() == null || getPath().equals("/"))) { if (!getPath().startsWith("/")) { sb.append('/'); } sb.append(getPath()); } return sb.toString(); }

Target:
private String createURI(final boolean usePassword) { StringBuilder sb = new StringBuilder(); appendRootUri(sb, usePassword); if (sb.charAt(sb.length() - 1) != '/') { sb.append('/'); } sb.append(shareName); String path = getPath(); if (!(path == null || path.equals("/"))) { if (!path.startsWith("/")) { sb.append('/'); } sb.append(path); } return sb.toString(); }