auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void startDuckTimer() { if (this.duckTimer != null) { cancelDuckTimer(); } this.duckTimer = new Timer(); this.duckTimer.schedule(new TimerTask() { @Override public void run() { if (LogUtil.isLogAvailable()) { Log.d(TAG, "Duck timer executed...something's wrong. Resetting audio focus and unducking volumne.."); } hasFocus = false; requestAudio(); unduck(); } }, DUCK_TIMER_DELAY); }

Target:
private void startDuckTimer() { if (this.duckTimer != null) { cancelDuckTimer(); } this.duckTimer = new Timer(); this.duckTimer.schedule(new TimerTask() { @Override public void run() { if (LogUtil.isLogAvailable()) { Log.d(TAG, "Duck timer executed...something's wrong. Resetting audio focus and unducking volume.."); } hasFocus = false; requestAudio(); unduck(); } }, DUCK_TIMER_DELAY_MS); }
Source:
public void before() throws Exception { final String userHome = System.getProperty("user.home"); final String propertiesFilename = userHome + "/metamodel-integrationtest-configuration.properties"; final File file = new File(propertiesFilename); Assume.assumeTrue(file.exists()); final Properties props = new Properties(); props.load(new FileReader(file)); final String accessKey = props.getProperty("dynamodb.accessKey"); final String secretKey = props.getProperty("dynamodb.secretKey"); Assume.assumeNotNull(accessKey, secretKey); final AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey); final AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials); client = AmazonDynamoDBClientBuilder.standard().withRegion(Regions.US_WEST_2).withCredentials( credentialsProvider).build(); }

Target:
public void before() throws Exception { final String userHome = System.getProperty("user.home"); final String propertiesFilename = userHome + "/metamodel-integrationtest-configuration.properties"; final File file = new File(propertiesFilename); Assume.assumeTrue(file.exists()); final Properties props = new Properties(); props.load(new FileReader(file)); final String accessKey = props.getProperty("dynamodb.accessKey"); final String secretKey = props.getProperty("dynamodb.secretKey"); Assume.assumeNotNull(accessKey, secretKey); final Regions region = Regions.fromName(props.getProperty("dynamodb.region", Regions.DEFAULT_REGION.getName())); final AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey); final AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials); client = AmazonDynamoDBClientBuilder.standard().withRegion(region).withCredentials(credentialsProvider).build(); }
Source:
public Dirichlet(final Dirichlet prior, final double[] counts) { Utils.nonNull(counts); Arrays.stream(counts).forEach(c -> ParamUtils.isPositive(c, "Counts must be positive.")); if (counts.length != prior.size()) { throw new IllegalArgumentException("Counts and prior must have same length."); } alpha = IntStream.range(0, prior.size()).mapToDouble(n -> prior.alpha[n] + counts[n]).toArray(); }

Target:
public Dirichlet(final Dirichlet prior, final double[] counts) { Utils.nonNull(prior, "prior can't be null"); Utils.nonNull(counts, "counts can't be null"); Arrays.stream(counts).forEach(c -> ParamUtils.isPositive(c, "Counts must be positive.")); Utils.validateArg(counts.length == prior.size(), "Counts and prior must have same length."); alpha = IntStream.range(0, prior.size()).mapToDouble(n -> prior.alpha[n] + counts[n]).toArray(); }
Source:
static AwsDates fromDateHeader(String date) { DateFormat dateFormat = new SimpleDateFormat(X_AMZ_DATE_FORMAT); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); try { Date inputDate = new SimpleDateFormat(CUSTOM_DATE_FORMAT).parse(date); String xAmzDate = dateFormat.format(inputDate); return new AwsDates(date, xAmzDate, xAmzDate.substring(0, 8)); } catch (ParseException e) { throw new IllegalArgumentException("Invalid date provided: " + date, e); } }

Target:
static AwsDates fromDateHeader(String date) throws ParseException { DateFormat dateFormat = new SimpleDateFormat(X_AMZ_DATE_FORMAT); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); Date inputDate = new SimpleDateFormat(CUSTOM_DATE_FORMAT).parse(date); String xAmzDate = dateFormat.format(inputDate); return new AwsDates(xAmzDate, date); }
Source:
public void testGetResourceInformationIfMethodAbsent() { final ResourceInformationReflector resourceInformationReflector = new ResourceInformationReflector(ResourceWithoutMethod.class.getName(), ResourceInfoWithMethod.class.getName()); final ResourceWithMethod resourceWithMethod = new ResourceWithMethod(); resourceWithMethod.setResourceInformation(RESOURCE_NAME, ResourceInfoWithMethod.newInstance(RESOURCE_NAME, RESOURCE_VALUE)); final Map<String, Long> externalResources = resourceInformationReflector.getExternalResourcesUnSafe(resourceWithMethod); assertThat(externalResources.size(), is(0)); }

Target:
public void testGetResourceInformationIfMethodAbsent() { final ResourceInformationReflector resourceInformationReflector = new ResourceInformationReflector(ResourceWithoutMethod.class.getName(), ResourceInfoWithMethod.class.getName()); final ResourceWithMethod resourceWithMethod = new ResourceWithMethod(); resourceWithMethod.setResourceInformation(RESOURCE_NAME, ResourceInfoWithMethod.newInstance(RESOURCE_NAME, RESOURCE_VALUE)); final Map<String, Long> externalResources = resourceInformationReflector.getExternalResourcesUnSafe(resourceWithMethod); assertThat(externalResources.entrySet(), is(empty())); }
Source:
private void drawLine(final double startX, final double startY, final double endX, final double endY) { Circle head = new Circle(HEAD_RADIUS, Color.RED); Circle tail = new Circle(HEAD_RADIUS, Color.GREEN); line.setStartX(startX); line.setStartY(startY); line.setEndX(endX); line.setEndY(endY); head.setCenterX(line.getStartX()); head.setCenterY(line.getStartY()); tail.setCenterX(line.getEndX()); tail.setCenterY(line.getEndY()); this.getChildren().addAll(line, head, tail); }

