auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String toString() { return "Reference: " + referenceId + ", Id: " + id + ", errors: " + errors; }

Target:
public String toString() { final StringBuilder buildy = new StringBuilder("Reference: ").append(referenceId).append(", Id: "); final List<RestError> anyErrors = getErrors(); if (anyErrors.isEmpty()) { buildy.append(", with no errors"); } else { buildy.append(", with "); buildy.append(anyErrors.size()); buildy.append(" error(s)"); } return buildy.toString(); }
Source:
public static boolean isJobServiceWithSameParamsPending(Context context, ComponentName componentName, PersistableBundle bundleCompare, String exceptKey) { JobScheduler scheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE); boolean jobAlreadyScheduled = false; for (JobInfo jobInfo : scheduler.getAllPendingJobs()) { if (jobInfo.getService().getClassName().compareTo(componentName.getClassName()) == 0) { PersistableBundle extras = jobInfo.getExtras(); if (extras != null) { Set<String> keySetOne = extras.keySet(); Set<String> keySetTwo = bundleCompare.keySet(); if ((exceptKey == null && (keySetOne.size() == keySetTwo.size())) || ((exceptKey != null && (keySetOne.size() - 1 == keySetTwo.size())) && extras.keySet().containsAll(bundleCompare.keySet()))) { jobAlreadyScheduled = true; for (String key : bundleCompare.keySet()) { Object one = extras.get(key); Object two = bundleCompare.get(key); if (!one.equals(two)) { jobAlreadyScheduled = false; break; } } if (jobAlreadyScheduled) { AppLog.i(AppLog.T.STATS, "Job was already scheduled"); break; } } } } } return jobAlreadyScheduled; }

Target:
public static boolean isJobServiceWithSameParamsPending(Context context, ComponentName componentName, PersistableBundle bundleCompare, String exceptKey) { JobScheduler scheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE); boolean jobAlreadyScheduled = false; List<JobInfo> jobs = scheduler.getAllPendingJobs(); if (jobs == null) { return jobAlreadyScheduled; } for (JobInfo jobInfo : jobs) { if (jobInfo.getService().getClassName().compareTo(componentName.getClassName()) == 0) { PersistableBundle extras = jobInfo.getExtras(); if (extras != null) { Set<String> keySetOne = extras.keySet(); Set<String> keySetTwo = bundleCompare.keySet(); if ((exceptKey == null && (keySetOne.size() == keySetTwo.size())) || ((exceptKey != null && (keySetOne.size() - 1 == keySetTwo.size())) && extras.keySet().containsAll(bundleCompare.keySet()))) { jobAlreadyScheduled = true; for (String key : bundleCompare.keySet()) { Object one = extras.get(key); Object two = bundleCompare.get(key); if ((one != null && two == null) || (one == null && two != null)) { jobAlreadyScheduled = false; break; } if (one == two) { continue; } if (one instanceof int[] && two instanceof int[]) { if (Arrays.equals((int[]) one, (int[]) two)) { continue; } else { jobAlreadyScheduled = false; break; } } else { if (!one.equals(two)) { jobAlreadyScheduled = false; break; } } } if (jobAlreadyScheduled) { AppLog.i(AppLog.T.STATS, "Job was already scheduled"); return jobAlreadyScheduled; } } } } } return jobAlreadyScheduled; }
Source:
private Collection<ConditionalStreamListenerHandler> findMatchingHandlers(Message<?> message) { ArrayList<ConditionalStreamListenerHandler> matchingMethods = new ArrayList<>(); for (ConditionalStreamListenerHandler conditionalStreamListenerHandlerMethod : this.handlerMethods) { if (conditionalStreamListenerHandlerMethod.getCondition() == null) { matchingMethods.add(conditionalStreamListenerHandlerMethod); } else { Object value = conditionalStreamListenerHandlerMethod.getCondition().getValue(this.evaluationContext, message); if (Boolean.class.isAssignableFrom(value.getClass())) { if ((Boolean) value) { matchingMethods.add(conditionalStreamListenerHandlerMethod); } } else if (Boolean.valueOf(String.valueOf(value))) { matchingMethods.add(conditionalStreamListenerHandlerMethod); } } } return matchingMethods; }

Target:
private Collection<ConditionalStreamListenerHandler> findMatchingHandlers(Message<?> message) { ArrayList<ConditionalStreamListenerHandler> matchingMethods = new ArrayList<>(); for (ConditionalStreamListenerHandler conditionalStreamListenerHandlerMethod : this.handlerMethods) { if (conditionalStreamListenerHandlerMethod.getCondition() == null) { matchingMethods.add(conditionalStreamListenerHandlerMethod); } else { boolean conditionMetOnMessage = conditionalStreamListenerHandlerMethod.getCondition().getValue( this.evaluationContext, message, Boolean.class); if (conditionMetOnMessage) { matchingMethods.add(conditionalStreamListenerHandlerMethod); } } } return matchingMethods; }
Source:
public static void main(String[] args) throws Exception { MainDc mainInstance = new MainDc(); Properties nuroDCProp = new Properties(); mainInstance.loadDefaultValues(); mainInstance.loadFromEnrivonmentVariables(); try { nuroDCProp.load(new FileInputStream(mainInstance.configFilePath)); } catch (FileNotFoundException ex) { logger.error("Properties file not found"); throw new RuntimeException("Properties file not found"); } catch (IOException ex) { logger.error("Error while parsing properties file"); throw new RuntimeException("Error while parsing properties file"); } int port; try { port = Integer.parseInt(mainInstance.managerPort); } catch (NumberFormatException ex) { logger.error("Error while converting manager port - must be an integer"); throw new RuntimeException("Error while parsing properties file"); } Registry.initialize(mainInstance.managerIp, port, nuroDCProp); Registry.startMonitoring(); }

