auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RequestCodes.CRED_SAVE_FLOW) { finish(resultCode, data); } if (resultCode == ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT) { finish(resultCode, data); } }

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RequestCodes.CRED_SAVE_FLOW || resultCode == ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT) { finish(resultCode, data); } }
Source:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (cachedResult == null) { BigDecimal ssd = sumSquaredDeviation(); ssd = ssd.divide(new BigDecimal(getDataPointsCount()), MathContext.DECIMAL128); cachedResult = new BigDecimal(Math.sqrt(ssd.doubleValue())); } if (buffer == null) { initBuffer(); } buffer = PDataType.DECIMAL.toBytes(cachedResult); ptr.set(buffer); return true; }

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (cachedResult == null) { BigDecimal ssd = sumSquaredDeviation(); ssd = ssd.divide(new BigDecimal(getDataPointsCount()), PDataType.DEFAULT_MATH_CONTEXT); int resultPrecision = colPrecision; for (int i = 1; i < this.totalCount; i++) { if (resultPrecision >= PDataType.MAX_PRECISION) break; Pair<Integer, Integer> precisionScale = BigDecimalUtil.getResultPrecisionScale(this.colPrecision, this.colScale, this.colPrecision, this.colScale, Operation.OTHERS); resultPrecision = precisionScale.getFirst(); } cachedResult = new BigDecimal(Math.sqrt(ssd.doubleValue()), new MathContext(resultPrecision, RoundingMode.HALF_UP)); cachedResult.setScale(this.colScale, RoundingMode.HALF_UP); } if (buffer == null) { initBuffer(); } buffer = PDataType.DECIMAL.toBytes(cachedResult); ptr.set(buffer); return true; }
Source:
public RepoObjectMetadata getArticleItemFile(ArticleFileIdentifier fileId) { ArticleItem work = articleCrudService.getArticleItem(fileId.getItemIdentifier()); String fileType = fileId.getFileType(); ArticleFile articleFile = work.getFile(fileType) .orElseThrow(() -> new RestClientException("Unrecognized type: " + fileType, HttpStatus.NOT_FOUND)); try { return contentRepoService.getRepoObjectMetadata(articleFile.getCrepoVersion()); } catch (NotFoundException e) { throw new RestClientException("Object not found: " + fileId, HttpStatus.NOT_FOUND); } }

Target:
public RepoObjectMetadata getArticleItemFile(ArticleFileIdentifier fileId) { ArticleItem work = articleCrudService.getArticleItem(fileId.getItemIdentifier()); String fileType = fileId.getFileType(); ArticleFile articleFile = work.getFile(fileType) .orElseThrow(() -> new RestClientException("Unrecognized type: " + fileType, HttpStatus.NOT_FOUND)); try { return contentRepoService.getRepoObjectMetadata(articleFile.getCrepoVersion()); } catch (NotFoundException e) { throw new RestClientException("Object not found: " + fileId + ". File info: " + articleFile, HttpStatus.NOT_FOUND); } }
Source:
public File saveData(String filename) { IPath newDataLoc = getNewDataLocation(filename, DATA_EXT); IPath defaultDataLoc = PerfPlugin.getDefault().getPerfProfileData(); File newDataFile = new File(newDataLoc.toOSString()); File defaultDataFile = defaultDataLoc.toFile(); if (canSave(newDataFile)) { try { newDataFile.createNewFile(); if (copyFile(defaultDataFile, newDataFile)) { PerfPlugin.getDefault().setPerfProfileData(newDataLoc); PerfPlugin.getDefault().getProfileView() .setContentDescription(newDataLoc.toOSString()); return newDataFile; } else { openErroDialog(Messages.PerfSaveSession_failure_title, Messages.PerfSaveSession_failure_msg, newDataLoc.lastSegment()); } } catch (IOException e) { openErroDialog(Messages.PerfSaveSession_failure_title, Messages.PerfSaveSession_failure_msg, newDataLoc.lastSegment()); } } return null; }

Target:
public File saveData(String filename) { IPath newDataLoc = getNewDataLocation(filename, DATA_EXT); IPath defaultDataLoc = PerfPlugin.getDefault().getPerfProfileData(); File newDataFile = new File(newDataLoc.toOSString()); File defaultDataFile = defaultDataLoc.toFile(); if (canSave(newDataFile)) { try { newDataFile.createNewFile(); copyFile(defaultDataFile, newDataFile); PerfPlugin.getDefault().setPerfProfileData(newDataLoc); PerfPlugin.getDefault().getProfileView() .setContentDescription(newDataLoc.toOSString()); return newDataFile; } catch (IOException e) { openErroDialog(Messages.PerfSaveSession_failure_title, Messages.PerfSaveSession_failure_msg, newDataLoc.lastSegment()); } } return null; }
Source:
public Map<Errors, Integer> errorCounts() { return errorCounts(data.topics().stream() .flatMap(topic -> topic.partitions().stream()) .map(partition -> Errors.forCode(partition.errorCode()))); }

Target:
public Map<Errors, Integer> errorCounts() { return errorCounts(data.topics().stream().flatMap(topic -> topic.partitions().stream().map(partition -> Errors.forCode(partition.errorCode())))); }
Source:
public List<RelationKey> getMatchingRelationKeys(final String searchTerm) throws CatalogException { if (isClosed) { throw new CatalogException("Catalog is closed."); } final String expandedSearchTerm = '%' + Joiner.on("%").join(Splitter.fixedLength(1).split(searchTerm.toLowerCase())) + '%'; try { return queue.execute(new SQLiteJob<List<RelationKey>>() { @Override protected List<RelationKey> job(final SQLiteConnection sqliteConnection) throws CatalogException, SQLiteException { try { SQLiteStatement statement = sqliteConnection.prepare("SELECT user_name, program_name, relation_name FROM relations " + "WHERE lower(user_name || ':' || program_name || ':' || relation_name) LIKE ? AND tombstone=0"); statement.bind(1, expandedSearchTerm); ImmutableList.Builder<RelationKey> result = ImmutableList.builder(); while (statement.step()) { String userName = statement.columnString(0); String programName = statement.columnString(1); String relationName = statement.columnString(2); result.add(new RelationKey(userName, programName, relationName)); } statement.dispose(); return result.build(); } catch (final SQLiteException e) { throw new CatalogException(e); } } }).get(); } catch (InterruptedException | ExecutionException e) { if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } throw new CatalogException(e); } }