Target:
private void drawLine(final double startX, final double startY, final double endX, final double endY) { Circle head = new Circle(HEAD_RADIUS); Circle tail = new Circle(HEAD_RADIUS); head.getStyleClass().add("edgeHead"); tail.getStyleClass().add("edgeTail"); line.setStartX(startX); line.setStartY(startY); line.setEndX(endX); line.setEndY(endY); head.setCenterX(line.getStartX()); head.setCenterY(line.getStartY()); tail.setCenterX(line.getEndX()); tail.setCenterY(line.getEndY()); this.getChildren().addAll(line, head, tail); }
Source:
public void run() { while (!isInterrupted()) { _sleepForPollPeriod(); if (!isInterrupted() && _isMonitoringServiceEnabled()) { try { _pushCounters(); } catch (Throwable t) { _logger.error("Error occured while pushing monitor counters for {}. Reason: {}", HOSTNAME, t.getMessage()); } } } }

Target:
public void run() { while (!isInterrupted()) { _sleepForPollPeriod(); if (!isInterrupted() && _isMonitoringServiceEnabled()) { try { _pushCounters(); } catch (Exception ex) { _logger.error("Error occured while pushing monitor counters for {}. Reason: {}", HOSTNAME, ex.getMessage()); } } } }
Source:
public void runEnhancementsFileObject() throws Exception { FileObject fileObj = repositoryObjectFactory.createFileObject(PIDs.get(UUID_TEST), null); fileObj.addOriginalFile(makeContentUri(BINARY_CONTENT), "file.png", "image/png", null, null); MvcResult result = mvc.perform(post("/runEnhancements") .contentType(MediaType.APPLICATION_JSON) .content("{\"force\":false,\"pids\":[\"" + UUID_TEST + "\"]}") .accept(MediaType.APPLICATION_JSON)) .andExpect(status().is2xxSuccessful()) .andReturn(); assertResponseSuccess(result); verify(jmsTemplate).send(any(MessageCreator.class)); }

Target:
public void runEnhancementsFileObject() throws Exception { FileObject fileObj = repositoryObjectFactory.createFileObject(null); PID filePid = fileObj.getPid(); fileObj.addOriginalFile(makeContentUri(BINARY_CONTENT), "file.png", "image/png", null, null); setResultMetadataObject(filePid); MvcResult result = mvc.perform(post("/runEnhancements") .contentType(MediaType.APPLICATION_JSON) .content("{\"force\":false,\"pids\":[\"" + filePid.getId() + "\"]}") .accept(MediaType.APPLICATION_JSON)) .andExpect(status().is2xxSuccessful()) .andReturn(); assertResponseSuccess(result); verify(messageSender).sendMessage(docCaptor.capture()); Document msgDoc = docCaptor.getValue(); assertMessageValues(msgDoc, fileObj.getOriginalFile().getPid(), "image/png"); }
Source:
public JobsRunner pull(TransferForms forms, BriefcasePreferences appPreferences, BriefcasePreferences localPreferences) { return JobsRunner.launchAsync(forms.map(form -> run(jobStatus -> transferODKToBriefcase( appPreferences.getBriefcaseDir().orElseThrow(BriefcaseException::new), new TerminationFuture(), TransferForms.of(form) )))).onComplete(() -> EventBus.publish(new PullEvent.PullComplete())); }

Target:
public JobsRunner pull(TransferForms forms, BriefcasePreferences appPreferences, BriefcasePreferences localPreferences) { return JobsRunner.launchAsync(forms.map(form -> run(jobStatus -> transferODKToBriefcase( appPreferences.getBriefcaseDir().orElseThrow(BriefcaseException::new), path.toFile(), new TerminationFuture(), TransferForms.of(form) )))).onComplete(() -> EventBus.publish(new PullEvent.PullComplete())); }
Source:
private void removeUnnecessaryAdvancedPrefs(PreferenceScreen screen) { PreferenceCategory plugins = (PreferenceCategory) screen.findPreference("category_plugins"); if (!CompatHelper.hasKanaAndEmojiKeys()) { CheckBoxPreference emojiScrolling = (CheckBoxPreference) screen.findPreference("scrolling_buttons"); if (emojiScrolling != null && plugins != null) { plugins.removePreference(emojiScrolling); } } if (!CompatHelper.hasScrollKeys() && !CompatHelper.hasKanaAndEmojiKeys()) { CheckBoxPreference doubleScrolling = (CheckBoxPreference) screen.findPreference("double_scrolling"); if (doubleScrolling != null && plugins != null) { plugins.removePreference(doubleScrolling); } } PreferenceCategory workarounds = (PreferenceCategory) screen.findPreference("category_workarounds"); if (workarounds != null) { CheckBoxPreference fixHebrewText = (CheckBoxPreference) screen.findPreference("fixHebrewText"); CompatHelper.removeHiddenPreferences(this.getApplicationContext()); workarounds.removePreference(fixHebrewText); } }

Target:
private void removeUnnecessaryAdvancedPrefs(PreferenceScreen screen) { PreferenceCategory plugins = (PreferenceCategory) screen.findPreference("category_plugins"); if (!CompatHelper.hasKanaAndEmojiKeys()) { CheckBoxPreference emojiScrolling = (CheckBoxPreference) screen.findPreference("scrolling_buttons"); if (emojiScrolling != null && plugins != null) { plugins.removePreference(emojiScrolling); } } if (!CompatHelper.hasScrollKeys() && !CompatHelper.hasKanaAndEmojiKeys()) { CheckBoxPreference doubleScrolling = (CheckBoxPreference) screen.findPreference("double_scrolling"); if (doubleScrolling != null && plugins != null) { plugins.removePreference(doubleScrolling); } } }
Source:
public void setSelectQuery(String selectQuery) { this.selectQuery = selectQuery; }

