auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addShellOutputListener(final IHostShell shell, final IControllableServerBehavior behavior) { if( shell == null ) return; IHostShellOutputListener listener = null; listener = new IHostShellOutputListener() { public void shellOutputChanged(IHostShellChangeEvent event) { IHostOutput[] out = event.getLines(); for (int i = 0; i < out.length; i++) { if( out[i].toString().startsWith(ECHO_KEY_DISCOVER_PID)) { int lastColon = out[i].toString().lastIndexOf(DELIMETER); String pid = out[i].toString().substring(lastColon+1); behavior.putSharedData(IDeployableServerBehaviorProperties.PROCESS_ID, pid); } } } }; shell.addOutputListener(listener); }

Target:
private void addShellOutputListener(final IHostShell shell, final IControllableServerBehavior behavior) { if( shell == null ) return; IHostShellOutputListener listener = null; listener = new IHostShellOutputListener() { public void shellOutputChanged(IHostShellChangeEvent event) { IHostOutput[] out = event.getLines(); String s = null; for (int i = 0; i < out.length; i++) { s = out[i].toString(); if( s.startsWith(ECHO_KEY_DISCOVER_PID)) { int lastColon = s.lastIndexOf(DELIMETER); String pid = s.substring(lastColon+1); behavior.putSharedData(IDeployableServerBehaviorProperties.PROCESS_ID, pid); } } } }; shell.addOutputListener(listener); }
Source:
public void cleanupExpiredPools() { List<Pool> pools = poolCurator.listExpiredPools(); log.info("Expired pools: " + pools.size()); for (Pool p : pools) { if (p.hasAttribute("derived_pool")) { continue; } log.info("Cleaning up expired pool: " + p.getId() + " (" + p.getEndDate() + ")"); if (!subAdapter.isReadOnly()) { Subscription sub = subAdapter.getSubscription(p.getSubscriptionId()); if (sub != null) { subAdapter.deleteSubscription(sub); } deletePool(p); } } }

Target:
public void cleanupExpiredPools() { List<Pool> pools = poolCurator.listExpiredPools(); log.info("Expired pools: " + pools.size()); for (Pool p : pools) { if (p.hasAttribute("derived_pool")) { continue; } log.info("Cleaning up expired pool: " + p.getId() + " (" + p.getEndDate() + ")"); if (!subAdapter.isReadOnly()) { Subscription sub = subAdapter.getSubscription(p.getSubscriptionId()); if (sub != null) { subAdapter.deleteSubscription(sub); } } deletePool(p); } }
Source:
public void EditAccount_003_reopenAccount() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); EditAccount editAccount = new EditAccount(driver, testedWiki, credentials.userNameClosedAccount); editAccount.reopenAccount(credentials.passwordClosedAccount); }

Target:
public void EditAccount_003_reopenAccount() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); EditAccount editAccount = new EditAccount(driver, testedWiki, credentials.userNameClosedAccount); editAccount.reopenAccount(credentials.passwordClosedAccount); editAccount.verifyAccountReopenedMessage(); }
Source:
public TabletServers getParticipatingTabletServers(@PathParam("tableId") String tableId) throws Exception { Instance instance = Monitor.getContext().getInstance(); TreeSet<String> locs = new TreeSet<>(); if (RootTable.ID.equals(tableId)) { locs.add(instance.getRootTabletLocation()); } else { String systemTableName = MetadataTable.ID.equals(tableId) ? RootTable.NAME : MetadataTable.NAME; MetaDataTableScanner scanner = new MetaDataTableScanner(Monitor.getContext(), new Range(KeyExtent.getMetadataEntry(tableId, new Text()), KeyExtent.getMetadataEntry(tableId, null)), systemTableName); while (scanner.hasNext()) { TabletLocationState state = scanner.next(); if (state.current != null) { try { locs.add(state.current.hostPort()); } catch (Exception ex) } } scanner.close(); } TabletServers tabletServers = new TabletServers(Monitor.getMmi().tServerInfo.size()); List<TabletServerStatus> tservers = new ArrayList<>(); if (Monitor.getMmi() != null) { for (TabletServerStatus tss : Monitor.getMmi().tServerInfo) { try { if (tss.name != null && locs.contains(tss.name)) tservers.add(tss); } catch (Exception ex) { } } } for (TabletServerStatus status : tservers) { if (status == null) status = NO_STATUS; TableInfo summary = TableInfoUtil.summarizeTableStats(status); if (tableId != null) summary = status.tableMap.get(tableId); if (summary == null) continue; TabletServer tabletServerInfo = new TabletServer(); tabletServerInfo.updateTabletServerInfo(status, summary); tabletServers.addTablet(tabletServerInfo); } return tabletServers; }

Target:
public TabletServers getParticipatingTabletServers(@PathParam("tableId") String tableId) throws Exception { Instance instance = Monitor.getContext().getInstance(); TabletServers tabletServers = new TabletServers(Monitor.getMmi().tServerInfo.size()); TreeSet<String> locs = new TreeSet<>(); if (RootTable.ID.equals(tableId)) { locs.add(instance.getRootTabletLocation()); } else { String systemTableName = MetadataTable.ID.equals(tableId) ? RootTable.NAME : MetadataTable.NAME; MetaDataTableScanner scanner = new MetaDataTableScanner(Monitor.getContext(), new Range(KeyExtent.getMetadataEntry(tableId, new Text()), KeyExtent.getMetadataEntry(tableId, null)), systemTableName); while (scanner.hasNext()) { TabletLocationState state = scanner.next(); if (state.current != null) { try { locs.add(state.current.hostPort()); } catch (Exception ex) { scanner.close(); return tabletServers; } } } scanner.close(); } List<TabletServerStatus> tservers = new ArrayList<>(); if (Monitor.getMmi() != null) { for (TabletServerStatus tss : Monitor.getMmi().tServerInfo) { try { if (tss.name != null && locs.contains(tss.name)) tservers.add(tss); } catch (Exception ex) { return tabletServers; } } } for (TabletServerStatus status : tservers) { if (status == null) status = NO_STATUS; TableInfo summary = TableInfoUtil.summarizeTableStats(status); if (tableId != null) summary = status.tableMap.get(tableId); if (summary == null) continue; TabletServer tabletServerInfo = new TabletServer(); tabletServerInfo.updateTabletServerInfo(status, summary); tabletServers.addTablet(tabletServerInfo); } return tabletServers; }
Source:
public void setup() { cache = mock(InternalCache.class); command = spy(new ClearCommand()); region = mock(Region.class); dataResult = mock(DataCommandResult.class); membersList = new HashSet<DistributedMember>(); membersList.add(member); doNothing().when(command).authorize(any(), any(), anyString()); doReturn(cache).when(command).getCache(); doReturn(membersList).when(command).findAnyMembersForRegion(anyString()); ResultModel result = ResultModel.createInfo(success); doReturn(result).when(dataResult).toResultModel(); }

