auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCancellationDuringInitialization() throws Exception { dispatcher = createAndStartDispatcher(heartbeatServices, haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID, createdJobManagerRunnerLatch)); jobMasterLeaderElectionService.isLeader(UUID.randomUUID()); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); final BlockingJobVertex blockingJobVertex = new BlockingJobVertex("testVertex"); blockingJobVertex.setInvokableClass(NoOpInvokable.class); JobGraph blockingJobGraph = new JobGraph(TEST_JOB_ID, "blockingTestJob", blockingJobVertex); dispatcherGateway.submitJob(blockingJobGraph, TIMEOUT).get(); Assert.assertThat(dispatcherGateway.requestJobStatus(blockingJobGraph.getJobID(), TIMEOUT).get(), is(JobStatus.INITIALIZING)); CompletableFuture<Acknowledge> cancellationFuture = dispatcherGateway.cancelJob(blockingJobGraph.getJobID(), TIMEOUT); Assert.assertThat(dispatcherGateway.requestJobStatus(blockingJobGraph.getJobID(), TIMEOUT).get(), is(JobStatus.CANCELLING)); Assert.assertThat(cancellationFuture.isDone(), is(false)); blockingJobVertex.unblock(); cancellationFuture.get(); Assert.assertThat(dispatcherGateway.requestJobStatus(blockingJobGraph.getJobID(), TIMEOUT).get(), is(JobStatus.CANCELED)); }

Target:
public void testCancellationDuringInitialization() throws Exception { dispatcher = createAndStartDispatcher(heartbeatServices, haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID, createdJobManagerRunnerLatch)); jobMasterLeaderElectionService.isLeader(UUID.randomUUID()); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); Tuple2<JobGraph, BlockingJobVertex> blockingJobGraph = getBlockingJobGraphAndVertex(); JobID jobID = blockingJobGraph.f0.getJobID(); dispatcherGateway.submitJob(blockingJobGraph.f0, TIMEOUT).get(); assertThat(dispatcherGateway.requestJobStatus(jobID, TIMEOUT).get(), is(JobStatus.INITIALIZING)); CompletableFuture<Acknowledge> cancellationFuture = dispatcherGateway.cancelJob(jobID, TIMEOUT); assertThat(dispatcherGateway.requestJobStatus(jobID, TIMEOUT).get(), is(JobStatus.CANCELLING)); assertThat(cancellationFuture.isDone(), is(false)); blockingJobGraph.f1.unblock(); cancellationFuture.get(); assertThat(dispatcherGateway.requestJobResult(jobID, TIMEOUT).get().getApplicationStatus(), is(ApplicationStatus.CANCELED)); }
Source:
private void replaceLabels(TurboIssue issue, List<String> labels) { List<String> originalLabels = issue.getLabels().stream().sorted().collect(Collectors.toList()); if (!labels.equals(originalLabels)) { List<Action> actions = getActions(originalLabels, labels); List<String> resultingLabels = getResultingLabels(originalLabels, actions); assert(labels.equals(resultingLabels)); ui.logic.replaceIssueLabelsUI(issue, labels); Notification undoNotification = new Notification(createInfoOcticon(), "Undo label change(s) for #" + issue.getId() + ": " + issue.getTitle(), "Undo", () -> ui.logic.replaceIssueLabelsRepo(issue, labels, originalLabels) .thenApply(success -> postReplaceLabelActions(success, issue)), () -> ui.logic.replaceIssueLabelsUI(issue, originalLabels)); ui.showNotification(undoNotification); } }

Target:
private void replaceLabels(TurboIssue issue, List<String> labels) { List<String> originalLabels = issue.getLabels().stream().sorted().collect(Collectors.toList()); if (!labels.equals(originalLabels)) { List<String> resultingLabels = createResultingLabelList(issue, labels); assert(labels.equals(resultingLabels)); ui.logic.replaceIssueLabelsUI(issue, resultingLabels); Notification undoNotification = new Notification(createInfoOcticon(), "Undo label change(s) for #" + issue.getId() + ": " + issue.getTitle(), "Undo", () -> ui.logic.replaceIssueLabelsRepo(issue, resultingLabels, originalLabels) .thenApply(success -> showErrorDialogOnFailure(success, issue)), () -> ui.logic.replaceIssueLabelsUI(issue, originalLabels)); ui.showNotification(undoNotification); } }
Source:
private static Ordering<Ref> branchComparator(Ref headLeaf) { if (headLeaf == null) { return Ordering.from(RefComparator.INSTANCE); } final String headLeafName = headLeaf.getName(); return new Ordering<Ref>() { @Override public int compare(@Nullable Ref left, @Nullable Ref right) { boolean leftIsHead = isHead(left); boolean rightIsHead = isHead(right); if (leftIsHead && !rightIsHead) { return -1; } else if (rightIsHead) { return 1; } else { return 0; } } private final boolean isHead(Ref ref) { return ref != null && ref.getName().equals(headLeafName); } }.compound(RefComparator.INSTANCE); }

Target:
private static Ordering<Ref> branchComparator(Ref headLeaf) { if (headLeaf == null) { return Ordering.from(RefComparator.INSTANCE); } final String headLeafName = headLeaf.getName(); return new Ordering<Ref>() { @Override public int compare(@Nullable Ref left, @Nullable Ref right) { int l = isHead(left) ? 1 : 0; int r = isHead(right) ? 1 : 0; return l - r; } private final boolean isHead(Ref ref) { return ref != null && ref.getName().equals(headLeafName); } }.compound(RefComparator.INSTANCE); }
Source:
public static List<Cookie> parseCookieHeader(String host, String cookieHeaderValue) { String cookies_string = cookieHeaderValue; if (StringUtils.isEmpty(cookies_string)){ return Collections.emptyList(); } String[] cookies = cookies_string.split(";"); if (cookies.length==0){ return Collections.emptyList(); }else{ List<Cookie> cookiesList = new ArrayList<Cookie>(); for (String cookie : cookies){ String[] parts = cookie.split("="); if (parts.length==1) { cookiesList.add(new Cookie(host,parts[0].trim(),"")); }else{ cookiesList.add(new Cookie(host,parts[0].trim(),parts[1].trim())); } } return cookiesList; } }

