auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testBinaryLogicTypeAllOperators() { new JsonModelBuilder().beginBinaryLogicType("AND"); new JsonModelBuilder().beginBinaryLogicType("OR"); }

Target:
public void testBinaryLogicTypeAllOperators() { new JsonModelBuilder().beginBinaryLogicType(AND); new JsonModelBuilder().beginBinaryLogicType(OR); }
Source:
public static VdcParameter create(String name, Class javaType, String guidStr) { Guid guid = new Guid(guidStr); synchronized (parametersMap) { if (parametersMap.containsKey(guid)) { throw new InvalidParameterGuidException(name, parametersMap.get(guid)); } parametersMap.put(guid, new VdcParameter(name, javaType, guid)); } return parametersMap.get(guid); }

Target:
public static VdcParameter create(String name, Class javaType, String guidStr) { Guid guid = new Guid(guidStr); synchronized (parametersMap) { if (parametersMap.containsKey(guid)) { throw new InvalidParameterGuidException(name, parametersMap.get(guid)); } VdcParameter param = new VdcParameter(name, javaType, guid); parametersMap.put(guid, param); return param; } }
Source:
public void close() throws IOException { datagramChannel.socket().close(); datagramChannel = null; }

Target:
public void close() throws IOException { try { datagramChannel.socket().close(); } finally { datagramChannel = null; } }
Source:
public void test06_09_NestedJavaBean() { driver.get(applicationContextUrl); driver.findElement(By.id("EL")).click(); driver.findElement(By.id("06_09")).click(); inputFieldAccessor.overrideValue(By.id("criteria.name"), "yamada", driver); inputFieldAccessor.overrideValue(By.id("criteria.age"), "20", driver); inputFieldAccessor.overrideValue(By.id("rememberCriteria"), "true", driver); driver.findElement(By.id("searchButton")).click(); driver.findElement(By.id("pagination")).findElement(By.linkText("2")) .click(); assertThat( driver.findElement(By.id("criteria.name")) .getAttribute("value"), is("yamada")); assertThat( driver.findElement(By.id("criteria.age")).getAttribute("value"), is("20")); assertThat( driver.findElement(By.id("rememberCriteria")).getAttribute( "value"), is("true")); screenCapture.save(driver); }

Target:
public void test06_09_NestedJavaBean() { driver.findElement(By.id("06_09")).click(); inputFieldAccessor.overrideValue(By.id("criteria.name"), "yamada", driver); inputFieldAccessor.overrideValue(By.id("criteria.age"), "20", driver); inputFieldAccessor.overrideValue(By.id("rememberCriteria"), "true", driver); driver.findElement(By.id("searchButton")).click(); driver.findElement(By.id("pagination")).findElement(By.linkText("2")) .click(); assertThat( driver.findElement(By.id("criteria.name")) .getAttribute("value"), is("yamada")); assertThat( driver.findElement(By.id("criteria.age")).getAttribute("value"), is("20")); assertThat( driver.findElement(By.id("rememberCriteria")).getAttribute( "value"), is("true")); }
Source:
public void testXStripeClientUserAgent() { final RequestOptions options = (new RequestOptionsBuilder()).setApiKey("sk_foobar").build(); final Map<String, String> headers = LiveStripeResponseGetter.getHeaders(options); final Map<String, String> uaMap = new Gson().fromJson(headers.get("X-Stripe-Client-User-Agent"), new TypeToken<Map<String, String>>() {}.getType()); for (Map.Entry<String, String> entry : uaMap.entrySet()) { assertTrue("Header key contains unexpected '.'", !entry.getKey().contains(".")); } }

Target:
public void testXStripeClientUserAgent() { final RequestOptions options = (new RequestOptionsBuilder()).setApiKey("sk_foobar").build(); final Map<String, String> headers = LiveStripeResponseGetter.getHeaders(options); final Map<String, String> uaMap = new Gson().fromJson(headers.get("X-Stripe-Client-User-Agent"), new TypeToken<Map<String, String>>() {}.getType()); for (Map.Entry<String, String> entry : uaMap.entrySet()) { assertTrue("Header key contains unexpected '.'", !entry.getKey().contains(".")); assertTrue("Header value should not be empty", entry.getValue() != null); } assertTrue(uaMap.containsKey("bindings_version")); assertTrue(uaMap.containsKey("lang")); assertTrue(uaMap.containsKey("publisher")); assertTrue(uaMap.containsKey("java_version")); assertTrue(uaMap.containsKey("java_vendor")); assertTrue(uaMap.containsKey("java_vm_version")); assertTrue(uaMap.containsKey("java_vm_vendor")); assertTrue(uaMap.containsKey("os_name")); assertTrue(uaMap.containsKey("os_version")); assertTrue(uaMap.containsKey("os_arch")); }
Source:
private void reconcileRequestTimeout(final RequestContext requestContext, Long timeout) { Number contextTimeout = (Number) requestContext.getLocalAttr(R2Constants.REQUEST_TIMEOUT); int timeoutBound = (contextTimeout != null) ? contextTimeout.intValue() : Integer.MAX_VALUE; requestContext.putLocalAttr(R2Constants.REQUEST_TIMEOUT, Math.min(timeout, timeoutBound)); }

Target:
private int reconcileRequestTimeout(final RequestContext requestContext, Long timeout) { int d2Timeout = timeout.intValue(); Object requestTimeout = requestContext.getLocalAttr(R2Constants.REQUEST_TIMEOUT); if (requestTimeout instanceof Number && ((Number)requestTimeout).intValue() > 0) { d2Timeout = Math.min(((Number)requestTimeout).intValue(), d2Timeout); } else if (requestTimeout != null) { LOGGER.error("Ignore invalid value for REQUEST_TIMEOUT set in request context: " + requestTimeout); } requestContext.putLocalAttr(R2Constants.REQUEST_TIMEOUT, d2Timeout); return d2Timeout; }
Source:
public CloseableIterator<CacheEntry<K, V>> iterator() { return new CloseableIteratorMapper<>(new RemovableCloseableIterator<>(Closeables.iterator(stream()), cache, e -> e.getKey()), e -> new EntryWrapper<>(cache, e)); }

