auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ClusteredQueryCommandWorker getCommand(Cache<?, ?> cache, QueryDefinition queryDefinition, UUID lazyQueryId, int docIndex) { ClusteredQueryCommandWorker command = null; command = getNewInstance(); command.init(cache, queryDefinition, lazyQueryId, docIndex); return command; }

Target:
public ClusteredQueryCommandWorker getCommand(Cache<?, ?> cache, QueryDefinition queryDefinition, UUID lazyQueryId, int docIndex) { ClusteredQueryCommandWorker command = getNewInstance(); command.init(cache, queryDefinition, lazyQueryId, docIndex); return command; }
Source:
public void initFromPage(int valueCount, ByteBuffer in, int offset) throws IOException { int effectiveBitLength = valueCount * bitsPerValue; int length = BytesUtils.paddedByteCountFromBits(effectiveBitLength); if (Log.DEBUG) LOG.debug("reading " + length + " bytes for " + valueCount + " values of size " + bitsPerValue + " bits." ); this.in = new ByteBufferInputStream(in.duplicate(), offset, length); this.bitPackingReader = createBitPackingReader(bitsPerValue, this.in, valueCount); this.nextOffset = offset + length; }

Target:
public void initFromPage(int valueCount, ByteBuffer in, int offset) throws IOException { int effectiveBitLength = valueCount * bitsPerValue; int length = BytesUtils.paddedByteCountFromBits(effectiveBitLength); if (Log.DEBUG) LOG.debug("reading " + length + " bytes for " + valueCount + " values of size " + bitsPerValue + " bits." ); this.in = new ByteBufferInputStream(in, offset, length); this.bitPackingReader = createBitPackingReader(bitsPerValue, this.in, valueCount); this.nextOffset = offset + length; }
Source:
protected void _sendAdditionalNotification(NotificationContext context, NotificationStatus status) { requireArgument(context != null, "Notification context cannot be null."); super.sendAdditionalNotification(context); Notification notification = null; Trigger trigger = null; for (Notification tempNotification : context.getAlert().getNotifications()) { if (tempNotification.getName().equalsIgnoreCase(context.getNotification().getName())) { notification = tempNotification; break; } } requireArgument(notification != null, "Notification in notification context cannot be null."); for (Trigger tempTrigger : context.getAlert().getTriggers()) { if (tempTrigger.getName().equalsIgnoreCase(context.getTrigger().getName())) { trigger = tempTrigger; break; } } requireArgument(trigger != null, "Trigger in notification context cannot be null."); String body = getGOCMessageBody(notification, trigger, context); Severity sev = status == NotificationStatus.CLEARED ? Severity.OK : Severity.ERROR; sendMessage(sev, context.getNotification().getName(), getDisplayedName(context, context.getAlert().getName()), getDisplayedName(context, context.getTrigger().getName()), body, context.getNotification().getSeverityLevel(),context.getNotification().getSRActionable(), context.getTriggerFiredTime(), context.getTriggeredMetric()); }

Target:
protected void _sendAdditionalNotification(NotificationContext context, NotificationStatus status) { requireArgument(context != null, "Notification context cannot be null."); super.sendAdditionalNotification(context); Notification notification = null; Trigger trigger = null; for (Notification tempNotification : context.getAlert().getNotifications()) { if (tempNotification.getName().equalsIgnoreCase(context.getNotification().getName())) { notification = tempNotification; break; } } requireArgument(notification != null, "Notification in notification context cannot be null."); for (Trigger tempTrigger : context.getAlert().getTriggers()) { if (tempTrigger.getName().equalsIgnoreCase(context.getTrigger().getName())) { trigger = tempTrigger; break; } } requireArgument(trigger != null, "Trigger in notification context cannot be null."); String body = getGOCMessageBody(notification, trigger, context); Severity sev = status == NotificationStatus.CLEARED ? Severity.OK : Severity.ERROR; sendMessage(sev, getDisplayedName(context, context.getNotification().getName()), getDisplayedName(context, context.getAlert().getName()), getDisplayedName(context, context.getTrigger().getName()), body, context.getNotification().getSeverityLevel(),context.getNotification().getSRActionable(), context.getTriggerFiredTime(), context.getTriggeredMetric()); }
Source:
public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.GET != request.getMethod()) { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Only support GET method to retrieve GC details." + " If you want to trigger gc, send a POST to gc endpoint."); return response; } StateManager sm = bookie.getStateManager(); BookieState bs = new BookieState(); bs.running = sm.isRunning(); bs.readOnly = sm.isReadOnly(); bs.shuttingDown = sm.isShuttingDown(); bs.availableForHighPriorityWrites = sm.isAvailableForHighPriorityWrites(); String jsonResponse = JsonUtil.toJson(bs); response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; }

Target:
public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.GET != request.getMethod()) { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Only support GET method to retrieve bookie state."); return response; } StateManager sm = bookie.getStateManager(); BookieState bs = new BookieState(); bs.running = sm.isRunning(); bs.readOnly = sm.isReadOnly(); bs.shuttingDown = sm.isShuttingDown(); bs.availableForHighPriorityWrites = sm.isAvailableForHighPriorityWrites(); String jsonResponse = JsonUtil.toJson(bs); response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; }
Source:
public List<NetworkAttachment> getAllForNic(Guid nicId) { return getCallsHandler().executeReadList("GetNetworkAttachmentsByNicId", new NetworkAttachmentRowMapper(qosDaoRetriever, dnsResolverConfigurationDao), getCustomMapSqlParameterSource().addValue("nic_id", nicId)); }

Target:
public List<NetworkAttachment> getAllForNic(Guid nicId) { return getCallsHandler().executeReadList("GetNetworkAttachmentsByNicId", qosDaoAttachmentMapper, getCustomMapSqlParameterSource().addValue("nic_id", nicId)); }
Source:
public void onRetryCompletion(long id) { if (!outstandingRetries.containsValue(id)) { return; } lock.lock(); try { outstandingRetries.remove(id); if (isFlushed()) { flushedCondition.signal(); isFlushed = true; } } finally { lock.unlock(); } resetNoSuccessWarningDeadline(); }

Target:
public void onRetryCompletion(long id) { lock.lock(); try { if (outstandingRetries.remove(id) != null && isFlushed()) { flushedCondition.signal(); isFlushed = true; } } finally { lock.unlock(); } resetNoSuccessWarningDeadline(); }
Source:
public Mono<Response<TextAnalyticsResultCollection<AnalyzeSentimentResult>>> analyzeSentimentBatch( Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options) { try { inputDocumentsValidation(documents); return withContext(context -> getAnalyzedSentimentResponse(documents, options, context)); } catch (RuntimeException ex) { return monoError(logger, ex); } }

Target:
public Mono<Response<AnalyzeSentimentResultCollection>> analyzeSentimentBatch( Iterable<TextDocumentInput> documents, TextAnalyticsRequestOptions options) { try { inputDocumentsValidation(documents); return withContext(context -> getAnalyzedSentimentResponse(documents, options, context)); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
protected Control createDialogArea(Composite parent) { final Composite composite = (Composite) super.createDialogArea(parent); createSubtitleLabel(composite, Messages.AddAnalysisDialog_Name); fNameText = new Text(composite, getInputTextStyle()); fNameText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); fNameText.addModifyListener(e -> validateInputs()); fNameErrorLabel = createErrorLabel(composite); new Label(composite, SWT.WRAP); createSubtitleLabel(composite, Messages.AddAnalysisDialog_Command); fCommandText = new Text(composite, getInputTextStyle()); fCommandText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); final Font mono = new Font(parent.getDisplay(), "Monospace", 9, SWT.NONE); fCommandText.setFont(mono); fCommandText.addModifyListener(e -> validateInputs()); fCommandErrorLabel = createErrorLabel(composite); applyDialogFont(composite); return composite; }

Target:
protected Control createDialogArea(Composite parent) { final Composite composite = (Composite) super.createDialogArea(parent); createSubtitleLabel(composite, Messages.AddAnalysisDialog_Name); fNameText = new Text(composite, getInputTextStyle()); fNameText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); fNameText.addModifyListener(e -> validateInputs()); fNameErrorLabel = createErrorLabel(composite); new Label(composite, SWT.WRAP); createSubtitleLabel(composite, Messages.AddAnalysisDialog_Command); fCommandText = new Text(composite, getInputTextStyle()); fCommandText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); final Font mono = new Font(parent.getDisplay(), "Monospace", 9, SWT.NONE); fCommandText.setFont(mono); fCommandText.addModifyListener(e -> validateInputs()); fCommandText.addDisposeListener(e -> mono.dispose()); fCommandErrorLabel = createErrorLabel(composite); applyDialogFont(composite); return composite; }
Source:
public Future<Task> blockingSubmit(EngineWorker<Task> taskWorker) throws InterruptedException { semaphore.acquire(); GenWorker genWorker = (GenWorker) taskWorker; genWorker.getTask().setGenStartTime(new Date(System.currentTimeMillis())); Future<Task> future = completionService.submit(genWorker); executingGenTasks.put(future, genWorker.getTask()); return future; }

