auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void moveSprintPlan(IProject project, IUserSession session, int oldId, int newId) { List<ISprintPlanDesc> descs = this.loadListPlans(); this.moveSprint(oldId, newId); ProductBacklogHelper PBHelper = new ProductBacklogHelper(session, project); Map<String, ArrayList<IIssue>> map = PBHelper.getSprintHashMap(); ArrayList<Integer> list = new ArrayList<Integer>(); if (oldId > newId) { for (int i = newId; i <= oldId; i++) { if (this.isSprintPlan(descs, i)) list.add(i); } } else { for (int i = 0; i <= newId - oldId; i++) { if (this.isSprintPlan(descs, newId - i)) list.add(newId - i); } } ProductBacklogLogic productBacklogLogic = new ProductBacklogLogic( session, project); if (list.size() != 0) { for (int i = 0; i < list.size(); i++) { if ((i + 1) != list.size()) { String sprintID = String.valueOf(list.get(i)); String nextSprintID = String.valueOf(list.get(i + 1)); List<IIssue> stories = map.get(sprintID); if (stories != null) { ArrayList<Long> total = convertTolong(stories); productBacklogLogic.addIssueToSprint(total, nextSprintID); } } else { String sprintID = String.valueOf(list.get(i)); String nextSprintID = String.valueOf(list.get(0)); List<IIssue> stories = map.get(sprintID); if (stories != null) { ArrayList<Long> total = convertTolong(stories); productBacklogLogic.addIssueToSprint(total, nextSprintID); } } } } }

Target:
public void moveSprintPlan(IProject project, IUserSession session, int oldId, int newId) { List<ISprintPlanDesc> descs = loadListPlans(); moveSprint(oldId, newId); ProductBacklogHelper PBHelper = new ProductBacklogHelper(session, project); Map<String, ArrayList<IIssue>> map = PBHelper.getSprintHashMap(); ArrayList<Integer> sprintsId = new ArrayList<Integer>(); if (oldId > newId) { for (int i = newId; i <= oldId; i++) { if (isSprintPlan(descs, i)) sprintsId.add(i); } } else { for (int i = 0; i <= newId - oldId; i++) { if (isSprintPlan(descs, newId - i)) sprintsId.add(newId - i); } } ProductBacklogLogic productBacklogLogic = new ProductBacklogLogic( session, project); if (sprintsId.size() != 0) { for (int i = 0; i < sprintsId.size(); i++) { if ((i + 1) != sprintsId.size()) { String sprintID = String.valueOf(sprintsId.get(i)); String nextSprintID = String.valueOf(sprintsId.get(i + 1)); List<IIssue> stories = map.get(sprintID); if (stories != null) { ArrayList<Long> total = convertToLong(stories); productBacklogLogic.addIssueToSprint(total, nextSprintID); } } else { String sprintID = String.valueOf(sprintsId.get(i)); String nextSprintID = String.valueOf(sprintsId.get(0)); List<IIssue> stories = map.get(sprintID); if (stories != null) { ArrayList<Long> total = convertToLong(stories); productBacklogLogic.addIssueToSprint(total, nextSprintID); } } } } }
Source:
private Integer getLastBuildNumberWithHistory(String planKey, int buildNumber) { while (true) { ResultsSummary lastBuild = Optional.ofNullable(resultsSummaryManager.findLastBuildResultBefore( planKey, buildNumber)).orElseThrow( () -> new RuntimeException("Could not found a previous buildId with the history artifact.")); if (historyArtifactExists(planKey, lastBuild.getBuildNumber())) { return lastBuild.getBuildNumber(); } else { buildNumber = lastBuild.getBuildNumber(); } } }

Target:
private Optional<Integer> getLastBuildNumberWithHistory(String planKey, int buildNumber) { int currentBuild = buildNumber; do { ResultsSummary lastBuild = resultsSummaryManager.findLastBuildResultBefore(planKey, currentBuild); if (Objects.isNull(lastBuild)) { return Optional.empty(); } currentBuild = lastBuild.getBuildNumber(); } while (!historyArtifactExists(planKey, currentBuild)); return Optional.of(currentBuild); }
Source:
public void commit(TransactionService transactionService) { if (state.get() == State.COMMITTED) { return; } if (state.get() == State.FAILED) { throw new IllegalStateException("this transaction has already failed"); } while (true) { Preconditions.checkState(state.get() == State.UNCOMMITTED, "Transaction must be uncommitted."); if (state.compareAndSet(State.UNCOMMITTED, State.COMMITTING)) { break; } } if (getTransactionType() == TransactionType.AGGRESSIVE_HARD_DELETE || getTransactionType() == TransactionType.HARD_DELETE) { cleaner.queueCellsForScrubbing(getCellsToQueueForScrubbing(), getStartTimestamp()); } boolean success = false; try { if (numWriters.get() > 0) { throw new IllegalStateException("Cannot commit while other threads are still calling put."); } checkConstraints(); commitWrites(transactionService); long transactionMillis = TimeUnit.NANOSECONDS.toMillis(transactionTimerContext.stop()); if (perfLogger.isDebugEnabled()) { perfLogger.debug("Committed transaction in {}ms", getStartTimestamp(), transactionMillis); } success = true; } finally { state.set(success ? State.COMMITTED : State.FAILED); } }