Target:
public static void main(String[] args) throws Exception { MainDc mainInstance = new MainDc(); if (args.length > 0) { mainInstance.configFilePath = args[0]; } else { mainInstance.configFilePath = CONFIG_FILE_PATH; } Properties nuroDCProp = new Properties(); try { nuroDCProp.load(new FileInputStream(mainInstance.configFilePath)); } catch (FileNotFoundException ex) { logger.error("Properties file not found"); throw new RuntimeException("Properties file not found"); } catch (IOException ex) { logger.error("Error while parsing properties file"); throw new RuntimeException("Error while parsing properties file"); } Registry.initialize(nuroDCProp); Registry.startMonitoring(); }
Source:
public FontManager(String preferredFont, AssetManager assets) { fonts.clear(); fonts.put("default", Typeface.defaultFromStyle(Typeface.NORMAL)); String[] files = null; try { files = assets.list(FONT_PATH); } catch (IOException | RuntimeException e) { e.printStackTrace(); } if (files == null) { Timber.w("Couldn't load font assets from %s", FONT_PATH); return; } for (String file : files) { String fileName = String.format("%s/%s", FONT_PATH, file); fonts.put(fileName, Typeface.createFromAsset(assets, fileName)); Timber.i("Processed Font: %s", fileName); } setCurrentFont(preferredFont); }

Target:
private FontManager(String preferredFont, AssetManager assets) { buildFontList(preferredFont, assets); }
Source:
public MarkupFormatter getMarkupFormatter() { return getJenkins().getMarkupFormatter(); }

Target:
public MarkupFormatter getMarkupFormatter() { return Jenkins.getInstance().getMarkupFormatter(); }
Source:
public void onSaveDefaultActiveFilter(@Observes final SavedFilterAsDefaultActiveEvent event) { filterSettingsManager.saveDefaultActiveFilter(event.getSavedFilter().getKey(), () -> { view.removeAllSavedFilters(); loadSavedFilters(); }); }

Target:
public void onSaveDefaultActiveFilter(@Observes final SavedFilterAsDefaultActiveEvent event) { filterSettingsManager.saveDefaultActiveFilter(event.getSavedFilter().getKey(), () -> view.updateSavedFiltersDefault(event.getSavedFilter().getKey()) ); }
Source:
public void stop() { IoUtils.safeClose(normalServer); IoUtils.safeClose(secureServer); httpAuthenticationFactory.shutdownAuthenticationMechanismFactoryExecutory(); }

Target:
public void stop() { IoUtils.safeClose(normalServer); IoUtils.safeClose(secureServer); }
Source:
private ObjectReader configureObjReader() { this.count=0; CsvSchema firstLineSchema = getCsvSchema()!=null? getCsvSchema():CsvSchema.emptySchema().withHeader(); ObjectReader objectReader = configureCsvMapper().readerFor(JsonNode.class); return objectReader.with(firstLineSchema); }

Target:
private ObjectReader configureObjReader() { this.count=0; CsvSchema firstLineSchema = getCsvSchema()!=null? getCsvSchema():CsvSchema.emptySchema().withHeader(); CsvMapper csvMapper = getCsvMapper()!=null ? getCsvMapper() : configureCsvMapper(); ObjectReader objectReader = csvMapper.readerFor(JsonNode.class); return objectReader.with(firstLineSchema); }
Source:
public void perform(Value value) { String effectiveValue = value.asString(); if (trim) { effectiveValue = effectiveValue.trim(); } if (Strings.isEmpty(effectiveValue)) { throw new IllegalArgumentException(NLS.get("RequiredCheck.errorMsg")); } }

Target:
public void perform(Value value) { String effectiveValue = trim ? value.getString() : value.getRawString(); if (Strings.isEmpty(effectiveValue)) { throw new IllegalArgumentException(NLS.get("RequiredCheck.errorMsg")); } }
Source:
public static void assertOperatorIsBlocked(Operator operator, Duration timeout) { try { operator.isBlocked().get(timeout.toMillis(), TimeUnit.MILLISECONDS); fail("Operator is expected to be blocked for at least " + timeout.toString()); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("interrupted", e); } catch (ExecutionException e) { throw new RuntimeException(e.getCause()); } catch (TimeoutException ignored) { } }

Target:
public static void assertOperatorIsBlocked(Operator operator, Duration timeout) { if (waitForOperatorToUnblock(operator, timeout)) { fail("Operator is expected to be blocked for at least " + timeout.toString()); } }
Source:
public Emailer(final Props props, final CommonMetrics commonMetrics) { super(props); this.commonMetrics = requireNonNull(commonMetrics, "commonMetrics is null."); this.azkabanName = props.getString("azkaban.name", "azkaban"); this.mailHost = props.getString("mail.host", "localhost"); this.mailPort = props.getInt("mail.port", DEFAULT_SMTP_PORT); this.mailUser = props.getString("mail.user", ""); this.mailPassword = props.getString("mail.password", ""); this.mailSender = props.getString("mail.sender", ""); this.tls = props.getString("mail.tls", "false"); final int mailTimeout = props.getInt("mail.timeout.millis", 30000); EmailMessage.setTimeout(mailTimeout); final int connectionTimeout = props.getInt("mail.connection.timeout.millis", 30000); EmailMessage.setConnectionTimeout(connectionTimeout); EmailMessage.setTotalAttachmentMaxSize(getAttachmentMaxSize()); this.clientHostname = props.getString("jetty.hostname", "localhost"); if (props.getBoolean("jetty.use.ssl", true)) { this.scheme = HTTPS; this.clientPortNumber = Integer.toString(props.getInt("mail.jetty.ssl.port", props.getInt("jetty.ssl.port", Constants.DEFAULT_SSL_PORT_NUMBER))); } else { this.scheme = HTTP; this.clientPortNumber = Integer.toString(props.getInt("mail.jetty.port", props.getInt("jetty.port", Constants.DEFAULT_PORT_NUMBER))); } this.testMode = props.getBoolean("test.mode", false); }