Target:
public void setup() { cache = mock(InternalCache.class); command = spy(new ClearCommand()); region = mock(Region.class); dataResult = mock(DataCommandResult.class); membersList = new HashSet<>(); membersList.add(member); doNothing().when(command).authorize(any(), any(), anyString()); doReturn(cache).when(command).getCache(); doReturn(membersList).when(command).findAnyMembersForRegion(anyString()); ResultModel result = ResultModel.createInfo(success); doReturn(result).when(dataResult).toResultModel(); }
Source:
public File toFile(URI fileURI, InputStream templateStream, ParamsTree<String, String> documentParams) throws ExportServiceException { File pdffile = new File(fileURI); OutputStream out; try { out = new FileOutputStream(pdffile); out = new java.io.BufferedOutputStream(out); FileOutputStream str = new FileOutputStream(pdffile); this.transformToStream(templateStream, documentParams, out); str.close(); out.close(); return pdffile; } catch (FileNotFoundException e) { throw new ExportServiceException("Could not create pdf file", e); } catch (IOException e) { throw new ExportServiceException( "IO error while saving the pdf file", e); } }

Target:
public File toFile(URI fileURI, InputStream templateStream, ParamsTree<String, String> documentParams) throws ExportServiceException { File pdffile = new File(fileURI); try (OutputStream out = new java.io.BufferedOutputStream(new FileOutputStream(pdffile))) { this.transformToStream(templateStream, documentParams, out); return pdffile; } catch (FileNotFoundException e) { throw new ExportServiceException("Could not create pdf file", e); } catch (IOException e) { throw new ExportServiceException("IO error while saving the pdf file", e); } }
Source:
public void tearDown() throws Exception { System.setProperty("curator-default-connection-timeout", "15000"); }

Target:
public void tearDown() throws Exception { System.clearProperty("curator-default-connection-timeout"); }
Source:
public ExecutionInterval getBegin() { return Collections.min(getBeginContextExecutionYears(), ExecutionYear.COMPARATOR_BY_YEAR); }

Target:
public ExecutionInterval getBegin() { Set<ExecutionYear> beginContextExecutionYears = getBeginContextExecutionYears(); return beginContextExecutionYears.isEmpty() ? null : Collections.min(beginContextExecutionYears, ExecutionYear.COMPARATOR_BY_YEAR); }
Source:
public void remove() { if (this.lastRetIndex < 0) { logger.logAndThrow(new IllegalStateException()); return; } else { try { items.remove(this.lastRetIndex); this.nextIndex = this.lastRetIndex; this.lastRetIndex = -1; } catch (IndexOutOfBoundsException ex) { logger.logAndThrow(new ConcurrentModificationException()); return; } } }

Target:
public void remove() { if (this.lastRetIndex < 0) { throw logger.logExceptionAsError(new IllegalStateException()); } else { try { items.remove(this.lastRetIndex); this.nextIndex = this.lastRetIndex; this.lastRetIndex = -1; } catch (IndexOutOfBoundsException ex) { throw logger.logExceptionAsError(new ConcurrentModificationException(ex)); } } }
Source:
public void commit() throws IOException { close(); try { Files.move(tmpFile, destFile, StandardCopyOption.ATOMIC_MOVE); } catch (IOException e) { Files.move(tmpFile, destFile, StandardCopyOption.REPLACE_EXISTING); } }

Target:
public void commit() throws IOException { close(); try { Files.move(tmpPath, destPath, StandardCopyOption.ATOMIC_MOVE); } catch (IOException e) { if (e instanceof AtomicMoveNotSupportedException) { LOGGER.log(Level.WARNING, "Atomic move not supported. falling back to non-atomic move.", e); } else { LOGGER.log(Level.WARNING, "Unable to move atomically, falling back to non-atomic move.", e); } if (destPath.toFile().exists()) { LOGGER.log(Level.INFO, "The target file {0} was already existing", destPath); } try { Files.move(tmpPath, destPath, StandardCopyOption.REPLACE_EXISTING); } catch (IOException e1) { e1.addSuppressed(e); LOGGER.log(Level.WARNING, "Unable to move {0} to {1}. Attempting to delete {0} and abandoning.", new Path[]{tmpPath, destPath}); try { Files.deleteIfExists(tmpPath); } catch (IOException e2) { e2.addSuppressed(e1); LOGGER.log(Level.WARNING, "Unable to delete {0}, good bye then!", tmpPath); throw e2; } throw e1; } } }
Source:
protected void handleNotificationEvent(Notification notification) { super.handleNotificationEvent(notification); super.refresh(); }

Target:
protected void handleNotificationEvent(Notification notification) { super.handleNotificationEvent(notification); Object notifier = notification.getNotifier(); Object oldValue = notification.getOldValue(); if (notifier instanceof EAnnotation) { if (((EAnnotation) notifier).getSource().equalsIgnoreCase(NamedStyleProperties.CSS_FORCE_VALUE)) { super.refresh(); } } else if (oldValue instanceof EAnnotation) { if (((EAnnotation) oldValue).getSource().equalsIgnoreCase(NamedStyleProperties.CSS_FORCE_VALUE)) { super.refresh(); } } }
Source:
private AzureBlobFileSystem createTestFile(Path testFilePath, long testFileSize, Configuration config) throws Exception { AzureBlobFileSystem fs; if (config == null) { fs = this.getFileSystem(); } else { final AzureBlobFileSystem currentFs = getFileSystem(); fs = (AzureBlobFileSystem) FileSystem.newInstance(currentFs.getUri(), config); } if (fs.exists(testFilePath)) { FileStatus status = fs.getFileStatus(testFilePath); if (status.getLen() >= testFileSize) { return fs; } } byte[] buffer = new byte[EIGHT_MB]; char character = 'a'; for (int i = 0; i < buffer.length; i++) { buffer[i] = (byte) character; character = (character == 'z') ? 'a' : (char) ((int) character + 1); } try (FSDataOutputStream outputStream = fs.create(testFilePath)) { int bytesWritten = 0; while (bytesWritten < testFileSize) { outputStream.write(buffer); bytesWritten += buffer.length; } } assertEquals("File not created of expected size", testFileSize, fs.getFileStatus(testFilePath).getLen()); return fs; }