Target:
public void commit(TransactionService transactionService) { if (state.get() == State.COMMITTED) { return; } if (state.get() == State.FAILED) { throw new IllegalStateException("this transaction has already failed"); } while (true) { Preconditions.checkState(state.get() == State.UNCOMMITTED, "Transaction must be uncommitted."); if (state.compareAndSet(State.UNCOMMITTED, State.COMMITTING)) { break; } } if (getTransactionType() == TransactionType.AGGRESSIVE_HARD_DELETE || getTransactionType() == TransactionType.HARD_DELETE) { cleaner.queueCellsForScrubbing(getCellsToQueueForScrubbing(), getStartTimestamp()); } boolean success = false; try { if (numWriters.get() > 0) { throw new IllegalStateException("Cannot commit while other threads are still calling put."); } checkConstraints(); commitWrites(transactionService); if (perfLogger.isDebugEnabled()) { long transactionMillis = TimeUnit.NANOSECONDS.toMillis(transactionTimerContext.stop()); perfLogger.debug("Committed transaction in {}ms", getStartTimestamp(), transactionMillis); } success = true; } finally { state.set(success ? State.COMMITTED : State.FAILED); } }
Source:
public Set<AgentIdentity> selectAgent(User user, Set<AgentIdentity> allFreeAgents, int agentCount) { Set<AgentIdentity> userAgent = new HashSet<>(); for (AgentIdentity each : allFreeAgents) { String region = ((AgentControllerIdentityImplementation) each).getRegion(); if (StringUtils.endsWith(region, "owned_" + user.getUserId())) { userAgent.add(each); if (userAgent.size() == agentCount) { return userAgent; } } } for (AgentIdentity each : allFreeAgents) { String region = ((AgentControllerIdentityImplementation) each).getRegion(); if (!StringUtils.contains(region, "owned_")) { userAgent.add(each); if (userAgent.size() == agentCount) { return userAgent; } } } return userAgent; }

Target:
public Set<AgentIdentity> selectAgent(User user, Set<AgentIdentity> allFreeAgents, int agentCount) { Stream<AgentIdentity> ownedFreeAgentStream = allFreeAgents.stream().filter(isOwnedAgent.apply(user.getUserId())); Stream<AgentIdentity> freeAgentStream = allFreeAgents.stream().filter(isCommonAgent); return Stream.concat(ownedFreeAgentStream, freeAgentStream) .limit(agentCount) .collect(toSet()); }
Source:
public CacheStrategy<SegmentAnalysis, SegmentAnalysis, SegmentMetadataQuery> getCacheStrategy(final SegmentMetadataQuery query) { return new CacheStrategy<SegmentAnalysis, SegmentAnalysis, SegmentMetadataQuery>() { @Override public boolean isCacheable(SegmentMetadataQuery query, boolean willMergeRunners) { return true; } @Override public byte[] computeCacheKey(SegmentMetadataQuery query) { SegmentMetadataQuery updatedQuery = query.withFinalizedAnalysisTypes(config); byte[] includerBytes = updatedQuery.getToInclude().getCacheKey(); byte[] analysisTypesBytes = updatedQuery.getAnalysisTypesCacheKey(); return ByteBuffer.allocate(1 + includerBytes.length + analysisTypesBytes.length) .put(SEGMENT_METADATA_CACHE_PREFIX) .put(includerBytes) .put(analysisTypesBytes) .array(); } @Override public TypeReference<SegmentAnalysis> getCacheObjectClazz() { return getResultTypeReference(); } @Override public Function<SegmentAnalysis, SegmentAnalysis> prepareForCache() { return new Function<SegmentAnalysis, SegmentAnalysis>() { @Override public SegmentAnalysis apply(@Nullable SegmentAnalysis input) { return input; } }; } @Override public Function<SegmentAnalysis, SegmentAnalysis> pullFromCache() { return new Function<SegmentAnalysis, SegmentAnalysis>() { @Override public SegmentAnalysis apply(@Nullable SegmentAnalysis input) { return input; } }; } @Override public Function<SegmentAnalysis, SegmentAnalysis> prepareForResultLevelCache() { return prepareForCache(); } @Override public Function<SegmentAnalysis, SegmentAnalysis> pullFromResultLevelCache() { return pullFromCache(); } }; }

Target:
public CacheStrategy<SegmentAnalysis, SegmentAnalysis, SegmentMetadataQuery> getCacheStrategy(final SegmentMetadataQuery query) { return new CacheStrategy<SegmentAnalysis, SegmentAnalysis, SegmentMetadataQuery>() { @Override public boolean isCacheable(SegmentMetadataQuery query, boolean willMergeRunners) { return true; } @Override public byte[] computeCacheKey(SegmentMetadataQuery query) { SegmentMetadataQuery updatedQuery = query.withFinalizedAnalysisTypes(config); byte[] includerBytes = updatedQuery.getToInclude().getCacheKey(); byte[] analysisTypesBytes = updatedQuery.getAnalysisTypesCacheKey(); return ByteBuffer.allocate(1 + includerBytes.length + analysisTypesBytes.length) .put(SEGMENT_METADATA_CACHE_PREFIX) .put(includerBytes) .put(analysisTypesBytes) .array(); } @Override public TypeReference<SegmentAnalysis> getCacheObjectClazz() { return getResultTypeReference(); } @Override public Function<SegmentAnalysis, SegmentAnalysis> prepareForCache(boolean isResultLevelCache) { return new Function<SegmentAnalysis, SegmentAnalysis>() { @Override public SegmentAnalysis apply(@Nullable SegmentAnalysis input) { return input; } }; } @Override public Function<SegmentAnalysis, SegmentAnalysis> pullFromCache(boolean isResultLevelCache) { return new Function<SegmentAnalysis, SegmentAnalysis>() { @Override public SegmentAnalysis apply(@Nullable SegmentAnalysis input) { return input; } }; } }; }
Source:
public void deleteAllTimelinesForEventType(final String eventTypeName) throws TopicDeletionException, TimelineException, NotFoundException { LOG.info("Deleting all timelines for event type {}", eventTypeName); final List<Timeline> timelines = getTimelines(eventTypeName); for (final Timeline timeline:timelines) { final TopicRepository topicRepository = getTopicRepositoryForTimeline(timeline); topicRepository.deleteTopic(timeline.getTopic()); timelineDbRepository.deleteTimeline(timeline.getId()); } }