Target:
public Emailer(final Props props, final CommonMetrics commonMetrics) { super(props); this.commonMetrics = requireNonNull(commonMetrics, "commonMetrics is null."); this.azkabanName = props.getString("azkaban.name", "azkaban"); this.mailHost = props.getString("mail.host", "localhost"); this.mailPort = props.getInt("mail.port", DEFAULT_SMTP_PORT); this.mailUser = props.getString("mail.user", ""); this.mailPassword = props.getString("mail.password", ""); this.mailSender = props.getString("mail.sender", ""); this.tls = props.getString("mail.tls", "false"); final int mailTimeout = props.getInt("mail.timeout.millis", 30000); EmailMessage.setTimeout(mailTimeout); final int connectionTimeout = props.getInt("mail.connection.timeout.millis", 30000); EmailMessage.setConnectionTimeout(connectionTimeout); EmailMessage.setTotalAttachmentMaxSize(getAttachmentMaxSize()); this.clientHostname = props.getString(ConfigurationKeys.AZKABAN_WEBSERVER_EXTERNAL_HOSTNAME, props.getString("jetty.hostname", "localhost")); if (props.getBoolean("jetty.use.ssl", true)) { this.scheme = HTTPS; this.clientPortNumber = Integer.toString(props.getInt(ConfigurationKeys.AZKABAN_WEBSERVER_EXTERNAL_SSL_PORT, props.getInt("jetty.ssl.port", Constants.DEFAULT_SSL_PORT_NUMBER))); } else { this.scheme = HTTP; this.clientPortNumber = Integer.toString(props.getInt(ConfigurationKeys.AZKABAN_WEBSERVER_EXTERNAL_PORT, props.getInt("jetty.port", Constants.DEFAULT_PORT_NUMBER))); } this.testMode = props.getBoolean("test.mode", false); }
Source:
private void disableSystemAudioIfExist() { assertRunOnServiceThread(); if (getAvrDeviceInfo() == null) { return; } removeAction(SystemAudioActionFromAvr.class); removeAction(SystemAudioActionFromTv.class); removeAction(SystemAudioAutoInitiationAction.class); removeAction(SystemAudioStatusAction.class); removeAction(VolumeControlAction.class); setSystemAudioMode(false); }

Target:
private void disableSystemAudioIfExist() { assertRunOnServiceThread(); if (getAvrDeviceInfo() == null) { return; } removeAction(SystemAudioActionFromAvr.class); removeAction(SystemAudioActionFromTv.class); removeAction(SystemAudioAutoInitiationAction.class); removeAction(SystemAudioStatusAction.class); removeAction(VolumeControlAction.class); if (!mService.isControlEnabled()) { setSystemAudioMode(false); } }
Source:
public int getClassLoadingCount() throws IOException, InterruptedException { if (getChannel() == null) { return -1; } return channel.call(new LoadingCount(false)); }

Target:
public int getClassLoadingCount() throws IOException, InterruptedException { if (channel == null) { return -1; } return channel.call(new LoadingCount(false)); }
Source:
private void loadContainers(final IDockerConnection connection) { final Job loadContainersJob = new Job(DVMessages .getFormattedString("ContainersLoadJob.msg", connection.getUri())) { @Override protected IStatus run(final IProgressMonitor monitor) { connection.getContainers(true); Display.getDefault().asyncExec(() -> { viewer.refresh(); }); return Status.OK_STATUS; } }; loadContainersJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { } }); loadContainersJob.schedule(); }

Target:
private void loadContainers(final IDockerConnection connection) { final Job loadContainersJob = new Job(DVMessages .getFormattedString("ContainersLoadJob.msg", connection.getUri())) { @Override protected IStatus run(final IProgressMonitor monitor) { connection.getContainers(true); Display.getDefault().asyncExec(() -> { viewer.refresh(); }); return Status.OK_STATUS; } }; loadContainersJob.schedule(); }
Source:
private void readToLogEnd() { log.trace("Reading to end of offset log"); Set<TopicPartition> assignment = consumer.assignment(); Map<TopicPartition, Long> endOffsets = consumer.endOffsets(assignment); log.trace("Reading to end of log offsets {}", endOffsets); while (!endOffsets.isEmpty()) { Iterator<Map.Entry<TopicPartition, Long>> it = endOffsets.entrySet().iterator(); while (it.hasNext()) { Map.Entry<TopicPartition, Long> entry = it.next(); TopicPartition topicPartition = entry.getKey(); Long endOffset = entry.getValue(); long lastConsumedOffset = consumer.position(topicPartition); if (lastConsumedOffset >= endOffset) { log.trace("Reached end offset for {}", endOffset, topicPartition); it.remove(); } else { log.trace( "Behind end offset for {}; last-consumed offset is {}", endOffset, topicPartition, lastConsumedOffset); poll(Integer.MAX_VALUE); break; } } } }

Target:
private void readToLogEnd() { log.trace("Reading to end of offset log"); Set<TopicPartition> assignment = consumer.assignment(); Map<TopicPartition, Long> endOffsets = consumer.endOffsets(assignment); log.trace("Reading to end of log offsets {}", endOffsets); while (!endOffsets.isEmpty()) { Iterator<Map.Entry<TopicPartition, Long>> it = endOffsets.entrySet().iterator(); while (it.hasNext()) { Map.Entry<TopicPartition, Long> entry = it.next(); TopicPartition topicPartition = entry.getKey(); long endOffset = entry.getValue(); long lastConsumedOffset = consumer.position(topicPartition); if (lastConsumedOffset >= endOffset) { log.trace("Read to end offset for {}", endOffset, topicPartition); it.remove(); } else { log.trace("Behind end offset for {}; last-read offset is {}", endOffset, topicPartition, lastConsumedOffset); poll(Integer.MAX_VALUE); break; } } } }
Source:
public BinaryMemcacheClient<V> connectBinary() { final Authenticator authenticator = firstNonNull( this.authenticator, BinaryAuthenticationValidator.INSTANCE); authenticator.validate(true); return new DefaultBinaryMemcacheClient<>( connectRaw(true, authenticator), metrics, valueTranscoder, charset, maxKeyLength); }

Target:
public BinaryMemcacheClient<V> connectBinary() { final Authenticator authenticator = this.authenticator.orElse(BinaryAuthenticationValidator.getInstance()); authenticator.validate(true); return new DefaultBinaryMemcacheClient<>( connectRaw(true, authenticator), metrics, valueTranscoder, charset, maxKeyLength); }
Source:
private void getAllMembersHelper(IResource res, ArrayList<IResource> ret) { if (res instanceof IContainer) { IContainer cont = (IContainer) res; try { for (IResource r : cont.members()) { if (r.getLocation().toFile().isFile()) { ret.add(r); } else { getAllMembersHelper(r, ret); } } } catch (CoreException e) { } } }

