auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public <T> Observable<Metric<T>> findMetrics(String tenantId, MetricType<T> metricType) { Observable<Metric<T>> setFromMetricsIndex = null; Observable<Metric<T>> setFromData = dataAccess.findAllMetricsInData() .compose(new MetricFromFullDataRowTransformer(defaultTTL)) .filter(m -> tenantId.equals(m.getTenantId())) .map(m -> { @SuppressWarnings("unchecked") Metric<T> mt = (Metric<T>) m; return mt; }); if (metricType == null) { setFromMetricsIndex = Observable.from(MetricType.userTypes()) .map(type -> { @SuppressWarnings("unchecked") MetricType<T> t = (MetricType<T>) type; return t; }) .flatMap(type -> dataAccess.findMetricsInMetricsIndex(tenantId, type) .compose(new MetricsIndexRowTransformer<>(tenantId, type, defaultTTL))); } else { setFromMetricsIndex = dataAccess.findMetricsInMetricsIndex(tenantId, metricType) .compose(new MetricsIndexRowTransformer<>(tenantId, metricType, defaultTTL)); setFromData = setFromData.filter(m -> metricType.equals(m.getMetricId().getType())); } return setFromMetricsIndex.concatWith(setFromData).distinct(m -> m.getMetricId()); }

Target:
public <T> Observable<Metric<T>> findMetrics(String tenantId, MetricType<T> metricType) { Observable<Metric<T>> setFromMetricsIndex = null; Observable<Metric<T>> setFromData = dataAccess.findAllMetricsInData() .filter(row -> tenantId.equals(row.getString(0))) .compose(new MetricFromFullDataRowTransformer(defaultTTL)) .map(m -> (Metric<T>) m); if (metricType == null) { setFromMetricsIndex = Observable.from(MetricType.userTypes()) .map(type -> (MetricType<T>) type) .flatMap(type -> dataAccess.findMetricsInMetricsIndex(tenantId, type) .compose(new MetricsIndexRowTransformer<>(tenantId, type, defaultTTL))); } else { setFromMetricsIndex = dataAccess.findMetricsInMetricsIndex(tenantId, metricType) .compose(new MetricsIndexRowTransformer<>(tenantId, metricType, defaultTTL)); setFromData = setFromData.filter(m -> metricType.equals(m.getMetricId().getType())); } return setFromMetricsIndex.concatWith(setFromData).distinct(m -> m.getMetricId()); }
Source:
protected Predicate<DetailedS3Object> getSizePredicate() throws CommandException { if (Guard.isMapNullOrEmpty(this.filterParams)) { return Predicates.notNull(); } String larger = this.filterParams.get(LARGERTHAN); String smaller = this.filterParams.get(SMALLERTHAN); if (Guard.isStringNullOrEmpty(larger) && Guard.isStringNullOrEmpty(smaller)) { return Predicates.notNull(); } final long largerthan = Guard.isStringNullOrEmpty(larger) ? 0L : Long.parseLong(larger); final long smallerthan = Guard.isStringNullOrEmpty(smaller) ? Long.MAX_VALUE : Long.parseLong(smaller); return new Predicate<DetailedS3Object>() { @Override public boolean apply(@Nullable final DetailedS3Object input) { return input.getSize() > largerthan && input.getSize() < smallerthan; } }; }

Target:
private Predicate<DetailedS3Object> getSizePredicate() throws CommandException { if (Guard.isMapNullOrEmpty(this.filterParams)) { return Predicates.notNull(); } final String larger = this.filterParams.get(LARGERTHAN); final String smaller = this.filterParams.get(SMALLERTHAN); if (Guard.isStringNullOrEmpty(larger) && Guard.isStringNullOrEmpty(smaller)) { return Predicates.notNull(); } final long largerthan = Guard.isStringNullOrEmpty(larger) ? 0L : Long.parseLong(larger); final long smallerthan = Guard.isStringNullOrEmpty(smaller) ? Long.MAX_VALUE : Long.parseLong(smaller); return new Predicate<DetailedS3Object>() { @Override public boolean apply(@Nullable final DetailedS3Object input) { return input.getSize() > largerthan && input.getSize() < smallerthan; } }; }
Source:
protected void printHelp(CommandContext ctx) throws CommandLineException { InputStream helpInput = WildFlySecurityManager.getClassLoaderPrivileged(CommandHandlerWithHelp.class).getResourceAsStream(filename); if(helpInput != null) { try (final BufferedReader reader = new BufferedReader(new InputStreamReader(helpInput, StandardCharsets.UTF_8));){ HelpFormatter.format(ctx, reader); } catch(java.io.IOException e) { throw new CommandFormatException ("Failed to read help/help.txt: " + e.getLocalizedMessage()); } } else { throw new CommandFormatException("Failed to locate command description " + filename); } }

Target:
protected void printHelp(CommandContext ctx) throws CommandLineException { InputStream helpInput = WildFlySecurityManager.getClassLoaderPrivileged(CommandHandlerWithHelp.class).getResourceAsStream(filename); if(helpInput != null) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(helpInput, StandardCharsets.UTF_8)); HelpFormatter.format(ctx, reader); } catch(java.io.IOException e) { throw new CommandFormatException ("Failed to read help/help.txt: " + e.getLocalizedMessage()); } finally { StreamUtils.safeClose(reader); } } else { throw new CommandFormatException("Failed to locate command description " + filename); } }
Source:
public <R extends ConnectRecord<R>> List<Transformation<R>> transformations() { final List<String> transformAliases = getList(TRANSFORMS_CONFIG); final List<Transformation<R>> transformations = new ArrayList<>(transformAliases.size()); for (String alias : transformAliases) { final String prefix = TRANSFORMS_CONFIG + "." + alias + "."; try { @SuppressWarnings("unchecked") final Transformation<R> transformation = getClass(prefix + "type").asSubclass(Transformation.class) .getDeclaredConstructor().newInstance(); Map<String, Object> configs = originalsWithPrefix(prefix); Object predicateAlias = configs.remove("predicate"); Object negate = configs.remove("negate"); transformation.configure(configs); if (predicateAlias != null) { String predicatePrefix = "predicates." + predicateAlias + "."; @SuppressWarnings("unchecked") Predicate<R> predicate = getClass(predicatePrefix + "type").asSubclass(Predicate.class) .getDeclaredConstructor().newInstance(); predicate.configure(originalsWithPrefix(predicatePrefix)); transformations.add(new PredicatedTransformation<>(predicate, negate == null ? false : Boolean.parseBoolean(negate.toString()), transformation)); } else { transformations.add(transformation); } } catch (Exception e) { throw new ConnectException(e); } } return transformations; }

