auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) throws Throwable { CompletionStage<Void> stage; if (command instanceof TxReadOnlyKeyCommand) { stage = entryFactory.wrapEntryForWriting(ctx, command.getKey(), command.getSegment(), ignoreOwnership(command) || canRead(command), true); } else { stage = entryFactory.wrapEntryForReading(ctx, command.getKey(), command.getSegment(), ignoreOwnership(command) || canRead(command)); } if (CompletionStages.isCompletedSuccessfully(stage)) { return invokeNext(ctx, command); } else { return asyncInvokeNext(ctx, command, stage); } }

Target:
public Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) throws Throwable { CompletionStage<Void> stage; if (command instanceof TxReadOnlyKeyCommand) { stage = entryFactory.wrapEntryForWriting(ctx, command.getKey(), command.getSegment(), ignoreOwnership(command) || canRead(command), true); } else { stage = entryFactory.wrapEntryForReading(ctx, command.getKey(), command.getSegment(), ignoreOwnership(command) || canRead(command)); } return asyncInvokeNext(ctx, command, stage); }
Source:
@Override protected <T> PrioritizedListenableFutureTask<T> newTaskFor(Runnable runnable, T value) { return PrioritizedListenableFutureTask.create(ListenableFutureTask.create(runnable, value), runnable instanceof PrioritizedRunnable ? ((PrioritizedRunnable) runnable).getPriority() : DEFAULT_PRIORITY ); }

Target:
@Override protected <T> PrioritizedListenableFutureTask<T> newTaskFor(Runnable runnable, T value) { Preconditions.checkArgument(allowRegularTasks || runnable instanceof PrioritizedRunnable, "task does not implement PrioritizedRunnable"); return PrioritizedListenableFutureTask.create(ListenableFutureTask.create(runnable, value), runnable instanceof PrioritizedRunnable ? ((PrioritizedRunnable) runnable).getPriority() : defaultPriority ); }
Source:
private String getArtifactViewApplicabiltyText() { String viewName = null; if (explorer != null) { BranchId branch = explorer.getBranch(); if (branch != null) { if (!ViewApplicabilityUtil.isBranchOfProductLine(branch)) { button.setEnabled(false); } else { button.setEnabled(true); ArtifactId viewId = explorer.getViewId(); if (viewId.isValid()) { viewName = ArtifactQuery.getArtifactTokenFromId(explorer.getBranch(), viewId).getName(); } } } } return String.format("<form><p>%s</p></form>", viewName == null ? "Not Set" : viewName); }

Target:
private String getArtifactViewApplicabiltyText() { String viewName = "Not Set"; if (explorer != null) { BranchId branch = explorer.getBranch(); if (branch != null) { if (!ViewApplicabilityUtil.isBranchOfProductLine(branch)) { button.setEnabled(false); } else { button.setEnabled(true); ArtifactId viewId = explorer.getViewId(); if (viewId.isValid()) { viewName = ArtifactQuery.getArtifactTokenFromId(explorer.getBranch(), viewId).getName(); } } } } return String.format("<form><p>%s</p></form>", viewName); }
Source:
public void run() { service.submit(new Runnable() { @Override public void run() { while (true) { while (avroDataStream.hasNext()) { if (!keepIndexing) { return; } GenericRecord record = avroDataStream.next(); GenericRecord message = new GenericData.Record(AvroUtils.getAvroSchemaFromPinotSchema(pinotSchema)); for (FieldSpec spec : pinotSchema.getDimensionFieldSpecs()) { message.put(spec.getName(), record.get(spec.getName())); } for (FieldSpec spec : pinotSchema.getDimensionFieldSpecs()) { message.put(spec.getName(), record.get(spec.getName())); } TimeFieldSpec spec = pinotSchema.getTimeFieldSpec(); String timeColumn = spec.getName(); message.put(timeColumn, currentTimeValue); try { publish(message); counter++; if (counter % 60 == 0) { currentTimeValue = currentTimeValue + 1; } Thread.sleep(1000); } catch (Exception e) { logger.error(e.getMessage()); } } try { avroDataStream.close(); } catch (IOException e) { logger.error(e.getMessage()); } try { createStream(); } catch (IOException e) { logger.error(e.getMessage()); } } } }); }

Target:
public void run() { service.submit(new Runnable() { @Override public void run() { while (true) { while (avroDataStream.hasNext()) { if (!keepIndexing) { return; } GenericRecord record = avroDataStream.next(); GenericRecord message = new GenericData.Record(AvroUtils.getAvroSchemaFromPinotSchema(pinotSchema)); for (FieldSpec spec : pinotSchema.getDimensionFieldSpecs()) { message.put(spec.getName(), record.get(spec.getName())); } for (FieldSpec spec : pinotSchema.getDimensionFieldSpecs()) { message.put(spec.getName(), record.get(spec.getName())); } TimeFieldSpec spec = pinotSchema.getTimeFieldSpec(); String timeColumn = spec.getIncomingGranularitySpec().getName(); message.put(timeColumn, currentTimeValue); try { publish(message); counter++; if (counter % 60 == 0) { currentTimeValue = currentTimeValue + 1; } Thread.sleep(1000); } catch (Exception e) { logger.error(e.getMessage()); } } try { avroDataStream.close(); } catch (IOException e) { logger.error(e.getMessage()); } try { createStream(); } catch (IOException e) { logger.error(e.getMessage()); } } } }); }
Source:
public static void initialize() throws Exception { repoFile = Files.createTempDir(); System.setProperty("org.uberfire.nio.git.daemon.enabled", "false"); System.setProperty("org.uberfire.nio.git.ssh.enabled", "false"); System.setProperty("org.uberfire.sys.repo.monitor.disabled", "true"); System.setProperty(ArtifactRepositoryService.ORG_GUVNOR_M2REPO_DIR_PROPERTY, repoFile.getAbsolutePath()); weldContainer = new Weld().initialize(); ioService = weldContainer.select(IOService.class, new NamedLiteral("ioStrategy")).get(); buildService = weldContainer.select(BuildService.class).get(); moduleService = weldContainer.select(KieModuleService.class).get(); classLoaderHelper = weldContainer.select(ModuleClassLoaderHelper.class).get(); formFinderService = weldContainer.select(ModuleFormFinderServiceImpl.class).get(); fs.forceAsDefault(); }