Target:
public CloseableIterator<CacheEntry<K, V>> iterator() { return new CloseableIteratorMapper<>(new RemovableCloseableIterator<>(Closeables.iterator(stream()), cache, CacheEntry::getKey), e -> new EntryWrapper<>(cache, e)); }
Source:
private void onSourceColumnsChanged() { boolean everythingEnabled = _datastore != null; _saveButton.setEnabled(everythingEnabled); _saveAsButton.setEnabled(everythingEnabled); for (PopupButton superCategoryButton : _superCategoryButtons) { superCategoryButton.setEnabled(everythingEnabled); } }

Target:
private void onSourceColumnsChanged() { boolean everythingEnabled = !_analysisJobBuilder.getSourceColumns().isEmpty() && _datastore != null; _saveButton.setEnabled(everythingEnabled); _saveAsButton.setEnabled(everythingEnabled); for (PopupButton superCategoryButton : _superCategoryButtons) { superCategoryButton.setEnabled(everythingEnabled); } }
Source:
public Date getLastModified() { try { if (Files.isSymbolicLink(file) && Files.notExists(file)) { return new Date(0L); } return new Date(Files.getLastModifiedTime(file).toMillis()); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public Date getLastModified() { try { if (Files.isSymbolicLink(file) && Files.notExists(file)) { return null; } return new Date(Files.getLastModifiedTime(file).toMillis()); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
private Set<GenericItem> getItemsInVisibilityCond(EList<VisibilityRule> ruleList) { Set<GenericItem> items = new HashSet<GenericItem>(); if (ruleList != null) { for (VisibilityRule rule : ruleList) { String itemName = rule.getItem(); if (itemName != null) { try { Item item = itemUIRegistry.getItem(itemName); if (item instanceof GenericItem) { final GenericItem gItem = (GenericItem) item; items.add(gItem); } } catch (ItemNotFoundException e) { } } } } return items; }

Target:
private Set<GenericItem> getItemsInVisibilityCond(EList<VisibilityRule> ruleList) { Set<GenericItem> items = new HashSet<GenericItem>(); for (VisibilityRule rule : ruleList) { String itemName = rule.getItem(); if (itemName != null) { try { Item item = itemUIRegistry.getItem(itemName); if (item instanceof GenericItem) { items.add((GenericItem) item); } } catch (ItemNotFoundException e) { } } } return items; }
Source:
public void onGenericMessage( final GenericMessageEvent event ) { String text = event.getMessage(); Matcher matcher = FAKE_NEWS_PATTERN.matcher( text ); Matcher helpMatcher = FAKE_NEWS_HELP_PATTERN.matcher( text ); if ( helpMatcher.matches() ) { event.respondWith( "Check your DMs fam" ); for ( String line : HELP_MESSAGE.split( "\n" ) ) { event.respondPrivateMessage( line ); } } else if ( matcher.matches() ) { currentNews( event, matcher, fakeNewsFeedsByCategory, DEFAULT_CATEGORY, logger ); } }

Target:
public void onGenericMessage( final GenericMessageEvent event ) { String text = event.getMessage(); Matcher matcher = FAKE_NEWS_PATTERN.matcher( text ); Matcher helpMatcher = FAKE_NEWS_HELP_PATTERN.matcher( text ); if ( helpMatcher.matches() ) { for ( String line : HELP_MESSAGE.split( "\n" ) ) { event.respondPrivateMessage( line ); } } else if ( matcher.matches() ) { currentNews( event, matcher, fakeNewsFeedsByCategory, DEFAULT_CATEGORY, logger ); } }
Source:
public int getPointAreaOffset() { int pixelCoordinate = 0; IAxis[] xAxes = getSwtChart().getAxisSet().getXAxes(); ISeries[] series = fSwtChart.getSeriesSet().getSeries(); if ((xAxes.length > 0) && (series.length > 0) && (series[0].getXSeries() != null) && (series[0].getXSeries().length > 0)) { IAxis axis = xAxes[0]; double[] xSeries = series[0].getXSeries(); double minx = Double.MAX_VALUE; for (double x : xSeries) { if (minx > x) { minx = x; } } pixelCoordinate = axis.getPixelCoordinate(minx); } return getSwtChart().toControl(getSwtChart().getPlotArea().toDisplay(pixelCoordinate, 0)).x; }

Target:
public int getPointAreaOffset() { int pixelCoordinate = 0; IAxis[] xAxes = getSwtChart().getAxisSet().getXAxes(); ISeries[] series = fSwtChart.getSeriesSet().getSeries(); if ((xAxes.length > 0) && (series.length > 0) && (series[0].getXSeries() != null) && (series[0].getXSeries().length > 0)) { IAxis axis = xAxes[0]; double[] xSeries = series[0].getXSeries(); double minX = Double.MAX_VALUE; for (double x : xSeries) { if (minX > x) { minX = x; } } pixelCoordinate = axis.getPixelCoordinate(minX); } return getSwtChart().toControl(getSwtChart().getPlotArea().toDisplay(pixelCoordinate, 0)).x; }
Source:
protected void addPages() { try { OseeStatusContributionItemFactory.addTo(this, true); String editorName = getResultsEditorProvider().getEditorName(); if (getTabs() == null || getTabs().isEmpty()) { tabs.add(new ResultsEditorHtmlTab("Error", "Error", AHTML.simplePage("Error: No tabs were defined for \"" + editorName + "\""))); } for (IResultsEditorTab tab : getTabs()) { addResultsTab(tab); } if (startPage == null) { addResultsTab(new ResultsEditorHtmlTab("Error", "Error", AHTML.simplePage("Error: Pages creation error for \"" + editorName + "\"; StartPage == null"))); } setPartName(editorName); setActivePage(startPage); } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } }

Target:
protected void addPages() { try { OseeStatusContributionItemFactory.addTo(this, true); String editorName = getResultsEditorProvider().getEditorName(); for (IResultsEditorTab tab : getTabs()) { addResultsTab(tab); } if (startPage == null) { addResultsTab(new ResultsEditorHtmlTab("Error", "Error", AHTML.simplePage("Error: Pages creation error for \"" + editorName + "\"; StartPage == null"))); } setPartName(editorName); setActivePage(startPage); } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } }
Source:
private DefaultTeslaAether getAetherClient() { List<String> remoteUriList = extensionsConfig.getRemoteRepositories(); List<Repository> remoteRepositories = Lists.newArrayList(); for (String uri : remoteUriList) { try { URI u = new URI(uri); Repository r = new Repository(uri); if (u.getUserInfo() != null) { String[] auth = u.getUserInfo().split(":", 2); if (auth.length == 2) { r.setUsername(auth[0]); r.setPassword(auth[1]); } else { log.warn( "Invalid credentials in repository URI, expecting [<user>:<password>], got [%s] for [%s]", u.getUserInfo(), uri ); } } remoteRepositories.add(r); } catch (URISyntaxException e) { throw Throwables.propagate(e); } } if (log.isTraceEnabled() || log.isDebugEnabled()) { return new DefaultTeslaAether( extensionsConfig.getLocalRepository(), remoteRepositories.toArray(new Repository[remoteRepositories.size()]) ); } PrintStream oldOut = System.out; try { System.setOut( new PrintStream( new OutputStream() { @Override public void write(int b) throws IOException { } @Override public void write(byte[] b) throws IOException { } @Override public void write(byte[] b, int off, int len) throws IOException { } } , false, StringUtils.UTF8_STRING ) ); return new DefaultTeslaAether( extensionsConfig.getLocalRepository(), remoteRepositories.toArray(new Repository[remoteRepositories.size()]) ); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } finally { System.setOut(oldOut); } }

Target:
private DefaultTeslaAether getAetherClient() { List<String> remoteUriList = remoteRepositories; List<Repository> remoteRepositories = Lists.newArrayList(); for (String uri : remoteUriList) { try { URI u = new URI(uri); Repository r = new Repository(uri); if (u.getUserInfo() != null) { String[] auth = u.getUserInfo().split(":", 2); if (auth.length == 2) { r.setUsername(auth[0]); r.setPassword(auth[1]); } else { log.warn( "Invalid credentials in repository URI, expecting [<user>:<password>], got [%s] for [%s]", u.getUserInfo(), uri ); } } remoteRepositories.add(r); } catch (URISyntaxException e) { throw Throwables.propagate(e); } } if (log.isTraceEnabled() || log.isDebugEnabled()) { return new DefaultTeslaAether( localRepository, remoteRepositories.toArray(new Repository[remoteRepositories.size()]) ); } PrintStream oldOut = System.out; try { System.setOut( new PrintStream( new OutputStream() { @Override public void write(int b) throws IOException { } @Override public void write(byte[] b) throws IOException { } @Override public void write(byte[] b, int off, int len) throws IOException { } } , false, StringUtils.UTF8_STRING ) ); return new DefaultTeslaAether( localRepository, remoteRepositories.toArray(new Repository[remoteRepositories.size()]) ); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } finally { System.setOut(oldOut); } }
Source:
private String format(PhoneNumberFormat format) { if (this.number != null && this.regionCode != null) { try { PhoneNumber phoneNumber = PHONE_UTIL.parse(this.number, this.regionCode); if (PHONE_UTIL.isValidNumber(phoneNumber)) { return PHONE_UTIL.format(phoneNumber, format); } } catch (Exception e) { } } return number; }

Target:
private String format(PhoneNumberFormat format) { if (this.number != null && this.regionCode != null) { try { PhoneNumber phoneNumber = PHONE_UTIL.parse(this.number, this.regionCode); if (PHONE_UTIL.isValidNumber(phoneNumber)) { return PHONE_UTIL.format(phoneNumber, format); } } catch (NumberParseException e) { } } return number; }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.single_app_view); int position = getIntent().getIntExtra("position", -1); appRecord = CommCareApplication._().getAppAtIndex(position); if (appRecord == null) { Intent i = new Intent(getApplicationContext(), AppManagerActivity.class); startActivity(i); finish(); } String appName = appRecord.getDisplayName(); TextView tv = (TextView)findViewById(R.id.app_name); tv.setText(appName); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.single_app_view); int position = getIntent().getIntExtra("position", -1); appRecord = getAppForPosition(position); if (appRecord == null) { Intent i = new Intent(getApplicationContext(), AppManagerActivity.class); startActivity(i); finish(); } String appName = appRecord.getDisplayName(); TextView tv = (TextView)findViewById(R.id.app_name); tv.setText(appName); }
Source:
private void applyColorPalette() { switch (PreferenceManager.getDefaultSharedPreferences(this).getString("color_palette", "light")) { case "light": AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); break; case "dark": AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); break; case "auto": AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); break; } }