Target:
static List<Cookie> parseCookieHeader(String host, String cookieHeaderValue) { if (StringUtils.isEmpty(cookieHeaderValue)){ return Collections.emptyList(); } String[] cookies = cookieHeaderValue.split(";"); List<Cookie> cookiesList = new ArrayList<Cookie>(); for (String cookie : cookies){ String[] parts = cookie.split("="); if (parts.length==1) { cookiesList.add(new Cookie(host,parts[0].trim(),"")); }else{ cookiesList.add(new Cookie(host,parts[0].trim(),parts[1].trim())); } } return cookiesList; }
Source:
public int compareTo(long thisSize, long thatSize, ResourceUnit thatUnit) { if (thatUnit instanceof MemoryUnit) { return Long.signum(convert(thisSize, (MemoryUnit) thatUnit) - thatSize); } else { throw new IllegalArgumentException(); } }

Target:
public int compareTo(long thisSize, long thatSize, ResourceUnit thatUnit) { if (thatUnit instanceof MemoryUnit) { MemoryUnit mThatUnit = (MemoryUnit) thatUnit; if (index < mThatUnit.index) { try { return Long.signum(thisSize - convert(thatSize, mThatUnit)); } catch (ArithmeticException e) { return Long.signum(mThatUnit.convert(thisSize, this) - thatSize); } } else { try { return Long.signum(mThatUnit.convert(thisSize, this) - thatSize); } catch (ArithmeticException e) { return Long.signum(thisSize - convert(thatSize, mThatUnit)); } } } else { throw new IllegalArgumentException(); } }
Source:
public void setValueToRedis() throws IOException { Path projectDir = folder.newFolder().toPath(); addWorkflow(projectDir, "acceptance/params/set.dig"); Path config = projectDir.resolve("config"); Files.write(config, asList( "param_server.type=redis", "param_server.host=" + DIGDAG_TEST_REDIS )); CommandStatus status = main("run", "-o", folder.newFolder().getAbsolutePath(), "--config", config.toString(), "--project", projectDir.toString(), projectDir.resolve("set.dig").toString() ); assertCommandStatus(status); long key1_ttl = redisClient.ttl("0:key1"); long key2_ttl = redisClient.ttl("0:key2"); assertTrue(key1_ttl < TTL_90_DAYS_PLUS_1SEC && key1_ttl > TTL_89_DAYS); assertTrue(key2_ttl < TTL_90_DAYS_PLUS_1SEC && key2_ttl > TTL_89_DAYS); assertThat(redisClient.get("0:key1"), is("{\"value_type\":0,\"value\":{\"value\":\"value1\"}}")); assertThat(redisClient.get("0:key2"), is("{\"value_type\":0,\"value\":{\"value\":\"value2\"}}")); }

Target:
public void setValueToRedis() throws IOException { Path projectDir = folder.newFolder().toPath(); addWorkflow(projectDir, "acceptance/params/set.dig"); Path config = projectDir.resolve("config"); Files.write(config, asList( "param_server.type=redis", "param_server.host=" + DIGDAG_TEST_REDIS )); CommandStatus status = main("run", "-o", folder.newFolder().getAbsolutePath(), "--config", config.toString(), "--project", projectDir.toString(), projectDir.resolve("set.dig").toString() ); assertCommandStatus(status); long key1_ttl = redisClient.ttl("0:key1"); long key2_ttl = redisClient.ttl("0:key2"); assertTrue(key1_ttl <= TTL_90_DAYS && key1_ttl > TTL_89_DAYS); assertTrue(key2_ttl <= TTL_90_DAYS && key2_ttl > TTL_89_DAYS); assertThat(redisClient.get("0:key1"), is("{\"value_type\":0,\"value\":{\"value\":\"value1\"}}")); assertThat(redisClient.get("0:key2"), is("{\"value_type\":0,\"value\":{\"value\":\"value2\"}}")); }
Source:
public final void start(@Nullable BundleContext context) throws Exception { super.start(context); if (ACTIVATORS.containsValue(this)) { logError("Duplicate Activator ID found."); } ACTIVATORS.put(this.getPluginId(), this); startActions(); }

Target:
public final void start(@Nullable BundleContext context) throws Exception { super.start(context); String id = this.getPluginId(); if (ACTIVATORS.containsKey(id)) { logError("Duplicate Activator ID : " + id); } ACTIVATORS.put(id, this); startActions(); }
Source:
private List<String> initCommand(){ List<String> command = new ArrayList<String>(); command.add(cmd); command.add("install"); if (acceptLicense) { command.add("--acceptLicense"); } else { command.add("--viewLicenseAgreement"); } if (to != null) { command.add("--to=" + to); } if (whenFileExists != null) { command.add("--when-file-exists=" + whenFileExists); } if (directoryPath != null) { command.add("--location=" + directoryPath); } if (downloadOnly != null) { command.add("--downloadOnly=" + downloadOnly); } if (offlineOnly) { command.add("--offlineOnly"); } return command; }

Target:
private List<String> initCommand(){ List<String> command = new ArrayList<String>(); command.add(cmd); command.add("install"); if (acceptLicense) { command.add("--acceptLicense"); } else { command.add("--viewLicenseAgreement"); } if (to != null) { command.add("--to=" + to); } if (from != null) { command.add("--from=" + from); } return command; }
Source:
public static Integer jsonLength(Object input) { final PathContext context = (PathContext) input; final Integer result; try { Object value = context.pathReturned; if (value == null) { result = null; } else { if (value instanceof Collection) { result = ((Collection) value).size(); } else if (value instanceof Map) { result = ((LinkedHashMap) value).size(); } else if (isScalarObject(value)) { result = 1; } else { result = 0; } } } catch (Exception ex) { throw RESOURCE.unknownObjectOfJsonLength( input.toString()).ex(); } return result; }

Target:
public static Integer jsonLength(Object input) { final Integer result; final Object value; try { if (isJsonPathContext(input)) { PathContext context = (PathContext) input; if (context.exc != null) { throw toUnchecked(context.exc); } value = context.pathReturned; } else { value = input; } if (value == null) { result = null; } else { if (value instanceof Collection) { result = ((Collection) value).size(); } else if (value instanceof Map) { result = ((LinkedHashMap) value).size(); } else if (isScalarObject(value)) { result = 1; } else { result = 0; } } } catch (Exception ex) { throw RESOURCE.unknownContextOfJsonLength( input.toString()).ex(); } return result; }
Source:
protected boolean canDoAction() { boolean returnValue = isVmExist() && acquireLockInternal(); VM vm = getVm(); if (returnValue && (vm != null && vm.getstatus() == VMStatus.ImageLocked)) { returnValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_LOCKED); } else { returnValue = returnValue && (vm == null || isDiskCanBeAddedToVm(getParameters().getDiskInfo())); if (returnValue && DiskStorageType.IMAGE == getParameters().getDiskInfo().getDiskStorageType()) { returnValue = checkIfImageDiskCanBeAdded(vm); } if (returnValue && DiskStorageType.LUN == getParameters().getDiskInfo().getDiskStorageType()) { returnValue = checkIfLunDiskCanBeAdded(); } } return returnValue; }