Target:
public List<RelationKey> getMatchingRelationKeys(final String searchTerm) throws CatalogException { if (isClosed) { throw new CatalogException("Catalog is closed."); } final String expandedSearchTerm = '%' + Joiner.on("%").join(Splitter.fixedLength(1).split(searchTerm.toLowerCase())) + '%'; try { return queue.execute(new SQLiteJob<List<RelationKey>>() { @Override protected List<RelationKey> job(final SQLiteConnection sqliteConnection) throws CatalogException, SQLiteException { try { SQLiteStatement statement = sqliteConnection.prepare("SELECT user_name, program_name, relation_name FROM relations " + "WHERE lower(user_name || ':' || program_name || ':' || relation_name) LIKE ? AND is_deleted=0"); statement.bind(1, expandedSearchTerm); ImmutableList.Builder<RelationKey> result = ImmutableList.builder(); while (statement.step()) { String userName = statement.columnString(0); String programName = statement.columnString(1); String relationName = statement.columnString(2); result.add(new RelationKey(userName, programName, relationName)); } statement.dispose(); return result.build(); } catch (final SQLiteException e) { throw new CatalogException(e); } } }).get(); } catch (InterruptedException | ExecutionException e) { throw new CatalogException(e); } }
Source:
public static String getDeleteTabletOnAllVolumesUri(TableId tableId, String dirName) { if (dirName.contains(Path.SEPARATOR)) { throw new IllegalArgumentException("invalid dir name " + dirName); } return ALL_VOLUMES_PREFIX + ServerConstants.TABLE_DIR + Path.SEPARATOR + tableId + Path.SEPARATOR + dirName; }

Target:
public static String getDeleteTabletOnAllVolumesUri(TableId tableId, String dirName) { ServerColumnFamily.validateDirCol(dirName); return ALL_VOLUMES_PREFIX + ServerConstants.TABLE_DIR + Path.SEPARATOR + tableId + Path.SEPARATOR + dirName; }
Source:
public void internalReceiveCommand(String itemName, Command command) { logger.trace("internalReceiveCommand({},{}) called.", itemName, command.toString()); if (this.eventPublisher == null) { logger.error("internalReceiveCommand(): eventPublisher is NULL. Should NEVER occur."); return; } VeluxBindingConfig itemConfig = this.bindingProvider.getConfigForItemName(itemName); VeluxItemType itemType = itemConfig.getBindingItemType(); if (itemType.isWritable() || itemType.isExecutable()) { logger.trace("internalReceiveCommand() is about to send update to item {}.", itemName); for (VeluxBindingProvider provider : providers) { logger.trace("internalReceiveCommand() working with VeluxBindingProvider {}.", provider); bridgeHandler.handleCommandOnChannel(itemName, command, itemConfig, provider, this.eventPublisher); } } else { logger.warn("internalReceiveCommand() ignoring command to item as neither writable nor executable.", itemName); } logger.trace("internalReceiveCommand() done."); }

Target:
public void internalReceiveCommand(String itemName, Command command) { logger.trace("internalReceiveCommand({},{}) called.", itemName, command.toString()); if (this.eventPublisher == null) { logger.warn("internalReceiveCommand(): eventPublisher is NULL. Should NEVER occur."); return; } VeluxBindingConfig itemConfig = this.bindingProvider.getConfigForItemName(itemName); VeluxItemType itemType = itemConfig.getBindingItemType(); if (itemType.isWritable() || itemType.isExecutable()) { logger.trace("internalReceiveCommand() is about to send update to item {}.", itemName); for (VeluxBindingProvider provider : providers) { logger.trace("internalReceiveCommand() working with VeluxBindingProvider {}.", provider); bridgeHandler.handleCommandOnChannel(itemName, command, itemConfig, provider, this.eventPublisher); } } else { logger.warn("internalReceiveCommand() ignoring command to item as neither writable nor executable.", itemName); } logger.trace("internalReceiveCommand() done."); }
Source:
public CustomSpinnerAdapter(Context context, ArrayList<Long> speedList) { super(context, R.layout.spinner_item_layout, speedList); mContext = context; mSpeedList = speedList; mInflater = LayoutInflater.from(mContext); }

Target:
public CustomSpinnerAdapter(Context context, ArrayList<Long> speedList) { super(context, R.layout.spinner_item_layout, speedList); mInflater = LayoutInflater.from(getContext()); }
Source:
public void sendPhoneVerificationToken(Study study, String userId, Phone phone) { checkNotNull(study); checkArgument(isNotBlank(userId)); if (phone == null) { return; } if (isRequestThrottled(ThrottleRequestType.VERIFY_PHONE, userId)) { return; } String sptoken = getNextToken(); String formattedSpToken = sptoken.substring(0,3) + "-" + sptoken.substring(3,6); SmsMessageProvider provider = new SmsMessageProvider.Builder() .withStudy(study) .withToken("sptoken", formattedSpToken) .withSmsTemplate(study.getVerifyPhoneSmsTemplate()) .withExpirationPeriod(PHONE_VERIFICATION_EXPIRATION_PERIOD, VERIFY_OR_RESET_EXPIRE_IN_SECONDS) .withPhone(phone).build(); notificationsService.sendSMSMessage(provider); }

Target:
public void sendPhoneVerificationToken(Study study, String userId, Phone phone) { checkNotNull(study); checkArgument(isNotBlank(userId)); if (phone == null) { return; } if (isRequestThrottled(ThrottleRequestType.VERIFY_PHONE, userId)) { return; } String sptoken = getNextToken(); saveVerification(sptoken, new VerificationData(study.getIdentifier(), ChannelType.PHONE, userId)); String formattedSpToken = sptoken.substring(0,3) + "-" + sptoken.substring(3,6); SmsMessageProvider provider = new SmsMessageProvider.Builder() .withStudy(study) .withToken("sptoken", formattedSpToken) .withSmsTemplate(study.getVerifyPhoneSmsTemplate()) .withExpirationPeriod(PHONE_VERIFICATION_EXPIRATION_PERIOD, VERIFY_OR_RESET_EXPIRE_IN_SECONDS) .withPhone(phone).build(); notificationsService.sendSMSMessage(provider); }
Source:
public void setIpv6BootProtocol(Ipv6BootProtocol ipv6BootProtocol) { this.ipv6BootProtocol = ipv6BootProtocol; }