Target:
private AzureBlobFileSystem createTestFile(Path testFilePath, long testFileSize, Configuration config) throws Exception { AzureBlobFileSystem fs; if (config == null) { fs = this.getFileSystem(); } else { final AzureBlobFileSystem currentFs = getFileSystem(); fs = (AzureBlobFileSystem) FileSystem.newInstance(currentFs.getUri(), config); } if (fs.exists(testFilePath)) { FileStatus status = fs.getFileStatus(testFilePath); if (status.getLen() >= testFileSize) { return fs; } } byte[] buffer = new byte[EIGHT_MB]; char character = 'a'; for (int i = 0; i < buffer.length; i++) { buffer[i] = (byte) character; character = (character == 'z') ? 'a' : (char) ((int) character + 1); } try (FSDataOutputStream outputStream = fs.create(testFilePath)) { int bytesWritten = 0; while (bytesWritten < testFileSize) { outputStream.write(buffer); bytesWritten += buffer.length; } } Assertions.assertThat(fs.getFileStatus(testFilePath).getLen()) .describedAs("File not created of expected size") .isEqualTo(testFileSize); return fs; }
Source:
public static boolean isActive(IStructuredSelection selectedElements) { boolean result = true; final Iterator<?> iterator = selectedElements.iterator(); if (!iterator.hasNext()) { result = false; } while (iterator.hasNext()) { final Object next = iterator.next(); if (next instanceof IDiagramElementEditPart) { result = result && isActive((IDiagramElementEditPart) next); } else { result = false; } } return result; }

Target:
public static boolean isActive(IStructuredSelection selectedElements) { boolean result = true; final Iterator<?> iterator = selectedElements.iterator(); if (!iterator.hasNext()) { result = false; } while (iterator.hasNext()) { final Object selectedElement = iterator.next(); if (selectedElement instanceof IDiagramElementEditPart) { result = result && isActive((IDiagramElementEditPart) selectedElement); } else { result = false; } } return result; }
Source:
private boolean isFlowRunningLongerThan(ExecutableFlow flow, long flowMaxRunningTimeInMins) { Set<Status> nonFinishingStatusAfterFlowStarts = new HashSet<>(); nonFinishingStatusAfterFlowStarts.add(Status.RUNNING); nonFinishingStatusAfterFlowStarts.add(Status.QUEUED); nonFinishingStatusAfterFlowStarts.add(Status.PAUSED); nonFinishingStatusAfterFlowStarts.add(Status.FAILED_FINISHING); return nonFinishingStatusAfterFlowStarts.contains(flow.getStatus()) && flow.getStartTime() > 0 && TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis()-flow.getStartTime()) >= flowMaxRunningTimeInMins; }

Target:
private boolean isFlowRunningLongerThan(ExecutableFlow flow, long flowMaxRunningTimeInMins) { Set<Status> nonFinishingStatusAfterFlowStarts = new HashSet<>(Arrays.asList(Status.RUNNING, Status.QUEUED, Status.PAUSED, Status.FAILED_FINISHING)); return nonFinishingStatusAfterFlowStarts.contains(flow.getStatus()) && flow.getStartTime() > 0 && TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis()-flow.getStartTime()) >= flowMaxRunningTimeInMins; }
Source:
public List getDataValue(String key) { Object value = GetValue(key, new ArrayList()); if (value instanceof List) { return (List)value; } return new ArrayList(); }

Target:
public List<Object> getDataValue(String key) { Object value = GetValue(key, new ArrayList()); if (value instanceof List) { return (List<Object>) value; } return new ArrayList<Object>(); }
Source:
protected void auditField(final ChangeSpec changeSpec) { final String fieldName = changeSpec.getFieldName(); Audit[] annotations = dictionary.getAttributeOrRelationAnnotations(getResourceClass(), Audit.class, fieldName ); if (annotations == null || annotations.length == 0) { auditClass(Audit.Action.UPDATE, changeSpec); return; } for (Audit annotation : annotations) { if (annotation.action().length == 1 && annotation.action()[0] == Audit.Action.UPDATE) { LogMessageImpl message = new LogMessageImpl(annotation, this, Optional.of(changeSpec)); getRequestScope().getAuditLogger().log(message); } else { throw new InvalidSyntaxException("Only Audit.Action.UPDATE is allowed on fields."); } } }

Target:
protected void auditField(final ChangeSpec changeSpec) { final String fieldName = changeSpec.getFieldName(); Audit[] annotations = dictionary.getAttributeOrRelationAnnotations(getResourceClass(), Audit.class, fieldName ); if (annotations == null || annotations.length == 0) { auditClass(Audit.Action.UPDATE, changeSpec); return; } for (Audit annotation : annotations) { if (annotation.action().length == 1 && annotation.action()[0] == Audit.Action.UPDATE) { LogMessage message = new LogMessageImpl(annotation, this, Optional.of(changeSpec)); getRequestScope().getAuditLogger().log(message); } else { throw new InvalidSyntaxException("Only Audit.Action.UPDATE is allowed on fields."); } } }
Source:
private void pull(Launcher launcher, FilePath repository, TaskListener listener, PrintStream output, Node node) throws IOException, InterruptedException { ArgumentListBuilder cmd = findHgExe(node, listener, false); cmd.add("pull"); PossiblyCachedRepo cachedSource = cachedSource(node, launcher, listener, true); if (cachedSource != null) { cmd.add(cachedSource.getRepoLocation()); } joinWithPossibleTimeout( launch(launcher).cmds(cmd).stdout(output).pwd(repository), true, listener); }

