auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testValidRequest() { try { HttpServletRequest req = EasyMock.createStrictMock(HttpServletRequest.class); HttpServletResponse resp = EasyMock.createStrictMock(HttpServletResponse.class); FilterChain filterChain = EasyMock.createNiceMock(FilterChain.class); ServletOutputStream outputStream = EasyMock.createNiceMock(ServletOutputStream.class); EasyMock.expect(resp.getOutputStream()).andReturn(outputStream).once(); EasyMock.expect(req.getAttribute(AuthConfig.DRUID_AUTH_TOKEN)).andReturn("so-very-valid").once(); EasyMock.expect(req.getAttribute(AuthConfig.DRUID_AUTH_TOKEN_CHECKED)).andReturn(true).once(); EasyMock.replay(req, resp, filterChain, outputStream); PreResponseAuthorizationCheckFilter filter = new PreResponseAuthorizationCheckFilter( authConfig, authenticators, new DefaultObjectMapper() ); filter.doFilter(req, resp, filterChain); EasyMock.verify(req, resp, filterChain, outputStream); } catch (Exception ex) { throw new RuntimeException(ex); } }

Target:
public void testValidRequest() throws Exception { AuthenticationResult authenticationResult = new AuthenticationResult("so-very-valid", "so-very-valid"); HttpServletRequest req = EasyMock.createStrictMock(HttpServletRequest.class); HttpServletResponse resp = EasyMock.createStrictMock(HttpServletResponse.class); FilterChain filterChain = EasyMock.createNiceMock(FilterChain.class); ServletOutputStream outputStream = EasyMock.createNiceMock(ServletOutputStream.class); EasyMock.expect(req.getAttribute(AuthConfig.DRUID_AUTHENTICATION_RESULT)).andReturn(authenticationResult).once(); EasyMock.expect(req.getAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED)).andReturn(true).once(); EasyMock.replay(req, resp, filterChain, outputStream); PreResponseAuthorizationCheckFilter filter = new PreResponseAuthorizationCheckFilter( authenticators, new DefaultObjectMapper() ); filter.doFilter(req, resp, filterChain); EasyMock.verify(req, resp, filterChain, outputStream); }
Source:
public int compareValueTo( ZonedDateTimeSchemaKey other ) { int compare = Long.compare( epochSecondUTC, other.epochSecondUTC ); if ( compare == 0 ) { compare = Integer.compare( nanoOfSecond, other.nanoOfSecond ); } if ( compare == 0 ) { compare = zoneId >= 0 ? Integer.compare( zoneId, other.zoneId ) : Integer.compare( zoneOffsetSeconds, zoneOffsetSeconds ); } return compare; }

Target:
public int compareValueTo( ZonedDateTimeSchemaKey other ) { int compare = Long.compare( epochSecondUTC, other.epochSecondUTC ); if ( compare == 0 ) { compare = Integer.compare( nanoOfSecond, other.nanoOfSecond ); if ( compare == 0 && ( differentValidZoneId( other ) || differentValidZoneOffset( other ) ) ) { compare = Values.COMPARATOR.compare( asValue(), other.asValue() ); } } return compare; }
Source:
private Object wrapTopLevelContainer(Object handle){ if (handle instanceof Map){ return new MapWrapper((Map)handle); } if (handle instanceof List){ return new ListWrapper((List)handle); } if (handle instanceof Set){ return new SetWrapper((Set)handle); } if (handle.getClass().isArray()){ return new ArrayWrapper((Object[])handle); } return handle; }

Target:
private Object wrapTopLevelContainer(Object handle){ if (handle instanceof Map){ return new MapWrapper((Map)handle); } if (handle instanceof List){ return new ListWrapper((List)handle); } if (handle instanceof Set){ return new SetWrapper((Set)handle); } if (handle.getClass().isArray()){ return new ArrayWrapper(convertToObjectArray(handle)); } return handle; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dev_auth); recyclerView = (RecyclerView) findViewById(R.id.devAuthRecyclerView); String json = getIntent().getStringExtra("emails_json"); List<String> emails = new ArrayList<>(); int direct_admin_size = 1; connectionProgressDialog = new ProgressDialog(this); connectionProgressDialog.setMessage(getString(R.string.signing_in)); try { JSONObject jsonObject = new JSONObject(json); JSONArray jsonArray = jsonObject.getJSONArray("direct_admins"); for (int i = 0; i < jsonArray.length(); i++) { emails.add(jsonArray.get(i).toString()); } direct_admin_size = jsonArray.length(); jsonArray = jsonObject.getJSONArray("direct_users"); for (int i = 0; i < jsonArray.length(); i++) { emails.add(jsonArray.get(i).toString()); } } catch (JSONException e) { e.printStackTrace(); } AuthEmailAdapter authEmailAdapter = new AuthEmailAdapter(emails, direct_admin_size); recyclerView.setAdapter(authEmailAdapter); recyclerView.setLayoutManager(new LinearLayoutManager(DevAuthActivity.this) { }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dev_auth); String json = getIntent().getStringExtra(AsyncDevGetEmails.EMAIL_JSON); recyclerView = (RecyclerView) findViewById(R.id.devAuthRecyclerView); List<String> emails = new ArrayList<>(); int directAdminSize = 1; connectionProgressDialog = new ProgressDialog(this); connectionProgressDialog.setMessage(getString(R.string.signing_in)); try { JSONObject jsonObject = new JSONObject(json); JSONArray jsonArray = jsonObject.getJSONArray("direct_admins"); for (int i = 0; i < jsonArray.length(); i++) { emails.add(jsonArray.get(i).toString()); } directAdminSize = jsonArray.length(); jsonArray = jsonObject.getJSONArray("direct_users"); for (int i = 0; i < jsonArray.length(); i++) { emails.add(jsonArray.get(i).toString()); } } catch (JSONException e) { ZLog.logException(e); } AuthEmailAdapter authEmailAdapter = new AuthEmailAdapter(emails, directAdminSize, DevAuthActivity.this); recyclerView.setAdapter(authEmailAdapter); authEmailAdapter.setOnItemClickListener(new AuthClickListener() { @Override public void onItemClick(String email) { AsyncLogin asyncLogin = new AsyncLogin(DevAuthActivity.this, email, null, true); asyncLogin.execute(); connectionProgressDialog.show(); } }); recyclerView.setLayoutManager(new LinearLayoutManager(DevAuthActivity.this) { }); }
Source:
public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { boolean retry = false; try { switch (response.getStatusCode()) { case 401: Multimap<String, String> headers = command.getCurrentRequest().getHeaders(); if (headers != null && headers.containsKey(AuthHeaders.AUTH_USER) && headers.containsKey(AuthHeaders.AUTH_KEY) && !headers.containsKey(AuthHeaders.AUTH_TOKEN)) { retry = false; } else { closeClientButKeepContentStream(response); Integer count = retryCountMap.getIfPresent(command); if (count == null) { logger.debug("invalidating authentication token - first time for %s", command); retryCountMap.put(command, 1); authenticationResponseCache.invalidateAll(); retry = true; } else { if (count + 1 >= NUM_RETRIES) { logger.debug("too many 401s - giving up after: %s for %s", count, command); retry = false; } else { logger.debug("invalidating authentication token - retry %s for %s", count, command); retryCountMap.put(command, count + 1); authenticationResponseCache.invalidateAll(); Uninterruptibles.sleepUninterruptibly(5, TimeUnit.SECONDS); retry = true; } } } break; } return retry; } finally { closeClientButKeepContentStream(response); } }