Target:
public void setIpv6BootProtocol(Ipv6BootProtocol ipv6BootProtocol) { this.ipv6BootProtocol = (ipv6BootProtocol == null) ? Ipv6BootProtocol.NONE : ipv6BootProtocol; }
Source:
public DataSet<LocatedRow> getDataSet(DataSetProcessor dsp) throws StandardException{ if(statusDirectory != null) { dsp.setPermissive(statusDirectory, getVTIFileName(), failBadRecordCount); } DataSet set=source.getDataSet(dsp); OperationContext operationContext=dsp.createOperationContext(this); ExecRow execRow=getExecRowDefinition(); int[] execRowTypeFormatIds=WriteReadUtils.getExecRowTypeFormatIds(execRow); if(insertMode.equals(InsertNode.InsertMode.UPSERT) && pkCols==null) throw ErrorState.UPSERT_NO_PRIMARY_KEYS.newException(""+heapConglom+""); TxnView txn=getCurrentTransaction(); operationContext.pushScope(); try{ if(statusDirectory!=null) { dsp.setSchedulerPool("import"); if (txn instanceof ActiveWriteTxn) { ActiveWriteTxn activeWriteTxn = (ActiveWriteTxn) txn; activeWriteTxn.setAdditive(true); } else if (txn instanceof WritableTxn) { WritableTxn writableTxn = (WritableTxn)txn; writableTxn.setAdditive(true); } } PairDataSet dataSet=set.index(new InsertPairFunction(operationContext),true); DataSetWriter writer=dataSet.insertData(operationContext) .autoIncrementRowLocationArray(autoIncrementRowLocationArray) .execRowDefinition(getExecRowDefinition()) .execRowTypeFormatIds(execRowTypeFormatIds) .sequences(spliceSequences) .isUpsert(insertMode.equals(InsertNode.InsertMode.UPSERT)) .pkCols(pkCols) .tableVersion(tableVersion) .destConglomerate(heapConglom) .operationContext(operationContext) .txn(txn) .build(); return writer.write(); }finally{ operationContext.popScope(); } }

Target:
public DataSet<LocatedRow> getDataSet(DataSetProcessor dsp) throws StandardException{ if(statusDirectory != null) { dsp.setPermissive(statusDirectory, getVTIFileName(), failBadRecordCount); } DataSet set=source.getDataSet(dsp); OperationContext operationContext=dsp.createOperationContext(this); ExecRow execRow=getExecRowDefinition(); int[] execRowTypeFormatIds=WriteReadUtils.getExecRowTypeFormatIds(execRow); if(insertMode.equals(InsertNode.InsertMode.UPSERT) && pkCols==null) throw ErrorState.UPSERT_NO_PRIMARY_KEYS.newException(""+heapConglom+""); TxnView txn=getCurrentTransaction(); operationContext.pushScope(); try{ if(statusDirectory!=null) dsp.setSchedulerPool("import"); PairDataSet dataSet=set.index(new InsertPairFunction(operationContext),true); DataSetWriter writer=dataSet.insertData(operationContext) .autoIncrementRowLocationArray(autoIncrementRowLocationArray) .execRowDefinition(getExecRowDefinition()) .execRowTypeFormatIds(execRowTypeFormatIds) .sequences(spliceSequences) .isUpsert(insertMode.equals(InsertNode.InsertMode.UPSERT)) .pkCols(pkCols) .tableVersion(tableVersion) .destConglomerate(heapConglom) .operationContext(operationContext) .txn(txn) .build(); return writer.write(); }finally{ operationContext.popScope(); } }
Source:
public static void main(String[] args) { if (args.length != 1) { System.err .println("usage: java edu.illinois.cs.cogcomp.lbj.pos.POSTagTokenized <text file>"); System.exit(1); } String testingFile = args[0]; POSTagger tagger = new POSTagger(); Parser parser = new ColumnFormat(testingFile); String sentence = ""; for (String[] s = (String[]) parser.next(); s != null; s = (String[]) parser.next()) { Token first = null; if (s.length > 0) { Token t = first = new Token(new Word(s[0]), null, null); for (int i = 1; i < s.length; ++i) { t.next = new Token(new Word(s[i]), t, null); t = (Token) t.next; } } for (Token word = first; word != null; word = (Token) word.next) { String tag = tagger.discreteValue(word); sentence += " (" + tag + " " + word.form + ")"; } logger.info(sentence.substring(1)); } }

Target:
public static void main(String[] args) { if (args.length != 1) { System.err .println("usage: java edu.illinois.cs.cogcomp.lbj.pos.POSTagTokenized <text file>"); System.exit(1); } String testingFile = args[0]; POSTagger tagger = new POSTagger(); Parser parser = new ColumnFormat(testingFile); String sentence = ""; for (String[] s = (String[]) parser.next(); s != null; s = (String[]) parser.next()) { Token first = null; if (s.length > 0) { Token t = first = new Token(new Word(s[0]), null, null); for (int i = 1; i < s.length; ++i) { t.next = new Token(new Word(s[i]), t, null); t = (Token) t.next; } } for (Token word = first; word != null; word = (Token) word.next) { String tag = tagger.discreteValue(word); sentence += " (" + tag + " " + word.form + ")"; } System.out.println(sentence.substring(1)); } }
Source:
private Integer getAutoMaxBandwidthForCluster(Guid clusterId) { Integer qosBandwidth = getQosBandwidth(clusterId); if (qosBandwidth != null) { return qosBandwidth; } Integer linkSpeedBandwidth = getLinkSpeedBandwidth(clusterId); return linkSpeedBandwidth; }

Target:
private Integer getAutoMaxBandwidthForCluster(Guid clusterId) { Integer qosBandwidth = getQosBandwidth(clusterId); if (qosBandwidth != null) { return qosBandwidth; } return getLinkSpeedBandwidth(clusterId); }
Source:
public void forEach(MultimapAggregationStateConsumer consumer) { BlockBuilder keyBlockBuilder = keyBlockBuilders.get(getGroupId()); BlockBuilder valueBlockBuilder = valueBlockBuilders.get(getGroupId()); for (int i = 0; !isEmpty() && keyBlockBuilder != null && i < keyBlockBuilder.getPositionCount(); i++) { consumer.accept(keyBlockBuilder, valueBlockBuilder, i); } }

