auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void configureUriWithUsernameAndPasswordWhenUsernameAndPasswordPropertiesSet() { this.contextRunner.withUserConfiguration(CredentialsProviderConfiguration.class) .withPropertyValues("spring.elasticsearch.rest.uris=http://user:password@localhost:9200,localhost:9201", "spring.elasticsearch.rest.username=admin", "spring.elasticsearch.rest.password=admin") .run((context) -> { RestClient client = context.getBean(RestClient.class); assertThat(client.getNodes().stream().map(Node::getHost).map(HttpHost::toString)) .containsExactly("http://localhost:9200", "http://localhost:9201"); CredentialsProvider credentialsProvider = context.getBean(CredentialsProvider.class); Credentials uriCredentials = credentialsProvider.getCredentials(new AuthScope("localhost", 9200)); assertThat(uriCredentials.getUserPrincipal().getName()).isEqualTo("user"); assertThat(uriCredentials.getPassword()).isEqualTo("password"); Credentials defaultCredentials = credentialsProvider .getCredentials(new AuthScope("localhost", 9201)); assertThat(defaultCredentials.getUserPrincipal().getName()).isEqualTo("admin"); assertThat(defaultCredentials.getPassword()).isEqualTo("admin"); }); }

Target:
void configureUriWithUsernameAndPasswordWhenUsernameAndPasswordPropertiesSet() { this.contextRunner .withPropertyValues("spring.elasticsearch.rest.uris=http://user:password@localhost:9200,localhost:9201", "spring.elasticsearch.rest.username=admin", "spring.elasticsearch.rest.password=admin") .run((context) -> { RestClient client = context.getBean(RestClient.class); assertThat(client.getNodes().stream().map(Node::getHost).map(HttpHost::toString)) .containsExactly("http://localhost:9200", "http://localhost:9201"); assertThat(client).extracting("client") .extracting("credentialsProvider", InstanceOfAssertFactories.type(CredentialsProvider.class)) .satisfies((credentialsProvider) -> { Credentials uriCredentials = credentialsProvider .getCredentials(new AuthScope("localhost", 9200)); assertThat(uriCredentials.getUserPrincipal().getName()).isEqualTo("user"); assertThat(uriCredentials.getPassword()).isEqualTo("password"); Credentials defaultCredentials = credentialsProvider .getCredentials(new AuthScope("localhost", 9201)); assertThat(defaultCredentials.getUserPrincipal().getName()).isEqualTo("admin"); assertThat(defaultCredentials.getPassword()).isEqualTo("admin"); }); }); }
Source:
public static void computePermissions() throws IOException { final File tempDir = com.google.common.io.Files.createTempDir(); final File newFile = new File(tempDir, "blah"); assertThat(newFile.createNewFile(), is(true)); if (!isPosixSupported(newFile)) { return; } DEFAULT_GIVEN_PERMISSIONS = Files.getPosixFilePermissions(newFile.toPath()); }

Target:
public static void computePermissions() throws IOException { final File tempDir = tmp.newFolder(); final File newFile = new File(tempDir, "blah"); assertThat(newFile.createNewFile(), is(true)); if (!isPosixSupported(newFile)) { return; } DEFAULT_GIVEN_PERMISSIONS = Files.getPosixFilePermissions(newFile.toPath()); }
Source:
public void handleQueueItemsUntilEmpty() { if (cancelled.get()) { return; } if (handler == null) { logger.warning("No handler set, the reading will not start."); return; } synchronized (syncRoot) { if ((readerFuture == null || readerFuture.isDone()) && (delayedFuture == null || delayedFuture.isDone())) { readerFuture = executor.submit(reader); } } }

Target:
public void handleQueueItemsUntilEmpty() { synchronized (syncRoot) { if (readerFuture == null || readerFuture.isDone()) { rescheduleReader(); } } }
Source:
public void updateErrorRate(long val, String message, Exception e) { if (!StringUtils.isEmpty(message)) { LOG.error("updateErrorRate with message: " + message, e); } _errorRate.mark(val); _aggregatedErrorRate.mark(val); }

Target:
public void updateErrorRate(long val, String message, Exception e) { if (!StringUtils.isEmpty(message)) { _errorLogger.error("updateErrorRate with message: " + message, e); } _errorRate.mark(val); _aggregatedErrorRate.mark(val); }
Source:
public void onMessageFrame(int channelId, WebSocketMessage message, Initiator initiator) { WebSocketProxy proxy = extension.getWebSocketProxy(channelId); if (proxy.isAllowAPI()) { return; } if (message.isFinished) { Map<String, String> map = new HashMap<String, String>(); map.put(FIELD_CHANNEL_ID, Integer.toString(channelId)); map.put(FIELD_TIME_IN_MS, Long.toString(message.getTimestamp().getTime())); map.put(FIELD_OP_CODE, Integer.toString(message.getOpcode())); map.put(FIELD_OP_CODE_STRING, message.getOpcodeString()); map.put(FIELD_DIRECTION, message.getDirection().name()); map.put(FIELD_MSG_ID, Integer.toString(message.getMessageId())); map.put(FIELD_LENGTH, Integer.toString(message.getPayloadLength())); if (message.isText()) { String txt = message.getReadablePayload(); if (txt.length() > 1024) { txt = txt.substring(0, 1024); } map.put(FIELD_MSG_SUMMARY, txt); } else { StringBuilder sb = new StringBuilder(); for (byte b : message.getPayload()) { sb.append(String.format("%02X ", b)); if (sb.length() > 1024) { break; } } map.put(FIELD_MSG_SUMMARY, sb.toString()); } Runnable runnableTask = () -> { ZAP.getEventBus().publishSyncEvent( this, new Event(this, EVENT_MESSAGE, null, map)); }; this.executor.execute(runnableTask); } }