Target:
public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { boolean retry = false; switch (response.getStatusCode()) { case 401: Multimap<String, String> headers = command.getCurrentRequest().getHeaders(); if (headers != null && headers.containsKey(AuthHeaders.AUTH_USER) && headers.containsKey(AuthHeaders.AUTH_KEY) && !headers.containsKey(AuthHeaders.AUTH_TOKEN)) { retry = false; } else { Integer count = retryCountMap.getIfPresent(command); if (count == null) { logger.debug("invalidating authentication token - first time for %s", command); retryCountMap.put(command, 1); authenticationResponseCache.invalidateAll(); retry = true; } else { if (count + 1 >= NUM_RETRIES) { logger.debug("too many 401s - giving up after: %s for %s", count, command); retry = false; } else { logger.debug("invalidating authentication token - retry %s for %s", count, command); retryCountMap.put(command, count + 1); authenticationResponseCache.invalidateAll(); Uninterruptibles.sleepUninterruptibly(5, TimeUnit.SECONDS); retry = true; } } } break; } return retry; }
Source:
private void updateChunkingAndSizeMetricsOnSuccessfulGet() { routerMetrics.getBlobSizeBytes.update(bytesWritten); routerMetrics.getBlobChunkCount.update(numChunksTotal); if (hasRange) { routerMetrics.getBlobWithRangeSizeBytes.update(bytesWritten); routerMetrics.getBlobWithRangeChunkCount.update(numChunksTotal); } if (numChunksTotal == 1) { routerMetrics.simpleBlobGetCount.inc(); } else { routerMetrics.compositeBlobGetCount.inc(); } }

Target:
private void updateChunkingAndSizeMetricsOnSuccessfulGet() { routerMetrics.getBlobSizeBytes.update(bytesWritten); routerMetrics.getBlobChunkCount.update(numChunksTotal); if (options != null && options.getRange() != null) { routerMetrics.getBlobWithRangeSizeBytes.update(bytesWritten); routerMetrics.getBlobWithRangeTotalBlobSizeBytes.update(totalSize); } if (numChunksTotal == 1) { routerMetrics.simpleBlobGetCount.inc(); } else { routerMetrics.compositeBlobGetCount.inc(); } }
Source:
private InputFile inputFile(String relativePath, Type type) { DefaultInputFile inputFile = new DefaultInputFile("moduleKey", relativePath) .setModuleBaseDir(moduleBaseDir.toPath()) .setLanguage("js") .setType(type); inputFile.initMetadata(new FileMetadata().readMetadata(inputFile.file(), Charset.defaultCharset())); context.fileSystem().add(inputFile); return inputFile; }

Target:
private InputFile inputFile(String relativePath, Type type) { DefaultInputFile inputFile = new DefaultInputFile("moduleKey", relativePath) .setModuleBaseDir(moduleBaseDir.toPath()) .setLanguage("js") .setType(type); inputFile.initMetadata(new FileMetadata().readMetadata(inputFile.file(), Charsets.UTF_8)); context.fileSystem().add(inputFile); return inputFile; }
Source:
private void pushToDownstream() { downstream().push(rows.get(rowIdx)); rowIdx++; requested--; if (rowIdx >= rows.size() && waiting == -1 && requested > 0) downstream().end(); }

Target:
private void pushToDownstream() { inLoop = true; downstream().push(rows.get(rowIdx)); inLoop = false; rowIdx++; requested--; if (rowIdx >= rows.size() && waiting == -1 && requested > 0) downstream().end(); }
Source:
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equals(MODULE)) { final String originalName = attributes.getValue(NAME); final String name; if (threadModeSettings == null) { name = originalName; } else { name = threadModeSettings.resolveName(originalName); } final DefaultConfiguration conf = new DefaultConfiguration(name, threadModeSettings); if (configuration == null) { configuration = conf; } if (!configStack.isEmpty()) { final DefaultConfiguration top = configStack.peek(); top.addChild(conf); } configStack.push(conf); } else if (qName.equals(PROPERTY)) { final String value; try { value = replaceProperties(attributes.getValue(VALUE), overridePropsResolver, attributes.getValue(DEFAULT)); } catch (final CheckstyleException ex) { throw new SAXException(ex); } final String name = attributes.getValue(NAME); final DefaultConfiguration top = configStack.peek(); top.addAttribute(name, value); } else if (qName.equals(MESSAGE)) { final String key = attributes.getValue(KEY); final String value = attributes.getValue(VALUE); final DefaultConfiguration top = configStack.peek(); top.addMessage(key, value); } else { if (!qName.equals(METADATA)) { throw new IllegalStateException("Unknown name:" + qName + "."); } } }

