auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<DocumentModel> getSubscribedDocuments(String prefixedPrincipalName) { String nxql = String.format( "SELECT * FROM Document WHERE ecm:mixinType ='Notifiable' " + "AND ecm:isCheckedInVersion = 0 " + "AND notif:notifications/*/subscribers/* = " + NXQL.escapeString(prefixedPrincipalName)); return UnrestrictedDocFetcher.query(nxql); }

Target:
public List<DocumentModel> getSubscribedDocuments(String prefixedPrincipalName) { String nxql = "SELECT * FROM Document WHERE ecm:mixinType = '" + SubscriptionAdapter.NOTIFIABLE_FACET + "' " + "AND ecm:isCheckedInVersion = 0 " + "AND notif:notifications/*/subscribers/* = " + NXQL.escapeString(prefixedPrincipalName); return UnrestrictedDocFetcher.query(nxql); }
Source:
protected static final String formatMessage(String message, Arg<?>... args) { if (args.length == 0) { return message; } String[] stringifiedArgs = Arrays.stream(args) .map(arg -> String.format("%s=%s", arg.getName(), toJson(arg.getValue()))) .toArray(String[]::new); return String.format("%s {%s}", message, String.join(", ", stringifiedArgs)); }

Target:
protected static final String formatMessage(String message, Arg<?>... args) { if (args.length == 0) { return message; } StringBuilder builder = new StringBuilder(); builder.append(message).append(" {"); for (int i = 0; i < args.length; i++) { if (i > 0) { builder.append(", "); } Arg<?> arg = args[i]; builder.append(arg.getName()).append("=").append(toJson(arg.getValue())); } builder.append("}"); return builder.toString(); }
Source:
public static String getClientIp(final String ip, final String xff) { if (xff == null || "-".equals(xff) || "".equals(xff)) { return ip; } else { String[] proxiedIps = xff.split(","); try { for (String proxiedIp : proxiedIps) { Matcher ip4 = IP4PATTERN.matcher(proxiedIp); Matcher ip6 = IP6PATTERN.matcher(proxiedIp); if ((!( proxiedIp.startsWith("127.0") || proxiedIp.startsWith("192.168") || proxiedIp.startsWith("10.") )) && ( ip4.matches() || ip6.matches() ) ) { return proxiedIp; } } return ip; } catch (ArrayIndexOutOfBoundsException e) { return ip; } } }

Target:
public static String getClientIp(final String ip, final String xff) { if (xff == null || xff.isEmpty() || xff.equals("-")) { return ip; } else { String[] proxiedIps = xff.split(","); try { for (String proxiedIp : proxiedIps) { int ipVersion = getIpVersion(proxiedIp); if ((!( proxiedIp.startsWith("127.0") || proxiedIp.startsWith("192.168") || proxiedIp.startsWith("10.") || proxiedIp.startsWith("169.254") )) && ( ipVersion == 4 || ipVersion == 6 ) ) { return proxiedIp; } } return ip; } catch (ArrayIndexOutOfBoundsException e) { return ip; } } }
Source:
public C get(K key) { C value = map.get(key); if (value == null) { value = supplier.get(); C previousValue = map.put(key, value); if (previousValue != null) { value = previousValue; } } return value; }

Target:
public C get(K key) { C value; if (concurrentMap != null) { value = concurrentMap.get(key); if (value == null ) { value = supplier.get(); if (value != null) { C previousValue = concurrentMap.putIfAbsent(key, value); if (previousValue != null) { value = previousValue; } } } } else { value = map.get(key); if (value == null ) { value = supplier.get(); if (value != null) { C previousValue = map.put(key, value); if (previousValue != null) { value = previousValue; } } } } return value; }
Source:
private QueueTaskFuture<?> startJob(GitHubPRCause cause) { List<ParameterValue> values = getDefaultParametersValues(); values.addAll(asList( TRIGGER_SENDER_AUTHOR.param(cause.getTriggerSenderName()), TRIGGER_SENDER_EMAIL.param(cause.getTriggerSenderEmail()), COMMIT_AUTHOR_NAME.param(cause.getCommitAuthorName()), COMMIT_AUTHOR_EMAIL.param(cause.getCommitAuthorEmail()), TARGET_BRANCH.param(cause.getTargetBranch()), SOURCE_BRANCH.param(cause.getSourceBranch()), AUTHOR_EMAIL.param(cause.getPRAuthorEmail()), SHORT_DESC.param(cause.getShortDescription()), TITLE.param(cause.getTitle()), URL.param(cause.getHtmlUrl().toString()), SOURCE_REPO_OWNER.param(cause.getSourceRepoOwner()), HEAD_SHA.param(cause.getHeadSha()), COND_REF.param(cause.getCondRef()), CAUSE_SKIP.param(cause.isSkip()), NUMBER.param(String.valueOf(cause.getNumber())) )); GitHubPRBadgeAction gitHubPRBadgeAction = new GitHubPRBadgeAction(cause); ParameterizedJobMixIn parameterizedJobMixIn = asParameterizedJobMixIn(job); int quietPeriod = 0; try { Object mixinJob = FieldUtils.readField(parameterizedJobMixIn, "val$job", true); ParameterizedJobMixIn.ParameterizedJob parameterizedJob = (ParameterizedJobMixIn.ParameterizedJob) mixinJob; quietPeriod = parameterizedJob.getQuietPeriod(); LOGGER.debug("Got quiet period from the project: {}", quietPeriod); } catch (IllegalAccessException e) { LOGGER.error("Couldn't get quiet period ({})", e.getMessage(), e); } return parameterizedJobMixIn.scheduleBuild2(quietPeriod, new CauseAction(cause), new ParametersAction(values), gitHubPRBadgeAction); }