Target:
protected boolean canDoAction() { boolean returnValue = isVmExist() && acquireLockInternal(); VM vm = getVm(); returnValue = returnValue && (vm == null || isDiskCanBeAddedToVm(getParameters().getDiskInfo())); if (returnValue && DiskStorageType.IMAGE == getParameters().getDiskInfo().getDiskStorageType()) { returnValue = checkIfImageDiskCanBeAdded(vm); } if (returnValue && DiskStorageType.LUN == getParameters().getDiskInfo().getDiskStorageType()) { returnValue = checkIfLunDiskCanBeAdded(); } return returnValue; }
Source:
public Object getEntry(String key, String tenantDomain) throws AxisFault { LocalEntryServiceProxy localEntryAdminClient = getLocalEntryAdminClient(tenantDomain); return localEntryAdminClient.getEntry(key); }

Target:
public Object getEntry(String key, String tenantDomain) throws AxisFault { LocalEntryServiceProxy localEntryServiceProxy = getLocalEntryAdminClient(tenantDomain); return localEntryServiceProxy.getEntry(key); }
Source:
public RuntimeException transform(RuntimeException e, Response response) { if (response == null) { return transformNoResponse(e); } RuntimeException result = null; if (response.getStatusInfo() instanceof Response.Status) { result = transformByResponseStatus((Response.Status) response.getStatusInfo(), e, response); } if (result == null) { result = transformByResponseStatusFamily(response.getStatusInfo().getFamily(), e, response); } return result != null ? result : defaultTransform(e, response); }

Target:
public RuntimeException transform(RuntimeException e, Response response) { if (response == null) { return e; } RuntimeException result = null; if (response.getStatusInfo() instanceof Response.Status) { result = transformByResponseStatus((Response.Status) response.getStatusInfo(), e, response); } if (result == null) { result = transformByResponseStatusFamily(response.getStatusInfo().getFamily(), e, response); } return result != null ? result : defaultTransform(e, response); }
Source:
private static BibEntry getBibEntryWithGivenEntryId(BibDatabaseContext database, String entryId) { for (BibEntry bibEntry : database.getEntries()) { if (bibEntry.getId().equals(entryId)) { return bibEntry; } } return null; }

Target:
private static Optional<BibEntry> getBibEntryWithGivenEntryId(BibDatabaseContext database, String entryId) { for (BibEntry bibEntry : database.getEntries()) { if (bibEntry.getId().equals(entryId)) { return Optional.of(bibEntry); } } return Optional.empty(); }
Source:
public void process(ClientInvocationBuilder invocation, Object param) { invocation.getInvocation().setEntity(Entity.entity(param == null? null : new GenericEntity<Object>(param, genericType), mediaType, annotations)) }

Target:
public void process(ClientInvocationBuilder invocation, Object param) { invocation.getInvocation().setEntity(Entity.entity(param == null? null : new GenericEntity<Object>(param, genericType), mediaType, annotations)); }
Source:
public InternalResourceGroupManager(LegacyResourceGroupConfigurationManager legacyManager, ClusterMemoryPoolManager memoryPoolManager, NodeInfo nodeInfo, MBeanExporter exporter, InternalNodeManager internalNodeManager, QueryManagerConfig queryManagerConfig, NodeSchedulerConfig nodeSchedulerConfig) { this.exporter = requireNonNull(exporter, "exporter is null"); this.configurationManagerContext = new ResourceGroupConfigurationManagerContextInstance(memoryPoolManager, nodeInfo.getEnvironment()); this.legacyManager = requireNonNull(legacyManager, "legacyManager is null"); this.configurationManager = new AtomicReference<>(cast(legacyManager)); this.internalNodeManager = requireNonNull(internalNodeManager, "internalNodeManager is null"); requireNonNull(nodeSchedulerConfig, "nodeSchedulerConfig is null"); requireNonNull(queryManagerConfig, "queryManagerConfig is null"); this.isIncludeCoordinator = nodeSchedulerConfig.isIncludeCoordinator(); this.initializationRequiredWorkers = queryManagerConfig.getInitializationRequiredWorkers(); this.initializationTimeout = queryManagerConfig.getInitializationTimeout(); this.initialNanos = System.nanoTime(); this.shouldQueueQueriesWithInsufficientWorkers = queryManagerConfig.getQueueQueriesWithInsufficientWorkers(); }

Target:
public InternalResourceGroupManager( LegacyResourceGroupConfigurationManager legacyManager, ClusterMemoryPoolManager memoryPoolManager, NodeInfo nodeInfo, MBeanExporter exporter, InternalNodeManager internalNodeManager, QueryManagerConfig queryManagerConfig, NodeSchedulerConfig nodeSchedulerConfig) { this.exporter = requireNonNull(exporter, "exporter is null"); this.configurationManagerContext = new ResourceGroupConfigurationManagerContextInstance(memoryPoolManager, nodeInfo.getEnvironment()); this.legacyManager = requireNonNull(legacyManager, "legacyManager is null"); this.configurationManager = new AtomicReference<>(cast(legacyManager)); this.internalNodeManager = requireNonNull(internalNodeManager, "internalNodeManager is null"); requireNonNull(nodeSchedulerConfig, "nodeSchedulerConfig is null"); requireNonNull(queryManagerConfig, "queryManagerConfig is null"); this.isIncludeCoordinator = nodeSchedulerConfig.isIncludeCoordinator(); this.initializationRequiredWorkers = queryManagerConfig.getInitializationRequiredWorkers(); this.initializationTimeout = queryManagerConfig.getInitializationTimeout(); this.initialNanos = System.nanoTime(); this.shouldQueuePendingQueries = queryManagerConfig.getShouldQueuePendingQueries(); }
Source:
public void testAccessingValuesForInvalidPath() throws Exception { FieldAccessor accessor = new FieldAccessor(); accessor.registerDecoder("TargetValue", new OafFieldDecoder()); String rawSetId = "rawset-id"; String agentId = "agent-id"; String agentName = "agent-name"; AtomicAction action = new AtomicAction(rawSetId, new Agent(agentId, agentName, Agent.AGENT_TYPE.service)); accessor.getValue("$TargetValue.Unknown", action).toString(); }