Target:
public <R extends ConnectRecord<R>> List<Transformation<R>> transformations() { final List<String> transformAliases = getList(TRANSFORMS_CONFIG); final List<Transformation<R>> transformations = new ArrayList<>(transformAliases.size()); for (String alias : transformAliases) { final String prefix = TRANSFORMS_CONFIG + "." + alias + "."; try { @SuppressWarnings("unchecked") final Transformation<R> transformation = Utils.newInstance(getClass(prefix + "type"), Transformation.class); Map<String, Object> configs = originalsWithPrefix(prefix); Object predicateAlias = configs.remove(PredicatedTransformation.PREDICATE_CONFIG); Object negate = configs.remove(PredicatedTransformation.NEGATE_CONFIG); transformation.configure(configs); if (predicateAlias != null) { String predicatePrefix = PREDICATES_PREFIX + predicateAlias + "."; @SuppressWarnings("unchecked") Predicate<R> predicate = Utils.newInstance(getClass(predicatePrefix + "type"), Predicate.class); predicate.configure(originalsWithPrefix(predicatePrefix)); transformations.add(new PredicatedTransformation<>(predicate, negate == null ? false : Boolean.parseBoolean(negate.toString()), transformation)); } else { transformations.add(transformation); } } catch (Exception e) { throw new ConnectException(e); } } return transformations; }
Source:
public void onNewHead(FlowNode flowNode) { if (!isMonitored(flowNode)) { return; } StepEndNode endNode = (StepEndNode) flowNode; StepStartNode startNode = endNode.getStartNode(); int stage_depth = 0; for (BlockStartNode node : startNode.iterateEnclosingBlocks()) { if (isStageNode(node)) { stage_depth++; } } DatadogClient client = ClientFactory.getClient(); try { BuildData buildData = new BuildData(getRun(flowNode), flowNode.getExecution().getOwner().getListener()); String hostname = buildData.getHostname(""); Map<String, Set<String>> tags = buildData.getTags(); TagsUtil.addTagToTags(tags, "stage_name", getStageName(startNode)); TagsUtil.addTagToTags(tags, "stage_depth", String.valueOf(stage_depth)); tags.remove("result"); client.gauge("jenkins.job.stageduration", getTime(startNode, endNode), hostname, tags); } catch (IOException | InterruptedException e) { e.printStackTrace(); } }

Target:
public void onNewHead(FlowNode flowNode) { if (!isMonitored(flowNode)) { return; } DatadogClient client = ClientFactory.getClient(); if (client == null){ return; } StepEndNode endNode = (StepEndNode) flowNode; StepStartNode startNode = endNode.getStartNode(); int stageDepth = 0; String directParentName = null; for (BlockStartNode node : startNode.iterateEnclosingBlocks()) { if (isStageNode(node)) { if(directParentName == null){ directParentName = getStageName(node); } stageDepth++; } } if(directParentName == null){ directParentName = "root"; } WorkflowRun run = getRun(flowNode); if(run == null){ return; } try { BuildData buildData = new BuildData(run, flowNode.getExecution().getOwner().getListener()); String hostname = buildData.getHostname(""); Map<String, Set<String>> tags = buildData.getTags(); TagsUtil.addTagToTags(tags, "stage_name", getStageName(startNode)); TagsUtil.addTagToTags(tags, "parent_stage_name", directParentName); TagsUtil.addTagToTags(tags, "stage_depth", String.valueOf(stageDepth)); tags.remove("result"); client.gauge("jenkins.job.stage_duration", getTime(startNode, endNode), hostname, tags); } catch (IOException | InterruptedException e) { DatadogUtilities.severe(logger, e, "Unable to submit the stage duration metric for " + getStageName(startNode)); } }
Source:
public void registerEntities() throws IOException { OServerAdmin serverAdmin = new OServerAdmin(getConnectionUrl()).connect("root", "root"); if (!serverAdmin.existsDatabase()) { logger.debug("Create database " + database); serverAdmin.createDatabase(database, "document", "plocal").close(); } factory().db().getEntityManager().registerEntityClasses(DOMAIN_PACKAGE); }

Target:
public void registerEntities() throws IOException { OServerAdmin serverAdmin = new OServerAdmin(getConnectionUrl()).connect(user, password); if (!serverAdmin.existsDatabase()) { logger.debug("Create database " + database); serverAdmin.createDatabase(database, "document", "plocal").close(); } factory().db().getEntityManager().registerEntityClasses(DOMAIN_PACKAGE); }
Source:
public void revokeAllRolesFor(String username) { for (List<RoleUser> usersOfRole : roleToUsersMappings.values()) { usersOfRole.remove(new RoleUser(username)); } }

Target:
public void revokeAllRolesFor(String username) { final RoleUser roleUser = new RoleUser(username); synchronized (roleToUsersMappings) { Set<PluginRoleConfig> pluginRoles = new HashSet<>(roleToUsersMappings.keySet()); for (PluginRoleConfig pluginRole : pluginRoles) { roleToUsersMappings.get(pluginRole).remove(roleUser); } } }
Source:
public Double getDistance() { if (!isLeaf()) { throw new IllegalStateException("No target value exists for a logical operator"); } Object distance = json.get(DISTANCE); if (distance == null) { return null; } else if (distance instanceof Double) { return (Double) distance; } else if (distance instanceof Integer) { return ((Integer) distance).doubleValue(); } else if (distance instanceof Long) { return ((Long) distance).doubleValue(); } else { throw new IllegalStateException("The distance value could not be converted into a double"); } }

Target:
public Double getDistance() { if (!isLeaf()) { throw new IllegalStateException("No distance value exists for a logical operator"); } Object distance = json.get(DISTANCE); if (distance == null) { return null; } if (distance instanceof Number) { return ((Number) distance).doubleValue(); } throw new IllegalStateException("The distance value could not be converted into a double"); }
Source:
public void createSubscription() throws Exception { Subscription subscription = gd.getNotificationService().createSubscription(project, gd.getAccountService().getCurrent(), new Subscription( Arrays.asList(new TimerEvent("0 * * * * *"), new TimerEvent("1 * * * * *")), new Condition("true"), new Template("test message"), Arrays.asList(channel.getMeta().getUri()), new Meta("test subscription"))); assertThat(subscription, is(notNullValue())); }