Target:
private QueueTaskFuture<?> startJob(GitHubPRCause cause) { List<ParameterValue> values = getDefaultParametersValues(); values.addAll(asList( TRIGGER_SENDER_AUTHOR.param(cause.getTriggerSenderName()), TRIGGER_SENDER_EMAIL.param(cause.getTriggerSenderEmail()), COMMIT_AUTHOR_NAME.param(cause.getCommitAuthorName()), COMMIT_AUTHOR_EMAIL.param(cause.getCommitAuthorEmail()), TARGET_BRANCH.param(cause.getTargetBranch()), SOURCE_BRANCH.param(cause.getSourceBranch()), AUTHOR_EMAIL.param(cause.getPRAuthorEmail()), SHORT_DESC.param(cause.getShortDescription()), TITLE.param(cause.getTitle()), URL.param(cause.getHtmlUrl().toString()), SOURCE_REPO_OWNER.param(cause.getSourceRepoOwner()), HEAD_SHA.param(cause.getHeadSha()), COND_REF.param(cause.getCondRef()), CAUSE_SKIP.param(cause.isSkip()), NUMBER.param(String.valueOf(cause.getNumber())) )); GitHubPRBadgeAction gitHubPRBadgeAction = new GitHubPRBadgeAction(cause); ParameterizedJobMixIn parameterizedJobMixIn = asParameterizedJobMixIn(job); int quietPeriod = 0; try { Object mixinJob = FieldUtils.readField(parameterizedJobMixIn, "val$job", true); ParameterizedJobMixIn.ParameterizedJob parameterizedJob = (ParameterizedJobMixIn.ParameterizedJob) mixinJob; quietPeriod = parameterizedJob.getQuietPeriod(); } catch (IllegalAccessException e) { LOGGER.error("Couldn't get quiet period, falling back to ({})", quietPeriod, e.getMessage(), e); } return parameterizedJobMixIn.scheduleBuild2(quietPeriod, new CauseAction(cause), new ParametersAction(values), gitHubPRBadgeAction); }
Source:
public static String getAverageMemberLoadByMemberId(String Id, String startTime, String endTime) throws RestAPIException { String memberLoadAverageQuery = "SELECT value AS MEMBER_AVERAGE_LOAD_AVERAGE,ID,timeStamp FROM HealthStatisticsTable " + "WHERE ID = \"" + Id + "\" AND timeStamp BETWEEN " + startTime + " AND " + endTime + " AND " + "type = \"member_average_load_average\" GROUP BY from_unixtime(timeStamp/1000,\"%Y-%m-%d %H:%i\");"; List<AverageLoadAverageBean> averageMemberLoadList = new ArrayList<AverageLoadAverageBean>(); ConnectionHandler connectionHandler = new ConnectionHandler(); try { Statement statement = connectionHandler.getsqlConnection().createStatement(); ResultSet result = statement.executeQuery(memberLoadAverageQuery); while (result.next()) { averageMemberLoadList.add(new AverageLoadAverageBean("", result.getLong("TIMESTAMP"), result.getDouble("MEMBER_AVERAGE_LOAD_AVERAGE"), result.getString("ID"))); } } catch (SQLException ex) { log.error("SQLException: ", ex); throw new RestAPIException(ex.getMessage()); } catch (Exception ex) { log.error("Exception: ", ex); throw new RestAPIException(ex.getMessage()); } finally { try { connectionHandler.closeConnection(); } catch (SQLException ex) { log.error("SQLException: ", ex); throw new RestAPIException(ex.getMessage()); } } if (!averageMemberLoadList.isEmpty()) { return new Gson().toJson(averageMemberLoadList); } else { return null; } }

Target:
public static String getAverageMemberLoadByMemberId(String Id, String startTime, String endTime) throws RestAPIException { String memberLoadAverageQuery = "SELECT value AS 'MEMBER_AVERAGE_LOAD_AVERAGE' , ID , timeStamp FROM " + HELATH_STAT_TABLE +" WHERE ID =? " +" AND timeStamp BETWEEN ? " +" AND ? " +" AND " +" type = \"member_average_load_average\" GROUP BY from_unixtime(timeStamp/1000,\"%Y-%m-%d %H:%i\");"; List<AverageLoadAverageBean> averageMemberLoadList = new ArrayList<AverageLoadAverageBean>(); ConnectionHandler connectionHandler = new ConnectionHandler(); PreparedStatement prepareStatement; try { prepareStatement= connectionHandler.getsqlConnection().prepareStatement(memberLoadAverageQuery); prepareStatement.setString(1, Id); prepareStatement.setString(2, startTime); prepareStatement.setString(3, endTime); ResultSet result = prepareStatement.executeQuery(); while (result.next()) { averageMemberLoadList.add(new AverageLoadAverageBean("", result.getLong("TIMESTAMP"), result.getDouble("MEMBER_AVERAGE_LOAD_AVERAGE"), result.getString("ID"))); } } catch (SQLException ex) { log.error("SQLException: ", ex); throw new RestAPIException(ex.getMessage(),ex); } catch (Exception ex) { log.error("Exception: ", ex); throw new RestAPIException(ex.getMessage(),ex); } finally { try { connectionHandler.closeConnection(); } catch (SQLException ex) { log.error("SQLException: ", ex); throw new RestAPIException(ex.getMessage(),ex); } } if (!averageMemberLoadList.isEmpty()) { return new Gson().toJson(averageMemberLoadList); } else { return null; } }
Source:
public boolean deletePhonenumber() { if (selectedPhonenumber != null) { return loadTestDataService.deletePhonenumber(selectedPhonenumber); } else { addPatientErrorMessages("Phonenumber have to be select to be deleted"); } return false; }

Target:
public boolean deletePhonenumber() { boolean result = false; if (selectedPhonenumber != null) { result = loadTestDataService.deletePhonenumber(selectedPhonenumber); } else { addPatientErrorMessages(msgForSelectDelete("phonenumber")); } return result; }
Source:
public void toJSONString(JSONStringer stringer) throws JSONException { super.toJSONString(stringer); stringer.key(Members.ISNULL.name()); stringer.value(m_isNull); stringer.key(Members.VALUE.name()); if (m_isNull) { stringer.value("NULL"); } else { switch (m_valueType) { case INVALID: throw new JSONException("ConstantValueExpression.toJSONString(): value_type should never be VoltType.INVALID"); case NULL: stringer.value("null"); break; case TINYINT: stringer.value(Long.valueOf(m_value)); break; case SMALLINT: stringer.value(Long.valueOf(m_value)); break; case INTEGER: stringer.value(Long.valueOf(m_value)); break; case BIGINT: stringer.value(Long.valueOf(m_value)); break; case FLOAT: stringer.value(Double.valueOf(m_value)); break; case STRING: stringer.value(m_value); break; case VARBINARY: stringer.value(m_value); break; case TIMESTAMP: try { stringer.value(Long.valueOf(m_value)); } catch (NumberFormatException e) { stringer.value(Timestamp.valueOf(m_value)); } break; case DECIMAL: stringer.value(m_value); break; case BOOLEAN: stringer.value(Boolean.valueOf(m_value)); break; default: throw new JSONException("ConstantValueExpression.toJSONString(): Unrecognized value_type " + m_valueType); } } }