Target:
private void applyColorPalette() { switch (PreferenceManager.getDefaultSharedPreferences(this).getString(PreferencesRepository.KEY_PREF_COLOR_PALETTE, PreferencesRepository.DEFAULT_PREF_COLOR_PALETTE)) { case "light": AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); break; case "dark": AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); break; case "auto": if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); } else { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY); } break; } }
Source:
private static xml getMediaIdForUploadedFileTokenSynchronous(Context context, String ks, String uploadTocken, String fileName, String mimetype) { try { RestAdapter restAdapter = KalturaRestAdapter.buildAdapter(context); String mediaTypeConverted = FileUtilities.kalturaCodeFromMimeType(mimetype); return restAdapter.create(KalturaAPIInterface.class).getMediaIdForUploadedFileTokenSynchronous(ks, uploadTocken, fileName, mediaTypeConverted); } catch (Exception E) { Log.e(APIHelpers.LOG_TAG, E.getMessage()); return null; } }

Target:
private static xml getMediaIdForUploadedFileTokenSynchronous(Context context, String ks, String uploadTocken, String fileName, String mimetype) { try { RestAdapter restAdapter = KalturaRestAdapter.buildAdapter(context); String mediaTypeConverted = FileUtilities.kalturaCodeFromMimeType(mimetype); return restAdapter.create(KalturaAPIInterface.class).getMediaIdForUploadedFileTokenSynchronous(ks, uploadTocken, fileName, mediaTypeConverted); } catch (Exception E) { Log.e(APIHelpers.LOG_TAG, E.toString()); return null; } }
Source:
private static InputStream getRegistryResource(MessageContext synCtx, String key) { InputStream inputStream = null; Object entry = synCtx.getEntry(key); if (entry instanceof OMTextImpl) { if (log.isDebugEnabled()) { log.debug("Value for the key is "); } OMTextImpl text = (OMTextImpl) entry; String content = text.getText(); inputStream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); } return inputStream; }