Target:
public void createSubscription() throws Exception { subscription = gd.getNotificationService().createSubscription(project, gd.getAccountService().getCurrent(), new Subscription( Arrays.asList(new TimerEvent("0 * * * * *"), new TimerEvent("1 * * * * *")), singletonList(channel), new TriggerCondition("true"), new MessageTemplate("test message"), "test subscription")); assertThat(subscription, is(notNullValue())); }
Source:
private Callable<Boolean> getConnectAndLoginCallable() { return () -> { try { xmppConnection.connect(); } catch(Exception t) { logger.warn(MucClient.this + " error connecting", t); return true; } if (xmppConnection.isConnected()) { xmppConnection.login(); } else { logger.info(MucClient.this + " still not connected."); } return false; }; }

Target:
private Callable<Boolean> getConnectAndLoginCallable() { return () -> { try { if (!xmppConnection.isConnected()) { xmppConnection.connect(); } } catch(Exception t) { logger.warn(MucClient.this + " error connecting", t); return true; } logger.info("Logging in."); xmppConnection.login(); executor.shutdown(); return false; }; }
Source:
@Test public void checkAbilityToUseNodeDefinedExplicitly() { File node = new File("src/test/java/io/appium/java_client/service/local/appium.js"); AppiumServiceBuilder builder = new AppiumServiceBuilder().withAppiumJS(node); assertThat(new File(builder.createArgs().get(0)).getAbsolutePath(), is(node.getAbsolutePath())); }

Target:
@Test public void checkAbilityToUseNodeDefinedExplicitly() { File mainJS = PATH_T0_TEST_MAIN_JS.toFile(); AppiumServiceBuilder builder = new AppiumServiceBuilder() .withAppiumJS(mainJS); assertThat(builder.createArgs().get(0), is(mainJS.getAbsolutePath())); }
Source:
public void shouldReturnNotFoundViolation() { Review review = new Review(ImmutableList.of(new ReviewFile("test"))); ReviewResult reviewResult = fixture.process(review); assertThat(reviewResult).isNotNull(); assert reviewResult != null; assertThat(reviewResult.getViolations()).isNotEmpty(); assertThat(reviewResult.getViolations()) .extracting("message") .containsOnly("File not found!"); }

Target:
public void shouldReturnNotFoundViolation() { Review review = new Review(ImmutableList.of(new ReviewFile("test"))); ReviewResult reviewResult = fixture.process(review); assertThat(reviewResult).isNotNull(); assertThat(reviewResult.getViolations()) .isNotEmpty() .extracting("message") .containsOnly("File not found!"); }
Source:
public Object getValueAt(final int rowIndex, final int columnIndex) { final Column column = Column.values()[columnIndex]; final GameDescription description = gameList.get(rowIndex).getSecond(); switch (column) { case Host: return description.getHostName(); case Round: final int round = description.getRound(); return round == 0 ? "-" : String.valueOf(round); case Name: return description.getGameName(); case Players: return description.getPlayerCount(); case P: return (description.isPassworded() ? "*" : ""); case GV: return description.getGameVersion(); case Status: return description.getStatus(); case Comments: return description.getComment(); case Started: return description.getFormattedBotStartTime(); case GUID: return gameList.get(rowIndex).getFirst(); default: throw new IllegalStateException("Unknown column:" + column); } }

Target:
public Object getValueAt(final int rowIndex, final int columnIndex) { final Column column = Column.values()[columnIndex]; final GameDescription description = gameListModel.getGameDescriptionByRow(rowIndex); switch (column) { case Host: return description.getHostName(); case Round: final int round = description.getRound(); return round == 0 ? "-" : String.valueOf(round); case Name: return description.getGameName(); case Players: return description.getPlayerCount(); case P: return (description.isPassworded() ? "*" : ""); case GV: return description.getGameVersion(); case Status: return description.getStatus(); case Comments: return description.getComment(); case Started: return description.getFormattedBotStartTime(); case GUID: return gameListModel.getGameGuidByRow(rowIndex); default: throw new IllegalStateException("Unknown column:" + column); } }
Source:
public Set<Expr> getScalarInputs(List<Expr> args) { return ImmutableSet.of(args.get(1), args.get(2)); }

Target:
public Set<Expr> getScalarInputs(List<Expr> args) { if (args.size() == 3) { return ImmutableSet.of(args.get(1), args.get(2)); } else { return ImmutableSet.of(args.get(1)); } }
Source:
private String retrieveVcfSection(String vcfFilePath) throws IOException { String vcfSection = ""; int lineCount = NUMBER_OF_LINES; Scanner scanner = new Scanner(new GZIPInputStream(new FileInputStream(vcfFilePath))); while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (!line.startsWith("#")) { lineCount--; vcfSection += line + "\n"; if (lineCount == 0) { break; } } } scanner.close(); if (lineCount > 0) { return ""; } return vcfSection; }

Target:
private String retrieveVcfSection(String vcfFilePath) throws IOException { String vcfSection = ""; int lineCount = NUMBER_OF_LINES; Scanner scanner = new Scanner(new GZIPInputStream(new FileInputStream(vcfFilePath))); while (scanner.hasNextLine() && lineCount > 0) { String line = scanner.nextLine(); if (!line.startsWith("#")) { lineCount--; vcfSection += line + "\n"; } } scanner.close(); if (lineCount > 0) { return ""; } return vcfSection; }
Source:
public boolean isClientAwake(Registration registration) { return clientPrecenses.get(registration.getEndpoint()) != null; }

