auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public OffheapIncrementalIndex( long minTimestamp, QueryGranularity gran, final AggregatorFactory[] metrics, boolean deserializeComplexMetrics, boolean reportParseExceptions, boolean sortFacts, int maxRowCount, StupidPool<ByteBuffer> bufferPool ) { this( new IncrementalIndexSchema.Builder().withMinTimestamp(minTimestamp) .withQueryGranularity(gran) .withMetrics(metrics) .withRollup(true) .build(), deserializeComplexMetrics, reportParseExceptions, sortFacts, maxRowCount, bufferPool ); }

Target:
public OffheapIncrementalIndex( long minTimestamp, QueryGranularity gran, final AggregatorFactory[] metrics, boolean deserializeComplexMetrics, boolean reportParseExceptions, boolean sortFacts, int maxRowCount, StupidPool<ByteBuffer> bufferPool ) { this( new IncrementalIndexSchema.Builder().withMinTimestamp(minTimestamp) .withQueryGranularity(gran) .withMetrics(metrics) .withRollup(IncrementalIndexSchema.DEFAULT_ROLLUP) .build(), deserializeComplexMetrics, reportParseExceptions, sortFacts, maxRowCount, bufferPool ); }
Source:
public void addComboActionButton(ActionButtonDefinition<T> buttonDef, List<ActionButtonDefinition<T>> subActions) { ActionButton newButton = getView().addDropdownComboActionButton(buttonDef, subActions, this); actionButtonDefinitions.add(buttonDef); for (ActionButtonDefinition ab : subActions) { actionButtonDefinitions.add(ab); } initButton(buttonDef, newButton); }

Target:
public void addComboActionButton(ActionButtonDefinition<T> buttonDef, List<ActionButtonDefinition<T>> subActions) { ActionButton newButton = getView().addDropdownComboActionButton(buttonDef, subActions, this); actionButtonDefinitions.add(buttonDef); initButton(buttonDef, newButton); }
Source:
private void initializeRow() { LayoutParams params = new LayoutParams(0, LayoutParams.MATCH_PARENT, 1.0f); params.leftMargin = params.topMargin = params.rightMargin = params.bottomMargin = getResources() .getDimensionPixelSize(R.dimen.pocketmusic_trackrow_margin); int noteColor; if (isBlackRow) { noteColor = ContextCompat.getColor(getContext(), R.color.light_grey); } else { noteColor = ContextCompat.getColor(getContext(), R.color.white); } for (int i = 0; i < QUARTER_COUNT; i++) { List<GridRowPosition> gridRowPositions = new ArrayList<>(); if (gridRow != null) { gridRowPositions = gridRow.getGridRowPositions().get(0); } noteViews.add(new NoteView(getContext(), noteColor, gridRowPositions, i)); addView(noteViews.get(i), params); } }

Target:
private void initializeRow() { LayoutParams params = new LayoutParams(0, LayoutParams.MATCH_PARENT, 1.0f); params.leftMargin = params.topMargin = params.rightMargin = params.bottomMargin = getResources() .getDimensionPixelSize(R.dimen.pocketmusic_trackrow_margin); int noteColor; if (isBlackRow) { noteColor = ContextCompat.getColor(getContext(), R.color.light_grey); } else { noteColor = ContextCompat.getColor(getContext(), R.color.white); } for (int i = 0; i < QUARTER_COUNT; i++) { List<GridRowPosition> gridRowPositions = new ArrayList<>(); if (gridRow != null) { gridRowPositions = getFirstGridRowPositionsList(); } noteViews.add(new NoteView(getContext(), noteColor, gridRowPositions, i)); addView(noteViews.get(i), params); } }
Source:
public void MercuryCuratedNavigationTest_004_navigateThroughDifferentUrl() { String testUrl; String expectedUrl; CuratedContentPageObject section = new CuratedContentPageObject(driver); expectedUrl = urlBuilder.getUrlForPathWithoutWiki(Configuration.getWikiName(), MercurySubpages.CC_CATEGORY_TEMPLATES); testUrl = expectedUrl; section.openWikiPage(testUrl); Assertion.assertUrlEqualToCurrentUrl(driver, expectedUrl); expectedUrl = urlBuilder.getUrlForPathWithoutWiki(Configuration.getWikiName(), MercurySubpages.CC_SECTION_CATEGORIES); testUrl = expectedUrl; section.openWikiPage(testUrl); Assertion.assertUrlEqualToCurrentUrl(driver, expectedUrl); expectedUrl = urlBuilder.getUrlForPath(Configuration.getWikiName(), MercurySubpages.CC_MAIN_PAGE); testUrl = urlBuilder.getUrlForPathWithoutWiki(Configuration.getWikiName(), MercurySubpages.CC_EMPTY_CATEGORY); section.openWikiPage(testUrl); Assertion.assertUrlEqualToCurrentUrl(driver, expectedUrl); expectedUrl = urlBuilder.getUrlForPath(Configuration.getWikiName(), MercurySubpages.CC_MAIN_PAGE); testUrl = urlBuilder.getUrlForPathWithoutWiki(Configuration.getWikiName(), MercurySubpages.CC_NOT_EXISTING_SECTION); section.openWikiPage(testUrl); section.isAlertNotificationVisible(); Assertion.assertUrlEqualToCurrentUrl(driver, expectedUrl); }