Target:
public Future<Task> blockingSubmit(EngineWorker<Task> taskWorker) throws InterruptedException { semaphore.acquire(); Future<Task> future = null; try { GenWorker genWorker = (GenWorker) taskWorker; genWorker.getTask().setGenStartTime(new Date(System.currentTimeMillis())); future = completionService.submit(genWorker); executingGenTasks.put(future, genWorker.getTask()); } catch (Exception ex) { semaphore.release(); throw ex; } return future; }
Source:
public Optional<DyeableData> fill(DataContainer container, DyeableData dyeableData) { Optional<String> id = container.getString(Keys.DYE_COLOR.getQuery()); if (id.isPresent()) { dyeableData.set(Keys.DYE_COLOR, Sponge.getGame().getRegistry().getType(DyeColor.class, id.get()).get()); return Optional.of(dyeableData); } return Optional.empty(); }

Target:
public Optional<DyeableData> fill(DataContainer container, DyeableData dyeableData) { Optional<String> id = container.getString(Keys.DYE_COLOR.getQuery()); if (id.isPresent()) { Optional<DyeColor> color = Sponge.getGame().getRegistry().getType(DyeColor.class, id.get()); dyeableData.set(Keys.DYE_COLOR, color.orElseThrow(() -> new RegistryException("Corresponding color " + id.get() + " missing in registry"))); return Optional.of(dyeableData); } return Optional.empty(); }
Source:
public boolean match(ChangeData object) throws OrmException { final PatchSet patchSet = object.currentPatchSet(db); if (patchSet != null) { final RevId revision = patchSet.getRevision(); if (revision != null) { final AnyObjectId objectId = ObjectId.fromString(revision.get()); final Change change = object.getChange(); if (change != null) { final Project.NameKey projectName = change.getProject(); if (projectName != null && (objectId != null)) { try { final RevWalk walk = new RevWalk(repoManager.openRepository(projectName.get())); final RevCommit revCommit = walk.parseCommit(objectId); return rFilter.include(walk, revCommit); } catch (RepositoryNotFoundException e) { log.error("Repository \"" + projectName.get() + "\" unknown.", e); } catch (MissingObjectException e) { log.error("Commit Id \"" + revision.get() + "\" does not exist.", e); } catch (IncorrectObjectTypeException e) { log.error("Id \"" + revision.get() + "\" is not a commit.", e); } catch (IOException e) { log.error("Could not search for commit message in \"" + projectName.get() + "\" repository.", e); } catch (NullPointerException e) { } } } } } return false; }

Target:
public boolean match(ChangeData object) throws OrmException { final PatchSet patchSet = object.currentPatchSet(db); if (patchSet == null) { return false; } final RevId revision = patchSet.getRevision(); if (revision == null) { return false; } final AnyObjectId objectId = ObjectId.fromString(revision.get()); if (objectId == null) { return false; } final Change change = object.change(db); if (change == null) { return false; } final Project.NameKey projectName = change.getProject(); if (projectName == null) { return false; } try { final Repository repo = repoManager.openRepository(projectName.get()); try { final RevWalk rw = new RevWalk(repo); try { return rFilter.include(rw, rw.parseCommit(objectId)); } finally { rw.release(); } } finally { repo.close(); } } catch (RepositoryNotFoundException e) { log.error("Repository \"" + projectName.get() + "\" unknown.", e); } catch (MissingObjectException e) { log.error(projectName.get() + "\" commit does not exist.", e); } catch (IncorrectObjectTypeException e) { log.error(projectName.get() + "\" revision is not a commit.", e); } catch (IOException e) { log.error("Could not search for commit message in \"" + projectName.get() + "\" repository.", e); } return false; }
Source:
public TestApplicationContext() { super(); }