Target:
public void onMessageFrame(int channelId, WebSocketMessage message, Initiator initiator) { WebSocketProxy proxy = extension.getWebSocketProxy(channelId); if (proxy.isAllowAPI()) { return; } if (message.isFinished) { this.executor.execute(() -> { Map<String, String> map = new HashMap<String, String>(); map.put(FIELD_CHANNEL_ID, Integer.toString(channelId)); map.put(FIELD_TIME_IN_MS, Long.toString(message.getTimestamp().getTime())); map.put(FIELD_OP_CODE, Integer.toString(message.getOpcode())); map.put(FIELD_OP_CODE_STRING, message.getOpcodeString()); map.put(FIELD_DIRECTION, message.getDirection().name()); map.put(FIELD_MSG_ID, Integer.toString(message.getMessageId())); map.put(FIELD_LENGTH, Integer.toString(message.getPayloadLength())); if (message.isText()) { String txt = message.getReadablePayload(); if (txt.length() > 1024) { txt = txt.substring(0, 1024); } map.put(FIELD_MSG_SUMMARY, txt); } else { StringBuilder sb = new StringBuilder(); for (byte b : message.getPayload()) { sb.append(String.format("%02X ", b)); if (sb.length() > 1024) { break; } } map.put(FIELD_MSG_SUMMARY, sb.toString()); } ZAP.getEventBus().publishSyncEvent( this, new Event(this, EVENT_MESSAGE, null, map)); }); } }
Source:
public EvalTypeId(IType type, IBinding templateDefinition, ICPPEvaluation... arguments) { super(templateDefinition); Assert.isNotNull(arguments); fInputType= type; fArguments= arguments; }

Target:
public EvalTypeId(IType type, IBinding templateDefinition, ICPPEvaluation... arguments) { super(templateDefinition); if (arguments==null) throw new NullPointerException("arguments"); fInputType= type; fArguments= arguments; }
Source:
public static CtfTmfEvent createEvent(EventDefinition eventDef, String fileName, CtfTmfTrace originTrace) { long ts = eventDef.getTimestamp(); CtfTmfTimestamp timestamp = (CtfTmfTimestamp)originTrace.createTimestamp(originTrace.getCTFTrace().timestampCyclesToNanos(ts)); int sourceCPU = eventDef.getCPU(); ITmfEventField content = new TmfEventField( ITmfEventField.ROOT_FIELD_ID, null, parseFields(eventDef)); String reference = fileName == null ? CtfTmfEvent.NO_STREAM : fileName; CtfTmfEvent event = new CtfTmfEvent( originTrace, ITmfContext.UNKNOWN_RANK, timestamp, content, reference, sourceCPU, eventDef.getDeclaration() ); return event; }

Target:
public static CtfTmfEvent createEvent(EventDefinition eventDef, String fileName, CtfTmfTrace originTrace) { long ts = eventDef.getTimestamp(); CtfTmfTimestamp timestamp = originTrace.createTimestamp(originTrace.getCTFTrace().timestampCyclesToNanos(ts)); int sourceCPU = eventDef.getCPU(); ITmfEventField content = new TmfEventField( ITmfEventField.ROOT_FIELD_ID, null, parseFields(eventDef)); String reference = fileName == null ? CtfTmfEvent.NO_STREAM : fileName; CtfTmfEvent event = new CtfTmfEvent( originTrace, ITmfContext.UNKNOWN_RANK, timestamp, content, reference, sourceCPU, eventDef.getDeclaration() ); return event; }
Source:
private static void verifyInputFile(Map<String, List<String>> allTests, boolean skipFileNaming, String path, String fileName) { List<String> classes; int slash = path.lastIndexOf(File.separatorChar); String packge = path.substring(0, slash); boolean found = false; for (int depth = 0; depth < 4; depth++) { final String folderPath = packge; slash = packge.lastIndexOf(File.separatorChar); if (slash != -1) { packge = path.substring(0, slash); } classes = allTests.get(packge); if (classes != null && checkInputMatchCorrectFileStructure(classes, folderPath, skipFileNaming, fileName)) { found = true; break; } } if (!skipFileNaming) { assertTrue(found, "Resource must be named after a Test like 'InputMyCustomCase.java' " + "and be in the sub-package of the test like 'mycustom' " + "for test 'MyCustomCheckTest': " + path); } }

Target:
private static void verifyInputFile(Map<String, List<String>> allTests, boolean skipFileNaming, String path, String fileName) { List<String> classes; int slash = path.lastIndexOf(File.separatorChar); String packge = path.substring(0, slash); boolean found = false; for (int depth = 0; depth < 4; depth++) { final String folderPath = packge; slash = packge.lastIndexOf(File.separatorChar); packge = path.substring(0, slash); classes = allTests.get(packge); if (classes != null && checkInputMatchCorrectFileStructure(classes, folderPath, skipFileNaming, fileName)) { found = true; break; } } assertTrue(found, "Resource must be named after a Test like 'InputMyCustomCase.java' " + "and be in the sub-package of the test like 'mycustom' " + "for test 'MyCustomCheckTest': " + path); }
Source:
private void setupFab() { fab = (FloatingActionButton) findViewById(R.id.fab); chatBox = (SwipeRemoveLinearLayout) findViewById(R.id.messageBoxContainer); chatBox.registerToSwipeEvents(this); fabHidder = new CountDownTimer(HIDE_FAB_AFTER_SEC * 1000, HIDE_FAB_AFTER_SEC * 1000) { public void onTick(long millisUntilFinished) { } public void onFinish() { if (!isTextFieldFocused) { displayFAB(true); displayChatBox(false); } else { start(); } } }; fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { currentList.stopRecyclerViewScroll(); displayChatBox(true); displayFAB(false); fabHidder.start(); showSoftKeyboard(); if (streamActv.getText().toString().isEmpty() || streamActv.getText().toString().equals("")) { streamActv.requestFocus(); } else if (topicActv.getText().toString().isEmpty() || topicActv.getText().toString().equals("")) { topicActv.requestFocus(); } else { messageEt.requestFocus(); } } }); }

Target:
private void setupFab() { fab = (FloatingActionButton) findViewById(R.id.fab); chatBox = (SwipeRemoveLinearLayout) findViewById(R.id.messageBoxContainer); chatBox.registerToSwipeEvents(this); fabHidder = new CountDownTimer(HIDE_FAB_AFTER_SEC * 1000, HIDE_FAB_AFTER_SEC * 1000) { public void onTick(long millisUntilFinished) { } public void onFinish() { if (!isTextFieldFocused) { displayFAB(true); displayChatBox(false); } else { start(); } } }; fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { currentList.stopRecyclerViewScroll(); displayChatBox(true); displayFAB(false); fabHidder.start(); showSoftKeyboard(); checkForChatBoxFocusRequest(); } }); }
Source:
private Object[] getRoots() { if (roots == null) { List<Object> rootList = new ArrayList<Object>(); rootFolders = getRootFolders(); for (StagingFolderEntry rootFolder : rootFolders) { rootList.add(rootFolder); } if (rootFiles != null) { for (StagingEntry rootFile : rootFiles) { rootList.add(rootFile); } } roots = new Object[rootList.size()]; rootList.toArray(roots); } return roots; }

