auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void loadStoredConfig() { File cfgFile = new File(generateConfigFilename()); if (cfgFile.exists()) { try { FileInputStream fiStream = new FileInputStream(cfgFile); Properties propertiesFile = new Properties(); propertiesFile.load(fiStream); this.devAddr = propertiesFile.getProperty("devAddr"); this.paired = true; fiStream.close(); } catch (IOException e) { logger.warn("Unable to load information for "+this.deviceType+" "+this.serialNumber+" it may not yet be paired. Error was "+e.getMessage()); this.paired = false; return; } logger.debug("Successfully loaded pairing info for "+this.serialNumber); } else { logger.warn("Unable to locate information for "+this.deviceType+" "+this.serialNumber+" it may not yet be paired"); this.paired = false; } }

Target:
public void loadStoredConfig() { File cfgFile = new File(generateConfigFilename()); if (cfgFile.exists()) { try { FileInputStream fiStream = new FileInputStream(cfgFile); Properties propertiesFile = new Properties(); propertiesFile.load(fiStream); this.devAddr = propertiesFile.getProperty("devAddr"); this.paired = true; fiStream.close(); } catch (IOException e) { logger.warn("Unable to load information for " + this.getDeviceType() + " " + this.getSerialNumber() + " it may not yet be paired. Error was " + e.getMessage()); this.paired = false; return; } logger.debug("Successfully loaded pairing info for " + this.getSerialNumber()); } else { logger.warn("Unable to locate information for " + this.getDeviceType() + " " + this.getSerialNumber() + " it may not yet be paired"); this.paired = false; } }
Source:
public Optional<SchemaSource> get(Topic topic) { try { byte[] schemaBytes = curatorFramework.getData().forPath(zkPaths.topicPath(topic.getName(), SCHEMA_SUFFIX)); return Optional.ofNullable(SchemaSource.valueOf(new String(schemaBytes, Charset.defaultCharset()))); } catch (KeeperException.NoNodeException ex) { return Optional.empty(); } catch (Exception ex) { throw new InternalProcessingException("Could not load from zookeeper schema for topic " + topic.getQualifiedName(), ex); } }

Target:
public Optional<SchemaSource> get(Topic topic) { try { byte[] schemaBytes = curatorFramework.getData().forPath(zkPaths.topicPath(topic.getName(), SCHEMA_SUFFIX)); return Optional.of(SchemaSource.valueOf(new String(schemaBytes, Charset.defaultCharset()))); } catch (KeeperException.NoNodeException ex) { return Optional.empty(); } catch (Exception ex) { throw new InternalProcessingException("Could not load from zookeeper schema for topic " + topic.getQualifiedName(), ex); } }
Source:
private static Bitmap performSafeScaleDown(File f, int scale, int depth) { if (depth == 8) { return null; } BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = scale; try { return BitmapFactory.decodeFile(f.getAbsolutePath(), options); } catch (OutOfMemoryError e) { return performSafeScaleDown(f, ++scale, ++depth); } }

Target:
private static Bitmap performSafeScaleDown(File f, int scale, int depth) { if (depth == 8) { return null; } BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = scale; try { return BitmapFactory.decodeFile(f.getAbsolutePath(), options); } catch (OutOfMemoryError e) { return performSafeScaleDown(f, scale + 1, depth + 1); } }
Source:
private void createLogger() { synchronized (logCreatorLock) { String loggerName = System.currentTimeMillis() + "." + this.executionId + "." + this.jobId; logger = Logger.getLogger(loggerName); try { attachFileAppender(createFileAppender()); } catch (IOException e) { removeAppender(jobAppender); flowLogger.error("Could not open log file in " + workingDir + " for job " + this.jobId, e); } AzkabanExecutorServer exec = AzkabanExecutorServer.getApp(); if (exec != null && !exec.getAzkabanProps().getBoolean("kafkaLogging.globalDisable", false) && props.getBoolean("azkaban.job.kafkaLogging.enabled", false)) { try { attachKafkaAppender(createKafkaAppender()); } catch (Exception e) { removeAppender(kafkaAppender); flowLogger.error("Failed to create Kafka appender for job " + this.jobId, e); } } } }

Target:
private void createLogger() { synchronized (logCreatorLock) { String loggerName = System.currentTimeMillis() + "." + this.executionId + "." + this.jobId; logger = Logger.getLogger(loggerName); try { attachFileAppender(createFileAppender()); } catch (IOException e) { removeAppender(jobAppender); flowLogger.error("Could not open log file in " + workingDir + " for job " + this.jobId, e); } if (props.getBoolean(JobProperties.AZKABAN_JOB_LOGGING_KAFKA_ENABLE, false)) { if (azkabanProps.containsKey(ServerProperties.AZKABAN_SERVER_LOGGING_KAFKA_BROKERLIST) && azkabanProps.containsKey(ServerProperties.AZKABAN_SERVER_LOGGING_KAFKA_TOPIC)) { try { attachKafkaAppender(createKafkaAppender()); } catch (Exception e) { removeAppender(kafkaAppender); flowLogger.error("Failed to create Kafka appender for job " + this.jobId, e); } } else { flowLogger.info("Kafka appender not created as brokerlist or topic not provided by executor server"); } } } }
Source:
protected void setup(Binder binder) { String benchmarkSuiteSupplierType = buildConfigObject(BenchmarkConfig.class).getBenchmarkSuiteSupplier(); String database = buildConfigObject(BenchmarkSuiteConfig.class).getDatabase(); checkArgument(supportedBenchmarkSuiteSupplierTypes.contains(benchmarkSuiteSupplierType), "Unsupported BenchmarkSuiteSupplier: %s", benchmarkSuiteSupplierType); if (MYSQL_BENCHMARK_SUITE_SUPPLIER.equals(benchmarkSuiteSupplierType)) { configBinder(binder).bindConfig(BenchmarkSuiteConfig.class); binder.bind(BenchmarkSuiteSupplier.class).to(DbBenchmarkSuiteSupplier.class).in(SINGLETON); Jdbi jdbi = Jdbi.create(() -> DriverManager.getConnection(database)).installPlugin(new SqlObjectPlugin()); binder.bind(Jdbi.class).toInstance(jdbi); } }