Target:
private static InputStream getRegistryResource(MessageContext synCtx, String key) { InputStream inputStream = null; Object entry = synCtx.getEntry(key); if (entry instanceof OMTextImpl) { if (log.isDebugEnabled()) { log.debug("Retrieving the key :" + key); } OMTextImpl text = (OMTextImpl) entry; String content = text.getText(); inputStream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); } return inputStream; }
Source:
private void setAutoSave( @SuppressWarnings("restriction") @Preference(value = IPreferenceConstants.SAVE_AUTOMATICALLY, nodePath = "org.eclipse.ui.workbench") boolean autoSave) { if (autoSave) { System.out.println("ON"); if (!initial) { IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (IWorkbenchWindow iWorkbenchWindow : windows) { IWorkbenchPage p = iWorkbenchWindow.getActivePage(); if (p != null) { p.saveAllEditors(false); } } } eventBroker.subscribe(UIEvents.Dirtyable.TOPIC_DIRTY, dirtyHandler); initial = false; } else { eventBroker.unsubscribe(dirtyHandler); System.out.println("OFF"); shutdown(); } }

Target:
public void setAutoSave( @SuppressWarnings("restriction") @Preference(value = IPreferenceConstants.SAVE_AUTOMATICALLY, nodePath = "org.eclipse.ui.workbench") boolean autoSave) { if (autoSave) { eventBroker.subscribe(UIEvents.Dirtyable.TOPIC_DIRTY, dirtyHandler); } else { eventBroker.unsubscribe(dirtyHandler); shutdown(); } }
Source:
public void cleanup() { try (Statement stmt = connection.createStatement()) { List<String> statusTables = new ArrayList<>(); { ResultSet rs = stmt.executeQuery( String.format(ENGLISH, "SELECT tablename FROM pg_tables WHERE tablename LIKE '%s_%%'", escapeParam(statusTableName)) ); while (rs.next()) { statusTables.add(rs.getString(1)); } } statusTables.forEach( statusTable -> { try { ResultSet rs = stmt.executeQuery( String.format(ENGLISH, "SELECT query_id FROM %s WHERE created_at IS NOT NULL AND completed_at < CURRENT_TIMESTAMP - INTERVAL '%d SECOND'", escapeIdent(statusTable), cleanupDuration.getSeconds()) ); if (rs.next()) { stmt.executeUpdate(String.format("DROP TABLE %s", escapeIdent(statusTable))); } } catch (SQLException e) { logger.warn("Failed to drop expired status table: {}. Ignoring...", statusTable, e); } } ); } catch (SQLException ex) { throw new DatabaseException("Failed to list up expired status tables", ex); } }

Target:
public void cleanup() { try (Statement stmt = connection.createStatement()) { List<TableReference> statusTables = new ArrayList<>(); { ResultSet rs = stmt.executeQuery( String.format(ENGLISH, "SELECT schemaname, tablename FROM pg_tables WHERE tablename LIKE '%s_%%'", escapeParam(statusTableNamePrefix)) ); while (rs.next()) { statusTables.add(TableReference.of(rs.getString(1), rs.getString(2))); } } statusTables.forEach( statusTable -> { try { ResultSet rs = stmt.executeQuery( String.format(ENGLISH, "SELECT query_id FROM %s WHERE completed_at < SYSDATE - INTERVAL '%d SECOND'", escapeTableReference(statusTable), cleanupDuration.getSeconds()) ); if (rs.next()) { stmt.executeUpdate(String.format("DROP TABLE %s", escapeTableReference(statusTable))); } } catch (SQLException e) { logger.warn("Failed to drop expired status table: {}. Ignoring this error. To not show this warning message, please confirm that this user has privilege to DROP tables whose name is prefixed with '{}_'", statusTable, statusTableNamePrefix, e); } } ); } catch (SQLException ex) { throw new DatabaseException("Failed to list up expired status tables", ex); } }
Source:
public <T extends Throwable> void expectThrowingOf(Class<T> clazz, String errorMsg, Runnable block) { try { block.run(); flop(errorMsg); } catch (Throwable e) { if (clazz.isInstance(e)) { } else if (org.reactivestreams.tck.support.NonFatal.apply(e)) flop("$errorMsg but " + e); } }

Target:
public <T extends Throwable> void expectThrowingOf(Class<T> clazz, String errorMsg, Runnable block) throws Throwable { try { block.run(); flop(errorMsg); } catch (Throwable e) { if (clazz.isInstance(e)) { } else if (org.reactivestreams.tck.support.NonFatal.apply(e)) { flop(errorMsg + " but " + e); } else { throw e; } } }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> listPermissionSubjects = super.getPermissionCheckSubjects(); listPermissionSubjects.add(new PermissionSubject(getParameters().getStorageDomainId(), VdcObjectType.Disk, ActionGroup.CREATE_DISK)); listPermissionSubjects = QuotaHelper.getInstance().addQuotaPermissionSubject(listPermissionSubjects, getStoragePool(), getQuotaId()); return listPermissionSubjects; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> listPermissionSubjects = super.getPermissionCheckSubjects(); listPermissionSubjects.add(new PermissionSubject(getParameters().getStorageDomainId(), VdcObjectType.Storage, ActionGroup.CREATE_DISK)); listPermissionSubjects = QuotaHelper.getInstance().addQuotaPermissionSubject(listPermissionSubjects, getStoragePool(), getQuotaId()); return listPermissionSubjects; }
Source:
public UninstantiatedDescribable customUninstantiate(@Nonnull UninstantiatedDescribable ud) { Map<String, Object> scmArguments = new HashMap<>(ud.getArguments()); scmArguments.remove("repositoryUrl"); scmArguments.remove("isConfiguredByUrlDynamicValue"); return ud.withArguments(scmArguments); }

Target:
public UninstantiatedDescribable customUninstantiate(@Nonnull UninstantiatedDescribable ud) { Map<String, Object> scmArguments = new TreeMap<>(ud.getArguments()); scmArguments.remove("repositoryUrl"); scmArguments.remove("configuredByUrl"); return ud.withArguments(scmArguments); }
Source:
private String getPerformanceRating() { StringBuilder builder = new StringBuilder(); float percentage = Math.round(((((totalElapsedTime / 1000000.0) * 100.0F) / MAX_TICK_DURATION) * 100.0F) / 100.0F); builder.append(NumberUtils.getColorFromPercentage(100 - Math.min(percentage, 100))); int rest = 20; for (int i = (int) Math.min(percentage, 100); i >= 5; i = i - 5) { builder.append(':'); rest--; } builder.append(ChatColor.DARK_GRAY); for (int i = 0; i < rest; i++) { builder.append(':'); } builder.append(" - "); builder.append(rating.getColor() + ChatUtils.humanize(rating.name())); builder.append(ChatColor.GRAY); builder.append(" ("); builder.append(NumberUtils.roundDecimalNumber(percentage)); builder.append("%)"); return builder.toString(); }