Target:
public boolean isClientAwake(Registration registration) { return clientPresences.containsKey(registration.getEndpoint()); }
Source:
public void changePasswordAsAdmin(CommandSender sender, final String playerName, String newPassword) { final String lowerCaseName = playerName.toLowerCase(); if (!(playerCache.isAuthenticated(lowerCaseName) || dataSource.isAuthAvailable(lowerCaseName))) { if (sender == null) { ConsoleLogger.warning("Tried to change password for user " + lowerCaseName + " but it doesn't exist!"); } else { commonService.send(sender, MessageKey.UNKNOWN_USER); } return; } HashedPassword hashedPassword = passwordSecurity.computeHash(newPassword, lowerCaseName); if (dataSource.updatePassword(lowerCaseName, hashedPassword)) { if (dataSource instanceof CacheDataSource) { bungeeSender.sendAuthMeBungeecordMessage(MessageType.REFRESH_PASSWORD, lowerCaseName); } if (sender != null) { commonService.send(sender, MessageKey.PASSWORD_CHANGED_SUCCESS); ConsoleLogger.info(sender.getName() + " changed password of " + lowerCaseName); } else { ConsoleLogger.info("Changed password of " + lowerCaseName); } } else { if (sender != null) { commonService.send(sender, MessageKey.ERROR); } ConsoleLogger.warning("An error occurred while changing password for user " + lowerCaseName + "!"); } }

Target:
public void changePasswordAsAdmin(CommandSender sender, final String playerName, String newPassword) { final String lowerCaseName = playerName.toLowerCase(); if (!(playerCache.isAuthenticated(lowerCaseName) || dataSource.isAuthAvailable(lowerCaseName))) { if (sender == null) { ConsoleLogger.warning("Tried to change password for user " + lowerCaseName + " but it doesn't exist!"); } else { commonService.send(sender, MessageKey.UNKNOWN_USER); } return; } HashedPassword hashedPassword = passwordSecurity.computeHash(newPassword, lowerCaseName); if (dataSource.updatePassword(lowerCaseName, hashedPassword)) { bungeeSender.sendAuthMeBungeecordMessage(MessageType.REFRESH_PASSWORD, lowerCaseName); if (sender != null) { commonService.send(sender, MessageKey.PASSWORD_CHANGED_SUCCESS); ConsoleLogger.info(sender.getName() + " changed password of " + lowerCaseName); } else { ConsoleLogger.info("Changed password of " + lowerCaseName); } } else { if (sender != null) { commonService.send(sender, MessageKey.ERROR); } ConsoleLogger.warning("An error occurred while changing password for user " + lowerCaseName + "!"); } }
Source:
public String getId() { return "PositionedCrop.com.bumptech.glide.load.resource.bitmap.x:" + xPercentage + ".y:" + yPercentage; }

Target:
public String getId() { return "PositionedCrop.com.bumptech.glide.load.resource.bitmap(x=" + xPercentage + ",y=" + yPercentage + ")"; }
Source:
public void initTable(final ImmutableList<String> columnHeads) { this.columnCount = columnHeads.size(); DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); this.header = new ASCIITableHeader[this.columnCount]; for (int i = 0; i < this.columnCount; i++) { header[i] = new ASCIITableHeader(columnHeads.get(i), ASCIITable.ALIGN_LEFT); } }

Target:
public void initTable(final ImmutableList<String> columnHeads) { this.columnCount = columnHeads.size(); this.header = new ASCIITableHeader[this.columnCount]; for (int i = 0; i < this.columnCount; i++) { header[i] = new ASCIITableHeader(columnHeads.get(i), ASCIITable.ALIGN_LEFT); } }
Source:
public void getPackagesFromFile_shouldSkipOptionalFoldersIfJarFile() throws IOException{ File f = new File(this.getClass().getResource("/org/openmrs/module/include/test1-1.0-SNAPSHOT.omod").getFile()); File d = new File("/tmp/test1-1.0-SNAPSHOT.jar"); FileUtils.copyFile(f, d); Collection<String> packageCollection = ModuleUtil.getPackagesFromFile(d); Assert.assertFalse(packageCollection.isEmpty()); for (String string : packageCollection) { Assert.assertFalse(string.contains("lib")); Assert.assertFalse(string.contains("META-INF")); Assert.assertFalse(string.contains("web.module")); } }

Target:
public void getPackagesFromFile_shouldSkipOptionalFoldersIfJarFile() throws IOException{ File f = new File(this.getClass().getResource("/org/openmrs/module/include/test1-1.0-SNAPSHOT.omod").getFile()); File d = new File("/tmp/test1-1.0-SNAPSHOT.jar"); FileUtils.copyFile(f, d); Collection<String> packageCollection = ModuleUtil.getPackagesFromFile(d); Assert.assertFalse(packageCollection.isEmpty()); for (String string : packageCollection) { Assert.assertFalse(string.contains("lib")); Assert.assertFalse(string.contains("META-INF")); Assert.assertFalse(string.contains("web/module")); } }
Source:
public void initialise() { message = find("message", UILabel.class); message.bindText(new ReadOnlyBinding<String>() { @Override public String get() { Iterable<Message> msgs = console.getMessages(CoreMessageType.CHAT, CoreMessageType.NOTIFICATION); ArrayList<Message> msgsList = new ArrayList<>(); StringBuilder messageHistory = new StringBuilder(); for (Message msg : msgs) { msgsList.add(msg); } for (int i = msgsList.size() >= MAX_LINES ? msgsList.size() - MAX_LINES : 0; i < msgsList.size(); i++) { messageHistory.append(msgsList.get(i).getMessage()); if (i < msgsList.size() - 1) { messageHistory.append(Console.NEW_LINE); } } return messageHistory.toString(); } }); }

Target:
public void initialise() { message = find("message", UILabel.class); message.bindText(new ReadOnlyBinding<String>() { @Override public String get() { Iterable<Message> msgs = console.getMessages(CoreMessageType.CHAT, CoreMessageType.NOTIFICATION); StringBuilder messageHistory = new StringBuilder(); int count = 1; int size = Iterables.size(msgs); for (Message msg : msgs) { if (count > size - MAX_MESSAGES) { messageHistory.append(msg.getMessage()); if (count < size) { messageHistory.append(Console.NEW_LINE); } } count++; } return messageHistory.toString(); } }); }
Source:
public void execute(JobExecutionContext context) throws JobExecutionException { Logger.debug(this, "Running ContentReviewThread - " + new Date()); try { run(); } catch (Exception e) { Logger.info(this, e.toString()); } finally { try { HibernateUtil.closeSession(); } catch (DotHibernateException e) { Logger.warn(this, e.getMessage(), e); } } }

Target:
public void execute(JobExecutionContext context) throws JobExecutionException { Logger.debug(this, "Running ContentReviewThread - " + new Date()); try { run(); } catch (Exception e) { Logger.info(this, e.toString()); } }
Source:
protected FilterBoxService(List<LanguageClient> clients) { this.input = new String(); this.clients = clients; }