Target:
protected void setup(Binder binder) { String benchmarkSuiteSupplier = buildConfigObject(BenchmarkRunnerConfig.class).getBenchmarkSuiteSupplier(); checkArgument(supportedBenchmarkSuiteSuppliers.contains(benchmarkSuiteSupplier), "Unsupported BenchmarkSuiteSupplier: %s", benchmarkSuiteSupplier); if (BENCHMARK_SUITE_SUPPLIER.equals(benchmarkSuiteSupplier)) { configBinder(binder).bindConfig(BenchmarkSuiteConfig.class); binder.bind(BenchmarkSuiteSupplier.class).to(DbBenchmarkSuiteSupplier.class).in(SINGLETON); String database = buildConfigObject(MySqlBenchmarkSuiteConfig.class).getDatabaseUrl(); binder.bind(Jdbi.class).toInstance(Jdbi.create(() -> DriverManager.getConnection(database)).installPlugin(new SqlObjectPlugin())); } }
Source:
public void testSTPolygon() throws Exception { assertQuery("select ST_AsText(ST_Polygon('Polygon ((1 1, 1 4, 4 4, 4 1))'))", "select 'POLYGON ((1 1, 4 1, 4 4, 1 4, 1 1))'"); assertQueryFails("select ST_AsText(ST_Polygon('LineString(1 1, 2 2, 1 3)'))", "ST_Polygon only applies to Polygon. Input type is: LineString"); }

Target:
public void testSTPolygon() throws Exception { assertFunction("ST_AsText(ST_Polygon('POLYGON EMPTY'))", VARCHAR, "MULTIPOLYGON EMPTY"); assertFunction("ST_AsText(ST_Polygon('POLYGON ((1 1, 1 4, 4 4, 4 1))'))", VARCHAR, "POLYGON ((1 1, 4 1, 4 4, 1 4, 1 1))"); assertInvalidFunction("ST_AsText(ST_Polygon('LINESTRING (1 1, 2 2, 1 3)'))", "ST_Polygon only applies to POLYGON. Input type is: LINE_STRING"); }
Source:
public SchemaRegistryAvroDeserializer buildSyncClient() { return new SchemaRegistryAvroDeserializer( this.registryUrl, this.credential, this.avroSpecificReader, this.maxSchemaMapSize); }

Target:
public SchemaRegistryAvroDeserializer buildSyncClient() { CachedSchemaRegistryClient client = new CachedSchemaRegistryClientBuilder() .endpoint(registryUrl) .credential(credential) .maxSchemaMapSize(maxSchemaMapSize) .buildClient(); return new SchemaRegistryAvroDeserializer(client, this.avroSpecificReader); }
Source:
public static List<RemoteRepository> getRemoteRepositories(MavenContainer container, Settings settings) { Set<RemoteRepository> remoteRepos = new HashSet<>(); remoteRepos.addAll(container.getEnabledRepositoriesFromProfile(settings)); long numberOfCentralMirrors = settings.getMirrors().stream().filter(m -> CENTRAL_MIRRORS_IDS.contains(m.getId())).count(); if (numberOfCentralMirrors == 0) { String centralRepoURL = getCentralMirrorURL(settings).orElse(MAVEN_CENTRAL_REPO); remoteRepos.add(convertToMavenRepo("central", centralRepoURL, settings)); } return new ArrayList<>(remoteRepos); }

Target:
public static List<RemoteRepository> getRemoteRepositories(MavenContainer container, Settings settings) { Set<RemoteRepository> remoteRepos = new HashSet<>(); remoteRepos.addAll(container.getEnabledRepositoriesFromProfile(settings)); String centralRepoURL = getCentralMirrorURL(settings).orElse(MAVEN_CENTRAL_REPO); remoteRepos.add(convertToMavenRepo("central", centralRepoURL, settings)); return new ArrayList<>(remoteRepos); }
Source:
public PairSupplier<Q, E> create(Iterable<Q> queries, Iterable<E> endpoints) { LinkedList<Pair<Q,E>> tempList = new LinkedList<Pair<Q, E>>(); Iterator<E> endpointIt = endpoints.iterator(); Iterator<Q> queryIt = queries.iterator(); E currentEndpoint; Q currentQuery; while(endpointIt.hasNext() || queryIt.hasNext()) { if(!endpointIt.hasNext()) { endpointIt = endpoints.iterator(); } if(!queryIt.hasNext()) { queryIt = queries.iterator(); } currentEndpoint = endpointIt.next(); currentQuery = queryIt.next(); tempList.add(Pair.of(currentQuery, currentEndpoint)); } return new PairSupplierImpl<Q, E>(ImmutableList.copyOf(tempList)); }

Target:
public PairSupplier<Q, E> create(Iterable<Q> queries, Iterable<E> endpoints) { LinkedList<Pair<Q,E>> tempList = new LinkedList<Pair<Q, E>>(); Iterator<E> endpointIt = endpoints.iterator(); Iterator<Q> queryIt = queries.iterator(); checkState(endpointIt.hasNext(), "Empty EndpointProvider"); checkState(queryIt.hasNext(), "Empty QueryProvider"); E currentEndpoint; Q currentQuery; while(endpointIt.hasNext() || queryIt.hasNext()) { if(!endpointIt.hasNext()) { endpointIt = endpoints.iterator(); } if(!queryIt.hasNext()) { queryIt = queries.iterator(); } currentEndpoint = endpointIt.next(); currentQuery = queryIt.next(); tempList.add(Pair.of(currentQuery, currentEndpoint)); } return new PairSupplierImpl<Q, E>(ImmutableList.copyOf(tempList)); }
Source:
protected <T> T internalValueOfString(final String value, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException { LocalTime time; try { time = LocalTime.parse(value); } catch (DateTimeParseException ex) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content."); } if (returnType.isAssignableFrom(LocalTime.class)) { return (T) time; } else if (returnType.isAssignableFrom(java.sql.Time.class)) { return (T) java.sql.Time.valueOf(time); } ZonedDateTime zdt = LocalDateTime.of(EPOCH, time).atZone(ZoneId.systemDefault()); if (returnType.isAssignableFrom(Calendar.class)) { return (T) GregorianCalendar.from(zdt); } else if (returnType.isAssignableFrom(Long.class)) { return (T) Long.valueOf(zdt.toInstant().toEpochMilli()); } else if (returnType.isAssignableFrom(Timestamp.class)) { return (T) Timestamp.from(zdt.toInstant()); } else { throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported."); } }