Target:
public Multimap<TopicRepository, String> deleteAllTimelinesForEventType(final String eventTypeName) throws TopicDeletionException, TimelineException, NotFoundException, InternalNakadiException, NoSuchEventTypeException { LOG.info("Deleting all timelines for event type {}", eventTypeName); final Multimap<TopicRepository, String> topicsToDelete = ArrayListMultimap.create(); for (final Timeline timeline : getActiveTimelinesOrdered(eventTypeName)) { topicsToDelete.put(getTopicRepository(timeline), timeline.getTopic()); timelineDbRepository.deleteTimeline(timeline.getId()); } return topicsToDelete; }
Source:
private String createIntermediateTableForeignKeyActionId() { if (DbConnectionFactory.isMySql()) { return MYSQL_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; } else if (DbConnectionFactory.isPostgres()) { return POSTGRES_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; } else if (DbConnectionFactory.isMsSql()) { return MSSQL_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; } else if (DbConnectionFactory.isOracle()) { return ORACLE_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; } return H2_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; }

Target:
private String createIntermediateTableForeignKeyActionId() { String sql = H2_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; if (DbConnectionFactory.isMySql()) { sql = MYSQL_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; } else if (DbConnectionFactory.isPostgres()) { sql = POSTGRES_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; } else if (DbConnectionFactory.isMsSql()) { sql = MSSQL_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; } else if (DbConnectionFactory.isOracle()) { sql = ORACLE_CREATE_INTERMEDIATE_TABLE_FOREIGN_KEY_ACTION_ID; } return sql; }
Source:
public static void fhirResourceGetPatientEverything(String resourceName) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( "%sv1beta1/%s/$everything", client.getRootUrl(), resourceName); URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); HttpUriRequest request = RequestBuilder .get(uriBuilder.build()) .addHeader("Content-Type", "application/json-patch+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { System.err.print(String.format( "Exception getting patient everythingresource: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.println("FHIR resource search results: "); responseEntity.writeTo(System.out); }

Target:
public static void fhirResourceGetPatientEverything(String resourceName) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( "%sv1/%s/$everything", client.getRootUrl(), resourceName); URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); HttpUriRequest request = RequestBuilder .get(uriBuilder.build()) .addHeader("Content-Type", "application/json-patch+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { System.err.print(String.format( "Exception getting patient everythingresource: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.println("FHIR resource search results: "); responseEntity.writeTo(System.out); }
Source:
public Function<Group, Object> makeJsonQueryExtractor(String expr) { return null; }

Target:
public Function<Group, Object> makeJsonQueryExtractor(String expr) { throw new UnsupportedOperationException("Parquet does not support JQ"); }
Source:
private boolean isIsUnsignedIntegerField(String lengthName) { IDeclaration decl = getCurrentScope().rLookupIdentifier(lengthName); if (decl instanceof IntegerDeclaration) { return !((IntegerDeclaration) decl).isSigned(); } return false; }

Target:
private boolean isIsUnsignedIntegerField(String lengthName) { IDeclaration decl = getCurrentScope().lookupIdentifierRecursive(lengthName); if (decl instanceof IntegerDeclaration) { return !((IntegerDeclaration) decl).isSigned(); } return false; }
Source:
private void checkTagsThatSupportEscaping(ASTElement node, Object data) { final List<ASTAttribute> attributes = node.findChildrenOfType(ASTAttribute.class); final Set<ASTElExpression> toReport = new HashSet<>(); boolean isUnescaped = false; boolean isEL = false; boolean hasPlaceholders = false; for (ASTAttribute attr : attributes) { String name = attr.getName().toLowerCase(); switch (name) { case ESCAPE: case ITEM_ESCAPED: final ASTText text = attr.getFirstDescendantOfType(ASTText.class); if (text != null) { if (text.getImage().equalsIgnoreCase(FALSE)) { isUnescaped = true; } } break; case VALUE: case ITEM_VALUE: final List<ASTElExpression> elsInVal = attr.findDescendantsOfType(ASTElExpression.class); for (ASTElExpression el : elsInVal) { if (doesElContainAnyUnescapedIdentifiers(el, ESCAPING.HTMLENCODE)) { isEL = true; toReport.add(el); } } final ASTText textValue = attr.getFirstDescendantOfType(ASTText.class); if (textValue != null) { if (Pattern.compile("\\{(\\w|,|\\.|'|:|\\s)*\\}").matcher(textValue.getImage()).matches()) { hasPlaceholders = true; } } break; default: break; } } if (hasPlaceholders && isUnescaped) { for (ASTElExpression expr : hasELInInnerElements(node)) { addViolation(data, expr); } } if (isEL && isUnescaped) { for (ASTElExpression expr : toReport) { addViolation(data, expr); } } }

Target:
private void checkTagsThatSupportEscaping(ASTElement node, Object data) { final List<ASTAttribute> attributes = node.findChildrenOfType(ASTAttribute.class); final Set<ASTElExpression> toReport = new HashSet<>(); boolean isUnescaped = false; boolean isEL = false; boolean hasPlaceholders = false; for (ASTAttribute attr : attributes) { String name = attr.getName().toLowerCase(); switch (name) { case ESCAPE: case ITEM_ESCAPED: final ASTText text = attr.getFirstDescendantOfType(ASTText.class); if (text != null) { if (text.getImage().equalsIgnoreCase(FALSE)) { isUnescaped = true; } } break; case VALUE: case ITEM_VALUE: final List<ASTElExpression> elsInVal = attr.findDescendantsOfType(ASTElExpression.class); for (ASTElExpression el : elsInVal) { if (startsWithSafeResource(el)) { continue; } if (doesElContainAnyUnescapedIdentifiers(el, Escaping.HTMLENCODE)) { isEL = true; toReport.add(el); } } final ASTText textValue = attr.getFirstDescendantOfType(ASTText.class); if (textValue != null) { if (PLACEHOLDERS.matcher(textValue.getImage()).matches()) { hasPlaceholders = true; } } break; default: break; } } if (hasPlaceholders && isUnescaped) { for (ASTElExpression expr : hasELInInnerElements(node)) { addViolation(data, expr); } } if (isEL && isUnescaped) { for (ASTElExpression expr : toReport) { addViolation(data, expr); } } }
Source:
private static String decryptPasswordAES(String encodedPassword) { String decryptedPassword = StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM) .decrypt(encodedPassword); return decryptedPassword; }