Target:
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equals(MODULE)) { final String originalName = attributes.getValue(NAME); final String name = threadModeSettings.resolveName(originalName); final DefaultConfiguration conf = new DefaultConfiguration(name, threadModeSettings); if (configuration == null) { configuration = conf; } if (!configStack.isEmpty()) { final DefaultConfiguration top = configStack.peek(); top.addChild(conf); } configStack.push(conf); } else if (qName.equals(PROPERTY)) { final String value; try { value = replaceProperties(attributes.getValue(VALUE), overridePropsResolver, attributes.getValue(DEFAULT)); } catch (final CheckstyleException ex) { throw new SAXException(ex); } final String name = attributes.getValue(NAME); final DefaultConfiguration top = configStack.peek(); top.addAttribute(name, value); } else if (qName.equals(MESSAGE)) { final String key = attributes.getValue(KEY); final String value = attributes.getValue(VALUE); final DefaultConfiguration top = configStack.peek(); top.addMessage(key, value); } else { if (!qName.equals(METADATA)) { throw new IllegalStateException("Unknown name:" + qName + "."); } } }
Source:
public ValidationLayer getValidationLayer() throws CatalogException { if(valLayer != null) { return valLayer; } else { throw new CatalogException("validation layer is not initialized"); } }

Target:
public ValidationLayer getValidationLayer() { return valLayer; }
Source:
public boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleeper) { try { sleeper.sleepFor(retryIntervalMs, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { log.warn("Error occurred while sleeping", e); } return true; }

Target:
public boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleeper) { try { sleeper.sleepFor(retryIntervalMs, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { log.warn("Error occurred while sleeping", e); Thread.currentThread().interrupt(); } return true; }
Source:
private Expression simplifyExpression(Session session, Expression predicate, TypeProvider types) { Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(session, predicate, types); ExpressionInterpreter interpreter = ExpressionInterpreter.expressionOptimizer(predicate, metadata, session, expressionTypes); Object value = interpreter.optimize(NoOpSymbolResolver.INSTANCE); if (value instanceof Expression) { return (Expression) value; } if (value == null) { value = false; } return literalEncoder.toExpression(value, BOOLEAN); }

Target:
private Expression simplifyExpression(Session session, Expression predicate, TypeProvider types) { Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(session, predicate, types); ExpressionInterpreter interpreter = ExpressionInterpreter.expressionOptimizer(predicate, metadata, session, expressionTypes); Object value = interpreter.optimize(NoOpSymbolResolver.INSTANCE); if (value == null) { value = false; } return literalEncoder.toExpression(value, BOOLEAN); }
Source:
public T remove(int index) { try { T removedObject = super.remove(index); comparingSet.remove(removedObject); return removedObject; } catch (IndexOutOfBoundsException ioobException) { throw new IndexOutOfBoundsException(); } }

Target:
public T remove(int index) { try { T removedObject = super.remove(index); comparingSet.remove(removedObject); return removedObject; } catch (IndexOutOfBoundsException ioobException) { throw ioobException; } }
Source:
private void useRegistryForConfigIfNecessary() { registries.stream().filter(RegistryConfig::isZookeeperProtocol).findFirst().ifPresent(rc -> { Environment.getInstance().getDynamicConfiguration().orElseGet(() -> { ConfigManager configManager = ConfigManager.getInstance(); ConfigCenterConfig cc = configManager.getConfigCenter().orElse(new ConfigCenterConfig()); if (StringUtils.isNotEmpty(rc.getClient())) { Map<String, String> newParametersMap = cc.getParameters() != null ? cc.getParameters() : new HashMap<>(); newParametersMap.put(CLIENT_KEY, rc.getClient()); cc.setParameters(newParametersMap); } cc.setProtocol(rc.getProtocol()); cc.setAddress(rc.getAddress()); cc.setHighestPriority(false); setConfigCenter(cc); startConfigCenter(); return null; }); }); }

Target:
private void useRegistryForConfigIfNecessary() { registries.stream().filter(RegistryConfig::isZookeeperProtocol).findFirst().ifPresent(rc -> { Environment.getInstance().getDynamicConfiguration().orElseGet(() -> { ConfigManager configManager = ConfigManager.getInstance(); ConfigCenterConfig cc = configManager.getConfigCenter().orElse(new ConfigCenterConfig()); if (StringUtils.isNotEmpty(rc.getClient())) { Map<String, String> parameters = cc.getParameters(); if (parameters == null) { parameters = new HashMap<>(); cc.setParameters(parameters); } parameters.putIfAbsent(CLIENT_KEY, rc.getClient()); } cc.setProtocol(rc.getProtocol()); cc.setAddress(rc.getAddress()); cc.setHighestPriority(false); setConfigCenter(cc); startConfigCenter(); return null; }); }); }
Source:
public JMenuItem[] getMenuItemsAtLocation(MENU_LOCATION location) { if (location == MENU_LOCATION.TOOLS) { JMenuItem menuItemIC = new JMenuItem(JMeterUtils.getResString("generate_report_ui.html_report_menu"), KeyEvent.VK_UNDEFINED); menuItemIC.setName(ActionNames.HTML_REPORT); menuItemIC.setActionCommand(ActionNames.HTML_REPORT); menuItemIC.setAccelerator(null); menuItemIC.addActionListener(ActionRouter.getInstance()); return new JMenuItem[] { menuItemIC }; } return new JMenuItem[0]; }

Target:
public JMenuItem[] getMenuItemsAtLocation(MENU_LOCATION location) { if (location != MENU_LOCATION.TOOLS) { return new JMenuItem[0]; } JMenuItem menuItem = new JMenuItem(JMeterUtils.getResString("generate_report_ui.html_report_menu"), KeyEvent.VK_UNDEFINED); menuItem.setName(ActionNames.HTML_REPORT); menuItem.setActionCommand(ActionNames.HTML_REPORT); menuItem.setAccelerator(null); menuItem.addActionListener(ActionRouter.getInstance()); return new JMenuItem[] { menuItem }; }
Source:
private String buildHashedPayload(HttpRequest request) { String hashedPayload = ""; try { byte[] unhashedBytes = request.getPayload() == null ? "".getBytes() : ByteStreams.toByteArray(request .getPayload().getInput()); hashedPayload = sha256(unhashedBytes); } catch (IOException e) { throw new HttpException("Error signing request", e); } return hashedPayload; }

Target:
private static String buildHashedPayload(HttpRequest request) { try { byte[] unhashedBytes = request.getPayload() == null ? "".getBytes() : ByteStreams.toByteArray(request .getPayload().getInput()); return sha256(unhashedBytes); } catch (IOException e) { throw new HttpException("Error signing request", e); } }
Source:
protected void runJob() { JNodeCache nodeCache = cache.getNodeCache(); final TextSearchIndex index = new TextSearchIndex(nodeCache); final CodeUsageInfo usageInfo = new CodeUsageInfo(nodeCache); cache.setTextIndex(index); cache.setUsageInfo(usageInfo); final boolean alwaysIndex = !wrapper.getSettings().isSkipClassIndexingIfLowMemory(); for (final JavaClass cls : wrapper.getIncludedClasses()) { addTask(new Runnable() { @Override public void run() { try { index.indexNames(cls); CodeLinesInfo linesInfo = new CodeLinesInfo(cls); List<StringRef> lines = splitLines(cls); usageInfo.processClass(cls, linesInfo, lines); if (alwaysIndex || Utils.isFreeMemoryAvailable()) { index.indexCode(cls, linesInfo, lines); } else { index.classCodeIndexSkipped(cls); } } catch (Exception e) { LOG.error("Index error in class: {}", cls.getFullName(), e); } } }); } }

Target:
protected void runJob() { JNodeCache nodeCache = cache.getNodeCache(); final TextSearchIndex index = new TextSearchIndex(nodeCache); final CodeUsageInfo usageInfo = new CodeUsageInfo(nodeCache); cache.setTextIndex(index); cache.setUsageInfo(usageInfo); for (final JavaClass cls : wrapper.getIncludedClasses()) { addTask(new Runnable() { @Override public void run() { try { index.indexNames(cls); CodeLinesInfo linesInfo = new CodeLinesInfo(cls); List<StringRef> lines = splitLines(cls); usageInfo.processClass(cls, linesInfo, lines); if (Utils.isFreeMemoryAvailable()) { index.indexCode(cls, linesInfo, lines); } else { index.classCodeIndexSkipped(cls); } } catch (Exception e) { LOG.error("Index error in class: {}", cls.getFullName(), e); } } }); } }
Source:
public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookContentType hookContentType, String template) { switch (hookContentType) { case BINARY: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookContentType.BINARY.toString(); case TEXT: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookContentType.TEXT.toString(); default: return null; } }

Target:
public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookContentType hookContentType, String template) { switch (hookContentType) { case BINARY: return HookContentType.BINARY.toString(); case TEXT: return HookContentType.TEXT.toString(); default: return null; } }
Source:
@Override public void unparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { switch (call.getKind()) { case FLOOR: if (call.operandCount() != 2) { super.unparseCall(writer, call, leftPrec, rightPrec); return; } unparseFloor(writer, call); break; case ROW: unparseRow(writer, call); break; default: super.unparseCall(writer, call, leftPrec, rightPrec); } }

Target:
@Override public void unparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { switch (call.getKind()) { case FLOOR: if (call.operandCount() != 2) { super.unparseCall(writer, call, leftPrec, rightPrec); return; } unparseFloor(writer, call); break; default: super.unparseCall(writer, call, leftPrec, rightPrec); } }
Source:
public static synchronized void stop() { if (recoveryManager != null) { recoveryManager.terminate(); recoveryManager = null; } }

Target:
public static synchronized void stop() { if (!initialized) return; if (recoveryManager != null) { recoveryManager.terminate(); recoveryManager = null; } unregisterJndiBindings(); try { DriverManager.deregisterDriver(new TransactionalDriver()); } catch (SQLException e) { if (tsLogger.logger.isInfoEnabled()) tsLogger.logger.debug("Unable to deregister TransactionalDriver: " + e.getMessage(), e); } if (replacedJndiProperties) jdbcPropertyManager.getJDBCEnvironmentBean().setJndiProperties(null); initialized = false; }
Source:
private List<List<String>> readCSVFile(File csvFile) throws IOException { List<List<String>> rows = new ArrayList<>(); try (BufferedReader buffer = new BufferedReader(new FileReader(csvFile))) { String lineString; while ((lineString = buffer.readLine()) != null) { String[] columns = lineString.split(DELIMITER); rows.add(Arrays.asList(columns)); } } return rows; }

Target:
private List<List<String>> readCSVFile(File csvFile) throws IOException { List<List<String>> rows = new ArrayList<>(); try (BufferedReader buffer = new BufferedReader(new FileReader(csvFile))) { String lineString; while ((lineString = buffer.readLine()) != null) { String[] columns = lineString.split(DELIMITER); String[] columnsWithoutAppName = Arrays.copyOfRange(columns,1,columns.length ); rows.add(Arrays.asList(columnsWithoutAppName)); } } return rows; }
Source:
public void render(Graphics g, float x, float y, float width, float height) { g.drawNinePatch(ninePatch, x, y, width, height); g.drawLineSegment(x, 0, x, g.getWindowHeight()); g.drawLineSegment(0, y, g.getWindowWidth(), y); g.drawLineSegment(x + width, 0, x + width, g.getWindowHeight()); g.drawLineSegment(0, y + height, g.getWindowWidth(), y + height); }

Target:
public void render(Graphics g, float x, float y, float width, float height) { g.drawNinePatch(ninePatch, x, y, width, height); }
Source:
public void initializeStore() { final File stateDir = TestUtils.tempDirectory(); metrics = new Metrics(); final StreamsMetricsImpl metrics = new StreamsMetricsImpl(KStreamSessionWindowAggregateProcessorTest.this.metrics, "test", StreamsConfig.METRICS_LATEST); context = new InternalMockProcessorContext( stateDir, Serdes.String(), Serdes.String(), metrics, new StreamsConfig(StreamsTestUtils.getStreamsConfig()), NoOpRecordCollector::new, new ThreadCache(new LogContext("testCache "), 100000, metrics) ) { @Override public <K, V> void forward(final K key, final V value, final To to) { toInternal.update(to); results.add(new KeyValueTimestamp<>(key, value, toInternal.timestamp())); } }; initStore(true); processor.init(context); }

Target:
public void initializeStore() { final File stateDir = TestUtils.tempDirectory(); metrics = new Metrics(); final StreamsMetricsImpl streamsMetrics = new StreamsMetricsImpl(metrics, "test", StreamsConfig.METRICS_LATEST); context = new InternalMockProcessorContext( stateDir, Serdes.String(), Serdes.String(), streamsMetrics, new StreamsConfig(StreamsTestUtils.getStreamsConfig()), NoOpRecordCollector::new, new ThreadCache(new LogContext("testCache "), 100000, streamsMetrics) ) { @Override public <K, V> void forward(final K key, final V value, final To to) { toInternal.update(to); results.add(new KeyValueTimestamp<>(key, value, toInternal.timestamp())); } }; initStore(true); processor.init(context); }
Source:
void submit(Request request) { Object target = request.getTarget(); if (target == null) return; cancelExistingRequest(target, request.uri); targetsToRequests.put(target, request); requestSparseArray.put(request.getTargetRef().hashCode(), request); request.future = service.submit(request); }

Target:
void submit(Request request) { Object target = request.getTarget(); if (target == null) return; cancelExistingRequest(target, request.uri); targetsToRequests.put(target, request); request.future = service.submit(request); }
Source:
public CaseSensitiveMappedSchemaTableName(String schemaName, String tableName) { if (schemaName == null) { throw new NullPointerException("schemaName is null"); } if (schemaName.isEmpty()) { throw new IllegalArgumentException("schemaName is empty"); } this.schemaName = schemaName; this.schemaNameLower = schemaName.toLowerCase(ENGLISH); if (tableName == null) { throw new NullPointerException("tableName is null"); } if (tableName.isEmpty()) { throw new IllegalArgumentException("tableName is empty"); } this.tableName = tableName; this.tableNameLower = tableName.toLowerCase(ENGLISH); }

Target:
public CaseSensitiveMappedSchemaTableName(String schemaName, String tableName) { this.schemaName = requireNonNull(schemaName, "schemaName is null"); if (schemaName.isEmpty()) { throw new IllegalArgumentException("schemaName is empty"); } this.schemaNameLower = schemaName.toLowerCase(ENGLISH); this.tableName = requireNonNull(tableName, "tableName is null"); if (tableName.isEmpty()) { throw new IllegalArgumentException("tableName is empty"); } this.tableNameLower = tableName.toLowerCase(ENGLISH); }
Source:
public List<DataSample> getData() { return data; }

Target:
public List<DataSample> getData() { return this.data; }
Source:
private boolean flowControl(int size) { boolean flowWorked = replicatingChannel.getConnection().blockUntilWritable(size, timeout); if (!flowWorked) { try { ActiveMQServerLogger.LOGGER.slowReplicationResponse(); stop(); } catch (Exception e) { ActiveMQServerLogger.LOGGER.failedToStopReplicationServer(e); } } return flowWorked; }

Target:
private boolean flowControl(int size) { boolean flowWorked = replicatingChannel.getConnection().blockUntilWritable(size, timeout); if (!flowWorked) { try { ActiveMQServerLogger.LOGGER.slowReplicationResponse(); stop(); } catch (Exception e) { logger.warn(e.getMessage(), e); } } return flowWorked; }
Source:
static <E, T> Validation<E, T> invalid(E error) { Objects.requireNonNull(error, "errors is null"); return new Invalid<>(error); }

Target:
static <E, T> Validation<E, T> invalid(E error) { Objects.requireNonNull(error, "error is null"); return new Invalid<>(error); }
Source:
private String getApplicationLabel(ComponentName componentName) { final PackageManager pm = getPackageManager(); ApplicationInfo info = null; try { info = pm.getApplicationInfo(componentName.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "Application info not found for packageName " + componentName .getPackageName()); } if (info == null) { return componentName.getPackageName(); } else { return info.loadLabel(pm).toString(); } }

Target:
private String getApplicationLabel(ComponentName componentName) { final PackageManager pm = getPackageManager(); try { ApplicationInfo info = pm.getApplicationInfo(componentName.getPackageName(), 0); return pm.getApplicationLabel(info).toString(); } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "Application info not found for packageName " + componentName .getPackageName()); } return componentName.getPackageName(); }
Source:
protected Node visitShowTables(ShowTables showTables, Void context) { CatalogSchemaName schema = createCatalogSchemaName(session, showTables, showTables.getSchema()); accessControl.checkCanShowTablesMetadata(session.getRequiredTransactionId(), session.getIdentity(), schema); if (!metadata.catalogExists(session, schema.getCatalogName())) { throw new SemanticException(MISSING_SCHEMA, showTables, "Catalog '%s' does not exist", schema.getCatalogName()); } if (!metadata.schemaExists(session, schema)) { throw new SemanticException(MISSING_SCHEMA, showTables, "Schema '%s' does not exist", schema.getSchemaName()); } Expression predicate = equal(identifier("table_schema"), new StringLiteral(schema.getSchemaName())); Optional<String> likePattern = showTables.getLikePattern(); if (likePattern.isPresent()) { Expression likePredicate = new LikePredicate(identifier("table_name"), new StringLiteral(likePattern.get()), null); predicate = logicalAnd(predicate, likePredicate); } return simpleQuery( selectList(aliasedName("table_name", "Table")), from(schema.getCatalogName(), TABLE_TABLES), predicate, ordering(ascending("table_name"))); }