Target:
public final void setSelectQuery(String selectQuery) { Assert.hasText(selectQuery, "'selectQuery' must be specified."); this.selectQuery = selectQuery; }
Source:
private void provisionDefaultPlugins( List<ComponentImpl> components, FileContentProvider contentProvider) throws DevfileException { Map<String, String> missingPluginsIdToRef = new HashMap<>(defaultPluginsToRefs); for (ComponentImpl t : components) { if (PLUGIN_COMPONENT_TYPE.equals(t.getType())) { String pluginPublisherAndName = getPluginPublisherAndName(t, contentProvider); missingPluginsIdToRef.remove(pluginPublisherAndName); } } for (String pluginRef : missingPluginsIdToRef.values()) { ExtendedPluginFQN fqn; ComponentImpl component; try { fqn = pluginFQNParser.parsePluginFQN(pluginRef); } catch (InfrastructureException e) { throw new DevfileException(e.getMessage(), e); } if (isNullOrEmpty(fqn.getReference())) { component = new ComponentImpl(PLUGIN_COMPONENT_TYPE, pluginRef); } else { try { fqn = pluginFQNParser.evaluateFqn(pluginRef, contentProvider); component = new ComponentImpl(PLUGIN_COMPONENT_TYPE, pluginRef); } catch (InfrastructureException e) { throw new DevfileException(e.getMessage(), e); } if (!isNullOrEmpty(fqn.getId())) { component.setId(fqn.getId()); } if (!isNullOrEmpty(fqn.getReference())) { component.setReference(fqn.getReference()); } } components.add(component); } }

Target:
private void provisionDefaultPlugins( List<ComponentImpl> components, FileContentProvider contentProvider) throws DevfileException { Map<String, String> missingPluginsIdToRef = new HashMap<>(defaultPluginsToRefs); removeAlreadyAddedPlugins(components, contentProvider, missingPluginsIdToRef); try { addMissingPlugins(components, contentProvider, missingPluginsIdToRef); } catch (InfrastructureException e) { throw new DevfileException(e.getMessage(), e); } }
Source:
public Integer saveRule(Rule rule) throws InvalidRuleException { return runInTransaction((status) -> { final Group group = classificationGroupDao.findByName(Groups.USER_DEFINED); ruleValidator.validate(rule); groupValidator.validate(group, rule); group.addRule(rule); final Integer ruleId = classificationRuleDao.save(rule); updateRulePositionsAndReloadEngine(RulePrioritizationUtil.sortRulePositions(group)); return ruleId; }); }

Target:
public Integer saveRule(Rule rule) throws InvalidRuleException { return runInTransaction((status) -> { final Group group = classificationGroupDao.findByName(Groups.USER_DEFINED); ruleValidator.validate(rule); groupValidator.validate(group, rule); group.addRule(rule); final Integer ruleId = classificationRuleDao.save(rule); updateRulePositionsAndReloadEngine(RulePositionUtil.sortRulePositions(rule)); return ruleId; }); }
Source:
public List<VdcBllMessages> validate() { Set<String> ifaceNames = new HashSet<String>(); Map<String, VdsNetworkInterface> bonds = new HashMap<String, VdsNetworkInterface>(); Map<String, List<VdsNetworkInterface>> bondSlaves = new HashMap<String, List<VdsNetworkInterface>>(); Map<String, network> networks = new HashMap<String, network>(); for (VdsNetworkInterface iface : params.getInterfaces()) { String name = iface.getName(); String networkName = iface.getNetworkName(); String bondName = iface.getBondName(); if (ifaceNames.contains(name)) { violations.add(VdcBllMessages.NETWORK_INTERFACE_NAME_ALREADY_IN_USE); continue; } else { ifaceNames.add(name); } if (isBond(iface)) { if (iface.getVlanId() == null) { extractBond(bonds, iface, name); } else if (!getExistingIfaces().containsKey(NetworkUtils.StripVlan(name))) { violations.add(VdcBllMessages.NETWORK_BOND_NOT_EXISTS); } } else { if (StringUtils.isNotBlank(bondName)) { extractBondSlave(bondSlaves, iface, bondName); } if (!getExistingIfaces().containsKey(NetworkUtils.StripVlan(name))) { violations.add(VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS); } } if (violations.isEmpty() && StringUtils.isNotBlank(networkName)) { extractNetwork(networks, iface, networkName); } } validateBonds(bonds, bondSlaves); this.networks = new ArrayList<network>(networks.values()); extractRemoveNetworks(networks.keySet(), getExisitingHostNetworkNames()); this.bonds = new ArrayList<VdsNetworkInterface>(bonds.values()); this.removedBonds = extractRemovedBonds(bonds); return violations; }

Target:
public List<VdcBllMessages> validate() { Set<String> ifaceNames = new HashSet<String>(); Set<String> bonds = new HashSet<String>(); Set<String> attachedNetworksNames = new HashSet<String>(); Map<String, List<VdsNetworkInterface>> bondSlaves = new HashMap<String, List<VdsNetworkInterface>>(); for (VdsNetworkInterface iface : params.getInterfaces()) { String name = iface.getName(); String networkName = iface.getNetworkName(); String bondName = iface.getBondName(); if (ifaceNames.contains(name)) { violations.add(VdcBllMessages.NETWORK_INTERFACE_NAME_ALREADY_IN_USE); continue; } else { ifaceNames.add(name); } if (isBond(iface)) { extractBondIfModified(bonds, iface, name); } else { if (StringUtils.isNotBlank(bondName)) { extractBondSlave(bondSlaves, iface, bondName); } if (!getExistingIfaces().containsKey(NetworkUtils.StripVlan(name))) { violations.add(VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS); } } if (violations.isEmpty() && StringUtils.isNotBlank(networkName)) { extractNetwork(attachedNetworksNames, iface, networkName); } } validateBonds(bonds, bondSlaves); detectSlaveChanges(bondSlaves); extractRemoveNetworks(attachedNetworksNames, getExisitingHostNetworkNames()); this.removedBonds = extractRemovedBonds(bonds); return violations; }
Source:
public static void main(String[] args) throws Exception { String filePath = System.getProperty("user.dir") + "\\dl4j-examples\\src\\main\\resources\\NewsData\\RawNewsToGenerateWordVector.txt"; log.info("Load & Vectorize Sentences...."); SentenceIterator iter = new BasicLineIterator(filePath); TokenizerFactory t = new DefaultTokenizerFactory(); t.setTokenPreProcessor(new CommonPreprocessor()); log.info("Building model...."); Word2Vec vec = new Word2Vec.Builder() .minWordFrequency(2) .iterations(5) .layerSize(100) .seed(42) .windowSize(20) .iterate(iter) .tokenizerFactory(t) .build(); log.info("Fitting Word2Vec model...."); vec.fit(); log.info("Writing word vectors to text file...."); WordVectorSerializer.writeWordVectors(vec, System.getProperty("user.dir") + "\\dl4j-examples\\src\\main\\resources\\NewsData\\NewsWordVector.txt"); }