Target:
public void MercuryCuratedNavigationTest_004_navigateThroughDifferentUrl() { CuratedContentPageObject section = new CuratedContentPageObject(driver); String expectedUrl = urlBuilder.getUrlForPathWithoutWiki(Configuration.getWikiName(), MercurySubpages.CC_CATEGORY_TEMPLATES); String testUrl = expectedUrl; section.openWikiPage(testUrl); section.waitForLoadingSpinnerToFinish(); Assertion.assertUrlEqualToCurrentUrl(driver, expectedUrl); expectedUrl = urlBuilder.getUrlForPathWithoutWiki(Configuration.getWikiName(), MercurySubpages.CC_SECTION_CATEGORIES); testUrl = expectedUrl; section.openWikiPage(testUrl); section.waitForLoadingSpinnerToFinish(); Assertion.assertUrlEqualToCurrentUrl(driver, expectedUrl); expectedUrl = urlBuilder.getUrlForPath(Configuration.getWikiName(), MercurySubpages.CC_MAIN_PAGE); testUrl = urlBuilder.getUrlForPathWithoutWiki(Configuration.getWikiName(), MercurySubpages.CC_EMPTY_CATEGORY); section.openWikiPage(testUrl); section.waitForLoadingSpinnerToFinish(); Assertion.assertUrlEqualToCurrentUrl(driver, expectedUrl); expectedUrl = urlBuilder.getUrlForPath(Configuration.getWikiName(), MercurySubpages.CC_MAIN_PAGE); testUrl = urlBuilder.getUrlForPathWithoutWiki(Configuration.getWikiName(), MercurySubpages.CC_NOT_EXISTING_SECTION); section.openWikiPage(testUrl); section.waitForLoadingSpinnerToFinish(); section.isAlertNotificationVisible(); Assertion.assertUrlEqualToCurrentUrl(driver, expectedUrl); }
Source:
private void checkAttributesDependencies(PerunSession sess, Member member, Group group, List<Attribute> attributes, boolean workWithUserAttributes) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { if(workWithUserAttributes) { User user = getPerunBl().getUsersManagerBl().getUserByMember(sess, member); List<Attribute> userAttributes = new ArrayList<Attribute>(); List<Attribute> memberAttributes = new ArrayList<Attribute>(); List<Attribute> memberGroupAttributes = new ArrayList<Attribute>(); for(Attribute attr: attributes) { if(getAttributesManagerImpl().isFromNamespace(sess, attr, NS_USER_ATTR)) { userAttributes.add(attr); } else if(getAttributesManagerImpl().isFromNamespace(sess, attr, NS_MEMBER_ATTR)) { memberAttributes.add(attr); } else if(getAttributesManagerImpl().isFromNamespace(sess, attr, NS_MEMBER_GROUP_ATTR)) { memberGroupAttributes.add(attr); } else { throw new WrongAttributeAssignmentException(attr); } } checkAttributesDependencies(sess, member, null, memberAttributes); checkAttributesDependencies(sess, user, null, userAttributes); checkAttributesDependencies(sess, group, member, memberGroupAttributes); } else { checkAttributesDependencies(sess, member, group, attributes); } }

Target:
private void checkAttributesDependencies(PerunSession sess, Member member, Group group, List<Attribute> attributes, boolean workWithUserAttributes) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { if(workWithUserAttributes) { User user = getPerunBl().getUsersManagerBl().getUserByMember(sess, member); List<Attribute> userAttributes = new ArrayList<Attribute>(); List<Attribute> memberAttributes = new ArrayList<Attribute>(); List<Attribute> memberGroupAttributes = new ArrayList<Attribute>(); for(Attribute attr: attributes) { if(getAttributesManagerImpl().isFromNamespace(sess, attr, NS_USER_ATTR)) { userAttributes.add(attr); } else if(getAttributesManagerImpl().isFromNamespace(sess, attr, NS_MEMBER_ATTR)) { memberAttributes.add(attr); } else if(getAttributesManagerImpl().isFromNamespace(sess, attr, NS_MEMBER_GROUP_ATTR)) { memberGroupAttributes.add(attr); } else { throw new WrongAttributeAssignmentException(attr); } } checkAttributesDependencies(sess, member, null, memberAttributes); checkAttributesDependencies(sess, user, null, userAttributes); checkAttributesDependencies(sess, member, group, memberGroupAttributes); } else { checkAttributesDependencies(sess, member, group, attributes); } }
Source:
protected void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { super.handleNode(node, element, uri, localName, parser); DynamicNode stageNode = (DynamicNode) node; stageNode.setAutoComplete(false); stageNode.setLanguage("rule"); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, PlanItem> planItems = (Map<String, PlanItem>) buildData.getMetaData("PlanItems"); PlanItem stagePlanItem = planItems.get(stageNode.getMetaData("UniqueId")); if (stagePlanItem != null && stagePlanItem.getEntryCriterion() != null) { if(AUTOCOMPLETE_EXPRESSIONS.contains(stagePlanItem.getEntryCriterion().getExpression())) { stageNode.setAutoComplete(true); } else { stageNode.setActivationExpression(stagePlanItem.getEntryCriterion().getExpression()); } } if (stagePlanItem != null && stagePlanItem.getExitCriterion() != null) { stageNode.setCompletionExpression(stagePlanItem.getExitCriterion().getExpression()); } }

Target:
protected void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { super.handleNode(node, element, uri, localName, parser); DynamicNode stageNode = (DynamicNode) node; stageNode.setAutoComplete(false); stageNode.setLanguage("rule"); ProcessBuildData buildData = (ProcessBuildData) parser.getData(); Map<String, PlanItem> planItems = (Map<String, PlanItem>) buildData.getMetaData("PlanItems"); PlanItem stagePlanItem = planItems.get(stageNode.getMetaData("UniqueId")); if (stagePlanItem != null && stagePlanItem.getEntryCriterion() != null) { if ("autostart".equalsIgnoreCase(stagePlanItem.getEntryCriterion().getExpression())) { stageNode.setMetaData("customAutoStart", "true"); } else { stageNode.setActivationExpression(stagePlanItem.getEntryCriterion().getExpression()); } } if (stagePlanItem != null && stagePlanItem.getExitCriterion() != null) { if (AUTOCOMPLETE_EXPRESSIONS.contains(stagePlanItem.getExitCriterion().getExpression())) { stageNode.setAutoComplete(true); } else { stageNode.setCompletionExpression(stagePlanItem.getExitCriterion().getExpression()); } } }
Source:
private boolean isInTimeRange(ITmfTimestamp traceStartTime, ITmfTimestamp traceEndTime) { if (traceStartTime.compareTo(fEndTimeRange) <= 0 && traceEndTime.compareTo(fStartTimeRange) >= 0) { return true; } return false; }

Target:
private boolean isInTimeRange(ITmfTimestamp traceStartTime, ITmfTimestamp traceEndTime) { return traceStartTime.compareTo(fEndTimeRange) <= 0 && traceEndTime.compareTo(fStartTimeRange) >= 0; }
Source:
public IgniteZeroMqStreamer(int ioThreads, ZeroMqTypeSocket socketType, @NotNull String addr, byte[] topic) { A.ensure(ioThreads > 0, "Param ioThreads has been more than 0."); A.ensure(!"".equals(addr), "Param addr has been not empty."); this.ioThreads = ioThreads; this.addr = addr; this.topic = topic; if (ZeroMqTypeSocket.check(socketType)) this.socketType = socketType.getType(); else throw new IgniteException("This socket type not implementation this version ZeroMQ streamer."); }

