auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void start() { this.subscriber = Subscriber .newBuilder(ProjectSubscriptionName.of(project, subscriptionName), messageReceiver) .setCredentialsProvider(FixedCredentialsProvider.create(credentials)) .build(); subscriber.addListener(new GooglePubsubFailureHandler(this, formatSubscriptionName(project, subscriptionName)), MoreExecutors.directExecutor()); subscriber.startAsync().awaitRunning(); log.info("Google Pubsub subscriber started"); }

Target:
synchronized public void start() { this.subscriber = Subscriber .newBuilder(ProjectSubscriptionName.of(project, subscriptionName), messageReceiver) .setCredentialsProvider(FixedCredentialsProvider.create(credentials)) .build(); subscriber.addListener(new GooglePubsubFailureHandler(this, formatSubscriptionName(project, subscriptionName)), MoreExecutors.directExecutor()); subscriber.startAsync().awaitRunning(); log.info("Google Pubsub subscriber started for {}", formatSubscriptionName(project, subscriptionName)); }
Source:
public static TripsConfig initTripsConfig() { return new TripsConfig( config.getLong("report.trip.minimalTripDistance", 500), config.getLong("report.trip.minimalTripDuration", 300) * 1000, config.getLong("report.trip.minimalParkingDuration", 300) * 1000, config.getBoolean("report.trip.greedyParking"), config.getLong("report.trip.minimalNoDataDuration", 3600) * 1000, config.getBoolean("report.trip.stopOnIgnitionOff")); }

Target:
public static TripsConfig initTripsConfig() { return new TripsConfig( config.getLong("report.trip.minimalTripDistance", 500), config.getLong("report.trip.minimalTripDuration", 300) * 1000, config.getLong("report.trip.minimalParkingDuration", 300) * 1000, config.getBoolean("report.trip.greedyParking"), config.getLong("report.trip.minimalNoDataDuration", 3600) * 1000, config.getBoolean("report.trip.useIgnition")); }
Source:
private void peekEventsFromIncompleteTransactions(List<GatewaySenderEventImpl> batch, Map<TransactionId, Integer> incompleteTransactionIdsInBatch, PartitionedRegion prQ) { if (!isGroupTransactionEvents()) { return; } if (areAllTransactionsCompleteInBatch(incompleteTransactionIdsInBatch)) { return; } int maxRetries = 2; for (Map.Entry<TransactionId, Integer> pendingTransaction : incompleteTransactionIdsInBatch .entrySet()) { TransactionId transactionId = pendingTransaction.getKey(); int bucketId = pendingTransaction.getValue(); boolean presentLastEventInTransaction = false; int retries = 0; while (!presentLastEventInTransaction && ++retries <= maxRetries) { List<Object> events = peekEventsWithTransactionId(prQ, bucketId, transactionId); for (Object object : events) { GatewaySenderEventImpl event = (GatewaySenderEventImpl) object; batch.add(event); peekedEvents.add(event); presentLastEventInTransaction = event.isLastEventInTransaction(); if (logger.isDebugEnabled()) { logger.debug( "Peeking extra event: {}, bucketId: {}, isLastEventInTransaction: {}, batch size: {}", event.getKey(), bucketId, event.isLastEventInTransaction(), batch.size()); } } } if (retries >= maxRetries) { logger.warn("Not able to retrieve all events for transaction after retries", transactionId, retries); } } }

Target:
private void peekEventsFromIncompleteTransactions(List<GatewaySenderEventImpl> batch, Map<TransactionId, Integer> incompleteTransactionIdsInBatch, PartitionedRegion prQ) { if (!mustGroupTransactionEvents()) { return; } if (areAllTransactionsCompleteInBatch(incompleteTransactionIdsInBatch)) { return; } for (Map.Entry<TransactionId, Integer> pendingTransaction : incompleteTransactionIdsInBatch .entrySet()) { TransactionId transactionId = pendingTransaction.getKey(); int bucketId = pendingTransaction.getValue(); boolean areAllEventsForTransactionInBatch = false; int retries = 0; while (!areAllEventsForTransactionInBatch && retries++ < GET_TRANSACTION_EVENTS_FROM_QUEUE_RETRIES) { List<Object> events = peekEventsWithTransactionId(prQ, bucketId, transactionId); for (Object object : events) { GatewaySenderEventImpl event = (GatewaySenderEventImpl) object; batch.add(event); peekedEvents.add(event); areAllEventsForTransactionInBatch = event.isLastEventInTransaction(); if (logger.isDebugEnabled()) { logger.debug( "Peeking extra event: {}, bucketId: {}, isLastEventInTransaction: {}, batch size: {}", event.getKey(), bucketId, event.isLastEventInTransaction(), batch.size()); } } } if (!areAllEventsForTransactionInBatch) { logger.warn("Not able to retrieve all events for transaction after tries", transactionId, retries); } } }
Source:
public void moveUnpluggedDiskVmDown() { command.getParameters().setParametersList(createMoveDisksParameters()); initDiskImage(diskImageId); initVm(VMStatus.Down, Guid.newGuid(), diskImageId, false); command.updateParameters(); assertTrue(command.getMoveDiskParametersList().size() == 1); }

Target:
public void moveUnpluggedDiskVmDown() { command.getParameters().setParametersList(createMoveDisksParameters()); initDiskImage(diskImageId); initVm(VMStatus.Down, Guid.newGuid(), diskImageId, false); command.updateParameters(); assertEquals(command.getMoveDiskParametersList().size(), 1); }
Source:
public void verifyLastEditHistoryDevice(String targetText) { Assertion.assertStringContains(targetText, getLastEditHistoryDevice()); PageObjectLogging.log("verifyLastEditHistoryDevice", "verifying the last edit shows " + targetText, true); }

Target:
public void verifyLastEditHistoryDevice(String targetText) { Assertion.assertStringContains(targetText, getLastEditHistoryDevice()); PageObjectLogging.log( "verifyLastEditHistoryDevice", "The last edit shows " + targetText, true ); }
Source:
private void initializeDefinedElements(CContentAssistInvocationContext context) { int startOffset = getStatementStartOffset(context.getDocument(), context.getParseOffset() - fPrefix.length()); fAvailableElements = new ArrayList<>(); IASTCompletionNode node = null; CContentAssistInvocationContext newContext = new CContentAssistInvocationContext( context.getViewer(), startOffset, getCEditor(), true, false); try { node = newContext.getCompletionNode(); if (node != null) { IASTName[] names = node.getNames(); for (IASTName name : names) { IASTCompletionContext astContext = name.getCompletionContext(); if (astContext != null) { IBinding[] bindings = astContext.findBindings(name, true); if (bindings != null) { AccessContext accessibilityContext = new AccessContext(name); for (IBinding binding : bindings) { if (accessibilityContext.isAccessible(binding)) fAvailableElements.add(binding); } } } } } } finally { newContext.dispose(); } }