Target:
private void pull(Launcher launcher, FilePath repository, TaskListener listener, PrintStream output, Node node) throws IOException, InterruptedException { ArgumentListBuilder cmd = findHgExe(node, listener, false); cmd.add("pull"); branchSelector.select(cmd); doPull(cmd, launcher, repository, listener, output, node); }
Source:
public void ignoresWrongFile() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:2"; final User user = base.user(new URN(urn)); user.aliases().add("jeff2"); final Alias alias = user.aliases().iterate().iterator().next(); final long bout = alias.inbox().start(); alias.inbox().bout(bout).friends().invite(alias.name()); final String file = "test.bin"; final RqWithAuth request = new RqWithAuth( urn, new RqMultipart.Fake( TkAttachTest.fake(bout), new RqWithHeaders( new Request() { @Override public Iterable<String> head() throws IOException { return new LinkedList<>(); } @Override public InputStream body() throws IOException { return new ByteArrayInputStream("".getBytes()); } }, String.format(TkAttachTest.POST_URL, bout), String.format("Content-Disposition: form-data; name=\"file\"; filename=\"%s\"", file), "Content-Type: application/octet-stream" ) ) ); try { new FkBout(".*$", new TkAttach(base)).route(request); } catch (final RsFailure ex) { MatcherAssert.assertThat( "file unexpectedly exists after attach failure", new Attachments.Search( alias.inbox().bout(bout).attachments() ).exists(file), Matchers.is(false) ); return; } Assert.fail("Expected RsFailure exception but nothing was thrown"); }

Target:
public void ignoresWrongFile() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:2"; final User user = base.user(new URN(urn)); user.aliases().add("jeff2"); final Alias alias = user.aliases().iterate().iterator().next(); final long bout = alias.inbox().start(); alias.inbox().bout(bout).friends().invite(alias.name()); final String file = "test.bin"; final RqWithAuth request = new RqWithAuth( urn, new RqMultipart.Fake( TkAttachTest.fake(bout), new RqWithHeaders( TkAttachTest.body(""), String.format(TkAttachTest.POST_URL, bout), String.format("Content-Disposition: form-data; name=\"file\"; filename=\"%s\"", file), "Content-Type: application/octet-stream" ) ) ); try { new FkBout(".*$", new TkAttach(base)).route(request); Assert.fail("Expected RsFailure exception but nothing was thrown"); } catch (final RsFailure ex) { MatcherAssert.assertThat( "file unexpectedly exists after attach failure", new Attachments.Search( alias.inbox().bout(bout).attachments() ).exists(file), Matchers.is(false) ); } }
Source:
public HealthAwareRecorder(String pluginName) { this.pluginName = "[" + pluginName + "] "; }

Target:
protected HealthAwareRecorder(String pluginName) { this.pluginName = "[" + pluginName + "] "; }
Source:
public void testFilterPluginErrorsOnly() throws Exception { String warningId = ingestXmlFromResourceAndWait(WARNING_METACARD); String cleanId = ingestXmlFromResourceAndWait(CLEAN_METACARD); String errorId = ingestXmlFromResourceAndWait(ERROR_METACARD); Dictionary<String, Object> filterPluginProps = configureMetacardValidityFilterPlugin( Collections.singletonList("invalid-state=data-manager"), true, false, getAdminConfig()); testWithRetry( () -> { query(warningId, TRANSFORMER_XML, HttpStatus.SC_OK); query(cleanId, TRANSFORMER_XML, HttpStatus.SC_OK); query(errorId, TRANSFORMER_XML, HttpStatus.SC_NOT_FOUND); }); configureMetacardValidityFilterPlugin(filterPluginProps, getAdminConfig()); }

Target:
public void testFilterPluginErrorsOnly() throws Exception { String warningId = ingestXmlFromResourceAndWait(WARNING_METACARD); String cleanId = ingestXmlFromResourceAndWait(CLEAN_METACARD); String errorId = ingestXmlFromResourceAndWait(ERROR_METACARD); Dictionary<String, Object> filterPluginProps = configureMetacardValidityFilterPlugin( Collections.singletonList("invalid-state=data-manager"), true, false, getAdminConfig()); query(warningId, TRANSFORMER_XML, HttpStatus.SC_OK); query(cleanId, TRANSFORMER_XML, HttpStatus.SC_OK); query(errorId, TRANSFORMER_XML, HttpStatus.SC_NOT_FOUND); configureMetacardValidityFilterPlugin(filterPluginProps, getAdminConfig()); }
Source:
private int writeBytes(PutRecordRequest putRecordRequest, Object data) { ByteBuffer buffer; if (data instanceof ByteBuffer) { buffer = (ByteBuffer) data; } else if (data instanceof byte []) { buffer = ByteBuffer.wrap((byte []) data); } else { LOG.debug("Type is not supported for writing to stream", data.getClass().getName()); return 0; } putRecordRequest.setData(buffer); kinesisClient.putRecord(putRecordRequest); return 1; }

Target:
private int writeBytes(PutRecordRequest putRecordRequest, Object data) { ByteBuffer buffer; if (data instanceof ByteBuffer) { buffer = (ByteBuffer) data; } else if (data instanceof byte[]) { buffer = ByteBuffer.wrap((byte[]) data); } else { throw new IllegalStateException(String.format("Type %s is not supported for writing to stream", data.getClass().getName())); } putRecordRequest.setData(buffer); return putRecord(putRecordRequest); }
Source:
public int hashCode() { return Objects.hash(uuid, address1); }

Target:
public int hashCode() { return Objects.hash(uuid, address1, address2, cityVillage, stateProvince, country, postalCode, countryDistrict, address3, address4, address5, address6, startDate, endDate, latitude, longitude); }
Source:
public List<BaragonConfigFile> synchronouslySendRenderConfigsRequest(String serviceId) throws Exception { final Set<String> loadBalancers = Sets.newHashSet(); final Optional<BaragonService> maybeOriginalService = stateDatastore.getService(serviceId); if (maybeOriginalService.isPresent()) { loadBalancers.addAll(maybeOriginalService.get().getLoadBalancerGroups()); } else { throw new BaragonWebException(String.format("Service with id=%s could not be found", serviceId)); } List<BaragonAgentMetadata> agents = agentManager.getAgents(loadBalancers).stream().collect(Collectors.toList()); BaragonAgentMetadata randomAgent = agents.get(RANDOM.nextInt(agents.size())); final String baseUrl = randomAgent.getBaseAgentUri(); final HttpRequest.Builder builder = HttpRequest.newBuilder().setUrl(baseUrl + "/renderedConfigs/" + serviceId); HttpResponse response = httpClient.execute(builder.build()); LOG.info(String.format("Got %s response from BaragonAgent", response.getStatusCode())); if (response.isError()) { throw new AgentServiceNotifyException(String.format("Bad response received from BaragonService %s", response.getAsString())); } return response.getAs(new TypeReference<List<BaragonConfigFile>>(){}); }