Target:
private void getAllMembersHelper(IResource res, ArrayList<IResource> ret) { ArrayList<IResource> tmp = new ArrayList<IResource> (); if (res instanceof IContainer) { IContainer cont = (IContainer) res; try { for (IResource r : cont.members()) { if (r.getLocation().toFile().isFile()) { tmp.add(r); } else { getAllMembersHelper(r, tmp); } } } catch (CoreException e) { return; } ret.addAll(tmp); } }
Source:
private synchronized void checkFile(File file) { if (!processedFiles.contains(file.getAbsolutePath())) { processedFiles.add(file.getAbsolutePath()); listener.onFileCreate(file); } else { LOG.info("File already processed {}.", file); } }

Target:
private synchronized void checkFile(File file) { if (!processedFiles.contains(file.getAbsolutePath())) { try { LOG.debug("Start processing file {}", file); listener.onFileCreate(file); processedFiles.add(file.getAbsolutePath()); } catch (IOException e) { LOG.error("File has been processed with error {}", e); } } else { LOG.info("File already processed {}.", file); } }
Source:
public int wordCount(DataStore<String, WebPage> inStore, DataStore<String, TokenDatum> outStore) throws IOException { GoraSparkEngine<String, WebPage> goraSparkEngine = new GoraSparkEngine<>(String.class, WebPage.class); SparkConf sparkConf = new SparkConf().setAppName("Gora Spark Word Count Application").setMaster("local"); Class[] c = new Class[1]; c[0] = inStore.getPersistentClass(); sparkConf.registerKryoClasses(c); JavaSparkContext sc = new JavaSparkContext(sparkConf); JavaPairRDD<String, WebPage> goraRDD = goraSparkEngine.initialize(sc, inStore); JavaPairRDD<String, String> goraRDDFlatenned = goraRDD.flatMapValues(flatMapFun); long count = goraRDD.count(); log.info("Total Web page count: {}", count); JavaRDD<Tuple2<String, Long>> mappedGoraRdd = goraRDDFlatenned.values().map(mapFunc); System.out.println(mappedGoraRdd.collect()); JavaPairRDD<String, TokenDatum> reducedGoraRdd = JavaPairRDD.fromJavaRDD(mappedGoraRdd).reduceByKey(redFunc) .mapToPair(metricFunc); log.info("SparkWordCount debug purpose TokenDatum print starts:"); Map<String, TokenDatum> tokenDatumMap = reducedGoraRdd.collectAsMap(); for (String key : tokenDatumMap.keySet()) { log.info(key); log.info(tokenDatumMap.get(key).toString()); } log.info("SparkWordCount debug purpose TokenDatum print ends:"); System.out.println(reducedGoraRdd.collect()); Configuration sparkHadoopConf = goraSparkEngine.generateOutputConf(outStore); reducedGoraRdd.saveAsNewAPIHadoopDataset(sparkHadoopConf); System.out.println(outStore.get("d")); return 1; }

Target:
public int wordCount(DataStore<String, WebPage> inStore, DataStore<String, TokenDatum> outStore) throws IOException { GoraSparkEngine<String, WebPage> goraSparkEngine = new GoraSparkEngine<>(String.class, WebPage.class); SparkConf sparkConf = new SparkConf().setAppName("Gora Spark Word Count Application").setMaster("local"); Class[] c = new Class[1]; c[0] = inStore.getPersistentClass(); sparkConf.registerKryoClasses(c); JavaSparkContext sc = new JavaSparkContext(sparkConf); JavaPairRDD<String, WebPage> goraRDD = goraSparkEngine.initialize(sc, inStore); JavaPairRDD<String, String> goraRDDFlatenned = goraRDD.flatMapValues(flatMapFun); long count = goraRDD.count(); log.info("Total Web page count: {}", count); JavaRDD<Tuple2<String, Long>> mappedGoraRdd = goraRDDFlatenned.values().map(mapFunc); JavaPairRDD<String, TokenDatum> reducedGoraRdd = JavaPairRDD.fromJavaRDD(mappedGoraRdd).reduceByKey(redFunc) .mapToPair(metricFunc); log.info("SparkWordCount debug purpose TokenDatum print starts:"); Map<String, TokenDatum> tokenDatumMap = reducedGoraRdd.collectAsMap(); for (String key : tokenDatumMap.keySet()) { log.info(key); log.info(tokenDatumMap.get(key).toString()); } log.info("SparkWordCount debug purpose TokenDatum print ends:"); log.info(reducedGoraRdd.collect().toString()); Configuration sparkHadoopConf = goraSparkEngine.generateOutputConf(outStore); reducedGoraRdd.saveAsNewAPIHadoopDataset(sparkHadoopConf); return 1; }
Source:
public static int getCategoryOfFilterMatch(String documentFilter, String completionFilter) { if (documentFilter == null || documentFilter.isEmpty()) { return 5; } else if (completionFilter.matches("^(|.*\\W)" + documentFilter + "(|\\W.*)$")) { return 1; } else if (completionFilter.matches("^(|.*\\W)" + documentFilter + ".*$")) { return 2; } else if (completionFilter.contains(documentFilter)) { return 3; } else if (isSubstringFoundOrderedInString(documentFilter, completionFilter)) { return 4; } return 5; }

Target:
public static int getCategoryOfFilterMatch(String documentFilter, String completionFilter) { if (documentFilter.isEmpty()) { return 5; } documentFilter = documentFilter.toLowerCase(); completionFilter = completionFilter.toLowerCase(); int subIndex = completionFilter.indexOf(documentFilter); int topCategory = 5; if (subIndex == -1) { return isSubstringFoundOrderedInString(documentFilter, completionFilter) ? 4 : 5; } while (subIndex != -1) { if (subIndex > 0 && Character.isLetterOrDigit(completionFilter.charAt(subIndex - 1))) { topCategory = Math.min(topCategory, 3); } else if (subIndex + documentFilter.length() < completionFilter.length() - 1 && Character.isLetterOrDigit(completionFilter.charAt(subIndex + documentFilter.length() + 1))) { topCategory = Math.min(topCategory, 2); } else { topCategory = 1; } if (topCategory == 1) { break; } subIndex = completionFilter.indexOf(documentFilter, subIndex + 1); } return topCategory; }
Source:
public Builder(final WebDriver driver, final URL script) { this.driver = driver; this.script = script; AXE.inject(this.driver, this.script, this.skipFrames); }