Target:
public void toJSONString(JSONStringer stringer) throws JSONException { super.toJSONString(stringer); stringer.key(Members.ISNULL.name()); stringer.value(m_isNull); stringer.key(Members.VALUE.name()); if (m_isNull) { stringer.value("NULL"); } else { switch (m_valueType) { case INVALID: throw new JSONException("ConstantValueExpression.toJSONString(): value_type should never be VoltType.INVALID"); case NULL: stringer.value("null"); break; case TINYINT: stringer.value(Long.valueOf(m_value)); break; case SMALLINT: stringer.value(Long.valueOf(m_value)); break; case INTEGER: stringer.value(Long.valueOf(m_value)); break; case BIGINT: stringer.value(Long.valueOf(m_value)); break; case FLOAT: stringer.value(Double.valueOf(m_value)); break; case STRING: stringer.value(m_value); break; case VARBINARY: stringer.value(m_value); break; case TIMESTAMP: stringer.value(Long.valueOf(m_value)); break; case DECIMAL: stringer.value(m_value); break; case BOOLEAN: stringer.value(Boolean.valueOf(m_value)); break; default: throw new JSONException("ConstantValueExpression.toJSONString(): Unrecognized value_type " + m_valueType); } } }
Source:
private AbstractSqlWriter createQueryWriter(SqlContext context, QueryData queryData, QueryType queryType) throws OseeCoreException { IOseeBranch branch = getBranchToSearch(queryData); return new ArtifactQuerySqlWriter(logger, dbService, sqlProvider, context, queryType, branch.getUuid()); }

Target:
private AbstractSqlWriter createQueryWriter(SqlContext context, QueryData queryData, QueryType queryType) throws OseeCoreException { IOseeBranch branch = getBranchToSearch(queryData); Conditions.checkNotNull(branch, "branch"); return new ArtifactQuerySqlWriter(logger, dbService, sqlProvider, context, queryType, branch.getUuid()); }
Source:
public TaskInfo updateTask( Session session, TaskId taskId, Optional<PlanFragment> fragment, List<TaskSource> sources, OutputBuffers outputBuffers, Optional<TableWriteInfo> tableWriteInfo) { requireNonNull(session, "session is null"); requireNonNull(taskId, "taskId is null"); requireNonNull(fragment, "fragment is null"); requireNonNull(sources, "sources is null"); requireNonNull(outputBuffers, "outputBuffers is null"); if (resourceOvercommit(session)) { queryContexts.getUnchecked(taskId.getQueryId()).setResourceOvercommit(); } else { queryContexts.getUnchecked( taskId.getQueryId()).setMemoryLimits( SystemSessionProperties.getQueryMaxTaskMemory(session), SystemSessionProperties.getQueryMaxTotalTaskMemory(session)); } SqlTask sqlTask = tasks.getUnchecked(taskId); sqlTask.recordHeartbeat(); return sqlTask.updateTask(session, fragment, sources, outputBuffers, tableWriteInfo); }

Target:
public TaskInfo updateTask( Session session, TaskId taskId, Optional<PlanFragment> fragment, List<TaskSource> sources, OutputBuffers outputBuffers, Optional<TableWriteInfo> tableWriteInfo) { requireNonNull(session, "session is null"); requireNonNull(taskId, "taskId is null"); requireNonNull(fragment, "fragment is null"); requireNonNull(sources, "sources is null"); requireNonNull(outputBuffers, "outputBuffers is null"); if (resourceOvercommit(session)) { queryContexts.getUnchecked(taskId.getQueryId()).setResourceOvercommit(); } else { queryContexts.getUnchecked( taskId.getQueryId()).setMemoryLimits( getQueryMaxMemoryPerNode(session), getQueryMaxTotalMemoryPerNode(session)); } SqlTask sqlTask = tasks.getUnchecked(taskId); sqlTask.recordHeartbeat(); return sqlTask.updateTask(session, fragment, sources, outputBuffers, tableWriteInfo); }
Source:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp1 = args[0]; ObjectPointable op; if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) { TaggedValuePointable temptvp = ppool.takeOne(TaggedValuePointable.class); try { tvp1.getValue(sp1); int size1 = sp1.getEntryCount(); int size2; for (int i = 0; i < size1; i++) { sp1.getEntry(i, temptvp); if (temptvp.getTag() == ValueTag.OBJECT_TAG) { op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); temptvp.getValue(op); op.getKeys(temptvp); temptvp.getValue(sp2); size2 = sp2.getEntryCount(); for (int j = 0; j < size2; j++) { TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY .createPointable(); sp2.getEntry(j, tvp); pointables.add(tvp); } } } removeDuplicates(pointables); abvs.reset(); sb.reset(abvs); for (TaggedValuePointable tvp : pointables) { sb.addItem(tvp); } sb.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { ppool.giveBack(temptvp); } } else if (tvp1.getTag() == ValueTag.OBJECT_TAG) { try { op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); tvp1.getValue(op); op.getKeys(result); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } else { try { abvs.reset(); sb.reset(abvs); sb.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } }

Target:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp1 = args[0]; ObjectPointable op; if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) { List<TaggedValuePointable> pointables = new ArrayList<>(); TaggedValuePointable temptvp = ppool.takeOne(TaggedValuePointable.class); try { tvp1.getValue(sp1); int size1 = sp1.getEntryCount(); int size2; for (int i = 0; i < size1; i++) { sp1.getEntry(i, temptvp); if (temptvp.getTag() == ValueTag.OBJECT_TAG) { op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); temptvp.getValue(op); op.getKeys(temptvp); temptvp.getValue(sp2); size2 = sp2.getEntryCount(); for (int j = 0; j < size2; j++) { TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY .createPointable(); sp2.getEntry(j, tvp); pointables.add(tvp); } } } removeDuplicates(pointables); abvs.reset(); sb.reset(abvs); for (TaggedValuePointable tvp : pointables) { sb.addItem(tvp); } sb.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { ppool.giveBack(temptvp); } } else if (tvp1.getTag() == ValueTag.OBJECT_TAG) { try { op = (ObjectPointable) ObjectPointable.FACTORY.createPointable(); tvp1.getValue(op); op.getKeys(result); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } else { XDMConstants.setEmptySequence(result); } }
Source:
public String getMimeType(final String fileId) throws IOException { if (getFile(fileId) != null) { FileUtil.getFileMimeType(getFile(fileId).getFile()); } return null; }