Target:
protected <T> T internalValueOfString(final String value, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException { LocalTime time; try { time = LocalTime.parse(value); } catch (DateTimeParseException ex) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content."); } if (returnType.isAssignableFrom(LocalTime.class)) { return (T) time; } else if (returnType.isAssignableFrom(java.sql.Time.class)) { return (T) java.sql.Time.valueOf(time); } ZonedDateTime zdt = LocalDateTime.of(EPOCH, time).atZone(ZoneId.systemDefault()); if (returnType.isAssignableFrom(Calendar.class)) { return (T) GregorianCalendar.from(zdt); } else if (returnType.isAssignableFrom(Long.class)) { return (T) Long.valueOf(zdt.toInstant().toEpochMilli()); } else if (returnType.isAssignableFrom(java.sql.Date.class)) { throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported."); } else if (returnType.isAssignableFrom(Timestamp.class)) { return (T) Timestamp.from(zdt.toInstant()); } else if (returnType.isAssignableFrom(java.util.Date.class)) { return (T) java.util.Date.from(zdt.toInstant()); } else { throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported."); } }
Source:
public void run() { if (m_closed.get()) { return; } long bytesWritten = 0; try { bytesWritten = m_sender.m_bytesSent.get(m_targetId).get(); long bytesSentSinceLastCheck = bytesWritten - m_bytesWrittenSinceConstruction; rejoinLog.info(String.format("While sending rejoin data to site %s, %d bytes have been sent in the past %s seconds.", CoreUtils.hsIdToString(m_destHSId), bytesSentSinceLastCheck, WATCHDOG_PERIOS_S)); checkTimeout(m_writeTimeout); if (m_writeFailed.get() != null) { clearOutstanding(); } if (bytesSentSinceLastCheck > 0) { m_lastDataSent = System.currentTimeMillis(); } else if (TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis() - m_lastDataSent) > 1) { Set<Integer> liveHosts = VoltDB.instance().getHostMessenger().getLiveHostIds(); if (!liveHosts.contains(CoreUtils.getHostIdFromHSId(m_destHSId))) { m_closed.set(true); } } } catch (Throwable t) { rejoinLog.error("Stream snapshot watchdog thread threw an exception", t); } finally { if (!m_closed.get()) { VoltDB.instance().scheduleWork(new Watchdog(bytesWritten, m_writeTimeout), WATCHDOG_PERIOS_S, -1, TimeUnit.SECONDS); } } }

Target:
public void run() { if (m_closed.get()) { return; } long bytesWritten = 0; try { bytesWritten = m_sender.m_bytesSent.get(m_targetId).get(); long bytesSentSinceLastCheck = bytesWritten - m_bytesWrittenSinceConstruction; rejoinLog.info(String.format("While sending rejoin data to site %s, %d bytes have been sent in the past %s seconds.", CoreUtils.hsIdToString(m_destHSId), bytesSentSinceLastCheck, WATCHDOG_PERIOS_S)); checkTimeout(m_writeTimeout); if (m_writeFailed.get() != null) { clearOutstanding(); } if (bytesSentSinceLastCheck > 0) { m_lastDataSent = System.nanoTime(); } else if (TimeUnit.MINUTES.convert((System.nanoTime() - m_lastDataSent), TimeUnit.NANOSECONDS) > 1) { Set<Integer> liveHosts = VoltDB.instance().getHostMessenger().getLiveHostIds(); if (!liveHosts.contains(CoreUtils.getHostIdFromHSId(m_destHSId))) { m_closed.set(true); } } } catch (Throwable t) { rejoinLog.error("Stream snapshot watchdog thread threw an exception", t); } finally { if (!m_closed.get()) { VoltDB.instance().scheduleWork(new Watchdog(bytesWritten, m_writeTimeout), WATCHDOG_PERIOS_S, -1, TimeUnit.SECONDS); } } }
Source:
public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("elasticsearch.table-description-dir", "/etc/elasticsearch/") .put("elasticsearch.table-names", "test.table1,test.table2,test.table3") .put("elasticsearch.default-schema", "test") .put("elasticsearch.scroll-size", "4000") .put("elasticsearch.scroll-time", "2m") .put("elasticsearch.max-hits", "20000") .put("elasticsearch.request-timeout", "2m") .build(); ElasticsearchConnectorConfig expected = new ElasticsearchConnectorConfig() .setTableDescriptionDir(new File("/etc/elasticsearch/")) .setTableNames("test.table1,test.table2,test.table3") .setDefaultSchema("test") .setScrollSize(4000) .setScrollTime(new Duration(120, TimeUnit.SECONDS)) .setMaxHits(20000) .setRequestTimeout(new Duration(120, TimeUnit.SECONDS)); ConfigAssertions.assertFullMapping(properties, expected); }

Target:
public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("elasticsearch.table-description-dir", "/etc/elasticsearch/") .put("elasticsearch.table-names", "test.table1,test.table2,test.table3") .put("elasticsearch.default-schema", "test") .put("elasticsearch.scroll-size", "4000") .put("elasticsearch.scroll-timeout", "2m") .put("elasticsearch.max-hits", "20000") .put("elasticsearch.request-timeout", "2m") .build(); ElasticsearchConnectorConfig expected = new ElasticsearchConnectorConfig() .setTableDescriptionDir(new File("/etc/elasticsearch/")) .setTableNames("test.table1,test.table2,test.table3") .setDefaultSchema("test") .setScrollSize(4000) .setScrollTimeout(new Duration(120, SECONDS)) .setMaxHits(20000) .setRequestTimeout(new Duration(120, SECONDS)); assertFullMapping(properties, expected); }
Source:
public boolean remove(String path, int options) { if (path.equals("/")) { notifyListeners("/", HelixPropertyStoreUtils.StoreOperationType.DELETE); pathToRecords.clear(); return true; } else { throw new IllegalStateException("Not implemented"); } }

Target:
public boolean remove(String path, int options) { if (path.equals("/")) { pathToRecords.clear(); notifyListeners("/", HelixPropertyStoreUtils.StoreOperationType.DELETE); return true; } else { throw new IllegalStateException("Not implemented"); } }
Source:
public Cat build() { Cat cat = new Cat(this); String uriSuffix = cat.buildURI(); cat.setURI("_cat/indices" + (uriSuffix.isEmpty() ? "" : "/") + uriSuffix); return cat; }