Target:
public Builder(final WebDriver driver, final URL script) { this.driver = driver; this.script = script; }
Source:
private void parse(InputStream in, boolean recurse) throws IOException, MessagingException { mHeader.clear(); mFrom = null; mTo = null; mCc = null; mBcc = null; mReplyTo = null; xOriginalTo = null; deliveredTo = null; xEnvelopeTo = null; mMessageId = null; mReferences = null; mInReplyTo = null; mSentDate = null; mBody = null; MimeConfig.Builder configBuilder = new MimeConfig.Builder(); configBuilder.setMaxHeaderLen(-1); configBuilder.setMaxLineLen(-1); configBuilder.setMaxHeaderCount(-1); MimeStreamParser parser = new MimeStreamParser(configBuilder.build()); parser.setContentHandler(new MimeMessageBuilder(new DefaultBodyFactory())); if (recurse) { parser.setRecurse(); } try { parser.parse(new EOLConvertingInputStream(in)); } catch (MimeException me) { throw new MessagingException(me.getMessage(), me); } }

Target:
private void parse(InputStream in, boolean recurse) throws IOException, MessagingException { mHeader.clear(); mFrom = null; mTo = null; mCc = null; mBcc = null; mReplyTo = null; xOriginalTo = null; deliveredTo = null; xEnvelopeTo = null; mMessageId = null; mReferences = null; mInReplyTo = null; mSentDate = null; mBody = null; MimeConfig parserConfig = new MimeConfig.Builder() .setMaxHeaderLen(-1) .setMaxLineLen(-1) .setMaxHeaderCount(-1) .build(); MimeStreamParser parser = new MimeStreamParser(parserConfig); parser.setContentHandler(new MimeMessageBuilder(new DefaultBodyFactory())); if (recurse) { parser.setRecurse(); } try { parser.parse(new EOLConvertingInputStream(in)); } catch (MimeException me) { throw new MessagingException(me.getMessage(), me); } }
Source:
public void testStorageTypeStatsJMX() throws Exception { URL baseUrl = new URL (cluster.getHttpUri(0)); String result = readOutput(new URL(baseUrl, "/jmx")); Map<String, Object> stat = (Map<String, Object>) JSON.parse(result); Object[] beans =(Object[]) stat.get("beans"); Map<String, Object> blockStats = null; for (Object bean : beans) { Map<String, Object> map = (Map<String, Object>) bean; if (map.get("name").equals("Hadoop:service=NameNode,name=BlockStats")) { blockStats = map; } } assertNotNull(blockStats); Object[] storageTypeStatsList = (Object[])blockStats.get("StorageTypeStats"); assertNotNull(storageTypeStatsList); assertEquals(4, storageTypeStatsList.length); Set<String> typesPresent = new HashSet<> (); for (Object obj : storageTypeStatsList) { Map<String, Object> entry = (Map<String, Object>)obj; String storageType = (String)entry.get("key"); Map<String,Object> storageTypeStats = (Map<String,Object>)entry.get("value"); typesPresent.add(storageType); if (storageType.equals("ARCHIVE") || storageType.equals("DISK") ) { assertEquals(3L, storageTypeStats.get("nodesInService")); } else if (storageType.equals("RAM_DISK")) { assertEquals(7L, storageTypeStats.get("nodesInService")); } else if (storageType.equals("NVDIMM")) { assertEquals(1L, storageTypeStats.get("nodesInService")); } else { fail(); } } assertTrue(typesPresent.contains("ARCHIVE")); assertTrue(typesPresent.contains("DISK")); assertTrue(typesPresent.contains("RAM_DISK")); assertTrue(typesPresent.contains("NVDIMM")); }

Target:
public void testStorageTypeStatsJMX() throws Exception { URL baseUrl = new URL (cluster.getHttpUri(0)); String result = readOutput(new URL(baseUrl, "/jmx")); Map<String, Object> stat = (Map<String, Object>) JSON.parse(result); Object[] beans =(Object[]) stat.get("beans"); Map<String, Object> blockStats = null; for (Object bean : beans) { Map<String, Object> map = (Map<String, Object>) bean; if (map.get("name").equals("Hadoop:service=NameNode,name=BlockStats")) { blockStats = map; } } assertNotNull(blockStats); Object[] storageTypeStatsList = (Object[])blockStats.get("StorageTypeStats"); assertNotNull(storageTypeStatsList); assertEquals(4, storageTypeStatsList.length); Set<String> typesPresent = new HashSet<> (); for (Object obj : storageTypeStatsList) { Map<String, Object> entry = (Map<String, Object>)obj; String storageType = (String)entry.get("key"); Map<String,Object> storageTypeStats = (Map<String,Object>)entry.get("value"); typesPresent.add(storageType); switch (storageType) { case "ARCHIVE": case "DISK": assertEquals(3L, storageTypeStats.get("nodesInService")); break; case "RAM_DISK": assertEquals(7L, storageTypeStats.get("nodesInService")); break; case "NVDIMM": assertEquals(1L, storageTypeStats.get("nodesInService")); break; default: fail(); } } assertTrue(typesPresent.contains("ARCHIVE")); assertTrue(typesPresent.contains("DISK")); assertTrue(typesPresent.contains("RAM_DISK")); assertTrue(typesPresent.contains("NVDIMM")); }
Source:
public void testExpandedImageUsingInvalidUrl() throws ImageStore.CantGetImageException{ final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); intent.putExtra("mp_imgurl", ""); when(mpPushSpy.getBitmapFromUrl(VALID_URL)).thenReturn(null); mpPushSpy.createNotification(intent); verify(mpPushSpy).getBitmapFromUrl(VALID_URL); verify(builderSpy).setStyle(new Notification.BigTextStyle().setSummaryText("MESSAGE")); }

Target:
public void testExpandedImageUsingInvalidUrl() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); intent.putExtra("mp_img", INVALID_IMAGE_URL); when(mpPushSpy.getBitmapFromUrl(INVALID_IMAGE_URL)).thenReturn(null); mpPushSpy.createNotification(intent); verify(mpPushSpy).getBitmapFromUrl(INVALID_IMAGE_URL); verify(mpPushSpy).setBigTextStyle("MESSAGE"); }
Source:
@Test public void testWindowOnWindowDoesNotCombineProjects() { final String query = "SELECT ROW_NUMBER() OVER (ORDER BY rn)\n" + "FROM (SELECT *,\n" + " ROW_NUMBER() OVER (ORDER BY \"product_id\") as rn\n" + " FROM \"foodmart\".\"product\")"; final String expected = "SELECT ROW_NUMBER() OVER (ORDER BY \"RN\")\n" + "FROM (SELECT \"product_class_id\", \"product_id\", \"brand_name\"," + " \"product_name\", \"SKU\", \"SRP\", \"gross_weight\"," + " \"net_weight\", \"recyclable_package\", \"low_fat\"," + " \"units_per_case\", \"cases_per_pallet\", \"shelf_width\"," + " \"shelf_height\", \"shelf_depth\"," + " ROW_NUMBER() OVER (ORDER BY \"product_id\") AS \"RN\"\n" + "FROM \"foodmart\".\"product\") AS \"t\""; sql(query) .withPostgresql() .ok(expected); }

