auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void initialize(Server server, Injector injector) { final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS); ServletHolder holderPwd = new ServletHolder("default", DefaultServlet.class); root.addServlet(holderPwd, "/"); root.setBaseResource( new ResourceCollection( new String[]{ TaskMaster.class.getClassLoader().getResource("static").toExternalForm(), TaskMaster.class.getClassLoader().getResource("indexer_static").toExternalForm() } ) ); JettyServerInitUtils.addExtensionFilters(root, injector); root.addFilter(JettyServerInitUtils.defaultGzipFilterHolder(), "/*", null); root.addFilter(GuiceFilter.class, "/status/*", null); root.addFilter(new FilterHolder(injector.getInstance(RedirectFilter.class)), "/*", null); root.addFilter(GuiceFilter.class, "/druid/*", null); HandlerList handlerList = new HandlerList(); if(serverConfig.getEnableHttpRequestLogging()) { handlerList.setHandlers(new Handler[]{JettyServerInitUtils.getJettyRequestLogHandler(), root}); } else { handlerList.setHandlers(new Handler[]{root}); } server.setHandler(handlerList); }

Target:
public void initialize(Server server, Injector injector) { final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS); ServletHolder holderPwd = new ServletHolder("default", DefaultServlet.class); root.addServlet(holderPwd, "/"); root.setBaseResource( new ResourceCollection( new String[]{ TaskMaster.class.getClassLoader().getResource("static").toExternalForm(), TaskMaster.class.getClassLoader().getResource("indexer_static").toExternalForm() } ) ); JettyServerInitUtils.addExtensionFilters(root, injector); root.addFilter(JettyServerInitUtils.defaultGzipFilterHolder(), "/*", null); root.addFilter(GuiceFilter.class, "/status/*", null); root.addFilter(new FilterHolder(injector.getInstance(RedirectFilter.class)), "/*", null); root.addFilter(GuiceFilter.class, "/druid/*", null); HandlerList handlerList = new HandlerList(); handlerList.setHandlers(new Handler[]{JettyServerInitUtils.getJettyRequestLogHandler(), root}); server.setHandler(handlerList); }
Source:
public ByteBuf getEntry(long ledgerId, long entryId) throws IOException { long startTime = MathUtils.nowInNano(); if (log.isDebugEnabled()) { log.debug("Get Entry: {}@{}", ledgerId, entryId); } if (entryId == BookieProtocol.LAST_ADD_CONFIRMED) { return getLastEntry(ledgerId); } writeCacheMutex.readLock().lock(); try { ByteBuf entry = writeCache.get(ledgerId, entryId); if (entry != null) { recordSuccessfulEvent(readCacheHitStats, startTime); recordSuccessfulEvent(readEntryStats, startTime); return entry; } entry = writeCacheBeingFlushed.get(ledgerId, entryId); if (entry != null) { recordSuccessfulEvent(readCacheHitStats, startTime); recordSuccessfulEvent(readEntryStats, startTime); return entry; } } finally { writeCacheMutex.readLock().unlock(); } ByteBuf entry = readCache.get(ledgerId, entryId); if (entry != null) { recordSuccessfulEvent(readCacheHitStats, startTime); recordSuccessfulEvent(readEntryStats, startTime); return entry; } try { long entryLocation = entryLocationIndex.getLocation(ledgerId, entryId); if (entryLocation == 0) { throw new NoEntryException(ledgerId, entryId); } entry = entryLogger.readEntry(ledgerId, entryId, entryLocation); readCache.put(ledgerId, entryId, entry); long nextEntryLocation = entryLocation + 4 + entry.readableBytes(); fillReadAheadCache(ledgerId, entryId + 1, nextEntryLocation); recordSuccessfulEvent(readCacheMissStats, startTime); recordSuccessfulEvent(readEntryStats, startTime); return entry; } catch (NoEntryException e) { recordFailedEvent(readEntryStats, startTime); throw e; } }

Target:
public ByteBuf getEntry(long ledgerId, long entryId) throws IOException { long startTime = MathUtils.nowInNano(); if (log.isDebugEnabled()) { log.debug("Get Entry: {}@{}", ledgerId, entryId); } if (entryId == BookieProtocol.LAST_ADD_CONFIRMED) { return getLastEntry(ledgerId); } writeCacheMutex.readLock().lock(); try { ByteBuf entry = writeCache.get(ledgerId, entryId); if (entry != null) { recordSuccessfulEvent(readCacheHitStats, startTime); recordSuccessfulEvent(readEntryStats, startTime); return entry; } entry = writeCacheBeingFlushed.get(ledgerId, entryId); if (entry != null) { recordSuccessfulEvent(readCacheHitStats, startTime); recordSuccessfulEvent(readEntryStats, startTime); return entry; } } finally { writeCacheMutex.readLock().unlock(); } ByteBuf entry = readCache.get(ledgerId, entryId); if (entry != null) { recordSuccessfulEvent(readCacheHitStats, startTime); recordSuccessfulEvent(readEntryStats, startTime); return entry; } long entryLocation; try { entryLocation = entryLocationIndex.getLocation(ledgerId, entryId); if (entryLocation == 0) { throw new NoEntryException(ledgerId, entryId); } entry = entryLogger.readEntry(ledgerId, entryId, entryLocation); } catch (NoEntryException e) { recordFailedEvent(readEntryStats, startTime); throw e; } readCache.put(ledgerId, entryId, entry); long nextEntryLocation = entryLocation + 4 + entry.readableBytes(); fillReadAheadCache(ledgerId, entryId + 1, nextEntryLocation); recordSuccessfulEvent(readCacheMissStats, startTime); recordSuccessfulEvent(readEntryStats, startTime); return entry; }
Source:
public final void initialize(final URL location, final ResourceBundle resources) { NotificationFactory notFact = new NotificationFactory(); forceRepaintPosition = false; listen(Message.OPENED, (controller, args) -> { assert controller instanceof MenuController; assert args[0] instanceof File && args[1] instanceof File; try { loadGraph((File) args[0], (File) args[1]); } catch (IOException exception) { shout(NotificationController.NOTIFY, notFact .getNotification(exception)); } }); listen(Message.FILTERED, (controller, args) -> { assert args.length == 1; if (!(args[0] instanceof Set<?>)) { throw new IllegalArgumentException( "Argument not of type Set<Sequence>"); } model.setVisible((Set<Sequence>) args[0]); forceRepaintPosition = true; repaint(); }); }