Target:
private static String decryptPasswordAES(String encodedPassword) { return StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).decrypt(encodedPassword); }
Source:
public Object setRoleAndVariable(ProceedingJoinPoint joinPoint) throws Throwable { if (isInAHttpRequest()) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); DataSource dataSource = jdbcTemplate.getJdbcTemplate().getDataSource(); Connection connection = DataSourceUtils.getConnection(dataSource); boolean mustCheck = false; String formattedOrgIds = ""; if (DataSourceUtils.isConnectionTransactional(connection, dataSource)) { mustCheck = !isCurrentlyInAPublicUrlRequest() && isLoggedUser() && !isAdmin(); if (mustCheck) { Set<Integer> orgIds = new TreeSet<>(organizationRepository.findAllOrganizationIdForUser(SecurityContextHolder.getContext().getAuthentication().getName())); formattedOrgIds = orgIds.stream().map(s -> Integer.toString(s)).collect(Collectors.joining(",", "'{", "}'")); jdbcTemplate.update("set local role application_user", new EmptySqlParameterSource()); jdbcTemplate.update("set local alfio.checkRowAccess = true", new EmptySqlParameterSource()); jdbcTemplate.update("set local alfio.currentUserOrgs = " + formattedOrgIds, new EmptySqlParameterSource()); } } if (log.isDebugEnabled()) { logEntry(connection, dataSource, joinPoint, request, mustCheck, formattedOrgIds); } } return joinPoint.proceed(); }

Target:
public Object setRoleAndVariable(ProceedingJoinPoint joinPoint) throws Throwable { if (isInAHttpRequest()) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); DataSource dataSource = jdbcTemplate.getJdbcTemplate().getDataSource(); Connection connection = DataSourceUtils.getConnection(dataSource); boolean mustCheck = false; String formattedOrgIds = ""; if (DataSourceUtils.isConnectionTransactional(connection, dataSource)) { mustCheck = !isCurrentlyInAPublicUrlRequest() && isLoggedUser() && !isAdmin(); if (mustCheck) { Set<Integer> orgIds = new TreeSet<>(organizationRepository.findAllOrganizationIdForUser(SecurityContextHolder.getContext().getAuthentication().getName())); formattedOrgIds = orgIds.stream().map(s -> Integer.toString(s)).collect(Collectors.joining(",", "'{", "}'")); jdbcTemplate.update("set local role application_user", new EmptySqlParameterSource()); jdbcTemplate.update("set local alfio.checkRowAccess = true", new EmptySqlParameterSource()); jdbcTemplate.update("set local alfio.currentUserOrgs = " + formattedOrgIds, new EmptySqlParameterSource()); } } if (log.isTraceEnabled()) { logEntry(connection, dataSource, joinPoint, request, mustCheck, formattedOrgIds); } } return joinPoint.proceed(); }
Source:
protected void onInit() { super.onInit(); if (this.clustered) { Assert.state(this.addresses.length == this.adminAddresses.length && this.addresses.length == this.nodes.length, "'addresses', 'adminAddresses', and 'nodes' properties must have equal length"); this.connectionFactory = new LocalizedQueueConnectionFactory(this.connectionFactory, this.addresses, this.adminAddresses, this.nodes, this.vhost, this.username, this.password); } }

Target:
protected void onInit() { super.onInit(); if (this.clustered) { Assert.state(this.addresses.length == this.adminAddresses.length && this.addresses.length == this.nodes.length, "'addresses', 'adminAddresses', and 'nodes' properties must have equal length"); this.connectionFactory = new LocalizedQueueConnectionFactory(this.connectionFactory, this.addresses, this.adminAddresses, this.nodes, this.vhost, this.username, this.password, this.useSSL, this.sslPropertiesLocation); } }
Source:
public String toString() { return "Added in: " + startCommit.abbreviate(7) + ", Revisions:" + numbers.length; }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append('^'); builder.append(commit.abbreviate(7).name()); builder.append(' ').append('('); PersonIdent author = commit.getAuthorIdent(); builder.append(author.getName()); builder.append(' '); final SimpleDateFormat format; format = new SimpleDateFormat("EEE MMM d HH:mm:ss yyyy Z", Locale.US); format.setTimeZone(author.getTimeZone()); builder.append(format.format(author.getWhen())); builder.append(' '); builder.append(number + 1); builder.append(')'); return builder.toString(); }
Source:
void ctor_v4() { try { AAAARecord ar = new AAAARecord(m_an, DClass.IN, m_ttl, InetAddress.getByName("192.168.1.1")); assertEquals("::ffff:192.168.1.1", ar.rrToString()); } catch (UnknownHostException ignore) { } }

Target:
void ctor_v4() throws UnknownHostException { AAAARecord ar = new AAAARecord(m_an, DClass.IN, m_ttl, InetAddress.getByName("192.168.1.1")); assertEquals("::ffff:192.168.1.1", ar.rrToString()); }
Source:
protected boolean canDoAction() { GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!glusterVolume.isOnline()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); return false; } if (glusterVolume.getAsyncTask() == null || glusterVolume.getAsyncTask().getType() != GlusterTaskType.REBALANCE_VOLUME || glusterVolume.getAsyncTask().getStatus() != JobExecutionStatus.STARTED) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED); return false; } return true; }

Target:
protected boolean canDoAction() { GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (glusterVolume.getAsyncTask() == null || glusterVolume.getAsyncTask().getType() != GlusterTaskType.REBALANCE_VOLUME || glusterVolume.getAsyncTask().getStatus() != JobExecutionStatus.STARTED) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED); return false; } return true; }
Source:
private void updateText() { if (img != null) { if (img.isDeleted()) { putValue(NAME, tr("Undelete Image")); putValue(SHORT_DESCRIPTION, tr("Unmark whole imguence for deletion ")); } else { putValue(NAME, tr("Delete Image")); putValue(SHORT_DESCRIPTION, tr("Mark whole imguence for deletion ")); } } else { putValue(NAME, tr("Delete Image")); putValue(SHORT_DESCRIPTION, tr("Mark whole imguence for deletion ")); } }