Target:
private String getPerformanceRating() { StringBuilder builder = new StringBuilder(); builder.append(NumberUtils.getColorFromPercentage(100 - Math.min(percentage, 100))); int rest = 20; for (int i = (int) Math.min(percentage, 100); i >= 5; i = i - 5) { builder.append(':'); rest--; } builder.append(ChatColor.DARK_GRAY); for (int i = 0; i < rest; i++) { builder.append(':'); } builder.append(" - "); builder.append(rating.getColor() + ChatUtils.humanize(rating.name())); builder.append(ChatColor.GRAY); builder.append(" ("); builder.append(NumberUtils.roundDecimalNumber(percentage)); builder.append("%)"); return builder.toString(); }
Source:
private void checkTrustedService() { if (getVm() == null || getVmTemplate() == null) { return; } if (getVm().isTrustedService() && !getVmTemplate().isTrustedService()) { auditLogDirector.log(this, AuditLogType.USER_ADD_VM_TEMPLATE_FROM_TRUSTED_TO_UNTRUSTED); } else if (!getVm().isTrustedService() && getVmTemplate().isTrustedService()) { auditLogDirector.log(this, AuditLogType.USER_ADD_VM_TEMPLATE_FROM_UNTRUSTED_TO_TRUSTED); } }

Target:
private void checkTrustedService() { if (!isVmInDb) { return; } if (getVm().isTrustedService() && !getVmTemplate().isTrustedService()) { auditLogDirector.log(this, AuditLogType.USER_ADD_VM_TEMPLATE_FROM_TRUSTED_TO_UNTRUSTED); } else if (!getVm().isTrustedService() && getVmTemplate().isTrustedService()) { auditLogDirector.log(this, AuditLogType.USER_ADD_VM_TEMPLATE_FROM_UNTRUSTED_TO_TRUSTED); } }
Source:
public static void transitionTopologyState(String topologyName, TMasterCommand topologyStateControlCommand, SchedulerStateManagerAdaptor statemgr, TopologyAPI.TopologyState startState, TopologyAPI.TopologyState expectedState, NetworkUtils.TunnelConfig tunnelConfig) throws TMasterException { TopologyAPI.TopologyState state = TMasterUtils.getRuntimeTopologyState(topologyName, statemgr); if (state == null) { throw new TMasterException(String.format( "Topology '%s' is not initialized yet", topologyName)); } if (state == expectedState) { String errMsg = String.format( "Topology {0} command received topology {1} but already in {2} state", topologyStateControlCommand, topologyName, state); throw new TMasterException(errMsg); } if (state != startState) { String errMsg = String.format( "Topology '%s' is not in state '%s'", topologyName, startState); throw new TMasterException(errMsg); } if (!TMasterUtils.sendToTMaster( topologyStateControlCommand.name().toLowerCase(), topologyName, statemgr, tunnelConfig)) { String errMsg = String.format( "Failed to %s topology '%s'", topologyStateControlCommand, topologyName); throw new TMasterException(errMsg); } LOG.log(Level.INFO, "Topology command {0} completed successfully.", topologyStateControlCommand); }

Target:
public static void transitionTopologyState(String topologyName, TMasterCommand topologyStateControlCommand, SchedulerStateManagerAdaptor statemgr, TopologyAPI.TopologyState startState, TopologyAPI.TopologyState expectedState, NetworkUtils.TunnelConfig tunnelConfig) throws TMasterException { TopologyAPI.TopologyState state = TMasterUtils.getRuntimeTopologyState(topologyName, statemgr); if (state == null) { throw new TMasterException(String.format( "Topology '%s' is not initialized yet", topologyName)); } if (state == expectedState) { throw new TMasterException(String.format( "Topology {0} command received topology {1} but already in {2} state", topologyStateControlCommand, topologyName, state)); } if (state != startState) { throw new TMasterException(String.format( "Topology '%s' is not in state '%s'", topologyName, startState)); } TMasterUtils.sendToTMaster( topologyStateControlCommand.name().toLowerCase(), topologyName, statemgr, tunnelConfig); LOG.log(Level.INFO, "Topology command {0} completed successfully.", topologyStateControlCommand); }
Source:
public void test_parallelPrefix$III() { Random rand = new Random(0); int[] list = new int[1000]; for(int i = 0; i < list.length; ++i) { list[i] = rand.nextInt() % 1000; } int begin = 100, end = 500; int[] seqResult = list.clone(); for(int i = begin; i < end - 1; ++i) { seqResult[i + 1] += seqResult[i]; } Arrays.parallelPrefix(list, begin, end, (x, y) -> x + y); assertTrue(Arrays.equals(seqResult, list)); try { Arrays.parallelPrefix(list, begin, end, null); fail(); } catch (NullPointerException expected) { } try { Arrays.parallelPrefix((int[]) null, begin, end, (x, y) -> x + y); fail(); } catch (NullPointerException expected) { } }

Target:
public void test_parallelPrefix$III() { Random rand = new Random(0); int[] list = new int[1000]; for(int i = 0; i < list.length; ++i) { list[i] = rand.nextInt() % 1000; } int begin = 100, end = 500; int[] seqResult = list.clone(); for(int i = begin; i < end - 1; ++i) { seqResult[i + 1] += seqResult[i]; } Arrays.parallelPrefix(list, begin, end, (x, y) -> x + y); assertTrue(Arrays.equals(seqResult, list)); try { Arrays.parallelPrefix(list, begin, end, null); fail(); } catch (NullPointerException expected) { } try { Arrays.parallelPrefix((int[]) null, begin, end, (x, y) -> x + y); fail(); } catch (NullPointerException expected) { } try { Arrays.parallelPrefix(list, end, begin, (x, y) -> x + y); fail(); } catch (IllegalArgumentException expected) { } }
Source:
public void appendAddRecord(final long id, final byte recordType, final EncodingSupport record, final boolean sync, final IOCompletion callback) throws Exception { checkJournalIsLoaded(); lineUpContext(callback); pendingRecords.add(id); Future<?> result = appendExecutor.submit(new Runnable() { @Override public void run() { journalLock.readLock().lock(); try { JournalInternalRecord addRecord = new JournalAddRecord(true, id, recordType, record); JournalFile usedFile = appendRecord(addRecord, false, sync, null, callback); records.put(id, new JournalRecord(usedFile, addRecord.getEncodeSize())); if (logger.isTraceEnabled()) { logger.trace("appendAddRecord::id=" + id + ", userRecordType=" + recordType + ", record = " + record + ", usedFile = " + usedFile); } } catch (Exception e) { ActiveMQJournalLogger.LOGGER.error(e.getMessage(), e); } finally { pendingRecords.remove(id); journalLock.readLock().unlock(); } } }); if (sync && callback == null) { result.get(); } }