Target:
public void testAccessingValuesForInvalidPath() throws Exception { FieldAccessor accessor = new FieldAccessor(); accessor.registerDecoder("targetValue", new OafFieldDecoder()); String rawSetId = "rawset-id"; String agentId = "agent-id"; String agentName = "agent-name"; AtomicAction action = new AtomicAction(rawSetId, new Agent(agentId, agentName, Agent.AGENT_TYPE.service)); accessor.getValue("agent.unknown", action); }
Source:
private static byte[] toByteArray(String string) { return (string.concat(System.lineSeparator())).getBytes(Charset.defaultCharset()); }

Target:
private static byte[] toByteArray(String string) { return (string.concat(CRLF)).getBytes(StandardCharsets.UTF_8); }
Source:
private void validateNotRemovingLabeledNetworks() { Map<String, VdsNetworkInterface> nicsByName = Entities.entitiesByName(params.getInterfaces()); Map<String, VdsNetworkInterface> hostInterfacesByNetworkName = Entities.hostInterfacesByNetworkName(getExistingIfaces().values()); for (String network : removedNetworks) { VdsNetworkInterface nic = hostInterfacesByNetworkName.get(network); if (nic != null) { if (NetworkUtils.isVlan(nic)) { nic = nicsByName.get(NetworkUtils.stripVlan(nic.getName())); } if (nic.getLabels() != null && nic.getLabels().contains(getExistingClusterNetworks().get(network).getLabel())) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC, network); } } } }

Target:
private void validateNotRemovingLabeledNetworks() { Map<String, VdsNetworkInterface> nicsByName = Entities.entitiesByName(params.getInterfaces()); Map<String, VdsNetworkInterface> hostInterfacesByNetworkName = Entities.hostInterfacesByNetworkName(getExistingIfaces().values()); for (String network : removedNetworks) { VdsNetworkInterface nic = hostInterfacesByNetworkName.get(network); if (nic != null) { if (NetworkUtils.isVlan(nic)) { nic = nicsByName.get(NetworkUtils.stripVlan(nic.getName())); } Network removedNetwork = getExistingClusterNetworks().get(network); if (nic.getLabels() != null && removedNetwork != null && nic.getLabels().contains(removedNetwork.getLabel())) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC, network); } } } }
Source:
Options(String[] args) throws CmdLineException, FileNotFoundException { CmdLineParser parser = new CmdLineParser(this); parser.parseArgument(args); srcFiles.addAll(arguments); srcFiles.addAll(filesToConvert); if (srcFiles.isEmpty()) { throw new CmdLineException(parser, "No files were given"); } externsMap = getExternsMap(); }

Target:
Options(String[] args) throws CmdLineException { CmdLineParser parser = new CmdLineParser(this); parser.parseArgument(args); srcFiles.addAll(arguments); srcFiles.addAll(filesToConvert); if (srcFiles.isEmpty()) { throw new CmdLineException(parser, "No files were given"); } try { externsMap = getExternsMap(); } catch (FileNotFoundException e) { throw new CmdLineException(parser, "externs file " + externsMapFile + " not found.", e); } }
Source:
public List<Tool> refreshToolsByOrganization(@ApiParam(hidden = true) @Parameter(hidden = true, name = "user")@Auth User authUser, @ApiParam(value = "User ID", required = true) @PathParam("userId") Long userId, @ApiParam(value = "Organization", required = true) @PathParam("organization") String organization, @ApiParam(value = "Docker registry", required = true) @QueryParam("dockerRegistry") String dockerRegistry) { checkUser(authUser, userId); checkToolTokens(authUser, userId, organization); if (dockerRegistry == null) { throw new CustomWebApplicationException("a repository is now required", HttpStatus.SC_BAD_REQUEST); } dockerRepoResource.refreshToolsForUser(userId, organization, dockerRegistry); userDAO.clearCache(); authUser = userDAO.findById(authUser.getId()); authUser.updateUserMetadata(tokenDAO); List<Tool> finalTools = getTools(authUser); bulkUpsertTools(authUser); return finalTools; }

Target:
public List<Tool> refreshToolsByOrganization(@ApiParam(hidden = true) @Parameter(hidden = true, name = "user")@Auth User authUser, @ApiParam(value = "User ID", required = true) @PathParam("userId") Long userId, @ApiParam(value = "Organization", required = true) @PathParam("organization") String organization, @ApiParam(value = "Docker registry", required = true) @QueryParam("dockerRegistry") String dockerRegistry) { checkUser(authUser, userId); checkToolTokens(authUser, userId, organization); if (dockerRegistry == null) { throw new CustomWebApplicationException("A repository is required", HttpStatus.SC_BAD_REQUEST); } dockerRepoResource.refreshToolsForUser(userId, organization, dockerRegistry); userDAO.clearCache(); authUser = userDAO.findById(authUser.getId()); authUser.updateUserMetadata(tokenDAO); List<Tool> finalTools = getTools(authUser); bulkUpsertTools(authUser); return finalTools; }
Source:
public SchedulerRestClient getRestClient() { HttpClientBuilder httpClientBuilder = new HttpClientBuilder().useSystemProperties(); if (canInsecureAccess()) { try { httpClientBuilder.insecure(true); } catch (Exception e) { throw new CLIException(REASON_OTHER, "Cannot disable SSL verification.", e); } } return new SchedulerRestClient(restServerUrl, new ApacheHttpClient4Engine(httpClientBuilder.build())); }

Target:
public SchedulerRestClient getRestClient() { HttpClientBuilder httpClientBuilder = new HttpClientBuilder().useSystemProperties(); if (canInsecureAccess()) { httpClientBuilder.insecure(true); } return new SchedulerRestClient(restServerUrl, new ApacheHttpClient4Engine(httpClientBuilder.build())); }
Source:
public SaveTaskService saveTaskService(TaskDefinitionRepository taskDefinitionRepository, AuditRecordService auditRecordService, AppRegistryService registry) { return new DefaultSaveTaskService(taskDefinitionRepository, auditRecordService,registry); }