Target:
public static void initialize() throws Exception { repoFile = Files.createTempDir(); System.setProperty(JGitFileSystemProviderConfiguration.GIT_DAEMON_ENABLED, "false"); System.setProperty(JGitFileSystemProviderConfiguration.GIT_SSH_ENABLED, "false"); System.setProperty("org.uberfire.sys.repo.monitor.disabled", "true"); System.setProperty(ArtifactRepositoryService.ORG_GUVNOR_M2REPO_DIR_PROPERTY, repoFile.getAbsolutePath()); weldContainer = new Weld().initialize(); ioService = weldContainer.select(IOService.class, new NamedLiteral("ioStrategy")).get(); buildService = weldContainer.select(BuildService.class).get(); moduleService = weldContainer.select(KieModuleService.class).get(); classLoaderHelper = weldContainer.select(ModuleClassLoaderHelper.class).get(); formFinderService = weldContainer.select(ModuleFormFinderServiceImpl.class).get(); fs.forceAsDefault(); }
Source:
protected GraphHopper createGraphHopper(CmdArgs args) { GraphHopper tmp = new GraphHopperOSM().forServer().init(args); tmp.setSpatialRuleLookup(SpatialRuleLookupBuilder.build()); tmp.importOrLoad(); logger.info("loaded graph at:" + tmp.getGraphHopperLocation() + ", data_reader_file:" + tmp.getDataReaderFile() + ", flag_encoders:" + tmp.getEncodingManager() + ", " + tmp.getGraphHopperStorage().toDetailsString()); return tmp; }

Target:
protected GraphHopper createGraphHopper(CmdArgs args) { GraphHopper tmp = new GraphHopperOSM().forServer().init(args); String location = args.get("spatial_rules.location", ""); if (!location.isEmpty()) { if (!tmp.getEncodingManager().supports(("generic"))) { logger.warn("spatial_rules.location was specified but 'generic' encoder is missing to utilize the index"); } else try { SpatialRuleLookup index = buildIndex(new FileReader(location), tmp.getGraphHopperStorage().getBounds()); if (index != null) { logger.info("Set spatial rule lookup with " + index.size() + " rules"); ((DataFlagEncoder) tmp.getEncodingManager().getEncoder("generic")).setSpatialRuleLookup(index); } } catch (IOException ex) { throw new RuntimeException(ex); } } tmp.importOrLoad(); logger.info("loaded graph at:" + tmp.getGraphHopperLocation() + ", data_reader_file:" + tmp.getDataReaderFile() + ", flag_encoders:" + tmp.getEncodingManager() + ", " + tmp.getGraphHopperStorage().toDetailsString()); return tmp; }
Source:
public AuthHeader fromString(final String value) { try { return AuthHeader.valueOf(value); } catch (IllegalArgumentException e) { throw new NotAuthorizedException(e, "Bearer"); } }

Target:
public AuthHeader fromString(final String value) { if (value == null) { throw new NotAuthorizedException("Bearer"); } try { return AuthHeader.valueOf(value); } catch (IllegalArgumentException e) { throw new NotAuthorizedException(e, "Bearer"); } }
Source:
public String generateVersionCrid(Item item, Version version) { String versionCrid = delegate.generateVersionCrid(item, version); Optional<String> value = idMappingStore.getValueFor(version.getCanonicalUri()); if (!value.isPresent() || !versionCrid.equals(value.get())) { idMappingStore.storeMapping(version.getCanonicalUri(), versionCrid); } return versionCrid; }

Target:
public String generateVersionCrid(Item item, Version version) { String versionCrid = delegate.generateVersionCrid(item, version); idMappingStore.storeMapping(version.getCanonicalUri(), versionCrid); return versionCrid; }
Source:
protected void finishFileInfo() throws IOException { if (lastCell != null) { byte lastKey = PrivateCellUtil.getCellKeySerializedAsKeyValueKey(this.lastCell); fileInfo.append(HFileInfo.LASTKEY, lastKey, false); } int avgKeyLen = (int)this.keySizeSketch.getQuantile(0.5); fileInfo.append(HFileInfo.AVG_KEY_LEN, Bytes.toBytes(avgKeyLen), false); int avgValueLen = (int)this.valueSizeSketch.getQuantile(0.5); fileInfo.append(HFileInfo.AVG_VALUE_LEN, Bytes.toBytes(avgValueLen), false); fileInfo.append(HFileInfo.CREATE_TIME_TS, Bytes.toBytes(hFileContext.getFileCreateTime()), false); if (hFileContext.isIncludesTags()) { fileInfo.append(HFileInfo.MAX_TAGS_LEN, Bytes.toBytes(this.maxTagsLength), false); boolean tagsCompressed = (hFileContext.getDataBlockEncoding() != DataBlockEncoding.NONE) && hFileContext.isCompressTags(); fileInfo.append(HFileInfo.TAGS_COMPRESSED, Bytes.toBytes(tagsCompressed), false); } }

Target:
protected void finishFileInfo() throws IOException { if (lastCell != null) { byte lastKey = PrivateCellUtil.getCellKeySerializedAsKeyValueKey(this.lastCell); fileInfo.append(HFileInfo.LASTKEY, lastKey, false); } int medianKeyLen = (int)this.keySizeSketch.getQuantile(0.5); fileInfo.append(HFileInfo.AVG_KEY_LEN, Bytes.toBytes(medianKeyLen), false); int medianValueLen = (int)this.valueSizeSketch.getQuantile(0.5); fileInfo.append(HFileInfo.AVG_VALUE_LEN, Bytes.toBytes(medianValueLen), false); fileInfo.append(HFileInfo.CREATE_TIME_TS, Bytes.toBytes(hFileContext.getFileCreateTime()), false); if (hFileContext.isIncludesTags()) { fileInfo.append(HFileInfo.MAX_TAGS_LEN, Bytes.toBytes(this.maxTagsLength), false); boolean tagsCompressed = (hFileContext.getDataBlockEncoding() != DataBlockEncoding.NONE) && hFileContext.isCompressTags(); fileInfo.append(HFileInfo.TAGS_COMPRESSED, Bytes.toBytes(tagsCompressed), false); } }
Source:
protected void loadAvailableModels() { logger.info("Registering existing models"); try (Stream<java.nio.file.Path> walk = Files.walk(Paths.get(runtimeOptions.getImportsBaseDir()), 1)) { walk.filter(p -> p.toFile().isFile()) .filter(p -> p.toString().toLowerCase().endsWith(DASHBOARD_EXTENSION)) .map(p -> p.toString()) .peek(p -> logger.info("Registering {}", p)) .peek(runtimeModelRegistry::registerFile) .forEach(p -> logger.info("Sucessfully Registered {}", p)); } catch (Exception e) { logger.info("Error Registering existing models"); logger.debug("Error Registering existing models.", e); throw new RuntimeException("Error registering existing models.", e); } }