Target:
public void forEach(MultimapAggregationStateConsumer consumer) { BlockBuilder keyBlockBuilder = keyBlockBuilders.get(getGroupId()); BlockBuilder valueBlockBuilder = valueBlockBuilders.get(getGroupId()); if (keyBlockBuilder == null) { return; } for (int i = 0; i < keyBlockBuilder.getPositionCount(); i++) { consumer.accept(keyBlockBuilder, valueBlockBuilder, i); } }
Source:
public String insert(@RequestBody(required = true) JaxbRule rule) { long priority = rule.getPriority() == null ? 0 : rule.getPriority().longValue(); if (adminService.getRuleByPriority(priority) != null) { adminService.shift(priority, 1); } Long id = adminService.insert(rule.toRule()); if (rule.getLimits() != null && rule.getAccess().equals("LIMIT")) { adminService.setLimits(id, rule.getLimits().toRuleLimits(null)); } if (rule.getLayerDetails() != null && !rule.getAccess().equals("LIMIT")) { adminService.setDetails(id, rule.getLayerDetails().toLayerDetails(null)); } HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.TEXT_PLAIN); return String.valueOf(id); }

Target:
public String insert(@RequestBody(required = true) JaxbRule rule) { long priority = rule.getPriority() == null ? 0 : rule.getPriority().longValue(); if (adminService.getRuleByPriority(priority) != null) { adminService.shift(priority, 1); } Long id = adminService.insert(rule.toRule()); if (rule.getLimits() != null && rule.getAccess().equals("LIMIT")) { adminService.setLimits(id, rule.getLimits().toRuleLimits(null)); } if (rule.getLayerDetails() != null && !rule.getAccess().equals("LIMIT")) { adminService.setDetails(id, rule.getLayerDetails().toLayerDetails(null)); } return String.valueOf(id); }
Source:
public void verifyContainsElement(By childBy) { List<WebElement> elements = browser.driver.findElements(childBy); assertFalse(elements.isEmpty()); }

Target:
public void verifyContainsElement(By childBy) { assertFalse(browser.driver.findElements(childBy).isEmpty()); }
Source:
public List<Resource> getAssignedResources(PerunSession sess, User user) throws InternalErrorException { try { return jdbc.query("select distinct " + resourceMappingSelectQuery + " from resources join groups_resources on resources.id=groups_resources.resource_id " + " join groups on groups_resources.group_id=groups.id" + " join groups_members on groups.id=groups_members.group_id " + " join members on groups_members.member_id=members.id " + " where members.user_id=?", RESOURCE_MAPPER, user.getId()); } catch (EmptyResultDataAccessException e) { return new ArrayList<>(); } catch (RuntimeException e) { throw new InternalErrorException(e); } }

Target:
public List<Resource> getAssignedResources(PerunSession sess, User user) { try { return jdbc.query("select distinct " + resourceMappingSelectQuery + " from resources" + " join groups_resources on resources.id=groups_resources.resource_id " + " join groups on groups_resources.group_id=groups.id" + " join groups_members on groups.id=groups_members.group_id " + " join members on groups_members.member_id=members.id " + " where members.user_id=?", RESOURCE_MAPPER, user.getId()); } catch (RuntimeException e) { throw new InternalErrorException(e); } }
Source:
void registerFlashMessageCallback(final DataTypeFlashMessage flashMessage) { switch (flashMessage.getType()) { case ERROR: break; case WARNING: warningCallback = flashMessage.getOnSuccess(); break; } }

Target:
void registerFlashMessageCallback(final DataTypeFlashMessage flashMessage) { switch (flashMessage.getType()) { case ERROR: break; case WARNING: warningSuccessCallback = flashMessage.getOnSuccess(); warningErrorCallback = flashMessage.getOnError(); break; } }
Source:
public ExecutorServiceBuilder maxPoolSize(int maxPoolSize) { if (maxPoolSize < corePoolSize) { throw new IllegalArgumentException("maxPoolSize must be greater then corePoolSize"); } this.maxPoolSize = maxPoolSize; return this; }

Target:
public ExecutorServiceBuilder maxPoolSize(int maxPoolSize) { if (maxPoolSize < corePoolSize) { throw new IllegalArgumentException("maxPoolSize must be greater than corePoolSize"); } this.maxPoolSize = maxPoolSize; return this; }
Source:
public TaskResult runTask(@NotNull TaskContext taskContext) { Build build; if (npmBuildContext.isNpmCommandInstall()) { build = executeNpmInstall(); } else { build = executeNpmPublish(); } if (build == null) { return failRun(taskContext); } buildInfoHelper.addEnvVarsToBuild(npmBuildContext, build); if (npmBuildContext.isCaptureBuildInfo()) { buildFromTask = build; } Map<String, String> customBuildData = taskContext.getBuildContext().getBuildResult().getCustomBuildData(); if (!customBuildData.containsKey(BUILD_RESULT_COLLECTION_ACTIVATED_PARAM)) { customBuildData.put(BUILD_RESULT_COLLECTION_ACTIVATED_PARAM, "true"); } return TaskResultBuilder.newBuilder(taskContext).success().build(); }

Target:
public TaskResult runTask(@NotNull TaskContext taskContext) { Build build; if (npmBuildContext.isNpmCommandInstall()) { build = executeNpmInstall(); } else { build = executeNpmPublish(); } if (build == null) { return failRun(taskContext); } if (npmBuildContext.isCaptureBuildInfo()) { buildInfoHelper.addEnvVarsToBuild(npmBuildContext, build); taskBuildInfo = build; } Map<String, String> customBuildData = taskContext.getBuildContext().getBuildResult().getCustomBuildData(); if (!customBuildData.containsKey(BUILD_RESULT_COLLECTION_ACTIVATED_PARAM)) { customBuildData.put(BUILD_RESULT_COLLECTION_ACTIVATED_PARAM, "true"); } return TaskResultBuilder.newBuilder(taskContext).success().build(); }
Source:
private CompositeByteBuf addComponents(boolean increaseIndex, int cIndex, Iterable<ByteBuf> buffers) { if (buffers instanceof ByteBuf) { return addComponent(increaseIndex, cIndex, (ByteBuf) buffers); } checkNotNull(buffers, "buffers"); Iterator<ByteBuf> it = buffers.iterator(); try { checkComponentIndex(cIndex); for (ByteBuf b; it.hasNext() && (b = it.next()) != null;) { cIndex = addComponent0(increaseIndex, cIndex, b) + 1; cIndex = Math.min(cIndex, componentCount); } } finally { while (it.hasNext()) { ReferenceCountUtil.safeRelease(it.next()); } } consolidateIfNeeded(); return this; }