Target:
private void initializeDefinedElements(CContentAssistInvocationContext context) { int startOffset = getStatementStartOffset(context.getDocument(), context.getParseOffset() - fPrefix.length()); fAvailableElements = new ArrayList<>(); IASTCompletionNode node = null; CContentAssistInvocationContext newContext = new CContentAssistInvocationContext( context.getViewer(), startOffset, context.getEditor(), true, false); try { node = newContext.getCompletionNode(); if (node != null) { IASTName[] names = node.getNames(); for (IASTName name : names) { IASTCompletionContext astContext = name.getCompletionContext(); if (astContext != null) { IBinding[] bindings = astContext.findBindings(name, true); if (bindings != null) { AccessContext accessibilityContext = new AccessContext(name); for (IBinding binding : bindings) { if (accessibilityContext.isAccessible(binding)) fAvailableElements.add(binding); } } } } } } finally { newContext.dispose(); } }
Source:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); byte[] valueBytes = (values == null) ? new byte[]{} : StringUtils.toUtf8(values.toString()); return ByteBuffer.allocate(1 + dimensionBytes.length + valueBytes.length) .put(DimFilterCacheHelper.SELECTOR_CACHE_ID) .put(dimensionBytes) .put(valueBytes) .array(); }

Target:
public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); final byte[][] valuesBytes = new byte[values.size()][]; int valuesBytesSize = 0; int index = 0; for (String value : values) { valuesBytes[index] = StringUtils.toUtf8(value); valuesBytesSize += valuesBytes[index].length + 1; ++index; } ByteBuffer filterCacheKey = ByteBuffer.allocate(2 + dimensionBytes.length + valuesBytesSize) .put(DimFilterCacheHelper.IN_CACHE_ID) .put(dimensionBytes) .put((byte) 0xFF); for (byte bytes: valuesBytes) { filterCacheKey.put(bytes) .put((byte) 0xFF); } return filterCacheKey.array(); }
Source:
private Set<String> getTenants() { Set<String> tenants = new HashSet<String>(); ResultSet resultset = session.execute("SELECT * FROM system_schema.keyspaces WHERE keyspace_name = '" + "hawkular_metrics" + "';"); if (resultset.all().isEmpty()) { return tenants; } ResultSet resultSet = session.execute("SELECT DISTINCT tenant_id,type from hawkular_metrics.metrics_idx;"); for (Row row:resultSet.all()) { String tenant = row.getString("tenant_id"); if (!tenant.startsWith("_") && !tenant.contains(":")) { tenants.add(tenant); } } return tenants; }

Target:
private Set<String> getTenants() { Set<String> tenants = new HashSet<>(); ResultSet resultset = session.execute("SELECT * FROM system_schema.keyspaces WHERE keyspace_name = 'hawkular_metrics';"); if (!resultset.iterator().hasNext()) { return tenants; } try { ResultSet resultSet = session.execute("SELECT DISTINCT tenant_id,type from hawkular_metrics.metrics_idx;"); Iterator<Row> ri = resultSet.iterator(); while (ri.hasNext()) { Row row = ri.next(); String tenant = row.getString("tenant_id"); if (!tenant.startsWith("_") && !tenant.contains(":")) { tenants.add(tenant); } } } catch (InvalidQueryException iqe) { log.warn(iqe); } return tenants; }
Source:
public static void renderOverlay(RenderGameOverlayEvent.Text event) { Minecraft mc = Minecraft.getMinecraft(); if (!mc.gameSettings.showDebugInfo) return; if (mc.player.hasReducedDebug() || mc.gameSettings.reducedDebugInfo || !mc.player.capabilities.isCreativeMode) { return; } List<String> left = event.getLeft(); List<String> right = event.getRight(); RayTraceResult mouseOver = mc.objectMouseOver; if (mouseOver == null) { return; } getDebuggableObject(mouseOver).ifPresent(client -> { EnumFacing side = mouseOver.sideHit; MessageManager.sendToServer(new MessageDebuggableRequest(client.getPos(), side)); List<String> clientLeft = new ArrayList<>(); List<String> clientRight = new ArrayList<>(); client.getClientDebugInfo(clientLeft, clientRight, side); final String headerFirst = DIFF_HEADER_FORMATTING + "SERVER:"; final String headerSecond = DIFF_HEADER_FORMATTING + "CLIENT:"; appendDiff(left, ClientDebuggables.SERVER_LEFT, clientLeft, headerFirst, headerSecond); appendDiff(right, ClientDebuggables.SERVER_RIGHT, clientRight, headerFirst, headerSecond); }); }

Target:
public static void renderOverlay(RenderGameOverlayEvent.Text event) { if (Minecraft.getMinecraft().gameSettings.showDebugInfo && !Minecraft.getMinecraft().player.hasReducedDebug() && !Minecraft.getMinecraft().gameSettings.reducedDebugInfo && Minecraft.getMinecraft().player.capabilities.isCreativeMode) { ClientDebuggables.getDebuggableTileSide().ifPresent(tileSide -> { List<String> clientLeft = new ArrayList<>(); List<String> clientRight = new ArrayList<>(); tileSide.getLeft().getDebugInfo(clientLeft, clientRight, tileSide.getRight()); String headerFirst = DIFF_HEADER_FORMATTING + "SERVER:"; String headerSecond = DIFF_HEADER_FORMATTING + "CLIENT:"; appendDiff(event.getLeft(), ClientDebuggables.SERVER_LEFT, clientLeft, headerFirst, headerSecond); appendDiff(event.getRight(), ClientDebuggables.SERVER_RIGHT, clientRight, headerFirst, headerSecond); tileSide.getLeft().getClientDebugInfo(event.getLeft(), event.getRight(), tileSide.getRight()); }); } }
Source:
public void createUserWithEmailAsUsername() { switchRegistrationEmailAsUsername(true); String id = createUser(); UserResource user = realm.users().get(id); UserRepresentation userRep = user.toRepresentation(); assertEquals("user1@localhost", userRep.getEmail()); switchRegistrationEmailAsUsername(false); }