Target:
protected Node visitShowTables(ShowTables showTables, Void context) { CatalogSchemaName schema = createCatalogSchemaName(session, showTables, showTables.getSchema()); accessControl.checkCanShowTablesMetadata(session.getRequiredTransactionId(), session.getIdentity(), schema); if (!metadata.catalogExists(session, schema.getCatalogName())) { throw new SemanticException(MISSING_CATALOG, showTables, "Catalog '%s' does not exist", schema.getCatalogName()); } if (!metadata.schemaExists(session, schema)) { throw new SemanticException(MISSING_SCHEMA, showTables, "Schema '%s' does not exist", schema.getSchemaName()); } Expression predicate = equal(identifier("table_schema"), new StringLiteral(schema.getSchemaName())); Optional<String> likePattern = showTables.getLikePattern(); if (likePattern.isPresent()) { Expression likePredicate = new LikePredicate(identifier("table_name"), new StringLiteral(likePattern.get()), null); predicate = logicalAnd(predicate, likePredicate); } return simpleQuery( selectList(aliasedName("table_name", "Table")), from(schema.getCatalogName(), TABLE_TABLES), predicate, ordering(ascending("table_name"))); }
Source:
public ClientCnxn( String chrootPath, HostProvider hostProvider, int sessionTimeout, ZKClientConfig clientConfig, Watcher defaultWatcher, ClientCnxnSocket clientCnxnSocket, boolean canBeReadOnly ) { this( chrootPath, hostProvider, sessionTimeout, clientConfig, defaultWatcher, clientCnxnSocket, 0, new byte[16], canBeReadOnly); }