Target:
private Object[] getRoots() { if (roots == null) { List<Object> rootList = new ArrayList<Object>(); rootFolders = getRootFolders(); for (StagingFolderEntry rootFolder : rootFolders) rootList.add(rootFolder); if (rootFiles != null) { for (StagingEntry rootFile : rootFiles) rootList.add(rootFile); } roots = new Object[rootList.size()]; rootList.toArray(roots); } return roots; }
Source:
private static void askInteractively(Console console, UserInfo userInfo, Action action) { System.out.println(action); System.out.print("login: "); if (Strings.isNullOrEmpty(userInfo.getLogin())) { userInfo.setLogin(console.readLine()); } else { System.out.println(userInfo.getLogin()); } System.out.print("password: "); if ((action.isCreate() && Strings.isNullOrEmpty(userInfo.getPassword())) || (action.isUpdate() && Strings.isNullOrEmpty(userInfo.getPassword()) && userInfo.getGroups().isEmpty())) { userInfo.setPassword(new String(console.readPassword())); } else { System.out.println("*******"); } if (action.isCreate() && userInfo.getGroups().isEmpty()) { System.out.print("groups for user " + userInfo.getLogin() + ":"); String groupString = console.readLine(); userInfo.setGroups(Arrays.asList(groupString.split(","))); } }

Target:
private static void askInteractively(Console console, UserInfo userInfo, Action action) { System.out.println(action); System.out.print("login: "); if (!userInfo.isLoginSet()) { userInfo.setLogin(console.readLine()); } else { System.out.println(userInfo.getLogin()); } System.out.print("password: "); if ((action.isCreate() && !userInfo.isPasswordSet()) || (action.isUpdate() && !userInfo.isPasswordSet()) && !userInfo.isGroupSet()) { userInfo.setPassword(new String(console.readPassword())); } else { System.out.println("*******"); } if (action.isCreate() && !userInfo.isGroupSet()) { System.out.print("groups for user " + userInfo.getLogin() + ":"); String groupString = console.readLine(); userInfo.setGroups(Arrays.asList(groupString.split(","))); } }
Source:
public void append(String tempFile, String committedFile) throws ConnectException { try { acquireLease(); WALEntry key = new WALEntry(tempFile); WALEntry value = new WALEntry(committedFile); writer.append(key, value); writer.hsync(); } catch (IOException e) { close(); throw new ConnectException(e); } }

Target:
public void append(String tempFile, String committedFile) throws ConnectException { try { acquireLease(); WALEntry key = new WALEntry(tempFile); WALEntry value = new WALEntry(committedFile); writer.append(key, value); writer.hsync(); } catch (IOException e) { log.error("Error appending WAL file: {}, {}", logFile, e); close(); throw new DataException(e); } }
Source:
public void test_Provider_ConscryptOverridesBouncyCastle() throws Exception { if (StandardNames.IS_RI) { return; } Provider conscrypt = Security.getProvider("AndroidOpenSSL"); Provider bc = Security.getProvider("BC"); Set<String> conscryptAlgs = new HashSet<>(); for (Entry<Object, Object> entry : conscrypt.entrySet()) { String key = (String) entry.getKey(); if (key.contains(" ")) { continue; } if (key.startsWith("Alg.Alias.")) { continue; } conscryptAlgs.add(key); } Set<String> bcClasses = new HashSet<>(); for (String conscryptAlg : conscryptAlgs) { Provider.Service service = getService(bc, conscryptAlg); if (service != null) { bcClasses.add(service.getClassName()); } } assertTrue(bcClasses.size() > 0); Set<String> shouldBeOverriddenBcIds = new HashSet<>(); for (Entry<Object, Object> entry : bc.entrySet()) { String key = (String) entry.getKey(); if (key.contains(" ")) { continue; } if (key.startsWith("Alg.Alias.")) { key = key.substring("Alg.Alias.".length()); } Provider.Service service = getService(bc, key); if (bcClasses.contains(service.getClassName())) { shouldBeOverriddenBcIds.add(key); } } Set<String> nonOverriddenIds = new TreeSet<>(); for (String shouldBeOverridenBcId : shouldBeOverriddenBcIds) { if (getService(conscrypt, shouldBeOverridenBcId) == null) { nonOverriddenIds.add(shouldBeOverridenBcId); } } assertTrue("Conscrypt does not provide IDs " + nonOverriddenIds + ", but it does provide other IDs that point to the same implementation(s)" + " in BouncyCastle.", nonOverriddenIds.isEmpty()); }

Target:
public void test_Provider_ConscryptOverridesBouncyCastle() throws Exception { if (StandardNames.IS_RI) { return; } Provider conscrypt = Security.getProvider("AndroidOpenSSL"); Provider bc = Security.getProvider("BC"); Set<String> conscryptAlgs = new HashSet<>(); for (Entry<Object, Object> entry : conscrypt.entrySet()) { String key = (String) entry.getKey(); if (key.contains(" ")) { continue; } if (key.startsWith("Alg.Alias.")) { continue; } conscryptAlgs.add(key); } Set<String> bcClasses = new HashSet<>(); for (String conscryptAlg : conscryptAlgs) { Provider.Service service = getService(bc, conscryptAlg); if (service != null) { bcClasses.add(service.getClassName()); } } assertTrue(bcClasses.size() > 0); Set<String> shouldBeOverriddenBcIds = new HashSet<>(); for (Object keyObject : bc.keySet()) { String key = (String) keyObject; if (key.contains(" ")) { continue; } if (key.startsWith("Alg.Alias.")) { key = key.substring("Alg.Alias.".length()); } Provider.Service service = getService(bc, key); if (bcClasses.contains(service.getClassName())) { shouldBeOverriddenBcIds.add(key); } } assertTrue(shouldBeOverriddenBcIds.size() > 0); Set<String> nonOverriddenIds = new TreeSet<>(); for (String shouldBeOverridenBcId : shouldBeOverriddenBcIds) { if (getService(conscrypt, shouldBeOverridenBcId) == null) { nonOverriddenIds.add(shouldBeOverridenBcId); } } assertTrue("Conscrypt does not provide IDs " + nonOverriddenIds + ", but it does provide other IDs that point to the same implementation(s)" + " in BouncyCastle.", nonOverriddenIds.isEmpty()); }
Source:
public void testSTIsClosed() throws Exception { assertQuery("select st_is_closed(st_geometry_from_text('linestring(1 1, 2 2, 1 3, 1 1)'))", "select true"); }