Target:
TestApplicationContext() { super(); }
Source:
public void setBlockProxy( final String repoId, final boolean block ) throws Exception { RepositoryStatusResource status = new RepositoryStatusResource(); status.setId( repoId ); status.setRepoType( "proxy" ); status.setLocalStatus( LocalStatus.IN_SERVICE.name() ); if ( block ) { status.setRemoteStatus( RemoteStatus.AVAILABLE.name() ); status.setProxyMode( ProxyMode.BLOCKED_MANUAL.name() ); } else { status.setRemoteStatus( RemoteStatus.UNAVAILABLE.name() ); status.setProxyMode( ProxyMode.ALLOW.name() ); } Response response = RepositoryStatusMessageUtil.changeStatus( status ); assertThat( "Could not unblock proxy: " + repoId + ", status: " + response.getStatus().getName() + " (" + response.getStatus().getCode() + ") - " + response.getStatus().getDescription(), response, isSuccessful() ); TaskScheduleUtil.waitForAllTasksToStop(); getTest().getEventInspectorsUtil().waitForCalmPeriod(); }

Target:
public void setBlockProxy( final String repoId, final boolean block ) throws Exception { RepositoryStatusResource status = new RepositoryStatusResource(); status.setId( repoId ); status.setRepoType( "proxy" ); status.setLocalStatus( LocalStatus.IN_SERVICE.name() ); if ( block ) { status.setRemoteStatus( RemoteStatus.AVAILABLE.name() ); status.setProxyMode( ProxyMode.BLOCKED_MANUAL.name() ); } else { status.setRemoteStatus( RemoteStatus.UNAVAILABLE.name() ); status.setProxyMode( ProxyMode.ALLOW.name() ); } Response response = RepositoryStatusMessageUtil.changeStatus( status ); try { assertThat( "Could not unblock proxy: " + repoId + ", status: " + response.getStatus().getName() + " (" + response.getStatus().getCode() + ") - " + response.getStatus().getDescription(), response, isSuccessful() ); } finally { RequestFacade.releaseResponse( response ); } TaskScheduleUtil.waitForAllTasksToStop(); getTest().getEventInspectorsUtil().waitForCalmPeriod(); }
Source:
public int[] transformToIntValuesSV(ProjectionBlock projectionBlock) { if (_argument.getResultMetadata().getDataType() != FieldSpec.DataType.INT) { return super.transformToIntValuesSV(projectionBlock); } if (_intValuesSV == null) { _intValuesSV = new int[DocIdSetPlanNode.MAX_DOC_PER_CALL]; } int length = projectionBlock.getNumDocs(); int[][] intValuesMV = _argument.transformToIntValuesMV(projectionBlock); for (int i = 0; i < length; i++) { int maxRes = Integer.MIN_VALUE; for (int j = 0; j < intValuesMV[i].length; j++) { maxRes = Math.max(maxRes, intValuesMV[i][j]); } _intValuesSV[i] = maxRes; } return _intValuesSV; }

Target:
public int[] transformToIntValuesSV(ProjectionBlock projectionBlock) { if (_argument.getResultMetadata().getDataType() != FieldSpec.DataType.INT) { return super.transformToIntValuesSV(projectionBlock); } if (_intValuesSV == null) { _intValuesSV = new int[DocIdSetPlanNode.MAX_DOC_PER_CALL]; } int length = projectionBlock.getNumDocs(); int[][] intValuesMV = _argument.transformToIntValuesMV(projectionBlock); for (int i = 0; i < length; i++) { int maxRes = Integer.MIN_VALUE; for (int value : intValuesMV[i]) { maxRes = Math.max(maxRes, value); } _intValuesSV[i] = maxRes; } return _intValuesSV; }
Source:
public void testEffectivelyReadOnlyDisablesControl() throws DatabindingFailedException, NoRendererFoundException, NoPropertyDescriptorFoundExeption { showMoveButtons = true; when(renderer.getVElement().isReadonly()).thenReturn(false); when(renderer.getVElement().isEffectivelyReadonly()).thenReturn(true); final VView parent = mock(VView.class); when(parent.isReadonly()).thenReturn(true); when(renderer.getVElement().eContainer()).thenReturn(parent); final TestObservableValue observableValue = mock(TestObservableValue.class); when(databindingService.getObservableValue(any(VDomainModelReference.class), any(EObject.class))).thenReturn( observableValue); when(observableValue.getObserved()).thenReturn(mock(EObject.class)); final Composite composite = (Composite) renderer.render(new SWTGridCell(0, 0, renderer), shell); renderer.finalizeRendering(shell); assertFalse(composite.isEnabled()); final Button upButton = SWTTestUtil.findControlById(composite, UUID_UP, Button.class); assertThat(upButton, notNullValue()); assertFalse(upButton.getVisible()); final Button downButton = SWTTestUtil.findControlById(composite, UUID_DOWN, Button.class); assertThat(downButton, notNullValue()); assertFalse(downButton.getVisible()); final Button linkButton = SWTTestUtil.findControlById(composite, UUID_LINK, Button.class); assertThat(linkButton, nullValue()); final Button addButton = SWTTestUtil.findControlById(composite, UUID_ADD, Button.class); assertThat(addButton, nullValue()); final Button deleteButton = SWTTestUtil.findControlById(composite, UUID_DELETE, Button.class); assertThat(deleteButton, notNullValue()); assertFalse(deleteButton.getVisible()); }