Target:
protected void loadAvailableModels() { logger.info("Registering existing models"); try (Stream<java.nio.file.Path> walk = Files.walk(Paths.get(runtimeOptions.getImportsBaseDir()), 1)) { walk.filter(p -> p.toFile().isFile() && p.toString().toLowerCase().endsWith(DASHBOARD_EXTENSION)) .map(Object::toString) .forEach(p -> { logger.info("Registering {}", p); runtimeModelRegistry.registerFile(p); logger.info("Sucessfully Registered {}", p); }); } catch (Exception e) { throw new RuntimeException("Error registering existing models.", e); } }
Source:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { Expression child = getStringExpression(); if (!child.evaluate(tuple, ptr)) { return false; } int position; if(strToSearch.length()==0){ position = 0; ptr.set(PInteger.INSTANCE.toBytes(position)); return true; } byte strPattern = strToSearch.getBytes(); SortOrder sortOrder = child.getSortOrder(); ImmutableBytesWritable str = new ImmutableBytesWritable(strPattern); position = searchString(ptr,str,sortOrder,strPattern); ptr.set(PInteger.INSTANCE.toBytes(position)); return true; }

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { Expression child = getChildren().get(0); if (!child.evaluate(tuple, ptr)) { return false; } if (ptr.getLength() == 0) { ptr.set(ByteUtil.EMPTY_BYTE_ARRAY); return true; } int position; if (strToSearch == null){ position = 0; ptr.set(PInteger.INSTANCE.toBytes(position)); return true; } String sourceStr = (String) PVarchar.INSTANCE.toObject(ptr, getChildren().get(0).getSortOrder()); position = sourceStr.indexOf(strToSearch); ptr.set(PInteger.INSTANCE.toBytes(position)); return true; }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append('{'); for (java.util.Map.Entry<byte[], byte[]> entry : _map.entrySet()) { if (sb.length() > 1) { sb.append(','); } sb.append(new String(entry.getKey())); sb.append('='); sb.append(new String(entry.getValue())); } sb.append('}'); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append('{'); for (java.util.Map.Entry<byte[], byte[]> entry : _map.entrySet()) { if (sb.length() > 1) { sb.append(','); } sb.append(Bytes.toString(entry.getKey())); sb.append('='); sb.append(Bytes.toString(entry.getValue())); } sb.append('}'); return sb.toString(); }
Source:
public void handleMessage(Message msg) { switch (msg.what) { case EVENT_QUALIFIED_NETWORKS_CHANGED: synchronized (this) { AsyncResult ar = (AsyncResult) msg.obj; List<QualifiedNetworks> networks = (List<QualifiedNetworks>) ar.result; updateAvailableNetworks(networks); } break; default: loge("Unexpected event " + msg.what); break; } }

Target:
public void handleMessage(Message msg) { switch (msg.what) { case EVENT_QUALIFIED_NETWORKS_CHANGED: AsyncResult ar = (AsyncResult) msg.obj; List<QualifiedNetworks> networks = (List<QualifiedNetworks>) ar.result; updateAvailableNetworks(networks); break; default: loge("Unexpected event " + msg.what); break; } }
Source:
private List<Object> getResources(final List<String> paths) { return paths.stream().map(path -> resourceResolver.getResource(path)) .collect(Collectors.toList()); }