Target:
public void createUserWithEmailAsUsername() { switchRegistrationEmailAsUsername(true); String id = createUser(); UserResource user = realm.users().get(id); UserRepresentation userRep = user.toRepresentation(); assertEquals("user1@localhost", userRep.getUsername()); switchRegistrationEmailAsUsername(false); }
Source:
private DeclarationScope(DeclarationScope source, DeclarationScope parentScope, String name) { this(parentScope, name); fStructs.putAll(source.fStructs); fEnums.putAll(source.fEnums); fVariants.putAll(source.fVariants); fTypes.putAll(source.fTypes); fIdentifiers.putAll(source.fIdentifiers); for (Entry<String, DeclarationScope> child : source.fChildren.entrySet()) { fChildren.put(child.getKey(), new DeclarationScope(child.getValue(), this, name)); } }

Target:
private DeclarationScope(DeclarationScope source, DeclarationScope parentScope, String name) { this(parentScope, name); fUniqueId = source.fUniqueId; fStructs.putAll(source.fStructs); fEnums.putAll(source.fEnums); fVariants.putAll(source.fVariants); fTypes.putAll(source.fTypes); fIdentifiers.putAll(source.fIdentifiers); for (DeclarationScope child : source.fChildren.values()) { addChild(child); } }
Source:
void drain() { if (wip.getAndIncrement() != 0) { return; } int missed = 1; final AtomicLong p = sharedProducer; final Subscriber<? super R> a = actual; for (;;) { if (cancelled) { cleanup(); return; } EagerInnerSubscriber<R> inner; boolean d = done; synchronized (subscribers) { inner = subscribers.peek(); } boolean empty = inner == null; if (d) { Throwable err = error; if (err != null) { cleanup(); a.onError(err); return; } else if (empty) { a.onCompleted(); return; } } if (!empty) { long r = p.get(); long e = 0L; boolean unbounded = r == Long.MAX_VALUE; Queue<R> q = inner.queue; boolean innerDone = false; for (;;) { d = inner.done; R v = q.peek(); empty = v == null; if (d) { Throwable err = inner.error; if (err != null) { cleanup(); a.onError(err); return; } else if (empty) { synchronized (subscribers) { subscribers.poll(); } inner.unsubscribe(); innerDone = true; break; } } if (empty) { break; } if (r == 0L) { break; } q.poll(); try { a.onNext(v); } catch (Throwable ex) { Exceptions.throwOrReport(ex, a, v); return; } r--; e--; } if (e != 0L) { if (!unbounded) { p.addAndGet(e); } } if (innerDone) { continue; } } missed = wip.addAndGet(-missed); if (missed == 0) { return; } } }

Target:
void drain() { if (wip.getAndIncrement() != 0) { return; } int missed = 1; final AtomicLong requested = sharedProducer; final Subscriber<? super R> actualSubscriber = this.actual; for (;;) { if (cancelled) { cleanup(); return; } EagerInnerSubscriber<R> innerSubscriber; boolean outerDone = done; synchronized (subscribers) { innerSubscriber = subscribers.peek(); } boolean empty = innerSubscriber == null; if (outerDone) { Throwable error = this.error; if (error != null) { cleanup(); actualSubscriber.onError(error); return; } else if (empty) { actualSubscriber.onCompleted(); return; } } if (!empty) { long requestedAmount = requested.get(); long emittedAmount = 0L; boolean unbounded = requestedAmount == Long.MAX_VALUE; Queue<R> innerQueue = innerSubscriber.queue; boolean innerDone = false; for (;;) { outerDone = innerSubscriber.done; R v = innerQueue.peek(); empty = v == null; if (outerDone) { Throwable innerError = innerSubscriber.error; if (innerError != null) { cleanup(); actualSubscriber.onError(innerError); return; } else if (empty) { synchronized (subscribers) { subscribers.poll(); } innerSubscriber.unsubscribe(); innerDone = true; break; } } if (empty) { break; } if (requestedAmount == 0L) { break; } innerQueue.poll(); try { actualSubscriber.onNext(v); } catch (Throwable ex) { Exceptions.throwOrReport(ex, actualSubscriber, v); return; } requestedAmount--; emittedAmount--; } if (emittedAmount != 0L) { if (!unbounded) { requested.addAndGet(emittedAmount); } if (!innerDone) { innerSubscriber.requestMore(-emittedAmount); } } if (innerDone) { continue; } } missed = wip.addAndGet(-missed); if (missed == 0) { return; } } }
Source:
public void importFileUpload(FileUploadEvent event) { importCertFile = event.getFile(); if (importCertFile != null) { importCertificate = new ArrayList<>(); Certificate cert = service.createCertificate(importCertFile.getContents()); cert.setAlias(ALIAS_PLACEHOLDER); importCertificate.add(cert); checkCertValidity(cert); Date CertExpiryDate = cert.getX509Cert().getNotAfter(); SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date today = new Date(); long DateDiff = CertExpiryDate.getTime() - today.getTime(); long ExpiresInDays = DateDiff / (24 * 60 * 60 * 1000); if (ExpiresInDays > 30 && ExpiresInDays <= 90) { FacesContext.getCurrentInstance().addMessage(certWarningMsg, new FacesMessage(FacesMessage.SEVERITY_INFO, "INFO", "This Certificate is expiring soon.")); } } }

Target:
public void importFileUpload(FileUploadEvent event) { importCertFile = event.getFile(); if (importCertFile != null) { importCertificate = new ArrayList<>(); Certificate cert = service.createCertificate(importCertFile.getContents()); cert.setAlias(ALIAS_PLACEHOLDER); importCertificate.add(cert); checkCertValidity(cert); if (cert.getExpiresInDays() > 30 && cert.getExpiresInDays() <= 90) { HelperUtil.addMessageInfo(IMPORT_CERT_EXPIRY_MSG, "This Certificate is expiring soon."); } } }
Source:
private final Object createValue() { if (getType() == BOOLEAN) { return random.nextBoolean(); } if (getType() == BIGINT) { return random.nextLong(); } if (getType() == INTEGER) { return random.nextInt(); } if (getType() == SMALLINT) { return (short) random.nextInt(); } if (getType() == TINYINT) { return (byte) random.nextInt(); } if (getType() == DATE) { return new SqlDate(random.nextInt()); } if (getType() == TIMESTAMP) { return new SqlTimestamp(START_TIME.plus(random.nextLong()).getMillis(), UTC_KEY); } throw new UnsupportedOperationException("Unsupported type: " + getType()); }