Target:
@Test void testWindowOnWindowDoesNotCombineProjects() { final String query = "SELECT ROW_NUMBER() OVER (ORDER BY rn)\n" + "FROM (SELECT *,\n" + " ROW_NUMBER() OVER (ORDER BY \"product_id\") as rn\n" + " FROM \"foodmart\".\"product\")"; final String expected = "SELECT ROW_NUMBER() OVER (ORDER BY \"RN\")\n" + "FROM (SELECT \"product_class_id\", \"product_id\", \"brand_name\"," + " \"product_name\", \"SKU\", \"SRP\", \"gross_weight\"," + " \"net_weight\", \"recyclable_package\", \"low_fat\"," + " \"units_per_case\", \"cases_per_pallet\", \"shelf_width\"," + " \"shelf_height\", \"shelf_depth\"," + " ROW_NUMBER() OVER (ORDER BY \"product_id\") AS \"RN\"\n" + "FROM \"foodmart\".\"product\") AS \"t\""; sql(query) .withPostgresql() .ok(expected); }
Source:
public void addDistinctLocationByPartOfDay(Point point) { boolean distinct = true; for (ExplorationStatisticsEntry location : distinctLocations.values()) { if (location.getLocationId() == entries.get(point).getLocationId() && PartOfDay.getCorrespondingConstant( entries.get(point).getDiscoveredDate()).getName().getSingular().equalsIgnoreCase( PartOfDay.getCorrespondingConstant(location.getDiscoveredDate()).toString())) { distinct = false; break; } } if (distinct) { distinctLocations.put(point, entries.get(point)); } }

Target:
public void addDistinctLocationByPartOfDay(Point point) { boolean distinct = true; for (ExplorationStatisticsEntry location : distinctLocations.values()) { PartOfDay day = PartOfDay.getCorrespondingConstant(entries.get(point).getDiscoveredDate()); String entryName = day.getName().getSingular(); String distinctName = PartOfDay.getCorrespondingConstant(location.getDiscoveredDate()).toString(); if (location.getLocationId() == entries.get(point).getLocationId() && entryName.equalsIgnoreCase(distinctName)) { distinct = false; break; } } if (distinct) { distinctLocations.put(point, entries.get(point)); } }
Source:
protected Configuration getConfiguration() throws IOException { conf.unset(TxConstants.Manager.CFG_TX_HDFS_USER); conf.set(TxConstants.Manager.CFG_TX_SNAPSHOT_DIR, tmpFolder.newFolder().getAbsolutePath()); conf.set(TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES, SnapshotCodecV2.class.getName()); return conf; }

Target:
private Configuration getConfiguration() throws IOException { conf.unset(TxConstants.Manager.CFG_TX_HDFS_USER); conf.set(TxConstants.Manager.CFG_TX_SNAPSHOT_DIR, TMP_FOLDER.newFolder().getAbsolutePath()); return conf; }
Source:
public boolean isAuthorized() { if (session.isVoAdmin(voId)) { return true; } else { return group != null && session.isGroupAdmin(groupId); } }

Target:
public boolean isAuthorized() { return (session.isVoAdmin(voId) || session.isGroupAdmin(groupId)); }
Source:
private void addStoredKnowledge(String testID) { logger.info("addStoredKnowledge with testID: " + testID); AddStoredKnowledgeTask task = new AddStoredKnowledgeTask(testID); Future<Boolean> future = taskExecutorService.submit(task); testTasks.put(testID, future); try { boolean hasRegressionModel = future.get(); TestRunningState nextState = hasRegressionModel ? DETERMINE_EXECUTE_VALIDATION_SET : DETERMINE_EXECUTE_EXPERIMENTS; testModelDAO.setTestRunningState(testID, nextState); handleTestState(testID); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } catch (BenchFlowTestIDDoesNotExistException e) { logger.error("test ID does not exist - should not happen"); } }

Target:
private void addStoredKnowledge(String testID) { logger.info("addStoredKnowledge with testID: " + testID); AddStoredKnowledgeTask task = new AddStoredKnowledgeTask(testID); Future<?> future = taskExecutorService.submit(task); testTasks.put(testID, future); try { future.get(); boolean hasRegressionModel = explorationModelDAO.hasRegressionModel(testID); TestRunningState nextState = hasRegressionModel ? DETERMINE_EXECUTE_VALIDATION_SET : DETERMINE_EXECUTE_EXPERIMENTS; testModelDAO.setTestRunningState(testID, nextState); handleTestState(testID); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } catch (BenchFlowTestIDDoesNotExistException e) { logger.error("test ID does not exist - should not happen"); } }
Source:
public InvocationContext createRemoteInvocationContextForCommand( VisitableCommand cacheCommand, Address origin) { if (cacheCommand instanceof FlagAffectedCommand) { InvocationContext context = createRemoteInvocationContext(origin); return context; } else { return this.createRemoteInvocationContext(origin); } }

Target:
public InvocationContext createRemoteInvocationContextForCommand( VisitableCommand cacheCommand, Address origin) { return createRemoteInvocationContext(origin); }
Source:
public void activate() { super.activate(); if (!(semanticElement instanceof Transition) && !(((Transition) semanticElement).eContainer() instanceof Vertex)) { return; } Vertex owningElement = (Vertex) ((Transition) semanticElement).eContainer(); DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(owningElement, transitionPriorityChangeListener); }