Target:
private CompositeByteBuf addComponents(boolean increaseIndex, int cIndex, Iterable<ByteBuf> buffers) { if (buffers instanceof ByteBuf) { return addComponent(increaseIndex, cIndex, (ByteBuf) buffers); } checkNotNull(buffers, "buffers"); Iterator<ByteBuf> it = buffers.iterator(); try { checkComponentIndex(cIndex); while (it.hasNext()) { ByteBuf b = it.next(); if (b == null) { break; } cIndex = addComponent0(increaseIndex, cIndex, b) + 1; cIndex = Math.min(cIndex, componentCount); } } finally { while (it.hasNext()) { ReferenceCountUtil.safeRelease(it.next()); } } consolidateIfNeeded(); return this; }
Source:
protected void startDebugging(OpenShiftServerBehaviour behaviour, DebugContext context, IProgressMonitor monitor) { IDebugListener listener = new IDebugListener() { @Override public void onDebugChange(DebugContext context, IProgressMonitor monitor) throws CoreException { int localPort = mapPortForwarding(context, monitor); IServer server = behaviour.getServer(); ILaunch debuggerLaunch = attachRemoteDebugger(server, localPort, monitor); if (debuggerLaunch != null) { overrideHotcodeReplace(server, debuggerLaunch); } } @Override public void onPodRestart(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException { onDebugChange(debuggingContext, monitor); } }; context.setDebugListener(listener); OpenShiftDebugMode.enableDebugging(context, monitor); }

Target:
protected void startDebugging(OpenShiftServerBehaviour behaviour, DebugContext context, IProgressMonitor monitor) { IDebugListener listener = new IDebugListener() { @Override public void onDebugChange(DebugContext context, IProgressMonitor monitor) throws CoreException { int localPort = mapPortForwarding(context, monitor); IServer server = behaviour.getServer(); ILaunch debuggerLaunch = attachRemoteDebugger(server, localPort, monitor); if (debuggerLaunch != null) { overrideHotcodeReplace(server, debuggerLaunch); } } @Override public void onPodRestart(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException { onDebugChange(debuggingContext, monitor); } }; context.setDebugListener(listener); OpenShiftDebugMode.enableDebugging(context); }
Source:
public void limit_asSubQuery() { realm.executeTransaction(r -> { for (int i = 0; i < 5; i++) { r.createObject(AllTypes.class).setColumnLong(i % 5); } }); RealmResults<AllTypes> results = realm.where(AllTypes.class) .sort(AllTypes.FIELD_LONG, Sort.DESCENDING) .findAll() .where() .distinct(AllTypes.FIELD_LONG) .findAll() .where() .limit(2) .findAll(); assertEquals(2, results.size()); assertEquals(4, results.first().getColumnLong()); assertEquals(3, results.last().getColumnLong()); }

Target:
public void limit_asSubQuery() { realm.executeTransaction(r -> { for (int i = 0; i < 10; i++) { r.createObject(AllTypes.class).setColumnLong(i % 5); } }); RealmResults<AllTypes> results = realm.where(AllTypes.class) .sort(AllTypes.FIELD_LONG, Sort.DESCENDING) .findAll() .where() .distinct(AllTypes.FIELD_LONG) .findAll() .where() .limit(2) .findAll(); assertEquals(2, results.size()); assertEquals(4, results.first().getColumnLong()); assertEquals(3, results.last().getColumnLong()); }
Source:
private static String toString(InputStream is) { try { return new String(ByteStreams.toByteArray(is)); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
private static String toString(InputStream is) { try { return new String(ByteStreams.toByteArray(is), StandardCharsets.UTF_8); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
private boolean isValidReviewer(Account member, ChangeControl control) { if (member.isActive()) { IdentifiedUser user = identifiedUserFactory.create(member.getId()); if (control.forUser(user).isRefVisible()) { return true; } } return false; }

Target:
private boolean isValidReviewer(Account member, ChangeControl control) { if (member.isActive()) { IdentifiedUser user = identifiedUserFactory.create(member.getId()); return control.forUser(user).isRefVisible(); } return false; }
Source:
public void render(){ System.out.println("Rendering Path "+toString()); for(Node n:nodes){ MojamComponent.screen.alphaFill((int)n.pos.x, (int)n.pos.y, Tile.WIDTH, Tile.HEIGHT, 0x00ccff, 0x10); } }

Target:
public void render(){ for(Node n:nodes){ MojamComponent.screen.alphaFill((int)n.pos.x, (int)n.pos.y, Tile.WIDTH, Tile.HEIGHT, 0x00ccff, 0x10); } }
Source:
private void markReachable(final Set<ObjectId> have, final int maxTime) throws IOException { for (final Ref r : local.getRefDatabase().getRefsByPrefix(ALL)) { ObjectId id = r.getPeeledObjectId(); if (id == null) id = r.getObjectId(); if (id == null) continue; parseReachable(id); } for (ObjectId id : local.getAdditionalHaves()) parseReachable(id); for (ObjectId id : have) parseReachable(id); if (maxTime > 0) { final Date maxWhen = new Date(maxTime * 1000L); walk.sort(RevSort.COMMIT_TIME_DESC); walk.markStart(reachableCommits); walk.setRevFilter(CommitTimeRevFilter.after(maxWhen)); for (;;) { final RevCommit c = walk.next(); if (c == null) break; if (c.has(ADVERTISED) && !c.has(COMMON)) { c.add(COMMON); c.carry(COMMON); reachableCommits.add(c); } } } }

Target:
private void markReachable(final Set<ObjectId> have, final int maxTime) throws IOException { for (Ref r : local.getRefDatabase().getRefsByPrefix(ALL)) { ObjectId id = r.getPeeledObjectId(); if (id == null) id = r.getObjectId(); if (id == null) continue; parseReachable(id); } for (ObjectId id : local.getAdditionalHaves()) parseReachable(id); for (ObjectId id : have) parseReachable(id); if (maxTime > 0) { final Date maxWhen = new Date(maxTime * 1000L); walk.sort(RevSort.COMMIT_TIME_DESC); walk.markStart(reachableCommits); walk.setRevFilter(CommitTimeRevFilter.after(maxWhen)); for (;;) { final RevCommit c = walk.next(); if (c == null) break; if (c.has(ADVERTISED) && !c.has(COMMON)) { c.add(COMMON); c.carry(COMMON); reachableCommits.add(c); } } } }
Source:
public static Map<String, Object> optionsAsMap(List<Option> options) { Map<String, Object> map = new LinkedHashMap<String, Object>(); for (Option option : options) { String name = option.getName(); Object value = option.getValue(); if (value instanceof String || value instanceof List) { map.put(name, value); } else if (value instanceof Option) { Map<String, Object> newMap = optionsAsMap(Arrays.asList((Option) value)); Object oldValue = map.get(name); if (oldValue instanceof Map) { Map<String, Object> oldMap = (Map<String, Object>) oldValue; for (Map.Entry<String, Object> entry : newMap.entrySet()) { oldMap.put(entry.getKey(), entry.getValue()); } } else { map.put(name, newMap); } } else if (value instanceof Map) { Object oldValue = map.get(name); if (oldValue instanceof Map) { ((Map<String, Object>) oldValue).putAll((Map<String, Object>) value); } else { map.put(name, value); } } else { throw new AssertionError("Option value must be String, Option, List, or Map<String, ?>"); } } return map; }

Target:
public static Map<String, Object> optionsAsMap(List<Option> options) { Map<String, Object> map = new LinkedHashMap<String, Object>(); for (Option option : options) { String name = option.getName(); Object value = option.getValue(); if (value instanceof String || value instanceof List) { map.put(name, value); } else if (value instanceof Option) { Map<String, Object> newMap = optionsAsMap(Arrays.asList((Option) value)); Object oldValue = map.get(name); if (oldValue instanceof Map) { Map<String, Object> oldMap = (Map<String, Object>) oldValue; oldMap = new LinkedHashMap<String, Object>(oldMap); oldMap.putAll(newMap); map.put(name, oldMap); } else { map.put(name, newMap); } } else if (value instanceof Map) { Object oldValue = map.get(name); if (oldValue instanceof Map) { ((Map<String, Object>) oldValue).putAll((Map<String, Object>) value); } else { map.put(name, value); } } else { throw new AssertionError("Option value must be String, Option, List, or Map<String, ?>"); } } return unmodifiableMap(map); }
Source:
public static TaskResultImpl getTaskResult(SchedulerDBManager dbManager, InternalJob job, InternalTask task) { if (task == null){ return null; } TaskResultImpl taskResult; JobDescriptor jobDescriptor = job.getJobDescriptor(); if (jobDescriptor.getRunningTasks().get(task.getId()) != null){ taskResult = (TaskResultImpl) dbManager.loadTasksResults(job.getId(), Collections.singletonList(task.getId())) .get(task.getId()); } else { taskResult = getEmptyTaskResultWithTaskIdAndExecutionTime(task); if (jobDescriptor.getPausedTasks().get(task.getId()) != null){ taskResult.setPropagatedVariables(getPropagatedVariables(dbManager, job, task)); } } return taskResult; }

Target:
public TaskResultImpl getTaskResult(SchedulerDBManager dbManager, InternalJob job, InternalTask task) throws UnknownTaskException { return getTaskResult(dbManager, job, task, null, null); }
Source:
public void testParceling() { LinkAddress l; l = new LinkAddress(V6_ADDRESS, 64, 123, 456); assertParcelingIsLossless(l); l = new LinkAddress(V4 + "/28", IFA_F_PERMANENT, RT_SCOPE_LINK); assertParcelingIsLossless(l); assertFieldCountEquals(4, LinkAddress.class); }

Target:
public void testParceling() { LinkAddress l; l = new LinkAddress(V6_ADDRESS, 64, 123, 456); assertParcelingIsLossless(l); l = new LinkAddress(V4 + "/28", IFA_F_PERMANENT, RT_SCOPE_LINK); assertParcelSane(l, 4); }
Source:
public Map<SystemStreamPartition, List<IncomingMessageEnvelope>> poll(Set<SystemStreamPartition> systemStreamPartitions, long timeout) throws InterruptedException { if (perminentEventHubError != null) { String msg = String.format("Received a non transient error from event hub partition receiver (ssp=%s)", failedSSPReceiver); throw new SamzaException(msg, perminentEventHubError); } return super.poll(systemStreamPartitions, timeout); }

Target:
public Map<SystemStreamPartition, List<IncomingMessageEnvelope>> poll(Set<SystemStreamPartition> systemStreamPartitions, long timeout) throws InterruptedException { Throwable handlerError = eventHubHandlerError.get(); if (handlerError != null) { if (isErrorTransient(handlerError)) { LOG.warn("Received a transient error from event hub partition receiver, restarted receiver", handlerError); } else { String msg = "Received a non transient error from event hub partition receiver"; throw new SamzaException(msg, handlerError); } } return super.poll(systemStreamPartitions, timeout); }
Source:
public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = inflater.inflate(R.layout.item_full_search_result, parent, false); } TextView pageTitleText = (TextView) convertView.findViewById(R.id.result_title); FullSearchResult result = (FullSearchResult) getItem(position); pageTitleText.setText(result.getTitle().getDisplayText()); TextView descriptionText = (TextView) convertView.findViewById(R.id.result_description); descriptionText.setText(descriptionCache.get(result.getWikiBaseId())); ImageView imageView = (ImageView) convertView.findViewById(R.id.result_image); String thumbnail = pageImagesCache.get(result.getTitle().getPrefixedText()); if (thumbnail == null) { Picasso.with(parent.getContext()) .load(R.drawable.ic_pageimage_placeholder) .into(imageView); } else { Picasso.with(parent.getContext()) .load(thumbnail) .placeholder(R.drawable.ic_pageimage_placeholder) .error(R.drawable.ic_pageimage_placeholder) .into(imageView); } if (position == results.size() - 1 && lastResults.getContinueOffset() > 0) { doSearch(currentSearchTerm, lastResults.getContinueOffset()); } return convertView; }

Target:
public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = inflater.inflate(R.layout.item_full_search_result, parent, false); } TextView pageTitleText = (TextView) convertView.findViewById(R.id.result_title); FullSearchResult result = (FullSearchResult) getItem(position); pageTitleText.setText(result.getTitle().getDisplayText()); String wikidataId = result.getWikiBaseId(); if (!TextUtils.isEmpty(wikidataId)) { TextView descriptionText = (TextView) convertView.findViewById(R.id.result_description); descriptionText.setText(descriptionCache.get(wikidataId)); } ImageView imageView = (ImageView) convertView.findViewById(R.id.result_image); String thumbnail = pageImagesCache.get(result.getTitle().getPrefixedText()); if (thumbnail == null) { Picasso.with(parent.getContext()) .load(R.drawable.ic_pageimage_placeholder) .into(imageView); } else { Picasso.with(parent.getContext()) .load(thumbnail) .placeholder(R.drawable.ic_pageimage_placeholder) .error(R.drawable.ic_pageimage_placeholder) .into(imageView); } if (position == results.size() - 1 && lastResults.getContinueOffset() > 0) { doSearch(currentSearchTerm, lastResults.getContinueOffset()); } return convertView; }
Source:
protected void consumerRemoved(SimpleConsumer consumer) { this.inUseConsumerChannels.remove(consumer); }

Target:
protected void consumerRemoved(SimpleConsumer consumer) { this.inUseConsumerChannels.remove(consumer.getChannel()); this.whenUsed.remove(consumer); }
Source:
public byte[] getBytes() { ByteBuffer buffer = ByteBuffer.allocate(PARTITION_SIZE_IN_BYTES); buffer.putShort(CURRENT_VERSION); buffer.putLong(id); return buffer.array(); }

Target:
public byte[] getBytes() { return ClusterMapUtils.serializeShortAndLong(CURRENT_VERSION, id); }
Source:
private String buildURL(DownloadBuilder downloadBuilder) { StringBuilder result = new StringBuilder(); if (Strings.isFilled(downloadBuilder.getBaseURL())) { result.append(downloadBuilder.getBaseURL()); } result.append("/storage/physical/"); result.append(downloadBuilder.getBucket()); result.append("/"); if (downloadBuilder.isEternallyValid()) { result.append(computeEternallyValidHash(downloadBuilder.getPhysicalKey())); } else { result.append(computeHash(downloadBuilder.getPhysicalKey(), 0)); } result.append("/"); if (Strings.isFilled(downloadBuilder.getAddonText())) { result.append(Strings.reduceCharacters(downloadBuilder.getAddonText()).replaceAll("[^a-zA-Z0-9\\-_.]", "-")); result.append("--"); } result.append(downloadBuilder.getPhysicalKey()); result.append("."); result.append(downloadBuilder.getFileExtension()); if (Strings.isFilled(downloadBuilder.getFilename())) { result.append("?name="); result.append(Strings.urlEncode(downloadBuilder.getFilename())); } return result.toString(); }

Target:
private String buildURL(DownloadBuilder downloadBuilder) { StringBuilder result = new StringBuilder(); if (Strings.isFilled(downloadBuilder.getBaseURL())) { result.append(downloadBuilder.getBaseURL()); } result.append("/storage/physical/"); result.append(downloadBuilder.getBucket()); result.append("/"); if (downloadBuilder.isEternallyValid()) { result.append(computeEternallyValidHash(downloadBuilder.getPhysicalKey())); } else { result.append(computeHash(downloadBuilder.getPhysicalKey(), 0)); } result.append("/"); if (Strings.isFilled(downloadBuilder.getAddonText())) { result.append(Strings.reduceCharacters(NON_URL_CHARACTERS.matcher(downloadBuilder.getAddonText()) .replaceAll("-"))); result.append("--"); } result.append(downloadBuilder.getPhysicalKey()); result.append("."); result.append(downloadBuilder.getFileExtension()); if (Strings.isFilled(downloadBuilder.getFilename())) { result.append("?name="); result.append(Strings.urlEncode(downloadBuilder.getFilename())); } return result.toString(); }
Source:
public void attachDelegate(final OutputStream newDelegate) { wrapped = Objects.requireNonNull(newDelegate); }

Target:
public void attachDelegate(final OutputStream newDelegate) { Preconditions.checkState(wrapped == null); wrapped = Objects.requireNonNull(newDelegate); }
Source:
public void testTick() { Job j = new DummyJob(0); repo.addOrUpdateJob(j); Instant t1 = t0.plus(tickSize.multipliedBy(3).dividedBy(2)); ScheduledJob job = new ScheduledJob(t1, j.getId()); TestKit tk = new TestKit(system); ActorRef scheduler = system.actorOf(JobScheduler.props(repo, clock)); scheduler.tell(new JobScheduler.ScheduleCmd(job), tk.getRef()); tk.expectMsg(true); Assert.assertEquals(Collections.singletonList(job), getPlan(tk, scheduler)); clock.tick(); scheduler.tell(JobScheduler.Tick.INSTANCE, tk.getRef()); tk.expectNoMsg(); Assert.assertEquals(Collections.singletonList(job), getPlan(tk, scheduler)); clock.tick(); scheduler.tell(JobScheduler.Tick.INSTANCE, tk.getRef()); tk.expectMsg(JobExecutor.Success.INSTANCE); tk.expectNoMsg(); System.out.println(getPlan(tk, scheduler)); Assert.assertEquals( Collections.singletonList(new ScheduledJob(t1.plus(tickSize), j.getId())), getPlan(tk, scheduler)); }

Target:
public void testTick() { Job j = new DummyJob(0); repo.addOrUpdateJob(j); Instant t1 = t0.plus(tickSize.multipliedBy(3).dividedBy(2)); ScheduledJob job = new ScheduledJob(t1, j.getId()); TestKit tk = new TestKit(system); ActorRef scheduler = system.actorOf(JobScheduler.props(repo, clock)); scheduler.tell(new JobScheduler.ScheduleCmd(job), tk.getRef()); tk.expectMsg(true); Assert.assertEquals(Collections.singletonList(job), getPlan(tk, scheduler)); clock.tick(); scheduler.tell(JobScheduler.Tick.INSTANCE, tk.getRef()); tk.expectNoMsg(); Assert.assertEquals(Collections.singletonList(job), getPlan(tk, scheduler)); clock.tick(); scheduler.tell(JobScheduler.Tick.INSTANCE, tk.getRef()); tk.expectMsg(JobExecutor.Success.INSTANCE); tk.expectNoMsg(); Assert.assertEquals( Collections.singletonList(new ScheduledJob(t1.plus(tickSize), j.getId())), getPlan(tk, scheduler)); }
Source:
public ImageDescriptor getDisabledImageDescriptor() { return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DUPLICATE_CONFIG); }

Target:
public ImageDescriptor getDisabledImageDescriptor() { return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_WIZBAN_EXPORT_CONFIGS); }
Source:
private String getReplicationId() { if(filter == null) { return this.sourceDb.getIdentifier() ; } else { return this.sourceDb.getIdentifier() + "?" + filter.toString(); } }