Target:
public IgniteZeroMqStreamer(int ioThreads, ZeroMqTypeSocket socketType, @NotNull String addr, byte[] topic) { A.ensure(ioThreads > 0, "ioThreads has to larger than 0."); A.ensure(!"".equals(addr), "addr cannot be empty."); A.ensure(socketType != null, "socketType is not null."); this.ioThreads = ioThreads; this.addr = addr; this.topic = topic; this.socketType = socketType.getType(); }
Source:
public String[] getValueNames() { Collection<String> result = getAttributeNames0(); return getAttributeNames0().toArray(new String[result.size()]); }

Target:
public String[] getValueNames() { Collection<String> result = getAttributeNames0(); return result.toArray(new String[result.size()]); }
Source:
public int getWeight(EStructuralFeature feature) { if (irrelevant(feature)) { return 0; } Integer found = weights.get(feature); if (found == null) { found = Integer.valueOf(SMALL); if (feature == EcorePackage.Literals.ENAMED_ELEMENT__NAME) { found = Integer.valueOf(SIGNIFICANT); } if (feature instanceof EReference && ((EReference)feature).isContainment()) { found = Integer.valueOf(NORMAL); } if (feature instanceof EReference) { found = Integer.valueOf(referenceChangeCoef * found.intValue()); } else { found = Integer.valueOf(attributeChangeCoef * found.intValue()); } weights.put(feature, found); } return found.intValue(); }