Target:
public TaskSaveService saveTaskService(TaskDefinitionRepository taskDefinitionRepository, AuditRecordService auditRecordService, AppRegistryService registry) { return new DefaultTaskSaveService(taskDefinitionRepository, auditRecordService, registry); }
Source:
private static String getTestProperty(String name) { String val = ImmutableMap.of( BigtableOptionsFactory.PROJECT_ID_KEY, "igorbernstein-dev", BigtableOptionsFactory.INSTANCE_ID_KEY, "instance1", GOOGLE_DATAFLOW_STAGING_LOCATION, "gs://igorbernstein-dev/dataflow-staging", CLOUD_TEST_DATA_FOLDER, "gs://igorbernstein-dev/test-dir" ).get(name); return checkNotNull(val); }

Target:
private static String getTestProperty(String name) { return checkNotNull(System.getProperty(name), "Required property missing: " + name); }
Source:
public static <T> T getDefaultValue(Class<T> classType, String preferenceName) { Object value = null; if (USER_ASK_PREFERENCES_ID.equals(preferenceName)) { value = false; } else if (SCOPE_PREFERENCES_ID.equals(preferenceName)) { value = RefactorScope.WORKSPACE.name(); } return classType.isInstance(value) ? (T) value : null; }

Target:
public static <T> T getDefaultValue(Class<T> classType, String preferenceName) { Object value = null; if (USER_ASK_PREFERENCES_ID.equals(preferenceName)) { value = false; } else if (SCOPE_PREFERENCES_ID.equals(preferenceName)) { value = RefactorScope.WORKSPACE.name(); } return classType.isInstance(value) ? classType.cast(value) : null; }
Source:
public void testMakeWithShallowCopy() { final GenotypeBuilder gb = new GenotypeBuilder("test"); final int[] first = new int[]{1, 2}; final int[] second = new int[]{3, 4}; final Genotype firstG = gb.attribute("first", first).makeWithShallowCopy(); final Genotype secondG = gb.attribute("second", second).makeWithShallowCopy(); Assert.assertEquals(first, firstG.getExtendedAttribute("first")); Assert.assertEquals(first, secondG.getExtendedAttribute("first")); Assert.assertEquals(null, firstG.getExtendedAttribute("second")); Assert.assertEquals(second, secondG.getExtendedAttribute("second")); }

Target:
public void testMakeWithShallowCopy() { final GenotypeBuilder gb = new GenotypeBuilder("test"); final List<Allele> alleles = new ArrayList<>( Arrays.asList(Allele.create("A", true), Allele.create("T"))); final int[] ad = new int[]{1,5}; final int[] pl = new int[]{1,6}; final int[] first = new int[]{1, 2}; final int[] second = new int[]{3, 4}; final Genotype firstG = gb.alleles(alleles).attribute("first", first).makeWithShallowCopy(); final Genotype secondG = gb.AD(ad).PL(pl).attribute("second", second).makeWithShallowCopy(); Assert.assertEquals(first, firstG.getExtendedAttribute("first")); Assert.assertEquals(first, secondG.getExtendedAttribute("first")); Assert.assertEquals(alleles, firstG.getAlleles()); Assert.assertEquals(alleles, secondG.getAlleles()); Assert.assertNull(firstG.getAD()); Assert.assertEquals(ad, secondG.getAD()); Assert.assertNull(firstG.getPL()); Assert.assertEquals(pl, secondG.getPL()); Assert.assertNull(firstG.getExtendedAttribute("second")); Assert.assertEquals(second, secondG.getExtendedAttribute("second")); alleles.add(Allele.create("C")); Assert.assertNotEquals(alleles, firstG.getAlleles()); Assert.assertNotEquals(alleles, secondG.getAlleles()); ad[0] = 0; pl[0] = 10; Assert.assertNotEquals(ad, secondG.getAD()); Assert.assertNotEquals(pl, secondG.getPL()); }
Source:
private Node processInitialLabel(String initialLabel, List<String> removedLabels, Optional<String> suggestion) { TurboLabel repoInitialLabel = TurboLabel.getFirstMatchingTurboLabel(repoLabels, initialLabel); if (!removedLabels.contains(initialLabel)) { if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) { return getStyledPickerLabel(repoInitialLabel, true, false, true, false, true); } return getStyledPickerLabel(repoInitialLabel, false, false, false, false, true); } if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) { return getStyledPickerLabel(repoInitialLabel, true, false, false, false, true); } return getStyledPickerLabel(repoInitialLabel, false, false, true, false, true); }

Target:
private final Node processInitialLabel(String initialLabel, List<String> removedLabels, Optional<String> suggestion) { TurboLabel repoInitialLabel = TurboLabel.getFirstMatchingTurboLabel(allLabels, initialLabel); if (!removedLabels.contains(initialLabel)) { if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) { return getPickerLabelNode( new PickerLabel(repoInitialLabel, true).faded(true).removed(true)); } return getPickerLabelNode(new PickerLabel(repoInitialLabel, true)); } if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) { return getPickerLabelNode(new PickerLabel(repoInitialLabel, true).faded(true)); } return getPickerLabelNode(new PickerLabel(repoInitialLabel, true).removed(true)); }
Source:
synchronized void updateSender(final String operationId, final TraceInfo traceInfo) { final MigrationInfo updatedInfo = checkAndUpdateState(operationId, MOVING_PARTITION, UPDATING_SENDER); final String senderId = updatedInfo.getSenderId(); sender.get().sendUpdateMsg(senderId, operationId, traceInfo); }

Target:
synchronized void updateSender(final String operationId, final TraceInfo traceInfo) { final Migration migration = ongoingMigrations.get(operationId); if (migration == null) { LOG.log(Level.WARNING, "Migration with ID {0} was not registered, or it has already been finished.", operationId); return; } migration.checkAndUpdate(Migration.MOVING_PARTITION, Migration.UPDATING_SENDER); final String senderId = migration.getSenderId(); sender.get().sendUpdateMsg(senderId, operationId, traceInfo); }
Source:
private void end(int statusCode, Throwable throwable, Context context) { for (Tracer tracer : tracers) { if (throwable != null) { tracer.setAttribute(TracerProvider.ERROR_MSG, throwable.getMessage(), context); tracer.setAttribute(TracerProvider.ERROR_TYPE, throwable.getClass().getName(), context); StringWriter errorStack = new StringWriter(); throwable.printStackTrace(new PrintWriter(errorStack)); tracer.setAttribute(TracerProvider.ERROR_STACK, errorStack.toString(), context); } tracer.end(statusCode, throwable, context); } }