Target:
public final void initialize(final URL location, final ResourceBundle resources) { NotificationFactory notFact = new NotificationFactory(); forceRepaintPosition = false; listen(Message.OPENED, (controller, args) -> { assert controller instanceof MenuController; assert args[0] instanceof File && args[1] instanceof File; try { loadGraph((File) args[0], (File) args[1]); } catch (IOException exception) { shout(NotificationController.NOTIFY, notFact .getNotification(exception)); } }); listen(Message.FILTERED, (controller, args) -> { assert args.length == 1; assert args[0] instanceof Set<?>; model.setVisible((Set<Sequence>) args[0]); forceRepaintPosition = true; repaint(); }); }
Source:
void complete(BitmapHunter hunter) { List<Request> joined = hunter.getRequests(); Uri uri = hunter.getUri(); Exception exception = hunter.getException(); Bitmap result = hunter.getResult(); LoadedFrom from = hunter.getLoadedFrom(); if (!joined.isEmpty()) { for (Request join : joined) { if (!join.isCancelled()) { targetToRequest.remove(join.getTarget()); if (result != null) { join.complete(result, from); } else { join.error(); if (listener != null && exception != null) { listener.onImageLoadFailed(this, uri, exception); } } } } } }

Target:
void complete(BitmapHunter hunter) { List<Request> joined = hunter.getRequests(); if (joined.isEmpty()) { return; } Uri uri = hunter.getUri(); Exception exception = hunter.getException(); Bitmap result = hunter.getResult(); LoadedFrom from = hunter.getLoadedFrom(); for (Request join : joined) { if (join.isCancelled()) { continue; } targetToRequest.remove(join.getTarget()); if (result != null) { join.complete(result, from); } else { join.error(); } } if (listener != null && exception != null) { listener.onImageLoadFailed(this, uri, exception); } }
Source:
private void deleteVariable(final DmsProject project, final int termId) { if (project.getProperties() != null) { final List<ProjectProperty> deletedProjectProperties = new ArrayList<>(); for (final ProjectProperty property : project.getProperties()) { if (property.getVariableId().equals(termId)) { this.saver.getProjectPropertyDao().makeTransient(property); deletedProjectProperties.add(property); } } project.getProperties().removeAll(deletedProjectProperties); } }

Target:
public void deleteVariable(final DmsProject project, final int termId) { if (project.getProperties() != null) { final List<ProjectProperty> deletedProjectProperties = new ArrayList<>(); for (final ProjectProperty property : project.getProperties()) { if (property.getVariableId().equals(termId)) { this.saver.getProjectPropertyDao().makeTransient(property); deletedProjectProperties.add(property); } } project.getProperties().removeAll(deletedProjectProperties); } }
Source:
public void testRecoverJobGraph() throws Exception { final RetrievableStateHandle<JobGraph> stateHandle = jobGraphStorageHelper.store(testingJobGraph); final TestingStateHandleStore<JobGraph> stateHandleStore = builder .setGetFunction(ignore -> stateHandle) .build(); final JobGraphStore jobGraphStore = createAndStartJobGraphStore(stateHandleStore); final JobGraph recoveredJobGraph = jobGraphStore.recoverJobGraph(testingJobGraph.getJobID()); assertThat(recoveredJobGraph, is(notNullValue())); assertThat(recoveredJobGraph.getJobID(), is(testingJobGraph.getJobID())); jobGraphStore.stop(); }

Target:
public void testRecoverJobGraph() throws Exception { final RetrievableStateHandle<JobGraph> stateHandle = jobGraphStorageHelper.store(testingJobGraph); final TestingStateHandleStore<JobGraph> stateHandleStore = builder .setGetFunction(ignore -> stateHandle) .build(); final JobGraphStore jobGraphStore = createAndStartJobGraphStore(stateHandleStore); final JobGraph recoveredJobGraph = jobGraphStore.recoverJobGraph(testingJobGraph.getJobID()); assertThat(recoveredJobGraph, is(notNullValue())); assertThat(recoveredJobGraph.getJobID(), is(testingJobGraph.getJobID())); }
Source:
public Exercise call() throws Exception { logger.info("Checking adaptive exercises availability"); Exercise exercise = tmcServerCommunicationTaskFactory.getAdaptiveExercise().call(); if (exercise == null) { return null; } exercise.setName("AdaLovelace"); exercise.setCourseName("None"); byte[] zipb = tmcServerCommunicationTaskFactory.getDownloadingExerciseZipTask(exercise).call(); System.out.println(zipb.length); Progress progress = new Progress(3); extractProject(zipb, exercise, progress); return exercise; }

Target:
public Exercise call() throws Exception { logger.info("Checking adaptive exercises availability"); Exercise exercise = tmcServerCommunicationTaskFactory.getAdaptiveExercise().call(); if (exercise == null) { return null; } exercise.setName("AdaLovelace"); exercise.setCourseName("None"); byte[] zipb = tmcServerCommunicationTaskFactory.getDownloadingExerciseZipTask(exercise).call(); Progress progress = new Progress(3); extractProject(zipb, exercise, progress); return exercise; }
Source:
void close( FileMeta metadata, LocalLockOwner owner ) throws IOException { TransactionManager transactionManager = metadataCache.getAdvancedCache().getTransactionManager(); try { lockManager.reentrantSynchronous( metadata.getFilePath(), ( opLock ) -> { if ( owner == null || owner.getContextLockCount() == 0 ) { metadata.removeLock( this.nodeKey ); transactionManager.begin(); metadataCache.put( metadata.getFilePath(), metadata ); transactionManager.commit(); } else { LockLevel nodeLevel = metadata.getLockLevel( this.nodeKey ); } return null; } ); } catch ( InterruptedException e ) { throw new IOException( "Thread interrupted while closing file: " + metadata.getFilePath(), e ); } }

Target:
void close( FileMeta metadata, LocalLockOwner owner ) throws IOException { }
Source:
public void updateParentCommits(IRepository parent, IReview review, ChangeDetailX detail) { Map<Integer, CommitInfo[]> parents = detail.getParents(); List<IReviewItemSet> sets = review.getSets(); for (Entry<Integer, CommitInfo[]> parentCommit : parents.entrySet()) { CommitInfo[] commits = parentCommit.getValue(); List<String> commitIds = new ArrayList<String>(); for (CommitInfo commit : commits) { commitIds.add(commit.getCommit()); } ((ReviewItemSet) sets.get(parentCommit.getKey() - 1)).setParentCommits(commitIds); } }