Target:
public static void main(String[] args) throws Exception { String classPathResource = new ClassPathResource("NewsData").getFile().getAbsolutePath() + File.separator; String filePath = new File(classPathResource + File.separator + "RawNewsToGenerateWordVector.txt").getAbsolutePath(); log.info("Load & Vectorize Sentences...."); SentenceIterator iter = new BasicLineIterator(filePath); TokenizerFactory t = new DefaultTokenizerFactory(); t.setTokenPreProcessor(new CommonPreprocessor()); log.info("Building model...."); Word2Vec vec = new Word2Vec.Builder() .minWordFrequency(2) .iterations(5) .layerSize(100) .seed(42) .windowSize(20) .iterate(iter) .tokenizerFactory(t) .build(); log.info("Fitting Word2Vec model...."); vec.fit(); log.info("Writing word vectors to text file...."); WordVectorSerializer.writeWordVectors(vec, classPathResource + "NewsWordVector.txt"); }
Source:
public IndexMap( Map<Long, IndexProxy> indexesById ) { this( indexesById, indexesByDescriptor( indexesById ), indexIdsByDescriptor( indexesById ) ); }

Target:
IndexMap( Map<Long,IndexProxy> indexesById ) { this( indexesById, indexesByDescriptor( indexesById ), indexIdsByDescriptor( indexesById ) ); }
Source:
public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException { List<String> authorizationValues = request.getRequestHeaderValues(HttpConstants.AUTHORIZATION); if (authorizationValues != null) { Matcher matcher; for (String current : authorizationValues) { if ((matcher = BEARER_TOKEN_PATTERN.matcher(current)).matches()) { BearerTokenEvidence tokenEvidence = new BearerTokenEvidence(matcher.group(1)); EvidenceVerifyCallback verifyCallback = new EvidenceVerifyCallback(tokenEvidence); handleCallback(verifyCallback); if (verifyCallback.isVerified()) { AuthorizeCallback authorizeCallback = new AuthorizeCallback(null, null); handleCallback(authorizeCallback); if (authorizeCallback.isAuthorized()) { httpBearer.debugf("Token authentication successful."); handleCallback(new IdentityCredentialCallback(new BearerTokenCredential(tokenEvidence.getToken()), true)); handleCallback(AuthenticationCompleteCallback.SUCCEEDED); request.authenticationComplete(); return; } } httpBearer.debugf("Token authentication failed."); request.authenticationFailed("Invalid bearer token", response -> response.setStatusCode(FORBIDDEN)); } } } request.noAuthenticationInProgress(this::unauthorizedResponse); }

Target:
public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException { List<String> authorizationValues = request.getRequestHeaderValues(HttpConstants.AUTHORIZATION); if (authorizationValues != null) { Matcher matcher; for (String current : authorizationValues) { if ((matcher = BEARER_TOKEN_PATTERN.matcher(current)).matches()) { BearerTokenEvidence tokenEvidence = new BearerTokenEvidence(matcher.group(1)); EvidenceVerifyCallback verifyCallback = new EvidenceVerifyCallback(tokenEvidence); handleCallback(verifyCallback); if (verifyCallback.isVerified()) { AuthorizeCallback authorizeCallback = new AuthorizeCallback(null, null); handleCallback(authorizeCallback); if (authorizeCallback.isAuthorized()) { httpBearer.debugf("Token authentication successful."); handleCallback(new IdentityCredentialCallback(new BearerTokenCredential(tokenEvidence.getToken()), true)); handleCallback(AuthenticationCompleteCallback.SUCCEEDED); request.authenticationComplete(); return; } } httpBearer.debugf("Token authentication failed."); request.authenticationFailed("Invalid bearer token", response -> response.setStatusCode(FORBIDDEN)); return; } } } request.noAuthenticationInProgress(this::unauthorizedResponse); }
Source:
public static List<File> recursiveListLocalDir(File dir) { File[] files = dir.listFiles(); if (files == null) { return Collections.EMPTY_LIST; } List<File> result = new ArrayList<>(files.length); for (File f : files) { if (f.isDirectory()) { result.addAll(recursiveListLocalDir(f)); continue; } result.add(f); } return result; }