Target:
private void end(int statusCode, Throwable throwable, Context context) { if (throwable != null) { tracer.setAttribute(TracerProvider.ERROR_MSG, throwable.getMessage(), context); tracer.setAttribute(TracerProvider.ERROR_TYPE, throwable.getClass().getName(), context); } tracer.end(statusCode, throwable, context); }
Source:
public void onMessage(Message message) { if (logger.isTraceEnabled()) { logger.trace("Message received " + message); } String messageTag; if (this.correlationKey == null) { messageTag = message.getMessageProperties().getCorrelationId(); } else { messageTag = (String) message.getMessageProperties() .getHeaders().get(this.correlationKey); } if (messageTag == null) { logger.error("No correlation header in reply"); throw new AmqpRejectAndDontRequeueException("No correlation header"); } PendingReply pendingReply = this.replyHolder.get(messageTag); if (pendingReply == null) { if (logger.isWarnEnabled()) { logger.warn("Reply received after timeout for " + messageTag); } throw new AmqpRejectAndDontRequeueException("Reply received after timeout"); } else { restoreProperties(message, pendingReply); pendingReply.reply(message); } }

Target:
public void onMessage(Message message) { if (logger.isTraceEnabled()) { logger.trace("Message received " + message); } String messageTag; if (this.correlationKey == null) { messageTag = message.getMessageProperties().getCorrelationId(); } else { messageTag = (String) message.getMessageProperties() .getHeaders().get(this.correlationKey); } if (messageTag == null) { throw new AmqpRejectAndDontRequeueException("No correlation header in reply"); } PendingReply pendingReply = this.replyHolder.get(messageTag); if (pendingReply == null) { if (logger.isWarnEnabled()) { logger.warn("Reply received after timeout for " + messageTag); } throw new AmqpRejectAndDontRequeueException("Reply received after timeout"); } else { restoreProperties(message, pendingReply); pendingReply.reply(message); } }
Source:
List<BookieSocketAddress> getCurrentEnsemble() { if (newEnsemblesFromRecovery.size() > 0) { return newEnsemblesFromRecovery.lastEntry().getValue(); } else { return super.getCurrentEnsemble(); } }

Target:
List<BookieSocketAddress> getCurrentEnsemble() { synchronized (metadataLock) { if (!newEnsemblesFromRecovery.isEmpty()) { return newEnsemblesFromRecovery.lastEntry().getValue(); } else { return super.getCurrentEnsemble(); } } }
Source:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.reRun: new ConfirmDialogFragment.Builder() .withExtra("re_run") .withMessage(getString(R.string.Modal_DoYouWantToDeleteThisTest)) .withPositiveButton(getString(R.string.Modal_Delete)) .build().show(getSupportFragmentManager(), null); return true; default: return super.onOptionsItemSelected(item); } }

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.reRun: new ConfirmDialogFragment.Builder() .withExtra(RERUN_KEY) .withMessage(getString(R.string.Modal_ReRun_Websites_Title)) .withPositiveButton(getString(R.string.Modal_ReRun_Websites_Run)) .build().show(getSupportFragmentManager(), null); return true; default: return super.onOptionsItemSelected(item); } }
Source:
public static int processLauncherAndWait(Map<String, Object> conf, String user, List<String> args, final Map<String, String> environment, final String logPreFix) throws IOException { int ret = 0; Process process = processLauncher(conf, user, null, args, environment, null, null, null); if (StringUtils.isNotBlank(logPreFix)) { Utils.readAndLogStream(logPreFix, process.getInputStream()); } try { process.waitFor(); } catch (InterruptedException e) { LOG.warn("{} interrupted.", logPreFix); Thread.currentThread().interrupt(); throw new IOException(logPreFix + " interrupted", e); } ret = process.exitValue(); return ret; }

Target:
public static int processLauncherAndWait(Map<String, Object> conf, String user, List<String> args, final Map<String, String> environment, final String logPreFix) throws IOException { int ret = 0; Process process = processLauncher(conf, user, null, args, environment, null, null, null); if (StringUtils.isNotBlank(logPreFix)) { Utils.readAndLogStream(logPreFix, process.getInputStream()); } try { process.waitFor(); } catch (InterruptedException e) { LOG.warn("{} interrupted.", logPreFix); Thread.currentThread().interrupt(); process.destroy(); throw new IOException(logPreFix + " interrupted", e); } ret = process.exitValue(); return ret; }
Source:
private String findDevMachineName(Environment env) throws ServerException { return env.getMachines() .entrySet() .stream() .filter(entry -> entry.getValue() .getAgents() .contains("org.eclipse.che.ws-agent")) .findAny() .orElseThrow( () -> new ServerException("Agent 'org.eclipse.che.ws-agent' is not found in any of environment machines")) .getKey(); }

Target:
private String findDevMachineName(Environment env) throws ServerException { return env.getMachines() .entrySet() .stream() .filter(entry -> entry.getValue() .getAgents() .stream() .filter(agent -> agent.contains("org.eclipse.che.ws-agent")) .findAny() .isPresent()) .findAny() .orElseThrow(() -> new ServerException("Agent 'org.eclipse.che.ws-agent' is not found in any of environment machines")) .getKey(); }
Source:
private void doLoad(ExtMap input, ExtMap output) { context = input.<ExtMap> get(Base.InvokeKeys.CONTEXT); Properties configuration = context.<Properties> get(Base.ContextKeys.CONFIGURATION); context.mput( Base.ContextKeys.AUTHOR, "The oVirt Project" ).mput( Base.ContextKeys.EXTENSION_NAME, "Internal Authz (Built-in)" ).mput( Base.ContextKeys.LICENSE, "ASL 2.0" ).mput( Base.ContextKeys.HOME_URL, "<LINK_0>" ).mput( Base.ContextKeys.VERSION, "N/A" ).mput( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE, Integer.parseInt( configuration.getProperty("config.query.filter.size") ) ).mput( Base.ContextKeys.BUILD_INTERFACE_VERSION, Base.INTERFACE_VERSION_CURRENT ).mput( Authz.ContextKeys.AVAILABLE_NAMESPACES, Arrays.asList(NAMESPACE) ); adminUser = new ExtMap().mput( Authz.PrincipalRecord.NAMESPACE, NAMESPACE ).mput( Authz.PrincipalRecord.NAME, configuration.getProperty("config.authz.user.name") ).mput( Authz.PrincipalRecord.ID, configuration.getProperty("config.authz.user.id") ).mput( Authz.PrincipalRecord.GROUPS, Collections.emptyList() ); }