Target:
private final Object createValue() { if (getType() == BOOLEAN) { return random.nextBoolean(); } if (getType() == BIGINT) { return random.nextLong(); } if (getType() == INTEGER) { return random.nextInt(); } if (getType() == SMALLINT) { return (short) random.nextInt(); } if (getType() == TINYINT) { return (byte) random.nextInt(); } if (getType() == DATE) { return new SqlDate(random.nextInt()); } if (getType() == TIMESTAMP) { return new SqlTimestamp(random.nextLong(), TimeZoneKey.UTC_KEY); } throw new UnsupportedOperationException("Unsupported type: " + getType()); }
Source:
final void apply() throws QueryException { final Collection<DatabaseUpdates> updates = pendingUpdates.values(); final Collection<DBCreate> creates = dbCreates.values(); final Collection<DBRestore> restores = dbRestores.values(); if(tmp == null) { for(final DatabaseUpdates c : updates) { tmp = new MemData(c.data().meta.options); break; } } final Set<Data> dataWriteLocks = new HashSet<Data>(); for(final DatabaseUpdates c : updates) { c.check(tmp); dataWriteLocks.add(c.data()); } for(final DBCreate c : creates) { c.prepare(null); try { dataWriteLocks.add(c.qc.resource.database(c.dbName, c.info)); } catch(QueryException e) { } } for(final DBRestore r : restores) { r.prepare(null); try { dataWriteLocks.add(r.qc.resource.database(r.dbName, r.info)); } catch(QueryException e) { } } int i = 0; try { for(final Data d : dataWriteLocks) { if(!d.startUpdate()) throw BXDB_OPENED.get(null, d.meta.name); i++; } for(final DatabaseUpdates c : updates) c.apply(); for(final DBCreate c : creates) { c.apply(); final Data d = c.qc.resource.database(c.dbName, c.info); if(dataWriteLocks.add(d)) { d.startUpdate(); i++; } } for(final DBRestore r : restores) r.apply(); } finally { for(final Data d : dataWriteLocks) { if(i-- == 0) break; d.finishUpdate(); } } }

Target:
final void apply() throws QueryException { final Collection<DatabaseUpdates> updates = pendingUpdates.values(); final Collection<DBBackup> backups = dbBackups.values(); final Collection<DBCreate> creates = dbCreates.values(); final Collection<DBRestore> restores = dbRestores.values(); if(tmp == null) { for(final DatabaseUpdates c : updates) { tmp = new MemData(c.data().meta.options); break; } } final Set<Data> dataWriteLocks = new HashSet<Data>(); for(final DatabaseUpdates c : updates) { c.check(tmp); dataWriteLocks.add(c.data()); } for(final DBBackup b : backups) { b.prepare(null); dataWriteLocks.add(b.data); } for(final DBCreate c : creates) { c.prepare(null); try { dataWriteLocks.add(c.qc.resource.database(c.dbName, c.info)); } catch(QueryException e) { } } for(final DBRestore r : restores) { r.prepare(null); try { dataWriteLocks.add(r.qc.resource.database(r.dbName, r.info)); } catch(QueryException e) { } } int i = 0; try { for(final Data d : dataWriteLocks) { if(!d.startUpdate()) throw BXDB_OPENED.get(null, d.meta.name); i++; } for(final DBBackup b : backups) b.apply(); for(final DatabaseUpdates c : updates) c.apply(); for(final DBCreate c : creates) { c.apply(); final Data d = c.qc.resource.database(c.dbName, c.info); if(dataWriteLocks.add(d)) { d.startUpdate(); i++; } } for(final DBRestore r : restores) r.apply(); } finally { for(final Data d : dataWriteLocks) { if(i-- == 0) break; d.finishUpdate(); } } }
Source:
public void MobileLogin_002_failedLoginWrongPassword() { MobileBasePageObject mobile = new MobileBasePageObject(driver); mobile.openHome(wikiURL); mobile.openRandomPage(); System.out.println(credentials.userName12); MobileSpecialUserLogin login = mobile.loginFailedDropDown(credentials.userName12, mobile.getTimeStamp()); login.verifyWrongPasswordErrorMessage(); }

Target:
public void MobileLogin_002_failedLoginWrongPassword() { MobileBasePageObject mobile = new MobileBasePageObject(driver); mobile.openHome(wikiURL); mobile.openRandomPage(); MobileSpecialUserLogin login = mobile.loginFailedDropDown(credentials.userName12, mobile.getTimeStamp()); login.verifyWrongPasswordErrorMessage(); }
Source:
public void visitJumpInsn(int opcode, Label label) { if(opcode == GOTO || opcode == JSR) { currentBlock.terminator = new Instruction(opcode); currentBlock.successors = Collections.singletonList(blockByLabel.computeIfAbsent(label, l -> currentBlock.createSuccessor())); return; } currentBlock.trueBlock = blockByLabel.computeIfAbsent(label, l -> currentBlock.createTrueSuccessor()); currentBlock.terminator = new Instruction(opcode); currentBlock = currentBlock.createFalseSuccessor(); }

Target:
public void visitJumpInsn(int opcode, Label label) { if (opcode == GOTO || opcode == JSR) { currentBlock.terminator = new Instruction(opcode); currentBlock.successors = Collections.singletonList(blockByLabel.computeIfAbsent(label, l -> currentBlock.createSuccessor())); return; } currentBlock.setTrueBlock(blockByLabel.computeIfAbsent(label, l -> currentBlock.createSuccessor())); currentBlock.terminator = new Instruction(opcode); currentBlock.falseBlock = currentBlock.createSuccessor(); currentBlock = currentBlock.falseBlock; }
Source:
public void shouldUpdateBahmniProgramEnrollment() throws Exception { ProgramEnrollment programEnrollment = prepareProgramEnrollmentWithAttributes(); URI url = config.toInstancePathWithParams("/bahmniprogramenrollment/{uuid}", programEnrollment.getUuid()); when(restOperations.exchange(eq(url), eq(HttpMethod.POST), any(HttpEntity.class), eq(String.class))) .thenReturn(getResponseFromFile(PROGRAM_ENROLLMENT_RESPONSE)); ProgramEnrollment updated = programEnrollmentResource.updateBahmniProgramEnrollment(config, programEnrollment); verify(restOperations).exchange(eq(url), eq(HttpMethod.POST), requestCaptor.capture(), eq(String.class)); assertThat(updated, equalTo(programEnrollment)); assertThat(requestCaptor.getValue().getHeaders(), equalTo(getHeadersForPost(config))); assertThat(JsonUtils.readJson(requestCaptor.getValue().getBody(), JsonObject.class), equalTo(readFromFile(PROGRAM_ENROLLMENT_CREATE, JsonObject.class))); }