Target:
private String getReplicationId() { if(filter == null) { return this.sourceDb.getIdentifier() ; } else { return this.sourceDb.getIdentifier() + "?" + filter.toQueryString(); } }
Source:
default void copyToDirectory(Path outputDirectory) throws IOException { checkNotNull(outputDirectory, outputDirectory); copyToFile(outputDirectory.resolve(this.getFileName())); }

Target:
default void copyToDirectory(Path outputDirectory) throws IOException { checkNotNull(outputDirectory, "outputDirectory"); copyToFile(outputDirectory.resolve(this.getFileName())); }
Source:
public int hashCode() { int result = dataSource != null ? dataSource.hashCode() : 0; result = 31 * result + (context != null ? context.hashCode() : 0); result = 31 * result + (querySegmentSpec != null ? querySegmentSpec.hashCode() : 0); result = 31 * result + (duration != null ? duration.hashCode() : 0); if (isDescending()) { result = 31 * result + 1; } return result; }

Target:
public int hashCode() { int result = dataSource != null ? dataSource.hashCode() : 0; result = 31 * result + (descending ? 1 : 0); result = 31 * result + (context != null ? context.hashCode() : 0); result = 31 * result + (querySegmentSpec != null ? querySegmentSpec.hashCode() : 0); result = 31 * result + (duration != null ? duration.hashCode() : 0); return result; }
Source:
public ITmfTrace openTrace(String projectName, String traceName, boolean isExperiment) throws FileNotFoundException { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject rootProject = root.getProject(projectName); TmfProjectElement rootElement = TmfProjectRegistry.getProject(Objects.requireNonNull(rootProject)); String childrenName = isExperiment ? "Experiments" : "Traces"; ITmfProjectModelElement traceFolder = rootElement.getChild(childrenName); ITmfProjectModelElement traceChild = traceFolder.getChild(traceName); if (!(traceChild instanceof TmfCommonProjectElement)) { throw new FileNotFoundException(); } Display.getDefault().syncExec(new Runnable() { @Override public void run() { TmfOpenTraceHelper.openTraceFromElement((TmfCommonProjectElement) traceChild); } }); TmfCommonProjectElement projectElement = (TmfCommonProjectElement) traceChild; ITmfTrace trace = projectElement.getTrace(); Integer tryCounter = 0; final Integer numberOfTry = 10; while (trace == null && tryCounter < numberOfTry) { try { Thread.sleep(100); } catch (InterruptedException e) { break; } trace = projectElement.getTrace(); tryCounter++; } if (trace != null) { return trace; } throw new FileNotFoundException(); }