Target:
public void testEffectivelyReadOnlyDisablesControl() throws DatabindingFailedException, NoRendererFoundException, NoPropertyDescriptorFoundExeption { showMoveButtons = true; when(renderer.getVElement().isReadonly()).thenReturn(false); when(renderer.getVElement().isEffectivelyReadonly()).thenReturn(true); when(renderer.getVElement().isEffectivelyEnabled()).thenReturn(true); final VView parent = mock(VView.class); when(parent.isReadonly()).thenReturn(true); when(renderer.getVElement().eContainer()).thenReturn(parent); final TestObservableValue observableValue = mock(TestObservableValue.class); when(databindingService.getObservableValue(any(VDomainModelReference.class), any(EObject.class))).thenReturn( observableValue); when(observableValue.getObserved()).thenReturn(mock(EObject.class)); final Composite composite = (Composite) renderer.render(new SWTGridCell(0, 0, renderer), shell); renderer.finalizeRendering(shell); assertTrue(composite.isEnabled()); checkButton(composite, UUID_UP, false, false); checkButton(composite, UUID_DOWN, false, false); checkButton(composite, UUID_DELETE, false, false); checkNoButton(composite, UUID_LINK); checkNoButton(composite, UUID_ADD); }
Source:
public synchronized CoordinatorEvent take() throws InterruptedException { while (_eventQueue.isEmpty()) { wait(); } CoordinatorEvent queuedEvent = _eventQueue.poll(); if (CoordinatorEvent.NO_OP_EVENT == queuedEvent) { return null; } if (queuedEvent != null) { LOG.info("De-queuing event " + queuedEvent.getType()); LOG.debug("Event queue size: {}", _eventQueue.size()); _eventSet.remove(queuedEvent); return queuedEvent; } return null; }

Target:
public synchronized CoordinatorEvent take() throws InterruptedException { while (_eventQueue.isEmpty()) { wait(); } CoordinatorEvent queuedEvent = _eventQueue.poll(); if (CoordinatorEvent.NO_OP_EVENT == queuedEvent) { return null; } if (queuedEvent != null) { LOG.info("De-queuing event " + queuedEvent.getType()); LOG.debug("Event queue size: {}", _eventQueue.size()); _eventSet.remove(queuedEvent); } return queuedEvent; }
Source:
public static Bundle saveUiStateToBundle(CommCareActivity activity) { Bundle bundle = new Bundle(); Class classHoldingFields = getClassHoldingFields(activity); for (Field f : classHoldingFields.getDeclaredFields()) { if (f.isAnnotationPresent(UiElement.class)) { UiElement element = f.getAnnotation(UiElement.class); try { f.setAccessible(true); try { View v; if (activity.usesUIController()) { v = (View)f.get(activity.getUIController()); } else { v = (View)f.get(activity); } String elementKey = getElementKey(element); int vis = v.getVisibility(); bundle.putInt(elementKey + "_visibility", vis); boolean enabled = v.isEnabled(); bundle.putBoolean(elementKey + "_enabled", enabled); if (v instanceof TextView) { bundle.putString(elementKey + "_text", ((TextView)v).getText().toString()); } } catch (IllegalArgumentException e) { e.printStackTrace(); throw new RuntimeException("Bad Object type for field " + f.getName()); } catch (IllegalAccessException e) { throw new RuntimeException("Couldn't access the activity field for some reason"); } } finally { f.setAccessible(false); } } } return bundle; }

Target:
public static Bundle saveUiStateToBundle(CommCareActivity activity) { Bundle bundle = new Bundle(); Object objectHoldingFields = activity.getUIManager(); for (Field f : objectHoldingFields.getClass().getDeclaredFields()) { if (f.isAnnotationPresent(UiElement.class)) { UiElement element = f.getAnnotation(UiElement.class); try { f.setAccessible(true); try { View v = (View)f.get(objectHoldingFields); String elementKey = getElementKey(element); int vis = v.getVisibility(); bundle.putInt(elementKey + "_visibility", vis); boolean enabled = v.isEnabled(); bundle.putBoolean(elementKey + "_enabled", enabled); if (v instanceof TextView) { bundle.putString(elementKey + "_text", ((TextView)v).getText().toString()); } } catch (IllegalArgumentException e) { e.printStackTrace(); throw new RuntimeException("Bad Object type for field " + f.getName()); } catch (IllegalAccessException e) { throw new RuntimeException("Couldn't access the activity field for some reason"); } } finally { f.setAccessible(false); } } } return bundle; }
Source:
private static ImmutableSortedMap<String, ImmutableSet<String>> buildRegistry( ImmutableSet<String> modulePaths) { SortedMap<String, Set<String>> registry = new TreeMap<>(new Comparator<String>() { @Override public int compare(String a, String b) { int comparison = Integer.compare(b.length(), a.length()); if (comparison != 0) { return comparison; } return a.compareTo(b); } }); for (String modulePath : modulePaths) { String[] nodeModulesDirs = modulePath.split("/node_modules/"); String parentPath = ""; for (int i = 0; i < nodeModulesDirs.length - 1; i++) { if (i + 1 < nodeModulesDirs.length) { parentPath += nodeModulesDirs[i] + "/"; } String subPath = modulePath.substring(parentPath.length() + "node_modules/".length()); if (!registry.containsKey(parentPath)) { registry.put(parentPath, new HashSet<String>()); } registry.get(parentPath).add(subPath); parentPath += "node_modules/"; } } SortedMap<String, ImmutableSet<String>> immutableRegistry = new TreeMap<>(new Comparator<String>() { @Override public int compare(String a, String b) { int comparison = Integer.compare(b.length(), a.length()); if (comparison != 0) { return comparison; } return a.compareTo(b); } }); for (Map.Entry<String, Set<String>> entry : registry.entrySet()) { immutableRegistry.put(entry.getKey(), ImmutableSet.copyOf(entry.getValue())); } return ImmutableSortedMap.copyOfSorted(immutableRegistry); }