Target:
public void shouldUpdateBahmniProgramEnrollment() throws Exception { ProgramEnrollment programEnrollment = prepareBahmniProgramEnrollment(); URI url = config.toInstancePathWithParams("/bahmniprogramenrollment/{uuid}", programEnrollment.getUuid()); when(restOperations.exchange(eq(url), eq(HttpMethod.POST), any(HttpEntity.class), eq(String.class))) .thenReturn(getResponseFromFile(BAHMNI_PROGRAM_ENROLLMENT_RESPONSE)); ProgramEnrollment updated = programEnrollmentResource.updateBahmniProgramEnrollment(config, programEnrollment); verify(restOperations).exchange(eq(url), eq(HttpMethod.POST), requestCaptor.capture(), eq(String.class)); assertThat(updated, equalTo(programEnrollment)); assertThat(requestCaptor.getValue().getHeaders(), equalTo(getHeadersForPost(config))); assertThat(JsonUtils.readJson(requestCaptor.getValue().getBody(), JsonObject.class), equalTo(readFromFile(PROGRAM_ENROLLMENT_CREATE, JsonObject.class))); }
Source:
public List<? extends Module> getJacksonModules() { return ImmutableList.of( new SimpleModule("RocketMQFirehoseModule") .registerSubtypes( new NamedType(RocketMQFirehoseFactory.class, "RocketMQ-3.2.6") ) ); }

Target:
public List<? extends Module> getJacksonModules() { return ImmutableList.of( new SimpleModule("RocketMQFirehoseModule") .registerSubtypes( new NamedType(RocketMQFirehoseFactory.class, "rocketMQ") ) ); }
Source:
public KubernetesEnvironment convert(DockerImageEnvironment environment) throws InfrastructureException { final Iterator<String> iterator = environment.getMachines().keySet().iterator(); if (!iterator.hasNext()) { throw new InternalInfrastructureException( "DockerImage environment must contain at least one machine configuration"); } final String machineName = iterator.next(); final String dockerImage = environment.getRecipe().getContent(); final Map<String, String> annotations = new HashMap<>(); annotations.put(format(MACHINE_NAME_ANNOTATION_FMT, CONTAINER_NAME), machineName); final Pod pod = new PodBuilder() .withNewMetadata() .withName(POD_NAME) .withAnnotations(annotations) .endMetadata() .withNewSpec() .withContainers( new ContainerBuilder().withImage(dockerImage).withName(CONTAINER_NAME).build()) .endSpec() .build(); return KubernetesEnvironment.builder() .setMachines(environment.getMachines()) .setInternalRecipe(new InternalRecipe(KubernetesEnvironment.TYPE, null, "")) .setWarnings(environment.getWarnings()) .setPods(ImmutableMap.of(POD_NAME, pod)) .setWorkspaceConfigAttributes(environment.getAttributes()) .build(); }

Target:
public KubernetesEnvironment convert(DockerImageEnvironment environment) throws InfrastructureException { final Iterator<String> iterator = environment.getMachines().keySet().iterator(); if (!iterator.hasNext()) { throw new InternalInfrastructureException( "DockerImage environment must contain at least one machine configuration"); } final String machineName = iterator.next(); final String dockerImage = environment.getRecipe().getContent(); final Map<String, String> annotations = new HashMap<>(); annotations.put(format(MACHINE_NAME_ANNOTATION_FMT, CONTAINER_NAME), machineName); final Pod pod = new PodBuilder() .withNewMetadata() .withName(POD_NAME) .withAnnotations(annotations) .endMetadata() .withNewSpec() .withContainers( new ContainerBuilder().withImage(dockerImage).withName(CONTAINER_NAME).build()) .endSpec() .build(); return KubernetesEnvironment.builder() .setMachines(environment.getMachines()) .setInternalRecipe(environment.getRecipe()) .setWarnings(environment.getWarnings()) .setPods(ImmutableMap.of(POD_NAME, pod)) .setAttributes(environment.getAttributes()) .setType(KubernetesEnvironment.TYPE) .build(); }
Source:
public OsuWriter(OutputStream dest) { if(dest instanceof BufferedOutputStream){ this.writer = new DataOutputStream(dest); } else { this.writer = new DataOutputStream(new BufferedOutputStream(dest)); } }

Target:
public OsuWriter(OutputStream dest) { this.writer = new DataOutputStream(new BufferedOutputStream(dest)); }
Source:
public void encodesAndDecodes() throws IOException { final String urn = "urn:test:Hello World!"; final Map<String, String> properties = ImmutableMap.of("userName", "user"); final Identity identity = new Identity.Simple(urn, properties); final Codec codec = new CcBase64(new CcPlain()); final Identity expected = new CcBase64(new CcPlain()).decode( codec.encode(identity) ); MatcherAssert.assertThat( expected.urn(), Matchers.equalTo(urn) ); MatcherAssert.assertThat( expected.properties(), Matchers.equalTo(properties) ); }

Target:
public void encodesAndDecodes() throws IOException { final String urn = "urn:test:Hello World!"; final Map<String, String> properties = ImmutableMap.of("userName", "user"); final Codec codec = new CcBase64(new CcPlain()); final Identity expected = codec.decode( codec.encode(new Identity.Simple(urn, properties)) ); MatcherAssert.assertThat( expected.urn(), Matchers.equalTo(urn) ); MatcherAssert.assertThat( expected.properties(), Matchers.equalTo(properties) ); }
Source:
public HistoryTableModel() { super( new Column[] { Column.HREF_ID, Column.REQUEST_TIMESTAMP, Column.RESPONSE_TIMESTAMP, Column.METHOD, Column.URL, Column.STATUS_CODE, Column.STATUS_REASON, Column.RTT, Column.SIZE_REQUEST_HEADER, Column.SIZE_REQUEST_BODY, Column.SIZE_RESPONSE_HEADER, Column.SIZE_RESPONSE_BODY, Column.HIGHEST_ALERT, Column.NOTE, Column.TAGS, Column.HOSTNAME, Column.PATH_AND_QUERY, Column.PATH, Column.QUERY }); }