Target:
public void updateParentCommits(IRepository parent, IReview review, ChangeDetailX detail) { Map<Integer, CommitInfo[]> parents = detail.getParents(); if (parents == null) { return; } List<IReviewItemSet> sets = review.getSets(); for (Entry<Integer, CommitInfo[]> parentCommit : parents.entrySet()) { IReviewItemSet reviewItemSet = sets.get(parentCommit.getKey() - 1); for (CommitInfo gerritCommit : parentCommit.getValue()) { ICommit commit = IReviewsFactory.INSTANCE.createCommit(); commit.setId(gerritCommit.getCommit()); IUser commitAuthor = IReviewsFactory.INSTANCE.createUser(); GitPersonalInfo author = gerritCommit.getAuthor(); if (author != null) { commitAuthor.setId(author.getName()); commitAuthor.setDisplayName(author.getName()); commitAuthor.setEmail(author.getEmail()); commit.setAuthor(commitAuthor); } commit.setSubject(gerritCommit.getSubject()); commit.setMessage(gerritCommit.getMessage()); commit.setId(gerritCommit.getCommit()); reviewItemSet.getParentCommits().add(commit); } } }
Source:
public OkClient(OkHttpClient client) { if (client == null) throw new NullPointerException("client"); this.client = client; }

Target:
public OkClient(OkHttpClient client) { if (client == null) throw new NullPointerException("client == null"); this.client = client; }
Source:
protected void updateParametersVmFromInstanceType() { InstanceType instanceType = getInstanceType(); VmStatic vmStatic = getParameters().getVmStaticData(); if (instanceType != null) { vmStatic.setMemSizeMb(instanceType.getMemSizeMb()); vmStatic.setNumOfSockets(instanceType.getNumOfSockets()); vmStatic.setCpuPerSocket(instanceType.getCpuPerSocket()); vmStatic.setThreadsPerCpu(instanceType.getThreadsPerCpu()); vmStatic.setAutoStartup(instanceType.isAutoStartup()); if (FeatureSupported.isMigrationSupported(getCluster().getArchitecture(), getEffectiveCompatibilityVersion())) { vmStatic.setMigrationSupport(instanceType.getMigrationSupport()); } vmStatic.setNumOfIoThreads(instanceType.getNumOfIoThreads()); vmStatic.setMigrationDowntime(instanceType.getMigrationDowntime()); vmStatic.setPriority(instanceType.getPriority()); vmStatic.setTunnelMigration(instanceType.getTunnelMigration()); List<VmDevice> vmDevices = vmDeviceUtils.getMemoryBalloons(instanceType.getId()); vmStatic.setMinAllocatedMem(instanceType.getMinAllocatedMem()); if (vmDevices.isEmpty()) { getParameters().setBalloonEnabled(false); } else if (osRepository.isBalloonEnabled(getParameters().getVmStaticData().getOsId(), getEffectiveCompatibilityVersion())) { getParameters().setBalloonEnabled(true); } vmStatic.setMigrationPolicyId(instanceType.getMigrationPolicyId()); } }

Target:
protected void updateParametersVmFromInstanceType() { InstanceType instanceType = getInstanceType(); VmStatic vmStatic = getParameters().getVmStaticData(); if (instanceType != null) { vmStatic.setMemSizeMb(instanceType.getMemSizeMb()); vmStatic.setNumOfSockets(instanceType.getNumOfSockets()); vmStatic.setCpuPerSocket(instanceType.getCpuPerSocket()); vmStatic.setThreadsPerCpu(instanceType.getThreadsPerCpu()); vmStatic.setAutoStartup(instanceType.isAutoStartup()); if (FeatureSupported.isMigrationSupported(getCluster().getArchitecture(), getEffectiveCompatibilityVersion())) { vmStatic.setMigrationSupport(instanceType.getMigrationSupport()); } vmStatic.setNumOfIoThreads(instanceType.getNumOfIoThreads()); vmStatic.setMigrationDowntime(instanceType.getMigrationDowntime()); vmStatic.setPriority(instanceType.getPriority()); vmStatic.setTunnelMigration(instanceType.getTunnelMigration()); List<VmDevice> vmDevices = getVmDeviceUtils().getMemoryBalloons(instanceType.getId()); vmStatic.setMinAllocatedMem(instanceType.getMinAllocatedMem()); if (vmDevices.isEmpty()) { getParameters().setBalloonEnabled(false); } else if (osRepository.isBalloonEnabled(getParameters().getVmStaticData().getOsId(), getEffectiveCompatibilityVersion())) { getParameters().setBalloonEnabled(true); } vmStatic.setMigrationPolicyId(instanceType.getMigrationPolicyId()); } }
Source:
public void snapshot(SnapshotWriter writer) { if (mClosed) { return; } LOG.debug("Calling snapshot"); Preconditions.checkState(!mSnapshotting, "Cannot call snapshot multiple times concurrently"); mSnapshotting = true; mLastSnapshotStartTime = System.currentTimeMillis(); long snapshotId = mNextSequenceNumberToRead - 1; try (SnapshotWriterStream sws = new SnapshotWriterStream(writer)) { writer.writeLong(snapshotId); JournalUtils.writeToCheckpoint(sws, getStateMachines()); } catch (Exception e) { ProcessUtils.fatalError(LOG, e, "Failed to snapshot"); throw new RuntimeException(e); } LOG.info("Completed snapshot up to SN in {}ms", snapshotId, System.currentTimeMillis() - mLastSnapshotStartTime); mSnapshotting = false; }

Target:
public void snapshot(SnapshotWriter writer) { if (mClosed) { return; } LOG.debug("Calling snapshot"); Preconditions.checkState(!mSnapshotting, "Cannot call snapshot multiple times concurrently"); mSnapshotting = true; mLastSnapshotStartTime = System.currentTimeMillis(); long snapshotId = mNextSequenceNumberToRead - 1; try (SnapshotWriterStream sws = new SnapshotWriterStream(writer)) { writer.writeLong(snapshotId); JournalUtils.writeToCheckpoint(sws, getStateMachines()); } catch (Exception e) { ProcessUtils.fatalError(LOG, e, "Failed to take snapshot: %s", snapshotId); throw new RuntimeException(e); } LOG.info("Completed snapshot up to SN in {}ms", snapshotId, System.currentTimeMillis() - mLastSnapshotStartTime); mSnapshotting = false; }
Source:
private void handlePaused(final StateContext context) { periodicPauseLog(context.entity, context.iterationTimestamp); if (context.entity.getImagedTicketId() != null && getParameters().isRetryOperation()) { boolean stopSucceeded = stopImageTransferSession(context.entity); if (!stopSucceeded) { log.warn("Failed to remove transfer ticket for {}", getTransferDescription()); if (getParameters().isRetryOperation()) { getParameters().setRetryOperation(false); } else { getParameters().setRetryOperation(true); } } } }