Target:
public void testSTIsClosed() throws Exception { assertFunction("ST_IsClosed(ST_GeometryFromText('LINESTRING (1 1, 2 2, 1 3, 1 1)'))", BOOLEAN, true); assertFunction("ST_IsClosed(ST_GeometryFromText('LINESTRING (1 1, 2 2, 1 3)'))", BOOLEAN, false); assertInvalidFunction("ST_IsClosed(ST_GeometryFromText('POLYGON ((1 1, 1 4, 4 4, 4 1))'))", "ST_IsClosed only applies to LINE_STRING or MULTI_LINE_STRING. Input type is: POLYGON"); }
Source:
private View createCheckableAction(CarMenuItem item) { Context context = getContext(); Switch switchWidget = new Switch(context); switchWidget.setEnabled(item.isEnabled()); switchWidget.setChecked(item.isChecked()); switchWidget.setScaleX(mSwitchScale); switchWidget.setScaleY(mSwitchScale); switchWidget.setPadding(mActionButtonPadding, 0, mActionButtonPadding, 0); CharSequence title = item.getTitle(); if (title == null || TextUtils.isEmpty(title)) { switchWidget.setOnCheckedChangeListener((b, isChecked) -> { item.setChecked(isChecked); CarMenuItem.OnClickListener itemOnClickListener = item.getOnClickListener(); if (itemOnClickListener != null) { itemOnClickListener.onClick(item); } }); return switchWidget; } else { LinearLayout linearLayout = new LinearLayout(context); linearLayout.setGravity(Gravity.CENTER_VERTICAL); linearLayout.setOnClickListener((v -> { if (!item.isEnabled()) { return; } switchWidget.toggle(); item.setChecked(switchWidget.isChecked()); CarMenuItem.OnClickListener itemOnClickListener = item.getOnClickListener(); if (itemOnClickListener != null) { itemOnClickListener.onClick(item); } })); switchWidget.setClickable(false); Button button = new Button( new ContextThemeWrapper(context, item.getStyleResId()), null, 0); button.setText(title); button.setBackgroundResource(0); linearLayout.addView(switchWidget); linearLayout.addView(button); return linearLayout; } }

Target:
private View createCheckableAction(CarMenuItem item) { ViewGroup checkableAction = (ViewGroup) LayoutInflater.from(getContext()) .inflate(R.layout.checkable_action_item, this, false); Switch switchWidget = checkableAction.findViewById(R.id.switch_widget); switchWidget.setEnabled(item.isEnabled()); switchWidget.setChecked(item.isChecked()); switchWidget.setScaleX(mSwitchScale); switchWidget.setScaleY(mSwitchScale); checkableAction.setOnClickListener(b -> { if (!item.isEnabled()) { return; } switchWidget.toggle(); item.setChecked(switchWidget.isChecked()); CarMenuItem.OnClickListener itemOnClickListener = item.getOnClickListener(); if (itemOnClickListener != null) { itemOnClickListener.onClick(item); } }); CharSequence title = item.getTitle(); if (!(title == null || TextUtils.isEmpty(title))) { Button button = new Button(new ContextThemeWrapper(getContext(), item.getStyleResId()), null, 0); button.setText(title); button.setBackgroundResource(0); checkableAction.addView(button); } return checkableAction; }
Source:
public String getName() { return "STATIC"; }

Target:
public String getName() { return "SQL"; }
Source:
public StreamsAddressRequest(ByteBuf buf) { this.reqType = ICorfuPayload.fromBuffer(buf, Byte.class); this.beforeCompactionMark = ICorfuPayload.fromBuffer(buf, Boolean.class); if (reqType == STREAMS) { this.streamsRanges = ICorfuPayload.listFromBuffer(buf, StreamAddressRange.class); } else { this.streamsRanges = Collections.EMPTY_LIST; } }

Target:
public StreamsAddressRequest(ByteBuf buf) { this.reqType = ICorfuPayload.fromBuffer(buf, Byte.class); this.forSequencerTrim = ICorfuPayload.fromBuffer(buf, Boolean.class); if (reqType == STREAMS) { this.streamsRanges = ICorfuPayload.listFromBuffer(buf, StreamAddressRange.class); } else { this.streamsRanges = Collections.emptyList(); } }
Source:
public synchronized void flush() throws IOException { checkFlushException(); for (int i = 1; i <= executionOptions.getMaxRetries(); i++) { try { attemptFlush(); batchCount = 0; break; } catch (SQLException e) { LOG.error("JDBC executeBatch error, retry times = {}", i, e); if (i >= executionOptions.getMaxRetries()) { throw new IOException(e); } try { if (!connection.isValid(JdbcLookupFunction.CONNECTION_CHECK_TIMEOUT)) { connection = connectionProvider.reestablishConnection(); jdbcStatementExecutor.reopen(connection); } } catch (Exception excpetion) { LOG.error("JDBC connection is not valid, and reestablish connection failed.", excpetion); throw new RuntimeException("Reestablish JDBC connection failed", excpetion); } try { Thread.sleep(1000 * i); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new IOException("unable to flush; interrupted while doing another attempt", e); } } } }