Target:
private void updateText() { if (img != null) { if (img.isDeleted()) { putValue(NAME, tr("Undelete Image")); putValue(SHORT_DESCRIPTION, tr("Unmark image for deletion")); } else { putValue(NAME, tr("Delete Image")); putValue(SHORT_DESCRIPTION, tr("Mark image for deletion")); } } else { putValue(NAME, tr("Delete Image")); putValue(SHORT_DESCRIPTION, tr("Mark image for deletion")); } }
Source:
public boolean canDecode(final String path) { final String toDecode; if (AbstractFeatureReader.hasBlockCompressedExtension(path)) { toDecode = path.substring(0, path.lastIndexOf(".")); } else { toDecode = path; } return toDecode.toLowerCase().endsWith(".bed"); }

Target:
public boolean canDecode(final String path) { final String toDecode; if (AbstractFeatureReader.hasBlockCompressedExtension(path)) { toDecode = path.substring(0, path.lastIndexOf(".")); } else { toDecode = path; } return toDecode.toLowerCase().endsWith(BED_EXTENSION); }
Source:
public void onLogout() { AsyncQuery query = new AsyncQuery(); query.setHandleFailure(true); query.setModel(this); query.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { if (clientAgentType.isIE8OrBelow()) { Window.Location.reload(); } frontend.clearLoggedInUser(); ApplicationInit.super.performLogout(); connectAutomaticallyManager.resetAlreadyOpened(); } }; frontend.logoffAsync(frontend.getLoggedInUser(), query); }

Target:
public void onLogout() { AsyncQuery query = new AsyncQuery(); query.setHandleFailure(true); query.setModel(this); query.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { if (clientAgentType.isIE8OrBelow()) { Window.Location.reload(); } frontend.clearLoggedInUser(); performLogout(); connectAutomaticallyManager.resetAlreadyOpened(); } }; frontend.logoffAsync(frontend.getLoggedInUser(), query); }
Source:
public void tearDown() { if (morphline != null) { Notifications.notifyShutdown(morphline); Notifications.notifyShutdown(morphline); morphline = null; } }

Target:
public void tearDown() throws Exception { if (morphline != null) { Notifications.notifyShutdown(morphline); Notifications.notifyShutdown(morphline); morphline = null; } super.tearDown(); }
Source:
protected EditPart getPartForElement(EditPart context, Object modelElement) { if (modelElement instanceof FBNetwork) { CompositeNetworkEditPart compositeNetEP = new CompositeNetworkEditPart() { @Override protected void createEditPolicies() { installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new SubAppTypeFBNetworkLayoutEditPolicy()); } }; return compositeNetEP; } if (modelElement instanceof SubApp) { return new SubAppForFBNetworkEditPart(zoomManager); } return super.getPartForElement(context, modelElement); }

Target:
protected EditPart getPartForElement(EditPart context, Object modelElement) { if (modelElement instanceof FBNetwork) { TypedSubAppNetworkEditPart compositeNetEP = new TypedSubAppNetworkEditPart(); return compositeNetEP; } if (modelElement instanceof SubApp) { return new SubAppForFBNetworkEditPart(zoomManager); } return super.getPartForElement(context, modelElement); }
Source:
public void run() { while (!isShutdown) { if (Thread.currentThread().isInterrupted()) { log.warn("Prefetch thread was interrupted."); callShutdownOnStrategy(); break; } if (prefetchCounters.shouldGetNewRecords()) { try { sleepBeforeNextCall(); GetRecordsResult getRecordsResult = getRecordsRetrievalStrategy.getRecords(maxRecordsPerCall); lastSuccessfulCall = Instant.now(); ProcessRecordsInput processRecordsInput = new ProcessRecordsInput() .withRecords(getRecordsResult.getRecords()) .withMillisBehindLatest(getRecordsResult.getMillisBehindLatest()) .withCacheEntryTime(lastSuccessfulCall); getRecordsResultQueue.put(processRecordsInput); prefetchCounters.added(processRecordsInput); } catch (InterruptedException e) { log.info("Thread was interrupted, indicating shutdown was called on the cache."); callShutdownOnStrategy(); } catch (Throwable e) { log.error("Error was thrown while getting records, please check for the error", e); } } } }

Target:
public void run() { while (!isShutdown) { if (Thread.currentThread().isInterrupted()) { log.warn("Prefetch thread was interrupted."); break; } if (prefetchCounters.shouldGetNewRecords()) { try { sleepBeforeNextCall(); GetRecordsResult getRecordsResult = getRecordsRetrievalStrategy.getRecords(maxRecordsPerCall); lastSuccessfulCall = Instant.now(); ProcessRecordsInput processRecordsInput = new ProcessRecordsInput() .withRecords(getRecordsResult.getRecords()) .withMillisBehindLatest(getRecordsResult.getMillisBehindLatest()) .withCacheEntryTime(lastSuccessfulCall); getRecordsResultQueue.put(processRecordsInput); prefetchCounters.added(processRecordsInput); } catch (InterruptedException e) { log.info("Thread was interrupted, indicating shutdown was called on the cache."); } catch (SdkClientException e) { log.error("Exception thrown while fetching records from Kinesis", e); } catch (Throwable e) { log.error("Unexpected exception was thrown. This could probably be an issue or a bug." + " Please search for the exception/error online to check what is going on. If the " + "issue persists or is a recurring problem, feel free to open an issue on, " + "<LINK_0>", e); } } } callShutdownOnStrategy(); }
Source:
public void onStart(SourceCallback<TestTransactionalConnection, Object> sourceCallback) throws MuleException { connectExecutor = newFixedThreadPool(1, new NamedThreadFactory(TransactionalSource.class.getName())); connectExecutor.execute(() -> { SourceCallbackContext ctx = sourceCallback.createContext(); TransactionHandle txHandle = null; try { TestTransactionalConnection connection = connectionProvider.connect(); boolean isXa = false; if (connection instanceof XATransactionalConnection) { isXa = true; xaResource = (DummyXaResource) ((XATransactionalConnection) connection).getXAResource(); } ctx.addVariable(IS_XA, isXa); txHandle = ctx.bindConnection(connection); sourceCallback.handle(Result.<TestTransactionalConnection, Object>builder().output(connection).build(), ctx); } catch (ConnectionException e) { sourceCallback.onConnectionException(e); } catch (Exception e) { throw new RuntimeException(e); } finally { try { if (txHandle != null) { txHandle.commit(); } } catch (TransactionException e) { throw new RuntimeException(e); } } }); }