Target:
List<Object> getResources(final List<String> paths) { return Optional.ofNullable(paths) .map(Collection::stream) .orElseGet(Stream::empty) .map(path -> resourceResolver.getResource(path)) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
public void init() { log.info("MQTT inbound endpoint: " + name + " initializing ..."); if (mqttBlockingSenderEnable) initSyncClient(); else initAsyncClient(); }

Target:
public void init() { log.info("MQTT inbound endpoint: " + name + " initializing ..."); if (mqttBlockingSenderEnable){ initSyncClient(); } else{ initAsyncClient(); } }
Source:
public void waitForCleanup() throws InterruptedException { SECONDS.sleep(8); }

Target:
public void waitForCleanup() throws InterruptedException { Set<Long> waiting = new HashSet<>(ids); for (int i=0; i<10 && !waiting.isEmpty(); ++i) { SECONDS.sleep(1); for (Iterator<Long> it = waiting.iterator(); it.hasNext(); ) { try { getWorkflowInstance(it.next()); } catch (NotFoundException ex) { it.remove(); } } } }
Source:
public List<GameDetails> getListOfGames(@PathVariable(value = "gameListType") String gameListType, @RequestParam(value = "token", required = false) String token) throws AuthenticationException, GameException, WrongPathException { List<GameBean> games; UserBean user; int userId = 0; switch (GameListType.fromValue(gameListType)) { case CURRENT: user = authenticationService.authenticateUserByToken(token); userId = user.getId(); games = gameService.getListOfGamesWithJoinedUser(user); break; case PUBLIC: try { user = authenticationService.authenticateUserByToken(token); userId = user.getId(); } catch (Exception e) games = gameService.getListOfAllPublicGames(); break; case UNKNOWN: default: throw new WrongPathException(); } List<GameDetails> gamesToReturn = new ArrayList<GameDetails>(); for (GameBean game : games) { gamesToReturn.add(new GameDetails(game, userId)); } return gamesToReturn; }

Target:
public List<GameDetails> getListOfGames(@PathVariable(value = "gameListType") String gameListType, @RequestParam(value = "token", required = false) String token) throws AuthenticationException, GameException, WrongPathException { List<GameBean> games; switch (GameListType.fromValue(gameListType)) { case CURRENT: UserBean user = authenticationService.authenticateUserByToken(token); games = gameService.getListOfGamesWithJoinedUser(user); break; case PUBLIC: games = gameService.getListOfAllPublicGames(); break; case UNKNOWN: default: throw new WrongPathException(); } List<GameDetails> gamesToReturn = new ArrayList<GameDetails>(); for (GameBean game : games) { gamesToReturn.add(new GameDetails(game, 0)); } return gamesToReturn; }
Source:
protected SafeHtml getRenderedImage(IconType value, String color) { SafeStyles colorStyle = new SafeStylesBuilder().trustedColor(color).toSafeStyles(); return TEMPLATE.icon(value.getCssName(), colorStyle); }

Target:
protected SafeHtml getRenderedImage(IconType value, String color) { SafeStyles styles = new SafeStylesBuilder().trustedColor(color).toSafeStyles(); return TEMPLATE.icon(value.getCssName(), styles); }
Source:
private DeepLinkEntry findEntry(String uriString) { SchemeHostAndPath schemeHostAndPath = new SchemeHostAndPath(DeepLinkUri.parse(uriString)); DeepLinkEntry entryRegExpMatch = null; DeepLinkEntry entryIdxMatch = null; long regExSearchStart = SystemClock.elapsedRealtime(); long regExSearchEnd = SystemClock.elapsedRealtime(); long idxSearchStart = SystemClock.elapsedRealtime(); for (BaseLoader loader : loaders) { entryIdxMatch = loader.idxMatch(DeepLinkUri.parse(uriString)); if (entryIdxMatch != null) { break; } } long idxSearchEnd = SystemClock.elapsedRealtime(); return entryIdxMatch; }

Target:
private DeepLinkEntry findEntry(String uriString) { DeepLinkEntry entryRegExpMatch = null; DeepLinkEntry entryIdxMatch = null; for (BaseRegistry loader : loaders) { entryIdxMatch = loader.idxMatch(DeepLinkUri.parse(uriString)); if (entryIdxMatch != null) { break; } } return entryIdxMatch; }
Source:
private Set<Module> findModulesToBuild(RepositoryBuild build, Set<Module> allModules) { CommitInfo commitInfo = build.getCommitInfo().get(); final Set<Module> toBuild = new HashSet<>(); if (build.getBuildTrigger().getType() == Type.MANUAL) { if (!build.getBuildOptions().isPresent() || build.getBuildOptions().get().getModuleIds().isEmpty()) { toBuild.addAll(allModules); } else { final Set<Integer> requestedModuleIds = build.getBuildOptions().get().getModuleIds(); for (Module module : allModules) { if (requestedModuleIds.contains(module.getId().get())) { toBuild.add(module); } } addDownstreamModules(build, allModules, toBuild); } } else if (build.getBuildTrigger().getType() == Type.BRANCH_CREATION) { toBuild.addAll(allModules); } else if (commitInfo.isTruncated()) { toBuild.addAll(allModules); } else { for (String path : gitHubHelper.affectedPaths(commitInfo)) { for (Module module : allModules) { if (module.contains(FileSystems.getDefault().getPath(path))) { toBuild.add(module); } } } addDownstreamModules(build, allModules, toBuild); } return toBuild; }

Target:
private Set<Module> findModulesToBuild(RepositoryBuild build, Set<Module> allModules) { CommitInfo commitInfo = build.getCommitInfo().get(); final Set<Module> toBuild = new HashSet<>(); if (build.getBuildTrigger().getType() == Type.MANUAL) { if (build.getBuildOptions().getModuleIds().isEmpty()) { toBuild.addAll(allModules); } else { final Set<Integer> requestedModuleIds = build.getBuildOptions().getModuleIds(); for (Module module : allModules) { if (requestedModuleIds.contains(module.getId().get())) { toBuild.add(module); } } addDownstreamModules(build, allModules, toBuild); } } else if (build.getBuildTrigger().getType() == Type.BRANCH_CREATION) { toBuild.addAll(allModules); } else if (commitInfo.isTruncated()) { toBuild.addAll(allModules); } else { for (String path : gitHubHelper.affectedPaths(commitInfo)) { for (Module module : allModules) { if (module.contains(FileSystems.getDefault().getPath(path))) { toBuild.add(module); } } } addDownstreamModules(build, allModules, toBuild); } return toBuild; }
Source:
private boolean canClaimSegment(int segmentId) { if (segmentReleaseDeadlines.containsKey(segmentId) && segmentReleaseDeadlines.get(segmentId) > System.currentTimeMillis()){ return false; } segmentReleaseDeadlines.remove(segmentId); return true; }

Target:
private boolean canClaimSegment(int segmentId) { return !segmentReleaseDeadlines.containsKey(segmentId) || segmentReleaseDeadlines.get(segmentId) < System.currentTimeMillis(); }
Source:
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { switch (opcode) { case Opcodes.INVOKEVIRTUAL: case Opcodes.INVOKESPECIAL: case Opcodes.INVOKESTATIC: _methodInsnName = name; _methodInsnOwner = owner; _methodInsnDesc = desc; _methodInsnOpcode = opcode; break; default: LOGGER.debug("Unexpected opcode, falling back"); break; } super.visitMethodInsn(opcode, owner, name, desc, itf); }

Target:
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { switch (opcode) { case Opcodes.INVOKEVIRTUAL: case Opcodes.INVOKESPECIAL: case Opcodes.INVOKESTATIC: _methodInsnName = name; _methodInsnOwner = owner; _methodInsnDesc = desc; _methodInsnOpcode = opcode; break; default: System.out.println("Unexpected opcode, falling back"); break; } super.visitMethodInsn(opcode, owner, name, desc, itf); }
Source:
public boolean equals(Object obj) { return id == ((Nomination) obj).id; }

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } return id == ((Nomination) obj).id; }
Source:
public Repository getRepository(final IPath location) { Repository repository = null; int largestSegmentCount = 0; List<File> toRemove = new ArrayList<>(); synchronized (repositoryCache) { for (Iterator<Map.Entry<File, Reference<Repository>>> i = repositoryCache .entrySet().iterator(); i.hasNext();) { Map.Entry<File, Reference<Repository>> entry = i.next(); Repository repo = entry.getValue().get(); if (repo == null) { i.remove(); toRemove.add(entry.getKey()); continue; } if (repo.isBare()) { continue; } IPath repoPath = new Path(repo.getWorkTree().getAbsolutePath()); if (location != null && repoPath.isPrefixOf(location)) { if (repository == null || repoPath.segmentCount() > largestSegmentCount) { if (!repo.getDirectory().exists()) { i.remove(); toRemove.add(entry.getKey()); continue; } repository = repo; largestSegmentCount = repoPath.segmentCount(); } } } } removeIndexDiffCaches(toRemove); return repository; }