Target:
public int getWeight(EStructuralFeature feature) { if (irrelevant(feature)) { return 0; } Integer found = weights.get(feature); if (found == null) { found = Integer.valueOf(SMALL); if (feature == EcorePackage.Literals.ENAMED_ELEMENT__NAME) { found = Integer.valueOf(SIGNIFICANT); } if (feature instanceof EReference) { found = Integer.valueOf(referenceChangeCoef * found.intValue()); } else { found = Integer.valueOf(attributeChangeCoef * found.intValue()); } weights.put(feature, found); } return found.intValue(); }
Source:
public static void automaticIP() throws ClassNotFoundException, SQLException, UnknownHostException{ Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://mysql.cs.iastate.edu/db30901", "adm309", "EXbDqudt4"); Statement stmt = con.createStatement(); String iP =InetAddress.getLocalHost().getHostAddress(); stmt.executeUpdate("UPDATE testTable SET IP_Computer='" + iP + "' WHERE phoneNumber='" + lastLoggedIn() + "';"); }

Target:
public static void automaticIP(){ try { Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://mysql.cs.iastate.edu/db30901", "adm309", "EXbDqudt4"); Statement stmt = con.createStatement(); String iP =InetAddress.getLocalHost().getHostAddress(); stmt.executeUpdate("UPDATE testTable SET IP_Computer='" + iP + "' WHERE phoneNumber='" + lastLoggedIn() + "';"); } catch (Exception e) { System.out.println("Automatic login fail\n" + e.getMessage()); } }
Source:
public String getNodesInfo() { try { Response response = lowLevelClient.performRequest("GET", "/" + "_nodes/_all"); return EntityUtils.toString(response.getEntity()); } catch (IOException e) { throw new NuxeoException(e); } }

Target:
public String getNodesInfo() { try { Response response = lowLevelClient.performRequest("GET", "/_nodes/_all"); return EntityUtils.toString(response.getEntity()); } catch (IOException e) { throw new NuxeoException(e); } }
Source:
public void testRowTimestampDefault() throws Exception { String tableName = generateUniqueName(); try (Connection conn = DriverManager.getConnection(getUrl())) { String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + " (PK INTEGER NOT NULL PRIMARY KEY, KV1 VARCHAR, KV2 VARCHAR)" + this.tableDDLOptions; conn.createStatement().execute(ddl); String dml = "UPSERT INTO " + tableName + " (PK, KV1, KV2) VALUES (?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement(dml); int count = 5; for (int id = 0; id < count; ++id) { stmt.setInt(1, id); stmt.setString(2, "KV1_" + id); stmt.setString(3, "KV2_" + id); stmt.executeUpdate(); } conn.commit(); String dql = "SELECT PHOENIX_ROW_TIMESTAMP() FROM " + tableName; ResultSet rs = conn.createStatement().executeQuery(dql); verifyHbaseAllRowsTimestamp(tableName, rs, count); conn.createStatement().execute("UPSERT INTO " + tableName + " (PK, KV1) VALUES (2, 'KV1_foo')"); conn.commit(); rs = conn.createStatement().executeQuery(dql); verifyHbaseAllRowsTimestamp(tableName, rs, count); dql = "SELECT ROWKEY_BYTES_STRING(), PHOENIX_ROW_TIMESTAMP() FROM " + tableName + " WHERE PK >= 1 AND PK <=3 "; rs = conn.createStatement().executeQuery(dql); while (rs.next()) { verifyHbaseRowTimestamp(tableName, rs.getString(1), rs.getDate(2)); } } }

Target:
public void testRowTimestampDefault() throws Exception { String tableName = generateUniqueName(); try (Connection conn = DriverManager.getConnection(getUrl())) { String ddl = "CREATE TABLE IF NOT EXISTS " + tableName + " (PK INTEGER NOT NULL PRIMARY KEY, KV1 VARCHAR, KV2 VARCHAR)" + this.tableDDLOptions; conn.createStatement().execute(ddl); String dml = "UPSERT INTO " + tableName + " (PK, KV1, KV2) VALUES (?, ?, ?)"; try (PreparedStatement stmt = conn.prepareStatement(dml)) { int count = NUM_ROWS; for (int id = 0; id < count; ++id) { stmt.setInt(1, id); stmt.setString(2, "KV1_" + id); stmt.setString(3, "KV2_" + id); stmt.executeUpdate(); } } finally { conn.commit(); } String dql = "SELECT PHOENIX_ROW_TIMESTAMP() FROM " + tableName; try (Statement stmt = conn.createStatement()) { ResultSet rs = stmt.executeQuery(dql); verifyHbaseAllRowsTimestamp(tableName, rs, NUM_ROWS); } try (Statement stmt = conn.createStatement()) { stmt.execute("UPSERT INTO " + tableName + " (PK, KV1) VALUES (2, 'KV1_foo')"); } finally { conn.commit(); } try (Statement stmt = conn.createStatement()) { ResultSet rs = stmt.executeQuery(dql); verifyHbaseAllRowsTimestamp(tableName, rs, NUM_ROWS); } dql = "SELECT ROWKEY_BYTES_STRING(), PHOENIX_ROW_TIMESTAMP() FROM " + tableName + " WHERE PK >= 1 AND PK <=3 "; try (Statement stmt = conn.createStatement()) { ResultSet rs = stmt.executeQuery(dql); while (rs.next()) { verifyHbaseRowTimestamp(tableName, rs.getString(1), rs.getDate(2)); } } } }
Source:
public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { String selector[] = StringUtils.split(StringUtils.trim(bindingConfig), ':'); try { PowerMaxSelectorType.fromString(selector[0]); } catch (IllegalArgumentException e) { throw new BindingConfigParseException("item '" + item.getName() + "': invalid selector " + bindingConfig); } }

Target:
public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { }
Source:
public void startService() { super.startService(); arduino = (Arduino) Runtime.start("arduino", "Arduino"); adaFruit16cLeft = (Adafruit16CServoDriver) Runtime.start("I2cServoControlLeft", "Adafruit16CServoDriver"); adaFruit16cRight = (Adafruit16CServoDriver) Runtime.start("I2cServoControlRight", "Adafruit16CServoDriver"); chatBot = (ProgramAB) Runtime.start("chatBot", "ProgramAB"); htmlFilter = (HtmlFilter) Runtime.start("htmlFilter", "HtmlFilter"); mouth = (AbstractSpeechSynthesis) Runtime.start("mouth", "MarySpeech"); ear = (WebkitSpeechRecognition) Runtime.start("ear", "WebkitSpeechRecognition"); webgui = (WebGui) Runtime.start("webgui", "WebGui"); pir = (Pir) Runtime.start("pir", "Pir"); pir.attach(arduino, pirSensorPin); subscribe(mouth.getName(), "publishStartSpeaking"); subscribe(mouth.getName(), "publishEndSpeaking"); }

Target:
public void startService() { super.startService(); arduino = (Arduino) Runtime.start("arduino", "Arduino"); adaFruit16cLeft = (Adafruit16CServoDriver) Runtime.start("I2cServoControlLeft", "Adafruit16CServoDriver"); adaFruit16cRight = (Adafruit16CServoDriver) Runtime.start("I2cServoControlRight", "Adafruit16CServoDriver"); chatBot = (ProgramAB) Runtime.start("chatBot", "ProgramAB"); htmlFilter = (HtmlFilter) Runtime.start("htmlFilter", "HtmlFilter"); mouth = (SpeechSynthesis) Runtime.start("mouth", "MarySpeech"); ear = (WebkitSpeechRecognition) Runtime.start("ear", "WebkitSpeechRecognition"); webgui = (WebGui) Runtime.start("webgui", "WebGui"); pir = (Pir) Runtime.start("pir", "Pir"); pir.attach(arduino, pirSensorPin); subscribe(mouth.getName(), "publishStartSpeaking"); subscribe(mouth.getName(), "publishEndSpeaking"); }
Source:
public void updateSendTime(long value) { requestOrResponseSendTime.update(value); if (requestOrResponseSendTimeBySize != null) { requestOrResponseSendTimeBySize.update(value); } timeSpentTillNow += value; requestOrResponseTotalTime.update(timeSpentTillNow); if (requestOrResponseTotalTimeBySize != null) { requestOrResponseTotalTimeBySize.update(timeSpentTillNow); } }

Target:
public void updateSendTime(long value) { sendTime.update(value); }
Source:
@Override public void onMessageReceived(GridNioSession ses, Object msg) throws IgniteCheckedException { ByteBuffer input = checkMessage(ses, msg); GridNioSslHandler hnd = sslHandler(ses); GridSslMeta meta = ses.meta(SSL_META.ordinal()); if (meta.sslEngine() == null) meta.sslEngine(hnd.sslEngine()); hnd.lock(); try { hnd.messageReceived(input); if (hnd.isHandshakeFinished()) hnd.flushDeferredWrites(); ByteBuffer appBuf = hnd.getApplicationBuffer(); appBuf.flip(); if (appBuf.hasRemaining()) proceedMessageReceived(ses, appBuf); appBuf.compact(); if (hnd.isInboundDone() && !hnd.isOutboundDone()) { if (log.isDebugEnabled()) log.debug("Remote peer closed secure session (will close connection): " + ses); shutdownSession(ses, hnd); } } catch (SSLException e) { throw new GridNioException("Failed to decode SSL data: " + ses, e); } finally { hnd.unlock(); } }

Target:
@Override public void onMessageReceived(GridNioSession ses, Object msg) throws IgniteCheckedException { ByteBuffer input = checkMessage(ses, msg); GridNioSslHandler hnd = sslHandler(ses); hnd.lock(); try { hnd.messageReceived(input); if (hnd.isHandshakeFinished()) hnd.flushDeferredWrites(); ByteBuffer appBuf = hnd.getApplicationBuffer(); appBuf.flip(); if (appBuf.hasRemaining()) proceedMessageReceived(ses, appBuf); appBuf.compact(); if (hnd.isInboundDone() && !hnd.isOutboundDone()) { if (log.isDebugEnabled()) log.debug("Remote peer closed secure session (will close connection): " + ses); shutdownSession(ses, hnd); } } catch (SSLException e) { throw new GridNioException("Failed to decode SSL data: " + ses, e); } finally { hnd.unlock(); } }
Source:
AmbryPartitionStateModel(String resourceName, String partitionName, PartitionStateChangeListener partitionStateChangeListener) { this.resourceName = resourceName; this.partitionName = partitionName; this.partitionStateChangeListener = partitionStateChangeListener; StateModelParser parser = new StateModelParser(); _currentState = parser.getInitialState(DefaultLeaderStandbyStateModel.class); }

Target:
AmbryPartitionStateModel(String resourceName, String partitionName, PartitionStateChangeListener partitionStateChangeListener) { this.resourceName = resourceName; this.partitionName = partitionName; this.partitionStateChangeListener = Objects.requireNonNull(partitionStateChangeListener); StateModelParser parser = new StateModelParser(); _currentState = parser.getInitialState(DefaultLeaderStandbyStateModel.class); }
Source:
private void logRequest(final HttpServletRequest req, final Session session) { final StringBuilder buf = new StringBuilder(); buf.append(getRealClientIpAddr(req)).append(" "); if (session != null && session.getUser() != null) { buf.append(session.getUser().getUserId()).append(" "); } else { buf.append(" - ").append(" "); } buf.append("\""); buf.append(req.getMethod()).append(" "); buf.append(req.getRequestURI()).append(" "); if (req.getQueryString() != null && allowedPostRequest(req)) { buf.append(req.getQueryString()).append(" "); } else { buf.append("-").append(" "); } buf.append(req.getProtocol()).append("\" "); final String userAgent = req.getHeader("User-Agent"); if (this.shouldLogRawUserAgent) { buf.append(userAgent); } else { if (StringUtils.isFromBrowser(userAgent)) { buf.append("browser"); } else { buf.append("not-browser"); } } logger.info(buf.toString()); }

Target:
private void logRequest(final HttpServletRequest req, final Session session) { final StringBuilder buf = new StringBuilder(); buf.append(getRealClientIpAddr(req)).append(" "); if (session != null && session.getUser() != null) { buf.append(session.getUser().getUserId()).append(" "); } else { buf.append(" - ").append(" "); } buf.append("\""); buf.append(req.getMethod()).append(" "); buf.append(req.getRequestURI()).append(" "); if (req.getQueryString() != null && !isIllegalPostRequest(req)) { buf.append(req.getQueryString()).append(" "); } else { buf.append("-").append(" "); } buf.append(req.getProtocol()).append("\" "); final String userAgent = req.getHeader("User-Agent"); if (this.shouldLogRawUserAgent) { buf.append(userAgent); } else { if (StringUtils.isFromBrowser(userAgent)) { buf.append("browser"); } else { buf.append("not-browser"); } } logger.info(buf.toString()); }
Source:
public InterpreterResult execute(String[] tokens) { Jedis client = borrowClient(); try { return new InterpreterResult(SUCCESS, execute(client, tokens)); } catch (JedisException exception) { return new InterpreterResult(ERROR, exception.getMessage()); } finally { releaseClient(client); } }

Target:
public InterpreterResult execute(String[] tokens) { try (Jedis client = clientPool.getResource()) { try { return new InterpreterResult(SUCCESS, execute(client, tokens)); } catch (JedisException exception) { LOG.error("Couldn't execute redis command {}", tokens[0], exception); return new InterpreterResult(ERROR, exception.getMessage()); } } }
Source:
private IAnimationHandle animate(final com.ait.lienzo.client.core.shape.Shape<?> shape, final ShapeStateAttributes attributes, final long duration) { final AnimationProperties properties = new AnimationProperties(); attributes.consume((attr, value) -> { switch (attr) { case FILL_COLOR: properties.push(FILL_COLOR((String) value)); break; case FILL_ALPHA: properties.push(FILL_ALPHA((double) value)); break; case STROKE_COLOR: properties.push(STROKE_COLOR((String) value)); break; case STROKE_ALPHA: properties.push(STROKE_ALPHA((double) value)); break; case STROKE_WIDTH: properties.push(STROKE_WIDTH((double) value)); break; } }); return shape.animate( AnimationTweener.LINEAR, properties, duration, new AnimationCallback() { @Override public void onClose(IAnimation animation, IAnimationHandle handle) { super.onClose(animation, handle); if (!animationHandle.isRunning()) { setAnimationHandle(null); completeCallback.execute(); } } }); }

Target:
private IAnimationHandle animate(final com.ait.lienzo.client.core.shape.Shape<?> shape, final ShapeStateAttributes attributes, final long duration) { final AnimationProperties properties = new AnimationProperties(); attributes.consume((attr, value) -> { switch (attr) { case FILL_COLOR: properties.push(FILL_COLOR((String) value)); break; case FILL_ALPHA: properties.push(FILL_ALPHA((double) value)); break; case STROKE_COLOR: properties.push(STROKE_COLOR((String) value)); break; case STROKE_ALPHA: properties.push(STROKE_ALPHA((double) value)); break; case STROKE_WIDTH: properties.push(STROKE_WIDTH((double) value)); break; } }); return shape.animate( AnimationTweener.LINEAR, properties, duration, new AnimationCallback() { @Override public void onClose(final IAnimation animation, final IAnimationHandle handle) { super.onClose(animation, handle); if (!animationHandle.isRunning()) { setAnimationHandle(null); completeCallback.execute(); } } }); }
Source:
private void analyzeClass(final byte[] source) { final long classId = CRC64.classId(source); final int version = BytecodeVersion.read(source); final byte[] b = BytecodeVersion.downgradeIfNeeded(version, source); final ClassReader reader = new ClassReader(b); final ClassVisitor visitor = createAnalyzingVisitor(classId, reader.getClassName()); reader.accept(visitor, 0); }

Target:
private void analyzeClass(final byte[] source) { final long classId = CRC64.classId(source); final int version = BytecodeVersion.get(source); final byte[] b = BytecodeVersion.downgradeIfNeeded(version, source); final ClassReader reader = new ClassReader(b); final ClassVisitor visitor = createAnalyzingVisitor(classId, reader.getClassName()); reader.accept(visitor, 0); }
Source:
AsyncKijiTable( AsyncKiji kiji, String name, HBaseClient hbClient, TableLayoutMonitor layoutMonitor) throws IOException { mConstructorStack = (CLEANUP_LOG.isDebugEnabled()) ? Debug.getStackTrace() : ENABLE_CONSTRUCTOR_STACK_LOGGING_MESSAGE; mKiji = kiji; mKiji.retain(); mName = name; mHBClient = hbClient; mTableURI = KijiURI.newBuilder(mKiji.getURI()).withTableName(mName).build(); LOG.debug("Opening Kiji table '{}' with client version '{}'.", mTableURI, VersionInfo.getSoftwareVersion()); mHBaseTableName = KijiManagedHBaseTableName.getKijiTableName(mTableURI.getInstance(), mName).toString(); Deferred<Object> ensureTableExists = mHBClient.ensureTableExists(mHBaseTableName); try { ensureTableExists.joinUninterruptibly(); } catch (Exception e) { e.printStackTrace(); } if (!mKiji.getTableNames().contains(mName)) { closeResources(); throw new KijiTableNotFoundException(mTableURI); } mWriterFactory = new AsyncKijiWriterFactory(this); mReaderFactory = new AsyncKijiReaderFactory(this); mLayoutMonitor = layoutMonitor; mEntityIdFactory = createEntityIdFactory(mLayoutMonitor.getLayoutCapsule()); mRetainCount.set(1); DebugResourceTracker.get().registerResource(this, mConstructorStack); final State oldState = mState.getAndSet(State.OPEN); Preconditions.checkState(oldState == State.UNINITIALIZED, "Cannot open KijiTable instance in state %s.", oldState); }

Target:
AsyncKijiTable( AsyncKiji kiji, String name, HBaseClient hbClient, TableLayoutMonitor layoutMonitor) throws IOException { mConstructorStack = (CLEANUP_LOG.isDebugEnabled()) ? Debug.getStackTrace() : ENABLE_CONSTRUCTOR_STACK_LOGGING_MESSAGE; mKiji = kiji; mKiji.retain(); mName = name; mHBClient = hbClient; mTableURI = KijiURI.newBuilder(mKiji.getURI()).withTableName(mName).build(); LOG.debug("Opening Kiji table '{}' with client version '{}'.", mTableURI, VersionInfo.getSoftwareVersion()); mHBaseTableName = KijiManagedHBaseTableName.getKijiTableName(mTableURI.getInstance(), mName).toString(); try { mHBClient.ensureTableExists(mHBaseTableName).join(); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } if (!mKiji.getTableNames().contains(mName)) { closeResources(); throw new KijiTableNotFoundException(mTableURI); } mWriterFactory = new AsyncKijiWriterFactory(this); mReaderFactory = new AsyncKijiReaderFactory(this); mLayoutMonitor = layoutMonitor; mEntityIdFactory = createEntityIdFactory(mLayoutMonitor.getLayoutCapsule()); mRetainCount.set(1); DebugResourceTracker.get().registerResource(this, mConstructorStack); final State oldState = mState.getAndSet(State.OPEN); Preconditions.checkState(oldState == State.UNINITIALIZED, "Cannot open KijiTable instance in state %s.", oldState); }
Source:
public static String formatIso8601ForCCTray(Date date) { if (date == null) { return null; } return formatter.withZoneUTC().print(date.getTime()); }

Target:
public static String formatIso8601ForCCTray(Date date) { if (date == null) { return null; } return formatterUtc.print(date.getTime()); }
Source:
public String toString() { return format("buckets=%s, hiveTypes=%s, types=%s, bucketingType=%s", bucketCount, hiveTypes, types, bucketingType); }

Target:
public String toString() { return format( "buckets=%s, bucketFunctionType=%s, types=%s", bucketCount, bucketFunctionType, bucketFunctionType.equals(HIVE_COMPATIBLE) ? hiveTypes.get() : types.get()); }
Source:
public void begin() { ComponentSystemManager manager = context.get(ComponentSystemManager.class); final List<ComponentSystem> componentSystemList = manager.iterateAll(); componentSystems = componentSystemList.iterator(); setTotalSteps(componentSystemList.size()); }

Target:
public void begin() { ComponentSystemManager manager = context.get(ComponentSystemManager.class); final List<ComponentSystem> componentSystemList = manager.getAllSystems(); componentSystems = componentSystemList.iterator(); setTotalSteps(componentSystemList.size()); }
Source:
public Operation exec(Prolog engine) throws PrologException { engine.setB0(); PatchSetInfo psInfo = StoredValues.PATCH_SET_INFO.get(engine); UserIdentity author = psInfo.getAuthor(); return exec(engine, author); }

Target:
public Operation exec(Prolog engine) throws PrologException { PatchSetInfo psInfo; try { psInfo = getPatchSetInfo(engine); } catch (PatchSetInfoNotAvailableException err) { throw new JavaException(this, 1, err); } UserIdentity author = psInfo.getAuthor(); return exec(engine, author); }
Source:
protected int poll(Duration timeout) throws InterruptedException { records.clear(); try { for (ConsumerRecord<String, Bytes> record : consumer.poll(timeout.toMillis())) { if (log.isDebugEnabled() && records.isEmpty()) { log.debug("Poll first record: " + getNameForTopic(record.topic()) + ":" + record.partition() + ":+" + record.offset()); } records.add(record); } } catch (org.apache.kafka.common.errors.InterruptException e) { Thread.currentThread().interrupt(); throw new InterruptedException(e.getMessage()); } catch (WakeupException e) { log.debug("Receiving wakeup from another thread to close the tailer"); try { close(); } catch (Exception e1) { log.warn("Error while closing the tailer " + this); } throw new IllegalStateException("poll interrupted because tailer has been closed"); } if (log.isDebugEnabled()) { String msg = "Polling " + id + " returns " + records.size() + " records"; if (records.size() > 0) { log.debug(msg); } else { log.trace(msg); } } return records.size(); }

Target:
protected int poll(Duration timeout) throws InterruptedException { records.clear(); try { for (ConsumerRecord<String, Bytes> record : consumer.poll(timeout.toMillis())) { if (log.isDebugEnabled() && records.isEmpty()) { log.debug("Poll first record: " + getNameForTopic(record.topic()) + ":" + record.partition() + ":+" + record.offset()); } records.add(record); } } catch (org.apache.kafka.common.errors.InterruptException e) { throw new InterruptedException(e.getMessage()); } catch (WakeupException e) { log.debug("Receiving wakeup from another thread to close the tailer"); close(); throw new IllegalStateException("poll interrupted because tailer has been closed"); } if (log.isDebugEnabled()) { String msg = "Polling " + id + " returns " + records.size() + " records"; if (records.size() > 0) { log.debug(msg); } else { log.trace(msg); } } return records.size(); }
Source:
public CompletableFuture<Boolean> remove(K key, V value) { return readWriteMap.eval(key, new RemoveFunction<>(key, value)); }

Target:
public CompletableFuture<Boolean> remove(K key, V value) { requireNonNull(key, "key can't be null"); requireNonNull(value, "value can't be null"); return readWriteMap.eval(key, new RemoveFunction<>(value)); }
Source:
public String getIpAddress() { String publicIpv4Addr = amazonInfoHolder.get().get(MetaDataKey.publicIpv4); return this.shouldBroadcastPublicIpv4Addr() ? getPublicIpv4Addr() : getPrivateIpv4Addr(); }

Target:
public String getIpAddress() { return this.shouldBroadcastPublicIpv4Addr() ? getPublicIpv4Addr() : getPrivateIpv4Addr(); }
Source:
public JsonMessageParser(SecorConfig config) { super(config); fieldName = config.getMessageTimestampName(); }

Target:
public JsonMessageParser(SecorConfig config) { super(config); }
Source:
private boolean connectAudio(String address) { BluetoothHeadsetProxy bluetoothHeadset = mDeviceManager.getHeadsetService(); if (bluetoothHeadset == null) { Log.w(this, "Trying to connect audio but no headset service exists."); return false; } BluetoothDevice device = mDeviceManager.getDeviceFromAddress(address); if (device == null) { Log.w(this, "Attempting to turn on audio for a disconnected device"); return false; } boolean success = bluetoothHeadset.setActiveDevice(device); if (!success) { Log.w(LOG_TAG, "Couldn't set active device to %s", address); return false; } if (!bluetoothHeadset.isAudioOn()) { return bluetoothHeadset.connectAudio(); } return true; }

Target:
private boolean connectAudio(String address) { BluetoothHeadsetProxy bluetoothHeadset = mDeviceManager.getHeadsetService(); if (bluetoothHeadset == null) { Log.w(this, "Trying to connect audio but no headset service exists."); return false; } BluetoothDevice device = mDeviceManager.getDeviceFromAddress(address); if (device == null) { Log.w(this, "Attempting to turn on audio for a disconnected device"); return false; } if (!bluetoothHeadset.setActiveDevice(device)) { Log.w(LOG_TAG, "Couldn't set active device to %s", address); return false; } if (!bluetoothHeadset.isAudioOn()) { return bluetoothHeadset.connectAudio(); } return true; }
Source:
public void testObtainCertificateWithUnsupportedPublicKey() throws Exception { addKeyStore(ACCOUNTS_KEYSTORE, ACCOUNTS_KEYSTORE_NAME, ACCOUNTS_KEYSTORE_PASSWORD); addCertificateAuthorityAccount("account7v2", "mailto:admin@anexample.com"); addKeyStore(); server = setupTestObtainCertificateWithUnsupportedPublicKey(); try { ModelNode operation = new ModelNode(); operation.get(ClientConstants.OP_ADDR).add("subsystem", "elytron").add("key-store", KEYSTORE_NAME); operation.get(ClientConstants.OP).set(ElytronDescriptionConstants.OBTAIN_CERTIFICATE); operation.get(ElytronDescriptionConstants.ALIAS).set("server"); operation.get(ElytronDescriptionConstants.DOMAIN_NAMES).add("iraclzlcqgaymrc.com"); operation.get(ElytronDescriptionConstants.ALGORITHM).set("DSA"); operation.get(ElytronDescriptionConstants.KEY_SIZE).set(2048); operation.get(ElytronDescriptionConstants.AGREE_TO_TERMS_OF_SERVICE).set(true); operation.get(ElytronDescriptionConstants.CERTIFICATE_AUTHORITY_ACCOUNT).set(CERTIFICATE_AUTHORITY_ACCOUNT_NAME); assertFailed(services.executeOperation(operation)); } finally { removeCertificateAuthorityAccount(); removeKeyStore(ACCOUNTS_KEYSTORE_NAME); removeKeyStore(KEYSTORE_NAME); } }

Target:
public void testObtainCertificateWithUnsupportedPublicKey() throws Exception { addKeyStore(ACCOUNTS_KEYSTORE, ACCOUNTS_KEYSTORE_NAME, ACCOUNTS_KEYSTORE_PASSWORD); addCertificateAuthorityWithoutStagingUrl(); addCertificateAuthorityAccountWithCustomCA("account7v2", "mailto:admin@myexample.com"); addKeyStore(); server = setupTestObtainCertificateWithUnsupportedPublicKey(); try { ModelNode operation = new ModelNode(); operation.get(ClientConstants.OP_ADDR).add("subsystem", "elytron").add("key-store", KEYSTORE_NAME); operation.get(ClientConstants.OP).set(ElytronDescriptionConstants.OBTAIN_CERTIFICATE); operation.get(ElytronDescriptionConstants.ALIAS).set("server"); operation.get(ElytronDescriptionConstants.DOMAIN_NAMES).add("iraclzlcqgaymrc.com"); operation.get(ElytronDescriptionConstants.ALGORITHM).set("DSA"); operation.get(ElytronDescriptionConstants.KEY_SIZE).set(2048); operation.get(ElytronDescriptionConstants.AGREE_TO_TERMS_OF_SERVICE).set(true); operation.get(ElytronDescriptionConstants.CERTIFICATE_AUTHORITY_ACCOUNT).set(CERTIFICATE_AUTHORITY_ACCOUNT_NAME); ModelNode result = services.executeOperation(operation); assertFailed(result); String failureDescription = result.get(FAILURE_DESCRIPTION).asString(); assertTrue(failureDescription.contains("WFLYCTL0129")); } finally { removeCertificateAuthorityAccount(); removeCertificateAuthority(); removeKeyStore(ACCOUNTS_KEYSTORE_NAME); removeKeyStore(KEYSTORE_NAME); } }
Source:
public String getGID(URL url) throws MalformedURLException { Pattern p = Pattern.compile("^https?://buttsmithy.com/archives/comic/([a-zA-Z0-9-]*)/?$"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { return m.group(1); } throw new MalformedURLException("Expected imgur.com URL format: " + "https?://buttsmithy.com/archives/comic/ - got " + url + " instead"); }

Target:
public String getGID(URL url) throws MalformedURLException { Pattern p = Pattern.compile("^https?://buttsmithy.com/archives/comic/([a-zA-Z0-9-]*)/?$"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { return m.group(1); } throw new MalformedURLException("Expected buttsmithy.com URL format: " + "buttsmithy.com/archives/comic/ - got " + url + " instead"); }
Source:
private void testCancelAddingNewQuestion() { ______TS("Cancelling the adding of a new question"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("MCQ"); ______TS("Click cancel but click no to confirmation prompt"); feedbackEditPage.getDiscardChangesLink(-1).click(); feedbackEditPage.waitForConfirmationModalAndClickCancel(); assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); ______TS("Click cancel and click yes to confirmation prompt"); feedbackEditPage.getDiscardChangesLink(-1).click(); feedbackEditPage.waitForConfirmationModalAndClickOk(); assertFalse(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); ______TS("Make sure controls disabled by Team Contribution questions are re-enabled after cancelling"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONTRIB"); feedbackEditPage.getDiscardChangesLink(-1).click(); feedbackEditPage.waitForConfirmationModalAndClickOk(); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("NUMSCALE"); assertTrue(feedbackEditPage.isAllFeedbackPathOptionsEnabledForNewQuestion()); feedbackEditPage.getDiscardChangesLink(-1).click(); feedbackEditPage.waitForConfirmationModalAndClickOk(); }

Target:
private void testCancelAddingNewQuestion() { ______TS("Cancelling the adding of a new question"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("MCQ"); ______TS("Click cancel but click no to confirmation prompt"); feedbackEditPage.clickDiscardChangesLink(-1); feedbackEditPage.waitForConfirmationModalAndClickCancel(); assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); ______TS("Click cancel and click yes to confirmation prompt"); feedbackEditPage.clickDiscardChangesLink(-1); feedbackEditPage.waitForConfirmationModalAndClickOk(); assertFalse(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); ______TS("Make sure controls disabled by Team Contribution questions are re-enabled after cancelling"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("CONTRIB"); feedbackEditPage.clickDiscardChangesLink(-1); feedbackEditPage.waitForConfirmationModalAndClickOk(); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.selectNewQuestionType("NUMSCALE"); assertTrue(feedbackEditPage.isAllFeedbackPathOptionsEnabledForNewQuestion()); feedbackEditPage.clickDiscardChangesLink(-1); feedbackEditPage.waitForConfirmationModalAndClickOk(); }
Source:
public HTableDescriptor[] listTables(Pattern pattern) throws IOException { if (pattern == null) { return getTableDescriptorsIgnoreFailure(listTableNames()); } return getTableDescriptors(listTableNames(pattern)); }

Target:
public HTableDescriptor[] listTables(Pattern pattern) throws IOException { return getTableDescriptorsIgnoreFailure(listTableNames(pattern)); }
Source:
public void testDecode() throws Exception { OwnTracksProtocolDecoder decoder = new OwnTracksProtocolDecoder(new OwnTracksProtocol()); verifyPosition(decoder, request(HttpMethod.POST, "/", buffer("{\"lon\":2.29513,\"lat\":48.85833,\"tst\":1497349316,\"_type\":\"location\",\"tid\":\"JJ\"}"))); verifyPosition(decoder, request(HttpMethod.POST, "/", buffer("{\"cog\":271,\"lon\":2.29513,\"acc\":5,\"vel\":61,\"vac\":21,\"lat\":48.85833,\"tst\":1497349316,\"alt\":167,\"_type\":\"location\",\"tid\":\"JJ\",\"t\":\"u\",\"batt\":67}"))); verifyPosition(decoder, request(HttpMethod.POST, "/", buffer(text("{\"lat\":48.85,\"lon\":2.295,\"_type\":\"location\",\"tid\":\"JJ\"}")))); }

Target:
public void testDecode() throws Exception { OwnTracksProtocolDecoder decoder = new OwnTracksProtocolDecoder(new OwnTracksProtocol()); verifyPosition(decoder, request(HttpMethod.POST, "/", buffer("{\"lon\":2.29513,\"lat\":48.85833,\"tst\":1497349316,\"_type\":\"location\",\"tid\":\"JJ\"}"))); verifyPosition(decoder, request(HttpMethod.POST, "/", buffer("{\"cog\":271,\"lon\":2.29513,\"acc\":5,\"vel\":61,\"vac\":21,\"lat\":48.85833,\"tst\":1497349316,\"alt\":167,\"_type\":\"location\",\"tid\":\"JJ\",\"t\":\"u\",\"batt\":67}"))); verifyPosition(decoder, request(HttpMethod.POST, "/", buffer("{\"lat\":48.85,\"lon\":2.295,\"_type\":\"location\",\"tid\":\"JJ\",\"tst\":1497476456}"))); }
Source:
public List<Element> getSettingsSection( String xpath ) { if ( hasSettingsXML() ) { try { List<Node> nodes = XmlDom4JUtils.getDocumentFromFile( pluginDirAccess, SETTINGS_XML_FILENAME ).selectNodes( "/settings" + xpath ); List<Element> elements = new ArrayList<>( nodes.size() ); for ( Node node : nodes ) { if ( node.getNodeType() == Node.ELEMENT_NODE ) { elements.add( (DefaultElement) node ); } } return elements; } catch ( IOException e ) { logger.error( e ); } } return Collections.<Element>emptyList(); }

Target:
public List<Element> getSettingsSection( String xpath ) { if ( hasSettingsXML() ) { try { Node documentNode = XmlDom4JUtils.getDocumentFromFile( pluginDirAccess, SETTINGS_XML_FILENAME ); return (List<Element>) (List<?>) documentNode.selectNodes( "/settings" + xpath ); } catch ( IOException e ) { logger.error( e ); } } return Collections.<Element>emptyList(); }
Source:
private List<Parameter> getParameters(Class<?> cls, Method method, Route route) { List<Parameter> parameters = new ArrayList<>(); if (!route.call().parameters().isDefined()) { return parameters; } scala.collection.Iterator<play.routes.compiler.Parameter> iter = route.call().parameters().get().iterator(); int fieldPosition = 0; while (iter.hasNext()) { play.routes.compiler.Parameter p = iter.next(); if (!p.fixed().isEmpty()) continue; Parameter parameter; String def = CrossUtil.getParameterDefaultField(p); if (def.startsWith("\"") && def.endsWith("\"")){ def = def.substring(1,def.length()-1); } Type type = getParamType(cls, method, p.typeName()); Property schema = createProperty(type); if (route.path().has(p.name())) { parameter = new PathParameter(); if (def != null) ((PathParameter)parameter).setDefaultValue(def); if (schema != null) ((PathParameter)parameter).setProperty(schema); } else { parameter = new QueryParameter(); if (def != null) ((QueryParameter)parameter).setDefaultValue(def); if (schema != null) ((QueryParameter)parameter).setProperty(schema); } parameter.setName(p.name()); List<Annotation> annotations = getParamAnnotations(cls, method, p.typeName(), fieldPosition++); ParameterProcessor.applyAnnotations(getSwagger(), parameter, type, annotations); parameters.add(parameter); } return parameters; }

Target:
private List<Parameter> getParameters(Class<?> cls, Method method, Route route) { List<Parameter> parameters = new ArrayList<>(); if (!route.call().parameters().isDefined()) { return parameters; } scala.collection.Iterator<play.routes.compiler.Parameter> iter = route.call().parameters().get().iterator(); int fieldPosition = 0; while (iter.hasNext()) { play.routes.compiler.Parameter p = iter.next(); if (!p.fixed().isEmpty()) continue; Parameter parameter; String def = CrossUtil.getParameterDefaultField(p); if (def.startsWith("\"") && def.endsWith("\"")){ def = def.substring(1,def.length()-1); } Type type = getParamType(cls, method, p.typeName()); Property schema = createProperty(type); if (route.path().has(p.name())) { parameter = new PathParameter(); ((PathParameter)parameter).setDefaultValue(def); if (schema != null) ((PathParameter)parameter).setProperty(schema); } else { parameter = new QueryParameter(); ((QueryParameter)parameter).setDefaultValue(def); if (schema != null) ((QueryParameter)parameter).setProperty(schema); } parameter.setName(p.name()); List<Annotation> annotations = getParamAnnotations(cls, method, p.typeName(), fieldPosition); ParameterProcessor.applyAnnotations(getSwagger(), parameter, type, annotations); parameters.add(parameter); fieldPosition++; } return parameters; }