Target:
public synchronized void flush() throws IOException { checkFlushException(); for (int i = 1; i <= executionOptions.getMaxRetries(); i++) { try { attemptFlush(); batchCount = 0; break; } catch (SQLException e) { LOG.error("JDBC executeBatch error, retry times = {}", i, e); if (i >= executionOptions.getMaxRetries()) { throw new IOException(e); } try { if (!connection.isValid(CONNECTION_CHECK_TIMEOUT_SECONDS)) { connection = connectionProvider.reestablishConnection(); jdbcStatementExecutor.closeStatements(); jdbcStatementExecutor.prepareStatements(connection); } } catch (Exception excpetion) { LOG.error("JDBC connection is not valid, and reestablish connection failed.", excpetion); throw new IOException("Reestablish JDBC connection failed", excpetion); } try { Thread.sleep(1000 * i); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new IOException("unable to flush; interrupted while doing another attempt", e); } } } }
Source:
public void testTaskWithEnableAutoClaimTaskWithGroupOnly() throws Exception { TestWorkItemManager manager = new TestWorkItemManager(); env.set("Autoclaim", new String("true")); ksession.setEnvironment(env); ksession.setWorkItemManager(manager); WorkItemImpl workItem = new WorkItemImpl(); workItem.setName("Human Task"); workItem.setParameter("NodeName", "TaskName"); workItem.setParameter("Comment", "Comment"); workItem.setParameter("Priority", "10"); workItem.setParameter("GroupId", "Crusaders"); workItem.setParameter("SwimlaneActorId", "Darth Vader"); workItem.setProcessInstanceId(10); handler.executeWorkItem(workItem, manager); List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK"); assertEquals(1, tasks.size()); TaskSummary task = tasks.get(0); assertEquals("TaskName", task.getName()); assertEquals(10, task.getPriority().intValue()); assertEquals("Comment", task.getDescription()); assertEquals(Status.Reserved, task.getStatus()); assertEquals("Darth Vader", task.getActualOwner().getId()); assertEquals(10, task.getProcessInstanceId().intValue()); taskService.start(task.getId(), "Darth Vader"); taskService.complete(task.getId(), "Darth Vader", null); assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME)); }

Target:
public void testTaskWithEnableAutoClaimTaskWithGroupOnly() throws Exception { TestWorkItemManager manager = new TestWorkItemManager(); env.set("Autoclaim", "true"); ksession.setEnvironment(env); ksession.setWorkItemManager(manager); WorkItemImpl workItem = new WorkItemImpl(); workItem.setName("Human Task"); workItem.setParameter("NodeName", "TaskName"); workItem.setParameter("Comment", "Comment"); workItem.setParameter("Priority", "10"); workItem.setParameter("GroupId", "Crusaders"); workItem.setParameter("SwimlaneActorId", "Darth Vader"); workItem.setProcessInstanceId(10); handler.executeWorkItem(workItem, manager); List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK"); assertEquals(1, tasks.size()); TaskSummary task = tasks.get(0); assertEquals("TaskName", task.getName()); assertEquals(10, task.getPriority().intValue()); assertEquals("Comment", task.getDescription()); assertEquals(Status.Reserved, task.getStatus()); assertEquals("Darth Vader", task.getActualOwner().getId()); assertEquals(10, task.getProcessInstanceId().intValue()); taskService.start(task.getId(), "Darth Vader"); taskService.complete(task.getId(), "Darth Vader", null); assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME)); }
Source:
void localize() { nameEditor.setLabel(constants.makeTemplatePopupNameLabel()); descriptionEditor.setLabel(constants.makeTemplatePopupDescriptionLabel()); commentEditor.setLabel(constants.commentLabel()); clusterEditor.setLabel(constants.makeTemplateClusterLabel()); quotaEditor.setLabel(constants.makeTemplateQuotaLabel()); isTemplatePublicEditor.setLabel(constants.makeTemplateIsTemplatePublicEditorLabel()); copyVmPermissions.setLabel(constants.copyVmPermissions()); sealTemplateEditor.setLabel(constants.sealTemplate()); disksAllocationLabel.setText(constants.disksAllocation()); isSubTemplateEditor.setLabel(constants.createAsSubTemplate()); baseTemplateEditor.setLabel(constants.rootTemplate()); templateVersionNameEditor.setLabel(constants.templateVersionName()); cpuProfilesEditor.setLabel(constants.cpuProfileLabel()); }

Target:
void localize() { nameEditor.setLabel(constants.makeTemplatePopupNameLabel()); descriptionEditor.setLabel(constants.makeTemplatePopupDescriptionLabel()); commentEditor.setLabel(constants.commentLabel()); clusterEditor.setLabel(constants.makeTemplateClusterLabel()); quotaEditor.setLabel(constants.makeTemplateQuotaLabel()); isTemplatePublicEditor.setLabel(constants.makeTemplateIsTemplatePublicEditorLabel()); copyVmPermissions.setLabel(constants.copyVmPermissions()); disksAllocationLabel.setText(constants.disksAllocation()); isSubTemplateEditor.setLabel(constants.createAsSubTemplate()); baseTemplateEditor.setLabel(constants.rootTemplate()); templateVersionNameEditor.setLabel(constants.templateVersionName()); cpuProfilesEditor.setLabel(constants.cpuProfileLabel()); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; InterfacesTag that = (InterfacesTag) o; return !(interfaces != null ? !interfaces.equals(that.interfaces) : that.interfaces != null); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; InterfacesTag that = (InterfacesTag) o; return interfaces == null ? that.interfaces == null : interfaces.equals(that.interfaces); }
Source:
public HostMaintenanceConfirmationPopupView(EventBus eventBus) { super(eventBus); latch = new EntityModelCheckBoxEditor(Align.RIGHT); latch.setLabel(constants.approveOperation()); force = new EntityModelCheckBoxEditor(Align.RIGHT); force.setLabel(constants.forceRemove()); force.getContentWidgetContainer().getElement().getStyle().setWidth(90, Unit.PCT); stopGlusterServices = new EntityModelCheckBoxEditor(Align.RIGHT); stopGlusterServices.getContentWidgetContainer().getElement().getStyle().setWidth(90, Unit.PCT); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); ViewIdHandler.idHandler.generateAndSetIds(this); localize(); driver.initialize(this); reasonPanel.setVisible(true); pinnedVMsInfoPanel.setVisible(false); pinnedVMsInfoMessage.setAlertType(AlertType.INFO); }

Target:
public HostMaintenanceConfirmationPopupView(EventBus eventBus) { super(eventBus); latch = new EntityModelCheckBoxEditor(Align.RIGHT); latch.setLabel(constants.approveOperation()); force = new EntityModelCheckBoxEditor(Align.RIGHT); force.setLabel(constants.forceRemove()); force.getContentWidgetContainer().getElement().getStyle().setWidth(90, Unit.PCT); stopGlusterServices = new EntityModelCheckBoxEditor(Align.RIGHT); stopGlusterServices.getContentWidgetContainer().getElement().getStyle().setWidth(90, Unit.PCT); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); ViewIdHandler.idHandler.generateAndSetIds(this); localize(); driver.initialize(this); pinnedVMsInfoPanel.setVisible(false); pinnedVMsInfoMessage.setAlertType(AlertType.INFO); }
Source:
public AbstractTableViewer getTableViewer() { return actionContext.getViewer(); }