Target:
public List<BaragonConfigFile> synchronouslySendRenderConfigsRequest(String serviceId) throws Exception { final Set<String> loadBalancers = Sets.newHashSet(); final Optional<BaragonService> maybeOriginalService = stateDatastore.getService(serviceId); if (maybeOriginalService.isPresent()) { loadBalancers.addAll(maybeOriginalService.get().getLoadBalancerGroups()); } else { throw new BaragonWebException(String.format("Service with id=%s could not be found", serviceId)); } List<BaragonAgentMetadata> agents = agentManager.getAgents(loadBalancers).stream().collect(Collectors.toList()); BaragonAgentMetadata randomAgent = agents.get(RANDOM.nextInt(agents.size())); final String baseUrl = randomAgent.getBaseAgentUri(); final HttpRequest.Builder builder = HttpRequest.newBuilder().setUrl(baseUrl + "/renderedConfigs/" + serviceId); HttpResponse response = httpClient.execute(builder.build()); LOG.info(String.format("Got %s response from BaragonAgent", response.getStatusCode())); if (response.isError()) { throw new AgentServiceNotifyException(String.format("Bad response received from BaragonService %s", response.getAsString())); } return response.getAs(BARAGON_CONFIG_FILE_LIST_TYPE_REFERENCE); }
Source:
protected ILabelProvider getLabelProvider() { if (labelProvider == null) { try { labelProvider = ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, input) .getLabelProvider(); } catch (ServiceException e) { Activator.getDefault().error(e.getMessage(), e); } } return labelProvider; }

Target:
protected ILabelProvider getLabelProvider() { try { labelProvider = ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, input) .getLabelProvider(); } catch (ServiceException e) { Activator.getDefault().error(e.getMessage(), e); labelProvider = new UMLLabelProvider(); } return labelProvider; }
Source:
private void registerSessionListenerForCurrentUser() { mMediaSessionManager.removeOnActiveSessionsChangedListener(mActiveMediaSessionListener); mMediaSessionManager.addOnActiveSessionsChangedListener(mActiveMediaSessionListener, null, UserHandle.USER_CURRENT, null); }

Target:
private void registerSessionListenerForCurrentUser() { mMediaSessionManager.removeOnActiveSessionsChangedListener(mActiveMediaSessionListener); mMediaSessionManager.addOnActiveSessionsChangedListener(mActiveMediaSessionListener, null, UserHandle.USER_CURRENT, null); updateMediaController(mMediaSessionManager.getActiveSessionsForUser(null, UserHandle.USER_CURRENT)); }
Source:
void letPass() { BusFilter<CommandEnvelope> filter = new BusFilters.Accepting(); Optional<Ack> ack = filter.filter(commandEnvelope); Truth8.assertThat(ack).isEmpty(); }

Target:
void letPass() { BusFilter<CommandEnvelope> filter = new BusFilters.Accepting(); Optional<Ack> ack = filter.filter(commandEnvelope); assertThat(ack).isEmpty(); }
Source:
public void checkAmbiguousUri() { for (Map.Entry<String, List<ResourceInvoker>> entry : this.root.getBounded().entrySet()) { List<ResourceInvoker> values = entry.getValue(); if (values.size() > 1) { int locatorCnt = 0; int methodCnt = 0; for(ResourceInvoker rInvoker : values) { if (rInvoker instanceof ResourceLocatorInvoker) { locatorCnt++; } else if (rInvoker instanceof ResourceMethodInvoker) { methodCnt++; } } if (methodCnt > 0 && locatorCnt > 0) { StringBuilder sb = new StringBuilder(); for (ResourceInvoker exp : values) { sb.append(exp.getMethod().getDeclaringClass().getName() + "." + exp.getMethod().getName()+ ", "); } LogMessages.LOGGER.uriAmbiguity(entry.getKey(), sb.toString().substring(0, sb.toString().length()-2)); } } } }

Target:
public void checkAmbiguousUri() { for (Map.Entry<String, List<ResourceInvoker>> entry : this.root.getBounded().entrySet()) { List<ResourceInvoker> values = entry.getValue(); if (values.size() > 1) { int locatorCnt = 0; int methodCnt = 0; for(ResourceInvoker rInvoker : values) { if (rInvoker instanceof ResourceLocatorInvoker) { locatorCnt++; } else if (rInvoker instanceof ResourceMethodInvoker) { methodCnt++; } } if (methodCnt > 0 && locatorCnt > 0) { StringBuilder sb = new StringBuilder(); int cnt = values.size(); for (int i=0; i < cnt; i++) { ResourceInvoker exp = values.get(i); sb.append(exp.getMethod().getDeclaringClass().getName()) .append(".") .append(exp.getMethod().getName()); if (i < cnt-1) { sb.append(", "); } } LogMessages.LOGGER.uriAmbiguity(entry.getKey(), sb.toString()); } } } }
Source:
public CaseInsensitiveDictionaryMap(Map<? extends K, ? extends V> map) { this(initialCapacity(map.size())); for (Entry<? extends K, ? extends V> e : map.entrySet()) { K key = e.getKey(); V value = e.getValue(); if (key != null && value != null) { if (put(key, value) != null) { throw new IllegalArgumentException(NLS.bind(Msg.HEADER_DUPLICATE_KEY_EXCEPTION, key)); } } } }

Target:
public CaseInsensitiveDictionaryMap(Map<? extends K, ? extends V> map) { this(initialCapacity(map.size())); for (Entry<? extends K, ? extends V> e : map.entrySet()) { K key = e.getKey(); if (key != null) { V value = e.getValue(); if (value != null) { if (put(key, value) != null) { throw new IllegalArgumentException(NLS.bind(Msg.HEADER_DUPLICATE_KEY_EXCEPTION, key)); } } } } }
Source:
public void testSeekEvent_location() { final CtfLocationData loation2 = new CtfLocationData(1L, 0L); CtfLocation ctfLocation = new CtfLocation(loation2); ITmfContext result = fixture.seekEvent(ctfLocation); assertNotNull(result); }