Target:
public Repository getRepository(final IPath location) { if (location == null) { return null; } Repository repository = null; int largestSegmentCount = 0; List<File> toRemove = new ArrayList<>(); synchronized (repositoryCache) { for (Iterator<Map.Entry<File, Reference<Repository>>> i = repositoryCache .entrySet().iterator(); i.hasNext();) { Map.Entry<File, Reference<Repository>> entry = i.next(); Repository repo = entry.getValue().get(); if (repo == null) { i.remove(); toRemove.add(entry.getKey()); continue; } if (repo.isBare()) { continue; } IPath repoPath = new Path(repo.getWorkTree().getAbsolutePath()); if (repoPath.isPrefixOf(location)) { if (repository == null || repoPath.segmentCount() > largestSegmentCount) { if (!repo.getDirectory().exists()) { i.remove(); toRemove.add(entry.getKey()); continue; } repository = repo; largestSegmentCount = repoPath.segmentCount(); } } } } removeIndexDiffCaches(toRemove); return repository; }
Source:
public EntitySearchInfo(IAutoCompleter crossRefAutoCompleter, IConditionFieldAutoCompleter conditionFieldAutoCompleter, String relatedTableNameWithOutTags, String relatedTableName, String primeryKeyName, String defaultSort) { super(); this.crossRefAutoCompleter = crossRefAutoCompleter; this.conditionFieldAutoCompleter = conditionFieldAutoCompleter; this.relatedTableNameWithOutTags = relatedTableNameWithOutTags; this.relatedTableName = relatedTableName; this.primeryKeyName = primeryKeyName; this.defaultSort = defaultSort; }

Target:
public EntitySearchInfo(IAutoCompleter crossRefAutoCompleter, IConditionFieldAutoCompleter conditionFieldAutoCompleter, String relatedTableNameWithOutTags, String relatedTableName, String primeryKeyName, String defaultSort) { this.crossRefAutoCompleter = crossRefAutoCompleter; this.conditionFieldAutoCompleter = conditionFieldAutoCompleter; this.relatedTableNameWithOutTags = relatedTableNameWithOutTags; this.relatedTableName = relatedTableName; this.primeryKeyName = primeryKeyName; this.defaultSort = defaultSort; }
Source:
private void handleLogReplicationQueryLeadership(CorfuMsg msg, ChannelHandlerContext ctx, IServerRouter r) { log.info("******Log Replication Query Leadership Request received by Server."); LogReplicationQueryLeaderShipResponse resp = new LogReplicationQueryLeaderShipResponse(0, getSinkManager().isLeader()); r.sendResponse(ctx, msg, CorfuMsgType.LOG_REPLICATION_QUERY_LEADERSHIP_RESPONSE.payloadMsg(resp)); }

Target:
private void handleLogReplicationQueryLeadership(CorfuMsg msg, ChannelHandlerContext ctx, IServerRouter r) { log.info("Log Replication Query Leadership Request received by Server."); LogReplicationQueryLeaderShipResponse resp = new LogReplicationQueryLeaderShipResponse(0, isLeader.get(), serverContext.getLocalEndpoint()); r.sendResponse(msg, CorfuMsgType.LOG_REPLICATION_QUERY_LEADERSHIP_RESPONSE.payloadMsg(resp)); }
Source:
private static void registerClusteredLockManager(BasicComponentRegistry registry, GlobalConfiguration globalConfig, CompletableFuture<CacheHolder> future, ClusteredLockManagerConfiguration config) { ClusteredLockManager clusteredLockManager = new EmbeddedClusteredLockManager(future, config); registry.registerComponent(ClusteredLockManager.class, clusteredLockManager, true); if (globalConfig.globalJmxStatistics().enabled()) { CacheManagerJmxRegistration jmxRegistration = registry.getComponent(CacheManagerJmxRegistration.class).running(); jmxRegistration.registerMBean(clusteredLockManager); } }

Target:
private static void registerClusteredLockManager(BasicComponentRegistry registry, GlobalConfiguration globalConfig, CompletableFuture<CacheHolder> future, ClusteredLockManagerConfiguration config) { ClusteredLockManager clusteredLockManager = new EmbeddedClusteredLockManager(future, config); registry.registerComponent(ClusteredLockManager.class, clusteredLockManager, true); if (globalConfig.statistics()) { CacheManagerJmxRegistration jmxRegistration = registry.getComponent(CacheManagerJmxRegistration.class).running(); jmxRegistration.registerMBean(clusteredLockManager); } }
Source:
public void setThingTypeRegistry(ThingTypeRegistry thingTypeRegistry) { this.thingTypeRegistry = thingTypeRegistry; }

Target:
protected void setThingTypeRegistry(ThingTypeRegistry thingTypeRegistry) { this.thingTypeRegistry = thingTypeRegistry; }
Source:
public static VmPayload map(org.ovirt.engine.api.model.VmPayload entity, VmPayload template) { VmPayload model = template != null ? template : new VmPayload(); model.setType(VmDeviceType.valueOf(entity.getType().toUpperCase())); model.setFileName(entity.getFile().getName()); model.setContent(entity.getFile().getContent()); return model; }

Target:
public static VmPayload map(org.ovirt.engine.api.model.VmPayload entity, VmPayload template) { VmPayload model = template != null ? template : new VmPayload(); model.setType(VmDeviceType.valueOf(entity.getType().toUpperCase())); if (entity.getFile() != null) { model.setFileName(entity.getFile().getName()); model.setContent(entity.getFile().getContent()); } return model; }
Source:
public void setDefaultCapacityMap(ClusterConfigProperty capacityPropertyType, Map<String, Integer> capacityDataMap) throws IllegalArgumentException { if (capacityDataMap == null || capacityDataMap.size() == 0) { throw new IllegalArgumentException("Default capacity data is empty"); } Map<String, String> data = new HashMap<>(); capacityDataMap.entrySet().stream().forEach(entry -> { if (entry.getValue() < 0) { throw new IllegalArgumentException(String .format("Default capacity data contains a negative value: %s = %d", entry.getKey(), entry.getValue())); } data.put(entry.getKey(), Integer.toString(entry.getValue())); }); _record.setMapField(capacityPropertyType.name(), data); }

Target:
public void setDefaultCapacityMap(ClusterConfigProperty capacityPropertyType, Map<String, Integer> capacityDataMap) throws IllegalArgumentException { if (capacityDataMap == null) { throw new IllegalArgumentException("Default capacity data is null"); } Map<String, String> data = new HashMap<>(); capacityDataMap.entrySet().stream().forEach(entry -> { if (entry.getValue() < 0) { throw new IllegalArgumentException(String .format("Default capacity data contains a negative value: %s = %d", entry.getKey(), entry.getValue())); } data.put(entry.getKey(), Integer.toString(entry.getValue())); }); _record.setMapField(capacityPropertyType.name(), data); }
Source:
public void testFilterNicsWithUnmanagedNetworks(){ List<VdsNetworkInterface> existingInterfaces = new ArrayList<VdsNetworkInterface>(); for(int i=0; i<10; i++){ Nic nic = new Nic(); nic.setName("eth" + i); NetworkImplementationDetails networkImplementationDetails = new NetworkImplementationDetails(true, i%2==1); nic.setNetworkImplementationDetails(networkImplementationDetails); existingInterfaces.add(nic); } UnmanagedNetworkValidator validator = new UnmanagedNetworkValidator(); List<VdsNetworkInterface> unmanagedNicsList = validator.filterNicsWithUnmanagedNetworks(existingInterfaces, new HashSet<String>()); assertEquals(5, unmanagedNicsList.size()); for(int i=0; i<5; i++){ assertEquals("eth" + (i*2), unmanagedNicsList.get(i).getName()); } }