Target:
protected AbstractTableViewer getTableViewer() { return actionContext.getViewer(); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } LookupExtractorFactoryContainer that = (LookupExtractorFactoryContainer) o; if (version != null ? !version.equals(that.version) : that.version != null) { return false; } return lookupExtractorFactory.equals(that.lookupExtractorFactory); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } LookupExtractorFactoryContainer that = (LookupExtractorFactoryContainer) o; return Objects.equals(version, that.version) && Objects.equals(lookupExtractorFactory, that.lookupExtractorFactory); }
Source:
public OpenMRSPatient getPatientByUuid(String uuid) { Validate.notEmpty(uuid, "Patient Id cannot be empty"); Patient patient; try { patient = patientResource.getPatientById(uuid); } catch (HttpException e) { LOGGER.error("Failed to get patient by id: " + uuid); return null; } String motechIdentifierUuid; try { motechIdentifierUuid = patientResource.getMotechPatientIdentifierUuid(); } catch (HttpException e) { LOGGER.error("There was an exception retrieving the MoTeCH Identifier Type UUID"); return null; } String motechId = null; OpenMRSFacility facility = null; Identifier motechIdentifier = patient.getIdentifierByIdentifierType(motechIdentifierUuid); if (motechIdentifier == null) { LOGGER.warn("No MoTeCH Id found on Patient with id: " + patient.getUuid()); } else { if (motechIdentifier.getLocation() != null) { facility = facilityAdapter.getFacilityByUuid(motechIdentifier.getLocation().getUuid()); } motechId = motechIdentifier.getIdentifier(); } List<Identifier> supportedIdentifierList = new ArrayList<>(); for (Identifier identifier : patient.getIdentifiers()) { IdentifierType identifierType = identifier.getIdentifierType(); if (identifierType.getUuid().equals(motechIdentifierUuid)) { continue; } else { try { String identifierName = patientResource.getPatientIdentifierName(identifierType.getUuid()); if (identifierName == null) { LOGGER.warn("The identifier with UUID is not supported", identifierType.getUuid()); } else { identifier.getIdentifierType().setName(identifierName); supportedIdentifierList.add(identifier); } } catch (HttpException e) { LOGGER.error("There was an exception retrieving the identifier with UUID {}", identifierType.getUuid()); return null; } } } return ConverterUtils.toOpenMRSPatient(patient, facility, motechId, supportedIdentifierList); }

Target:
public OpenMRSPatient getPatientByUuid(String uuid) { Validate.notEmpty(uuid, "Patient Id cannot be empty"); Patient patient; try { patient = patientResource.getPatientById(uuid); } catch (HttpException e) { LOGGER.error("Failed to get patient by id: " + uuid); return null; } String motechIdentifierUuid; try { motechIdentifierUuid = patientResource.getMotechPatientIdentifierUuid(); } catch (HttpException e) { LOGGER.error("There was an exception retrieving the MoTeCH Identifier Type UUID"); return null; } String motechId = null; OpenMRSFacility facility = null; Identifier motechIdentifier = patient.getIdentifierByIdentifierType(motechIdentifierUuid); if (motechIdentifier == null) { LOGGER.warn("No MoTeCH Id found on Patient with id: " + patient.getUuid()); } else { if (motechIdentifier.getLocation() != null) { facility = facilityAdapter.getFacilityByUuid(motechIdentifier.getLocation().getUuid()); } motechId = motechIdentifier.getIdentifier(); } List<Identifier> supportedIdentifierTypeList = getSupportedIdentifierTypeList(patient.getIdentifiers(), motechIdentifierUuid); return ConverterUtils.toOpenMRSPatient(patient, facility, motechId, supportedIdentifierTypeList); }
Source:
private ByteArrayOutputStream setUpLoggerStream() { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final WriterAppender writerAppender = new WriterAppender( new SimpleLayout(), baos ); writerAppender.setThreshold( Level.ERROR ); writerAppender.activateOptions(); Logger.getRootLogger().addAppender( writerAppender ); return baos; }

Target:
private ByteArrayOutputStream setUpLoggerStream() { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final WriterAppender appender = new WriterAppender( new SimpleLayout(), baos ); appender.setThreshold(Level.ERROR); appender.activateOptions(); Logger.getRootLogger().addAppender(appender); return baos; }
Source:
public InputStream getContent(TaskRepository repository, ITask task, TaskAttribute attachmentAttribute, IProgressMonitor monitor) throws CoreException { BugzillaClient client; try { monitor.beginTask(Messages.BugzillaTaskAttachmentHandler_Getting_attachment, IProgressMonitor.UNKNOWN); TaskAttachmentMapper attachment = TaskAttachmentMapper.createFrom(attachmentAttribute); client = connector.getClientManager().getClient(repository, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); return client.getAttachmentData(attachment.getAttachmentId(), monitor); } catch (IOException e) { throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, "Unable to retrieve attachment", e)); } finally { monitor.done(); } }