Target:
private void handlePaused(final StateContext context) { periodicPauseLog(context.entity, context.iterationTimestamp); if (context.entity.getImagedTicketId() != null && getParameters().isRetryOperation()) { boolean stopSucceeded = stopImageTransferSession(context.entity); if (!stopSucceeded) { log.warn("Failed to remove transfer ticket for {}", getTransferDescription()); if (getParameters().isRetryOperation()) { getParameters().setRetryOperation(false); } } } }
Source:
public void testProfileGenericDataResponse() { com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataResponse voResponse = this .makeresponseVo(); ProfileGenericDataResponse wsResponse = this.monitoringMapper.map(voResponse, ProfileGenericDataResponse.class); Assert.assertTrue(wsResponse != null && wsResponse instanceof ProfileGenericDataResponse); Assert.assertTrue(wsResponse.getCaptureObjects().getCaptureObject().size() > 0); Assert.assertTrue(wsResponse.getProfileEntries().getProfileEntry().size() > 0); Assert.assertTrue(wsResponse.getProfileEntries().getProfileEntry().get(0).getProfileEntryValue() != null); Assert.assertTrue(!wsResponse.getProfileEntries().getProfileEntry().get(0).getProfileEntryValue().isEmpty()); Assert.assertTrue(wsResponse.getProfileEntries().getProfileEntry().get(0).getProfileEntryValue().size() == 4); int i = 0; for (ProfileEntryValue profileEntryValue : wsResponse.getProfileEntries().getProfileEntry().get(0) .getProfileEntryValue()) { Assert.assertTrue(profileEntryValue.getStringValueOrDateValueOrFloatValue() != null && !profileEntryValue.getStringValueOrDateValueOrFloatValue().isEmpty()); Assert.assertTrue(EXPECTED_CLASS[i++].equals(profileEntryValue.getStringValueOrDateValueOrFloatValue() .get(0).getClass())); } }

Target:
public void testProfileGenericDataResponse() { com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileGenericDataResponse source = this .makeresponseVo(); ProfileGenericDataResponse target = this.monitoringMapper.map(source, ProfileGenericDataResponse.class); assertNotNull("mapping ProfileGenericDataResponse should not return null", target); assertEquals(target.getCaptureObjects().getCaptureObject().size(), 1); assertEquals(target.getProfileEntries().getProfileEntry().size(), 2); assertNotNull(target.getProfileEntries().getProfileEntry().get(0).getProfileEntryValue()); assertEquals(target.getProfileEntries().getProfileEntry().get(0).getProfileEntryValue().size(), 4); int i = 0; for (ProfileEntryValue profileEntryValue : target.getProfileEntries().getProfileEntry().get(0) .getProfileEntryValue()) { assertNotNull(profileEntryValue.getStringValueOrDateValueOrFloatValue()); assertEquals(profileEntryValue.getStringValueOrDateValueOrFloatValue().size(), 1); assertEquals(profileEntryValue.getStringValueOrDateValueOrFloatValue().get(0).getClass(), EXPECTED_CLASS[i++]); assertTrue(profileEntryValue.getStringValueOrDateValueOrFloatValue() != null && !profileEntryValue.getStringValueOrDateValueOrFloatValue().isEmpty()); } }
Source:
public void run() { try { processingLoop(segment); } catch (Throwable e) { logger.error("Processing loop ended due to uncaught exception. Processor pausing.", e); state.set(State.PAUSED_ERROR); } finally { releaseSegment(segment.getSegmentId()); if (activeSegments.size() == maxThreadCount - 1) { new WorkerLauncher().run(); } } }

Target:
public void run() { try { processingLoop(segment); } catch (Throwable e) { logger.error("Processing loop ended due to uncaught exception. Pausing processor in Error State.", e); state.set(State.PAUSED_ERROR); } finally { activeSegments.remove(segment.getSegmentId()); if (availableThreads.getAndIncrement() == 0 && getState().isRunning()) { logger.info("No Worker Launcher active. Using current thread to assign segments."); new WorkerLauncher().run(); } } }
Source:
private void beforeFirstRefreshTreatment(boolean isVdsUpOrGoingToMaintenance) { if (vdsManager.getbeforeFirstRefresh()) { boolean flagsChanged = false; final AtomicBoolean processHardwareCapsNeededTemp = new AtomicBoolean(); vdsManager.refreshCapabilities(null, processHardwareCapsNeededTemp, vds); flagsChanged = processHardwareCapsNeededTemp.get(); vdsManager.setbeforeFirstRefresh(false); refreshedCapabilities = true; saveVdsDynamic = true; processHardwareCapsNeeded = processHardwareCapsNeeded ? processHardwareCapsNeeded : flagsChanged; } else if (isVdsUpOrGoingToMaintenance || vds.getStatus() == VDSStatus.Error) { return; } if (vds.getStatus() != VDSStatus.Up) { AuditLogable logable = createAuditLogableForHost(); logable.addCustomValue("HostStatus", vds.getStatus().toString()); auditLog(logable, AuditLogType.VDS_DETECTED); } }

Target:
private void beforeFirstRefreshTreatment(boolean isVdsUpOrGoingToMaintenance) { if (vdsManager.getbeforeFirstRefresh()) { final AtomicBoolean processHardwareCapsNeededTemp = new AtomicBoolean(); vdsManager.refreshCapabilities(new BeforeFirstTreatmentCallback( vdsManager, vds, processHardwareCapsNeededTemp, isVdsUpOrGoingToMaintenance), processHardwareCapsNeededTemp, vds); } else if (isVdsUpOrGoingToMaintenance || vds.getStatus() == VDSStatus.Error) { return; } }
Source:
public Object remove(Data key, CallerProvenance provenance) { checkIfLoaded(); long now = getNow(); Record record = getRecordOrNull(key, now, false); Object oldValue = null; if (record == null) { if (persistenceEnabledFor(provenance)) { oldValue = mapDataStore.load(key); if (oldValue != null) { mapDataStore.remove(key, now); } } } else { oldValue = removeRecord(key, record, now, provenance); } return oldValue; }