Target:
public ClientCnxn( String chrootPath, HostProvider hostProvider, int sessionTimeout, ZKClientConfig clientConfig, Watcher defaultWatcher, ClientCnxnSocket clientCnxnSocket, boolean canBeReadOnly ) throws IOException { this( chrootPath, hostProvider, sessionTimeout, clientConfig, defaultWatcher, clientCnxnSocket, 0, new byte[16], canBeReadOnly); }
Source:
private String getColumnContent(Card c, String key){ switch (key){ case "lapses": return Integer.toString(c.getLapses()); case "note": return c.model().optString("name"); case "question": return formatQA(c.q()); case "reviews": return Integer.toString(c.getReps()); case "answer": Map<String, String> qa = c._getQA(true, true); String q = qa.get("q"); String a = qa.get("a"); if (a.startsWith(q)) { a = a.replaceFirst(Pattern.quote(q), ""); } return formatQA(c.a()); case "tags": return c.note().stringTags(); case "sfld": return c.note().getSFld(); case "deck": try { return getCol().getDecks().get(c.getDid()).getString("name"); } catch (JSONException e) { throw new RuntimeException(e); } case "flags": return new Integer(c.getUserFlag()).toString(); case "id": return new Long(c.getId()).toString(); case "interval": int type = c.getType(); if (type == 0) { return getBaseContext().getString(R.string.card_browser_interval_new_card); } else if (type == 1) { return getBaseContext().getString(R.string.card_browser_interval_learning_card); } else { return Utils.timeSpan(getBaseContext(), c.getIvl()*86400); } case "card": return c.template().optString("name"); default: return ""; } }