Target:
public InputStream getContent(TaskRepository repository, ITask task, TaskAttribute attachmentAttribute, IProgressMonitor monitor) throws CoreException { BugzillaClient client; try { monitor.beginTask(Messages.BugzillaTaskAttachmentHandler_Getting_attachment, IProgressMonitor.UNKNOWN); TaskAttachmentMapper attachment = TaskAttachmentMapper.createFrom(attachmentAttribute); client = connector.getClientManager().getClient(repository, monitor); return client.getAttachmentData(attachment.getAttachmentId(), monitor); } catch (IOException e) { throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, "Unable to retrieve attachment", e)); } finally { monitor.done(); } }
Source:
public Region<Object, Object> getRegion() throws IOException { if (clientCache == null && clientCache.isClosed()) { initClient(); } if (region == null) { region = clientCache.getRegion(regionName); if (region == null) { region = clientCache.<Object, Object> createClientRegionFactory(ClientRegionShortcut.PROXY).create(regionName); } } return region; }

Target:
public Region<Object, Object> getRegion() throws IOException { if (clientCache == null || clientCache.isClosed()) { initClient(); } if (region == null) { region = clientCache.getRegion(regionName); if (region == null) { region = clientCache.<Object, Object> createClientRegionFactory(ClientRegionShortcut.PROXY).create(regionName); } } return region; }
Source:
public String toString() { return "TransferStepImpl{" + "srcId='" + srcId + '\'' + ", dstId='" + dstId + '\'' + ", dataInfo=" + dataInfo + '}'; }

Target:
public String toString() { final StringBuilder sb = new StringBuilder("TransferStepImpl{"); sb.append("srcId='").append(srcId).append('\''); sb.append(", dstId='").append(dstId).append('\''); sb.append(", dataInfo=").append(dataInfo); sb.append('}'); return sb.toString(); }
Source:
void assign( Field field, AnyValue value ) { switch ( field ) { case hour: hour = assignment( field, hour, value ); break; case minute: minute = assignment( field, minute, value ); break; case second: second = assignment( field, second, value ); break; case millisecond: millisecond = assignment( field, millisecond, value ); break; case microsecond: microsecond = assignment( field, microsecond, value ); break; case nanosecond: nanosecond = assignment( field, nanosecond, value ); break; case time: case datetime: time = assignment( field, time, value ); break; default: throw new UnsupportedTemporalUnitException( "Not a time field: " + field ); } }

Target:
void assign( Field field, AnyValue value ) { switch ( field ) { case hour: hour = assignment( field, hour, value ); break; case minute: minute = assignment( field, minute, value ); break; case second: second = assignment( field, second, value ); break; case millisecond: millisecond = assignment( field, millisecond, value ); break; case microsecond: microsecond = assignment( field, microsecond, value ); break; case nanosecond: nanosecond = assignment( field, nanosecond, value ); break; case time: case datetime: time = assignment( field, time, value ); break; default: throw new IllegalStateException( "Not a time field: " + field ); } }
Source:
public void checkStateChanged(CheckStateChangedEvent event) { TmfXYChartViewer chartViewer = getChartViewer(); if (chartViewer == null) { return; } if (TmfTraceManager.getInstance().getActiveTrace() == null) { return; } ICheckable checkboxTree = event.getCheckable(); if (checkboxTree instanceof CheckboxTreeViewer) { fTriStateFilteredCheckboxTree.setSubtreeChecked(event.getElement(), event.getChecked()); Set<@NonNull Integer> quarks = new TreeSet<>(); for (Object checkedElement : fTriStateFilteredCheckboxTree.getCheckedElements()) { if (checkedElement instanceof CounterTreeViewerEntry) { quarks.add(((CounterTreeViewerEntry) checkedElement).getQuark()); } } if (chartViewer instanceof CounterChartViewer) { ((CounterChartViewer) chartViewer).updateChart(quarks); } } }

Target:
public void checkStateChanged(CheckStateChangedEvent event) { TmfXYChartViewer chartViewer = getChartViewer(); if (chartViewer == null) { return; } if (TmfTraceManager.getInstance().getActiveTrace() == null) { return; } ICheckable checkboxTree = event.getCheckable(); if (checkboxTree instanceof CheckboxTreeViewer) { Set<@NonNull Integer> quarks = new TreeSet<>(); for (Object checkedElement : fTriStateFilteredCheckboxTree.getCheckedElements()) { if (checkedElement instanceof CounterTreeViewerEntry) { quarks.add(((CounterTreeViewerEntry) checkedElement).getQuark()); } } if (chartViewer instanceof CounterChartViewer) { ((CounterChartViewer) chartViewer).updateChart(quarks); } } }
Source:
private <T> void assertBlockPositions(Block block, Supplier<BlockBuilder> newBlockBuilder, T[] expectedValues) { try { assertEquals(block.getPositionCount(), expectedValues.length); } catch (Exception e) { e.printStackTrace(); } for (int position = 0; position < block.getPositionCount(); position++) { assertBlockPosition(block, newBlockBuilder, position, expectedValues[position], expectedValues.getClass().getComponentType()); } }

Target:
private <T> void assertBlockPositions(Block block, Supplier<BlockBuilder> newBlockBuilder, T[] expectedValues) { assertEquals(block.getPositionCount(), expectedValues.length); for (int position = 0; position < block.getPositionCount(); position++) { assertBlockPosition(block, newBlockBuilder, position, expectedValues[position], expectedValues.getClass().getComponentType()); } }
Source:
public Promise<Void> setup(final DeploymentDescriptorModel model) { addWorkItemHandlerModal.setup(LibraryConstants.AddWorkItemHandler, LibraryConstants.Name, LibraryConstants.Value); if (model.getWorkItemHandlers() == null) { model.setWorkItemHandlers(new ArrayList<>()); } workItemHandlersListPresenter.setup( view.getWorkItemHandlersTable(), model.getWorkItemHandlers(), (workItemHandler, presenter) -> presenter.init(LibraryConstants.AddWorkItemHandler, LibraryConstants.Name, LibraryConstants.Value, workItemHandler, this)); return promises.resolve(); }