Target:
public Object remove(Data key, CallerProvenance provenance) { checkIfLoaded(); long now = getNow(); Record record = getRecordOrNull(key, now, false); Object oldValue; if (record == null) { oldValue = mapDataStore.load(key); if (oldValue != null && persistenceEnabledFor(provenance)) { mapDataStore.remove(key, now); } } else { oldValue = removeRecord(key, record, now, provenance); } return oldValue; }
Source:
public void basicUsageOfSolverManagerWithOneProblem() throws InterruptedException { TestdataSolution problem = createTestProblem(tenantId); solverManager.solve(tenantId, problem, taskAssigningSolution -> solutionChangedLatch.countDown(), taskAssigningSolution -> solvingEndedLatch.countDown()); solutionChangedLatch.await(5, TimeUnit.SECONDS); assertEquals(solverManager.getSolverStatus(tenantId), SolverStatus.SOLVING); assertEquals(solverManager.getBestSolution(tenantId).getCode(), tenantId.toString()); assertTrue(solverManager.getBestScore(tenantId).isSolutionInitialized()); solverManager.stopSolver(tenantId); assertEquals(SolverStatus.TERMINATED_EARLY, solverManager.getSolverStatus(tenantId)); logger.info(String.valueOf(solvingEndedLatch.getCount())); }

Target:
public void basicUsageOfSolverManagerWithOneProblem() throws InterruptedException { TestdataSolution problem = createTestProblem(tenantId); solverManager.solve(tenantId, problem, taskAssigningSolution -> solutionChangedLatch.countDown(), taskAssigningSolution -> solvingEndedLatch.countDown()); solutionChangedLatch.await(5, TimeUnit.SECONDS); assertTrue(solverManager.isProblemSubmitted(tenantId)); solverManager.terminateSolver(tenantId); solvingEndedLatch.await(5, TimeUnit.SECONDS); }
Source:
private String jsonAMF(AMFDataObj dataObj) { if (dataObj == null) { logger.debug("data object is null"); return null; } String json = null; try { Map<String, Object> map = new HashMap<>(); addToMap(map, dataObj, OBJECT_TYPE_KEY); addToMap(map, dataObj, OFFSET_KEY); addToMap(map, dataObj, TIMESTAMP_KEY); addToMap(map, dataObj, ID_KEY); json = new ObjectMapper().writeValueAsString(map); } catch (JsonProcessingException e) { logger.debug("error occurred while parsing AMFData", e); } return json; }

Target:
private String jsonAMF(AMFDataObj dataObj) throws JsonProcessingException { Map<String, Object> map = new HashMap<>(); addToMap(map, dataObj, OBJECT_TYPE_KEY); addToMap(map, dataObj, OFFSET_KEY); addToMap(map, dataObj, TIMESTAMP_KEY); addToMap(map, dataObj, ID_KEY); return new ObjectMapper().writeValueAsString(map); }
Source:
public void writeLeaderInformation(LeaderInformation leaderInformation) { assert(running); if (LOG.isDebugEnabled()) { LOG.debug("Write leader information: {}.", leaderInformation); } if (leaderInformation.equals(LeaderInformation.empty())) { return; } try { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeUTF(leaderInformation.getLeaderAddress()); oos.writeObject(leaderInformation.getLeaderSessionID()); oos.close(); boolean dataWritten = false; while (!dataWritten && leaderLatch.hasLeadership()) { Stat stat = client.checkExists().forPath(leaderPath); if (stat != null) { long owner = stat.getEphemeralOwner(); long sessionID = client.getZookeeperClient().getZooKeeper().getSessionId(); if (owner == sessionID) { try { client.setData().forPath(leaderPath, baos.toByteArray()); dataWritten = true; } catch (KeeperException.NoNodeException noNode) { } } else { try { client.delete().forPath(leaderPath); } catch (KeeperException.NoNodeException noNode) { } } } else { try { client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath( leaderPath, baos.toByteArray()); dataWritten = true; } catch (KeeperException.NodeExistsException nodeExists) { } } } if (LOG.isDebugEnabled()) { LOG.debug("Successfully wrote leader information: {}.", leaderInformation); } } catch (Exception e) { fatalErrorHandler.onFatalError( new LeaderElectionException("Could not write leader address and leader session ID to " + "ZooKeeper.", e)); } }

Target:
public void writeLeaderInformation(LeaderInformation leaderInformation) { assert(running); if (LOG.isDebugEnabled()) { LOG.debug("Write leader information: {}.", leaderInformation); } if (leaderInformation.isEmpty()) { return; } try { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeUTF(leaderInformation.getLeaderAddress()); oos.writeObject(leaderInformation.getLeaderSessionID()); oos.close(); boolean dataWritten = false; while (!dataWritten && leaderLatch.hasLeadership()) { Stat stat = client.checkExists().forPath(leaderPath); if (stat != null) { long owner = stat.getEphemeralOwner(); long sessionID = client.getZookeeperClient().getZooKeeper().getSessionId(); if (owner == sessionID) { try { client.setData().forPath(leaderPath, baos.toByteArray()); dataWritten = true; } catch (KeeperException.NoNodeException noNode) { } } else { try { client.delete().forPath(leaderPath); } catch (KeeperException.NoNodeException noNode) { } } } else { try { client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath( leaderPath, baos.toByteArray()); dataWritten = true; } catch (KeeperException.NodeExistsException nodeExists) { } } } if (LOG.isDebugEnabled()) { LOG.debug("Successfully wrote leader information: {}.", leaderInformation); } } catch (Exception e) { fatalErrorHandler.onFatalError( new LeaderElectionException("Could not write leader address and leader session ID to " + "ZooKeeper.", e)); } }
Source:
private StockOperation createOperation(StockOperation operation, InventoryStockTake delegate) { operation.setStatus(StockOperationStatus.NEW); IStockOperationType operationType = WellKnownOperationTypes.getAdjustment(); operation.setInstanceType(operationType); Stockroom stockroom; stockroom = delegate.getStockroom(); operation.setSource(stockroom); operation.setOperationNumber(delegate.getOperationNumber()); Date dNow = new Date(); operation.setOperationDate(dNow); operation.setItems(createOperationsItemSet(operation, delegate.getItemStockSummaryList())); return operation; }