Target:
private String getColumnContent(Card c, String key){ c.loadIfRequired(); switch (key){ case "lapses": return Integer.toString(c.getLapses()); case "note": return c.model().optString("name"); case "question": return formatQA(c.q()); case "reviews": return Integer.toString(c.getReps()); case "answer": { Map<String, String> qa = c._getQA(true, true); String q = qa.get("q"); String a = qa.get("a"); if (a.startsWith(q)) { a = a.replaceFirst(Pattern.quote(q), ""); } return formatQA(c.a()); } case "tags": return c.note().stringTags(); case "sfld": return c.note().getSFld(); case "deck": try { return getCol().getDecks().get(c.getDid()).getString("name"); } catch (JSONException e) { throw new RuntimeException(e); } case "flags": return new Integer(c.getUserFlag()).toString(); case "id": return new Long(c.getId()).toString(); case "interval": { int type = c.getType(); if (type == 0) { return getBaseContext().getString(R.string.card_browser_interval_new_card); } else if (type == 1) { return getBaseContext().getString(R.string.card_browser_interval_learning_card); } else { return Utils.timeSpan(getBaseContext(), c.getIvl()*86400); } } case "card": return c.template().optString("name"); default: return ""; } }
Source:
private RunResult invokeAllTests(TestsToRun testsToRun) { RunResult runResult; ReporterFactory reporterFactory = parameters.getReporterFactory(); try { RunListener runListener = reporterFactory.createReporter(); ConsoleOutputCapture.startCapture((ConsoleOutputReceiver) runListener); launcher.registerTestExecutionListeners(new RunListenerAdapter(runListener)); for (Class<?> testClass : testsToRun) { invokeSingleClass(testClass, runListener); } } finally { runResult = reporterFactory.close(); } return runResult; }

Target:
private RunResult invokeAllTests(TestsToRun testsToRun) { RunResult runResult; ReporterFactory reporterFactory = parameters.getReporterFactory(); try { RunListener runListener = reporterFactory.createReporter(); ConsoleOutputCapture.startCapture((ConsoleOutputReceiver) runListener); for (Class<?> testClass : testsToRun) { invokeSingleClass(testClass, runListener); } } finally { runResult = reporterFactory.close(); } return runResult; }
Source:
public static void main(String[] args) throws Exception { try { SpringApplication.run(ModuleLauncherApplication.class, args); } catch (Exception e) { log.error("Couldn't launch module: ", e); } }

Target:
public static void main(String[] args) throws Exception { try { SpringApplication.run(ModuleLauncherApplication.class, args); } catch (Exception e) { log.error("Failed to launch module ", e); } }
Source:
public void onDebugLogToggle() { Level logLevel = Level.DEBUG; final LoggerContext loggerContext = ((Logger) LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())).getLoggerContext(); loggerContext.getLoggerList() .stream() .filter(logger -> logger.getName().startsWith("com.faforever")) .forEach(logger -> ((Logger) LoggerFactory.getLogger(logger.getName())).setLevel(logLevel)); log.info("Switching FA Forever logging configuration to {}", logLevel.levelStr); }