Target:
public String getMimeType(final String fileId) { FileWidgetUpload fileWidget = getFile(fileId); if (fileWidget != null) { return FileUtil.getFileMimeType(fileWidget.getFile()); } return null; }
Source:
public void testCreateConfigMapAlreadyExisting() throws Exception { final KubernetesConfigMap configMap = buildTestingConfigMap(); this.flinkKubeClient.createConfigMap(configMap).get(); mockCreateConfigMapAlreadyExisting(configMap.getInternalResource()); configMap.getData().put(TESTING_CONFIG_MAP_KEY, TESTING_CONFIG_MAP_NEW_VALUE); try { this.flinkKubeClient.createConfigMap(configMap).get(); fail("Exception should be thrown."); } catch (Exception ex) { assertThat(ex.getMessage(), containsString("Failed to create ConfigMap " + TESTING_CONFIG_MAP_NAME)); } final Optional<KubernetesConfigMap> currentOpt = this.flinkKubeClient.getConfigMap(TESTING_CONFIG_MAP_NAME); assertThat(currentOpt.isPresent(), is(true)); assertThat(currentOpt.get().getData().get(TESTING_CONFIG_MAP_KEY), is(TESTING_CONFIG_MAP_VALUE)); }

Target:
public void testCreateConfigMapAlreadyExisting() throws Exception { final KubernetesConfigMap configMap = buildTestingConfigMap(); this.flinkKubeClient.createConfigMap(configMap).get(); mockCreateConfigMapAlreadyExisting(configMap.getInternalResource()); configMap.getData().put(TESTING_CONFIG_MAP_KEY, TESTING_CONFIG_MAP_NEW_VALUE); try { this.flinkKubeClient.createConfigMap(configMap).get(); fail("Overwrite an already existing config map should fail with an exception."); } catch (Exception ex) { final String errorMsg = "Failed to create ConfigMap " + TESTING_CONFIG_MAP_NAME; assertThat(ex, FlinkMatchers.containsMessage(errorMsg)); } final Optional<KubernetesConfigMap> currentOpt = this.flinkKubeClient.getConfigMap(TESTING_CONFIG_MAP_NAME); assertThat(currentOpt.isPresent(), is(true)); assertThat(currentOpt.get().getData().get(TESTING_CONFIG_MAP_KEY), is(TESTING_CONFIG_MAP_VALUE)); }
Source:
public void addTableDefinition(String tableName, TableDefinition definition) { Preconditions.checkArgument( !tableDefinitions.containsKey(tableName) && !indexDefinitions.containsKey(tableName), "Table already defined: %s", tableName); Preconditions.checkArgument( Schemas.isTableNameValid(tableName), "Invalid table name " + tableName); if (!ignoreTableNameLengthChecks) { int internalTableNameLength = Schemas.getInternalTableNameLength(tableName, namespace); Preconditions.checkArgument( internalTableNameLength < POSTGRES_TABLE_NAME_CHAR_LIMIT, "Table name %s is too long, exceeds Cassandra and Postgres limits. " + "If running using a different KVS, set the ignoreTableNameLength flag.", tableName); Preconditions.checkArgument( internalTableNameLength < CASSANDRA_TABLE_NAME_CHAR_LIMIT, "Table name %s is too long, exceeds Cassandra limit. " + "If running using a different KVS, set the ignoreTableNameLength flag.", tableName); } tableDefinitions.put(tableName, definition); }

Target:
public void addTableDefinition(String tableName, TableDefinition definition) { Preconditions.checkArgument( !tableDefinitions.containsKey(tableName) && !indexDefinitions.containsKey(tableName), "Table already defined: %s", tableName); Preconditions.checkArgument( Schemas.isTableNameValid(tableName), "Invalid table name " + tableName); if (!ignoreTableNameLengthChecks) { String internalTableName = AbstractKeyValueService.internalTableName( TableReference.create(namespace, tableName)); List<CharacterLimitType> kvsExceeded = new ArrayList<>(); if (internalTableName.length() > AtlasDbConstants.CASSANDRA_TABLE_NAME_CHAR_LIMIT) { kvsExceeded.add(CharacterLimitType.CASSANDRA); } if (internalTableName.length() > AtlasDbConstants.POSTGRES_TABLE_NAME_CHAR_LIMIT) { kvsExceeded.add(CharacterLimitType.POSTGRES); } Preconditions.checkArgument( kvsExceeded.isEmpty(), "Internal table name %s is too long, known to exceed character limits for " + "the following KVS: %s. If using a table prefix, please ensure that the concatenation " + "of the prefix with the internal table name is below the KVS limit. " + "If running only against a different KVS, set the ignoreTableNameLength flag.", tableName, StringUtils.join(kvsExceeded, ", ")); } tableDefinitions.put(tableName, definition); }
Source:
protected final boolean matchesSafely(final T item) { try { this.itext = this.text(item); return this.body.matches(this.itext); } catch (final IOException ex) { throw new IllegalStateException(ex); } }

Target:
protected final boolean matchesSafely(final T item) { try { return this.body.matches(this.text(item)); } catch (final IOException ex) { throw new IllegalStateException(ex); } }
Source:
public static boolean isPublishSubscribe(String pathOrUri) { return pathOrUri != null && pathOrUri.endsWith(PUBLISH_SUBSCRIBE_PATH); }

Target:
public static boolean isPublishSubscribe(String pathOrUri) { return pathOrUri != null && pathOrUri.equals(PUBLISH_SUBSCRIBE_PATH); }
Source:
public List<String> getSupportedProducts() { return Arrays.asList(SupportedProduct.DATAPREP); }

Target:
public List<String> getSupportedProducts() { return Collections.singletonList(SupportedProduct.DATAPREP); }
Source:
public DefaultCacheEventListenerBuilder() { }

Target:
private DefaultCacheEventListenerBuilder() { }
Source:
public ResponseEntity<MetricValueForCommit[]> getMetricValues(@Validated @RequestBody GetMetricsForCommitCommand command, @PathVariable("projectId") Long projectId){ return new ResponseEntity<>(getMetricValuesOfCommitUseCase.get(command, projectId), HttpStatus.OK); }

Target:
public ResponseEntity<List<MetricValueForCommit>> getMetricValues(@Validated @RequestBody GetMetricsForCommitCommand command, @PathVariable("projectId") Long projectId){ return new ResponseEntity<>(getMetricValuesOfCommitUseCase.get(command, projectId), HttpStatus.OK); }
Source:
private FilteredTree createFilteredTree(Composite parent) { FilteredTree filteredTree = new RootElementsFilteredTree(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); filteredTree.setInitialText(PDEUIMessages.FeaturesView_searchPlaceholder); PatternFilter patternFilter = filteredTree.getPatternFilter(); patternFilter.setIncludeLeadingWildcard(true); TreeViewer viewer = filteredTree.getViewer(); viewer.setComparer(new FeatureElementComparer()); viewer.setLabelProvider(new PDELabelProvider()); viewer.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { handleOpen(); } }); viewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { Collection<?> selection = getViewerSelection(); openAction.setEnabled(!selection.isEmpty()); copyAction.setEnabled(!selection.isEmpty()); } }); return filteredTree; }