Target:
private StockOperation createOperation(StockOperation operation, InventoryStockTake delegate) { operation.setStatus(StockOperationStatus.NEW); IStockOperationType operationType = WellKnownOperationTypes.getAdjustment(); operation.setInstanceType(operationType); Stockroom stockroom = delegate.getStockroom(); operation.setSource(stockroom); operation.setOperationNumber(delegate.getOperationNumber()); operation.setOperationDate(new Date()); operation.setItems(createOperationsItemSet(operation, delegate.getItemStockSummaryList())); return operation; }
Source:
public String getPreview() { StringBuffer buf= new StringBuffer(); buf.append("\n"); buf.append("public class IFoo {\n"); if (isEnabled(CleanUpConstants.REMOVE_REDUNDANT_SEMICOLONS)) { buf.append(" int a = 3;\n"); buf.append(" public void foo() {};\n"); } else { buf.append(" int a = 3;;\n"); buf.append(" public void foo() {};;\n"); } buf.append("}\n"); return buf.toString(); }

Target:
public String getPreview() { StringBuffer buf= new StringBuffer(); buf.append("\n"); buf.append("enum color {\n"); buf.append(" red, yellow, green\n"); if (isEnabled(CleanUpConstants.REMOVE_REDUNDANT_SEMICOLONS)) { buf.append("}\n"); } else { buf.append("};\n"); } buf.append("\npublic class IFoo {\n"); if (isEnabled(CleanUpConstants.REMOVE_REDUNDANT_SEMICOLONS)) { buf.append(" int a= 3;\n"); buf.append(" public void foo() {}\n"); buf.append("}\n"); } else { buf.append(" int a= 3;;\n"); buf.append(" public void foo() {;};\n"); buf.append("};\n"); } return buf.toString(); }
Source:
public void add() throws Exception { client.apply(new AddSecretAuthentication.Builder(TEST_REALM_NAME) .password(PASSWORD) .build()); ops.exists(TEST_SECRET_IDENTITY_ADDRESS); ModelNodeResult result = ops.readAttribute(TEST_SECRET_IDENTITY_ADDRESS, "value"); result.assertSuccess(); assertEquals("Password should be encoded properly.", PASSWORD, new String(Base64.getDecoder().decode(result.stringValue()))); }

Target:
public void add() throws Exception { client.apply(new AddSecretAuthentication.Builder(TEST_REALM_NAME) .password(PASSWORD) .build()); assertTrue("Server identity should be created", ops.exists(TEST_SECRET_IDENTITY_ADDRESS)); ModelNodeResult result = ops.readAttribute(TEST_SECRET_IDENTITY_ADDRESS, "value"); result.assertSuccess(); assertEquals("Password should be encoded properly.", PASSWORD, new String(BaseEncoding.base64().decode(result.stringValue()), "UTF-8")); }
Source:
private Map<Integer, OnmsAcknowledgment> fetchAcks(Set<OnmsAlarm> alarms) { Set<OnmsAcknowledgment> acks = new HashSet<>(); if (alarms.size() == 1) { acknowledgmentDao.findLatestAckForRefId(alarms.iterator() .next() .getId()) .ifPresent(acks::add); } else { final Date earliestAlarm = alarms.stream() .map(OnmsAlarm::getFirstEventTime) .filter(Objects::nonNull) .min(Comparator.naturalOrder()) .orElseGet(() -> { final LocalDateTime oneMonthAgoLdt = LocalDateTime.now().minusMonths(1); final Date oneMonthAgo = Date.from(oneMonthAgoLdt.atZone(ZoneId.systemDefault()).toInstant()); LOG.error("Could not find minimum alarm creation time for alarms: {}. Using: {}", oneMonthAgo); return oneMonthAgo; }); acks.addAll(acknowledgmentDao.findLatestAcks(earliestAlarm)); } Map<Integer, OnmsAcknowledgment> acksById = acks.stream().collect(Collectors.toMap(OnmsAcknowledgment::getRefId, ack -> ack)); acksById.putAll(alarms.stream() .filter(alarm -> !acksById.containsKey(alarm.getId())) .collect(Collectors.toMap(OnmsAlarm::getId, alarm -> { OnmsAcknowledgment ack = new OnmsAcknowledgment(alarm, DefaultAlarmService.DEFAULT_USER, alarm.getFirstEventTime()); ack.setAckAction(AckAction.UNACKNOWLEDGE); ack.setId(0); return ack; }))); return acksById; }

Target:
private Map<Integer, OnmsAcknowledgment> fetchAcks(Set<OnmsAlarm> alarms) { Set<OnmsAcknowledgment> acks = new HashSet<>(); if (alarms.size() == 1) { acknowledgmentDao.findLatestAckForRefId(alarms.iterator() .next() .getId()) .ifPresent(acks::add); } else { final Date earliestAlarm = alarms.stream() .map(OnmsAlarm::getFirstEventTime) .filter(Objects::nonNull) .min(Comparator.naturalOrder()) .orElseGet(() -> { final LocalDateTime oneMonthAgoLdt = LocalDateTime.now().minusMonths(1); final Date oneMonthAgo = Date.from(oneMonthAgoLdt.atZone(ZoneId.systemDefault()).toInstant()); LOG.error("Could not find minimum alarm creation time for alarms: {}. Using: {}", alarms, oneMonthAgo); return oneMonthAgo; }); acks.addAll(acknowledgmentDao.findLatestAcks(earliestAlarm)); } Map<Integer, OnmsAcknowledgment> acksById = acks.stream().collect(Collectors.toMap(OnmsAcknowledgment::getRefId, ack -> ack)); acksById.putAll(alarms.stream() .filter(alarm -> !acksById.containsKey(alarm.getId())) .collect(Collectors.toMap(OnmsAlarm::getId, alarm -> { OnmsAcknowledgment ack = new OnmsAcknowledgment(alarm, DefaultAlarmService.DEFAULT_USER, alarm.getFirstEventTime()); ack.setAckAction(AckAction.UNACKNOWLEDGE); ack.setId(0); return ack; }))); return acksById; }
Source:
void setFillColor(String color) { color = color.trim(); int polygonColorNum = (Color.parseColor("#" + convertColor(color))); setPolygonFillColor(polygonColorNum); mStylesSet.add("fillColor"); }