Target:
public void appendAddRecord(final long id, final byte recordType, final EncodingSupport record, final boolean sync, final IOCompletion callback) throws Exception { checkJournalIsLoaded(); lineUpContext(callback); pendingRecords.add(id); final SimpleFuture<Boolean> result = newSyncAndCallbackResult(sync, callback); appendExecutor.execute(new Runnable() { @Override public void run() { journalLock.readLock().lock(); try { JournalInternalRecord addRecord = new JournalAddRecord(true, id, recordType, record); JournalFile usedFile = appendRecord(addRecord, false, sync, null, callback); records.put(id, new JournalRecord(usedFile, addRecord.getEncodeSize())); if (logger.isTraceEnabled()) { logger.trace("appendAddRecord::id=" + id + ", userRecordType=" + recordType + ", record = " + record + ", usedFile = " + usedFile); } if (result != null) { result.set(true); } } catch (Exception e) { if (result != null) { result.fail(e); } logger.error("appendAddRecord::" + e, e); } finally { pendingRecords.remove(id); journalLock.readLock().unlock(); } } }); if (result != null) { result.get(); } }
Source:
<R> R tryLock(final K key, final ReturnableDelegate<R> callback, final long time, final TimeUnit unit) throws Throwable { final Lock lock = lockStripes.get(key); if (!lock.tryLock(time, unit)) { String[] threads= new ThreadMonitorTool().getThreads(); Logger.warn(this.getClass(), String.format("Unable to acquire Lock on key %s ", key)); for(String thread: threads) { System.out.println(thread); } throw new DotConcurrentException( String.format("Unable to acquire Lock on key %s ", key) ); } try { return callback.execute(); } finally { lock.unlock(); } }

Target:
<R> R tryLock(final K key, final ReturnableDelegate<R> callback, final long time, final TimeUnit unit) throws Throwable { final Lock lock = lockStripes.get(key); if (!lock.tryLock(time, unit)) { throw new DotConcurrentException( String.format("Unable to acquire Lock on key %s ", key) ); } try { return callback.execute(); } finally { lock.unlock(); } }
Source:
public void run() { decryptJobMetricsTracker.startRequestProcessing(); Exception exception = null; ByteBuffer decryptedBlobContent = null; ByteBuffer decryptedUserMetadata = null; try { Object containerKey = kms.getKey(blobId.getAccountId(), blobId.getContainerId()); Object perBlobKey = cryptoService.decryptKey(encryptedPerBlobKey, containerKey); if (encryptedBlobContent != null) { decryptedBlobContent = cryptoService.decrypt(encryptedBlobContent, perBlobKey); } if (encryptedUserMetadata != null) { decryptedUserMetadata = cryptoService.decrypt(encryptedUserMetadata, perBlobKey); } } catch (Exception e) { exception = e; } finally { decryptJobMetricsTracker.completeRequestProcessing(); callback.onCompletion( exception == null ? new DecryptJobResult(blobId, decryptedBlobContent, decryptedUserMetadata) : null, exception); } }

Target:
public void run() { decryptJobMetricsTracker.onJobProcessingStart(); Exception exception = null; ByteBuffer decryptedBlobContent = null; ByteBuffer decryptedUserMetadata = null; try { Object containerKey = kms.getKey(blobId.getAccountId(), blobId.getContainerId()); Object perBlobKey = cryptoService.decryptKey(encryptedPerBlobKey, containerKey); if (encryptedBlobContent != null) { decryptedBlobContent = cryptoService.decrypt(encryptedBlobContent, perBlobKey); } if (encryptedUserMetadata != null) { decryptedUserMetadata = cryptoService.decrypt(encryptedUserMetadata, perBlobKey); } } catch (Exception e) { exception = e; } finally { decryptJobMetricsTracker.onJobProcessingComplete(); callback.onCompletion( exception == null ? new DecryptJobResult(blobId, decryptedBlobContent, decryptedUserMetadata) : null, exception); } }
Source:
private String prettyPrintContentWithTimeOut( AsyncPrettyPrinter asyncPrettyPrinter, InputStream in) throws IOException { AsyncPrettyPrintingCallable prettyPrintingCallable = new AsyncPrettyPrintingCallable( in, asyncPrettyPrinter); ExecutorService sExecutorService = AsyncPrettyPrinterExecutorHolder.getExecutorService(); Future<String> future = sExecutorService.submit(prettyPrintingCallable); try { return Util.getUninterruptibly(future, PRETTY_PRINT_TIMEOUT_SEC, TimeUnit.SECONDS); } catch (TimeoutException e) { future.cancel(true); return "Time out after " + PRETTY_PRINT_TIMEOUT_SEC + " seconds of attempting to pretty print\n" + Util.readAsUTF8(in); } catch (ExecutionException e) { Throwable cause = e.getCause(); ExceptionUtil.propagateIfInstanceOf(cause, IOException.class); throw ExceptionUtil.propagate(cause); } }

Target:
private String prettyPrintContentWithTimeOut( AsyncPrettyPrinter asyncPrettyPrinter, InputStream in) throws IOException { AsyncPrettyPrintingCallable prettyPrintingCallable = new AsyncPrettyPrintingCallable( in, asyncPrettyPrinter); ExecutorService executorService = AsyncPrettyPrinterExecutorHolder.getExecutorService(); if (executorService == null) { return null; } Future<String> future = executorService.submit(prettyPrintingCallable); try { return Util.getUninterruptibly(future, PRETTY_PRINT_TIMEOUT_SEC, TimeUnit.SECONDS); } catch (TimeoutException e) { future.cancel(true); return "Time out after " + PRETTY_PRINT_TIMEOUT_SEC + " seconds of attempting to pretty print\n" + Util.readAsUTF8(in); } catch (ExecutionException e) { Throwable cause = e.getCause(); ExceptionUtil.propagateIfInstanceOf(cause, IOException.class); throw ExceptionUtil.propagate(cause); } }
Source:
public SamReader.Type type() { return SamReader.Type.BAM_TYPE; }