Target:
private static ImmutableSortedMap<String, ImmutableSet<String>> buildRegistry( ImmutableSet<String> modulePaths) { SortedMap<String, Set<String>> registry = new TreeMap<>(new Comparator<String>() { @Override public int compare(String a, String b) { int comparison = Integer.compare(b.length(), a.length()); if (comparison != 0) { return comparison; } return a.compareTo(b); } }); for (String modulePath : modulePaths) { String[] nodeModulesDirs = modulePath.split(MODULE_SLASH + "node_modules" + MODULE_SLASH); String parentPath = ""; for (int i = 0; i < nodeModulesDirs.length - 1; i++) { if (i + 1 < nodeModulesDirs.length) { parentPath += nodeModulesDirs[i] + MODULE_SLASH; } String subPath = modulePath.substring(parentPath.length() + "node_modules/".length()); if (!registry.containsKey(parentPath)) { registry.put(parentPath, new HashSet<String>()); } registry.get(parentPath).add(subPath); parentPath += "node_modules" + MODULE_SLASH; } } SortedMap<String, ImmutableSet<String>> immutableRegistry = new TreeMap<>(new Comparator<String>() { @Override public int compare(String a, String b) { int comparison = Integer.compare(b.length(), a.length()); if (comparison != 0) { return comparison; } return a.compareTo(b); } }); for (Map.Entry<String, Set<String>> entry : registry.entrySet()) { immutableRegistry.put(entry.getKey(), ImmutableSet.copyOf(entry.getValue())); } return ImmutableSortedMap.copyOfSorted(immutableRegistry); }
Source:
private void bpBelongsToContext( IExecutionDMContext execContext, final MIBreakpointDMData data, final DataRequestMonitor<Boolean> rm ) { if ( execContext == null ) { rm.done( true ); return; } IMIExecutionDMContext threadContext = DMContexts.getAncestorOfType( execContext, IMIExecutionDMContext.class ); if ( threadContext != null ) { if ( data.getThreadId() != null && data.getThreadId().length() > 0 ) { try { int bpThreadId = Integer.parseInt( data.getThreadId() ); if ( bpThreadId != 0 ) { int ctxThreadId = Integer.parseInt(threadContext.getThreadId()); rm.done( ctxThreadId == bpThreadId ); return; } } catch( NumberFormatException e ) { assert false; GdbUIPlugin.getDefault().getLog().log( new Status( IStatus.ERROR, GdbUIPlugin.getUniqueIdentifier(), "Invalid breakpoint thread id" ) ); rm.done( true ); return; } } } final IMIContainerDMContext containerContext = DMContexts.getAncestorOfType( execContext, IMIContainerDMContext.class ); if ( containerContext != null ) { if ( data.getGroupIds() != null ) { List<String> groupIds = Arrays.asList( data.getGroupIds() ); rm.done( groupIds.contains( containerContext.getGroupId() ) ); } else { rm.done( true ); } } else { rm.done( true ); } }

Target:
private void bpBelongsToContext( IExecutionDMContext execContext, final MIBreakpointDMData data, final DataRequestMonitor<Boolean> rm ) { if ( execContext == null ) { rm.done( true ); return; } IMIExecutionDMContext threadContext = DMContexts.getAncestorOfType( execContext, IMIExecutionDMContext.class ); if ( threadContext != null ) { if (data.getThreadId() != null && data.getThreadId().length() > 0) { String bpThreadId = data.getThreadId().trim(); if (!bpThreadId.equals("0")) { String ctxThreadId = threadContext.getThreadId(); rm.done(ctxThreadId.equals(bpThreadId)); return; } } } final IMIContainerDMContext containerContext = DMContexts.getAncestorOfType( execContext, IMIContainerDMContext.class ); if ( containerContext != null ) { if ( data.getGroupIds() != null ) { List<String> groupIds = Arrays.asList( data.getGroupIds() ); rm.done( groupIds.contains( containerContext.getGroupId() ) ); } else { rm.done( true ); } } else { rm.done( true ); } }
Source:
public ReadAheadDispatcher(NestableBlock... blocks) { this.blocks = blocks; this.lookAheadReader = new LookAheadReader(); }

Target:
public ReadAheadDispatcher(NestableBlock... blocks) { this.blocks = cloneBlocks(Arrays.asList(blocks)); this.lookAheadReader = new LookAheadReader(); }
Source:
public static String stripHtml(String text) { String cleanText = text.replaceAll("\\<.*?\\>", " "); cleanText = cleanText.replaceAll("\\n", " "); cleanText = cleanText.replaceAll("\\r", " "); cleanText = cleanText.replaceAll("\\s{2,}", " "); return cleanText.trim(); }

Target:
public static String stripHtml(String text) { if (StringUtils.isEmpty(text)) return text; String cleanText = Jsoup.parse(text).text().trim(); return cleanText.trim(); }
Source:
public void overSizedCacheOps() throws Exception { final CacheManagerBuilder<PersistentCacheManager> clusteredCacheManagerBuilder = CacheManagerBuilder.newCacheManagerBuilder() .with(ClusteringServiceConfigurationBuilder.cluster(CLUSTER.getConnectionURI().resolve("/crud-cm")) .autoCreate() .defaultServerResource("primary-server-resource")); final PersistentCacheManager cacheManager = clusteredCacheManagerBuilder.build(false); cacheManager.init(); try { CacheConfiguration<Long, String> config = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.newResourcePoolsBuilder() .with(ClusteredResourcePoolBuilder.clusteredDedicated("primary-server-resource", 1, MemoryUnit.MB))).build(); Cache<Long, String> cache = cacheManager.createCache("clustered-cache", config); cache.put(1L, "The one"); assertThat(cache.containsKey(2L), is(false)); cache.put(2L, "The two"); assertThat(cache.containsKey(2L), is(true)); cache.put(1L, "Another one"); cache.put(3L, "The three"); assertThat(cache.get(1L), equalTo("Another one")); assertThat(cache.get(2L), equalTo("The two")); assertThat(cache.get(3L), equalTo("The three")); String veryLargeString = buildLargeString(2); cache.put(1L, veryLargeString); assertThat(cache.get(1L), is(nullValue())); assertThat(cache.get(3L), equalTo("The three")); cache.clear(); assertThat(cache.get(1L), is(nullValue())); assertThat(cache.get(2L), is(nullValue())); assertThat(cache.get(3L), is(nullValue())); System.out.println(" TEST COMPLETED SUCCESSFULLY "); } finally { cacheManager.close(); } }