Target:
void setFillColor(String color) { int polygonColorNum = (Color.parseColor("#" + convertColor(color))); setPolygonFillColor(polygonColorNum); mStylesSet.add("fillColor"); }
Source:
public ValidationResult isVmPluggedDiskUsingScsiReservation() { for (VM vm : vms) { List<VmDevice> devices = getDbFacade().getVmDeviceDao().getVmDeviceByVmIdAndType(vm.getId(), VmDeviceGeneralType.DISK); for (VmDevice device : devices) { if (device.getIsPlugged() && device.isUsingScsiReservation()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION, String.format("$VmName %s", vm.getName())); } } } return ValidationResult.VALID; }

Target:
public ValidationResult isVmPluggedDiskUsingScsiReservation() { StringBuilder vmUsingScsiReservation = new StringBuilder(); for (VM vm : vms) { List<VmDevice> devices = getDbFacade().getVmDeviceDao().getVmDeviceByVmIdAndType(vm.getId(), VmDeviceGeneralType.DISK); for (VmDevice device : devices) { if (device.getIsPlugged() && device.isUsingScsiReservation()) { vmUsingScsiReservation.append(vm.getName()).append(" "); } } } if (vmUsingScsiReservation.length() == 0) { return ValidationResult.VALID; } return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION, String.format("$VmName %s", vmUsingScsiReservation.toString().substring(0, vmUsingScsiReservation.toString().length()-1))); }
Source:
public void testKafkaRpcAtRemoteLocation() throws InterruptedException, ExecutionException { assertNotEquals(REMOTE_LOCATION_NAME, identity.getLocation()); Thread.sleep(5000); EchoRequest request = new EchoRequest("Kafka-RPC"); request.setLocation(REMOTE_LOCATION_NAME); request.setDelay(5000L); EchoResponse expectedResponse = new EchoResponse("Kafka-RPC"); EchoResponse actualResponse = echoClient.execute(request).get(); assertEquals(expectedResponse, actualResponse); }

Target:
public void testKafkaRpcAtRemoteLocation() throws InterruptedException, ExecutionException { EchoRequest request = new EchoRequest("Kafka-RPC"); request.setLocation(REMOTE_LOCATION_NAME); request.setDelay(5000L); EchoResponse expectedResponse = new EchoResponse("Kafka-RPC"); EchoResponse actualResponse = echoClient.execute(request).get(); assertEquals(expectedResponse, actualResponse); }
Source:
public T[] asArray(Class<T> clazz) { T[] result = getArray(clazz, this.size); int index = 0; Element<T> current = head; while (Objects.nonNull(current)) { result[index++] = current.value; current = current.next; } return (T[]) result; }

Target:
public T[] asArray(Class<T> clazz) { T[] result = newArray(clazz, this.size); int index = 0; Element<T> current = head; while (Objects.nonNull(current)) { result[index++] = current.value; current = current.next; } return result; }
Source:
public void beginRecognizeContentFromUrl() { String sourceFilePath = "{file_source_url}"; formRecognizerAsyncClient.beginRecognizeContentFromUrl(sourceFilePath).subscribe(trainingOperationResponse -> trainingOperationResponse.getFinalResult().subscribe(layoutPageResults -> layoutPageResults.forEach(formPage -> { System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); System.out.println("Recognized Tables: "); formPage.getTables().forEach(formTable -> { for (int i = 0; i < formTable.getRowCount(); i++) { for (int j = 0; j < formTable.getColumnCount(); j++) { int finalJ = j; int finalI = i; Optional<FormTableCell> optionalFormTableCell = formTable.getCells().stream().filter(formTableCell -> formTableCell.getRowIndex() == finalI && formTableCell.getColumnIndex() == finalJ) .findFirst(); FormTableCell recognizedTableCell = optionalFormTableCell.get(); if (recognizedTableCell.isHeader()) { System.out.println(recognizedTableCell.getText()); } else { System.out.printf("%s || ", recognizedTableCell.getText()); } }} }); }) )); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string }

Target:
public void beginRecognizeContentFromUrl() { String sourceFilePath = "{file_source_url}"; formRecognizerAsyncClient.beginRecognizeContentFromUrl(sourceFilePath).subscribe( recognizePollingOperation -> recognizePollingOperation.getFinalResult().subscribe(layoutPageResults -> layoutPageResults.forEach(recognizedForm -> { System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); System.out.println("Recognized Tables: "); recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()))); }) )); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string }
Source:
public VcfLineMapper(VariantSource source) { this.source = source; this.factory = new VariantVcfFactory(); if (!VariantSource.Aggregation.NONE.equals(source.getAggregation())) { throw new IllegalArgumentException( this.getClass().getSimpleName() + " should not take aggregated " + "VCFs, but the VariantSource is not marked as Aggregation.NONE"); } }

Target:
public VcfLineMapper(VariantSource source) { if (!VariantSource.Aggregation.NONE.equals(source.getAggregation())) { throw new IllegalArgumentException( this.getClass().getSimpleName() + " should be used to read genotyped VCFs only, " + "but the VariantSource.Aggregation set to " + source.getAggregation().toString()); } this.source = source; this.factory = new VariantVcfFactory(); }
Source:
public ProcessContext<CheckoutSeed> execute(ProcessContext<CheckoutSeed> context) throws Exception { Order order = context.getSeedData().getOrder(); if (order == null) { return context; } for (OrderItem orderItem : order.getOrderItems()) { Sku sku; if (orderItem instanceof DiscreteOrderItem) { sku = ((DiscreteOrderItem) orderItem).getSku(); } else if (orderItem instanceof BundleOrderItem) { sku = ((BundleOrderItem) orderItem).getSku(); } else { LOG.warn("Could not check availability; did not recognize passed-in item " + orderItem.getClass().getName()); return context; } Integer requestedQuantity = orderItem.getQuantity(); inventoryService.checkSkuAvailability(order, sku, requestedQuantity); Integer previousQty = orderItem.getQuantity(); for (OrderItem child : orderItem.getChildOrderItems()) { Sku childSku = ((DiscreteOrderItem) child).getSku(); Integer childQuantity = child.getQuantity(); childQuantity = childQuantity / previousQty; inventoryService.checkSkuAvailability(order, childSku, childQuantity * requestedQuantity); } } return context; }