Target:
private FilteredTree createFilteredTree(Composite parent) { FilteredTree filteredTree = new RootElementsFilteredTree(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); filteredTree.setInitialText(PDEUIMessages.FeaturesView_searchPlaceholder); PatternFilter patternFilter = filteredTree.getPatternFilter(); patternFilter.setIncludeLeadingWildcard(true); TreeViewer viewer = filteredTree.getViewer(); viewer.setComparer(new FeatureElementComparer()); viewer.setLabelProvider(new PDELabelProvider()); viewer.addDoubleClickListener(event -> handleOpen()); viewer.addSelectionChangedListener(event -> { Collection<?> selection = getViewerSelection(); fOpenAction.setEnabled(!selection.isEmpty()); fCopyAction.setEnabled(!selection.isEmpty()); }); return filteredTree; }
Source:
public Map<String, Integer> getConnectedHostIPAndPort() { Map<String, Integer> map = Maps.newHashMap(); for (NodeConnection conn : m_connections) { map.put(conn.getSocketAddress().getAddress().getHostAddress(), (conn.getSocketAddress().getPort())); } return Collections.unmodifiableMap(map); }

Target:
public Map<String, Integer> getConnectedHostIPAndPort() { Map<String, Integer> connectedHostIPAndPortMap = Maps.newHashMap(); for (NodeConnection conn : m_connections) { connectedHostIPAndPortMap.put(conn.getSocketAddress().getAddress().getHostAddress(), (conn.getSocketAddress().getPort())); } return Collections.unmodifiableMap(connectedHostIPAndPortMap); }
Source:
public void deletePushedAssetsByEnvironment(final String assetId, final String environmentId) throws DotDataException { new DotConnect().setSQL(DELETE_ASSETS_BY_ASSET_ID_AND_ENV) .addParam(assetId).addParam(environmentId).loadResult(); cache.clearCache(); }

Target:
public void deletePushedAssetsByEnvironment(final String assetId, final String environmentId) throws DotDataException { new DotConnect().setSQL(DELETE_ASSETS_BY_ASSET_ID_AND_ENV) .addParam(assetId).addParam(environmentId).loadResult(); cache.removePushedAssetById(assetId, environmentId); }
Source:
public void removeEndpoint(InetAddressAndPort endpoint) { replicaSet.removeIf(r -> r.getEndpoint().equals(endpoint)); }

Target:
public void removeEndpoint(InetAddressAndPort endpoint) { Iterator<Replica> iterator = replicaSet.iterator(); while (iterator.hasNext()) { Replica next = iterator.next(); if (next.getEndpoint().equals(endpoint)) { iterator.remove(); } } }
Source:
public Binder build(Annotation annotation) { return new Binder<BindTimelineLog, LoggingProtos.TimelineLog>() { public void bind(SQLStatement q, BindTimelineLog bind, LoggingProtos.TimelineLog arg) { q.bind("account_id", arg.getAccountId()); q.bind("date_of_night", String.valueOf(arg.getNightOfTimeline())); q.bind("algorithm", arg.getAlgorithm().getNumber()); q.bind("error", arg.getError().getNumber()); if (arg.hasTimestampWhenLogGenerated()) { q.bind("created_at", new Timestamp(arg.getTimestampWhenLogGenerated())); } else { q.bind("created_at", (Timestamp) null); } } }; }

Target:
public Binder build(Annotation annotation) { return new Binder<BindTimelineLog, LoggingProtos.TimelineLog>() { public void bind(SQLStatement q, BindTimelineLog bind, LoggingProtos.TimelineLog arg) { q.bind("account_id", arg.getAccountId()); q.bind("date_of_night", arg.getNightOf()); q.bind("algorithm", arg.getAlgorithm().getNumber()); q.bind("error", arg.getError().getNumber()); if (arg.hasTimestampWhenLogGenerated()) { q.bind("created_at", new Timestamp(arg.getTimestampWhenLogGenerated())); } else { q.bind("created_at", (Timestamp) null); } } }; }
Source:
public UserCredentials getUserCredentials(String username) { loadCredentials(); UserCredentials uc = credentialsMap.get(username); if (uc == null) { uc = new UserCredentials(); } return uc; }

Target:
public UserCredentials getUserCredentials(String username) throws IOException { loadCredentials(); UserCredentials uc = credentialsMap.get(username); if (uc == null) { uc = new UserCredentials(); } return uc; }
Source:
protected void composeLine(final AllelicCount record, final DataLine dataLine) { dataLine.append(record.getInterval().getContig()) .append(record.getInterval().getEnd()) .append(record.getRefReadCount()) .append(record.getAltReadCount()) .append(record.getRefNucleotide().name()) .append(record.getAltNucleotide().name()); }

Target:
protected void composeLine(final AllelicCount record, final DataLine dataLine) { Utils.validateArg(record.getAltNucleotide() != null && record.getRefNucleotide() != null, "AllelicCount must have all fields specified to be written to file."); dataLine.append(record.getInterval().getContig()) .append(record.getInterval().getEnd()) .append(record.getRefReadCount()) .append(record.getAltReadCount()) .append(record.getRefNucleotide().name()) .append(record.getAltNucleotide().name()); }
Source:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { mvs.reset(); try { ab.reset(mvs); TaggedValuePointable tvp1 = args[0]; if (tvp1.getTag() == ValueTag.ARRAY_TAG) { tvp1.getValue(ap); TaggedValuePointable tvp2 = args[1]; TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class); tvp2.getValue(lp); if ((int) lp.getLong() > ap.getEntryCount()) throw new RuntimeException("The argument is out of bounds"); ap.getEntry((int) lp.getLong() - 1, tempTvp); try { if (ap.getEntryCount() != 0) ab.addItem(tempTvp); else ab.addItem(tvp1); } finally { ppool.giveBack(tempTvp); } ab.finish(); } } catch (IOException e) { e.printStackTrace(); } result.set(mvs); }