Target:
public HistoryTableModel() { super( new Column[] { Column.HREF_ID, Column.REQUEST_TIMESTAMP, Column.RESPONSE_TIMESTAMP, Column.METHOD, Column.URL, Column.HOSTNAME, Column.PATH_AND_QUERY, Column.STATUS_CODE, Column.STATUS_REASON, Column.RTT, Column.SIZE_REQUEST_HEADER, Column.SIZE_REQUEST_BODY, Column.SIZE_RESPONSE_HEADER, Column.SIZE_RESPONSE_BODY, Column.HIGHEST_ALERT, Column.NOTE, Column.TAGS }); }
Source:
private HashMap<String, Object> createWSSecurityConfiguration() { LOG.debug("New Version in Minh 1111"); final HashMap<String, Object> outProps = new HashMap<>(); outProps.put(WSHandlerConstants.ACTION, "Timestamp SAMLTokenSigned"); outProps.put(WSHandlerConstants.TTL_TIMESTAMP, "3600"); outProps.put(WSHandlerConstants.USER, getIssuerKeyAlias()); outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, "gov.hhs.fha.nhinc.callback.cxf.CXFPasswordCallbackHandler"); outProps.put(WSHandlerConstants.PASSWORD_TYPE, "PasswordDigest"); outProps.put(WSHandlerConstants.SAML_CALLBACK_CLASS, "gov.hhs.fha.nhinc.callback.cxf.CXFSAMLCallbackHandler"); outProps.put("cryptoProperties", getSignatureProperties()); outProps.put(WSHandlerConstants.SIG_PROP_REF_ID, "cryptoProperties"); outProps.put(WSHandlerConstants.SIG_ALGO, SPConstants.RSA_SHA1); outProps.put(WSHandlerConstants.SIG_DIGEST_ALGO, SPConstants.SHA1); outProps.put(WSHandlerConstants.SIGNATURE_PARTS, "{Element}{<LINK_0>}Timestamp;"); return outProps; }

Target:
private HashMap<String, Object> createWSSecurityConfiguration() { final HashMap<String, Object> outProps = new HashMap<>(); outProps.put(WSHandlerConstants.ACTION, "Timestamp SAMLTokenSigned"); outProps.put(WSHandlerConstants.TTL_TIMESTAMP, "3600"); outProps.put(WSHandlerConstants.USER, getIssuerKeyAlias()); outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, "gov.hhs.fha.nhinc.callback.cxf.CXFPasswordCallbackHandler"); outProps.put(WSHandlerConstants.PASSWORD_TYPE, "PasswordDigest"); outProps.put(WSHandlerConstants.SAML_CALLBACK_CLASS, "gov.hhs.fha.nhinc.callback.cxf.CXFSAMLCallbackHandler"); outProps.put("cryptoProperties", getSignatureProperties()); outProps.put(WSHandlerConstants.SIG_PROP_REF_ID, "cryptoProperties"); outProps.put(WSHandlerConstants.SIG_ALGO, SPConstants.RSA_SHA1); outProps.put(WSHandlerConstants.SIG_DIGEST_ALGO, SPConstants.SHA1); outProps.put(WSHandlerConstants.SIGNATURE_PARTS, "{Element}{<LINK_0>}Timestamp;"); return outProps; }
Source:
public COREEnvelopeRealTimeResponse realTimeRequest(COREEnvelopeRealTimeRequest msg, AssertionType assertion) { LOG.trace("Using Java Implementation for Adapter CORE X12 Doc Submission Service"); throw new UnsupportedOperationException("Not supported yet."); }

Target:
public COREEnvelopeRealTimeResponse realTimeRequest(COREEnvelopeRealTimeRequest msg, AssertionType assertion) { LOG.trace("Using Java Implementation for Adapter CORE X12 Doc Submission Service"); return new AdapterCORE_X12DSRealTimeOrchImpl().realTimeRequest(msg, assertion); }
Source:
void noModifiersInForEachBesideFinal() { ParseResult<Statement> result = javaParser.parse(STATEMENT, provider("for(static transient int i : nums){}")); assertProblems(result, "(line 1,col 5) 'static' is not allowed here.", "(line 1,col 5) 'transient' is not allowed here.", "(line 1,col 1) A foreach statement's variable declaration may have at most one 'final' modifier, and no other modifiers. Given: [static , transient ]."); }

Target:
void noModifiersInForEachBesideFinal() { ParseResult<Statement> result = javaParser.parse(STATEMENT, provider("for(static transient int i : nums){}")); assertProblems(result, "(line 1,col 5) 'static' is not allowed here.", "(line 1,col 5) 'transient' is not allowed here."); }
Source:
public <V> DataSet<V> readORCFile(int[] baseColumnMap,int[] partitionColumnMap, String location, OperationContext context, Qualifier[][] qualifiers, DataValueDescriptor probeValue, ExecRow execRow) throws StandardException { assert baseColumnMap != null:"baseColumnMap Null"; assert partitionColumnMap != null:"partitionColumnMap Null"; try { try { } catch (Exception e) { return handleExceptionInCaseOfEmptySet(e,location); } SpliceORCPredicate predicate = new SpliceORCPredicate(qualifiers,baseColumnMap,execRow.createStructType()); Configuration configuration = new Configuration(HConfiguration.unwrapDelegate()); configuration.set(SpliceOrcNewInputFormat.SPLICE_PREDICATE,predicate.serialize()); configuration.set(SpliceOrcNewInputFormat.SPARK_STRUCT,execRow.createStructType().json()); configuration.set(SpliceOrcNewInputFormat.SPLICE_COLUMNS,intArrayToString(baseColumnMap)); configuration.set(SpliceOrcNewInputFormat.SPLICE_PARTITIONS,intArrayToString(partitionColumnMap)); JavaRDD<Row> rows = SpliceSpark.getContext().newAPIHadoopFile( location, SpliceOrcNewInputFormat.class, NullWritable.class, Row.class, configuration) .values(); return new SparkDataSet(rows.map(new RowToLocatedRowFunction(context,execRow))); } catch (Exception e) { throw StandardException.newException( SQLState.EXTERNAL_TABLES_READ_FAILURE,e.getMessage()); } }

Target:
public <V> DataSet<V> readORCFile(int[] baseColumnMap,int[] partitionColumnMap, String location, OperationContext context, Qualifier[][] qualifiers, DataValueDescriptor probeValue, ExecRow execRow) throws StandardException { assert baseColumnMap != null:"baseColumnMap Null"; assert partitionColumnMap != null:"partitionColumnMap Null"; try { SpliceORCPredicate predicate = new SpliceORCPredicate(qualifiers,baseColumnMap,execRow.createStructType()); Configuration configuration = new Configuration(HConfiguration.unwrapDelegate()); configuration.set(SpliceOrcNewInputFormat.SPLICE_PREDICATE,predicate.serialize()); configuration.set(SpliceOrcNewInputFormat.SPARK_STRUCT,execRow.createStructType().json()); configuration.set(SpliceOrcNewInputFormat.SPLICE_COLUMNS,intArrayToString(baseColumnMap)); configuration.set(SpliceOrcNewInputFormat.SPLICE_PARTITIONS,intArrayToString(partitionColumnMap)); JavaRDD<Row> rows = SpliceSpark.getContext().newAPIHadoopFile( location, SpliceOrcNewInputFormat.class, NullWritable.class, Row.class, configuration) .values(); return new SparkDataSet(rows.map(new RowToLocatedRowFunction(context,execRow))); } catch (Exception e) { throw StandardException.newException( SQLState.EXTERNAL_TABLES_READ_FAILURE,e.getMessage()); } }
Source:
public VisualizationObject(@JsonProperty("content") final Content content, @JsonProperty("meta") final Meta meta) { super(meta); this.content = content; }