Target:
private void doLoad(ExtMap input, ExtMap output) { context = input.<ExtMap> get(Base.InvokeKeys.CONTEXT); Properties configuration = context.<Properties> get(Base.ContextKeys.CONFIGURATION); context.mput( Base.ContextKeys.AUTHOR, "The oVirt Project" ).mput( Base.ContextKeys.EXTENSION_NAME, "Internal Authz (Built-in)" ).mput( Base.ContextKeys.LICENSE, "ASL 2.0" ).mput( Base.ContextKeys.HOME_URL, "<LINK_0>" ).mput( Base.ContextKeys.VERSION, "N/A" ).mput( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE, Integer.parseInt( configuration.getProperty("config.query.filter.size") ) ).mput( Base.ContextKeys.BUILD_INTERFACE_VERSION, Base.INTERFACE_VERSION_CURRENT ).mput( Authz.ContextKeys.AVAILABLE_NAMESPACES, Arrays.asList(NAMESPACE) ); adminUser = new ExtMap().mput( Authz.PrincipalRecord.NAMESPACE, NAMESPACE ).mput( Authz.PrincipalRecord.NAME, configuration.getProperty("config.authz.user.name") ).mput( Authz.PrincipalRecord.ID, configuration.getProperty("config.authz.user.id") ); }
Source:
private void removeNearbyIfUnsupported() { if (!DeviceUtil.supportsNearby(activity)) { activity.getNavMenu().removeItem(R.id.nav_item_nearby); } }

Target:
private void removeNearbyIfUnsupported() { if (!DeviceUtil.supportsNearby(activity) && app.isPreProdRelease()) { activity.getNavMenu().removeItem(R.id.nav_item_nearby); } }
Source:
private void fetchFromCache(String objectType, String layoutType, LayoutSyncCallback syncCallback, boolean fallbackOnServer) { final QuerySpec querySpec = QuerySpec.buildSmartQuerySpec(String.format(QUERY, objectType, layoutType), 1); try { final JSONArray results = smartStore.query(querySpec, 0); if (results == null || results.length() == 0) { if (fallbackOnServer) { fetchFromServer(objectType, layoutType, syncCallback); } else { onSyncComplete(objectType, syncCallback, null); } } else { final JSONArray resultArr = results.optJSONArray(0); if (resultArr == null || resultArr.length() == 0) { onSyncComplete(objectType, syncCallback, null); } else { onSyncComplete(objectType, syncCallback, Layout.fromJSON(resultArr.optJSONObject(0))); } } } catch (Exception e) { SmartSyncLogger.e(TAG, "Exception occurred while reading layout data from the cache", e); } }

Target:
private void fetchFromCache(String objectType, String layoutType, LayoutSyncCallback syncCallback, boolean fallbackOnServer) { final QuerySpec querySpec = QuerySpec.buildSmartQuerySpec(String.format(QUERY, objectType, layoutType), 1); try { final JSONArray results = smartStore.query(querySpec, 0); if (results == null || results.length() == 0) { if (fallbackOnServer) { fetchFromServer(objectType, layoutType, syncCallback); } else { onSyncComplete(objectType, syncCallback, null); } } else { onSyncComplete(objectType, syncCallback, Layout.fromJSON(results.optJSONArray(0).optJSONObject(0))); } } catch (Exception e) { SmartSyncLogger.e(TAG, "Exception occurred while reading layout data from the cache", e); } }
Source:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Map<String, Object> ret = new HashMap<String, Object>(); if (hasParam(req, ACTION_PARAM)) { String action = getParam(req, ACTION_PARAM); if (action.equals(STATS_SET_REPORTINGINTERVAL)) { handleChangeMetricInterval(req, ret); } else if (action.equals(STATS_SET_CLEANINGINTERVAL)) { handleChangeCleaningInterval(req, ret); } else if (action.equals(STATS_SET_MAXREPORTERPOINTS)) { handleChangeEmitterPoints(req, ret); } else if (action.equals(STATS_GET_ALLMETRICSNAME)) { handleGetAllMMetricsName(req, ret); } else if (action.equals(STATS_GET_METRICHISTORY)) { handleGetMetricHistory(req, ret); } else if (action.equals(STATS_SET_ENABLEMETRICS)) { handleChangeManagerStatusRequest(req, ret, true); } else if (action.equals(STATS_SET_DISBLEMETRICS)) { handleChangeManagerStatusRequest(req, ret, false); } } JSONUtils.toJSON(ret, resp.getOutputStream(), true); }

Target:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Map<String, Object> ret = new HashMap<String, Object>(); if (hasParam(req, ACTION_PARAM)) { String action = getParam(req, ACTION_PARAM); if (action.equals(STATS_SET_REPORTINGINTERVAL)) { handleChangeMetricInterval(req, ret); } else if (action.equals(STATS_SET_CLEANINGINTERVAL)) { handleChangeCleaningInterval(req, ret); } else if (action.equals(STATS_SET_MAXREPORTERPOINTS)) { handleChangeEmitterPoints(req, ret); } else if (action.equals(STATS_GET_ALLMETRICSNAME)) { handleGetAllMMetricsName(req, ret); } else if (action.equals(STATS_GET_METRICHISTORY)) { handleGetMetricHistory(req, ret); } else if (action.equals(STATS_SET_ENABLEMETRICS)) { handleChangeManagerStatusRequest(req, ret, true); } else if (action.equals(STATS_SET_DISABLEMETRICS)) { handleChangeManagerStatusRequest(req, ret, false); } else { ret.put(RESPONSE_ERROR, "Invalid action"); } } JSONUtils.toJSON(ret, resp.getOutputStream(), true); }
Source:
private Map<ArchitectureType, Map<Version, Boolean>> getMap(ArchCapabilitiesVerb archCapabilitiesVerb) { if (verbMap.containsKey(archCapabilitiesVerb)) { return verbMap.get(archCapabilitiesVerb); } else { Map<ArchitectureType, Map<Version, Boolean>> supportMap = new EnumMap<ArchitectureType, Map<Version, Boolean>>(ArchitectureType.class); for (ArchitectureType arch : ArchitectureType.values()) { Map<Version, Boolean> archMap = new HashMap<Version, Boolean>(); for (Version version : Version.ALL) { boolean isSupported = isSupported(archCapabilitiesVerb, arch, version); archMap.put(version, isSupported); } supportMap.put(arch, archMap); } verbMap.put(archCapabilitiesVerb, supportMap); return supportMap; } }