Target:
public Cat build() { return new Cat(this); }
Source:
public Profile apply(final EPackage missingPackage) { final List<String> closestPackageUris = getClosestPackageURIs(missingPackage); Optional<Profile> foundProfile = null; for (final String packageURI : closestPackageUris) { foundProfile = getProfile(packageURI); if (foundProfile.isPresent()) { Profile profile = foundProfile.get(); final String message = getSuccessMessage(missingPackage.getNsURI(), profile.getURI()); addResourceWarning(message); return profile; } } final String message = getFailMessage(missingPackage.getNsURI()); addResourceError(message); return null; }

Target:
public Profile apply(final EPackage missingPackage) { Optional<Profile> foundProfile = findProfile(missingPackage); if (foundProfile.isPresent()) { Profile profile = foundProfile.get(); final String message = getSuccessMessage(missingPackage.getNsURI(), profile.getURI()); addResourceWarning(message); return profile; } else { final String message = getFailMessage(missingPackage.getNsURI()); addResourceError(message); return null; } }
Source:
private int setWifiTethering(final boolean enable) { int rval = TETHER_ERROR_MASTER_ERROR; final long ident = Binder.clearCallingIdentity(); try { synchronized (mPublicSync) { mWifiTetherRequested = enable; final WifiManager mgr = getWifiManager(); if (mgr == null) { Log.e(TAG, "setWifiTethering: failed to get WifiManager!"); rval = TETHER_ERROR_SERVICE_UNAVAIL; } else if ((enable && mgr.startSoftAp(null )) || (!enable && mgr.stopSoftAp())) { rval = TETHER_ERROR_NO_ERROR; } } } finally { Binder.restoreCallingIdentity(ident); } if (rval != TETHER_ERROR_NO_ERROR) { mWifiTetherRequested = false; } return rval; }

Target:
private int setWifiTethering(final boolean enable) { int rval = TETHER_ERROR_MASTER_ERROR; final long ident = Binder.clearCallingIdentity(); try { synchronized (mPublicSync) { mWifiTetherRequested = enable; final WifiManager mgr = getWifiManager(); if (mgr == null) { mLog.e(TAG, "setWifiTethering: failed to get WifiManager!"); rval = TETHER_ERROR_SERVICE_UNAVAIL; } else if ((enable && mgr.startSoftAp(null )) || (!enable && mgr.stopSoftAp())) { rval = TETHER_ERROR_NO_ERROR; } } } finally { Binder.restoreCallingIdentity(ident); } if (rval != TETHER_ERROR_NO_ERROR) { mWifiTetherRequested = false; } return rval; }
Source:
public Object getDynamic(String id, StaplerRequest req, StaplerResponse rsp) throws Exception { if (!ResourceDomainConfiguration.isResourceRequest(req)) { rsp.sendError(404, "Cannot handle requests to this URL unless on Jenkins resource URL."); return null; } Token token = Token.decode(id); if (token == null) { rsp.sendError(404, "Jenkins serves only static files on this domain."); return null; } String authenticationName = token.username; String browserUrl = token.path; long creationDate = token.timestamp; long age = new Date().getTime() - creationDate; if (age >= 0 && age < TimeUnit.MINUTES.toMillis(VALID_FOR_MINUTES)) { return new InternalResourceRequest(browserUrl, authenticationName); } return new Redirection(browserUrl); }

Target:
public Object getDynamic(String id, StaplerRequest req, StaplerResponse rsp) throws Exception { if (!ResourceDomainConfiguration.isResourceRequest(req)) { rsp.sendError(404, "Cannot handle requests to this URL unless on Jenkins resource URL."); return null; } Token token = Token.decode(id); if (token == null) { rsp.sendError(404, ResourceDomainFilter.ERROR_RESPONSE); return null; } String authenticationName = token.username; String browserUrl = token.path; if (token.timestamp.plus(VALID_FOR_MINUTES, MINUTES).isAfter(now()) && token.timestamp.isBefore(now())) { return new InternalResourceRequest(browserUrl, authenticationName); } return new Redirection(browserUrl); }
Source:
public static Locale getLocale(@Nullable String localeCode, @NonNull SharedPreferences prefs) { Locale locale; if (localeCode == null || TextUtils.isEmpty(localeCode)) { localeCode = prefs.getString(Preferences.LANGUAGE, ""); } if (TextUtils.isEmpty(localeCode)) { localeCode = Locale.getDefault().toString(); } if (localeCode != null && (localeCode.contains("_") || localeCode.contains("-"))) { try { String[] localeParts = localeCode.split("[_-]", 2); locale = new Locale(localeParts[0], localeParts[1]); } catch (ArrayIndexOutOfBoundsException e) { Timber.w(e, "LanguageUtil::getLocale regional variant split failed. Using code raw."); locale = new Locale(localeCode); } } else { locale = new Locale(localeCode); } return locale; }

Target:
public static Locale getLocale(@Nullable String localeCode, @NonNull SharedPreferences prefs) { Locale locale; if (localeCode == null || TextUtils.isEmpty(localeCode)) { localeCode = prefs.getString(Preferences.LANGUAGE, ""); } if (TextUtils.isEmpty(localeCode)) { localeCode = Locale.getDefault().toString(); } if (localeCode != null && (localeCode.contains("_") || localeCode.contains("-"))) { try { String[] localeParts = localeCode.split("[_-]", 2); locale = new Locale(localeParts[0], localeParts[1]); } catch (ArrayIndexOutOfBoundsException e) { Timber.w(e, "LanguageUtil::getLocale variant split fail, using code '%s' raw.", localeCode); locale = new Locale(localeCode); } } else { locale = new Locale(localeCode); } return locale; }
Source:
public void onPluginLoad() { Plugin.get().screenRegex("project/(.*)/rev/(.*)/(.*)", new XDocScreen.Factory()); Plugin.get().screenRegex("project/(.*)/(.*)", new XDocScreen.HeadFactory()); Plugin.get().screenRegex("c/(.*)/([0-9.]+)/(.*),unified", new XDocUnifiedDiffScreen.Factory()); Plugin.get().screenRegex("c/(.*)/([0-9.]+)/(.*)", new XDocSideBySideDiffScreen.Factory()); }