Target:
public ProcessContext<CheckoutSeed> execute(ProcessContext<CheckoutSeed> context) throws Exception { Order order = context.getSeedData().getOrder(); if (order == null) { return context; } for (OrderItem orderItem : order.getOrderItems()) { Sku sku; if (orderItem instanceof DiscreteOrderItem) { sku = ((DiscreteOrderItem) orderItem).getSku(); } else if (orderItem instanceof BundleOrderItem) { sku = ((BundleOrderItem) orderItem).getSku(); } else { LOG.warn("Could not check availability; did not recognize passed-in item " + orderItem.getClass().getName()); return context; } if (!sku.isActive()) { throw new IllegalArgumentException("The requested skuId (" + sku.getId() + ") is no longer active"); } Integer requestedQuantity = orderItem.getQuantity(); inventoryService.checkSkuAvailability(order, sku, requestedQuantity); } return context; }
Source:
public void end() { if (isInTransaction()) { log.warn("Ending transaction without commit!"); quadsIndex().end(); defaultGraph().end(); isInTransaction.remove(); transactionType.remove(); writeLock().leaveCriticalSection(); } }

Target:
public void end() { if (isInTransaction()) { if (transactionType().equals(WRITE)) log.warn("Ending WRITE transaction without commit!"); quadsIndex().end(); defaultGraph().end(); isInTransaction.remove(); transactionType.remove(); writeLock().leaveCriticalSection(); } }
Source:
public static Contact getConvReceiver(String name){ String first; String last = ""; String phoneNumber = null; String secondPhone = null; Scanner scanner = new Scanner(name); first = scanner.next(); if(scanner.hasNext()){ last = scanner.next(); } for(int i = 0; i < Global.contactAList.size(); i++){ if(Global.contactAList.get(i).getFirstName().equals(first) && Global.contactAList.get(i).getLastName().equals(last)){ phoneNumber = Global.contactAList.get(i).getPhoneNumber(); if(!Global.contactAList.get(i).getSecondPhone().equals(null)){ secondPhone = Global.contactAList.get(i).getSecondPhone(); } break; } } Contact receiver = new Contact(first, last,phoneNumber,secondPhone); scanner.close(); return receiver; }

Target:
public static Contact getConvReceiver(String name){ String first = ""; String last = ""; String phoneNumber = null; String secondPhone = null; Scanner scanner = new Scanner(name); first = scanner.next(); if(scanner.hasNext()){ last = scanner.next(); } for(int i = 0; i < Global.contactAList.size(); i++){ if(Global.contactAList.get(i).getFirstName().equalsIgnoreCase(first) && Global.contactAList.get(i).getLastName().equalsIgnoreCase(last)){ phoneNumber = Global.contactAList.get(i).getPhoneNumber(); if(Global.contactAList.get(i).getSecondPhone() != null){ secondPhone = Global.contactAList.get(i).getSecondPhone(); } break; } } Contact receiver = new Contact(first, last,phoneNumber,secondPhone); scanner.close(); return receiver; }
Source:
private RaptorSplit( String connectorId, Set<UUID> shardUuids, Map<UUID, UUID> shardDeltaMap, boolean tableSupportsDeltaDelete, OptionalInt bucketNumber, List<HostAddress> addresses, TupleDomain<RaptorColumnHandle> effectivePredicate, OptionalLong transactionId, Optional<Map<String, Type>> columnTypes) { this.connectorId = requireNonNull(connectorId, "connectorId is null"); this.shardUuids = ImmutableSet.copyOf(requireNonNull(shardUuids, "shardUuid is null")); this.shardDeltaMap = requireNonNull(shardDeltaMap, "shardUuid is null"); this.tableSupportsDeltaDelete = requireNonNull(tableSupportsDeltaDelete, "tableSupportsDeltaDelete is null"); this.bucketNumber = requireNonNull(bucketNumber, "bucketNumber is null"); this.addresses = ImmutableList.copyOf(requireNonNull(addresses, "addresses is null")); this.effectivePredicate = requireNonNull(effectivePredicate, "effectivePredicate is null"); this.transactionId = requireNonNull(transactionId, "transactionId is null"); this.columnTypes = requireNonNull(columnTypes, "columnTypes is null"); }

Target:
private RaptorSplit( String connectorId, Set<UUID> shardUuids, Map<UUID, UUID> shardDeltaMap, boolean tableSupportsDeltaDelete, OptionalInt bucketNumber, List<HostAddress> addresses, TupleDomain<RaptorColumnHandle> effectivePredicate, OptionalLong transactionId, Optional<Map<String, Type>> columnTypes) { this.connectorId = requireNonNull(connectorId, "connectorId is null"); this.shardUuids = ImmutableSet.copyOf(requireNonNull(shardUuids, "shardUuid is null")); this.shardDeltaMap = requireNonNull(shardDeltaMap, "shardUuid is null"); this.tableSupportsDeltaDelete = tableSupportsDeltaDelete; this.bucketNumber = requireNonNull(bucketNumber, "bucketNumber is null"); this.addresses = ImmutableList.copyOf(requireNonNull(addresses, "addresses is null")); this.effectivePredicate = requireNonNull(effectivePredicate, "effectivePredicate is null"); this.transactionId = requireNonNull(transactionId, "transactionId is null"); this.columnTypes = requireNonNull(columnTypes, "columnTypes is null"); }
Source:
public PrivateKey parsePrivateKey(final String key) throws IOException { try (final PemReader pemReader = new PemReader(new StringReader(key));) { final PemObject pemObject = pemReader.readPemObject(); final byte[] content = pemObject.getContent(); final PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(content); final KeyFactory factory = KeyFactory.getInstance("RSA", "BC"); return factory.generatePrivate(privKeySpec); } catch (NoSuchAlgorithmException | NoSuchProviderException e) { throw new IOException("No encryption provider available.", e); } catch (final InvalidKeySpecException e) { throw new IOException("Invalid Key format.", e); } }

Target:
public PrivateKey parsePrivateKey(final String key) throws IOException { Preconditions.checkArgument(!Strings.isNullOrEmpty(key)); try (final PemReader pemReader = new PemReader(new StringReader(key));) { final PemObject pemObject = pemReader.readPemObject(); final byte[] content = pemObject.getContent(); final PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(content); final KeyFactory factory = KeyFactory.getInstance("RSA", "BC"); return factory.generatePrivate(privKeySpec); } catch (NoSuchAlgorithmException | NoSuchProviderException e) { throw new IOException("No encryption provider available.", e); } catch (final InvalidKeySpecException e) { throw new IOException("Invalid Key format.", e); } }