Target:
public void testSeekEvent_location() { final CtfLocationData location2 = new CtfLocationData(1L, 0L); CtfLocation ctfLocation = new CtfLocation(location2); ITmfContext result = fixture.seekEvent(ctfLocation); assertNotNull(result); }
Source:
public BooleanWrapper disconnect() { try { getMonitoringOrFail().removeRMEventListener(); } catch (Exception ignored) { } BooleanWrapper r = target.disconnect(); return r; }

Target:
public BooleanWrapper disconnect() { try { getMonitoringOrFail().removeRMEventListener(); } catch (Exception ignored) { logger.debug("", ignored); } BooleanWrapper r = target.disconnect(); return r; }
Source:
private void rebuildIndexRows(Map<byte[], List<Mutation>> indexKeyToMutationMap, List<Mutation> oldIndexRowsToBeDeletedList, IndexToolVerificationResult verificationResult) throws IOException { if (ignoreIndexRebuildForTesting) { return; } try { int batchSize = 0; List<Mutation> indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (List<Mutation> mutationList : indexKeyToMutationMap.values()) { indexUpdates.addAll(mutationList); batchSize += mutationList.size(); if (batchSize >= maxBatchSize) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); } batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (Mutation mutation : oldIndexRowsToBeDeletedList) { indexUpdates.add(mutation); batchSize ++; if (batchSize >= maxBatchSize) { indexHTable.batch(indexUpdates); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); } if (verify) { verificationResult.setRebuiltIndexRowCount(verificationResult.getRebuiltIndexRowCount() + indexKeyToMutationMap.size()); } } catch (Throwable t) { ServerUtil.throwIOException(indexHTable.getName().toString(), t); } }

Target:
private void rebuildIndexRows(Map<byte[], List<Mutation>> indexKeyToMutationMap, List<Mutation> oldIndexRowsToBeDeletedList, IndexToolVerificationResult verificationResult) throws IOException { if (ignoreIndexRebuildForTesting) { return; } try { int batchSize = 0; List<Mutation> indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (List<Mutation> mutationList : indexKeyToMutationMap.values()) { indexUpdates.addAll(mutationList); batchSize += mutationList.size(); if (batchSize >= maxBatchSize) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); } batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (Mutation mutation : oldIndexRowsToBeDeletedList) { indexUpdates.add(mutation); batchSize ++; if (batchSize >= maxBatchSize) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); } if (verify) { verificationResult.setRebuiltIndexRowCount(verificationResult.getRebuiltIndexRowCount() + indexKeyToMutationMap.size()); } } catch (Throwable t) { ServerUtil.throwIOException(indexHTable.getName().toString(), t); } }
Source:
String getSeasonName(final String value, final List<ValueReference> possibleValues) { if (possibleValues != null && !possibleValues.isEmpty()) { for (final ValueReference valueReference : possibleValues) { if (StringUtils.isNumeric(value) && valueReference.getId().intValue() == Integer.parseInt(value)) { return valueReference.getName(); } else if (valueReference.getDescription().equals(value)) { return valueReference.getName(); } } } return value; }

Target:
String getSeasonName(final String value, final List<ValueReference> possibleValues) { if (possibleValues != null && !possibleValues.isEmpty()) { for (final ValueReference valueReference : possibleValues) { if ((StringUtils.isNumeric(value) && valueReference.getId().intValue() == Integer.parseInt(value)) || valueReference.getDescription().equals(value)) { return valueReference.getName(); } } } return value; }
Source:
public BenchmarkRequestSubscriber(Meter successMeter, Meter failureMeter, Semaphore concurrencyControlSemaphore, AtomicLong count) { this.successMeter = successMeter; this.failureMeter = failureMeter; this.concurrencyControlSemaphore = concurrencyControlSemaphore; this.count = count; logger = LoggerFactory.getLogger(this.getClass()); }

Target:
public BenchmarkRequestSubscriber(Meter successMeter, Meter failureMeter, Semaphore concurrencyControlSemaphore, AtomicLong count) { this.successMeter = successMeter; this.failureMeter = failureMeter; this.concurrencyControlSemaphore = concurrencyControlSemaphore; this.count = count; }
Source:
public CheWsAgentCorsAllowedOriginsProvider( @Named("che.api") String apiEndpoint, @Nullable @Named("che.wsagent.cors.allowed_origins") String allowedOrigins, HttpJsonRequestFactory httpJsonRequestFactory) throws ApiException, IOException { this.apiEndpoint = apiEndpoint; if (allowedOrigins == null) { final UriBuilder builder = UriBuilder.fromUri(apiEndpoint) .path(WorkspaceService.class) .path(WorkspaceService.class, "getByKey") .queryParam("includeInternalServers", "true"); String href = builder.build(System.getenv("CHE_WORKSPACE_ID")).toString(); WorkspaceDto workspaceDto = httpJsonRequestFactory.fromUrl(href).useGetMethod().request().asDto(WorkspaceDto.class); String ideUrl = getIdeUrl(workspaceDto); if (ideUrl != null) { this.allowedOrigins = UriBuilder.fromUri(ideUrl).replacePath(null).build().toString(); } else { this.allowedOrigins = UriBuilder.fromUri(workspaceDto.getLinks().getOrDefault("ide", apiEndpoint)) .replacePath(null) .build() .toString(); } } else { this.allowedOrigins = allowedOrigins; } }

Target:
public CheWsAgentCorsAllowedOriginsProvider( @Named("che.api") String apiEndpoint, @Nullable @Named("che.wsagent.cors.allowed_origins") String allowedOrigins, HttpJsonRequestFactory httpJsonRequestFactory) throws ApiException, IOException { this.allowedOrigins = evaluateOrigins(apiEndpoint, allowedOrigins, httpJsonRequestFactory); }
Source:
public boolean renderOutput(PrintStream out, OutputFormat outputFormat, boolean interactive) { Thread clientThread = Thread.currentThread(); SignalHandler oldHandler = Signal.handle(SIGINT, signal -> { if (ignoreUserInterrupt.get() || client.isAborted()) { return; } userAbortedQuery.set(true); client.close(); clientThread.interrupt(); }); try { return renderQueryOutput(out, outputFormat, interactive); } finally { Signal.handle(SIGINT, oldHandler); Thread.interrupted(); } }