Target:
public void onPluginLoad() { Plugin.get().screenRegex("project/(.*)/rev/(.*)/(.*)", new XDocScreen.Factory()); Plugin.get().screenRegex("project/(.*)/(.*)", new XDocScreen.HeadFactory()); Plugin.get().screenRegex("c/(.*)/([0-9]+(\\.{2}[0-9]+)?)/(.*),unified", new XDocUnifiedDiffScreen.Factory()); Plugin.get().screenRegex("c/(.*)/([0-9]+(\\.{2}[0-9]+)?)/(.*)", new XDocSideBySideDiffScreen.Factory()); }
Source:
public CompletableFuture<Void> force() { CompletableFuture<Void> result = new CompletableFuture<>(); ForceLedgerOp op = new ForceLedgerOp(this, result); boolean wasClosed = false; synchronized (this) { if (metadata.isClosed()) { wasClosed = true; } } if (wasClosed) { try { bk.getMainWorkerPool().submit(new SafeRunnable() { @Override public void safeRun() { LOG.warn("Attempt to use a closed ledger: {}", ledgerId); result.completeExceptionally(new BKException.BKLedgerClosedException()); } @Override public String toString() { return String.format("force(lid=%d)", ledgerId); } }); } catch (RejectedExecutionException e) { result.completeExceptionally(new BKException.BKInterruptedException()); } return result; } if (pendingAddsSequenceHead == INVALID_ENTRY_ID) { bk.getMainWorkerPool().submit(new SafeRunnable() { @Override public void safeRun() { FutureUtils.complete(result, null); } @Override public String toString() { return String.format("force(lid=%d)", ledgerId); } }); return result; } try { bk.getMainWorkerPool().executeOrdered(ledgerId, op); } catch (RejectedExecutionException e) { result.completeExceptionally(new BKException.BKInterruptedException()); } return result; }

Target:
public CompletableFuture<Void> force() { CompletableFuture<Void> result = new CompletableFuture<>(); ForceLedgerOp op = new ForceLedgerOp(this, result); boolean wasClosed = false; synchronized (this) { if (metadata.isClosed()) { wasClosed = true; } } if (wasClosed) { try { bk.getMainWorkerPool().executeOrdered(ledgerId, new SafeRunnable() { @Override public void safeRun() { LOG.warn("Force() attempted on a closed ledger: {}", ledgerId); result.completeExceptionally(new BKException.BKLedgerClosedException()); } @Override public String toString() { return String.format("force(lid=%d)", ledgerId); } }); } catch (RejectedExecutionException e) { result.completeExceptionally(new BKException.BKInterruptedException()); } return result; } if (pendingAddsSequenceHead == INVALID_ENTRY_ID) { bk.getMainWorkerPool().executeOrdered(ledgerId, new SafeRunnable() { @Override public void safeRun() { FutureUtils.complete(result, null); } @Override public String toString() { return String.format("force(lid=%d)", ledgerId); } }); return result; } try { bk.getMainWorkerPool().executeOrdered(ledgerId, op); } catch (RejectedExecutionException e) { result.completeExceptionally(new BKException.BKInterruptedException()); } return result; }
Source:
public BusinessArchiveBuilder setActorMapping(final byte[] xmlContent) throws Exception { ActorMapping actorMapping; ActorMappingMarshaller marshaller = new ActorMappingMarshaller(); try { actorMapping = marshaller.deserializeFromXML(xmlContent); } catch (XmlParseException e) { throw new Exception("Generation of the actorMapping from the provided Xml failed", e); } setActorMapping(actorMapping); return this; }

Target:
public BusinessArchiveBuilder setActorMapping(final byte[] xmlContent) throws IOException { ActorMapping actorMapping; ActorMappingMarshaller marshaller = new ActorMappingMarshaller(); try { actorMapping = marshaller.deserializeFromXML(xmlContent); } catch (XmlMarshallException e) { throw new IOException("Generation of the actorMapping from the provided Xml failed", e); } setActorMapping(actorMapping); return this; }
Source:
public void testChangedShippingAddress() throws InterruptedException { createValidCheckout(); fetchShippingRates(HttpStatus.SC_OK); setShippingRate(); Address address = checkout.getShippingAddress(); address.setCity("Toronto"); checkout.setShippingAddress(address); updateCheckout(); fetchShippingRates(HttpStatus.SC_OK); setShippingRate(); assertEquals(checkout.getShippingAddress().getCity(), "Toronto"); }

Target:
public void testChangedShippingAddress() throws InterruptedException { createValidCheckout(); fetchShippingRates(HttpStatus.SC_OK); setShippingRate(); Address address = checkout.getShippingAddress(); address.setCity("Toronto"); checkout.setShippingRate(null); updateCheckout(); fetchShippingRates(HttpStatus.SC_OK); setShippingRate(); assertEquals(checkout.getShippingAddress().getCity(), "Toronto"); }
Source:
public static List<TimelineObjectHolder<String, DataSegment>> getTimelineForSegmentIds( CoordinatorClient coordinatorClient, String dataSource, List<WindowedSegmentId> segmentIds ) { final SortedMap<Interval, TimelineObjectHolder<String, DataSegment>> timeline = new TreeMap<>( Comparators.intervalsByStartThenEnd() ); for (WindowedSegmentId windowedSegmentId : Preconditions.checkNotNull(segmentIds, "segmentIds")) { final DataSegment segment = coordinatorClient.getDatabaseSegmentDataSourceSegment( dataSource, windowedSegmentId.getSegmentId() ); for (Interval interval : windowedSegmentId.getIntervals()) { final TimelineObjectHolder<String, DataSegment> existingHolder = timeline.get(interval); if (existingHolder != null) { if (!existingHolder.getVersion().equals(segment.getVersion())) { throw new ISE("Timeline segments with the same interval should have the same version: " + "existing version[%s] vs new segment[%s]", existingHolder.getVersion(), segment); } existingHolder.getObject().add(segment.getShardSpec().createChunk(segment)); } else { timeline.put( interval, new TimelineObjectHolder<>( interval, segment.getInterval(), segment.getVersion(), new PartitionHolder<>(segment.getShardSpec().createChunk(segment)) ) ); } } } Interval lastInterval = null; for (Interval interval : timeline.keySet()) { if (lastInterval != null) { if (interval.overlaps(lastInterval)) { throw new IAE( "Distinct intervals in input segments may not overlap: [%s] vs [%s]", lastInterval, interval ); } } lastInterval = interval; } return new ArrayList<>(timeline.values()); }