Target:
public void overSizedCacheOps() throws Exception { CacheManagerBuilder<PersistentCacheManager> clusteredCacheManagerBuilder = CacheManagerBuilder.newCacheManagerBuilder() .with(ClusteringServiceConfigurationBuilder.cluster(CLUSTER.getConnectionURI().resolve("/crud-cm")) .autoCreate() .defaultServerResource("primary-server-resource")); try (PersistentCacheManager cacheManager = clusteredCacheManagerBuilder.build(true)) { CacheConfiguration<Long, String> config = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, ResourcePoolsBuilder.newResourcePoolsBuilder() .with(ClusteredResourcePoolBuilder.clusteredDedicated("primary-server-resource", 1, MemoryUnit.MB))).build(); Cache<Long, String> cache = cacheManager.createCache("clustered-cache", config); cache.put(1L, "The one"); cache.put(2L, "The two"); cache.put(1L, "Another one"); cache.put(3L, "The three"); assertThat(cache.get(1L), equalTo("Another one")); assertThat(cache.get(2L), equalTo("The two")); assertThat(cache.get(3L), equalTo("The three")); cache.put(1L, buildLargeString(2)); assertThat(cache.get(1L), is(nullValue())); assertThat(cache.get(2L), equalTo("The two")); assertThat(cache.get(3L), equalTo("The three")); } }
Source:
private MetricName partitionPreferredReadReplicaMetricName(TopicPartition tp) { Map<String, String> metricTags = new HashMap<>(2); metricTags.put("topic", tp.topic().replace('.', '_')); metricTags.put("partition", String.valueOf(tp.partition())); return this.metrics.metricInstance(metricsRegistry.partitionPreferredReadReplica, metricTags); }

Target:
private MetricName partitionPreferredReadReplicaMetricName(TopicPartition tp) { Map<String, String> metricTags = topicPartitionTags(tp); return this.metrics.metricInstance(metricsRegistry.partitionPreferredReadReplica, metricTags); }
Source:
public void testParse() { assertEquals(Optional.of(ASSIGNEE), parse("assignee")); assertFalse(parse("malformed").isPresent()); assertFalse(parse("").isPresent()); assertFalse(parse(null).isPresent()); }

Target:
public void testParse() { assertEquals(Optional.of(ASSIGNEE), parse("assignee")); assertFalse(parse("malformed").isPresent()); assertFalse(parse("").isPresent()); assertFalse(parse(null).isPresent()); assertFalse(parse("empty").isPresent()); assertFalse(parse("false").isPresent()); assertFalse(parse("keyword").isPresent()); }
Source:
public Datum eval(Tuple params) { Datum valueDatum = params.get(0); Datum roundDatum = params.get(1); if(valueDatum instanceof NullDatum || roundDatum instanceof NullDatum) { return NullDatum.get(); } double value = valueDatum.asFloat8(); int rountPoint = roundDatum.asInt4(); if (Double.isNaN(value)) { throw new InvalidOperationException("value is not a number"); } if (Double.isInfinite(value)) { throw new InvalidOperationException("/ by zero"); } try { return DatumFactory.createFloat8(BigDecimal.valueOf(value).setScale(rountPoint, RoundingMode.HALF_UP).doubleValue()); } catch (Exception e) { throw new InvalidOperationException("RoundFloat8 eval error cause " + e.getMessage() + ", value=" + value + ", round point=" + rountPoint); } }

Target:
public Datum eval(Tuple params) { Datum valueDatum = params.get(0); Datum roundDatum = params.get(1); if(valueDatum instanceof NullDatum || roundDatum instanceof NullDatum) { return NullDatum.get(); } double value = valueDatum.asFloat8(); int rountPoint = roundDatum.asInt4(); if (Double.isNaN(value)) { throw new InvalidOperationException("value is not a number."); } if (Double.isInfinite(value)) { throw new InvalidOperationException("value is infinite."); } try { return DatumFactory.createFloat8(BigDecimal.valueOf(value).setScale(rountPoint, RoundingMode.HALF_UP).doubleValue()); } catch (Exception e) { throw new InvalidOperationException("RoundFloat8 eval error cause " + e.getMessage() + ", value=" + value + ", round point=" + rountPoint); } }
Source:
void considerDetachedPlugin(String shortName) { if (new File(rootDir, shortName + ".jpi").isFile() || new File(rootDir, shortName + ".hpi").isFile() || new File(rootDir, shortName + ".jpl").isFile() || new File(rootDir, shortName + ".hpl").isFile()) { LOGGER.fine(() -> "not considering loading a detached dependency " + shortName + " as it is already on disk"); return; } LOGGER.finer(() -> "considering loading a detached dependency " + shortName); for (String loadedFile : loadPluginsFromWar("/WEB-INF/detached-plugins", (dir, name) -> normalisePluginName(name).equals(shortName))) { String loaded = normalisePluginName(loadedFile); File arc = new File(rootDir, loaded + ".jpi"); LOGGER.finer(() -> "Loading a detached plugin as a dependency: " + arc); try { plugins.add(strategy.createPluginWrapper(arc)); } catch (IOException e) { failedPlugins.add(new FailedPlugin(arc.getName(), e)); } } }

Target:
void considerDetachedPlugin(String shortName) { if (new File(rootDir, shortName + ".jpi").isFile() || new File(rootDir, shortName + ".hpi").isFile() || new File(rootDir, shortName + ".jpl").isFile() || new File(rootDir, shortName + ".hpl").isFile()) { LOGGER.fine(() -> "not considering loading a detached dependency " + shortName + " as it is already on disk"); return; } LOGGER.fine(() -> "considering loading a detached dependency " + shortName); for (String loadedFile : loadPluginsFromWar("/WEB-INF/detached-plugins", (dir, name) -> normalisePluginName(name).equals(shortName))) { String loaded = normalisePluginName(loadedFile); File arc = new File(rootDir, loaded + ".jpi"); LOGGER.info(() -> "Loading a detached plugin as a dependency: " + arc); try { plugins.add(strategy.createPluginWrapper(arc)); } catch (IOException e) { failedPlugins.add(new FailedPlugin(arc.getName(), e)); } } }
Source:
restartRadio() { Log.d(LOG_TAG, "************TURN OFF RADIO**************"); cleanUpConnection(true, Phone.REASON_RADIO_TURNED_OFF); phone.mCM.setRadioPower(false, null); int reset = Integer.parseInt(SystemProperties.get("net.ppp.reset-by-timeout", "0")); SystemProperties.set("net.ppp.reset-by-timeout", String.valueOf(reset+1)); }