Target:
public boolean renderOutput(PrintStream out, OutputFormat outputFormat, boolean interactive) { Thread clientThread = Thread.currentThread(); SignalHandler oldHandler = Signal.handle(SIGINT, signal -> { if (ignoreUserInterrupt.get() || client.isClientAborted()) { return; } client.close(); clientThread.interrupt(); }); try { return renderQueryOutput(out, outputFormat, interactive); } finally { Signal.handle(SIGINT, oldHandler); Thread.interrupted(); } }
Source:
public WorldcatFetcher (String worldcatKey) { API_KEY = worldcatKey; }

Target:
public WorldcatFetcher(String worldcatKey) { WORLDCAT_OPEN_SEARCH_URL += worldcatKey; WORLDCAT_READ_URL += worldcatKey; }
Source:
public void testBlockingChannelInfoForPlainText() throws Exception { testBlockingChannelInfo("127.0.0.1", new Port(6667, PortType.PLAINTEXT), 5, 2); }

Target:
public void testBlockingChannelInfoForPlainText() throws Exception { testBlockingChannelInfo("127.0.0.1", new Port(6667, PortType.PLAINTEXT), 5, 5); }
Source:
private void initPreferences() { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); Settings.nativeTongue = sp.getString(PREF_KEY_NATIVE_TONGUE, SUPPORTED_LANGUAGES[0]); Settings.contributeRecordings = sp.getBoolean(PREF_KEY_CONTRIBUTE_SND, true); Log.d("AAA", "nativeTongue: " + Settings.nativeTongue); Log.d("AAA", "contributeRecordings: " + Settings.contributeRecordings); }

Target:
private void initPreferences() { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); Settings.nativeTongue = sp.getString(PREF_KEY_NATIVE_TONGUE, SUPPORTED_LANGUAGES[0]); Settings.contributeRecordings = sp.getBoolean(PREF_KEY_CONTRIBUTE_SND, true); }
Source:
protected void configure() { addExposedPort(POSTGRESQL_PORT); withUrlParam("loggerLevel", "OFF"); addEnv("POSTGRES_DB", databaseName); addEnv("POSTGRES_USER", username); addEnv("POSTGRES_PASSWORD", password); }

Target:
protected void configure() { withUrlParam("loggerLevel", "OFF"); addEnv("POSTGRES_DB", databaseName); addEnv("POSTGRES_USER", username); addEnv("POSTGRES_PASSWORD", password); }
Source:
private Pair<DbEndpoint, Connection> connectToBestAvailableEndpoint(boolean needWritable) throws SQLException { SQLException lastException = null; for (DbEndpoint dbEndpoint : sortedDbEndpoints) { if (!isBetterEndpoint(dbEndpoint, connectedEndpoint)) { if (needWritable && !connectedEndpoint.isWriteable()) { throw new SQLException("Could not connect to any writable database"); } else { return new Pair<>(connectedEndpoint, activeConnection); } } if (needWritable && !dbEndpoint.isWriteable()) { continue; } Properties credentials = new Properties(); credentials.setProperty("user", dbEndpoint.getUsername()); credentials.setProperty("password", dbEndpoint.getPassword()); try { Connection connection = mysqlDriver.connect(dbEndpoint.getUrl(), credentials); return new Pair<>(dbEndpoint, connection); } catch (SQLException e) { logger.warn("Unable to connect to endpoint due to {}", dbEndpoint.getUrl(), e.getMessage()); if (isCredentialError(e)) { throw e; } else { lastException = e; } } } if (lastException != null) { throw lastException; } else { throw new IllegalStateException("No suitable connection found"); } }

Target:
private Pair<DbEndpoint, Connection> connectToBestAvailableEndpoint(boolean needWritable) throws SQLException { SQLException lastException = null; for (DbEndpoint candidateEndpoint : sortedDbEndpoints) { if (!isBetterEndpoint(candidateEndpoint, connectedEndpoint)) { if (needWritable && !connectedEndpoint.isWriteable()) { throw Optional.ofNullable(lastException).orElse(noWritableEndpointException); } else { return new Pair<>(connectedEndpoint, activeConnection); } } if (needWritable && !candidateEndpoint.isWriteable()) { throw Optional.ofNullable(lastException).orElse(noWritableEndpointException); } Properties credentials = new Properties(); credentials.setProperty("user", candidateEndpoint.getUsername()); credentials.setProperty("password", candidateEndpoint.getPassword()); try { Connection connection = mysqlDriver.connect(candidateEndpoint.getUrl(), credentials); metrics.connectionSuccessCount.inc(); return new Pair<>(candidateEndpoint, connection); } catch (SQLException e) { logger.warn("Unable to connect to endpoint due to {}", candidateEndpoint.getUrl(), e.getMessage()); metrics.connectionFailureCount.inc(); if (isCredentialError(e)) { throw e; } else { lastException = e; } } } throw Optional.ofNullable(lastException).orElse(noEndpointException); }
Source:
public void testClientScopesPolicy() throws Exception { setTrustedHost("localhost"); ClientScopeRepresentation clientTemplate = new ClientScopeRepresentation(); clientTemplate.setName("foo"); Response response = realmResource().clientScopes().create(clientTemplate); String clientScopeId = ApiUtil.getCreatedId(response); response.close(); ClientRepresentation clientRep = createRep("test-app"); clientRep.setDefaultClientScopes(Collections.singletonList("foo")); assertFail(ClientRegOp.CREATE, clientRep, 403, "Not permitted to use specified clientScope"); clientRep.setDefaultClientScopes(null); ClientRepresentation registeredClient = reg.create(clientRep); reg.auth(Auth.token(registeredClient)); registeredClient.setDefaultClientScopes(Collections.singletonList("foo")); assertFail(ClientRegOp.UPDATE, registeredClient, 403, "Not permitted to use specified clientScope"); ClientResource client = ApiUtil.findClientByClientId(realmResource(), "test-app"); client.addDefaultClientScope(clientScopeId); reg.update(registeredClient); realmResource().clients().get(client.toRepresentation().getId()).remove(); realmResource().clientScopes().get(clientScopeId).remove(); }