Target:
public static List<File> recursiveListLocalDir(File dir) { File[] files = dir.listFiles(); if (files == null) { return Collections.emptyList(); } List<File> result = new ArrayList<>(files.length); for (File f : files) { if (f.isDirectory()) { result.addAll(recursiveListLocalDir(f)); continue; } result.add(f); } return result; }
Source:
public void onActivate(ActivateEvent event, EntityRef entity) { LASTeamComponent baseTeamComponent = entity.getComponent(LASTeamComponent.class); EntityRef player = event.getInstigator(); CharacterHeldItemComponent characterHeldItemComponent = player.getComponent(CharacterHeldItemComponent.class); if (characterHeldItemComponent != null) { EntityRef heldItem = characterHeldItemComponent.selectedItem; if (baseTeamComponent.team.equals(LASUtils.RED_TEAM) && heldItem.hasComponent(BlockItemComponent.class) && heldItem.getComponent(BlockItemComponent.class).blockFamily.getURI().toString().equals(LASUtils.BLACK_FLAG_URI)) { redScore++; inventoryManager.removeItem(player, player, heldItem, true); worldProvider.setBlock(new Vector3i(LASUtils.CENTER_BLACK_BASE_POSITION.x, LASUtils.CENTER_BLACK_BASE_POSITION.y + 1, LASUtils.CENTER_BLACK_BASE_POSITION.z), blockManager.getBlock(LASUtils.BLACK_FLAG_URI)); } if (baseTeamComponent.team.equals(LASUtils.BLACK_TEAM) && heldItem.hasComponent(BlockItemComponent.class) && heldItem.getComponent(BlockItemComponent.class).blockFamily.getURI().toString().equals(LASUtils.RED_FLAG_URI)) { blackScore++; inventoryManager.removeItem(player, player, heldItem, true); worldProvider.setBlock(new Vector3i(LASUtils.CENTER_RED_BASE_POSITION.x, LASUtils.CENTER_RED_BASE_POSITION.y + 1, LASUtils.CENTER_RED_BASE_POSITION.z), blockManager.getBlock(LASUtils.RED_FLAG_URI)); } } }

Target:
public void onActivate(ActivateEvent event, EntityRef entity) { checkAndResetGameOnScore(event, entity); }
Source:
public int getIdForLanguage(@NonNull String code) { Integer id = ids.get(code); return id != null ? id : 0; }

Target:
public int getIdForLanguage(@NonNull String code) { Integer id = ids.get(code); return id == null ? 0 : id; }
Source:
private int getPortOffset() { ServerConfiguration carbonConfig = ServerConfiguration.getInstance(); String portOffset = System.getProperty("portOffset", carbonConfig.getFirstProperty(CARBON_CONFIG_PORT_OFFSET)); try { return ((portOffset != null) ? Integer.parseInt(portOffset.trim()) : CARBON_DEFAULT_PORT_OFFSET); } catch (NumberFormatException e) { return CARBON_DEFAULT_PORT_OFFSET; } }

Target:
private int getPortOffset() { ServerConfiguration carbonConfig = ServerConfiguration.getInstance(); String portOffset = System.getProperty("portOffset", carbonConfig.getFirstProperty(CARBON_CONFIG_PORT_OFFSET)); try { if ((portOffset != null)) { return Integer.parseInt(portOffset.trim()); } else { return CARBON_DEFAULT_PORT_OFFSET; } } catch (NumberFormatException e) { return CARBON_DEFAULT_PORT_OFFSET; } }
Source:
public void onNewJobModelConfirmed(String version) { LOG.info("pid=" + processorId + "new version " + version + " of the job model got confirmed"); JobModel jobModel = getJobModel(); if (coordinatorListener != null) { coordinatorListener.onNewJobModel(processorId, jobModel); } zkUtils.cleanupZK(10); }

Target:
public void onNewJobModelConfirmed(String version) { LOG.info("pid=" + processorId + "new version " + version + " of the job model got confirmed"); JobModel jobModel = getJobModel(); if (coordinatorListener != null) { coordinatorListener.onNewJobModel(processorId, jobModel); } }
Source:
protected boolean canDoAction() { return super.canDoAction() && VdsGroupExists() && logicalNetworkExists() && changesAreClusterCompatible(); }

Target:
protected boolean canDoAction() { return super.canDoAction() && VdsGroupExists() && changesAreClusterCompatible() && logicalNetworkExists(); }
Source:
private void readForward(PipedOutputStream pos) { try { withinOperationsElement = false; final boolean isForwardDir = direction == Direction.Forward; final String closingTag = getClosingTag(isForwardDir); String line = reader.readLine(); while (line != null && !line.contains(closingTag)) { if (line.contains(getOpeningTag(isForwardDir))) { withinOperationsElement = true; } else if (withinOperationsElement) { pos.write(line.getBytes()); } line = reader.readLine(); } if (line != null) { withinOperationsElement = false; } } catch (final IOException ex) { ModelUtil.logException(ex); } finally { try { pos.close(); } catch (final IOException ex) { ModelUtil.logException(ex); } } }

Target:
private void readForward(PipedOutputStream pos) { try { boolean withinOperationsElement = false; final boolean isForwardDir = direction == Direction.Forward; final String closingTag = getClosingTag(isForwardDir); String line = reader.readLine(); while (line != null && !line.contains(closingTag)) { if (line.contains(getOpeningTag(isForwardDir))) { withinOperationsElement = true; } else if (withinOperationsElement) { pos.write(line.getBytes()); } line = reader.readLine(); } if (line != null) { withinOperationsElement = false; } } catch (final IOException ex) { ModelUtil.logException(ex); } finally { try { pos.close(); } catch (final IOException ex) { ModelUtil.logException(ex); } } }
Source:
public long getLong() { return convertTo(Value.LONG).getLong(); }

Target:
public long getLong() { return ((ValueLong) convertTo(Value.LONG)).getLong(); }
Source:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertSignalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }

Target:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertSignalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
public void run(IProgressMonitor monitor) { ListMultimap<File, String> locationToProjectNames = ArrayListMultimap.create(); for (EclipseProject project : this.projects) { locationToProjectNames.put(project.getProjectDirectory(), project.getName()); } for (File location : locationToProjectNames.keySet()) { List<String> projectNames = locationToProjectNames.get(location); if (projectNames.size() > 1) { throw new UnsupportedConfigurationException(String.format("The following projects all located in the %s directory: %s", location.getAbsolutePath(), Joiner.on(", ").join(projectNames))); } else if (location.equals(WORKSPACE_ROOT)) { throw new UnsupportedConfigurationException(String.format("Project %s location matches workspace root %s", projectNames.get(0), WORKSPACE_ROOT.getAbsolutePath())); } } }

