auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void initTrayIconExitHandler(Runnable exitCommand) { final TrayIcon trayIcon = createTrayIcon(exitCommand); try { <START> trayIcon.addMouseListener(new MouseListener() { <END> public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) { restoreFromTray(new ActionEvent(e.getSource(), e.getID(), e.paramString())); } } public void mouseEntered(MouseEvent e) public void mouseExited(MouseEvent e) public void mousePressed(MouseEvent e) public void mouseReleased(MouseEvent e) }); SystemTray.getSystemTray().add(trayIcon); mainWindow.setOnCloseRequest((e) -> { if (Platform.isImplicitExit()) { exitCommand.run(); } else { mainWindow.close(); this.showTrayNotification(trayIcon); } }); } catch (SecurityException | AWTException ex) { mainWindow.setOnCloseRequest((ev) -> { exitCommand.run(); }); } }</code><technical_language>MouseAdapter instead? lambdas, of course, method overwritten</technical_language>

Target:
private void initTrayIconExitHandler(Runnable exitCommand) { final TrayIcon trayIcon = createTrayIcon(exitCommand); try { trayIcon.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) { restoreFromTray(new ActionEvent(e.getSource(), e.getID(), e.paramString())); } } }); SystemTray.getSystemTray().add(trayIcon); mainWindow.setOnCloseRequest((e) -> { if (Platform.isImplicitExit()) { exitCommand.run(); } else { mainWindow.close(); this.showTrayNotification(trayIcon); } }); } catch (SecurityException | AWTException ex) { mainWindow.setOnCloseRequest((ev) -> { exitCommand.run(); }); } }
Source:
<code><START> public void missingAccessDecisionManagerIsDetected() { <END> assertThatIllegalArgumentException().isThrownBy(() -> this.interceptor.setAccessDecisionManager(null)) .withMessage("accessDecisionManager cannot be null"); }</code><technical_language>tests verify a null authorization manager is detected</technical_language>