Target:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp1 = args[0]; TaggedValuePointable tvp2 = args[1]; if (!(tvp1.getTag() == ValueTag.ARRAY_TAG || tvp1.getTag() == ValueTag.OBJECT_TAG)) { throw new SystemException(ErrorCode.FORG0006); } if (tvp1.getTag() == ValueTag.ARRAY_TAG) { if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) { throw new SystemException(ErrorCode.FORG0006); } TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class); mvs.reset(); try { ab.reset(mvs); tvp1.getValue(ap); tvp2.getValue(lp); if ((int) lp.getLong() > ap.getEntryCount()) { ab.finish(); result.set(mvs); return; } ap.getEntry((int) lp.getLong() - 1, tempTvp); ab.addItem(ap.getEntryCount() != 0 ? tempTvp : tvp1); ab.finish(); result.set(mvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } finally { ppool.giveBack(tempTvp); } } }
Source:
ContributionsPresenter(ContributionsRepository repository, @Named(CommonsApplicationModule.MAIN_THREAD) Scheduler mainThreadScheduler,@Named(CommonsApplicationModule.IO_THREAD) Scheduler ioThreadScheduler) { this.repository = repository; compositeDisposable=new CompositeDisposable(); this.mainThreadScheduler=mainThreadScheduler; this.ioThreadScheduler=ioThreadScheduler; }

Target:
ContributionsPresenter(ContributionsRepository repository, @Named(CommonsApplicationModule.MAIN_THREAD) Scheduler mainThreadScheduler,@Named(CommonsApplicationModule.IO_THREAD) Scheduler ioThreadScheduler) { this.repository = repository; this.mainThreadScheduler=mainThreadScheduler; this.ioThreadScheduler=ioThreadScheduler; }
Source:
public void onPostServerTick() { this.onPreServerTick(this.getMinecraftServerInstance()); }

Target:
public void onPostServerTick() { this.onPostServerTick(this.getMinecraftServerInstance()); }
Source:
private void fireTagCallForClick(@NonNull final OSInAppMessageAction action) { if (action.tag != null) { OSInAppMessageTag tags = action.tag; if (tags.getTagsToAdd() != null) OneSignal.sendTags(tags.getTagsToAdd()); if (tags.getTagsToRemove() != null) OneSignal.deleteTags(tags.getTagsToRemove(), null); } }

Target:
private void fireTagCallForClick(@NonNull final OSInAppMessageAction action) { if (action.tags != null) { OSInAppMessageTag tags = action.tags; if (tags.getTagsToAdd() != null) OneSignal.sendTags(tags.getTagsToAdd()); if (tags.getTagsToRemove() != null) OneSignal.deleteTags(tags.getTagsToRemove(), null); } }
Source:
private static ReaderBlogIdPostIdList getBlogIdPostIdsWithTagType(ReaderTagType tagType, int maxPosts) { if (tagType == null) { return new ReaderBlogIdPostIdList(); } String sql = "SELECT blog_id, post_id FROM tbl_posts WHERE tag_name=? AND tag_type=?"; if (maxPosts > 0) { sql += " LIMIT " + Integer.toString(maxPosts); } String[] args = {Integer.toString(tagType.toInt())}; return getBlogIdPostIds(sql, args); }

Target:
private static ReaderBlogIdPostIdList getBlogIdPostIdsWithTagType(ReaderTagType tagType, int maxPosts) { if (tagType == null) { return new ReaderBlogIdPostIdList(); } String sql = "SELECT blog_id, post_id FROM tbl_posts WHERE tag_type=?"; if (maxPosts > 0) { sql += " LIMIT " + Integer.toString(maxPosts); } String[] args = {Integer.toString(tagType.toInt())}; return getBlogIdPostIds(sql, args); }
Source:
public void run() throws Throwable { for (String className : testClassNames) { if (!shouldIncludeTest(className)) { continue; } final Class<?> testClass = Class.forName(className); List<TestResult> results; if (!mightBeATestClass(testClass)) { results = Collections.emptyList(); } else { results = new ArrayList<>(); TestNG testng = new TestNG(); testng.setUseDefaultListeners(false); testng.setAnnotationTransformer(new FilteringAnnotationTransformer(results)); testng.setTestClasses(new Class<?>[]{testClass}); testng.addListener(new TestListener(results)); testng.addListener(new SuiteHTMLReporter()); testng.addListener((IReporter) new FailedReporter()); testng.addListener(new XMLReporter()); testng.addListener(new EmailableReporter()); testng.addListener(new JUnitReportReporterImproved()); testng.run(); } writeResult(className, results); } }

Target:
public void run() throws Throwable { for (String className : testClassNames) { if (!shouldIncludeTest(className)) { continue; } final Class<?> testClass = Class.forName(className); List<TestResult> results; if (!mightBeATestClass(testClass)) { results = Collections.emptyList(); } else { results = new ArrayList<>(); TestNG testng = new TestNG(); testng.setUseDefaultListeners(false); testng.setAnnotationTransformer(new FilteringAnnotationTransformer(results)); testng.setTestClasses(new Class<?>[] {testClass}); testng.addListener(new TestListener(results)); testng.addListener(new SuiteHTMLReporter()); testng.addListener((IReporter) new FailedReporter()); testng.addListener(new XMLReporter()); testng.addListener(new EmailableReporter()); testng.addListener(new JUnitReportReporterWithMethodParameters()); testng.run(); } writeResult(className, results); } }
Source:
public org.kie.dmn.model.api.InputData dmnFromNode(final Node<View<InputData>, ?> node) { InputData source = node.getContent().getDefinition(); org.kie.dmn.model.api.InputData result = new org.kie.dmn.model.v1_2.TInputData(); result.setId(source.getId().getValue()); result.setDescription(DescriptionPropertyConverter.dmnFromWB(source.getDescription())); result.setName(source.getName().getValue()); org.kie.dmn.model.api.InformationItem variable = InformationItemPropertyConverter.dmnFromWB(source.getVariable()); variable.setParent(result); result.setVariable(variable); return result; }