Target:
public void onStart(SourceCallback<TestTransactionalConnection, Object> sourceCallback) throws MuleException { connectExecutor = newFixedThreadPool(1, new NamedThreadFactory(TransactionalSource.class.getName())); connectExecutor.execute(() -> { SourceCallbackContext ctx = sourceCallback.createContext(); TransactionHandle txHandle = null; try { TestTransactionalConnection connection = connectionProvider.connect(); boolean isXa = false; if (connection instanceof XATransactionalConnection) { isXa = true; xaResource = (DummyXaResource) ((XATransactionalConnection) connection).getXAResource(); } ctx.addVariable(IS_XA, isXa); txHandle = ctx.bindConnection(connection); sourceCallback.handle(Result.<TestTransactionalConnection, Object>builder().output(connection).build(), ctx); } catch (ConnectionException e) { sourceCallback.onConnectionException(e); } catch (Exception e) { throw new RuntimeException(e); } finally { try { if (txHandle != null) { txHandle.commit(); } } catch (TransactionException e) { try { txHandle.rollback(); } catch (TransactionException e1) { final RuntimeException rollbackException = new RuntimeException(e1); rollbackException.addSuppressed(e); throw rollbackException; } throw new RuntimeException(e); } } }); }
Source:
protected final boolean invariant() { for (Square[] aBoard : board) { for (Square anABoard : aBoard) { if (anABoard == null) { return false; } } } return true; }

Target:
protected final boolean invariant() { for (Square[] row : board) { for (Square square : row) { if (square == null) { return false; } } } return true; }
Source:
public Set<SecurityGroup> listSecurityGroupsForNode(String id) { RegionAndId regionAndId = RegionAndId.fromSlashEncoded(checkNotNull(id, "id")); String region = regionAndId.getRegion(); String instanceId = regionAndId.getId(); Optional<? extends ServerWithSecurityGroupsApi> serverApi = api.getServerWithSecurityGroupsApi(region); SecurityGroupApi securityGroupApi = getSecurityGroupApi(region); ServerWithSecurityGroups instance = serverApi.get().get(instanceId); if (instance == null) { return ImmutableSet.of(); } final FluentIterable<org.jclouds.openstack.neutron.v2.domain.SecurityGroup> allGroups = securityGroupApi.listSecurityGroups().concat(); Location location = locationIndex.get().get(region); return ImmutableSet.copyOf(transform(filter(allGroups, notNull()), neutronSecurityGroupToSecurityGroup.create(location))); }

Target:
public Set<SecurityGroup> listSecurityGroupsForNode(String id) { RegionAndId regionAndId = RegionAndId.fromSlashEncoded(checkNotNull(id, "id")); String region = regionAndId.getRegion(); Location location = locationIndex.get().get(region); Set<org.jclouds.openstack.nova.v2_0.domain.SecurityGroup> allGroups = api.getServerApi(region).listSecurityGroupForServer(regionAndId.getId()); return ImmutableSet.copyOf(transform(filter(allGroups, notNull()), novaSecurityGroupToSecurityGroup.create(location))); }
Source:
public AsyncHBaseAsyncKijiBufferedWriter(AsyncHBaseKijiTable table) throws IOException { mTable = table; mHBClient = table.getHBClient(); mTableName = KijiManagedHBaseTableName .getKijiTableName(mTable.getURI().getInstance(), mTable.getURI().getTable()).toBytes(); try { mHBClient.ensureTableExists(mTableName).join(); } catch (TableNotFoundException e) { throw new KijiTableNotFoundException(table.getURI()); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } mLayoutConsumerRegistration = mTable.registerLayoutConsumer(new InnerLayoutUpdater()); Preconditions.checkState( mWriterLayoutCapsule != null, "AsyncHBaseKijiBufferedWriter for table: %s failed to initialize.", mTable.getURI()); mTable.retain(); synchronized (mInternalLock) { Preconditions.checkState(mState == State.UNINITIALIZED, "Cannot open AsyncHBaseKijiBufferedWriter instance in state %s.", mState); mState = State.OPEN; } }

Target:
private AsyncHBaseAsyncKijiBufferedWriter(AsyncHBaseKijiTable table) throws IOException { mTable = table; mHBClient = table.getHBClient(); mTableName = KijiManagedHBaseTableName .getKijiTableName(mTable.getURI().getInstance(), mTable.getURI().getTable()).toBytes(); try { mHBClient.ensureTableExists(mTableName).join(); } catch (TableNotFoundException e) { throw new KijiTableNotFoundException(table.getURI()); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } mLayoutConsumerRegistration = mTable.registerLayoutConsumer(new InnerLayoutUpdater()); Preconditions.checkState( mWriterLayoutCapsule != null, "AsyncHBaseKijiBufferedWriter for table: %s failed to initialize.", mTable.getURI()); mTable.retain(); synchronized (mInternalLock) { Preconditions.checkState(mState == State.UNINITIALIZED, "Cannot open AsyncHBaseKijiBufferedWriter instance in state %s.", mState); mState = State.OPEN; } DebugResourceTracker.get().registerResource(this); }
Source:
private void checkTimeTypeArgument(MethodInvocationTree mit, Type argType) { if (!(argType.isNumerical() || isOneOf(argType, "java.lang.Long", "java.time.LocalDate") || argType.isSubtypeOf("java.util.Date") || argType.isSubtypeOf("java.util.Calendar"))) { reportIssue(mit, "Time argument is expected (long, Long, LocalDate, Date or Calendar)."); } }