Target:
public SamReader.Type type() { return SamReader.Type.BAM_HTSGET_TYPE; }
Source:
synchronized public boolean connectOne(long sid, InetSocketAddress electionAddr){ if (senderWorkerMap.get(sid) != null) { LOG.debug("There is a connection already for server " + sid); return true; } Socket sock = null; try { LOG.debug("Opening channel to server " + sid); if (self.isSslQuorum()) { sock = self.getX509Util().createSSLSocket(); } else { sock = new Socket(); } setSockOpts(sock); sock.connect(electionAddr, cnxTO); if (sock instanceof SSLSocket) { ((SSLSocket) sock).startHandshake(); } LOG.debug("Connected to server " + sid); if (quorumSaslAuthEnabled) { initiateConnectionAsync(sock, sid); } else { initiateConnection(sock, sid); } return true; } catch (UnresolvedAddressException e) { LOG.warn("Cannot open channel to " + sid + " at election address " + electionAddr, e); closeSocket(sock); throw e; } catch (X509Exception e) { LOG.warn("Cannot open secure channel to " + sid + " at election address " + electionAddr, e); closeSocket(sock); return false; } catch (IOException e) { LOG.warn("Cannot open channel to " + sid + " at election address " + electionAddr, e); closeSocket(sock); return false; } }

Target:
synchronized boolean connectOne(long sid, InetSocketAddress electionAddr){ if (senderWorkerMap.get(sid) != null) { LOG.debug("There is a connection already for server " + sid); return true; } Socket sock = null; try { LOG.debug("Opening channel to server " + sid); if (self.isSslQuorum()) { sock = self.getX509Util().createSSLSocket(); } else { sock = new Socket(); } setSockOpts(sock); sock.connect(electionAddr, cnxTO); if (sock instanceof SSLSocket) { SSLSocket sslSock = (SSLSocket) sock; sslSock.startHandshake(); LOG.info("SSL handshake complete with - - {}", sslSock.getRemoteSocketAddress(), sslSock.getSession().getProtocol(), sslSock.getSession().getCipherSuite()); } LOG.debug("Connected to server " + sid); if (quorumSaslAuthEnabled) { initiateConnectionAsync(sock, sid); } else { initiateConnection(sock, sid); } return true; } catch (UnresolvedAddressException e) { LOG.warn("Cannot open channel to " + sid + " at election address " + electionAddr, e); closeSocket(sock); throw e; } catch (X509Exception e) { LOG.warn("Cannot open secure channel to " + sid + " at election address " + electionAddr, e); closeSocket(sock); return false; } catch (IOException e) { LOG.warn("Cannot open channel to " + sid + " at election address " + electionAddr, e); closeSocket(sock); return false; } }
Source:
protected int decryptMore() throws IOException { if(finalDone) return -1; int n = input.read(inBuffer); if (n < 0) { decryptFinal(); int remaining = outBuffer.remaining(); if (remaining > 0) { return remaining; } return -1; } else if(n == 0) { return 0; } else { decrypt(); return outBuffer.remaining(); } }

Target:
protected int decryptMore() throws IOException { if(finalDone) { return -1; } int n = input.read(inBuffer); if (n < 0) { decryptFinal(); int remaining = outBuffer.remaining(); if (remaining > 0) { return remaining; } return -1; } else if(n == 0) { return 0; } else { decrypt(); return outBuffer.remaining(); } }
Source:
public boolean evaluate(String uriHost, String uriPath, String uriQuery, String httpStatus, String contentType, String userAgent) { return Pageview.isPageview(uriHost.toString(), uriPath.toString(), uriQuery.toString(), httpStatus.toString(), contentType.toString(), userAgent.toString()); }

Target:
public boolean evaluate( String uriHost, String uriPath, String uriQuery, String httpStatus, String contentType, String userAgent ) { return Pageview.isPageview( uriHost, uriPath, uriQuery, httpStatus, contentType, userAgent ); }
Source:
public static void addLibraryPath(String pathToAdd) { final Field usrPathsField; try { usrPathsField = ClassLoader.class.getDeclaredField("usr_paths"); usrPathsField.setAccessible(true); final String[] paths = (String[]) usrPathsField.get(null); for (String path : paths) { if (path.equals(pathToAdd)) { return; } } final String[] newPaths = Arrays.copyOf(paths, paths.length + 1); newPaths[newPaths.length - 1] = pathToAdd; usrPathsField.set(null, newPaths); for (String x : newPaths) { log.info("New Path " + x); } log.info("Library path " + System.getProperty("java.library.path")); for (String x : (String[]) usrPathsField.get(null)) { log.info("User path " + x); } } catch (NoSuchFieldException | IllegalAccessException e) { throw new RuntimeException("Could not add " + pathToAdd + " to library path", e); } }

Target:
public static void addLibraryPath(String pathToAdd) { final Field usrPathsField; try { usrPathsField = ClassLoader.class.getDeclaredField("usr_paths"); usrPathsField.setAccessible(true); final String[] paths = (String[]) usrPathsField.get(null); for (String path : paths) { if (path.equals(pathToAdd)) { return; } } final String[] newPaths = Arrays.copyOf(paths, paths.length + 1); newPaths[newPaths.length - 1] = pathToAdd; usrPathsField.set(null, newPaths); } catch (NoSuchFieldException | IllegalAccessException e) { throw new RuntimeException("Could not add " + pathToAdd + " to library path", e); } }
Source:
public void updatePartitionWeight(String resourceName, Map<String, Integer> averageWeightMap) { ResourceMonitor monitor = _resourceMonitorMap.get(resourceName); if (monitor == null) { LOG.warn("Failed to update partition weight metric for resource: because resource monitor" + " is not created.", resourceName); return; } monitor.updatePartitionWeightStats(averageWeightMap); }