Target:
protected FilterBoxService(List<LanguageClient> clients) { fInput = new String(); fClients = clients; }
Source:
private void setDiskImageSnapshotType(Map<Guid, DiskImage> diskImageMap, Snapshot snapshot) { DiskImage d = diskImageMap.get(snapshot.getId()); if ( d == null ) { return; } if (snapshot.getType() == SnapshotType.ACTIVE || snapshot.getType() == SnapshotType.PREVIEW) { d.setActive(true); } else if (snapshot.getType() == SnapshotType.REGULAR) { d.setActive(false); } }

Target:
private void setDiskImageSnapshotType(Map<Guid, DiskImage> diskImageMap, Snapshot snapshot) { DiskImage diskImage = diskImageMap.get(snapshot.getId()); if ( diskImage == null ) { return; } if (snapshot.getType() == SnapshotType.ACTIVE || snapshot.getType() == SnapshotType.PREVIEW) { diskImage.setActive(true); } else if (snapshot.getType() == SnapshotType.REGULAR) { diskImage.setActive(false); } }
Source:
protected void throwIfWriteAlreadyCommitted(TableReference tableRef, Map<Cell, byte[]> writes, ConflictHandler conflictHandler, LockToken commitLocksToken, TransactionService transactionService) throws TransactionConflictException { if (writes.isEmpty() || !conflictHandler.checkWriteWriteConflicts()) { return; } Set<CellConflict> spanningWrites = Sets.newHashSet(); Set<CellConflict> dominatingWrites = Sets.newHashSet(); Map<Cell, Long> keysToLoad = Maps.asMap(writes.keySet(), Functions.constant(Long.MAX_VALUE)); while (!keysToLoad.isEmpty()) { keysToLoad = detectWriteAlreadyCommittedInternal( tableRef, keysToLoad, spanningWrites, dominatingWrites, transactionService); } if (conflictHandler == ConflictHandler.RETRY_ON_VALUE_CHANGED) { throwIfValueChangedConflict(tableRef, writes, spanningWrites, dominatingWrites, commitLocksToken); } else if (conflictHandler.checkWriteWriteConflicts()) { if (!spanningWrites.isEmpty() || !dominatingWrites.isEmpty()) { getTransactionConflictsMeter().mark(); throw TransactionConflictException.create(tableRef, getStartTimestamp(), spanningWrites, dominatingWrites, System.currentTimeMillis() - timeCreated); } } else { throw new IllegalArgumentException("Unknown conflictHandler type: " + conflictHandler); } }

Target:
protected void throwIfWriteAlreadyCommitted(TableReference tableRef, Map<Cell, byte[]> writes, ConflictHandler conflictHandler, LockToken commitLocksToken, TransactionService transactionService) throws TransactionConflictException { if (writes.isEmpty() || !conflictHandler.checkWriteWriteConflicts()) { return; } Set<CellConflict> spanningWrites = Sets.newHashSet(); Set<CellConflict> dominatingWrites = Sets.newHashSet(); Map<Cell, Long> keysToLoad = Maps.asMap(writes.keySet(), Functions.constant(Long.MAX_VALUE)); while (!keysToLoad.isEmpty()) { keysToLoad = detectWriteAlreadyCommittedInternal( tableRef, keysToLoad, spanningWrites, dominatingWrites, transactionService); } if (conflictHandler == ConflictHandler.RETRY_ON_VALUE_CHANGED) { throwIfValueChangedConflict(tableRef, writes, spanningWrites, dominatingWrites, commitLocksToken); } else { if (!spanningWrites.isEmpty() || !dominatingWrites.isEmpty()) { getTransactionConflictsMeter().mark(); throw TransactionConflictException.create(tableRef, getStartTimestamp(), spanningWrites, dominatingWrites, System.currentTimeMillis() - timeCreated); } } }
Source:
public boolean clear(String hostname) { return resolveCache.clear( appendDot( checkNotNull(hostname, "hostname"))); }