Target:
public void activate() { super.activate(); if (!(semanticElement instanceof Transition) || !(((Transition) semanticElement).eContainer() instanceof Vertex)) { return; } Vertex owningElement = (Vertex) ((Transition) semanticElement).eContainer(); DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(owningElement, transitionPriorityChangeListener); }
Source:
public String toString() { return MoreObjects.toStringHelper(BigtableTable.class) .add("hashCode", "0x" + Integer.toHexString(hashCode())) .add("project", options.getProjectId()) .add("zone", options.getZone()) .add("cluster", options.getCluster()) .add("table", tableName.getNameAsString()) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(BigtableTable.class) .add("hashCode", "0x" + Integer.toHexString(hashCode())) .add("project", options.getProjectId()) .add("zone", options.getZone()) .add("cluster", options.getCluster()) .add("table", tableName.getNameAsString()) .add("host", options.getDataHost()) .toString(); }
Source:
public synchronized void stop() { if (container != null) { LOGGER.info("Shutting down container " + container.toString() + " from StreamProcessor"); container.shutdown(false); } else { LOGGER.info("Shutting down JobCoordinator from StreamProcessor"); jobCoordinator.stop(); } }

Target:
public synchronized void stop() { boolean containerShutdownInvoked = false; if (container != null) { try { LOGGER.info("Shutting down container " + container.toString() + " from StreamProcessor"); container.shutdown(); containerShutdownInvoked = true; } catch (IllegalContainerStateException icse) { LOGGER.info("Container was not running", icse); } } if (!containerShutdownInvoked) { LOGGER.info("Shutting down JobCoordinator from StreamProcessor"); jobCoordinator.stop(); } }
Source:
public void shutdown() { for (EventListenerWrapper listenerWrapper : aSyncListenersList) { removeWrapperFromList(listenerWrapper, aSyncListenersList); } for (EventListenerWrapper listenerWrapper : syncListenersList) { removeWrapperFromList(listenerWrapper, syncListenersList); } orderedExecutor.shutdown(); }

Target:
public synchronized void shutdown() { storeEventSource.removeEventListener(eventListener); storeEventSource.setEventOrdering(false); syncListenersList.clear(); aSyncListenersList.clear(); orderedExecutor.shutdown(); }
Source:
private Constraint oneAssignmentPerDatePerTeam(ConstraintFactory constraintFactory) { return constraintFactory.from(TeamAssignment.class) .ifExistsOther(TeamAssignment.class, Joiners.equal(TeamAssignment::getTeam), Joiners.equal(TeamAssignment::getDay), Joiners.lessThan(TeamAssignment::getId), Joiners.filtering((teamAssignment, otherTeamAssignment) -> teamAssignment.getTeam() != null)) .penalize("oneAssignmentPerDatePerTeam", HardMediumSoftScore.ONE_HARD); }

Target:
private Constraint oneAssignmentPerDatePerTeam(ConstraintFactory constraintFactory) { return constraintFactory.from(TeamAssignment.class) .join(TeamAssignment.class, Joiners.equal(TeamAssignment::getTeam), Joiners.equal(TeamAssignment::getDay), Joiners.lessThan(TeamAssignment::getId)) .penalize("oneAssignmentPerDatePerTeam", HardMediumSoftScore.ONE_HARD); }
Source:
public void testBug503035_1() { IGraph<String> graph = new Graph<String>(); graph.addChildren("A", ImmutableSet.of("B", "C")); graph.addChildren("B", ImmutableSet.of("C")); graph.addChildren("C", ImmutableSet.of("B")); Iterator<String> it = graph.breadthFirstIterator(); assertEquals("A", it.next()); assertTrue(it.hasNext()); assertEquals("B", it.next()); assertEquals("C", it.next()); assertFalse(it.hasNext()); }

Target:
public void testBug503035_1() { IGraph<String> graph = new Graph<String>(); graph.addChildren("A", ImmutableSet.of("B", "C")); graph.addChildren("B", ImmutableSet.of("C")); graph.addChildren("C", ImmutableSet.of("B")); Iterator<String> it = graph.breadthFirstIterator(); assertTrue(it.hasNext()); assertEquals("A", it.next()); assertTrue(it.hasNext()); assertEquals("B", it.next()); assertTrue(it.hasNext()); assertEquals("C", it.next()); assertFalse(it.hasNext()); }
Source:
ByteBuf slice() { return slice != null ? slice : (slice = srcBuf.slice(srcIdx(offset), length())); }

Target:
ByteBuf slice() { ByteBuf s = slice; if (s == null) { slice = s = srcBuf.slice(srcIdx(offset), length()); } return s; }
Source:
public void onCreate() { super.onCreate(); StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .build()); OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE); String currentAppId = getOneSignalAppId(this); setOneSignalAppId(this, "380dc082-5231-4cc2-ab51-a03da5a0e4c2"); OneSignal.init( this, "1234567", getOneSignalAppId(this), new ExampleNotificationOpenedHandler(), new ExampleNotificationReceivedHandler() ); }

Target:
public void onCreate() { super.onCreate(); StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .build()); OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE); String currentAppId = getOneSignalAppId(this); if (currentAppId == null) setOneSignalAppId(this, "0ba9731b-33bd-43f4-8b59-61172e27447d"); OneSignal.init( this, "1234567", getOneSignalAppId(this), new ExampleNotificationOpenedHandler(), new ExampleNotificationReceivedHandler() ); }
Source:
public void postRun() throws Exception { Config cfg = allProjectsConfig.load(); if (installVerified) { cfg.setString(KEY_LABEL, LABEL_VERIFIED, KEY_FUNCTION, "MaxWithBlock"); cfg.setStringList(KEY_LABEL, LABEL_VERIFIED, KEY_VALUE, Arrays.asList(new String[] {"-1 Fails", " 0 No score", "+1 Verified"})); allProjectsConfig.save("Review Label Initialization"); } }