Target:
protected void restartRadio() { Log.d(LOG_TAG, "************TURN OFF RADIO**************"); cleanUpConnection(true, Phone.REASON_RADIO_TURNED_OFF); phone.mCM.setRadioPower(false, null); }
Source:
@Override public int getRuntime(PreferenceManager pm) { if (getMax_runtime() != null && !getMax_runtime().equals(PreferenceManager.MAX_RUNTIME_DISABLED)) return 30 + getMax_runtime(); else if (getInputs() != null) return 30 + getInputs().size() * super.getRuntime(pm); else if(pm.isMaxRuntimeEnabled()) return 30 + pm.getMaxRuntime(); else return PreferenceManager.MAX_RUNTIME_DISABLED; }

Target:
@Override public int getRuntime(PreferenceManager pm) { if (getMax_runtime() != null && getMax_runtime() > PreferenceManager.MAX_RUNTIME_DISABLED) return 30 + getMax_runtime(); else if (getInputs() != null) return 30 + getInputs().size() * super.getRuntime(pm); else if(pm.isMaxRuntimeEnabled()) return 30 + pm.getMaxRuntime(); else return PreferenceManager.MAX_RUNTIME_DISABLED; }
Source:
private void emitThisParameter(FunctionType ftype, Iterator<Node> parameters) { final JSType typeOfThis = ftype.getTypeOfThis(); if (typeOfThis != null && !ftype.isConstructor()) { final JSDocInfo jsDocInfo = ftype.getJSDocInfo(); if (typeOfThis.isTemplateType() || (jsDocInfo != null && jsDocInfo.getThisType() != null)) { emitNoSpace("this :"); visitType(typeOfThis); if (parameters.hasNext()) { emit(", "); } } } }

Target:
private void emitThisParameter(FunctionType ftype, Iterator<Node> parameters) { final JSType typeOfThis = ftype.getTypeOfThis(); if (typeOfThis == null || ftype.isConstructor()) { return; } final JSDocInfo jsDocInfo = ftype.getJSDocInfo(); if (!typeOfThis.isTemplateType() && (jsDocInfo == null || jsDocInfo.getThisType() == null)) { return; } emitNoSpace("this :"); visitType(typeOfThis); if (parameters.hasNext()) { emit(", "); } }
Source:
int deliver(String urlString, JsonStream.Streamable streamable, Map<String, String> headers) throws DeliveryFailureException { checkHasNetworkConnection(); HttpURLConnection conn = null; try { URL url = new URL(urlString); conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setChunkedStreamingMode(0); conn.addRequestProperty("Content-Type", "application/json"); for (Map.Entry<String, String> entry : headers.entrySet()) { conn.addRequestProperty(entry.getKey(), entry.getValue()); } JsonStream stream = null; try { OutputStream out = conn.getOutputStream(); Charset charset = Charset.forName("UTF-8"); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, charset)); stream = new JsonStream(writer); streamable.toStream(stream); } finally { IOUtils.closeQuietly(stream); } return conn.getResponseCode(); } catch (IOException exception) { throw new DeliveryFailureException("IOException encountered in request", exception); } catch (Exception exception) { Logger.warn("Unexpected error delivering payload", exception); return HTTP_BAD_REQUEST; } finally { IOUtils.close(conn); } }

Target:
int deliver(String urlString, JsonStream.Streamable streamable, Map<String, String> headers) throws DeliveryFailureException { checkHasNetworkConnection(); HttpURLConnection conn = null; try { URL url = new URL(urlString); conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setChunkedStreamingMode(0); conn.addRequestProperty("Content-Type", "application/json"); for (Map.Entry<String, String> entry : headers.entrySet()) { conn.addRequestProperty(entry.getKey(), entry.getValue()); } JsonStream stream = null; try { OutputStream out = conn.getOutputStream(); Charset charset = Charset.forName("UTF-8"); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, charset)); stream = new JsonStream(writer); streamable.toStream(stream); } finally { IOUtils.closeQuietly(stream); } return conn.getResponseCode(); } catch (IOException exception) { throw new DeliveryFailureException("IOException encountered in request", exception); } catch (Exception exception) { Logger.warn("Unexpected error delivering payload", exception); return HTTP_REQUEST_FAILED; } finally { IOUtils.close(conn); } }
Source:
private void cloneMetaData(CharSequence tableName, CharSequence root, CharSequence backupRoot, int mkDirMode, TableReader reader) { path.of(backupRoot).concat(tableName).put(Files.SEPARATOR).$(); if (ff.exists(path)) { throw CairoException.instance(0).put("Backup dir for table \"").put(tableName).put("\" already exists [dir=").put(path).put(']'); } if (ff.mkdirs(path, mkDirMode) != 0) { throw CairoException.instance(ff.errno()).put("Could not create [dir=").put(path).put(']'); } TableReaderMetadata sourceMetaData = (TableReaderMetadata) reader.getMetadata(); int rootLen = path.length(); try { mem.of(ff, path.trimTo(rootLen).concat(TableUtils.META_FILE_NAME).$(), ff.getPageSize()); sourceMetaData.cloneTo(mem); path.trimTo(rootLen).$(); int symbolMapCount = 0; for (int i = 0; i < sourceMetaData.getColumnCount(); i++) { if (sourceMetaData.getColumnType(i) == ColumnType.SYMBOL) { SymbolMapReader mapReader = reader.getSymbolMapReader(i); SymbolMapWriter.createSymbolMapFiles(ff, mem, path, sourceMetaData.getColumnName(i), mapReader.getSymbolCapacity(), mapReader.isCached()); symbolMapCount++; } } mem.of(ff, path.trimTo(rootLen).concat(TableUtils.TXN_FILE_NAME).$(), ff.getPageSize()); TableUtils.resetTxn(mem, symbolMapCount, 0L, TableUtils.INITIAL_TXN); } finally { mem.close(); } }