Target:
public static List<TimelineObjectHolder<String, DataSegment>> getTimelineForSegmentIds( CoordinatorClient coordinatorClient, String dataSource, List<WindowedSegmentId> segmentIds ) { final SortedMap<Interval, TimelineObjectHolder<String, DataSegment>> timeline = new TreeMap<>( Comparators.intervalsByStartThenEnd() ); for (WindowedSegmentId windowedSegmentId : Preconditions.checkNotNull(segmentIds, "segmentIds")) { final DataSegment segment = coordinatorClient.getDatabaseSegmentDataSourceSegment( dataSource, windowedSegmentId.getSegmentId() ); for (Interval interval : windowedSegmentId.getIntervals()) { final TimelineObjectHolder<String, DataSegment> existingHolder = timeline.get(interval); if (existingHolder != null) { if (!existingHolder.getVersion().equals(segment.getVersion())) { throw new ISE("Timeline segments with the same interval should have the same version: " + "existing version[%s] vs new segment[%s]", existingHolder.getVersion(), segment); } existingHolder.getObject().add(segment.getShardSpec().createChunk(segment)); } else { timeline.put( interval, new TimelineObjectHolder<>( interval, segment.getInterval(), segment.getVersion(), new PartitionHolder<>(segment.getShardSpec().createChunk(segment)) ) ); } } } Interval lastInterval = null; for (Interval interval : timeline.keySet()) { if (lastInterval != null && interval.overlaps(lastInterval)) { throw new IAE( "Distinct intervals in input segments may not overlap: [%s] vs [%s]", lastInterval, interval ); } lastInterval = interval; } return new ArrayList<>(timeline.values()); }
Source:
public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects() { List<GlobalBusinessObjectDetail> detailObjects = new ArrayList<>(); detailObjects.addAll(subAccountGlobalDetails); detailObjects.addAll(subAccountGlobalNewAccountDetails); return subAccountGlobalDetails; }

Target:
public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects() { List<GlobalBusinessObjectDetail> detailObjects = new ArrayList<>(); detailObjects.addAll(subAccountGlobalDetails); detailObjects.addAll(subAccountGlobalNewAccountDetails); return detailObjects; }
Source:
private void setValueInternal(ITableRow row, T value, IFormField editingField) throws ProcessingException { if (m_validatedValues.containsKey(row)) { validateColumnValue(row, editingField, true, value); ICell cell = row.getCell(this); if (cell instanceof Cell && ((Cell) cell).getErrorStatus() == null) { m_validatedValues.put(row, value); } } T newValue = validateValue(row, value); row.setCellValue(getColumnIndex(), newValue); }

Target:
private void setValueInternal(ITableRow row, T value, IFormField editingField) throws ProcessingException { validateColumnValue(row, editingField, true, value); ICell cell = row.getCell(this); if (cell instanceof Cell && ((Cell) cell).getErrorStatus() == null) { m_validatedValues.put(row, value); } T newValue = validateValue(row, value); row.setCellValue(getColumnIndex(), newValue); }
Source:
public static String getMediaServerHostname(boolean full) throws IOException, InterruptedException { if (mediaServerHostname != null) return mediaServerHostname; String command = "hostname"; if (full) command = command + " -f"; Process p = Runtime.getRuntime().exec(command); BufferedReader input = new BufferedReader(new InputStreamReader( p.getInputStream())); p.waitFor(); mediaServerHostname = input.readLine(); return mediaServerHostname; }