Target:
public void missingAccessDecisionManagerIsDetected() throws Exception { this.interceptor.setAccessDecisionManager(null); assertThatIllegalArgumentException().isThrownBy(() -> this.interceptor.afterPropertiesSet()); }
Source:
<code><START> public void loadStoredConfig() <END> { 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; } }</code><technical_language>openhab.cfg ManagedService Interface store configuration to? This config file is absolutely intended hold configuration aspects this</technical_language>

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:
<code>public Optional<SchemaSource> get(Topic topic) { try { byte[] schemaBytes = curatorFramework.getData().forPath(zkPaths.topicPath(topic.getName(), SCHEMA_SUFFIX)); <START> return Optional.ofNullable(SchemaSource.valueOf(new String(schemaBytes, Charset.defaultCharset()))); <END> } catch (KeeperException.NoNodeException ex) { return Optional.empty(); } catch (Exception ex) { throw new InternalProcessingException("Could not load from zookeeper schema for topic " + topic.getQualifiedName(), ex); } }</code><technical_language>Optional.of instead of Optional.ofNullable enough</technical_language>

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:
<code>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) { <START> return performSafeScaleDown(f, ++scale, ++depth); <END> } }</code><technical_language>nitpick: try avoid var++ if var updated in multiple places. In this case var + 1 suffices tells reader care var incremented else. Also, I get confused difference of var++ ++var. semantics of var + 1 :)</technical_language>

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:
<code>private void createLogger() { synchronized (logCreatorLock) { String loggerName = System.currentTimeMillis() + "." + this.executionId + "." + this.jobId; logger = Logger.getLogger(loggerName); try { <START> attachFileAppender(createFileAppender()); <END> } 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); } } } }</code><technical_language>Thanks for refactoring this code. easier read now</technical_language>

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:
<code>protected void setup(Binder binder) { String benchmarkSuiteSupplierType = buildConfigObject(BenchmarkConfig.class).getBenchmarkSuiteSupplier(); <START> String database = buildConfigObject(BenchmarkSuiteConfig.class).getDatabase(); <END> 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); } }</code><technical_language>This in if block below. a mysql suite supplier, get database</technical_language>

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:
<code>public void testSTPolygon() throws Exception { <START> 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))'"); <END> assertQueryFails("select ST_AsText(ST_Polygon('LineString(1 1, 2 2, 1 3)'))", "ST_Polygon only applies to Polygon. Input type is: LineString"); }</code><technical_language>nit: test 'POLYGON EMPTY'</technical_language>

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:
<code><START> public SchemaRegistryAvroDeserializer buildSyncClient() { <END> return new SchemaRegistryAvroDeserializer( this.registryUrl, this.credential, this.avroSpecificReader, this.maxSchemaMapSize); }</code><technical_language>Check if credential registryUrl null creating Deserializer</technical_language>

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

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:
<code>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(); } <START> currentEndpoint = endpointIt.next(); <END> currentQuery = queryIt.next(); tempList.add(Pair.of(currentQuery, currentEndpoint)); } return new PairSupplierImpl<Q, E>(ImmutableList.copyOf(tempList)); }</code><technical_language>Empty provider exception</technical_language>

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:
<code>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 { <START> throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported."); <END> } }</code><technical_language>handle return types java.util.Date java.sql.Date</technical_language>

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:
<code>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) { <START> m_lastDataSent = System.currentTimeMillis(); <END> } 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); } } }</code><technical_language>Minor: nanoTime() for local timing is more accurate is monotonic subject clock changes</technical_language>

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:
<code>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)); <START> ConfigAssertions.assertFullMapping(properties, expected); <END> }</code><technical_language>static import assertFullMapping</technical_language>

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:
<code>public boolean remove(String path, int options) { if (path.equals("/")) { notifyListeners("/", HelixPropertyStoreUtils.StoreOperationType.DELETE); pathToRecords.clear(); return true; } else { <START> throw new IllegalStateException("Not implemented"); <END> } }</code><technical_language>do test cases remove a path is "/"</technical_language>

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:
<code>public Cat build() { Cat cat = new Cat(this); <START> String uriSuffix = cat.buildURI(); <END> cat.setURI("_cat/indices" + (uriSuffix.isEmpty() ? "" : "/") + uriSuffix); return cat; }</code><technical_language>URI build logic fit in builder itself. Instead do _roughly_ sth this: java public class Cat extends AbstractAction<CatResult> { private final static String PATH_TO_RESULT = "result"; private final String operationPath; public Cat(AbstractAction.Builder<Cat, ? extends Builder> builder) { super(builder); this.operationPath = builder.operationPath; setURI(buildURI()); } @Override protected String buildURI() { String uriSuffix = super.buildURI(); return "_cat/" + operationPath + (uriSuffix.isEmpty() ? "" : "/") + uriSuffix; } // .... adjust builder classes types (and Cat constructor) provide operationPath string</technical_language>

Target:
public Cat build() { return new Cat(this); }
Source:
<code>public Profile apply(final EPackage missingPackage) { final List<String> closestPackageUris = getClosestPackageURIs(missingPackage); Optional<Profile> foundProfile = <START> null; <END> 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; }</code><technical_language>Optional.absent()</technical_language>

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:
<code>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) { <START> Log.e(TAG, <END> "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; }</code><technical_language>Prior change is override. mLog is Log</technical_language>

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:
<code>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; <START> long creationDate = token.timestamp; long age = new Date().getTime() - creationDate; if (age >= 0 && age < TimeUnit.MINUTES.toMillis(VALID_FOR_MINUTES)) { <END> return new InternalResourceRequest(browserUrl, authenticationName); } return new Redirection(browserUrl); }</code><technical_language>Nit: java.time.Duration Instant for a more fluent API</technical_language>

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:
<code>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) { <START> Timber.w(e, "LanguageUtil::getLocale regional variant split failed. Using code raw."); <END> locale = new Locale(localeCode); } } else { locale = new Locale(localeCode); } return locale; }</code><technical_language>log input</technical_language>

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:
<code>public void onPluginLoad() { Plugin.get().screenRegex("project/(.*)/rev/(.*)/(.*)", new XDocScreen.Factory()); Plugin.get().screenRegex("project/(.*)/(.*)", new XDocScreen.HeadFactory()); <START> Plugin.get().screenRegex("c/(.*)/([0-9.]+)/(.*),unified", <END> new XDocUnifiedDiffScreen.Factory()); Plugin.get().screenRegex("c/(.*)/([0-9.]+)/(.*)", new XDocSideBySideDiffScreen.Factory()); }</code><technical_language>This means regex more 2 points patch set numbers, multiple patch set number specifications, 2..3..4..5</technical_language>

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:
<code>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() { <START> LOG.warn("Attempt to use a closed ledger: {}", ledgerId); <END> 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; }</code><technical_language>Nit: Force() attempted a closed ledger {}</technical_language>

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:
<code>public BusinessArchiveBuilder setActorMapping(final byte[] xmlContent) throws Exception { ActorMapping actorMapping; ActorMappingMarshaller marshaller = new ActorMappingMarshaller(); try { actorMapping = marshaller.deserializeFromXML(xmlContent); } catch (XmlParseException e) { <START> throw new Exception("Generation of the actorMapping from the provided Xml failed", e); <END> } setActorMapping(actorMapping); return this; }</code><technical_language>Exception? a IOException</technical_language>

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:
<code>public void testChangedShippingAddress() throws InterruptedException { createValidCheckout(); fetchShippingRates(HttpStatus.SC_OK); setShippingRate(); Address address = checkout.getShippingAddress(); address.setCity("Toronto"); <START> <END> checkout.setShippingAddress(address); updateCheckout(); fetchShippingRates(HttpStatus.SC_OK); setShippingRate(); assertEquals(checkout.getShippingAddress().getCity(), "Toronto"); }</code><technical_language>if functions needed. this point, check if shipping rate invalidated</technical_language>

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:
<code>public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects() { List<GlobalBusinessObjectDetail> detailObjects = new ArrayList<>(); detailObjects.addAll(subAccountGlobalDetails); detailObjects.addAll(subAccountGlobalNewAccountDetails); <START> return subAccountGlobalDetails; <END> }</code><technical_language>I return object needs updated return new detailObjects</technical_language>