Target:
public ITmfTrace openTrace(String projectName, String traceName, boolean isExperiment) throws FileNotFoundException { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject rootProject = root.getProject(projectName); TmfProjectElement rootElement = TmfProjectRegistry.getProject(Objects.requireNonNull(rootProject)); String folderName = isExperiment ? "Experiments" : "Traces"; ITmfProjectModelElement traceFolder = rootElement.getChild(folderName); for(String name : traceName.split("/")) { traceFolder = traceFolder.getChild(name); } ITmfProjectModelElement traceChild = traceFolder; if (!(traceChild instanceof TmfCommonProjectElement)) { throw new FileNotFoundException(); } Display.getDefault().syncExec(new Runnable() { @Override public void run() { TmfOpenTraceHelper.openTraceFromElement((TmfCommonProjectElement) traceChild); } }); TmfCommonProjectElement projectElement = (TmfCommonProjectElement) traceChild; ITmfTrace trace = projectElement.getTrace(); Integer tryCounter = 0; final Integer numberOfTry = 10; while (trace == null && tryCounter < numberOfTry) { try { Thread.sleep(100); } catch (InterruptedException e) { break; } trace = projectElement.getTrace(); tryCounter++; } if (trace != null) { return trace; } throw new FileNotFoundException(); }
Source:
protected void executeCommand() { boolean isStorageDisconnectSucceeded = disconnectStorage(); if(isStorageDisconnectSucceeded) { String connectionId = getConnection().getid(); if(StringUtils.isNotEmpty(connectionId)) { getDbFacade().getStorageServerConnectionDao().remove(connectionId); } setSucceeded(true); } }