Target:
public static String getMediaServerHostname(boolean full) throws IOException, InterruptedException { String command = "hostname"; if (full) command = command + " -f"; Process p = Runtime.getRuntime().exec(command); BufferedReader input = new BufferedReader(new InputStreamReader( p.getInputStream())); p.waitFor(); return input.readLine(); }
Source:
private void search(String keyword) { PortalQueryParameters params = new PortalQueryParameters(); params.setQuery(PortalItem.Type.WEBMAP, null, keyword); ListenableFuture<PortalQueryResultSet<PortalItem>> results = mPortal.findItemsAsync(params); results.addDoneListener(() -> { try { mPortalQueryResultSet = results.get(); mPortalItemList = mPortalQueryResultSet.getResults(); PortalItemAdapter portalItemAdapter = new PortalItemAdapter(mPortalItemList, portalItem -> addMap(mPortal, portalItem.getItemId())); mRecyclerView.setAdapter(portalItemAdapter); mDrawer.openDrawer(Gravity.START); getMoreResults(); } catch (Exception e) { String error = "Error getting portal query result set: " + e; Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); }

Target:
private void search(String keyword) { PortalQueryParameters params = new PortalQueryParameters(); params.setQuery(PortalItem.Type.WEBMAP, null, keyword); ListenableFuture<PortalQueryResultSet<PortalItem>> results = mPortal.findItemsAsync(params); results.addDoneListener(() -> { try { mSearchInstructionsTextView.setVisibility(View.GONE); mPortalQueryResultSet = results.get(); mPortalItemList = mPortalQueryResultSet.getResults(); PortalItemAdapter portalItemAdapter = new PortalItemAdapter(mPortalItemList, portalItem -> addMap(mPortal, portalItem.getItemId())); mRecyclerView.setAdapter(portalItemAdapter); mDrawer.openDrawer(Gravity.START); getMoreResults(); } catch (Exception e) { String error = "Error getting portal query result set: " + e.getMessage(); Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); }
Source:
private void compileSubreportsRecursively(JasperReport report) { JRElementsVisitor.visitReport(report, new JRVisitorSupport() { @Override public void visitSubreport(JRSubreport subreport) { final String compiledSubreportName = evaluateToString(report, subreport.getExpression()); final String sourceSubreportName = compiledSubreportName.replace(".jasper", ".jrxml"); final File compiledSubreportFile = new File(compiledSubreportName); if (!compiledSubreportFile.exists()) { LOG.debug("Compiling Subreport '{}' ...", compiledSubreportName); try { JasperDesign subreportDesign = JRXmlLoader.load(sourceSubreportName); JasperReport subreportCompiled = compileReport(subreportDesign); JRSaver.saveObject(subreportCompiled, compiledSubreportFile); compileSubreportsRecursively(subreportCompiled); } catch (ReportException | JRException e) { LOG.error("Could not compile Jasper Subreport. Expression: {}, Evaluated Expression: {}", subreport.getExpression(), compiledSubreportName, e); } LOG.debug("Subreport '{}' compiled"); } else { try { compileSubreportsRecursively((JasperReport) JRLoader.loadObject(compiledSubreportFile)); } catch (JRException e) { LOG.error("Could not load compiled Jasper Subreport. Expression: {}, Evaluated Expression: {}", subreport.getExpression(), compiledSubreportName, e); } } } }); }

Target:
private void compileSubreportsRecursively(JasperReport report) { JRElementsVisitor.visitReport(report, new JRVisitorSupport() { @Override public void visitSubreport(JRSubreport subreport) { final String compiledSubreportName = evaluateToString(report, subreport.getExpression()); final String sourceSubreportName = compiledSubreportName.replace(".jasper", ".jrxml"); final File compiledSubreportFile = new File(compiledSubreportName); final File sourceSubreportFile = new File(sourceSubreportName); if(!compiledSubreportFile.exists() || compiledSubreportFile.lastModified() < sourceSubreportFile.lastModified()) { LOG.debug("Compiling Subreport '{}' ...", compiledSubreportName); try { JasperDesign subreportDesign = JRXmlLoader.load(sourceSubreportName); JasperReport subreportCompiled = compileReport(subreportDesign); JRSaver.saveObject(subreportCompiled, compiledSubreportFile); compileSubreportsRecursively(subreportCompiled); } catch (ReportException | JRException e) { LOG.error("Could not compile Jasper Subreport. Expression: {}, Evaluated Expression: {}", subreport.getExpression(), compiledSubreportName, e); } LOG.debug("Subreport '{}' compiled", compiledSubreportName); } else { try { compileSubreportsRecursively((JasperReport) JRLoader.loadObject(compiledSubreportFile)); } catch (JRException e) { LOG.error("Could not load compiled Jasper Subreport. Expression: {}, Evaluated Expression: {}", subreport.getExpression(), compiledSubreportName, e); } } } }); }
Source:
public List<TransformExpressionTree> getInputExpressions() { return null; }

Target:
public List<TransformExpressionTree> getInputExpressions() { return Collections.emptyList(); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { AbstractTextEditor textEditor= getActiveTextEditor(); if (textEditor == null) { return null; } FontRegistry fontRegistry= textEditor.getSite().getWorkbenchWindow().getWorkbench().getThemeManager().getCurrentTheme().getFontRegistry(); String fontProperty= textEditor.getSymbolicFontName(); if (fontProperty == null) { fontProperty= JFaceResources.TEXT_FONT; } Set<String> fontsToSet= toUpdateFontSymbolicNames(fontProperty, fontRegistry); FontData[] initialFontData= null; String currentFontName= fontProperty; while (currentFontName != null && (initialFontData= fontRegistry.getFontData(currentFontName)) == null) { currentFontName= fgFontToDefault.get(currentFontName); } FontData[] newFontData= newFontDescriptor(initialFontData).getFontData(); if (newFontData != null) { fontsToSet.stream().forEach(fontName -> fontRegistry.put(fontName, newFontData)); } return Status.OK_STATUS; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { AbstractTextEditor textEditor= getActiveTextEditor(event); if (textEditor == null) { return null; } FontRegistry fontRegistry= textEditor.getSite().getWorkbenchWindow().getWorkbench().getThemeManager().getCurrentTheme().getFontRegistry(); String fontProperty= textEditor.getSymbolicFontName(); if (fontProperty == null) { fontProperty= JFaceResources.TEXT_FONT; } Set<String> fontsToSet= getAffectedFontNames(fontProperty, fontRegistry); FontData[] initialFontData= null; String currentFontName= fontProperty; while (currentFontName != null && (initialFontData= fontRegistry.getFontData(currentFontName)) == null) { currentFontName= fgFontToDefault.get(currentFontName); } FontData[] newFontData= createFontDescriptor(initialFontData).getFontData(); if (newFontData != null) { fontsToSet.stream().forEach(fontName -> fontRegistry.put(fontName, newFontData)); } return Status.OK_STATUS; }
Source:
public IContributionItem createShowingModeContributionItem(IDiagramWorkbenchPart part, ToolBarManager manager) { IWorkbenchPartSite site = part.getSite(); if (site != null && part instanceof DDiagramEditor) { final DDiagramEditor editor = (DDiagramEditor) part; DDiagram editorDiagram = (DDiagram) editor.getRepresentation(); ShowingModeSwitchingAction layoutingModeSwitchingAction = new ShowingModeSwitchingAction(site.getPage(), editorDiagram); TabbarActionContributionItem tabbarActionContributionItem = new TabbarActionContributionItem(layoutingModeSwitchingAction); return tabbarActionContributionItem; } return null; }

Target:
public IContributionItem createShowingModeContributionItem(IDiagramWorkbenchPart part, ToolBarManager manager) { IWorkbenchPartSite site = part.getSite(); if (site != null && part instanceof DDiagramEditor) { final DDiagramEditor editor = (DDiagramEditor) part; DDiagram editorDiagram = (DDiagram) editor.getRepresentation(); ShowingModeSwitchingAction showingModeSwitchingAction = new ShowingModeSwitchingAction(site.getPage(), editorDiagram); TabbarActionContributionItem tabbarActionContributionItem = new TabbarActionContributionItem(showingModeSwitchingAction); return tabbarActionContributionItem; } return null; }
Source:
public boolean equals(Object object) { if ((object == null) || (object.getClass() != getClass())) { return false; } if (object == this) { return true; } MacroId rhs = (MacroId) object; return new EqualsBuilder() .append(getId(), rhs.getId()) .append(getSyntax(), rhs.getSyntax()) .isEquals(); }

Target:
public boolean equals(Object object) { if (object == this) { return true; } if (!(object instanceof MacroId)) { return false; } MacroId rhs = (MacroId) object; return new EqualsBuilder() .append(getId(), rhs.getId()) .append(getSyntax(), rhs.getSyntax()) .isEquals(); }
Source:
public void run() { try { while (isOpen.get()) { boolean allChunksFilled = true; Iterator<PutOperation> iter = putOperations.iterator(); while (iter.hasNext()) { PutOperation op = iter.next(); if (!op.isChunkFillComplete()) { op.fillChunks(); allChunksFilled = false; } } if (allChunksFilled) { Thread.sleep(sleepTimeWhenIdleMs); } } } catch (Exception e) { logger.error("Aborting, as ChunkFillerThread received an exception: ", e); } finally { isOpen.set(false); } }

Target:
public void run() { try { while (isOpen.get()) { boolean allChunksFilled = true; Iterator<PutOperation> iter = putOperations.iterator(); while (iter.hasNext()) { PutOperation op = iter.next(); if (!op.isChunkFillComplete()) { op.fillChunks(); allChunksFilled = false; } } if (allChunksFilled) { Thread.sleep(sleepTimeWhenIdleMs); } } } catch (Throwable e) { logger.error("ChunkFillerThread received an unexpected error: ", e); if (isOpen.compareAndSet(true, false)) { completePendingOperations(); } } }
Source:
public void editingLocalCss_001_UserWithAdminRightsTriesToEditWikiaCss() { WikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN); wiki.openWikiPage(); CommonFunctions.logInCookie(Properties.userNameStaff, Properties.passwordStaff); wiki.openArticle(this.mediaWikiCss); wiki.clickEditButton(""); wiki.waitForStringInURL(this.specialCSS); }

Target:
public void editingLocalCss_001_UserWithAdminRightsTriesToEditWikiaCss() { WikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN); wiki.openWikiPage(); CommonFunctions.logInCookie(Properties.userNameStaff, Properties.passwordStaff); wiki.openArticle(URLsContent.mediaWikiCss); wiki.clickEditButton(); wiki.verifyUrl(URLsContent.specialCSS); }
Source:
private void validateInformations(Technology technology) throws BadRequestException { if (technology.getId() == null || technology.getId().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_ID_CANNOT_BLANK.message()); } else if (technology.getName() == null || technology.getName().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_NAME_CANNOT_BLANK.message()); } else if (technology.getShortDescription() == null || technology.getShortDescription().equals("")) { throw new BadRequestException( ValidationMessageEnums.TECHNOLOGY_SHORT_DESCRIPTION_BLANK.message()); } else if (technology.getDescription() == null || technology.getDescription().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_DESCRIPTION_BLANK.message()); } Technology dbTechnology = technologyDAO.findByName(technology.getName()); if (dbTechnology != null) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_NAME_ALREADY_USED.message()); } }