Target:
public void run(IProgressMonitor monitor) { ListMultimap<File, String> locationToProjectNames = ArrayListMultimap.create(); for (EclipseProject project : this.projects) { locationToProjectNames.put(project.getProjectDirectory(), project.getName()); } for (File location : locationToProjectNames.keySet()) { List<String> projectNames = locationToProjectNames.get(location); if (projectNames.size() > 1) { throw new UnsupportedConfigurationException(String.format("The following projects are all located in the %s directory: %s", location.getAbsolutePath(), Joiner.on(", ").join(projectNames))); } else if (location.equals(WORKSPACE_ROOT)) { throw new UnsupportedConfigurationException(String.format("Project %s location matches workspace root %s", projectNames.get(0), WORKSPACE_ROOT.getAbsolutePath())); } } }
Source:
public boolean filter(final LogMessage message) { final LocalDate startDate = Optional.ofNullable(startDatePicker.getValue()).orElse(LocalDate.now()); final LocalTime startTime = LocalTime.of(startHourSpinner.getValue(), startMinuteSpinner.getValue(), startSecondSpinner.getValue(), startMilliSpinner.getValue() * 1_000_000); final ZonedDateTime startDateTime = ZonedDateTime.of(LocalDateTime.of(startDate, startTime), ZoneId.systemDefault()); final LocalDate endDate = Optional.ofNullable(endDatePicker.getValue()).orElse(LocalDate.now()); final LocalTime endTime = LocalTime.of(endHourSpinner.getValue(), endMinuteSpinner.getValue(), endSecondSpinner.getValue(), endMilliSpinner.getValue() * 1_000_000); final ZonedDateTime endDateTime = ZonedDateTime.of(LocalDateTime.of(endDate, endTime), ZoneId.systemDefault()); final Set<Level> selectedLevels = Optional.ofNullable(levelComboBox.getSelectionModel().getSelectedItem()). map(l -> Collections.singleton(l)).orElse(Collections.emptySet()); if(!selectedLevels.contains(message.getLevel())) { return false; } if(message.getTimestamp().isBefore(startDateTime)) { return false; } if(message.getTimestamp().isAfter(endDateTime)) { return false; } return true; }

Target:
public boolean filter(final LogMessage message) { Assert.requireNonNull(message, "message"); final LocalDate startDate = Optional.ofNullable(startDatePicker.getValue()).orElse(LocalDate.now()); final LocalTime startTime = LocalTime.of(startHourSpinner.getValue(), startMinuteSpinner.getValue(), startSecondSpinner.getValue(), startMilliSpinner.getValue() * 1_000_000); final ZonedDateTime startDateTime = ZonedDateTime.of(LocalDateTime.of(startDate, startTime), ZoneId.systemDefault()); final LocalDate endDate = Optional.ofNullable(endDatePicker.getValue()).orElse(LocalDate.now()); final LocalTime endTime = LocalTime.of(endHourSpinner.getValue(), endMinuteSpinner.getValue(), endSecondSpinner.getValue(), endMilliSpinner.getValue() * 1_000_000); final ZonedDateTime endDateTime = ZonedDateTime.of(LocalDateTime.of(endDate, endTime), ZoneId.systemDefault()); final Set<Level> selectedLevels = Optional.ofNullable(levelComboBox.getSelectionModel().getSelectedItem()). map(l -> Collections.singleton(l)).orElse(Collections.emptySet()); if(!selectedLevels.contains(message.getLevel())) { return false; } if(message.getTimestamp().isBefore(startDateTime)) { return false; } if(message.getTimestamp().isAfter(endDateTime)) { return false; } return true; }
Source:
public void close() { flipper = false; try { flipperJob.waitTermination(); } catch ( InterruptedException | ExecutionException e ) { e.printStackTrace(); } applier.stop(); Consumer<WritableFulltext> fulltextCloser = luceneFulltextIndex -> { try { luceneFulltextIndex.saveConfiguration( transactionIdStore.getLastCommittedTransactionId() ); luceneFulltextIndex.close(); } catch ( IOException e ) { log.error( "Unable to close fulltext index.", e ); } }; writableNodeIndices[ASIDE].values().forEach( fulltextCloser ); writableNodeIndices[BSIDE].values().forEach( fulltextCloser ); writableRelationshipIndices[ASIDE].values().forEach( fulltextCloser ); writableRelationshipIndices[BSIDE].values().forEach( fulltextCloser ); }

Target:
public void close() { closed = true; try { flipperJob.waitTermination(); } catch ( InterruptedException | ExecutionException e ) { log.error( "Unable stop the fulltext index flipper", e ); } applier.stop(); Consumer<WritableFulltext> fulltextCloser = luceneFulltextIndex -> { try { luceneFulltextIndex.saveConfiguration( transactionIdStore.getLastCommittedTransactionId() ); luceneFulltextIndex.close(); } catch ( IOException e ) { log.error( "Unable to close fulltext index.", e ); } }; writableNodeIndices[ASIDE].values().forEach( fulltextCloser ); writableNodeIndices[BSIDE].values().forEach( fulltextCloser ); writableRelationshipIndices[ASIDE].values().forEach( fulltextCloser ); writableRelationshipIndices[BSIDE].values().forEach( fulltextCloser ); }
Source:
protected boolean migrateAllVms(ExecutionContext parentContext, boolean HAOnly) { boolean succeeded = true; for (VM vm : vms) { if (vm.isHostedEngine()) { if (!canScheduleVm(vm)) { succeeded = false; appendCustomCommaSeparatedValue("failedVms", vm.getName()); log.error("There is no host capable of running the hosted engine VM"); } } if (vm.getStatus() != VMStatus.MigratingFrom && (!HAOnly || vm.isAutoStartup())) { if (!migrateVm(vm, parentContext)) { succeeded = false; appendCustomCommaSeparatedValue("failedVms", vm.getName()); log.error("Failed to migrate VM '{}'", vm.getName()); } } } return succeeded; }