Target:
protected void executeCommand() { String connectionId = getConnection().getid(); if(StringUtils.isNotEmpty(connectionId)) { getDbFacade().getStorageServerConnectionDao().remove(connectionId); } disconnectStorage(); setSucceeded(true); }
Source:
public String playerHeight(@Sender EntityRef client, @CommandParam("height") float amount) { ClientComponent clientComp = client.getComponent(ClientComponent.class); CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class); if (move != null) { float prevHeight = move.height; move.height = amount; clientComp.character.saveComponent(move); LocationComponent loc = client.getComponent(LocationComponent.class); Vector3f currentPosition = loc.getWorldPosition(); teleportCommand(client, currentPosition.getX(), currentPosition.getY() + (amount - prevHeight)/2, currentPosition.getZ()); physics.removeCharacterCollider(clientComp.character); physics.getCharacterCollider(clientComp.character); return "Height of player set to " + amount + " (was " + prevHeight + ")"; } return ""; }

Target:
public String playerHeight(@Sender EntityRef client, @CommandParam("height") float amount) { try { ClientComponent clientComp = client.getComponent(ClientComponent.class); CharacterMovementComponent move = clientComp.character.getComponent(CharacterMovementComponent.class); if (move != null) { float prevHeight = move.height; move.height = amount; clientComp.character.saveComponent(move); LocationComponent loc = client.getComponent(LocationComponent.class); Vector3f currentPosition = loc.getWorldPosition(); clientComp.character .send(new CharacterTeleportEvent(new Vector3f(currentPosition.getX(), currentPosition.getY() + (amount - prevHeight) / 2, currentPosition.getZ()))); physics.removeCharacterCollider(clientComp.character); physics.getCharacterCollider(clientComp.character); return "Height of player set to " + amount + " (was " + prevHeight + ")"; } return ""; } catch (NullPointerException e) { e.printStackTrace(); return ""; } }
Source:
private static ServerJMSMessage processExtraProperties(ServerJMSMessage jms, TypedProperties properties) { if (properties != null) { properties.forEach((k, v) -> { jms.getInnerMessage().putObjectProperty(k, v); }); } return jms; }

Target:
private static ServerJMSMessage processExtraProperties(ServerJMSMessage jms, TypedProperties properties) { if (properties != null) { properties.forEach((k, v) -> { if (!k.equals(AMQPMessage.ADDRESS_PROPERTY)) { jms.getInnerMessage().putObjectProperty(k, v); } }); } return jms; }