Target:
private void validateInformations(Technology technology) throws BadRequestException { if (technology.getId() == null || technology.getId().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_ID_CANNOT_BLANK.message()); } else if (technology.getName() == null || technology.getName().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_NAME_CANNOT_BLANK.message()); } else if (technology.getShortDescription() == null || "".equals(technology.getShortDescription())) { throw new BadRequestException( ValidationMessageEnums.TECHNOLOGY_SHORT_DESCRIPTION_BLANK.message()); } else if (technology.getDescription() == null || technology.getDescription().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_DESCRIPTION_BLANK.message()); } Technology dbTechnology = technologyDAO.findByName(technology.getName()); if (dbTechnology != null) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_NAME_ALREADY_USED.message()); } }
Source:
public void classSetup() { profile = StudentProfileAttributes.builder().build(); profile.googleId = "valid.googleId"; profile.shortName = "shor"; profile.institute = "institute"; profile.email = "valid@email.com"; profile.nationality = "Lebanese"; profile.gender = GenderType.OTHER; profile.moreInfo = "moreInfo can have a lot more than this..."; profile.pictureKey = "profile Pic Key"; }

Target:
public void classSetup() { profile = StudentProfileAttributes.builder().build(); profile.googleId = "valid.googleId"; profile.shortName = "shor"; profile.institute = "institute"; profile.email = "valid@email.com"; profile.nationality = "Lebanese"; profile.gender = GenderType.FEMALE; profile.moreInfo = "moreInfo can have a lot more than this..."; profile.pictureKey = "profile Pic Key"; }
Source:
public void notify(final int changeKind) { DDiagramEditorSessionListenerDelegate dDiagramEditorSessionListenerDelegate = new DDiagramEditorSessionListenerDelegate(this, toolFilterWhenRepresentationIsLocked, changeKind); if (Display.getCurrent() == null && changeKind != 4) { EclipseUIUtil.displayAsyncExec(dDiagramEditorSessionListenerDelegate); } else { dDiagramEditorSessionListenerDelegate.run(); } switch (changeKind) { case VSM_UPDATED: modelerDescriptionFilesLoaded(); break; default: break; } }

Target:
public void notify(final int changeKind) { DDiagramEditorSessionListenerDelegate dDiagramEditorSessionListenerDelegate = new DDiagramEditorSessionListenerDelegate(this, toolFilterWhenRepresentationIsLocked, changeKind); if (Display.getCurrent() == null && changeKind != SessionListener.ABOUT_TO_BE_REPLACED) { EclipseUIUtil.displayAsyncExec(dDiagramEditorSessionListenerDelegate); } else { dDiagramEditorSessionListenerDelegate.run(); } switch (changeKind) { case VSM_UPDATED: modelerDescriptionFilesLoaded(); break; default: break; } }
Source:
public long getEmittedObjectCount() { return emittedObjectCount; }

Target:
protected long getEmittedObjectCount() { return emittedObjectCount; }
Source:
public DataGeneratorWithExecutor(DsfExecutor executor) { fExecutor = executor; fExecutor.scheduleAtFixedRate( new DsfRunnable() { public void run() { randomChanges(); } }, fRandom.nextInt(RANDOM_CHANGE_INTERVAL), RANDOM_CHANGE_INTERVAL, TimeUnit.MILLISECONDS); }

Target:
public DataGeneratorWithExecutor(DsfExecutor executor) { fExecutor = executor; final Random rand = new Random(); fExecutor.scheduleAtFixedRate( new DsfRunnable() { public void run() { randomChanges(); } }, rand.nextInt(RANDOM_CHANGE_INTERVAL), RANDOM_CHANGE_INTERVAL, TimeUnit.MILLISECONDS); }