Target:
public void postRun() throws Exception { Config cfg = allProjectsConfig.load(); if (installVerified) { cfg.setString(KEY_LABEL, LABEL_VERIFIED, KEY_FUNCTION, "MaxWithBlock"); cfg.setStringList(KEY_LABEL, LABEL_VERIFIED, KEY_VALUE, Arrays.asList(new String[] {"-1 Fails", " 0 No score", "+1 Verified"})); allProjectsConfig.save("Configure 'Verified' label"); } }
Source:
protected NamingEnumeration<SearchResult> searchLdap(String query, String scope) { SearchControls controls = new SearchControls(); LdapContext context = null; controls.setSearchScope(SUBTREE_SCOPE); NamingEnumeration<SearchResult> results; try { context = getServiceContext(); results = context.search(getConstantsConfig().getDomain(), query, controls); if (scope == getConstantsConfig().getGroupScope()) { String groupSearchDomain = getConstantsConfig().getGroupSearchDomain(); if (StringUtils.isNotEmpty(groupSearchDomain) && StringUtils.isNotBlank(groupSearchDomain)) { results = context.search(getConstantsConfig().getGroupSearchDomain(), query, controls); } } } catch (NamingException e) { getLogger().error("When searching ldap from /v1/identity Failed to search: " + query + " scope:" + getConstantsConfig().getDomain(), e); throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, getConstantsConfig().getConfig(), "Organizational Unit not found.", null); } finally { if (context != null){ getContextPool().returnObject(context); } } return results; }

Target:
protected NamingEnumeration<SearchResult> searchLdap(String query, String scope) { SearchControls controls = new SearchControls(); LdapContext context = null; controls.setSearchScope(SUBTREE_SCOPE); NamingEnumeration<SearchResult> results; try { context = getServiceContext(); if (getConstantsConfig().getGroupScope().equalsIgnoreCase(scope) && StringUtils.isNotBlank(getConstantsConfig().getGroupSearchDomain())) { results = context.search(getConstantsConfig().getGroupSearchDomain(), query, controls); } else { results = context.search(getConstantsConfig().getDomain(), query, controls); } } catch (NamingException e) { getLogger().error("When searching ldap from /v1/identity Failed to search: " + query + " scope:" + getConstantsConfig().getDomain(), e); throw new ClientVisibleException(ResponseCodes.INTERNAL_SERVER_ERROR, getConstantsConfig().getConfig(), "Organizational Unit not found.", null); } finally { if (context != null){ getContextPool().returnObject(context); } } return results; }
Source:
private synchronized Map<String, ThriftSerializedObject> partialSnapshot(TDeserializer td) { int attempts = 0; while (true) { try { return partialDeserializeLatestVersion(td); } catch (Exception e) { attempts++; if (attempts >= 10) { if (e.getCause() instanceof TProtocolException) { LOG.warn("LocalState file is corrupted, resetting state"); return new HashMap<>(); } throw new RuntimeException(e); } } } }

Target:
private synchronized Map<String, ThriftSerializedObject> partialSnapshot(TDeserializer td) { int attempts = 0; while (true) { try { return partialDeserializeLatestVersion(td); } catch (Exception e) { attempts++; if (attempts >= 10) { if (e.getCause() instanceof TProtocolException) { LOG.warn("LocalState file is corrupted, resetting state.", e); return new HashMap<>(); } throw new RuntimeException(e); } } } }
Source:
List<MultipartUpload> listUploads() { List<MultipartUpload> result = null; try { if (bucketPoolSize > 0) { result = new ArrayList<MultipartUpload>(); for (int i = 0; i < bucketPoolSize; i++) { val actualBucketName = BucketResolver.constructBucketName(bucketName, i); val request = new ListMultipartUploadsRequest(actualBucketName); val response = s3Client.listMultipartUploads(request); result.addAll(response.getMultipartUploads()); } } else { val request = new ListMultipartUploadsRequest(bucketName); val response = s3Client.listMultipartUploads(request); result = response.getMultipartUploads(); } return result; } catch (AmazonServiceException e) { log.error("Failed to list uploads on partition : ", e); throw new RetryableException(e); } }

Target:
List<MultipartUpload> listUploads() { List<MultipartUpload> result = null; try { if (bucketNamingService.isPartitioned()) { result = new ArrayList<MultipartUpload>(); for (int i = 0; i < bucketNamingService.getBucketPoolSize(); i++) { val actualBucketName = bucketNamingService.constructBucketName(bucketNamingService.getBaseObjectBucketName(), i); val request = new ListMultipartUploadsRequest(actualBucketName); val response = s3Client.listMultipartUploads(request); result.addAll(response.getMultipartUploads()); } } else { val request = new ListMultipartUploadsRequest(bucketNamingService.getBaseObjectBucketName()); val response = s3Client.listMultipartUploads(request); result = response.getMultipartUploads(); } return result; } catch (AmazonServiceException e) { log.error("Failed to list uploads on partition : ", e); throw new RetryableException(e); } }
Source:
public String getNodeDownloadFilename(String nodeVersion) { if(isWindows()) { int versionCompare = nodeVersion.compareTo("v4.0.0"); if(architecture == Architecture.x64){ if (versionCompare >= 0) { return nodeVersion+"/win-x64/node.exe"; } else { return nodeVersion+"/x64/node.exe"; } } else { if (versionCompare < 0) { return nodeVersion+"/win-x86/node.exe"; } else { return nodeVersion + "/node.exe"; } } } else { return nodeVersion + "/" + getLongNodeFilename(nodeVersion) + ".tar.gz"; } }

Target:
public String getNodeDownloadFilename(String nodeVersion) { if(isWindows()) { if(architecture == Architecture.x64){ if (nodeVersion.startsWith("v0.")) { return nodeVersion+"/x64/node.exe"; } else { return nodeVersion+"/win-x64/node.exe"; } } else { if (nodeVersion.startsWith("v0.")) { return nodeVersion + "/node.exe"; } else { return nodeVersion+"/win-x86/node.exe"; } } } else { return nodeVersion + "/" + getLongNodeFilename(nodeVersion) + ".tar.gz"; } }
Source:
private int getAdapterPosition(@Nullable String input) { int ret = -1; if (input != null && adapter != null) { for(int i=0 ; i<adapter.getCount() ; i++){ RegistrationOption item = adapter.getItem(i); if (item != null && input.equals(item.toString())) { ret = i; break; } } } return ret; }

Target:
private int getAdapterPosition(@Nullable String input) { int posiiton = -1; if (input != null && adapter != null) { for(int i=0 ; i<adapter.getCount() ; i++){ RegistrationOption item = adapter.getItem(i); if (item != null && input.equals(item.toString())) { posiiton = i; break; } } } return posiiton; }
Source:
public Collection<Class<?>> getProvidedServiceTypes() { return Collections.singletonList(LogicalServerStateMBeanImpl.class); }

Target:
public Collection<Class<?>> getProvidedServiceTypes() { return Collections.singletonList(LogicalServerStateProvider.class); }