Target:
public Promise<Void> setup(final DeploymentDescriptorModel model) { addWorkItemHandlerModal.setup(LibraryConstants.AddWorkItemHandler, LibraryConstants.Name, LibraryConstants.Value); if (model.getWorkItemHandlers() == null) { model.setWorkItemHandlers(new ArrayList<>()); } workItemHandlersListPresenter.setup( view.getWorkItemHandlersTable(), model.getWorkItemHandlers(), (workItemHandler, presenter) -> presenter.setupSectionConfig(LibraryConstants.EditWorkItemHandler, LibraryConstants.Name, LibraryConstants.Value, workItemHandler, this)); return promises.resolve(); }
Source:
private ServerConfiguration toServerConfiguration(Node node) { return new ServerConfiguration() { @Override public InetSocketAddress getTsaPort() { return InetSocketAddress.createUnresolved(substitutor.substitute(node.getBindAddress()), node.getPort()); } @Override public InetSocketAddress getGroupPort() { int groupPort = groupPortMapper.getPeerGroupPort(node, nodeContextSupplier.get().getNode()); return InetSocketAddress.createUnresolved(substitutor.substitute(node.getGroupBindAddress()), groupPort); } @Override public String getHost() { return node.getHostname(); } @Override public String getName() { return node.getName(); } @Override public int getClientReconnectWindow() { return nodeContextSupplier.get().getCluster().getClientReconnectWindow().getExactQuantity(TimeUnit.SECONDS).intValueExact(); } @Override public File getLogsLocation() { String sanitizedNodeName = node.getName().replace(":", "-"); return (unConfigured) ? null : substitutor.substitute(pathResolver.resolve(node.getLogDir().resolve(sanitizedNodeName))).toFile(); } @Override public String toString() { return node.getName() + "@" + node.getAddress(); } }; }

Target:
private ServerConfiguration toServerConfiguration(Node node) { return new DynamicConfigServerConfiguration(node, nodeContextSupplier, substitutor, groupPortMapper, pathResolver, unConfigured); }
Source:
public static boolean returnsVoid(Method method) { return method.getReturnType().toString().equals("void"); }

Target:
public static boolean returnsVoid(Method method) { return method.getReturnType().equals(Void.TYPE); }
Source:
public long getSize(Configuration configuration) { try { if (dataset instanceof AbstractRefinableView) { return ((AbstractRefinableView) dataset).getSize(); } else if (dataset instanceof AbstractDataset) { return ((AbstractDataset) dataset).getSize(); } } catch (UnsupportedOperationException e) { } logger.warn("Cannot determine size for dataset: " + toString()); return 1000L * 1000L * 1000L; }

Target:
public long getSize(Configuration configuration) { if (view instanceof SizeAccessor) { return ((SizeAccessor) view).getSize(); } logger.warn("Cannot determine size for view: " + toString()); return 1000L * 1000L * 1000L; }
Source:
private SdxUpgradeReplaceVms shouldReplaceVmsAfterUpgrade(SdxUpgradeRequest upgradeRequest) { return Optional.ofNullable(upgradeRequest) .map(SdxUpgradeRequest::getReplaceVms) .orElse(SdxUpgradeReplaceVms.ENABLED); }

Target:
private SdxUpgradeReplaceVms shouldReplaceVmsAfterUpgrade(SdxUpgradeRequest upgradeRequest) { SdxUpgradeReplaceVms replaceVms = Optional.ofNullable(upgradeRequest) .map(SdxUpgradeRequest::getReplaceVms) .orElse(SdxUpgradeReplaceVms.ENABLED); LOGGER.debug("VM-s replacement after the upgrade process is {}", replaceVms.name()); return replaceVms; }
Source:
public Cohort(String commaSeparatedIds) { this(); for (StringTokenizer st = new StringTokenizer(commaSeparatedIds, ","); st.hasMoreTokens();) { String id = st.nextToken(); Patient pid = new Patient(Integer.valueOf(id.trim())); members.add(new CohortMembership(pid)); } }

Target:
public Cohort(String commaSeparatedIds) { this(); for (StringTokenizer st = new StringTokenizer(commaSeparatedIds, ","); st.hasMoreTokens();) { String id = st.nextToken(); Patient pid = new Patient(Integer.valueOf(id.trim())); addMembership(new CohortMembership(pid)); } }
Source:
public CorsConfiguration getCorsConfiguration(HttpServletRequest request) { String path = request.getPathInfo(); if (path.indexOf("/environments/") > -1) { int envIdStartIndex = path.indexOf("/environments/") + "/environments/".length(); String environmentId = path.substring(envIdStartIndex, path.indexOf('/', envIdStartIndex)); GraviteeCorsConfiguration corsConfiguration = corsConfigurationByEnvironment.get(environmentId); if (corsConfiguration == null) { corsConfiguration = new GraviteeCorsConfiguration(parameterService, eventManager, environmentId); this.corsConfigurationByEnvironment.put(environmentId, corsConfiguration); } return corsConfiguration; } return super.getCorsConfiguration(request); }

Target:
public CorsConfiguration getCorsConfiguration(HttpServletRequest request) { String environmentId = computeEnvironmentId(request); if (environmentId != null) { GraviteeCorsConfiguration corsConfiguration = corsConfigurationByEnvironment.get(environmentId); if (corsConfiguration == null) { corsConfiguration = new GraviteeCorsConfiguration(parameterService, eventManager, environmentId); this.corsConfigurationByEnvironment.put(environmentId, corsConfiguration); } return corsConfiguration; } return super.getCorsConfiguration(request); }
Source:
public void undoQuote() { PostgreSQLDbSupport dbSupport = new PostgreSQLDbSupport(null); assertEquals("abc", dbSupport.unQuote("\"abc\"")); assertEquals("abc", dbSupport.unQuote("abc\"")); assertEquals("abc", dbSupport.unQuote("\"abc")); assertEquals("a\"b\"c", dbSupport.unQuote("a\"b\"c")); assertEquals("a\"b\"c", dbSupport.unQuote("\"a\"b\"c")); }

Target:
public void undoQuote() { PostgreSQLDbSupport dbSupport = new PostgreSQLDbSupport(null); assertEquals("abc", dbSupport.unQuote("\"abc\"")); assertEquals("abc", dbSupport.unQuote("abc")); }
Source:
public boolean needsInput() { boolean stateNeedsInput = state == State.CONSUMING_INPUT || (state == State.SPILLING_INPUT && spillInProgress.isDone()); return stateNeedsInput && !lookupSourceFactoryDestroyed.isDone(); }

Target:
public boolean needsInput() { boolean stateNeedsInput = (state == State.CONSUMING_INPUT) || (state == State.SPILLING_INPUT && spillInProgress.isDone()); return stateNeedsInput && !lookupSourceFactoryDestroyed.isDone(); }