Target:
private VisualizationObject(@JsonProperty("content") final Content content, @JsonProperty("meta") final Meta meta) { super(meta); this.content = notNull(content); }
Source:
public boolean isBinaryEquivalent(@Nullable IDeclaration other) { return fReferenceStructs.get(0).isBinaryEquivalent(other); }

Target:
public boolean isBinaryEquivalent(@Nullable IDeclaration other) { for (StructDeclaration referenceStruct : fReferenceStructs) { if (referenceStruct.isBinaryEquivalent(other)) { return true; } } return false; }
Source:
public OperationResult<ScanResult<Map.Entry<String, String>>> d_hscan(final String key, final int cursor){ return connPool.executeWithFailover(new BaseKeyOperation<ScanResult<Map.Entry<String, String>>>(key, OpName.HSCAN) { @Override public ScanResult<Map.Entry<String, String>> execute(Jedis client, ConnectionContext state) { return client.hscan(key,cursor); } }); }

Target:
public OperationResult<ScanResult<Map.Entry<String, String>>> d_hscan(final String key, final int cursor){ if (CompressionStrategy.NONE == connPool.getConfiguration().getCompressionStrategy()) { return connPool.executeWithFailover(new BaseKeyOperation<ScanResult<Map.Entry<String, String>>>(key, OpName.HSCAN) { @Override public ScanResult<Map.Entry<String, String>> execute(Jedis client, ConnectionContext state) { return client.hscan(key,cursor); } }); } else { return connPool.executeWithFailover(new CompressionValueOperation<ScanResult<Map.Entry<String, String>>>(key, OpName.HSCAN) { @Override public ScanResult<Map.Entry<String, String>> execute(final Jedis client, final ConnectionContext state) { return new ScanResult<Map.Entry<String,String>>(cursor, new ArrayList(CollectionUtils.transform( client.hscan(key,cursor).getResult(), new CollectionUtils.Transform<Map.Entry<String,String>, Map.Entry<String,String>>() { @Override public Map.Entry<String,String> get(Map.Entry<String,String> entry) { entry.setValue(decompressValue(entry.getValue(),state)); return entry; } }))); } }); } }
Source:
private void sendSaslMessage(ChannelHandlerContext ctx, byte[] payload, List<CipherOption> options) throws IOException { DataTransferEncryptorMessageProto.Builder builder = DataTransferEncryptorMessageProto.newBuilder(); builder.setStatus(DataTransferEncryptorStatus.SUCCESS); if (payload != null) { BuilderPayloadSetter.setter(builder, payload); } if (options != null) { builder.addAllCipherOption(PBHelperClient.convertCipherOptions(options)); } DataTransferEncryptorMessageProto proto = builder.build(); int size = proto.getSerializedSize(); size += CodedOutputStream.computeRawVarint32Size(size); ByteBuf buf = ctx.alloc().buffer(size); proto.writeDelimitedTo(new ByteBufOutputStream(buf)); ctx.write(buf); }

Target:
private void sendSaslMessage(ChannelHandlerContext ctx, byte[] payload, List<CipherOption> options) throws IOException { DataTransferEncryptorMessageProto.Builder builder = DataTransferEncryptorMessageProto.newBuilder(); builder.setStatus(DataTransferEncryptorStatus.SUCCESS); if (payload != null) { BuilderPayloadSetter.wrapAndSetPayload(builder, payload); } if (options != null) { builder.addAllCipherOption(PBHelperClient.convertCipherOptions(options)); } DataTransferEncryptorMessageProto proto = builder.build(); int size = proto.getSerializedSize(); size += CodedOutputStream.computeRawVarint32Size(size); ByteBuf buf = ctx.alloc().buffer(size); proto.writeDelimitedTo(new ByteBufOutputStream(buf)); ctx.write(buf); }
Source:
public void setVariableTypeIfNull(){ if(this.getVariableType() != null) { return; } if(this.getRole() == null){ return; } String propertyName = this.getStandardVariable().getProperty().getName(); this.setVariableType(OntologyDataHelper.mapFromPhenotype(this.getRole(), propertyName)); }

Target:
public void setVariableTypeIfNull(){ if(this.getVariableType() != null) { return; } if(this.getRole() == null){ return; } final String propertyName = this.getStandardVariable().getProperty().getName(); this.setVariableType(OntologyDataHelper.mapFromPhenotype(this.getRole(), propertyName)); }
Source:
protected void onPostExecute(JSONObject jsonObject) { if (jsonObject != null) { mLayer = new GeoJsonLayer(getMap(), jsonObject); addColorsToMarkers(); mLayer.addLayerToMap(); mLayer.setOnFeatureClickListener(new GeoJsonLayer.GeoJsonOnFeatureClickListener() { @Override public void onFeatureClick(GeoJsonFeature feature) { Log.i(mLogTag, "Feature clicked: " + feature.getProperty("title")); } }); } }

Target:
protected void onPostExecute(JSONObject jsonObject) { if (jsonObject != null) { mLayer = new GeoJsonLayer(getMap(), jsonObject); addColorsToMarkers(); mLayer.addLayerToMap(); mLayer.setOnFeatureClickListener(new GeoJsonLayer.GeoJsonOnFeatureClickListener() { @Override public void onFeatureClick(GeoJsonFeature feature) { showToast("Feature clicked: " + feature.getProperty("title")); } }); } }
Source:
public static BlobOutput deserializeBlobRecord(CrcInputStream crcStream) throws IOException, MessageFormatException { DataInputStream dataStream = new DataInputStream(crcStream); int blobTypeOrdinal = dataStream.readInt(); if(blobTypeOrdinal > BlobType.values().length){ logger.error("corrupt data while parsing blob content BlobContentType {}", blobTypeOrdinal); throw new MessageFormatException("corrupt data while parsing blob content", MessageFormatErrorCodes.Data_Corrupt); } BlobType blobContentType = BlobType.values()[blobTypeOrdinal]; long dataSize = dataStream.readLong(); if (dataSize > Integer.MAX_VALUE) { throw new IOException("We only support data of max size == MAX_INT. Error while reading blob from store"); } ByteBufferInputStream output = new ByteBufferInputStream(crcStream, (int) dataSize); long crc = crcStream.getValue(); long streamCrc = dataStream.readLong(); if (crc != streamCrc) { logger.error("corrupt data while parsing blob content expectedcrc actualcrc {}", crc, streamCrc); throw new MessageFormatException("corrupt data while parsing blob content", MessageFormatErrorCodes.Data_Corrupt); } return new BlobOutput(dataSize, blobContentType, output); }