Target:
public void onDebugLogToggle() { preferencesService.startDebugLogging(); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VmGuestAgentInterface other = (VmGuestAgentInterface) obj; if (getInterfaceName() == null) { if (other.getInterfaceName() != null) { return false; } } else if (!getInterfaceName().equals(other.getInterfaceName())) { return false; } if (getIpv4Addresses() == null) { if (other.getIpv4Addresses() != null) { return false; } } else if (!getIpv4Addresses().equals(other.getIpv4Addresses())) { return false; } if (getIpv6Addresses() == null) { if (other.getIpv6Addresses() != null) { return false; } } else if (!getIpv6Addresses().equals(other.getIpv6Addresses())) { return false; } if (getMacAddress() == null) { if (other.getMacAddress() != null) { return false; } } else if (!getMacAddress().equals(other.getMacAddress())) { return false; } if (getVmId() == null) { if (other.getVmId() != null) { return false; } } else if (!getVmId().equals(other.getVmId())) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof VmGuestAgentInterface)) { return false; } VmGuestAgentInterface other = (VmGuestAgentInterface) obj; if (getInterfaceName() == null) { if (other.getInterfaceName() != null) { return false; } } else if (!getInterfaceName().equals(other.getInterfaceName())) { return false; } if (getIpv4Addresses() == null) { if (other.getIpv4Addresses() != null) { return false; } } else if (!getIpv4Addresses().equals(other.getIpv4Addresses())) { return false; } if (getIpv6Addresses() == null) { if (other.getIpv6Addresses() != null) { return false; } } else if (!getIpv6Addresses().equals(other.getIpv6Addresses())) { return false; } if (getMacAddress() == null) { if (other.getMacAddress() != null) { return false; } } else if (!getMacAddress().equals(other.getMacAddress())) { return false; } if (getVmId() == null) { if (other.getVmId() != null) { return false; } } else if (!getVmId().equals(other.getVmId())) { return false; } return true; }
Source:
public void setLicenses(LicenseConfiguration[] licenses) { this.licenses = licenses; }

Target:
public void setLicenses(LicenseConfiguration[] licenses) throws IOException { if (!ArrayUtils.isEmpty(licenses)) { if (licenses.length > 1) { throw new IOException("PyPi doesn't support multiple licenses!"); } } this.licenses = licenses; }
Source:
public void delete() throws IOException { File rootDir = getRootDir(); if (!rootDir.isDirectory()) { LOGGER.warning(String.format( "%s: %s looks to have already been deleted, assuming build dir was already cleaned up", this, rootDir )); RunListener.fireDeleted(this); synchronized (this) { removeRunFromParent(); } return; } RunListener.fireDeleted(this); if (artifactManager != null) { deleteArtifacts(); } synchronized (this) { File tmp = new File(rootDir.getParentFile(),'.'+rootDir.getName()); if (tmp.exists()) { Util.deleteRecursive(tmp); } boolean renamingSucceeded = true; try { Path path = Files.move(rootDir.toPath(), tmp.toPath(), StandardCopyOption.ATOMIC_MOVE); } catch (UnsupportedOperationException | IOException | SecurityException ex) { renamingSucceeded = rootDir.renameTo(tmp); } Util.deleteRecursive(tmp); if (tmp.exists()) { tmp.deleteOnExit(); } if (!renamingSucceeded) { throw new IOException(rootDir + " is in use"); } LOGGER.log(FINE, "{0}: {1} successfully deleted", new Object[] {this, rootDir}); removeRunFromParent(); } }

Target:
public void delete() throws IOException { File rootDir = getRootDir(); if (!rootDir.isDirectory()) { LOGGER.warning(String.format( "%s: %s looks to have already been deleted, assuming build dir was already cleaned up", this, rootDir )); RunListener.fireDeleted(this); synchronized (this) { removeRunFromParent(); } return; } RunListener.fireDeleted(this); if (artifactManager != null) { deleteArtifacts(); } synchronized (this) { File tmp = new File(rootDir.getParentFile(),'.'+rootDir.getName()); if (tmp.exists()) { Util.deleteRecursive(tmp); } try { Files.move( Util.fileToPath(rootDir), Util.fileToPath(tmp), StandardCopyOption.ATOMIC_MOVE ); } catch (UnsupportedOperationException | SecurityException ex) { throw new IOException(rootDir + " is in use"); } Util.deleteRecursive(tmp); if (tmp.exists()) { tmp.deleteOnExit(); } LOGGER.log(FINE, "{0}: {1} successfully deleted", new Object[] {this, rootDir}); removeRunFromParent(); } }
Source:
public List<RepositoryVO> getRepositoryVOList(Database db) throws ConstraintException, SystemException, Bug { String key = "repositoryVOList"; logger.info("key:" + key); List<RepositoryVO> cachedRepositoryVOList = (List<RepositoryVO>)CacheController.getCachedObject("repositoryCache", key); if(cachedRepositoryVOList != null) { logger.info("There was an cached repo list:" + cachedRepositoryVOList.size()); return cachedRepositoryVOList; } List<RepositoryVO> repositoryVOList = new ArrayList<RepositoryVO>(); String SQL = "SELECT r.repositoryId, r.name, r.description, r.dnsName, r.isDeleted from cmRepository r order by r.repositoryId"; logger.info("SQL:" + SQL); try { Connection conn = (Connection) db.getJdbcConnection(); PreparedStatement psmt = conn.prepareStatement(SQL.toString()); ResultSet rs = psmt.executeQuery(); while(rs.next()) { RepositoryVO repoVO = new RepositoryVO(); repoVO.setRepositoryId(new Integer(rs.getString(1))); repoVO.setName(rs.getString(2)); repoVO.setDescription(rs.getString(3)); repoVO.setDnsName(rs.getString(4)); repoVO.setIsDeleted(rs.getBoolean(5)); logger.info("Found:" + repoVO); repositoryVOList.add(repoVO); } rs.close(); psmt.close(); } catch(Exception e) { logger.error("Problem getting repo list: " + e.getMessage(), e); } CacheController.cacheObject("repositoryCache", key, repositoryVOList); return repositoryVOList; }