Target:
private void checkTimeTypeArgument(MethodInvocationTree mit, Type argType) { if (!(argType.isNumerical() || isTypeOfAny(argType, "java.lang.Long", "java.time.LocalDate") || isSubtypeOfAny(argType, "java.util.Date", "java.util.Calendar"))) { reportIssue(mit, "Time argument is expected (long, Long, LocalDate, Date or Calendar)."); } }
Source:
public void should_create_sonar_way_profile() { ValidationMessages validation = ValidationMessages.create(); SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(7, 3), SonarQubeSide.SERVER); BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context(); PHPProfileDefinition definition = new PHPProfileDefinition(sonarRuntime); definition.define(context); BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile("php", "Sonar way"); assertThat(profile.language()).isEqualTo(Php.KEY); assertThat(profile.name()).isEqualTo(PHPProfileDefinition.SONAR_WAY_PROFILE); assertThat(profile.rules().size()).isGreaterThan(51); assertThat(profile.rules().size()).isLessThan(CheckList.getAllChecks().size()); assertThat(profile.rules()).extracting("ruleKey").contains("DuplicatedBlocks"); assertThat(validation.hasErrors()).isFalse(); }

Target:
public void should_create_sonar_way_profile() { ValidationMessages validation = ValidationMessages.create(); SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(7, 3), SonarQubeSide.SERVER); BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context(); PHPProfileDefinition definition = new PHPProfileDefinition(sonarRuntime); definition.define(context); BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile("php", "Sonar way"); assertThat(profile.language()).isEqualTo(Php.KEY); assertThat(profile.name()).isEqualTo(PHPProfileDefinition.SONAR_WAY_PROFILE); assertThat(profile.rules().size()).isGreaterThan(50); assertThat(profile.rules().size()).isLessThan(CheckList.getAllChecks().size()); assertThat(profile.rules()).extracting("ruleKey").contains("DuplicatedBlocks"); assertThat(validation.hasErrors()).isFalse(); }
Source:
public PhysicalPlanProvider(SchedulerStateManagerAdaptor stateManagerAdaptor, EventManager eventManager, @Named(CONF_TOPOLOGY_NAME) String topologyName) { this.stateManagerAdaptor = stateManagerAdaptor; this.topologyName = topologyName; eventManager.addEventListener(TopologyUpdate.class, new EventHandler<TopologyUpdate>() { @Override public synchronized void onEvent(TopologyUpdate event) { LOG.info("Received topology update event, invalidating cached PhysicalPlan: " + event); physicalPlan = null; } }); eventManager.addEventListener(ContainerRestart.class, new EventHandler<ContainerRestart>() { @Override public synchronized void onEvent(ContainerRestart event) { LOG.info("Received conatiner restart event, invalidating cached PhysicalPlan: " + event); physicalPlan = null; } }); }

Target:
public PhysicalPlanProvider(SchedulerStateManagerAdaptor stateManagerAdaptor, EventManager eventManager, @Named(CONF_TOPOLOGY_NAME) String topologyName) { this.stateManagerAdaptor = stateManagerAdaptor; this.topologyName = topologyName; eventManager.addEventListener(TopologyUpdate.class, new EventHandler<TopologyUpdate>() { @Override public synchronized void onEvent(TopologyUpdate event) { LOG.info( "Received topology update event, invalidating cached PhysicalPlan: " + event.getName()); physicalPlan = null; } }); eventManager.addEventListener(ContainerRestart.class, new EventHandler<ContainerRestart>() { @Override public synchronized void onEvent(ContainerRestart event) { LOG.info("Received conatiner restart event, invalidating cached PhysicalPlan: " + event.getName()); physicalPlan = null; } }); }
Source:
public static void stopH2O() { if (H2OServerStarted) { H2O.shutdown(0); log.info("H2O Server has shut down"); } else { log.info("H2O Server is not running"); } }

Target:
public static void stopH2O() { if (isH2OServerStarted) { H2O.shutdown(0); isH2OServerStarted = false; log.info("H2O Server has shutdown."); } else { log.warn("H2O server is not started, hence cannot be stopped"); } }
Source:
private void exit() { enableToolbarCommand(toolbar.getVisitGraphToolbarCommand(), visitGraphToolbarCommandEnabled); enableToolbarCommand(toolbar.getClearToolbarCommand(), clearToolbarCommandEnabled); enableToolbarCommand(toolbar.getClearStatesToolbarCommand(), clearStatesToolbarCommandEnabled); enableToolbarCommand(toolbar.getDeleteSelectionToolbarCommand(), deleteSelectionToolbarCommandEnabled); enableToolbarCommand(toolbar.getSwitchGridToolbarCommand(), switchGridToolbarCommandEnabled); enableToolbarCommand(toolbar.getUndoToolbarCommand(), undoToolbarCommandEnabled); enableToolbarCommand(toolbar.getRedoToolbarCommand(), redoToolbarCommandEnabled); enableToolbarCommand(toolbar.getValidateToolbarCommand(), validateToolbarCommandEnabled); enableToolbarCommand(toolbar.getExportToPngToolbarCommand(), exportToPngToolbarCommandEnabled); enableToolbarCommand(toolbar.getExportToJpgToolbarCommand(), exportToJpgToolbarCommandEnabled); enableToolbarCommand(toolbar.getExportToSvgToolbarCommand(), exportToJpgToolbarCommandEnabled); enableToolbarCommand(toolbar.getExportToPdfToolbarCommand(), exportToPdfToolbarCommandEnabled); enableToolbarCommand(toolbar.getCopyToolbarCommand(), copyCommandEnabled); enableToolbarCommand(toolbar.getCutToolbarCommand(), cutCommandEnabled); enableToolbarCommand(toolbar.getPasteToolbarCommand(), pasteCommandEnabled); }