Target:
protected boolean migrateAllVms(ExecutionContext parentContext, boolean HAOnly) { boolean succeeded = true; List<VM> vmsToMigrate = new ArrayList<>(); for (VM vm : vms) { if (vm.isHostedEngine()) { if (!canScheduleVm(vm)) { succeeded = false; log.error("There is no host capable of running the hosted engine VM"); } } if (vm.getStatus() != VMStatus.MigratingFrom && (!HAOnly || vm.isAutoStartup())) { vmsToMigrate.add(vm); } } if (!migrateVms(vmsToMigrate, parentContext)) { succeeded = false; log.error("Failed to migrate one or more VMs."); } return succeeded; }
Source:
public <T> List<T> searchEntitiesWithFullDetails(MambuEntityType searchEntityType, JSONFilterConstraints filterConstraints, String offset, String limit) throws MambuApiException { ENDING", "dataItemType":"LOANS"}} ApiDefinition apiDefinition = SearchService.makeApiDefinitionForSearchByFilter(searchEntityType); apiDefinition.setWithFullDetails(true); return serviceExecutor.executeJson(apiDefinition, filterConstraints, null, null, ServiceHelper.makePaginationParams(offset, limit)); }

Target:
public <T> List<T> searchEntitiesWithFullDetails(MambuEntityType searchEntityType, JSONFilterConstraints filterConstraints, String offset, String limit) throws MambuApiException { ENDING", "dataItemType":"LOANS"}} ApiDefinition apiDefinition = makeSearchEntitiesWithFullApiDefinition(searchEntityType); return serviceExecutor.executeJson(apiDefinition, filterConstraints, null, null, ServiceHelper.makePaginationParams(offset, limit)); }
Source:
public void startBootstrap(RowMap startBootstrapRow, AbstractProducer producer, MaxwellReplicator replicator) throws Exception { String databaseName = ( String ) startBootstrapRow.getData("database_name"); String tableName = ( String ) startBootstrapRow.getData("table_name"); LOGGER.debug(String.format("bootstrapping request for %s.%s", databaseName, tableName)); Schema schema = replicator.getSchema(); Database database = findDatabase(schema, databaseName); Table table = findTable(tableName, database); OpenReplicator openReplicator = replicator.getOpenReplicator(); BinlogPosition position = new BinlogPosition(openReplicator.getBinlogPosition(), openReplicator.getBinlogFileName()); producer.push(startBootstrapRow); producer.push(bootstrapStartRowMap(table, position)); LOGGER.info(String.format("bootstrapping started for %s.%s, binlog position is %s", databaseName, tableName, position.toString())); try ( Connection connection = getConnection() ) { setBootstrapRowToStarted(startBootstrapRow, connection); ResultSet resultSet = getAllRows(databaseName, tableName, schema, connection); int insertedRows = 0; while ( resultSet.next() ) { RowMap row = new RowMap( "insert", databaseName, tableName, System.currentTimeMillis(), table.getPKList(), position); setRowValues(row, resultSet, table); LOGGER.debug("bootstrapping row : " + row.toJSON()); producer.push(row); ++insertedRows; updateInsertedRowsColumn(insertedRows, startBootstrapRow, connection); } setBootstrapRowToCompleted(insertedRows, startBootstrapRow, connection); } }

Target:
public void startBootstrap(RowMap startBootstrapRow, AbstractProducer producer, MaxwellReplicator replicator) throws Exception { String databaseName = ( String ) startBootstrapRow.getData("database_name"); String tableName = ( String ) startBootstrapRow.getData("table_name"); LOGGER.debug(String.format("bootstrapping request for %s.%s", databaseName, tableName)); Schema schema = replicator.getSchema(); Database database = findDatabase(schema, databaseName); Table table = findTable(tableName, database); BinlogPosition position = startBootstrapRow.getPosition(); producer.push(startBootstrapRow); producer.push(bootstrapStartRowMap(table, position)); LOGGER.info(String.format("bootstrapping started for %s.%s, binlog position is %s", databaseName, tableName, position.toString())); try ( Connection connection = getConnection() ) { setBootstrapRowToStarted(startBootstrapRow, connection); ResultSet resultSet = getAllRows(databaseName, tableName, schema, connection); int insertedRows = 0; while ( resultSet.next() ) { RowMap row = new RowMap( "insert", databaseName, tableName, System.currentTimeMillis(), table.getPKList(), position); setRowValues(row, resultSet, table); if ( LOGGER.isDebugEnabled() ) LOGGER.debug("bootstrapping row : " + row.toJSON()); producer.push(row); ++insertedRows; updateInsertedRowsColumn(insertedRows, startBootstrapRow, position, connection); } setBootstrapRowToCompleted(insertedRows, startBootstrapRow, connection); } }
Source:
public File getDownloadDirectory() { final PrefManager prefManger = new PrefManager(context, PrefManager.Pref.SD_CARD); File externalAppDir = null; if (prefManger.getBoolean(PrefManager.Key.DOWNLOAD_TO_SDCARD, false)) { externalAppDir = FileUtil.getRemovableStorageAppDir(context); } if (externalAppDir == null) { externalAppDir = FileUtil.getExternalAppDir(context); } final ProfileModel profile = getProfile(); if (externalAppDir != null && profile != null) { File videosDir = new File(externalAppDir, AppConstants.Directories.VIDEOS); File usersVidsDir = new File(videosDir, Sha1Util.SHA1(profile.username)); usersVidsDir.mkdirs(); try { File noMediaFile = new File(usersVidsDir, ".nomedia"); noMediaFile.createNewFile(); } catch (IOException ioException) { logger.error(ioException); } return usersVidsDir; } return null; }

Target:
public File getDownloadDirectory() { File downloadDir = null; if (isSDCardDownloadEnabled()) { downloadDir = FileUtil.getRemovableStorageAppDir(context); } else { downloadDir = FileUtil.getExternalAppDir(context); } final ProfileModel profile = getProfile(); if (downloadDir != null && profile != null) { File videosDir = new File(downloadDir, AppConstants.Directories.VIDEOS); File usersVidsDir = new File(videosDir, Sha1Util.SHA1(profile.username)); usersVidsDir.mkdirs(); try { File noMediaFile = new File(usersVidsDir, ".nomedia"); noMediaFile.createNewFile(); } catch (IOException ioException) { logger.error(ioException); } return usersVidsDir; } return null; }
Source:
public List<Datastream> getAll(@Context PagingContext pagingContext) { return RestliUtils.withPaging(_store.getAllDatastreams(), pagingContext).collect(Collectors.toList()); }

Target:
public List<Datastream> getAll(@Context PagingContext pagingContext) { return RestliUtils.withPaging(_store.getAllDatastreams(), pagingContext).map(_store::getDatastream) .filter(stream -> stream != null).collect(Collectors.toList()); }
Source:
private void execute() { try { HttpResponse response = client.execute(request, context); Logger.debug(LOG_TAG, "Response: " + response.getStatusLine().toString()); HttpResponseObserver observer = getHttpResponseObserver(); if (observer != null) { observer.observeHttpResponse(response); } delegate.handleHttpResponse(response); } catch (ClientProtocolException e) { delegate.handleHttpProtocolException(e); } catch (IOException e) { Logger.debug(LOG_TAG, "I/O exception returned from execute."); if (!retry) { delegate.handleHttpIOException(e); } else { retry = false; Logger.debug(LOG_TAG, "Retrying request..."); this.execute(); } } catch (Exception e) { if (!retry) { delegate.handleHttpIOException(new IOException(e)); } else { retry = false; Logger.debug(LOG_TAG, "Retrying request..."); this.execute(); } } }

Target:
private void execute() { try { HttpResponse response = client.execute(request, context); Logger.debug(LOG_TAG, "Response: " + response.getStatusLine().toString()); HttpResponseObserver observer = getHttpResponseObserver(); if (observer != null) { observer.observeHttpResponse(response); } delegate.handleHttpResponse(response); } catch (ClientProtocolException e) { delegate.handleHttpProtocolException(e); } catch (IOException e) { Logger.debug(LOG_TAG, "I/O exception returned from execute."); if (!retryOnFailedRequest) { delegate.handleHttpIOException(e); } else { retryRequest(); } } catch (Exception e) { if (!retryOnFailedRequest) { delegate.handleHttpIOException(new IOException(e)); } else { retryRequest(); } } }
Source:
public void markNotificationsAsRead() { if (this.getNumberOfUnreadNotifications() > 0) { if (this.markNotificationsAsReadThisWiki.isDisplayed()) { this.clickAndWait(this.markNotificationsAsReadThisWiki); } else { this.clickAndWait(this.markNotificationsAsRead); this.waitForElementVisibleByElement(this.markNotificationsAsReadAllWikis); this.clickAndWait(this.markNotificationsAsReadAllWikis); } this.waitForElementNotPresent(unreadNotificationReddot); } }

Target:
public void markNotificationsAsRead() { if (this.getNumberOfUnreadNotifications() > 0) { if (this.markNotificationsAsReadThisWiki.isDisplayed()) { this.scrollAndClick(this.markNotificationsAsReadThisWiki); } else { this.scrollAndClick(this.markNotificationsAsRead); this.waitForElementVisibleByElement(this.markNotificationsAsReadAllWikis); this.scrollAndClick(this.markNotificationsAsReadAllWikis); } this.waitForElementNotPresent(unreadNotificationReddot); } }
Source:
public static void main(String[] args) { try { final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); final TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.environment().getActiveDirectoryEndpoint()) .build(); Azure azure = Azure .configure() .withLogLevel(HttpLogDetailLevel.BASIC) .authenticate(credential, profile) .withDefaultSubscription(); System.out.println("Selected subscription: " + azure.subscriptionId()); runSample(azure); } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } }

Target:
public static void main(String[] args) { try { final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE, true); final TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.environment().getActiveDirectoryEndpoint()) .build(); Azure azure = Azure .configure() .withLogLevel(HttpLogDetailLevel.BASIC) .authenticate(credential, profile) .withDefaultSubscription(); System.out.println("Selected subscription: " + azure.subscriptionId()); runSample(azure); } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } }
Source:
protected void testExecute_instructorDeleteOwnRole_shouldPass() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); InstructorAttributes instructor2OfCourse1 = typicalBundle.instructors.get("instructor2OfCourse1"); loginAsInstructor(instructor2OfCourse1.googleId); String[] submissionParams = new String[] { Const.ParamsNames.INSTRUCTOR_ID, instructor2OfCourse1.googleId, Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId, }; assertTrue(logic.getInstructorsForCourse(instructor1OfCourse1.courseId).size() > 1); DeleteInstructorAction deleteInstructorAction = getAction(submissionParams); JsonResult response = getJsonResult(deleteInstructorAction); assertEquals(HttpStatus.SC_OK, response.getStatusCode()); MessageOutput msg = (MessageOutput) response.getOutput(); assertEquals("OK", msg.getMessage()); InstructorsLogic instructorsLogic = InstructorsLogic.inst(); assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructor2OfCourse1.email, instructor1OfCourse1.courseId)); assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(instructor1OfCourse1.email, instructor1OfCourse1.courseId)); }

Target:
protected void testExecute_instructorDeleteOwnRole_shouldPass() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); InstructorAttributes instructor2OfCourse1 = typicalBundle.instructors.get("instructor2OfCourse1"); loginAsInstructor(instructor2OfCourse1.googleId); String[] submissionParams = new String[] { Const.ParamsNames.INSTRUCTOR_ID, instructor2OfCourse1.googleId, Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId, }; assertTrue(logic.getInstructorsForCourse(instructor1OfCourse1.courseId).size() > 1); DeleteInstructorAction deleteInstructorAction = getAction(submissionParams); JsonResult response = getJsonResult(deleteInstructorAction); assertEquals(HttpStatus.SC_OK, response.getStatusCode()); MessageOutput msg = (MessageOutput) response.getOutput(); assertEquals("Instructor is successfully deleted.", msg.getMessage()); InstructorsLogic instructorsLogic = InstructorsLogic.inst(); assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructor2OfCourse1.email, instructor1OfCourse1.courseId)); assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(instructor1OfCourse1.email, instructor1OfCourse1.courseId)); }