Target:
private void cloneMetaData(CharSequence tableName, CharSequence root, CharSequence backupRoot, int mkDirMode, TableReader reader) { path.of(backupRoot).concat(tableName).put(Files.SEPARATOR).$(); if (ff.exists(path)) { throw CairoException.instance(0).put("Backup dir for table \"").put(tableName).put("\" already exists [dir=").put(path).put(']'); } if (ff.mkdirs(path, mkDirMode) != 0) { throw CairoException.instance(ff.errno()).put("Could not create [dir=").put(path).put(']'); } TableReaderMetadata sourceMetaData = (TableReaderMetadata) reader.getMetadata(); int rootLen = path.length(); try { mem.of(ff, path.trimTo(rootLen).concat(TableUtils.META_FILE_NAME).$(), ff.getPageSize()); sourceMetaData.cloneTo(mem); path.trimTo(rootLen).$(); int symbolMapCount = 0; for (int i = 0, sz = sourceMetaData.getColumnCount(); i < sz; i++) { if (sourceMetaData.getColumnType(i) == ColumnType.SYMBOL) { SymbolMapReader mapReader = reader.getSymbolMapReader(i); SymbolMapWriter.createSymbolMapFiles(ff, mem, path, sourceMetaData.getColumnName(i), mapReader.getSymbolCapacity(), mapReader.isCached()); symbolMapCount++; } } mem.of(ff, path.trimTo(rootLen).concat(TableUtils.TXN_FILE_NAME).$(), ff.getPageSize()); TableUtils.resetTxn(mem, symbolMapCount, 0L, TableUtils.INITIAL_TXN); } finally { mem.close(); } }
Source:
public void close() throws IOException { if (!closed.compareAndSet(false, true)) { log.warn(new ISE("Already Closed!"), "Already closed"); return; } if (objects.size() < objectsCacheSize && !objects.offer(object)) { log.warn(new ISE("Queue offer failed"), "Could not offer object [%s] back into the queue", object); } }

Target:
public void close() throws IOException { if (!closed.compareAndSet(false, true)) { log.warn(new ISE("Already Closed!"), "Already closed"); return; } if (objects.size() < objectsCacheMaxCount) { if (!objects.offer(object)) { log.warn(new ISE("Queue offer failed"), "Could not offer object [%s] back into the queue", object); } } else { log.debug("cache num entries is exceeding max limit [%s]", objectsCacheMaxCount); } }
Source:
void addPartitionToFaultZone(String faultZoneId, String resourceName, String partition) { if (!_assignmentForFaultZoneMap.containsKey(faultZoneId)) { _assignmentForFaultZoneMap.put(faultZoneId, new HashMap<>()); } if (!_assignmentForFaultZoneMap.get(faultZoneId).containsKey(resourceName)) { _assignmentForFaultZoneMap.get(faultZoneId).put(resourceName, new HashSet<>()); } _assignmentForFaultZoneMap.get(faultZoneId).get(resourceName).add(partition); }

Target:
void addPartitionToFaultZone(String faultZoneId, String resourceName, String partition) { if (!_assignmentForFaultZoneMap.computeIfAbsent(faultZoneId, k -> new HashMap<>()) .computeIfAbsent(resourceName, k -> new HashSet<>()).add(partition)) { throw new HelixException(String .format("Resource %s already has a replica from partition %s in fault zone %s", resourceName, partition, faultZoneId)); } }
Source:
protected List<RowMap> getRowsForSQLTransactional(final String[] input) throws Exception { MaxwellTestSupportCallback callback = getMaxwellTestSupportCallback(input); return MaxwellTestSupport.getRowsWithReplicator(server, null, callback, null); }

Target:
protected List<RowMap> getRowsForSQLTransactional(final String[] input) throws Exception { return getRowsForSQLTransactional(input, null, null); }
Source:
public static ImmutableSortedSet<String> hosts(int...ports) { if (ports.length == 0) { return ImmutableSortedSet.of( HostAndPort.fromParts("", DEFAULT_INTERNAL_PORT).toString()); } ImmutableSortedSet.Builder<String> sbld = ImmutableSortedSet.naturalOrder(); for (int p: ports) { sbld.add(HostAndPort.fromParts("", p).toString()); } return sbld.build(); }

Target:
public static ImmutableSortedSet<String> hosts(int...ports) { if (ports.length == 0) { return ImmutableSortedSet.of( HostAndPort.fromParts("", Constants.DEFAULT_INTERNAL_PORT).toString()); } ImmutableSortedSet.Builder<String> sbld = ImmutableSortedSet.naturalOrder(); for (int p: ports) { sbld.add(HostAndPort.fromParts("", p).toString()); } return sbld.build(); }
Source:
public Double getAggregate() { if (count == 0) { return null; } return stddev; }

Target:
public Double getAggregate() { return stats.stddev(); }
Source:
public void :testSequentialIntegerDataSequence() throws Exception { XMLConfigParser parser = new XMLConfigParser(matcherScenario); DataModel model = parser.getDataModels().get(0); WriteWorkload loader = new WriteWorkload(parser); RulesApplier rulesApplier = loader.getRulesApplier(); Column targetColumn = null; for (Column column : model.getDataMappingColumns()) { DataSequence sequence = column.getDataSequence(); if (DataTypeMapping.INTEGER.equals(column.getType()) && sequence == DataSequence.SEQUENTIAL) { targetColumn = column; break; } } assertNotNull("Could not find a DataSequence.SEQENTIAL rule.", targetColumn); assertMultiThreadedIncrementValue(targetColumn, rulesApplier); }

Target:
public void testSequentialIntegerDataSequence() throws Exception { XMLConfigParser parser = new XMLConfigParser(matcherScenario); DataModel model = parser.getDataModels().get(0); WriteWorkload loader = new WriteWorkload(parser); RulesApplier rulesApplier = loader.getRulesApplier(); Column targetColumn = null; for (Column column : model.getDataMappingColumns()) { DataSequence sequence = column.getDataSequence(); if (DataTypeMapping.INTEGER.equals(column.getType()) && sequence == DataSequence.SEQUENTIAL) { targetColumn = column; break; } } assertNotNull("Could not find a DataSequence.SEQENTIAL rule.", targetColumn); assertMultiThreadedIncrementValue(targetColumn, rulesApplier); }
Source:
public BufferedReader getInput() throws IOException { StringBuilder buffer = new StringBuilder(); for (String current : inputList) { buffer.append(current).append('\n'); } BufferedReader br = new BufferedReader(new StringReader(buffer.toString())); return br; }

Target:
public BufferedReader getInput() throws IOException { return new BufferedReader(new StringReader(testString)); }