Target:
private void exit() { enableToolbarCommand(toolbar.getVisitGraphToolbarCommand(), visitGraphToolbarCommandEnabled); enableToolbarCommand(toolbar.getClearToolbarCommand(), clearToolbarCommandEnabled); enableToolbarCommand(toolbar.getClearStatesToolbarCommand(), clearStatesToolbarCommandEnabled); enableToolbarCommand(toolbar.getDeleteSelectionToolbarCommand(), deleteSelectionToolbarCommandEnabled); enableToolbarCommand(toolbar.getSwitchGridToolbarCommand(), switchGridToolbarCommandEnabled); enableToolbarCommand(toolbar.getUndoToolbarCommand(), undoToolbarCommandEnabled); enableToolbarCommand(toolbar.getRedoToolbarCommand(), redoToolbarCommandEnabled); enableToolbarCommand(toolbar.getValidateToolbarCommand(), validateToolbarCommandEnabled); enableToolbarCommand(toolbar.getExportToPngToolbarCommand(), exportToPngToolbarCommandEnabled); enableToolbarCommand(toolbar.getExportToJpgToolbarCommand(), exportToJpgToolbarCommandEnabled); enableToolbarCommand(toolbar.getExportToSvgToolbarCommand(), exportToSvgToolbarCommandEnabled); enableToolbarCommand(toolbar.getExportToPdfToolbarCommand(), exportToPdfToolbarCommandEnabled); enableToolbarCommand(toolbar.getCopyToolbarCommand(), copyCommandEnabled); enableToolbarCommand(toolbar.getCutToolbarCommand(), cutCommandEnabled); enableToolbarCommand(toolbar.getPasteToolbarCommand(), pasteCommandEnabled); }
Source:
public String upload(String name, InputStream inputStream, long size) { GcsOutputChannel outputChannel; GcsFileOptions options = new GcsFileOptions.Builder() .mimeType("image/jpeg") .acl("full-control") .build(); GcsFilename fileName = getFileName(name); try { outputChannel = gcsService.createOrReplace(fileName, options); copy(inputStream, Channels.newOutputStream(outputChannel)); } catch (IOException e) { throw new RuntimeException(e); } return getServingUrl(fileName); }

Target:
public String upload(String name, InputStream inputStream, long size) { GcsOutputChannel outputChannel; GcsFileOptions options = new GcsFileOptions.Builder() .acl("public-read") .build(); GcsFilename fileName = getFileName(name); verifyFileExtension(name); try { outputChannel = gcsService.createOrReplace(fileName, options); copy(inputStream, Channels.newOutputStream(outputChannel)); } catch (IOException e) { throw new RuntimeException(e); } return getServingUrl(fileName); }
Source:
private List<MethodMatcher> createMethodMatchers(String rule) { if (rule.length() > 0) { return ImmutableList.of(new MethodMatcher(rule)); } else { return ImmutableList.of(); } }

Target:
private static MethodInvocationMatcherCollection createMethodMatchers(String rule) { if (rule.length() > 0) { return MethodInvocationMatcherCollection.create(MethodMatcherFactory.methodMatcher(rule)); } else { return MethodInvocationMatcherCollection.create(); } }
Source:
public void printHelp(){ logger.info("-------------------"); logger.info("FarmJob help:"); logger.info("-------------------"); logger.info("FarmJob accepts the following parameters:"); logger.info(""); logger.info(" Mandatory:"); logger.info(" -pdbFilePath (mandatory) Path to the directory in your file system that contains the PDB files."); logger.info(" provide either -time or -nrAlignments. If both are provided the job stops as soon as any of the criteria has been reached."); logger.info(" -time maximum number of time to run (in seconds). -1 means no time limit, but run -nrAlignment arguments. Default: " + FarmJobParameters.DEFAULT_JOB_TIME ); logger.info(" -nrAlignments number of alignments to calculate. Default: " + FarmJobParameters.DEFAULT_NR_ALIGNMENTS) ; logger.info(""); logger.info(" Optional: "); logger.info(" -threads number of parallel threads to calculate alignments. Should be nr. of available CPUs. Default: " + FarmJobParameters.DEFAULT_NR_THREADS); logger.info(" -server the location of the server URL to talk to. Default : " + FarmJobParameters.DEFAULT_SERVER_URL); logger.info(" -username a unique name that can be given to this client. Can be used to give credit for who is doing the calculations. Default: IP and a random id"); logger.info(" -stepSize the number of pairs to be requsted from server. Default: " + FarmJobParameters.DEFAULT_BATCH_SIZE); }

Target:
public void printHelp(){ System.out.println("-------------------"); System.out.println("FarmJob help:"); System.out.println("-------------------"); System.out.println("FarmJob accepts the following parameters:"); System.out.println(""); System.out.println(" Mandatory:"); System.out.println(" -pdbFilePath (mandatory) Path to the directory in your file system that contains the PDB files."); System.out.println(" provide either -time or -nrAlignments. If both are provided the job stops as soon as any of the criteria has been reached."); System.out.println(" -time maximum number of time to run (in seconds). -1 means no time limit, but run -nrAlignment arguments. Default: " + FarmJobParameters.DEFAULT_JOB_TIME ); System.out.println(" -nrAlignments number of alignments to calculate. Default: " + FarmJobParameters.DEFAULT_NR_ALIGNMENTS) ; System.out.println(""); System.out.println(" Optional: "); System.out.println(" -threads number of parallel threads to calculate alignments. Should be nr. of available CPUs. Default: " + FarmJobParameters.DEFAULT_NR_THREADS); System.out.println(" -server the location of the server URL to talk to. Default : " + FarmJobParameters.DEFAULT_SERVER_URL); System.out.println(" -username a unique name that can be given to this client. Can be used to give credit for who is doing the calculations. Default: IP and a random id"); System.out.println(" -stepSize the number of pairs to be requsted from server. Default: " + FarmJobParameters.DEFAULT_BATCH_SIZE); }
Source:
public boolean onClusterClick(Cluster<TiClusterMarker> cluster) { LatLngBounds.Builder builder = LatLngBounds.builder(); for (TiClusterMarker item : cluster.getItems()) { builder.include(item.getPosition()); } final LatLngBounds bounds = builder.build(); if (map != null) { try { map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100)); } catch (Exception e) } return true; }

Target:
public boolean onClusterClick(Cluster<TiClusterMarker> cluster) { LatLngBounds.Builder builder = LatLngBounds.builder(); for (TiClusterMarker item : cluster.getItems()) { builder.include(item.getPosition()); } final LatLngBounds bounds = builder.build(); if (map != null) { try { map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100)); } catch (Exception e) { e.printStackTrace(); } } return true; }