Target:
public void testClientScopesPolicy() throws Exception { setTrustedHost("localhost"); ClientScopeRepresentation clientScope = new ClientScopeRepresentation(); clientScope.setName("foo"); Response response = realmResource().clientScopes().create(clientScope); String clientScopeId = ApiUtil.getCreatedId(response); response.close(); ClientRepresentation clientRep = createRep("test-app"); clientRep.setDefaultClientScopes(Collections.singletonList("foo")); assertFail(ClientRegOp.CREATE, clientRep, 403, "Not permitted to use specified clientScope"); clientRep.setDefaultClientScopes(null); ClientRepresentation registeredClient = reg.create(clientRep); reg.auth(Auth.token(registeredClient)); registeredClient.setDefaultClientScopes(Collections.singletonList("foo")); assertFail(ClientRegOp.UPDATE, registeredClient, 403, "Not permitted to use specified clientScope"); ClientResource client = ApiUtil.findClientByClientId(realmResource(), "test-app"); client.addDefaultClientScope(clientScopeId); reg.update(registeredClient); realmResource().clients().get(client.toRepresentation().getId()).remove(); realmResource().clientScopes().get(clientScopeId).remove(); }
Source:
public void ClickTrackingArticleEditMode_001_verifyPreviewModalEvents() { WikiBasePageObject base = new WikiBasePageObject(driver); base.openMainPage(wikiURL); NavigationBar navbar = new NavigationBar(driver); navbar.executeScript(script); ArticlePageObject article = base.openRandomArticle(wikiURL); VisualEditModePageObject visualEditMode = article.editArticleInRTEUsingDropdown(); visualEditMode.verifyContentLoaded(); visualEditMode.executeScript(ClickTrackingScriptsProvider.TRACKER_INSTALLATION); visualEditMode.previewArticle(); List<JsonObject> expectedEvents = Arrays.asList( EventsArticleEditMode.previewEvent ); visualEditMode.compareTrackedEventsTo(expectedEvents); }

Target:
public void ClickTrackingArticleEditMode_001_verifyPreviewModalEvents() { WikiBasePageObject base = new WikiBasePageObject(driver); ArticlePageObject article = base.openRandomArticle(wikiURL); VisualEditModePageObject visualEditMode = article .editArticleInRTEUsingDropdown(); visualEditMode.verifyContentLoaded(); visualEditMode .executeScript(ClickTrackingScriptsProvider.TRACKER_INSTALLATION); visualEditMode.previewArticle(); List<JsonObject> expectedEvents = Arrays .asList(EventsArticleEditMode.previewEvent); visualEditMode.compareTrackedEventsTo(expectedEvents); }
Source:
private void setAccountItemAttributes(AccountItem item, ContentValues cv, long accountId) { if (item.getDbId() != null) cv.put("id", item.getDbId()); cv.put("account", accountId); putOrNull(cv, "title", item.getTitle()); putOrNull(cv, "author", item.getAuthor()); putOrNull(cv, "format", item.getFormat()); putOrNull(cv, "itemid", item.getId()); putOrNull(cv, "status", item.getStatus()); putOrNull(cv, "cover", item.getCover()); putOrNull(cv, "mediatype", item.getMediaType().toString()); }

Target:
private void setAccountItemAttributes(AccountItem item, ContentValues cv, long accountId) { if (item.getDbId() != null) cv.put("id", item.getDbId()); cv.put("account", accountId); putOrNull(cv, "title", item.getTitle()); putOrNull(cv, "author", item.getAuthor()); putOrNull(cv, "format", item.getFormat()); putOrNull(cv, "itemid", item.getId()); putOrNull(cv, "status", item.getStatus()); putOrNull(cv, "cover", item.getCover()); putOrNull(cv, "mediatype", item.getMediaType() != null ? item.getMediaType().toString() : null); }
Source:
if (properties.useDatastoreToReadData()) { try { Datastore ds = new Datastore("<LINK_0>"); File f = ds.getDirectory("org.cogcomp.comma-srl", "comma-srl-data", 2.2, false); ANNOTATION_SOURCE_DIR = f.getAbsolutePath() + File.separator + "comma-srl-data" + File.separator + "Bayraktar-SyntaxToLabel" + File.separator + "modified" + File.separator; } catch (DatastoreException e) { e.printStackTrace(); } }

Target:
if (properties.useDatastoreToReadData()) { try { Datastore ds = new Datastore(new ResourceConfigurator().getDefaultConfig()); File f = ds.getDirectory("org.cogcomp.comma-srl", "comma-srl-data", 2.2, false); ANNOTATION_SOURCE_DIR = f.getAbsolutePath() + File.separator + "comma-srl-data" + File.separator + "Bayraktar-SyntaxToLabel" + File.separator + "modified" + File.separator; } catch (Exception e) { e.printStackTrace(); } }
Source:
private static void addAllAnnotations(List<PDAnnot> annotations, List<PDAnnotation> pdfboxAnnotations) { for (PDAnnotation annotation : pdfboxAnnotations) { if (annotation != null) { annotations.add(new PBoxPDAnnot(annotation)); } } }

Target:
private void addAllAnnotations(List<PDAnnot> annotations, List<PDAnnotation> pdfboxAnnotations) { for (PDAnnotation annotation : pdfboxAnnotations) { if (annotation != null) { annotations.add(new PBoxPDAnnot(annotation)); } } }
Source:
public Optional<Boolean> getValueFromContainer(ValueContainer<?> container) { if (supports(container)) { net.minecraft.entity.Entity entity = ((net.minecraft.entity.Entity) container); boolean isFlying = entity.isAirBorne; return Optional.of(isFlying); } return Optional.absent(); }

Target:
public Optional<Boolean> getValueFromContainer(ValueContainer<?> container) { final boolean isFlying; if (supports(container)) { if (container instanceof EntityPlayer) { isFlying = ((EntityPlayer) container).capabilities.isFlying; } else { isFlying = ((Entity) container).isAirBorne; } return Optional.of(isFlying); } return Optional.absent(); }