Target:
public List<RepositoryVO> getRepositoryVOList(Database db) throws ConstraintException, SystemException, Bug { String key = "repositoryVOList"; logger.info("key:" + key); List<RepositoryVO> cachedRepositoryVOList = (List<RepositoryVO>)CacheController.getCachedObject("repositoryCache", key); if(cachedRepositoryVOList != null) { logger.info("There was an cached repo list:" + cachedRepositoryVOList.size()); return cachedRepositoryVOList; } List<RepositoryVO> repositoryVOList = new ArrayList<RepositoryVO>(); String SQL = "SELECT r.repositoryId, r.name, r.description, r.dnsName, r.isDeleted from cmRepository r order by r.repositoryId"; logger.info("SQL:" + SQL); PreparedStatement psmt = null; ResultSet rs = null; try { Connection conn = (Connection) db.getJdbcConnection(); psmt = conn.prepareStatement(SQL.toString()); rs = psmt.executeQuery(); while(rs.next()) { RepositoryVO repoVO = new RepositoryVO(); repoVO.setRepositoryId(new Integer(rs.getString(1))); repoVO.setName(rs.getString(2)); repoVO.setDescription(rs.getString(3)); repoVO.setDnsName(rs.getString(4)); repoVO.setIsDeleted(rs.getBoolean(5)); logger.info("Found:" + repoVO); repositoryVOList.add(repoVO); } CacheController.cacheObject("repositoryCache", key, repositoryVOList); } catch(Exception e) { logger.error("Problem getting repo list: " + e.getMessage(), e); } finally { try { rs.close(); psmt.close(); } catch(Exception e) { logger.error("Problem getting repo list: " + e.getMessage(), e); } } return repositoryVOList; }
Source:
public synchronized List<LookupBean> pullExistingSnapshot() { List<LookupBean> lookupBeanList; try { if (!persistFile.isFile()) { LOGGER.warn("could not find any snapshot file under working directory [%s]", persistDirectory); return Collections.emptyList(); } else if( persistFile.length() == 0){ LOGGER.warn("found empty file no lookups to load from [%s]", persistFile.getAbsolutePath()); return Collections.emptyList(); } lookupBeanList = objectMapper.reader(new TypeReference<List<LookupBean>>() { }).readValue(persistFile); return lookupBeanList; } catch (IOException e) { throw new ISE(e, "Exception during reading lookups from [%s]", persistFile.getAbsolutePath()); } }

Target:
public synchronized List<LookupBean> pullExistingSnapshot() { List<LookupBean> lookupBeanList; try { if (!persistFile.isFile()) { LOGGER.warn("could not find any snapshot file under working directory [%s]", persistDirectory); return Collections.emptyList(); } else if( persistFile.length() == 0){ LOGGER.warn("found empty file no lookups to load from [%s]", persistFile.getAbsolutePath()); return Collections.emptyList(); } lookupBeanList = objectMapper.readValue(persistFile, new TypeReference<List<LookupBean>>(){}); return lookupBeanList; } catch (IOException e) { throw new ISE(e, "Exception during reading lookups from [%s]", persistFile.getAbsolutePath()); } }
Source:
public NewExternalSubnetModel(NetworkView network, SearchableListModel sourceModel) { this.sourceModel = sourceModel; setName(new EntityModel<String>()); setCidr(new EntityModel<String>()); setNetwork(new ListModel<NetworkView>()); setIpVersion(new ListModel<IpVersion>()); getIpVersion().setItems(AsyncDataProvider.getExternalSubnetIpVerionList()); getNetwork().setItems(Arrays.asList(network)); getNetwork().setSelectedItem(network); getNetwork().setIsChangable(false); setHashName("new_external_subnet"); initCommands(); }

Target:
public NewExternalSubnetModel(NetworkView network, SearchableListModel sourceModel) { this.sourceModel = sourceModel; setName(new EntityModel<String>()); setCidr(new EntityModel<String>()); setNetwork(new ListModel<NetworkView>()); setIpVersion(new ListModel<IpVersion>()); getIpVersion().setItems(AsyncDataProvider.getExternalSubnetIpVerionList()); getNetwork().setEntity(network); setTitle(ConstantsManager.getInstance().getConstants().newExternalSubnetTitle()); setHashName("new_external_subnet"); initCommands(); }
Source:
public void loadKeyOpenSSH() throws IOException, GeneralSecurityException { File file = new File(this.getClass().getResource("openssh").getFile()); assertkeyPair(file, null); }

Target:
public void loadKeyOpenSSH() throws IOException, GeneralSecurityException { File file = new File(this.getClass().getResource("openssh").getFile()); assertKeyPairNotNull(file, null); }
Source:
private void testUiConsistencyForNewQuestion() { ______TS("CONSTSUM-option after CONSTSUM-recipient: Check ui consistency success case"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONSTSUM_RECIPIENT"); feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); feedbackEditPage.waitForConfirmationModalAndClickOk(); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONSTSUM_OPTION"); assertTrue(feedbackEditPage.isElementVisible(By.id("constSumPoints--1"))); assertTrue(feedbackEditPage.isElementVisible(By.id("constSumPointsForEachOption--1"))); assertFalse(feedbackEditPage.isElementVisible(By.id("constSumOption_Recipient--1"))); feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); feedbackEditPage.waitForConfirmationModalAndClickOk(); }

Target:
private void testUiConsistencyForNewQuestion() { ______TS("CONSTSUM-option after CONSTSUM-recipient: Check ui consistency success case"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONSTSUM_RECIPIENT"); feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); feedbackEditPage.waitForConfirmationModalAndClickOk(); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONSTSUM_OPTION"); assertTrue(feedbackEditPage.isElementVisible(By.id("constSumPointsTotal--1"))); assertTrue(feedbackEditPage.isElementVisible(By.id("constSumOption_Option--1"))); assertFalse(feedbackEditPage.isElementVisible(By.id("constSumOption_Recipient--1"))); feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); feedbackEditPage.waitForConfirmationModalAndClickOk(); }
Source:
protected boolean hasChanges() { return hasChanges; }

Target:
public boolean hasChanges() { return hasChanges; }
Source:
public long length() { return length; }

Target:
@Override public long length() { return length; }