Target:
public org.kie.dmn.model.api.InputData dmnFromNode(final Node<View<InputData>, ?> node) { InputData source = node.getContent().getDefinition(); org.kie.dmn.model.api.InputData result = new org.kie.dmn.model.v1_2.TInputData(); result.setId(source.getId().getValue()); result.setDescription(DescriptionPropertyConverter.dmnFromWB(source.getDescription())); result.setName(source.getName().getValue()); org.kie.dmn.model.api.InformationItem variable = InformationItemPropertyConverter.dmnFromWB(source.getVariable()); if (variable != null) { variable.setParent(result); } result.setVariable(variable); return result; }
Source:
public void return_leak_period_date() throws Exception { setServerProperty(orchestrator, "sonar.leak.period", "previous_version"); Date leakPeriodDate = toDate("2016-12-31"); String projectKey1 = newProjectKey(); analyzeProject(projectKey1, "shared/xoo-sample", formatDate(leakPeriodDate)); analyzeProject(projectKey1, "shared/xoo-sample"); String projectKey2 = newProjectKey(); analyzeProject(projectKey2, "shared/xoo-sample"); String projectKey3 = newProjectKey(); newAdminWsClient(orchestrator).projects().create(CreateRequest.builder().setKey(projectKey3).setName(projectKey3).setOrganization(organizationKey).build()); SearchProjectsWsResponse response = searchProjects( SearchProjectsRequest.builder().setAdditionalFields(singletonList("leakPeriodDate")).setOrganization(organizationKey).build()); assertThat(response.getComponentsList()).extracting(Component::getKey, Component::hasLeakPeriodDate) .containsOnly( tuple(projectKey1, true), tuple(projectKey2, false), tuple(projectKey3, false)); Component project1 = response.getComponentsList().stream().filter(component -> component.getKey().equals(projectKey1)).findFirst() .orElseThrow(() -> new IllegalStateException("Project1 is not found")); assertThat(project1.getLeakPeriodDate()).startsWith("2016-12-31"); }

Target:
public void return_leak_period_date() throws Exception { setServerProperty(orchestrator, "sonar.leak.period", "previous_version"); String projectKey1 = newProjectKey(); analyzeProject(projectKey1, "shared/xoo-sample", "2016-12-31"); analyzeProject(projectKey1, "shared/xoo-sample"); String projectKey2 = newProjectKey(); analyzeProject(projectKey2, "shared/xoo-sample"); String projectKey3 = newProjectKey(); newAdminWsClient(orchestrator).projects().create(CreateRequest.builder().setKey(projectKey3).setName(projectKey3).setOrganization(organizationKey).build()); SearchProjectsWsResponse response = searchProjects( SearchProjectsRequest.builder().setAdditionalFields(singletonList("leakPeriodDate")).setOrganization(organizationKey).build()); assertThat(response.getComponentsList()).extracting(Component::getKey, Component::hasLeakPeriodDate) .containsOnly( tuple(projectKey1, true), tuple(projectKey2, false), tuple(projectKey3, false)); Component project1 = response.getComponentsList().stream().filter(component -> component.getKey().equals(projectKey1)).findFirst() .orElseThrow(() -> new IllegalStateException("Project1 is not found")); assertThat(sanitizeTimezones(project1.getLeakPeriodDate())).isEqualTo("2016-12-31T00:00:00+0000"); }
Source:
private String getQuestionResultStatistics(List<FeedbackResponseAttributes> responses, Map<String, Integer> answerFrequency) { isContainsNonEmptyResponse = false; for (String option : msqChoices) { answerFrequency.put(option, 0); } if (otherEnabled) { answerFrequency.put("Other", 0); } int numChoicesSelected = 0; for (FeedbackResponseAttributes response : responses) { numChoicesSelected = getNumOfChoicesSelected(response, numChoicesSelected, answerFrequency); } if (!isContainsNonEmptyResponse) { return ""; } return Integer.toString(numChoicesSelected); }

Target:
private int getQuestionResultStatistics( List<FeedbackResponseAttributes> responses, Map<String, Integer> answerFrequency) { containsNonEmptyResponse = false; for (String option : msqChoices) { answerFrequency.put(option, 0); } if (otherEnabled) { answerFrequency.put("Other", 0); } int numChoicesSelected = 0; for (FeedbackResponseAttributes response : responses) { numChoicesSelected = numChoicesSelected + getNumOfChoicesSelected(response, answerFrequency); } if (!containsNonEmptyResponse) { return -1; } return numChoicesSelected; }
Source:
private int countLines(File input) throws IOException { return Files.readAllLines(input.toPath()).size(); }

Target:
private int countLines(File input) throws IOException { int count = 0; try (BufferedReader reader = Files.newBufferedReader(input.toPath())) { while (reader.readLine() != null) { count++; } } return count; }
Source:
private void setEpisodeIndex(MemberOfType memberOf, Item item) { Episode episode = (Episode) item; Integer episodeNumber = episode.getEpisodeNumber(); if (episodeNumber != null) { memberOf.setIndex(Long.valueOf(episodeNumber)); } else if (!item.getReleaseDates().isEmpty()) { int index = generateIndexFromReleaseDate(item.getReleaseDates()); memberOf.setIndex(Long.valueOf(index)); } }

Target:
private void setEpisodeIndex(MemberOfType memberOf, Item item) { Episode episode = (Episode) item; Integer episodeNumber = episode.getEpisodeNumber(); if (episodeNumber != null) { memberOf.setIndex(Long.valueOf(episodeNumber)); } else if (!item.getReleaseDates().isEmpty()) { for (ReleaseDate releaseDate : item.getReleaseDates()) { if (releaseDate.type().equals(ReleaseType.FIRST_BROADCAST)) { int index = generateIndexFromReleaseDate(releaseDate); memberOf.setIndex(Long.valueOf(index)); } } } }
Source:
public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, TimeRange timeRange, Mutation mutation) throws IOException { CheckAndMutate.Builder builder = CheckAndMutate.newBuilder(row) .ifMatches(family, qualifier, op, comparator.getValue()).timeRange(timeRange); try { if (mutation instanceof Put) { return checkAndMutate(builder.build((Put) mutation)).isSuccess(); } else if (mutation instanceof Delete) { return checkAndMutate(builder.build((Delete) mutation)).isSuccess(); } else { throw new DoNotRetryIOException( "Unsupported mutate type: " + mutation.getClass().getSimpleName().toUpperCase()); } } catch (IllegalArgumentException e) { throw new DoNotRetryIOException(e.getMessage()); } }