Target:
private synchronized Map<ArchitectureType, Map<Version, Boolean>> getMap(ArchCapabilitiesVerb archCapabilitiesVerb) { if (verbMap.containsKey(archCapabilitiesVerb)) { return verbMap.get(archCapabilitiesVerb); } else { Map<ArchitectureType, Map<Version, Boolean>> supportMap = new EnumMap<ArchitectureType, Map<Version, Boolean>>(ArchitectureType.class); for (ArchitectureType arch : ArchitectureType.values()) { Map<Version, Boolean> archMap = new HashMap<Version, Boolean>(); for (Version version : Version.ALL) { boolean isSupported = isSupported(archCapabilitiesVerb, arch, version); archMap.put(version, isSupported); } supportMap.put(arch, archMap); } verbMap.put(archCapabilitiesVerb, supportMap); return supportMap; } }
Source:
public ISYActiveBindingConfig(Map<Object, Object> config) { this.logger.info("OpenHab Binding Configuration(refresh='{}',upnp='{}',uuid='{}',ip='{}',port='{}',user='{}',password='{}')", config.get("refresh"), config.get("upnp"),config.get("uuid"),config.get("ip"),config.get("port"),config.get("user"),"xxxxxx"); if (StringUtils.isNotBlank((String) config.get("refresh"))) { refreshInterval = Long.parseLong((String) config.get("refresh")); } if (StringUtils.isNotBlank((String) config.get("user")) && StringUtils.isNotBlank((String) config.get("password"))) { this.user = (String) config.get("user"); this.password = (String) config.get("password"); } else { this.logger.warn("No user/password specified"); } if (StringUtils.isNotBlank((String) config.get("upnp"))) { useUpnp = Boolean.parseBoolean((String) config.get("upnp")); } if (!useUpnp && StringUtils.isNotBlank((String) config.get("uuid")) && StringUtils.isNotBlank((String) config.get("ip")) && StringUtils.isNotBlank((String) config.get("port"))) { this.uuid = (String) config.get("uuid"); this.ipAddress = (String) config.get("ip"); try { this.port = Integer.parseInt((String) config.get("port")); } catch (NumberFormatException ne) { this.logger.error("Not a valid port number"); throw new RuntimeException("Not a valid port number", ne); } if (this.port < 0 || this.port > 65535) { this.logger.error("Port out of range (0-65535)"); throw new NumberFormatException("Invalid port"); } } else { this.logger.info("Using UPNP for ISY connection."); } }

Target:
public ISYActiveBindingConfig(Map<Object, Object> config) { this.logger .info("OpenHab Binding Configuration(refresh='{}',upnp='{}',uuid='{}',ip='{}',port='{}',user='{}',password='{}')", config.get("refresh"), config.get("upnp"), config.get("uuid"), config.get("ip"), config.get("port"), config.get("user"), "xxxxxx"); if (isNotBlank((String) config.get("refresh"))) { refreshInterval = Long.parseLong((String) config.get("refresh")); } if (isNotBlank((String) config.get("user")) && isNotBlank((String) config.get("password"))) { this.user = (String) config.get("user"); this.password = (String) config.get("password"); } else { this.logger.warn("No user/password specified"); } if (isNotBlank((String) config.get("upnp"))) { useUpnp = Boolean.parseBoolean((String) config.get("upnp")); } if (!useUpnp && isNotBlank((String) config.get("uuid")) && isNotBlank((String) config.get("ip")) && isNotBlank((String) config.get("port"))) { this.uuid = (String) config.get("uuid"); this.ipAddress = (String) config.get("ip"); try { this.port = Integer.parseInt((String) config.get("port")); } catch (NumberFormatException ne) { this.logger.error("Not a valid port number"); throw new RuntimeException("Not a valid port number", ne); } if (this.port < 0 || this.port > 65535) { this.logger.error("Port out of range (0-65535)"); throw new NumberFormatException("Invalid port"); } } else { this.logger.info("Using UPNP for ISY connection."); } }
Source:
public void setProjectService(KieProjectService projectService) { this.projectService = projectService; }

Target:
protected void setProjectService(KieProjectService projectService) { this.projectService = projectService; }
Source:
public BaseLayer(NeuralNetConfiguration conf, INDArray input) { this.input = input; this.conf = conf; }

Target:
public BaseLayer(NeuralNetConfiguration conf, INDArray input) { this(conf); this.input = input; }
Source:
public List<FormSelectionMark> getSelectionMarks() { return this.selectionMarks; }

Target:
public List<FormSelectionMark> getSelectionMarks() { return Collections.unmodifiableList(this.selectionMarks); }
Source:
public void verifyAccessibleForCurrentUserAsInstructorOrTeamMember(AccountAttributes account, String courseId, String section, String email) { InstructorAttributes instructor = InstructorsLogic.inst().getInstructorForGoogleId(courseId, account.googleId); StudentAttributes student = StudentsLogic.inst().getStudentForCourseIdAndGoogleId(courseId, account.googleId); if (instructor == null && student == null) { throw new UnauthorizedAccessException("User is not in the course that student belongs to"); } else if (instructor != null && !instructor.isAllowedForPrivilege(section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS) || student != null && !StudentsLogic.inst().isStudentsInSameTeam(courseId, email, student.email)) { throw new UnauthorizedAccessException("User does not have enough privileges to view the photo"); } }

Target:
public void verifyAccessibleForCurrentUserAsInstructorOrTeamMember(AccountAttributes account, String courseId, String section, String email) { InstructorAttributes instructor = InstructorsLogic.inst().getInstructorForGoogleId(courseId, account.googleId); if (instructor != null) { if (!instructor.isAllowedForPrivilege(section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS)) { throw new UnauthorizedAccessException("Instructor does not have enough privileges to view the photo"); } return; } StudentAttributes student = StudentsLogic.inst().getStudentForCourseIdAndGoogleId(courseId, account.googleId); if (student != null) { if (!StudentsLogic.inst().isStudentsInSameTeam(courseId, email, student.email)) { throw new UnauthorizedAccessException("Student does not have enough privileges to view the photo"); } return; } throw new UnauthorizedAccessException("User is not in the course that student belongs to"); }
Source:
public void onCacheCreatedEvent( CacheEntryEvent event ) { if ( event.getKey() == this.key ) { this.lock.signal(); } events.add( event ); }

Target:
public void onCacheCreatedEvent( CacheEntryEvent event ) { if ( event.getKey().equals( this.key ) ) { this.lock.signal(); } events.add( event ); }