Target:
public boolean clear(String hostname) { checkNotNull(hostname, "hostname"); return resolveCache.clear(appendDot(hostname)); }
Source:
public void initialize() { logger.debug("Initializing the MeteoBlue handler..."); bridge = getBridge(); if (bridge == null) { logger.warn("Unable to initialize meteoblue. No bridge was configured."); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Bridge not configured."); return; } MeteoBlueConfiguration config = getConfigAs(MeteoBlueConfiguration.class); if (StringUtils.isBlank(config.serviceType)) { flagBadConfig("The serviceType setting was not configured."); return; } if (StringUtils.isBlank(config.location)) { flagBadConfig("The location setting was not configured."); return; } config.parseLocation(); if (config.latitude == null) { flagBadConfig(String.format("Could not determine latitude from the defined location setting (%s).", config.location)); return; } if (config.latitude > 90.0 || config.latitude < -90.0) { flagBadConfig(String.format("Specified latitude value (%d) is not valid.", config.latitude)); return; } if (config.longitude == null) { flagBadConfig(String.format("Could not determine longitude from the defined location setting (%s).", config.location)); return; } if (config.longitude > 180.0 || config.longitude < -180.0) { flagBadConfig(String.format("Specified longitude value (%d) is not valid.", config.longitude)); return; } updateStatus(ThingStatus.ONLINE); startAutomaticRefresh(config); properlyConfigured = true; }

Target:
public void initialize() { logger.debug("Initializing the meteoblue handler..."); bridge = getBridge(); if (bridge == null) { logger.warn("Unable to initialize meteoblue. No bridge was configured."); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Bridge not configured."); return; } MeteoBlueConfiguration config = getConfigAs(MeteoBlueConfiguration.class); if (StringUtils.isBlank(config.serviceType)) { config.serviceType = MeteoBlueConfiguration.SERVICETYPE_NONCOMM; logger.debug("Using default service type ({}).", config.serviceType); return; } if (StringUtils.isBlank(config.location)) { flagBadConfig("The location was not configured."); return; } config.parseLocation(); if (config.latitude == null) { flagBadConfig(String.format("Could not determine latitude from the defined location setting (%s).", config.location)); return; } if (config.latitude > 90.0 || config.latitude < -90.0) { flagBadConfig(String.format("Specified latitude value (%d) is not valid.", config.latitude)); return; } if (config.longitude == null) { flagBadConfig(String.format("Could not determine longitude from the defined location setting (%s).", config.location)); return; } if (config.longitude > 180.0 || config.longitude < -180.0) { flagBadConfig(String.format("Specified longitude value (%d) is not valid.", config.longitude)); return; } updateStatus(ThingStatus.UNKNOWN); startAutomaticRefresh(config); properlyConfigured = true; }
Source:
public boolean isNotModified(HttpServletRequest request, HttpServletResponse response) { String currentEtag = String.format("W/\"%s\"", Objects.hash( getLastModified(), getProjectMessages(), getEnv().getDateForLastIndexRun().getTime(), Info.getVersion() ) ); String headerEtag = request.getHeader("If-None-Match"); if (headerEtag != null && headerEtag.equals(currentEtag)) { response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return true; } response.setHeader("ETag", currentEtag); return false; }

Target:
public boolean isNotModified(HttpServletRequest request, HttpServletResponse response) { String currentEtag = String.format("W/\"%s\"", Objects.hash( getLastModified(), getProjectMessages(), getEnv().getDateForLastIndexRun().getTime(), Info.getVersion() ) ); String headerEtag = request.getHeader(HttpHeaders.IF_NONE_MATCH); if (headerEtag != null && headerEtag.equals(currentEtag)) { response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return true; } response.setHeader(HttpHeaders.ETAG, currentEtag); return false; }
Source:
private void handleCookies(String url) { String cookies = CookieManager.getInstance().getCookie(url); if (MainActivity.DEBUG) Log.d(TAG, "handleCookies: url=" + url + "; cookies=" + (cookies == null ? "null" : cookies)); Log.e(TAG, "handleCookies: url=" + url + "; cookies=" + (cookies == null ? "null" : cookies)); if (cookies == null) return; addYoutubeCookies(cookies); }

Target:
private void handleCookies(String url) { String cookies = CookieManager.getInstance().getCookie(url); if (MainActivity.DEBUG) Log.d(TAG, "handleCookies: url=" + url + "; cookies=" + (cookies == null ? "null" : cookies)); if (cookies == null) return; addYoutubeCookies(cookies); }
Source:
public void testSaveExternalEvent() { AuditLog newExternalEvent = new AuditLog(); newExternalEvent.setLogType(AuditLogType.EXTERNAL_EVENT_NORMAL); newExternalEvent.setExternal(true); newExternalEvent.setOrigin("XYZ"); newExternalEvent.setCustomEventId(123123123); newExternalEvent.setCustomData("Some text here"); newExternalEvent.setMessage("And here"); newExternalEvent.setEventFloodInSec(100); dao.save(newExternalEvent); AuditLog result = dao.get(newExternalEvent.getAuditLogId()); assertNotNull(result); assertEquals(newExternalEvent.getOrigin(), result.getOrigin()); assertEquals(newExternalEvent.getCustomEventId(), result.getCustomEventId()); assertEquals(newExternalEvent.getCustomData(), result.getCustomData()); assertEquals(newExternalEvent.getMessage(), result.getMessage()); assertEquals(newExternalEvent.getEventFloodInSec(), result.getEventFloodInSec()); }

Target:
public void testSaveExternalEvent() { AuditLog newExternalEvent = new AuditLog(); newExternalEvent.setLogType(AuditLogType.EXTERNAL_EVENT_NORMAL); newExternalEvent.setExternal(true); newExternalEvent.setOrigin("XYZ"); newExternalEvent.setCustomEventId(123123123); newExternalEvent.setCustomData("Some text here"); newExternalEvent.setMessage("And here"); newExternalEvent.setEventFloodInSec(100); dao.save(newExternalEvent); AuditLog result = dao.get(newExternalEvent.getAuditLogId()); assertNotNull(result); assertTrue(result.getAuditLogId() > 0); assertEquals(newExternalEvent.getOrigin(), result.getOrigin()); assertEquals(newExternalEvent.getCustomEventId(), result.getCustomEventId()); assertEquals(newExternalEvent.getCustomData(), result.getCustomData()); assertEquals(newExternalEvent.getMessage(), result.getMessage()); assertEquals(newExternalEvent.getEventFloodInSec(), result.getEventFloodInSec()); }
Source:
private Map<String, Object> getOss() throws IOException { CharSource charSource = backingStore.asByteSource().asCharSource(UTF_8); try (Reader reader = charSource.openBufferedStream(); JsonInput input = json.newInput(reader)) { input.beginObject(); while (input.hasNext()) { String name = input.nextName(); if ("desiredCapabilities".equals(name)) { return input.read(MAP_TYPE); } else { input.skipValue(); } } } return null; }

Target:
private @Nullable Map<String, Object> getOss() throws IOException { CharSource charSource = backingStore.asByteSource().asCharSource(UTF_8); try (Reader reader = charSource.openBufferedStream(); JsonInput input = json.newInput(reader)) { input.beginObject(); while (input.hasNext()) { String name = input.nextName(); if (DESIRED_CAPABILITIES.equals(name)) { return input.read(MAP_TYPE); } input.skipValue(); } } return null; }
Source:
public ISwingScoutFormField<?> createFormField(JComponent parent, IFormField field, ISwingEnvironment environment) { IButton scoutField = (IButton) field; switch (scoutField.getDisplayStyle()) { case IButton.DISPLAY_STYLE_RADIO: { SwingScoutButton uiField = new SwingScoutRadioButton(); uiField.createField(scoutField, environment); return uiField; } case IButton.DISPLAY_STYLE_TOGGLE: { SwingScoutButton uiField = new SwingScoutButton(); uiField.createField(scoutField, environment); return uiField; } case IButton.DISPLAY_STYLE_LINK: { SwingScoutLink uiField = new SwingScoutLink(); uiField.createField(scoutField, environment); return uiField; } default: { SwingScoutButton uiField = new SwingScoutButton(); uiField.createField(scoutField, environment); return uiField; } } }

Target:
public ISwingScoutFormField<?> createFormField(JComponent parent, IFormField field, ISwingEnvironment environment) { if (field instanceof IRadioButton) { IRadioButton scoutField = (IRadioButton) field; SwingScoutRadioButton uiField = new SwingScoutRadioButton(); uiField.createField(scoutField, environment); return uiField; } else if (field instanceof IButton) { IButton scoutField = (IButton) field; switch (scoutField.getDisplayStyle()) { case IButton.DISPLAY_STYLE_TOGGLE: { SwingScoutButton<IButton> uiField = new SwingScoutButton<IButton>(); uiField.createField(scoutField, environment); return uiField; } case IButton.DISPLAY_STYLE_RADIO: { LOG.warn("It seems your RadioButton extends from AbstractButton with getConfiguredDisplayStyle set to DISPLAY_STYLE_RADIO. Please use the class AbstractRadioButton instead."); SwingScoutButton<IButton> uiField = new SwingScoutButton<IButton>(); uiField.createField(scoutField, environment); return uiField; } case IButton.DISPLAY_STYLE_LINK: { SwingScoutLink uiField = new SwingScoutLink(); uiField.createField(scoutField, environment); return uiField; } default: { SwingScoutButton<IButton> uiField = new SwingScoutButton<IButton>(); uiField.createField(scoutField, environment); return uiField; } } } return null; }
Source:
public List<String> getStreams() { List<String> streams = new ArrayList<>(); for(ActionRuntime action: actions) { streams.add(action.getStream()); } return streams; }

Target:
public List<String> getStreams() { LOG.debug("in getStreams"); List<String> streams = new ArrayList<>(); for(ActionRuntime action: actions) { LOG.debug("Action {}, Stream {}", action, action.getStream()); streams.add(action.getStream()); } LOG.debug("Returning streams {}", streams); return streams; }
Source:
private static void call(PerunCommand command, String[] cliArgs) throws ParseException { Options options = new Options(); options.addOption(Option.builder("i").required(false).hasArg().longOpt("perun-url").desc("Perun base URL").build()); options.addOption(Option.builder("u").required(false).hasArg().longOpt("httpuser").desc("HTTP Basic Auth user").build()); options.addOption(Option.builder("p").required(false).hasArg().longOpt("httppassword").desc("HTTP Basic Auth password").build()); command.addOptions(options); CommandLine commandLine; try { commandLine = new DefaultParser().parse(options, cliArgs); } catch (MissingOptionException ex) { System.err.println(); new HelpFormatter().printHelp(command.getClass().getSimpleName(), options); System.exit(1); return; } String perunUrl = System.getenv("PERUN_URL"); if (commandLine.hasOption("i")) { perunUrl = commandLine.getOptionValue("i"); } if (perunUrl == null) perunUrl = "<LINK_0>"; String user = System.getenv("PERUN_USER"); if(commandLine.hasOption("u")) { user = commandLine.getOptionValue("u"); } if(user==null) { user = System.getProperty("user.name"); } String password = System.getenv("PERUN_PASSWORD"); if(commandLine.hasOption("p")) { password = commandLine.getOptionValue("p"); } if(password==null) { System.err.println("specify password with option -p or env variable PERUN_PASSWORD"); System.exit(1); } PerunRPC perunRPC = new PerunRPC(perunUrl, user, password); command.executeCommand(new CommandContext(perunRPC, commandLine)); }

Target:
private static void call(PerunCommand command, String[] cliArgs) throws ParseException { Options options = new Options(); options.addOption(Option.builder(PERUN_URL_OPTION).required(false).hasArg().longOpt(PERUN_URL_VARIABLE).desc("Perun base URL").build()); options.addOption(Option.builder(PERUN_USER_OPTION).required(false).hasArg().longOpt(PERUN_USER_VARIABLE).desc("HTTP Basic Auth user/password").build()); command.addOptions(options); CommandLine commandLine; try { commandLine = new DefaultParser().parse(options, cliArgs); } catch (MissingOptionException ex) { System.err.println(); new HelpFormatter().printHelp(command.getClass().getSimpleName(), options); System.exit(1); return; } String perunUrl = System.getenv(PERUN_URL_VARIABLE); if (commandLine.hasOption(PERUN_URL_OPTION)) { perunUrl = commandLine.getOptionValue(PERUN_URL_OPTION); } if (perunUrl == null) perunUrl = "<LINK_0>"; String user = System.getenv(PERUN_USER_VARIABLE); if (commandLine.hasOption(PERUN_USER_OPTION)) { user = commandLine.getOptionValue(PERUN_USER_OPTION); } if (user == null) { System.err.println("specify username and password with option " + PERUN_USER_OPTION + " or env variable " + PERUN_USER_VARIABLE + " in the format 'username/password'"); System.exit(1); } int slash = user.indexOf('/'); if (slash == -1) { System.err.println("the username and password must be separated by the '/' character"); System.exit(1); } String username = user.substring(0, slash); String password = user.substring(slash + 1); PerunRPC perunRPC = new PerunRPC(perunUrl, username, password); command.executeCommand(new CommandContext(perunRPC, commandLine)); }
Source:
private void readBinaries( int total, BytesColumnVector c, int rowId) throws IOException { int left = total; while (left > 0) { consume(); readRepetitionAndDefinitionLevels(); if (definitionLevel >= maxDefLevel) { Binary binary = dataColumn.readBytes(); c.setVal(rowId, binary.getBytesUnsafe()); c.isNull[rowId] = false; c.isRepeating = c.isRepeating && Arrays.equals(binary.getBytesUnsafe(), ArrayUtils.subarray(c.vector[0], c.start[0], c.length[0])); } else { c.isNull[rowId] = true; c.isRepeating = false; c.noNulls = false; } rowId++; left--; } }

Target:
private void readBinaries( int total, BytesColumnVector c, int rowId) throws IOException { int left = total; while (left > 0) { readRepetitionAndDefinitionLevels(); if (definitionLevel >= maxDefLevel) { c.setVal(rowId, dataColumn.readBytes().getBytesUnsafe()); c.isNull[rowId] = false; c.isRepeating = false; } else { c.isNull[rowId] = true; c.isRepeating = false; c.noNulls = false; } rowId++; left--; } }
Source:
public void addExecutorInGUI() { String name = "ScheduledExecutorGUI" + RandomStringUtils.randomAlphanumeric(6); ConfigFragment config = page.getConfigFragment(); WizardWindow wizard = config.getResourceManager().addResource(); Editor editor = wizard.getEditor(); editor.text("name", name); editor.text(JNDI_NAME, JNDI_VALID); wizard.clickSave(); Console.withBrowser(browser).dismissReloadRequiredWindowIfPresent(); assertTrue("Scheduled executor should be present in table", config.resourceIsPresent(name)); ResourceAddress address = new ResourceAddress(eeAddress).add(EE_CHILD, name); verifier.verifyResource(address, true, 5000); removeEEChild(EE_CHILD, name); }

Target:
public void addExecutorInGUI() { String name = "ScheduledExecutorGUI" + RandomStringUtils.randomAlphanumeric(6); ConfigFragment config = page.getConfigFragment(); WizardWindow wizard = config.getResourceManager().addResource(); Editor editor = wizard.getEditor(); editor.text("name", name); editor.text(JNDI_NAME, JNDI_VALID); wizard.saveAndDismissReloadRequiredWindow(); assertTrue("Scheduled executor should be present in table", config.resourceIsPresent(name)); ResourceAddress address = new ResourceAddress(eeAddress).add(EE_CHILD, name); verifier.verifyResource(address, true, 5000); removeEEChild(EE_CHILD, name); }
Source:
public void dumpTreeAsString(String filePath) { try { FileWriter writer = new FileWriter(filePath); List<ConceptTreeNode<T>> nodeList = getBreadthOrderedNodeList(); for (ConceptTreeNode<T> node : nodeList) { String parent = ""; if (isRoot(node)) parent = "NIL"; else parent = getParent(node).getLabel(); writer.write(parent + "\t" + node.getLabel() + "\t" + node.getLabelDescription() + "\t" + node.getConceptVector().toString() + "\n"); } writer.close(); } catch (Exception e) { e.printStackTrace(); } }

Target:
public void dumpTreeAsString(String filePath) { try(FileWriter writer = new FileWriter(filePath)) { List<ConceptTreeNode<T>> nodeList = getBreadthOrderedNodeList(); for (ConceptTreeNode<T> node : nodeList) { String parent; if (isRoot(node)) parent = NIL; else parent = getParent(node).getLabelID(); writer.write(parent + "\t" + node.getLabelID() + "\t" + node.getLabelDescription() + "\t" + node.getConceptVector().toString() + "\n"); } } catch (IOException e) { e.printStackTrace(); logger.error("Error writing to file at " + filePath); throw new RuntimeException("Error writing to file at " + filePath); } }
Source:
private List<AttributeValidationReport> validateAttributeSerializable( String attributeName, Serializable serializable) { List<AttributeValidationReport> validationReportList = new ArrayList<>(); for (AttributeValidator attributeValidator : validators) { Attribute newAttribute = new AttributeImpl(attributeName, serializable); Optional<AttributeValidationReport> attributeValidationReport = attributeValidator.validate(newAttribute); if (attributeValidationReport.isPresent()) { validationReportList.add(attributeValidationReport.get()); } } return validationReportList; }

Target:
private List<AttributeValidationReport> validateAttributeSerializable( String attributeName, Serializable serializable) { Attribute newAttribute = new AttributeImpl(attributeName, serializable); List<AttributeValidationReport> validationReportList = new ArrayList<>(); for (AttributeValidator attributeValidator : validators) { Optional<AttributeValidationReport> attributeValidationReport = attributeValidator.validate(newAttribute); if (attributeValidationReport.isPresent()) { validationReportList.add(attributeValidationReport.get()); } } return validationReportList; }
Source:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 0) { return false; } Player p; String reason = ""; try { p = getPlayer(args[0]); if(args.length > 1) { for(int i = 1; i < args.length; i++) { reason = reason + args[i] + " "; } } } catch (CantFindPlayerException ex) { playerMsg(ex.getMessage(), ChatColor.RED); return true; } TFM_Util.bcastMsg(p.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED); TFM_WorldEditBridge.getInstance().undo(p, 15); TFM_RollbackManager.rollback(p); p.setOp(false); p.setGameMode(GameMode.SURVIVAL); p.getInventory().clear(); final Location target_pos = p.getLocation(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(target_pos.getWorld(), target_pos.getBlockX() + x, target_pos.getBlockY(), target_pos.getBlockZ() + z); target_pos.getWorld().strikeLightning(strike_pos); } } String user_ip = p.getAddress().getAddress().getHostAddress(); String[] ip_parts = user_ip.split("\\."); if (ip_parts.length == 4) { user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]); } TFM_Util.bcastMsg(String.format("Banning: %s, IP: %s.", p.getName(), user_ip), ChatColor.RED); TFM_ServerInterface.banIP(user_ip, null, null, null); TFM_ServerInterface.banUsername(p.getName(), null, null, null); if(args.length == 1) { p.kickPlayer("GTFO"); } else { p.kickPlayer(reason); } return true; }

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 0) { return false; } Player p; String ban_reason = ""; try { p = getPlayer(args[0]); if(args.length > 1) { ban_reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); } } catch (CantFindPlayerException ex) { playerMsg(ex.getMessage(), ChatColor.RED); return true; } TFM_Util.bcastMsg(p.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED); TFM_WorldEditBridge.getInstance().undo(p, 15); TFM_RollbackManager.rollback(p); p.setOp(false); p.setGameMode(GameMode.SURVIVAL); p.getInventory().clear(); final Location target_pos = p.getLocation(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(target_pos.getWorld(), target_pos.getBlockX() + x, target_pos.getBlockY(), target_pos.getBlockZ() + z); target_pos.getWorld().strikeLightning(strike_pos); } } String user_ip = p.getAddress().getAddress().getHostAddress(); String[] ip_parts = user_ip.split("\\."); if (ip_parts.length == 4) { user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]); } TFM_Util.bcastMsg(String.format("Banning: %s, IP: %s.", p.getName(), user_ip), ChatColor.RED); TFM_ServerInterface.banIP(user_ip, ban_reason, null, null); TFM_ServerInterface.banUsername(p.getName(), ban_reason, null, null); p.kickPlayer("GTFO"); return true; }
Source:
public PersistentLockId acquireBackupLock(String reason) { Preconditions.checkNotNull(reason, "Please provide a reason for acquiring the lock."); return PersistentLockId.withId(lockStore.acquireBackupLock(reason).instanceId()); }

Target:
public PersistentLockId acquireBackupLock(String reason) { Preconditions.checkNotNull(reason, "Please provide a reason for acquiring the lock."); return PersistentLockId.of(lockStore.acquireBackupLock(reason).instanceId()); }