Target:
public void testFilterNicsWithUnmanagedNetworks(){ VdsNetworkInterface nicManaged = createNicWithNetworkImplementationDetails("eth0", true); VdsNetworkInterface nicUnmanaged = createNicWithNetworkImplementationDetails("eth1", false); List<VdsNetworkInterface> existingInterfaces = Arrays.asList(nicManaged, nicUnmanaged); List<VdsNetworkInterface> unmanagedNicsList = validator.filterNicsWithUnmanagedNetworks(existingInterfaces, new HashSet<String>()); assertEquals(1, unmanagedNicsList.size()); assertEquals("eth1", unmanagedNicsList.get(0).getName()); }
Source:
public String getName() { return String.format( "%s [%s]", super.getName(), inputs.stream().map(Transformation::getName).collect(joining(", "))); }

Target:
public String getName() { return inputs.isEmpty() ? super.getName() : "[" + inputs.stream().map(Transformation::getName).collect(joining(", ")) + "]"; }
Source:
private void next(String email, final String password) { final FirebaseAuth firebaseAuth = mActivityHelper.getFirebaseAuth(); firebaseAuth.signInWithEmailAndPassword(email, password) .addOnFailureListener( new TaskFailureLogger(TAG, "Error signing in with email and password")) .addOnSuccessListener(new OnSuccessListener<AuthResult>() { @Override public void onSuccess(AuthResult authResult) { AuthCredential authCredential = AuthCredentialHelper.getAuthCredential(mIdpResponse); authResult.getUser().linkWithCredential(authCredential); firebaseAuth.signOut(); firebaseAuth.signInWithCredential(authCredential) .addOnFailureListener( new TaskFailureLogger(TAG, "Error signing in with credential")) .addOnSuccessListener( new OnSuccessListener<AuthResult>() { @Override public void onSuccess(AuthResult authResult) { mSmartLock.saveCredentialsOrFinish( WelcomeBackPasswordPrompt.this, mActivityHelper.getFlowParams(), authResult.getUser(), password, null ); } }); } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { String error = e.getLocalizedMessage(); mPasswordLayout.setError(error); } }); }

Target:
private void next(String email, final String password) { final FirebaseAuth firebaseAuth = mActivityHelper.getFirebaseAuth(); if (TextUtils.isEmpty(password)) { mPasswordField.setError(getString(R.string.required_field)); return; } else { mPasswordField.setError(null); } firebaseAuth.signInWithEmailAndPassword(email, password) .addOnFailureListener( new TaskFailureLogger(TAG, "Error signing in with email and password")) .addOnSuccessListener(new OnSuccessListener<AuthResult>() { @Override public void onSuccess(AuthResult authResult) { AuthCredential authCredential = AuthCredentialHelper.getAuthCredential(mIdpResponse); authResult.getUser().linkWithCredential(authCredential); firebaseAuth.signOut(); firebaseAuth.signInWithCredential(authCredential) .addOnFailureListener( new TaskFailureLogger(TAG, "Error signing in with credential")) .addOnSuccessListener( new OnSuccessListener<AuthResult>() { @Override public void onSuccess(AuthResult authResult) { SmartLock .getInstance(WelcomeBackPasswordPrompt.this, TAG) .saveCredentialsOrFinish( WelcomeBackPasswordPrompt.this, mActivityHelper, authResult.getUser(), password, null ); } }); } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { String error = e.getLocalizedMessage(); mPasswordLayout.setError(error); } }); }
Source:
protected void gatherData() { View view = getView(); if(view == null) return; EditText usernameEditText = (EditText)view.findViewById(R.id.username); EditText passwordEditText = (EditText)view.findViewById(R.id.password); username = usernameEditText.getText().toString(); password = passwordEditText.getText().toString(); url = "<LINK_0>"; wallabagServerVersion = 2; tryPossibleURLs = false; }

Target:
protected void gatherData() { View view = getView(); if(view == null) return; EditText usernameEditText = (EditText)view.findViewById(R.id.username); EditText passwordEditText = (EditText)view.findViewById(R.id.password); username = usernameEditText.getText().toString(); password = passwordEditText.getText().toString(); url = "<LINK_1>"; wallabagServerVersion = 2; tryPossibleURLs = false; }
Source:
public int getMaximumRelationAllowed(OrcsSession session, IRelationType type, RelationNode node, RelationSide side) throws OseeCoreException { return validity.getMaximumRelationsAllowed(type, node.getArtifactType(), side); }

Target:
public int getMaximumRelationAllowed(OrcsSession session, IRelationType type, RelationNode node, RelationSide side) throws OseeCoreException { Conditions.checkNotNull(node, "node"); return validity.getMaximumRelationsAllowed(type, node.getArtifactType(), side); }
Source:
List<TaskCallbackImpl> update(TaskCallbackImpl cb) { synchronized (lock) { callbacks.add(cb); TaskCallbackImpl callback = null; List<TaskCallbackImpl> committableCallbacks = new ArrayList<>(); TaskCoordinator.RequestScope shutdownRequest = null; while (!callbacks.isEmpty() && callbacks.peek().matchSeqNum(nextSeqNum)) { ++nextSeqNum; callback = callbacks.poll(); if (callback.coordinator.commitRequest().isDefined()) { committableCallbacks.add(callback); } if (callback.coordinator.shutdownRequest().isDefined()) { shutdownRequest = callback.coordinator.shutdownRequest().get(); } } if (committableCallbacks.isEmpty() && callback != null) { committableCallbacks.add(callback); } if (shutdownRequest != null) { for (TaskCallbackImpl callbackToCommit : committableCallbacks) { callbackToCommit.coordinator.shutdown(shutdownRequest); } } return committableCallbacks; } }