Target:
public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, TimeRange timeRange, Mutation mutation) throws IOException { CheckAndMutate checkAndMutate; try { CheckAndMutate.Builder builder = CheckAndMutate.newBuilder(row) .ifMatches(family, qualifier, op, comparator.getValue()).timeRange(timeRange); if (mutation instanceof Put) { checkAndMutate = builder.build((Put) mutation); } else if (mutation instanceof Delete) { checkAndMutate = builder.build((Delete) mutation); } else { throw new DoNotRetryIOException("Unsupported mutate type: " + mutation.getClass() .getSimpleName().toUpperCase()); } } catch (IllegalArgumentException e) { throw new DoNotRetryIOException(e.getMessage()); } return checkAndMutate(checkAndMutate).isSuccess(); }
Source:
private void cacheNegotiatingProfiles() { synchronized (this) { schemes = new ArrayList<String>(); profiles = new ArrayList<AuthenticationProfile>(); for (AuthenticationProfile profile : AuthenticationProfileRepository.getInstance().getProfiles()) { ExtMap authnContext = profile.getAuthn().getContext(); if ((authnContext.<Long> get(Authn.ContextKeys.CAPABILITIES).longValue() & caps) != 0) { profiles.add(profile); schemes.addAll(authnContext.<Collection<String>>get(Authn.ContextKeys.HTTP_AUTHENTICATION_SCHEME, Collections.<String>emptyList())); } } Collections.sort( profiles, new Comparator<AuthenticationProfile>() { @Override public int compare(AuthenticationProfile o1, AuthenticationProfile o2) { return Integer.valueOf(o1.getNegotiationPriority()).compareTo(o2.getNegotiationPriority()); } } ); } }

Target:
private synchronized void cacheNegotiatingProfiles() { schemes = new ArrayList<String>(); profiles = new ArrayList<AuthenticationProfile>(); for (AuthenticationProfile profile : AuthenticationProfileRepository.getInstance().getProfiles()) { ExtMap authnContext = profile.getAuthn().getContext(); if ((authnContext.<Long> get(Authn.ContextKeys.CAPABILITIES).longValue() & caps) != 0) { profiles.add(profile); schemes.addAll(authnContext.<Collection<String>>get(Authn.ContextKeys.HTTP_AUTHENTICATION_SCHEME, Collections.<String>emptyList())); } } Collections.sort( profiles, new Comparator<AuthenticationProfile>() { @Override public int compare(AuthenticationProfile o1, AuthenticationProfile o2) { return Integer.valueOf(o1.getNegotiationPriority()).compareTo(o2.getNegotiationPriority()); } } ); }
Source:
public static double[] getLocationByIP() { String location; try { URL url = new URL("<LINK_0>"); InputStream is = url.openStream(); byte[] b = new byte[BUF_SIZE + 1]; char[] c = new char[is.read(b) + 2]; for (int i = 0; b[i] > 0 && i < BUF_SIZE; i++) { c[i] = (char) b[i]; } location = String.valueOf(c). split("\"loc\": \"")[1].split("\"")[0]; } catch (Exception e) { System.err.println( "Не получается определить местоположение," + " попробуйте использовать --place"); return null; } return new double[]{ Double.parseDouble(location.split(",")[0]), Double.parseDouble(location.split(",")[1]), DEFAULT_RADIUS }; }

Target:
public static double[] getLocationByIP() { String location = ""; try { URL url = new URL("<LINK_0>"); try (InputStream is = url.openStream()) { byte[] b = new byte[BUF_SIZE + 1]; char[] c = new char[is.read(b) + 2]; for (int i = 0; b[i] > 0 && i < BUF_SIZE; i++) { c[i] = (char) b[i]; } location = String.valueOf(c). split("\"loc\": \"")[1].split("\"")[0]; try { is.close(); } catch (Exception e) { System.err.println("Соединение с ipinfo не закрылось"); } } catch (Exception e) { System.err.println( "Не получается определить местоположение," + " попробуйте использовать --place"); return null; } } catch (MalformedURLException e) { System.err.println( "http уже не считается протоколом, а вы используете мою программу О_о" ); } return new double[]{ Double.parseDouble(location.split(",")[0]), Double.parseDouble(location.split(",")[1]), DEFAULT_RADIUS }; }
Source:
protected void refreshBootParameters(RunVmParams runVmParameters) { super.refreshBootParameters(runVmParameters); getVm().setinitrd_url(runVmParameters.getinitrd_url()); getVm().setkernel_url(runVmParameters.getkernel_url()); getVm().setkernel_params(runVmParameters.getkernel_params()); getVm().setCustomProperties(runVmParameters.getCustomProperties()); }

Target:
protected void refreshBootParameters(RunVmParams runVmParameters) { if (runVmParameters == null) { return; } getVm().setinitrd_url(runVmParameters.getinitrd_url()); getVm().setkernel_url(runVmParameters.getkernel_url()); getVm().setkernel_params(runVmParameters.getkernel_params()); getVm().setCustomProperties(runVmParameters.getCustomProperties()); getVm().setboot_sequence(runVmParameters.getBootSequence()); }
Source:
private void collectCoverageInformation() { try { final InputStream execDataStream; try { execDataStream = new ByteArrayInputStream(RT.getAgent().getExecutionData(false)); } catch (IllegalStateException e) { System.err.println( "If the error notes: 'JaCoCo agent not started', the issue is likely " + "that the Jacoco agent is not included as a Java agent."); System.err.println( "To do so, add " + "'-Xbootclasspath/a:/path/to/jacocoagent.jar -javaagent:jacocoagent.jar' " + "to the command line argument."); throw (e); } final ExecutionDataReader reader = new ExecutionDataReader(execDataStream); reader.setSessionInfoVisitor( new ISessionInfoVisitor() { @Override public void visitSessionInfo(final SessionInfo info) }); reader.setExecutionDataVisitor( new IExecutionDataVisitor() { @Override public void visitClassExecution(final ExecutionData data) { executionData.put(data); } }); reader.read(); execDataStream.close(); } catch (IOException e) { System.err.println("Error in Coverage Tracker in collecting coverage information."); e.printStackTrace(); System.exit(1); } }

Target:
private void collectCoverageInformation() { try { final InputStream execDataStream; try { execDataStream = new ByteArrayInputStream(RT.getAgent().getExecutionData(false)); } catch (IllegalStateException e) { System.err.println( "If the error notes: 'JaCoCo agent not started', the issue is likely " + "that the Jacoco agent is not included as a Java agent."); System.err.println( "To do so, add " + "'-Xbootclasspath/a:/path/to/jacocoagent.jar -javaagent:jacocoagent.jar' " + "to the command line argument."); throw (e); } final ExecutionDataReader reader = new ExecutionDataReader(execDataStream); reader.setSessionInfoVisitor(DummySessionInfoVisitor.instance); reader.setExecutionDataVisitor( new IExecutionDataVisitor() { @Override public void visitClassExecution(final ExecutionData data) { executionData.put(data); } }); reader.read(); execDataStream.close(); } catch (IOException e) { System.err.println("Error in Coverage Tracker in collecting coverage information."); e.printStackTrace(); System.exit(1); } }