Target:
public void updatePartitionWeight(String resourceName, Map<String, Integer> averageWeightMap) { ResourceMonitor monitor = getOrCreateResourceMonitor(resourceName); if (monitor == null) { LOG.warn("Failed to update partition weight metric for resource: because resource monitor" + " is not created.", resourceName); return; } monitor.updatePartitionWeightStats(averageWeightMap); }
Source:
public boolean onMenuItemActionCollapse(MenuItem item) { mMenu.findItem(R.id.menu_new_media).setVisible(true); invalidateOptionsMenu(); enableTabs(true); reloadMediaGrid(); return true; }

Target:
public boolean onMenuItemActionCollapse(MenuItem item) { mMenu.findItem(R.id.menu_new_media).setVisible(true); invalidateOptionsMenu(); enableTabs(true); return true; }
Source:
public void correctNFL() throws IOException { copyNFLFiles(); File descriptorFile = new File(ResourceHelpers.resourceFilePath("nonexistent_image/NFL/nextflow.config")); File jsonFile = new File(ResourceHelpers.resourceFilePath("nextflow_rnatoy/test.json")); String toWrite = "docker-images = " + docker_images; File configPath = createTempFile(toWrite); if (configPath == null) { Assert.fail("Could create temp config file"); } ArrayList<String> args = new ArrayList<String>() {{ add("workflow"); add("launch"); add("--local-entry"); add(descriptorFile.getAbsolutePath()); add("--json"); add(jsonFile.getAbsolutePath()); add("--config"); add(configPath.getAbsolutePath()); }}; Client.main(args.toArray(new String[0])); Assert.assertTrue("Final process status was not success", systemOutRule.getLog().contains("Saving copy of NextFlow stdout to: ")); }

Target:
public void correctNFL() throws IOException { copyNFLFiles(); File descriptorFile = new File(ResourceHelpers.resourceFilePath("nonexistent_image/NFL/nextflow.config")); File jsonFile = new File(ResourceHelpers.resourceFilePath("nextflow_rnatoy/test.json")); String toWrite = "docker-images = " + DOCKER_IMAGE_DIRECTORY; File configPath = createTempFile(toWrite); if (configPath == null) { Assert.fail("Could create temp config file"); } ArrayList<String> args = new ArrayList<String>() {{ add("workflow"); add("launch"); add("--local-entry"); add(descriptorFile.getAbsolutePath()); add("--json"); add(jsonFile.getAbsolutePath()); add("--config"); add(configPath.getAbsolutePath()); }}; Client.main(args.toArray(new String[0])); Assert.assertTrue("Final process status was not success", systemOutRule.getLog().contains("Saving copy of NextFlow stdout to: ")); }
Source:
public TestConfiguration(Class<?> testClass, Method testMethod) { this(testClass, testMethod, Collections.EMPTY_SET); }

Target:
public TestConfiguration(Class<?> testClass, Method testMethod) { this(testClass, testMethod, Collections.emptySet()); }
Source:
public TabletIteratorEnvironment(IteratorScope scope, AccumuloConfiguration config) { if (scope == IteratorScope.majc) throw new IllegalArgumentException("must set if compaction is full"); this.scope = scope; this.trm = null; this.config = config; this.fullMajorCompaction = false; this.authorizations = Authorizations.EMPTY; this.topLevelIterators = new ArrayList<SortedKeyValueIterator<Key,Value>>(); }

Target:
public TabletIteratorEnvironment(IteratorScope scope, AccumuloConfiguration config) { if (scope == IteratorScope.majc) throw new IllegalArgumentException("must set if compaction is full"); this.scope = scope; this.trm = null; this.config = config; this.fullMajorCompaction = false; this.authorizations = Authorizations.EMPTY; this.topLevelIterators = new ArrayList<>(); }
Source:
private void createCamelContext() throws Exception { CamelContext camelContext = getContext(); ActiveMQConnectionFactory factory = ActiveMQJMSClient.createConnectionFactory( "(tcp://0.0.0.0:5672,tcp://0.0.0.0:61617)?ha=true;sslEnabled=true;enabledCipherSuites=TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256;enabledProtocols=TLSv1.1,TLSv1.2", "name"); if (factory == null) { return; } factory.setRetryInterval(1000); factory.setRetryIntervalMultiplier(1.0); factory.setReconnectAttempts(-1); SjmsComponent sjms = new SjmsComponent(); ConnectionFactoryResource connectionResource = new ConnectionFactoryResource(1, factory, "admin", "admin"); sjms.setConnectionResource(connectionResource); camelContext.addComponent("sjms", sjms); }

Target:
private void createCamelContext() throws Exception { CamelContext camelContext = getContext(); ActiveMQConnectionFactory factory = ActiveMQJMSClient.createConnectionFactory( "(tcp://0.0.0.0:5672,tcp://0.0.0.0:61617)?ha=true;sslEnabled=true;enabledCipherSuites=TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256;enabledProtocols=TLSv1.1,TLSv1.2", "name"); if (factory == null) { LOGGER.debug("Could not create ActiveMQConnectionFactory"); return; } factory.setRetryInterval(1000); factory.setRetryIntervalMultiplier(1.0); factory.setReconnectAttempts(-1); SjmsComponent sjms = new SjmsComponent(); ConnectionFactoryResource connectionResource = new ConnectionFactoryResource(1, factory, "admin", "admin"); sjms.setConnectionResource(connectionResource); camelContext.addComponent("sjms", sjms); }
Source:
public Integer getPulseTickSpeed(GlowBlock block) { return null; }

Target:
public int getPulseTickSpeed(GlowBlock block) { return 0; }
Source:
private static boolean hasJavadoc(DetailAST ast) { final boolean hasBefore = ast.getPreviousSibling() != null && isJavadoc(ast.getPreviousSibling()); final Optional<DetailAST> firstAnnotationChild = Optional.of(ast.getFirstChild()) .map(DetailAST::getFirstChild) .map(DetailAST::getFirstChild); boolean hasWithAnnotation = false; if (firstAnnotationChild.isPresent()) { for (DetailAST child = firstAnnotationChild.get(); child != null; child = child.getNextSibling()) { if (isJavadoc(child)) { hasWithAnnotation = true; break; } } } return hasBefore || hasWithAnnotation; }

Target:
private static boolean hasJavadoc(DetailAST ast) { final boolean hasJavadocBefore = ast.getPreviousSibling() != null && isJavadoc(ast.getPreviousSibling()); return hasJavadocBefore || hasJavadocAboveAnnotation(ast); }