Target:
List<TaskCallbackImpl> update(TaskCallbackImpl cb) { synchronized (lock) { callbacks.add(cb); List<TaskCallbackImpl> callbacksToUpdate = new ArrayList<>(); while (!callbacks.isEmpty() && callbacks.peek().matchSeqNum(nextSeqNum)) { ++nextSeqNum; TaskCallbackImpl callback = callbacks.poll(); callbacksToUpdate.add(callback); if (callback.coordinator.commitRequest().isDefined()) { break; } } return callbacksToUpdate; } }
Source:
public void testOpportunistic() throws Exception { Configuration conf = new YarnConfiguration(); String id = "container_01_01"; ContainerId mockContainerId = mock(ContainerId.class); when(mockContainerId.toString()).thenReturn(id); cGroupsCpuResourceHandler.bootstrap(plugin, conf); ContainerTokenIdentifier tokenId = mock(ContainerTokenIdentifier.class); when(tokenId.getExecutionType()).thenReturn(ExecutionType.OPPORTUNISTIC); Container container = mock(Container.class); when(container.getContainerId()).thenReturn(mockContainerId); when(container.getContainerTokenIdentifier()).thenReturn(tokenId); when(container.getResource()).thenReturn(Resource.newInstance(1024, 2)); cGroupsCpuResourceHandler.preStart(container); verify(mockCGroupsHandler, times(1)) .updateCGroupParam(CGroupsHandler.CGroupController.CPU, id, CGroupsHandler.CGROUP_CPU_SHARES, "2"); }

Target:
public void testOpportunistic() throws Exception { Configuration conf = new YarnConfiguration(); cGroupsCpuResourceHandler.bootstrap(plugin, conf); ContainerTokenIdentifier tokenId = mock(ContainerTokenIdentifier.class); when(tokenId.getExecutionType()).thenReturn(ExecutionType.OPPORTUNISTIC); Container container = mock(Container.class); String id = "container_01_01"; ContainerId mockContainerId = mock(ContainerId.class); when(mockContainerId.toString()).thenReturn(id); when(container.getContainerId()).thenReturn(mockContainerId); when(container.getContainerTokenIdentifier()).thenReturn(tokenId); when(container.getResource()).thenReturn(Resource.newInstance(1024, 2)); cGroupsCpuResourceHandler.preStart(container); verify(mockCGroupsHandler, times(1)) .updateCGroupParam(CGroupsHandler.CGroupController.CPU, id, CGroupsHandler.CGROUP_CPU_SHARES, "2"); }
Source:
public void testFastTransformSlopeAndOffset() { double offset = 54321.0; double slope = Math.pow(10.0, 4); for (int ex = 0; ex <= Long.BYTES - 1; ex++) { long start = 1 << ex; TmfTimestampTransformLinear precise = new TmfTimestampTransformLinear(slope, offset); TmfTimestampTransformLinearFast fast = fTransformFactory.create(slope, offset); checkTime(precise, fast, 5, start, 1); } }

Target:
public void testFastTransformSlopeAndOffset() { double offset = 54321.0; double slope = Math.pow(10.0, 4); for (int ex = 0; ex <= Long.SIZE - 1; ex++) { long start = 1 << ex; TmfTimestampTransformLinear precise = new TmfTimestampTransformLinear(slope, offset); TmfTimestampTransformLinearFast fast = fTransformFactory.create(slope, offset); checkTime(precise, fast, 5, start, 1); } }
Source:
public static List<KeyRange> getSaltByteRanges(List<List<KeyRange>> ranges, RowKeySchema schema, int bucketNum) { if (ScanRanges.isSingleRowScan(ranges, schema, false)) { int[] position = new int[ranges.size()]; int maxLength = ScanUtil.estimateKeyLength(schema, 1, ranges, new int[ranges.size()], Bound.LOWER); byte[] key = new byte[maxLength + 1]; ScanUtil.setKey(schema, ranges, position, Bound.LOWER, key, 1, 0, ranges.size(), 1); byte saltByte = SaltingUtil.getSaltingByte(key, bucketNum); KeyRange saltRange = SaltingUtil.SALTING_COLUMN.getDataType().getKeyRange(new byte[] {saltByte}, true, new byte[] {saltByte}, true); List<KeyRange> saltRangeList = new ArrayList<KeyRange>(); saltRangeList.add(saltRange); return saltRangeList; } return SaltingUtil.generateAllSaltingRanges(bucketNum); }

Target:
public static List<KeyRange> getSaltByteRanges(List<List<KeyRange>> ranges, RowKeySchema schema, int bucketNum) { if (ScanRanges.isSingleRowScan(ranges, schema, false)) { int[] position = new int[ranges.size()]; int maxLength = ScanUtil.estimateKeyLength(schema, 1, ranges, new int[ranges.size()], Bound.LOWER); byte[] key = new byte[maxLength + 1]; ScanUtil.setKey(schema, ranges, position, Bound.LOWER, key, 1, 0, ranges.size(), 1); byte saltByte = SaltingUtil.getSaltingByte(key, 1, key.length - 1, bucketNum); KeyRange saltRange = SaltingUtil.SALTING_COLUMN.getDataType().getKeyRange(new byte[] {saltByte}, true, new byte[] {saltByte}, true); List<KeyRange> saltRangeList = Collections.<KeyRange>singletonList(saltRange); return saltRangeList; } return Collections.<KeyRange>singletonList(SaltingUtil.SALTING_COLUMN.getDataType().getKeyRange( new byte[] {0}, true, new byte[] {(byte) bucketNum}, true)); }
Source:
private boolean isValidVariableTypeForFormula(final int id) { return Iterables.any(this.ontologyVariableDataManager.getVariableTypes(id), new Predicate<VariableType>() { @Override public boolean apply(@Nullable final VariableType variableType) { return variableType.equals(VariableType.TRAIT) || variableType.equals(VariableType.ENVIRONMENT_DETAIL) || variableType .equals(VariableType.STUDY_CONDITION); } }); }

Target:
private boolean isValidVariableTypeForFormula(final int id) { return Iterables.any(this.ontologyVariableDataManager.getVariableTypes(id), new Predicate<VariableType>() { @Override public boolean apply(@Nullable final VariableType variableType) { return DerivedVariableServiceImpl.CALCULATED_VARIABLE_VARIABLE_TYPES.contains(variableType.getId()); } }); }
Source:
public SamzaResource peekResource(String host) { synchronized (lock) { List<SamzaResource> resourcesOnPreferredHostBuffer = this.allocatedResources.get(host); List<SamzaResource> resourcesOnAnyHostBuffer = this.allocatedResources.get(ANY_HOST); if (resourcesOnPreferredHostBuffer != null && !resourcesOnPreferredHostBuffer.isEmpty()) { SamzaResource resource = resourcesOnPreferredHostBuffer.get(0); log.info("Returning a buffered resource: for from preferred-host buffer.", resource.getResourceID(), host); return resource; } else if (resourcesOnAnyHostBuffer != null && !resourcesOnAnyHostBuffer.isEmpty()) { log.debug("No resources on preferred-host buffer. Scanning ANY_HOST buffer"); SamzaResource resource = resourcesOnAnyHostBuffer.stream() .filter(resrc -> resrc.getHost().equals(host)) .findAny().orElse(null); if (resource != null) { log.info("Returning a buffered resource: for from ANY_HOST buffer.", resource.getResourceID(), host); } return resource; } else { log.debug("Cannot find any resource in the ANY_HOST buffer for because it is empty", host); return null; } } }