Target:
public List<? extends GlobalBusinessObjectDetail> getAllDetailObjects() { List<GlobalBusinessObjectDetail> detailObjects = new ArrayList<>(); detailObjects.addAll(subAccountGlobalDetails); detailObjects.addAll(subAccountGlobalNewAccountDetails); return detailObjects; }
Source:
<code>private void setValueInternal(ITableRow row, T value, IFormField editingField) throws ProcessingException { <START> if (m_validatedValues.containsKey(row)) { <END> 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); }</code><technical_language>issue while updating existing row. a row is updated removed inserted (see call of updateRows(updatedRows); in "private void replaceRowsCase2(ITableRow[] newRows)" resolveRow(ITableRow row) in AbstractTable , ITableRow param is instance of TableRow of type InternalTableRow. representations of row do match hashCode- equals-method. While addRows(insertedRows, false, insertedRowIndexes); is passing InternalTableRow this method. This if removed. validation done time a is set outside</technical_language>

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:
<code>public static String getMediaServerHostname(boolean full) throws IOException, InterruptedException { <START> if (mediaServerHostname != null) <END> 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; }</code><technical_language>1.if request full=true next request full=false, get one... 2.i do loading request, i block wowza thread for long</technical_language>

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:
<code>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) { <START> String error = "Error getting portal query result set: " + e; <END> Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); }</code><technical_language>show custom error in Toast actual exception (for user readability) " java.util.concurrent.ExecutionException: java.io.IOException: Loading of dependent object failed" logging for logcat.</technical_language>

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:
<code>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); } <START> LOG.debug("Subreport '{}' compiled"); <END> } 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); } } } }); }</code><technical_language>missing argument here, you</technical_language>

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:
<code>public List<TransformExpressionTree> getInputExpressions() { <START> return null; <END> }</code><technical_language>suggestion return Collections.emptyList();</technical_language>

Target:
public List<TransformExpressionTree> getInputExpressions() { return Collections.emptyList(); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { AbstractTextEditor textEditor= <START> getActiveTextEditor(); <END> 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; }</code><technical_language>find editor is provided event, HandlerUtil.getActiveEditor(event). For return 'true' isEnabled, active text context is active. A new method added checks supports zooming. Currently this means AbstractTextEditor in hands. consider add ITextEditorExtension7 interface later</technical_language>

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:
<code>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 <START> layoutingModeSwitchingAction <END> = new ShowingModeSwitchingAction(site.getPage(), editorDiagram); TabbarActionContributionItem tabbarActionContributionItem = new TabbarActionContributionItem(layoutingModeSwitchingAction); return tabbarActionContributionItem; } return null; }</code><technical_language>showing</technical_language>

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:
<code>public boolean equals(Object object) { <START> if ((object == null) || (object.getClass() != getClass())) { <END> return false; } if (object == this) { return true; } MacroId rhs = (MacroId) object; return new EqualsBuilder() .append(getId(), rhs.getId()) .append(getSyntax(), rhs.getSyntax()) .isEquals(); }</code><technical_language>need for parenthesis (they produce a Sonar issue)</technical_language>

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:
<code>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 { <START> isOpen.set(false); <END> } }</code><technical_language>@pnarayanan Please correct if I wrong. If is exception ChunkFiller thread, finally set PutManager's isOpen false. So, PutManager is closed. Then, is behavior of rest of world? router closed, right? more PutOperations submitted PutManager, check if PutManager is closed. pending PutOperations? timed out? Also, OperationController is able handle responses for PutOperation in a normal way</technical_language>

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:
<code>public void editingLocalCss_001_UserWithAdminRightsTriesToEditWikiaCss() { WikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN); wiki.openWikiPage(); CommonFunctions.logInCookie(Properties.userNameStaff, Properties.passwordStaff); wiki.openArticle(this.mediaWikiCss); <START> wiki.clickEditButton(""); <END> wiki.waitForStringInURL(this.specialCSS); }</code><technical_language>do pass empty string ClickEditButton method</technical_language>

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); }