Target:
public static BlobData deserializeBlobRecord(CrcInputStream crcStream) throws IOException, MessageFormatException { DataInputStream dataStream = new DataInputStream(crcStream); short blobTypeOrdinal = dataStream.readShort(); if (blobTypeOrdinal > BlobType.values().length) { logger.error("corrupt data while parsing blob content BlobContentType {}", blobTypeOrdinal); throw new MessageFormatException("corrupt data while parsing blob content", MessageFormatErrorCodes.Data_Corrupt); } BlobType blobContentType = BlobType.values()[blobTypeOrdinal]; long dataSize = dataStream.readLong(); if (dataSize > Integer.MAX_VALUE) { throw new IOException("We only support data of max size == MAX_INT. Error while reading blob from store"); } ByteBufferInputStream output = new ByteBufferInputStream(crcStream, (int) dataSize); long crc = crcStream.getValue(); long streamCrc = dataStream.readLong(); if (crc != streamCrc) { logger.error("corrupt data while parsing blob content expectedcrc actualcrc {}", crc, streamCrc); throw new MessageFormatException("corrupt data while parsing blob content", MessageFormatErrorCodes.Data_Corrupt); } return new BlobData(blobContentType, dataSize, output); }
Source:
public void testCallPublicMethodWithShortParams(String containerType, String endpoint) { short value = 10; performActionForShort(containerType, endpoint, PUBLIC_WITH_SHORT_PARAM_ACTION, value, new Param(PARAM_NAME, value)); }

Target:
public void testCallPublicMethodWithShortParams(String containerType, String endpoint) { final short value = 10; performActionForShort(containerType, endpoint, PUBLIC_WITH_SHORT_PARAM_ACTION, value, new Param(PARAM_NAME, value)); }
Source:
public void run() { getScreenBitmap(); mBackgroundHandler.post(mEventDispatchRunnable.withEndAction(this)); }

Target:
public void run() { updateScreenBitmap(); mBackgroundHandler.post(mEventDispatchRunnable.withEndAction(this)); }
Source:
private void setupBlobstore() throws AuthorizationException, KeyNotFoundException { IStormClusterState state = stormClusterState; BlobStore store = blobStore; Set<String> localKeys = new HashSet<>(); for (Iterator<String> it = store.listKeys(); it.hasNext();) { localKeys.add(it.next()); } Set<String> activeKeys = new HashSet<>(state.activeKeys()); Set<String> activeLocalKeys = new HashSet<>(localKeys); activeLocalKeys.retainAll(activeKeys); Set<String> keysToDelete = new HashSet<>(localKeys); keysToDelete.removeAll(activeKeys); NimbusInfo nimbusInfo = nimbusHostPortInfo; LOG.debug("Deleting keys not on the zookeeper {}", keysToDelete); for (String toDelete: keysToDelete) { store.deleteBlob(toDelete, NIMBUS_SUBJECT); } LOG.debug("Creating list of key entries for blobstore inside zookeeper local {}", activeKeys, activeLocalKeys); CuratorFramework zkClient = BlobStoreUtils.createZKClient(conf); for (String key: activeLocalKeys) { try { state.setupBlobstore(key, nimbusInfo, getVersionForKey(key, nimbusInfo, zkClient)); } catch (KeyNotFoundException e) { store.deleteBlob(key, NIMBUS_SUBJECT); } } }

Target:
private void setupBlobstore() throws AuthorizationException, KeyNotFoundException { IStormClusterState state = stormClusterState; BlobStore store = blobStore; Set<String> localKeys = new HashSet<>(); for (Iterator<String> it = store.listKeys(); it.hasNext();) { localKeys.add(it.next()); } Set<String> activeKeys = new HashSet<>(state.activeKeys()); Set<String> activeLocalKeys = new HashSet<>(localKeys); activeLocalKeys.retainAll(activeKeys); Set<String> keysToDelete = new HashSet<>(localKeys); keysToDelete.removeAll(activeKeys); NimbusInfo nimbusInfo = nimbusHostPortInfo; LOG.debug("Deleting keys not on the zookeeper {}", keysToDelete); for (String toDelete: keysToDelete) { store.deleteBlob(toDelete, NIMBUS_SUBJECT); } LOG.debug("Creating list of key entries for blobstore inside zookeeper local {}", activeKeys, activeLocalKeys); for (String key: activeLocalKeys) { try { state.setupBlobstore(key, nimbusInfo, getVersionForKey(key, nimbusInfo, conf, zkClient)); } catch (KeyNotFoundException e) { store.deleteBlob(key, NIMBUS_SUBJECT); } } }
Source:
private void closeQuietly(AutoCloseable resource) { try { if (resource != null) { resource.close(); } } catch (Exception e) { logger.warn("Closing resource", e); } }

Target:
private static void closeQuietly(AutoCloseable resource) { try { if (resource != null) { resource.close(); } } catch (Exception e) { logger.warn("Closing resource", e); } }
Source:
public void testGetActionName(){ assertEquals("instructorCourse", ActivityLogEntry.getActionName("/page/instructorCourse")); assertEquals("instructorCourse", ActivityLogEntry.getActionName("/page/instructorCourse?user=x")); try { ActivityLogEntry.getActionName("instructorCourse"); signalFailureToDetectException("getActionName should throw an exception if an action cannot be retrieved"); } catch (Exception e) { assertEquals("java.lang.ArrayIndexOutOfBoundsException: 2", e.toString()); } }

Target:
public void testGetActionName(){ assertEquals("instructorCourse", ActivityLogEntry.getActionName("/page/instructorCourse")); assertEquals("instructorCourse", ActivityLogEntry.getActionName("/page/instructorCourse?user=x")); try { ActivityLogEntry.getActionName("instructorCourse"); signalFailureToDetectException("getActionName should throw an exception if an action cannot be retrieved"); } catch (ArrayIndexOutOfBoundsException e) { assertEquals("java.lang.ArrayIndexOutOfBoundsException: 2", e.toString()); } }