Target:
public SamzaResource peekResource(String host) { synchronized (lock) { List<SamzaResource> resourcesOnPreferredHostBuffer = this.allocatedResources.get(host); List<SamzaResource> resourcesOnAnyHostBuffer = this.allocatedResources.get(ANY_HOST); if (resourcesOnPreferredHostBuffer != null && !resourcesOnPreferredHostBuffer.isEmpty()) { SamzaResource resource = resourcesOnPreferredHostBuffer.get(0); log.info("Returning a buffered resource: for from preferred-host buffer.", resource.getResourceID(), host); return resource; } else if (resourcesOnAnyHostBuffer != null && !resourcesOnAnyHostBuffer.isEmpty()) { log.debug("No resources on preferred-host buffer. Scanning ANY_HOST buffer"); SamzaResource resource = resourcesOnAnyHostBuffer.stream() .filter(resrc -> resrc.getHost().equals(host)) .findAny().orElse(null); if (resource != null) { log.info("Returning a buffered resource: for from ANY_HOST buffer.", resource.getResourceID(), host); } return resource; } else { log.debug("Cannot find any resource in the ANY_HOST buffer for because both buffers are empty", host); return null; } } }
Source:
public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) { if (!isByPassTransformers()) { ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory.createChainedSubystemInstance(subsystemRegistration.getCurrentSubsystemVersion()); ResourceTransformationDescriptionBuilder builder200 = chainedBuilder.createBuilder(subsystemRegistration.getCurrentSubsystemVersion(), MODEL_VERSION_2_0_0); registerTransformers_2_0_0(builder200); chainedBuilder.buildAndRegister(subsystemRegistration, new ModelVersion[] {MODEL_VERSION_2_0_0, MODEL_VERSION_1_0_0}); } }

Target:
public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) { final ModelVersion[] modelVersions; final ModelVersion target; if (isByPassTransformers()) { target = MODEL_VERSION_1_0_0; modelVersions = new ModelVersion[] {MODEL_VERSION_1_0_0}; } else { target = MODEL_VERSION_2_0_0; modelVersions = new ModelVersion[] {MODEL_VERSION_2_0_0, MODEL_VERSION_1_0_0}; } ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory.createChainedSubystemInstance(subsystemRegistration.getCurrentSubsystemVersion()); ResourceTransformationDescriptionBuilder builder300 = chainedBuilder.createBuilder(subsystemRegistration.getCurrentSubsystemVersion(), target); registerTransformers_3_0_0(builder300); chainedBuilder.buildAndRegister(subsystemRegistration, modelVersions); }
Source:
public void validateField(String name, Object o) { if (o == null) { return; } Map numa = (Map<String, Object>) o; for (String key : new String[]{NUMA_CORES, NUMA_MEMORY_IN_MB, NUMA_PORTS}) { if (!numa.containsKey(key)) { throw new IllegalArgumentException( "The numa configuration key [" + key + "] is missing!" ); } } List<Integer> cores = (List<Integer>) numa.get(NUMA_CORES); Set coreSet = new HashSet(); coreSet.addAll(cores); if (coreSet.size() != cores.size()) { throw new IllegalArgumentException( "No duplicate cores in NUMA config" ); } }

Target:
public void validateField(String name, Object o) { if (o == null) { return; } Map numa = (Map<String, Object>) o; for (String key : new String[]{NUMA_CORES, NUMA_MEMORY_IN_MB, NUMA_PORTS}) { if (!numa.containsKey(key)) { throw new IllegalArgumentException( "The numa configuration key [" + key + "] is missing!" ); } } List<Integer> cores = (List<Integer>) numa.get(NUMA_CORES); Set coreSet = new HashSet(); coreSet.addAll(cores); if (coreSet.size() != cores.size()) { throw new IllegalArgumentException( "Duplicate cores in NUMA config" ); } }
Source:
public RecursiveLoggerContextInstantiationException(String message) { super(I18nMessageFactory.createStaticMessage(message)); }

Target:
public RecursiveLoggerContextInstantiationException(String message) { super(createStaticMessage(message)); }
Source:
protected Optional<ToggleButton> createAllButton() { final ToggleButton allCategoryButton = createSidebarToggleButton(tr("All")); allCategoryButton.setId("allButton"); allCategoryButton.setOnAction(event -> { getControl().setSelectedElement(null); getControl().getOnAllCategorySelection().run(); }); return Optional.of(allCategoryButton); }

Target:
protected Optional<ToggleButton> createAllButton() { final ToggleButton allCategoryButton = createSidebarToggleButton(tr("All")); allCategoryButton.setId("allButton"); allCategoryButton.setOnAction(event -> getControl().setNothingSelected()); return Optional.of(allCategoryButton); }
Source:
public URLClassLoader loadDependencies() { ClassLoader currentCl = Thread.currentThread().getContextClassLoader(); URLClassLoader cl = URLClassLoader.newInstance(launchDependencies.toArray(new URL[launchDependencies.size()]), currentCl); Thread.currentThread().setContextClassLoader(cl); StringCodecs.check(); return cl; }

Target:
public URLClassLoader loadDependencies() { URLClassLoader cl = URLClassLoader.newInstance(launchDependencies.toArray(new URL[launchDependencies.size()])); Thread.currentThread().setContextClassLoader(cl); StringCodecs.check(); return cl; }
Source:
public String getAccessibleHorizontalLabelForBarAt(int index) { if (mAccessibleVirtualLabels != null && index < mAccessibleVirtualLabels.length) { return mAccessibleVirtualLabels[index]; } return ""; }

Target:
public String getAccessibleHorizontalLabelForBarAt(int index) { if (mAccessibleVirtualLabels != null && index < mAccessibleVirtualLabels.length) { return mAccessibleVirtualLabels[index]; } AppLog.w(AppLog.T.STATS, "Missing StatsBarGraph accessible label at index " + index); return ""; }