auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onBindViewHolder(CategoryListItemVH holder, final int position) { if (items.get(position).header != null) { holder.headline.setText(items.get(position).header); } final CategoryListItem item = items.get(position); holder.title.setText(item.text); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onItemClickListener.onItemClick(item); } }); }

Target:
public void onBindViewHolder(CategoryListItemVH holder, final int position) { final CategoryListItem item = items.get(position); if (holder.getItemViewType() == R.layout.vh_category_list_item_with_headline) { holder.headline.setText(items.get(position).header); } holder.title.setText(item.text); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onItemClickListener.onItemClick(item); } }); }
Source:
public void Tinyint() { QNumberTest numberTest = QNumberTest.numberTest; delete(numberTest).execute(); insert(numberTest).set(numberTest.col1Boolean, true).execute(); insert(numberTest).set(numberTest.col1Number, 1).execute(); assertEquals(2, query().from(numberTest).list(numberTest.col1Boolean).size()); assertEquals(2, query().from(numberTest).list(numberTest.col1Number).size()); }

Target:
public void Tinyint() { QNumberTest numberTest = QNumberTest.numberTest; delete(numberTest).execute(); insert(numberTest).set(numberTest.col1Boolean, true).execute(); insert(numberTest).set(numberTest.col1Number, (byte)1).execute(); assertEquals(2, query().from(numberTest).list(numberTest.col1Boolean).size()); assertEquals(2, query().from(numberTest).list(numberTest.col1Number).size()); }
Source:
public void add(Block block, int position) { requireNonNull(block, "block must not be null"); checkArgument(position >= 0, "position must be >= 0"); if (block.isNull(position)) { if (!containsNullElement) { containsNullElement = true; } } int hashPosition = getHashPositionOfElement(block, position); if (blockPositionByHash.get(hashPosition) == EMPTY_SLOT) { addNewElement(hashPosition, block, position); } }

Target:
public void add(Block block, int position) { requireNonNull(block, "block must not be null"); checkArgument(position >= 0, "position must be >= 0"); if (block.isNull(position)) { containsNullElement = true; } int hashPosition = getHashPositionOfElement(block, position); if (blockPositionByHash.get(hashPosition) == EMPTY_SLOT) { addNewElement(hashPosition, block, position); } }
Source:
public void setValue(boolean newValue) { if (this.value == newValue) { return; } this.value = newValue; EdgeType edgeType = newValue ? EdgeType.RisingEdge : EdgeType.FallingEdge; boolean alertWatchers; switch (latchType) { case RisingEdge: alertWatchers = newValue; break; case FallingEdge: alertWatchers = !newValue; break; case Both: alertWatchers = true; break; default: alertWatchers = false; break; } if (alertWatchers) { setChanged(); notifyObservers(edgeType); } }

Target:
public void setValue(boolean newValue) { if (this.value == newValue) { return; } EdgeType edgeType = newValue ? EdgeType.RisingEdge : EdgeType.FallingEdge; if (latchType == edgeType || latchType == EdgeType.Both) { setChanged(); notifyObservers(edgeType); } this.value = newValue; }
Source:
public void start() throws IOException { if ( config.get( BloomFulltextConfig.bloom_enabled ) ) { String analyzer = config.get( BloomFulltextConfig.bloom_default_analyzer ); Log log = logService.getInternalLog( FulltextProviderImpl.class ); provider = new FulltextProviderImpl( db, log, availabilityGuard, scheduler, transactionIdStore.get(), fileSystem, storeDir, analyzer ); provider.openIndex( BLOOM_NODES, NODES ); provider.openIndex( BLOOM_RELATIONSHIPS, RELATIONSHIPS ); provider.registerTransactionEventHandler(); provider.registerFileListing(fileListing); procedures.registerComponent( FulltextProvider.class, context -> provider, true ); } else { procedures.registerComponent( FulltextProvider.class, context -> FulltextProvider.NULL_PROVIDER, true ); } }

Target:
public void start() throws IOException { if ( config.get( BloomFulltextConfig.bloom_enabled ) ) { String analyzer = config.get( BloomFulltextConfig.bloom_default_analyzer ); Log log = logService.getInternalLog( FulltextProviderImpl.class ); provider = new FulltextProviderImpl( db, log, availabilityGuard, scheduler, transactionIdStore.get(), fileSystem, storeDir, analyzer ); provider.openIndex( BLOOM_NODES, NODES ); provider.openIndex( BLOOM_RELATIONSHIPS, RELATIONSHIPS ); provider.registerTransactionEventHandler(); provider.registerFileListing( fileListing.get() ); procedures.registerComponent( FulltextProvider.class, context -> provider, true ); } else { procedures.registerComponent( FulltextProvider.class, context -> FulltextProvider.NULL_PROVIDER, true ); } }
Source:
public String toString() { return toStringHelper(this) .add("table", table.toString()) .add("offset_start_ts", offsetStartTs) .add("offset_end_ts", offsetEndTs).toString(); }

Target:
public String toString() { return toStringHelper(this) .add("table", table.toString()) .add("startOffsetTimestamp", startOffsetTimestamp) .add("endOffsetTimestamp", endOffsetTimestamp).toString(); }
Source:
public HttpLogOptions setAllowedHeaderNames(final Set<String> allowedHeaderNames) { this.allowedHeaderNames = allowedHeaderNames == null ? this.allowedHeaderNames : allowedHeaderNames; return this; }

Target:
public HttpLogOptions setAllowedHeaderNames(final Set<String> allowedHeaderNames) { this.allowedHeaderNames = allowedHeaderNames == null ? new HashSet<>() : allowedHeaderNames; return this; }
Source:
public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException { if (!presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED) && artifact.getAttributeCount(ContentUrl) > 0) { if (presentationType.matches(WEB_PREVIEW, PresentationType.PREVIEW)) { return SPECIALIZED_MATCH; } else if (presentationType.equals(DEFAULT_OPEN)) { return PRESENTATION_TYPE; } } return NO_MATCH; }

Target:
public int getApplicabilityRating(PresentationType presentationType, Artifact artifact, Object... objects) throws OseeCoreException { if (!presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED) && artifact.getAttributeCount(ContentUrl) > 0) { if (presentationType.matches(WEB_PREVIEW)) { return SPECIALIZED_MATCH; } else if (presentationType.equals(PresentationType.PREVIEW)) { return PRESENTATION_SUBTYPE_MATCH; } else if (presentationType.equals(DEFAULT_OPEN)) { return PRESENTATION_TYPE; } } return NO_MATCH; }
Source:
public static String getEncryptedData(String message) { String[] lines = splitIntoLines(message, false); String result = ""; for (String line : lines) { result += line; } return result; }

Target:
String getEncryptedData(String message) { String[] lines = splitIntoLines(message, false); StringBuilder result = new StringBuilder(); for (String line : lines) { result.append(line); } return result.toString(); }
Source:
public void afterTextChanged(Editable s) { if(searchbox.getText() == s) { filterString = s.toString(); if(adapter != null) { adapter.applyFilter(filterString); noSearchResults.setText(Localization.get("select.search.empty", new String[] {searchbox.getText().toString()})); noSearchResults.setVisibility(adapter.getCount() == 0 ? View.VISIBLE : View.GONE); } } }

Target:
public void afterTextChanged(Editable s) { if(searchbox.getText() == s) { filterString = s.toString(); if(adapter != null) { adapter.applyFilter(filterString); String query = searchbox.getText().toString(); if (!"".equals(query)) { searchResultStatus.setText(Localization.get("select.search.status", new String[] { ""+adapter.getCount(), ""+adapter.getFullCount(), query })); searchResultStatus.setVisibility(View.VISIBLE); } else { searchResultStatus.setVisibility(View.GONE); } } } }
Source:
private long getArtifactTimeStamp(IToolChain toolChain) { IBuilder builder = toolChain.getBuilder(); IConfiguration configuration = toolChain.getParent(); URI buildLocationURI = ManagedBuildManager.getBuildLocationURI(configuration, builder); if (buildLocationURI != null) { if (!buildLocationURI.toString().endsWith("/")) { buildLocationURI = URI.create(buildLocationURI.toString() + "/"); } String artifactName = configuration.getArtifactName(); String artifactExt = configuration.getArtifactExtension(); String artifactPref = configuration.getOutputPrefix(artifactExt); if (artifactName.length() > 0) { if (artifactExt.length() > 0) artifactName += "." + artifactExt; if (artifactPref.length() > 0) artifactName = artifactPref + artifactName; try { artifactName = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactName, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, configuration); } catch (BuildMacroException e) { } URI buildArtifactURI = URIUtil.append(buildLocationURI, artifactName); try { IFileStore artifact = EFS.getStore(buildArtifactURI); org.eclipse.core.filesystem.IFileInfo info = (artifact == null) ? null : artifact.fetchInfo(); if ((info != null) && info.exists()) { return info.getLastModified(); } } catch (CoreException e) { } } } return 0; }

Target:
private long getArtifactTimeStamp(IToolChain toolChain) { IBuilder builder = toolChain.getBuilder(); IConfiguration configuration = toolChain.getParent(); URI buildLocationURI = ManagedBuildManager.getBuildLocationURI(configuration, builder); if (buildLocationURI != null) { if (!buildLocationURI.toString().endsWith("/")) { buildLocationURI = URI.create(buildLocationURI.toString() + "/"); } String artifactName = configuration.getArtifactName(); String artifactExt = configuration.getArtifactExtension(); String artifactPref = configuration.getOutputPrefix(artifactExt); if (artifactName.length() > 0) { if (artifactExt.length() > 0) artifactName += "." + artifactExt; if (artifactPref.length() > 0) artifactName = artifactPref + artifactName; try { artifactName = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactName, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, configuration); } catch (BuildMacroException e) { } URI buildArtifactURI = EFSExtensionManager.getDefault().append(buildLocationURI, artifactName); try { IFileStore artifact = EFS.getStore(buildArtifactURI); org.eclipse.core.filesystem.IFileInfo info = (artifact == null) ? null : artifact.fetchInfo(); if ((info != null) && info.exists()) { return info.getLastModified(); } } catch (CoreException e) { } } } return 0; }
Source:
public void addWorkMemberTest() { unit.addMember(workChildObj); ArgumentCaptor<ContentObject> captor = ArgumentCaptor.forClass(ContentObject.class); verify(repository).addMember(eq(unit), captor.capture()); ContentObject child = captor.getValue(); assertFalse("Should not be able to add Work to AdminUnit", child instanceof WorkObject); }

Target:
public void addWorkMemberTest() { unit.addMember(workChildObj); }
Source:
public void should_distributeDataAmongMultipleServers_givenMultipleClients_AddingDifferentDataToSameSetConcurrently() throws InterruptedException { String key = "key"; List<String> members1 = makeMemberList(SET_SIZE, "member1-"); List<String> members2 = makeMemberList(SET_SIZE, "member2-"); Runnable addSetsWithClient1 = makeSADDRunnable(key, members1, jedis1); Runnable addSetsWithClient2 = makeSADDRunnable(key, members2, jedis2); runConcurrentThreads(addSetsWithClient1, addSetsWithClient2); Set<String> results = jedis3.smembers(key); members1.addAll(members2); assertThat(results.toArray()).containsExactlyInAnyOrder(members1.toArray()); }

Target:
public void should_distributeDataAmongMultipleServers_givenMultipleClients_AddingDifferentDataToSameSetConcurrently() throws InterruptedException { String key = "key"; List<String> members1 = makeMemberList(SET_SIZE, "member1-"); List<String> members2 = makeMemberList(SET_SIZE, "member2-"); List<String> allMembers = new ArrayList<>(); allMembers.addAll(members1); allMembers.addAll(members2); CountDownLatch startThreads = new CountDownLatch(1); Runnable addSetsWithClient1 = makeSADDRunnable(key, members1, jedis1, startThreads); Runnable addSetsWithClient2 = makeSADDRunnable(key, members2, jedis2, startThreads); runConcurrentThreads(startThreads, addSetsWithClient1, addSetsWithClient2); Set<String> results = jedis3.smembers(key); assertThat(results.toArray()).containsExactlyInAnyOrder(allMembers.toArray()); }
Source:
public boolean isBetween(Time start, Time end) { return isAfter(start) && isBefore(end) || equals(start) || equals (end); }

Target:
public boolean isBetween(Time start, Time end) { return isAfterOrEqual(start) && isBeforeOrEqual(end); }
Source:
public void while_statement() { Lock lock = new ReentrantLock(); while (foo) { lock.tryLock(); } lock.unlock(); while (Random.nextBoolean()) { lock.tryLock(); lock = new ReentrantLock(); } lock.unlock(); }

Target:
public void while_statement() { Lock lock = new ReentrantLock(); while (foo) { lock.tryLock(); } lock.unlock(); while (foo) { lock.tryLock(); lock = new ReentrantLock(); } lock.unlock(); }
Source:
public BulkFileHandleDownloadRecordConfigurationProvider (CountingSemaphore semaphore, AmazonSQSClient awsSQSClient, AmazonSNSClient awsSNClient, BulkFileHandleDownloadRecordWorker worker, BulkFileHandleDownloadRecordTopicBucketInfo config, RunDuringNormalStateGate gate) { MessageDrivenWorkerStackConfiguration mdwsc = new MessageDrivenWorkerStackConfiguration(); mdwsc.setGate(gate); mdwsc.setQueueName(config.getQueueName()); mdwsc.setTopicNamesToSubscribe(Arrays.asList(config.getTopicName())); mdwsc.setRunner(worker); mdwsc.setSemaphoreLockAndMessageVisibilityTimeoutSec(60); mdwsc.setSemaphoreLockKey(SemaphoreKey.BULK_FILE_HANDLE_DOWNLOAD_RECORD_WORKER.name()); mdwsc.setSemaphoreMaxLockCount(1); Runnable runner = new MessageDrivenWorkerStack(semaphore, awsSQSClient, awsSNClient, mdwsc); this.config = new WorkerStackConfiguration(); this.config.setRunner(runner); this.config.setStartDelayMs(711); this.config.setPeriodMS(10*1000); this.config.setWorkerName(BulkFileDownloadRecordWorker.class.getName()); }

Target:
public BulkFileHandleDownloadRecordConfigurationProvider (CountingSemaphore semaphore, AmazonSQSClient awsSQSClient, AmazonSNSClient awsSNClient, BulkFileHandleDownloadRecordWorker worker, BulkFileHandleDownloadRecordTopicBucketInfo config, RunDuringNormalStateGate gate) { MessageDrivenWorkerStackConfiguration mdwsc = new MessageDrivenWorkerStackConfiguration(); mdwsc.setGate(gate); mdwsc.setQueueName(config.getQueueName()); mdwsc.setTopicNamesToSubscribe(Arrays.asList(config.getTopicName())); mdwsc.setRunner(worker); mdwsc.setSemaphoreLockAndMessageVisibilityTimeoutSec(60); mdwsc.setSemaphoreLockKey(SemaphoreKey.BULK_FILE_HANDLE_DOWNLOAD_RECORD_WORKER.name()); mdwsc.setSemaphoreMaxLockCount(1); Runnable runner = new MessageDrivenWorkerStack(semaphore, awsSQSClient, awsSNClient, mdwsc); this.config = new WorkerStackConfiguration(); this.config.setRunner(runner); this.config.setStartDelayMs(711); this.config.setPeriodMS(10*1000); this.config.setWorkerName(BulkFileHandleDownloadRecordWorker.class.getName()); }
Source:
public void authenticate(SignInMode requestedMode, final String token) { OpenIdUtil.SVC.discover(ssoUrl, requestedMode, false, token, new GerritCallback<DiscoveryResult>() { public void onSuccess(final DiscoveryResult result) { onDiscovery(result); } @Override public void onFailure(final Throwable caught) { super.onFailure(caught); } }); }

Target:
public void authenticate(SignInMode requestedMode, final String token) { OpenIdUtil.SVC.discover(ssoUrl, requestedMode, false, token, new GerritCallback<DiscoveryResult>() { public void onSuccess(final DiscoveryResult result) { onDiscovery(result); } }); }
Source:
public PageTitle(final String namespace, final String text, final Site site) { this.namespace = namespace; this.text = text; this.fragment = null; this.site = site; }

Target:
public PageTitle(final String namespace, final String text, final Site site) { this(namespace, text, null, site); }
Source:
public static void main(String[] args) { int exitStatus = 1; try { Map<String, Object> argMap = parseArgs(args); setupLogger(argMap); if(argMap.containsKey("version")) { throw new ExitException( String.format("%1$s %2$s", Config.EXT_TESTTOOL_PACKAGE_DISPLAY_NAME, Config.EXT_TESTTOOL_PACKAGE_VERSION), 0 ); } List<String> others = (List<String>) argMap.get("__other__"); Map<String, ModuleService> moduleServices = loadModules(ModuleService.class); if (argMap.containsKey(ARG_HELP)) { List<String> modules = new ArrayList<>(moduleServices.keySet()); Collections.sort(modules); throw new ExitException("Modules: " + StringUtils.join(modules, ", "), 0); } if (others.isEmpty()) { throw new ExitException("Please provide module.", 0); } String module = others.remove(0); ModuleService moduleService = moduleServices.get(module); if (moduleService == null) { throw new IllegalArgumentException( String.format("No such '%1$s' module exists.", module) ); } moduleService.parseArguments(others); if (moduleService.doHelp()) { throw new ExitException(module + " help", 0); } loadExtensions(moduleService, argMap); moduleService.run(); } catch(ExitException e) { System.out.println(e.getMessage()); exitStatus = e.getExitCode(); } catch (Throwable t) { String message = t.getMessage() != null ? t.getMessage() : t.getClass().getName(); logger.error(message); logger.debug(message, t); t.printStackTrace(); } System.exit(exitStatus); }

Target:
public static void main(String[] args) { int exitStatus = 1; try { Map<String, Object> argMap = parseArgs(args); setupLogger(argMap); if(argMap.containsKey("version")) { throw new ExitException( String.format("%1$s %2$s", Config.EXT_TESTTOOL_PACKAGE_DISPLAY_NAME, Config.EXT_TESTTOOL_PACKAGE_VERSION), 0 ); } List<String> others = (List<String>) argMap.get("__other__"); Map<String, ModuleService> moduleServices = loadModules(ModuleService.class); if (argMap.containsKey(ARG_HELP)) { List<String> modules = new ArrayList<>(moduleServices.keySet()); Collections.sort(modules); throw new ExitException("Modules: " + StringUtils.join(modules, ", "), 0); } if (others.size() < 2) { throw new ExitException("Please provide module and action.", 0); } String module = others.remove(0); ModuleService moduleService = moduleServices.get(module); if (moduleService == null) { throw new IllegalArgumentException( String.format("No such '%1$s' module exists.", module) ); } moduleService.parseArguments(others.remove(0), others); loadExtensions(moduleService, argMap); moduleService.run(); } catch(ExitException e) { System.out.println(e.getMessage()); exitStatus = e.getExitCode(); } catch (Throwable t) { String message = t.getMessage() != null ? t.getMessage() : t.getClass().getName(); logger.error(message); logger.debug(message, t); } System.exit(exitStatus); }
Source:
String[] getFontNames() { FontData[] fontNames = display.getFontList(null, true); String[] names = new String[fontNames.length]; int count = 0; mainfor: for (FontData fontName2 : fontNames) { String fontName = fontName2.getName(); if (fontName.startsWith("@")) continue; for (int j = 0; j < count; j++) { if (names[j].equals(fontName)) continue mainfor; } names[count++] = fontName; } if (count < names.length) { String[] newNames = new String[count]; System.arraycopy(names, 0, newNames, 0, count); names = newNames; } return names; }

Target:
String[] getFontNames() { FontData[] fontNames = display.getFontList(null, true); String[] names = new String[fontNames.length]; int count = 0; mainfor: for (FontData fontdata : fontNames) { String fontName = fontdata.getName(); if (fontName.startsWith("@")) continue; for (int j = 0; j < count; j++) { if (names[j].equals(fontName)) continue mainfor; } names[count++] = fontName; } if (count < names.length) { String[] newNames = new String[count]; System.arraycopy(names, 0, newNames, 0, count); names = newNames; } return names; }
Source:
public void addAlternativeSequenceName(final String name) { validateAltRegExp(name); final Set<String> altSequences = new HashSet<>(getAlternativeSequenceNames()); if (!mSequenceName.equals(name)) { altSequences.add(name); } encodeAltSequences(altSequences); }

Target:
public void addAlternativeSequenceName(final String name) { final Set<String> altSequences = new HashSet<>(getAlternativeSequenceNames()); if (!mSequenceName.equals(name)) { altSequences.add(name); } encodeAltSequences(altSequences); }
Source:
protected @Nullable IAnalysisModule findSegmentProviderAnalysis(@NonNull ITmfTrace trace) { return fPatternAnalysisId != null ? TmfTraceUtils.getAnalysisModuleOfClass(trace, XmlPatternAnalysis.class, fPatternAnalysisId) : null; }

Target:
protected @Nullable ISegmentStoreProvider findSegmentProviderAnalysis(@NonNull ITmfTrace trace) { return fPatternAnalysisId != null ? TmfTraceUtils.getAnalysisModuleOfClass(trace, XmlPatternAnalysis.class, fPatternAnalysisId) : null; }
Source:
public String getCardName(@NonNull Resources resources) { return "Kartu Multi Trip"; }

Target:
public String getCardName(@NonNull Resources resources) { return resources.getString(R.string.kmt_longname); }
Source:
public synchronized byte[] getEventKeyBytesGAE(EventKey eventKey) { long timestamp = 0; if (eventKey.getKey() .getFieldDescriptor().getFieldList() .contains(DimensionsDescriptor.DIMENSION_TIME)) { timestamp = eventKey.getKey().getFieldLong(DimensionsDescriptor.DIMENSION_TIME); } try { byte[] timeBytes = Longs.toByteArray(timestamp); byte[] schemaIDBytes = Ints.toByteArray(eventKey.getSchemaID()); byte[] dimensionDescriptorIDBytes = Ints.toByteArray(eventKey.getDimensionDescriptorID()); byte[] aggregatorIDBytes = Ints.toByteArray(eventKey.getAggregatorID()); byte[] gpoBytes = GPOUtils.serialize(eventKey.getKey(), tempBal); bal.add(timeBytes); bal.add(schemaIDBytes); bal.add(dimensionDescriptorIDBytes); bal.add(aggregatorIDBytes); bal.add(gpoBytes); byte[] serializedBytes = bal.toByteArray(); bal.clear(); return serializedBytes; } catch(Exception e) { e.printStackTrace(); return null; } }

Target:
public synchronized byte[] getEventKeyBytesGAE(EventKey eventKey) { long timestamp = 0; if (eventKey.getKey() .getFieldDescriptor().getFieldList() .contains(DimensionsDescriptor.DIMENSION_TIME)) { timestamp = eventKey.getKey().getFieldLong(DimensionsDescriptor.DIMENSION_TIME); } byte[] timeBytes = Longs.toByteArray(timestamp); byte[] schemaIDBytes = Ints.toByteArray(eventKey.getSchemaID()); byte[] dimensionDescriptorIDBytes = Ints.toByteArray(eventKey.getDimensionDescriptorID()); byte[] aggregatorIDBytes = Ints.toByteArray(eventKey.getAggregatorID()); byte[] gpoBytes = GPOUtils.serialize(eventKey.getKey(), tempBal); bal.add(timeBytes); bal.add(schemaIDBytes); bal.add(dimensionDescriptorIDBytes); bal.add(aggregatorIDBytes); bal.add(gpoBytes); byte[] serializedBytes = bal.toByteArray(); bal.clear(); return serializedBytes; }
Source:
private void emitAndPersistEvent(PaymentDetailsEntered event) { try { eventQueue.emitEvent(event); persistEventEmitRecord(event); } catch (QueueException e) { logger.error("Failed to emit event due to {}", event, e); } }

Target:
private void emitAndPersistEvent(PaymentDetailsEntered event) { try { eventQueue.emitEvent(event); persistEventEmittedRecord(event); } catch (QueueException e) { logger.error("Failed to emit event due to [chargeId={}]", event, e.getMessage(), event.getResourceExternalId()); } }
Source:
protected boolean isDescriptionSheetExists(final Workbook wb) throws WorkbookParserException { final Sheet sheet1 = wb.getSheetAt(WorkbookParser.DESCRIPTION_SHEET); if (sheet1 == null || sheet1.getSheetName() == null || !"Description".equals(sheet1.getSheetName())) { return false; } return true; }

Target:
protected boolean isDescriptionSheetExists(final Workbook wb) throws WorkbookParserException { final Sheet sheet1 = wb.getSheetAt(WorkbookParser.DESCRIPTION_SHEET); if (sheet1 == null || sheet1.getSheetName() == null || !WorkbookParser.DESCRIPTION_SHEET_NAME.equals(sheet1.getSheetName())) { return false; } return true; }
Source:
public void keyPressed(KeyEvent e) { System.out.println("KEY: " + e.getKeyChar() + ", " + selectedItem); if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_W) { selectedItem--; if (selectedItem < 0) { selectedItem = buttons.size() - 1; } } else if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_S) { selectedItem++; if (selectedItem > buttons.size() - 1) { selectedItem = 0; } } else if (e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_A) { ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; float value = slider.value - 0.1f; if (value < 0) { value = 0; } slider.setValue(value); slider.postClick(); } } else if (e.getKeyCode() == KeyEvent.VK_RIGHT || e.getKeyCode() == KeyEvent.VK_D) { ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; float value = slider.value + 0.1f; if (value > 1) { value = 1; } slider.setValue(value); slider.postClick(); } } else if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_E) { e.consume(); ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; if (slider.value == 1) { slider.setValue(0); } else { slider.setValue(1); } } button.postClick(); } else if (e.getKeyCode() == KeyEvent.VK_F11) { MojamComponent.toggleFullscreen(); } }

Target:
public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_W) { selectedItem--; if (selectedItem < 0) { selectedItem = buttons.size() - 1; } } else if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_S) { selectedItem++; if (selectedItem > buttons.size() - 1) { selectedItem = 0; } } else if (e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_A) { ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; float value = slider.value - 0.1f; if (value < 0) { value = 0; } slider.setValue(value); slider.postClick(); } } else if (e.getKeyCode() == KeyEvent.VK_RIGHT || e.getKeyCode() == KeyEvent.VK_D) { ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; float value = slider.value + 0.1f; if (value > 1) { value = 1; } slider.setValue(value); slider.postClick(); } } else if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_E) { e.consume(); ClickableComponent button = buttons.get(selectedItem); if (button instanceof Slider) { Slider slider = (Slider) button; if (slider.value == 1) { slider.setValue(0); } else { slider.setValue(1); } } button.postClick(); } else if (e.getKeyCode() == KeyEvent.VK_F11) { MojamComponent.toggleFullscreen(); } }
Source:
private static HashMap<String, String> getPluginConfiguration() { final short kEntries = 2; HashMap<String, String> conf = new HashMap<>((int) Math.ceil(kEntries / 0.75)); conf.put("configDir", ConfigCore.getKitodoConfigDirectory()); conf.put("tempDir", ConfigCore.getParameter(Parameters.PLUGIN_TEMP_DIR)); return conf; }

Target:
private static HashMap<String, String> getPluginConfiguration() { final short entries = 2; HashMap<String, String> conf = new HashMap<>((int) Math.ceil(entries / 0.75)); conf.put("configDir", ConfigCore.getKitodoConfigDirectory()); conf.put("tempDir", ConfigCore.getParameter(Parameters.PLUGIN_TEMP_DIR)); return conf; }
Source:
public static Set<SkinPart> fromFlags(int flags) { Set<SkinPart> parts = Sponge.getRegistry().getAllOf(SkinPart.class).stream() .filter(part -> part instanceof SpongeSkinPart) .filter(part -> (flags & (1 << ((SpongeSkinPart) part).ordinal())) != 0) .collect(Collectors.toSet()); return ImmutableSet.copyOf(parts); }

Target:
public static Set<SkinPart> fromFlags(int flags) { return Sponge.getRegistry().getAllOf(SkinPart.class).stream() .map(part -> (SpongeSkinPart) part) .filter(part -> part.test(flags)) .collect(GuavaCollectors.toImmutableSet()); }
Source:
WorkerThread(ForkJoinPool pool, ClassLoader contextClassLoader) { super(pool); super.setContextClassLoader(contextClassLoader); }

Target:
WorkerThread(ForkJoinPool pool, ClassLoader contextClassLoader) { super(pool); setContextClassLoader(contextClassLoader); }
Source:
private static boolean nullSafeDateEquals(final Date obj1, final Date obj2) { if (obj1 == null || obj2 == null) { return true; } else { Calendar cal1 = Calendar.getInstance(); cal1.setTime(obj1); Calendar cal2 = Calendar.getInstance(); cal2.setTime(obj2); if (cal1.get(Calendar.MONTH) == cal1.get(Calendar.MONTH) && cal1.get(Calendar.YEAR) == cal1.get(Calendar.YEAR) && cal1.get(Calendar.DATE) == cal1.get(Calendar.DATE)) { return true; } else { return false; } } }

Target:
private static boolean nullSafeDateEquals(final Date obj1, final Date obj2) { if (obj1 == null || obj2 == null) { return true; } else { Calendar cal1 = Calendar.getInstance(); cal1.setTime(obj1); Calendar cal2 = Calendar.getInstance(); cal2.setTime(obj2); if (cal1.get(Calendar.MONTH) == cal2.get(Calendar.MONTH) && cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && cal1.get(Calendar.DATE) == cal2.get(Calendar.DATE)) { return true; } else { return false; } } }
Source:
public static TreeWalk forPath(final ObjectReader reader, final String path, final AnyObjectId... trees) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { TreeWalk tw = new TreeWalk(reader); PathFilter f = PathFilter.create(path); tw.setFilter(f); tw.reset(trees); tw.setRecursive(false); for (;;) { if (!tw.next()) { return null; } else if (f.isDone(tw)) { return tw; } else if (tw.isSubtree()) { tw.enterSubtree(); } else { return null; } } }

Target:
public static TreeWalk forPath(final ObjectReader reader, final String path, final AnyObjectId... trees) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { TreeWalk tw = new TreeWalk(reader); PathFilter f = PathFilter.create(path); tw.setFilter(f); tw.reset(trees); tw.setRecursive(false); while (tw.next()) { if (f.isDone(tw)) { return tw; } else if (tw.isSubtree()) { tw.enterSubtree(); } } return null; }
Source:
public void testMessageCountNeverSubscribed() throws Exception { String topicName = "myTopic"; String groupId = "groupId"; AmqpConsumerAdapter adapter = createAdapterWithNonDurableConf(topicName, groupId, false); Optional<Long> result = adapter.messageCount(); verify(mockChannel, never()).messageCount(anyString()); assertEquals(result, Optional.empty()); }

Target:
public void testMessageCountNeverSubscribed() throws Exception { String topicName = "myTopic"; String groupId = "groupId"; AmqpConsumerAdapter adapter = createAdapterWithNonDurableConf(topicName, groupId, false); Optional<Long> result = adapter.messageCount(); verify(mockChannel, never()).messageCount(anyString()); assertEquals(Optional.empty(), result); }
Source:
public boolean validate() { if (oldGenerator != null && getJsonTextArea().getText().equals(oldGenerator.getPayloadGenerator().getJson()) && numberOfPayloadsSpinner.getValue() == oldGenerator.getPayloadGenerator().getNumberOfPayloads()) { return true; } if (getJsonTextArea().getText().isEmpty()) return false; if (numberOfPayloadsSpinner.getValue() <= 0) return false; oldGenerator = null; return true; }

Target:
public boolean validate() { if (oldGenerator != null && getJsonTextArea().getText().equals(oldGenerator.getPayloadGenerator().getJson()) && numberOfPayloadsSpinner.getValue() == oldGenerator.getPayloadGenerator().getNumberOfPayloads()) { return true; } if (getJsonTextArea().getDocument().getLength() == 0) { return false; } if (isInvalidJson(getJsonTextArea().getText())) { return false; } oldGenerator = null; return true; }
Source:
private String getLocaleFromCookie() { Cookie[] cookies = request.getCookies(); return cookies == null ? null : FluentIterable.of(cookies) .firstMatch(cookie -> LOCALE_COOKIE_NAME.equals(cookie.getName()) && SUPPORTED_LOCALES.contains(cookie.getValue())) .transform(cookie -> cookie.getValue().toLowerCase()) .orNull(); }

Target:
private String getLocaleFromCookie() { Cookie[] cookies = request.getCookies(); return cookies == null ? null : FluentIterable.of(cookies) .firstMatch(new Predicate<Cookie>() { @Override public boolean apply(Cookie cookie) { return LOCALE_COOKIE_NAME.equals(cookie.getName()) && SUPPORTED_LOCALES.contains(cookie.getValue()); } }).transform(new Function<Cookie, String>() { @Override public String apply(Cookie cookie) { return cookie.getValue().toLowerCase(); } }).orNull(); }
Source:
public void typeTextToSearchFactoryField(String expectedText) { seleniumWebDriverHelper.setValue(searchWorkspaceField, expectedText); WaitUtils.sleepQuietly(1); }

Target:
public void typeTextToSearchFactoryField(String expectedText) { seleniumWebDriverHelper.setValue(searchWorkspaceField, expectedText); }
Source:
public FileSystemJarCache(@Nonnull File rootDir, boolean touch) { this.rootDir = rootDir; this.touch = touch; if (rootDir==null) throw new IllegalArgumentException("Root directory is null"); try { Util.mkdirs(rootDir); } catch (IOException ex) { throw new IllegalArgumentException("Root directory not writable: " + rootDir); } }

Target:
public FileSystemJarCache(@Nonnull File rootDir, boolean touch) { this.rootDir = rootDir; this.touch = touch; if (rootDir==null) throw new IllegalArgumentException("Root directory is null"); try { Util.mkdirs(rootDir); } catch (IOException ex) { throw new IllegalArgumentException("Root directory not writable: " + rootDir, ex); } }
Source:
public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { if (response != null && request != null) { boolean isConnAborted = false; if (response.isError()) { Throwable ex = (Throwable)request.getAttribute(RequestDispatcher.ERROR_EXCEPTION); if (ex instanceof ClientAbortException) { isConnAborted = true; buf.append('X'); } } if (!isConnAborted) { if (org.apache.coyote.http11.Constants.KEEPALIVE.equals( request.getHeader(org.apache.coyote.http11.Constants.CONNECTION))) { buf.append('+'); } else { buf.append('-'); } } } else { buf.append('?'); } }

Target:
public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { if (response != null && request != null) { boolean statusFound = false; AtomicBoolean isIoAllowed = new AtomicBoolean(false); request.getCoyoteRequest().action(ActionCode.IS_IO_ALLOWED, isIoAllowed); if (!isIoAllowed.get()) { buf.append('X'); statusFound = true; } else { if (response.isError()) { Throwable ex = (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION); if (ex instanceof ClientAbortException) { buf.append('X'); statusFound = true; } } } if (!statusFound) { String connStatus = response.getHeader(org.apache.coyote.http11.Constants.CONNECTION); if (org.apache.coyote.http11.Constants.CLOSE.equals(connStatus)) { buf.append('-'); } else { buf.append('+'); } } } else { buf.append('?'); } }
Source:
public void onResponse(final ImageLoader.ImageContainer response, boolean isImmediate) { if (!mUrl.equals(mRequestedURL)) { return; } if (isImmediate && mIsInLayoutPass) { post(new Runnable() { @Override public void run() { onResponse(response, false); } }); return; } handleResponse(response, isImmediate, mImageLoadListener); }

Target:
public void onResponse(final ImageLoader.ImageContainer response, boolean isImmediate) { if (mUrl == null || !mUrl.equals(mRequestedURL)) { AppLog.w(AppLog.T.UTILS, "WPNetworkImageView > request no longer valid: " + mRequestedURL); return; } if (isImmediate && mIsInLayoutPass) { post(new Runnable() { @Override public void run() { onResponse(response, false); } }); return; } handleResponse(response, isImmediate, mImageLoadListener); }
Source:
Family smartResolutor(long studyUid, String entry, String user) throws CatalogException { Query query = new Query() .append(FamilyDBAdaptor.QueryParams.STUDY_UID.key(), studyUid); if (UUIDUtils.isOpenCGAUUID(entry)) { query.put(FamilyDBAdaptor.QueryParams.UUID.key(), entry); } else { try { long entryLong = Long.parseLong(entry); query.put(FamilyDBAdaptor.QueryParams.UID.key(), entryLong); } catch (NumberFormatException e) { query.put(FamilyDBAdaptor.QueryParams.ID.key(), entry); } } QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, Arrays.asList( FamilyDBAdaptor.QueryParams.UUID.key(), FamilyDBAdaptor.QueryParams.UID.key(), FamilyDBAdaptor.QueryParams.STUDY_UID.key(), FamilyDBAdaptor.QueryParams.ID.key(), FamilyDBAdaptor.QueryParams.RELEASE.key(), FamilyDBAdaptor.QueryParams.VERSION.key(), FamilyDBAdaptor.QueryParams.STATUS.key())); QueryResult<Family> familyQueryResult = familyDBAdaptor.get(query, options, user); if (familyQueryResult.getNumResults() == 0) { familyQueryResult = familyDBAdaptor.get(query, options); if (familyQueryResult.getNumResults() == 0) { throw new CatalogException("Family " + entry + " not found"); } else { throw new CatalogAuthorizationException("Permission denied. " + user + " is not allowed to see the family " + entry); } } else if (familyQueryResult.getNumResults() > 1) { throw new CatalogException("More than one family found based on " + entry); } else { return familyQueryResult.first(); } }

Target:
Family smartResolutor(long studyUid, String entry, String user) throws CatalogException { Query query = new Query() .append(FamilyDBAdaptor.QueryParams.STUDY_UID.key(), studyUid); if (UUIDUtils.isOpenCGAUUID(entry)) { query.put(FamilyDBAdaptor.QueryParams.UUID.key(), entry); } else { query.put(FamilyDBAdaptor.QueryParams.ID.key(), entry); } QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, Arrays.asList( FamilyDBAdaptor.QueryParams.UUID.key(), FamilyDBAdaptor.QueryParams.UID.key(), FamilyDBAdaptor.QueryParams.STUDY_UID.key(), FamilyDBAdaptor.QueryParams.ID.key(), FamilyDBAdaptor.QueryParams.RELEASE.key(), FamilyDBAdaptor.QueryParams.VERSION.key(), FamilyDBAdaptor.QueryParams.STATUS.key())); QueryResult<Family> familyQueryResult = familyDBAdaptor.get(query, options, user); if (familyQueryResult.getNumResults() == 0) { familyQueryResult = familyDBAdaptor.get(query, options); if (familyQueryResult.getNumResults() == 0) { throw new CatalogException("Family " + entry + " not found"); } else { throw new CatalogAuthorizationException("Permission denied. " + user + " is not allowed to see the family " + entry); } } else if (familyQueryResult.getNumResults() > 1) { throw new CatalogException("More than one family found based on " + entry); } else { return familyQueryResult.first(); } }
Source:
public void testTokenDefault() throws OpenTokException, UnsupportedEncodingException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { int apiKey = 123456; String apiSecret = "1234567890abcdef1234567890abcdef1234567890"; OpenTok opentok = new OpenTok.Builder(apiKey, apiSecret).build(); String sessionId = "1_MX4xMjM0NTZ-flNhdCBNYXIgMTUgMTQ6NDI6MjMgUERUIDIwMTR-MC40OTAxMzAyNX4"; String token = opentok.generateToken(sessionId); assertNotNull(token); assertTrue(Helpers.verifyTokenSignature(token, apiSecret)); Map<String, String> tokenData = Helpers.decodeToken(token); assertEquals(Integer.toString(apiKey), tokenData.get("partner_id")); assertNotNull(tokenData.get("create_time")); assertNotNull(tokenData.get("nonce")); }

Target:
public void testTokenDefault() throws OpenTokException, UnsupportedEncodingException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { int apiKey = 123456; String apiSecret = "1234567890abcdef1234567890abcdef1234567890"; OpenTok opentok = new OpenTok(apiKey, apiSecret); String sessionId = "1_MX4xMjM0NTZ-flNhdCBNYXIgMTUgMTQ6NDI6MjMgUERUIDIwMTR-MC40OTAxMzAyNX4"; String token = opentok.generateToken(sessionId); assertNotNull(token); assertTrue(Helpers.verifyTokenSignature(token, apiSecret)); Map<String, String> tokenData = Helpers.decodeToken(token); assertEquals(Integer.toString(apiKey), tokenData.get("partner_id")); assertNotNull(tokenData.get("create_time")); assertNotNull(tokenData.get("nonce")); }
Source:
public ZooKeeperServer(FileTxnSnapLog txnLogFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, ZKDatabase zkDb) { serverStats = new ServerStats(this); this.txnLogFactory = txnLogFactory; this.txnLogFactory.setServerStats(this.serverStats); this.zkDb = zkDb; this.tickTime = tickTime; setMinSessionTimeout(minSessionTimeout); setMaxSessionTimeout(maxSessionTimeout); listener = new ZooKeeperServerListenerImpl(this); readResponseCache = new ResponseCache(); connThrottle = new BlueThrottle(); connThrottle.setMaxTokens( Integer.getInteger("zookeeper.connection_throttle_tokens", 0) ); connThrottle.setFillTime( Integer.getInteger("zookeeper.connection_throttle_fill_time", 1) ); connThrottle.setFillCount( Integer.getInteger("zookeeper.connection_throttle_fill_count", 1) ); connThrottle.setFreezeTime( Integer.getInteger("zookeeper.connection_throttle_freeze_time", -1) ); connThrottle.setDropIncrease( getDoubleProp("zookeeper.connection_throttle_drop_increase", 0.02) ); connThrottle.setDropDecrease( getDoubleProp("zookeeper.connection_throttle_drop_decrease", 0.002) ); connThrottle.setDecreasePoint( getDoubleProp("zookeeper.connection_throttle_decrease_ratio", 0) ); LOG.info("Created server with tickTime " + tickTime + " minSessionTimeout " + getMinSessionTimeout() + " maxSessionTimeout " + getMaxSessionTimeout() + " datadir " + txnLogFactory.getDataDir() + " snapdir " + txnLogFactory.getSnapDir()); }

Target:
public ZooKeeperServer(FileTxnSnapLog txnLogFactory, int tickTime, int minSessionTimeout, int maxSessionTimeout, ZKDatabase zkDb) { serverStats = new ServerStats(this); this.txnLogFactory = txnLogFactory; this.txnLogFactory.setServerStats(this.serverStats); this.zkDb = zkDb; this.tickTime = tickTime; setMinSessionTimeout(minSessionTimeout); setMaxSessionTimeout(maxSessionTimeout); listener = new ZooKeeperServerListenerImpl(this); readResponseCache = new ResponseCache(); connThrottle = new BlueThrottle(); LOG.info("Created server with tickTime " + tickTime + " minSessionTimeout " + getMinSessionTimeout() + " maxSessionTimeout " + getMaxSessionTimeout() + " datadir " + txnLogFactory.getDataDir() + " snapdir " + txnLogFactory.getSnapDir()); }
Source:
public void testHasChildren() throws Exception { final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); root.setFirstChild(child); getSetParentMethod().invoke(child, root); assertWithMessage("Root node should have children") .that(root.hasChildren()) .isTrue(); assertWithMessage("Child node should have no children") .that(child.hasChildren()) .isFalse(); }

Target:
public void testHasChildren() { final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); root.setFirstChild(child); assertWithMessage("Root node should have children") .that(root.hasChildren()) .isTrue(); assertWithMessage("Child node should have no children") .that(child.hasChildren()) .isFalse(); }
Source:
public GetQueryListResponse getFinishedQueryList(RpcController controller, GetQueryListRequest request) throws ServiceException { try { context.getSessionManager().touch(request.getSessionId().getId()); GetQueryListResponse.Builder builder = GetQueryListResponse.newBuilder(); Collection<QueryInfo> queries = context.getQueryJobManager().getFinishedQueries(); BriefQueryInfo.Builder infoBuilder = BriefQueryInfo.newBuilder(); for (QueryInfo queryInfo : queries) { infoBuilder.setQueryId(queryInfo.getQueryId().getProto()); infoBuilder.setState(queryInfo.getQueryState()); infoBuilder.setQuery(queryInfo.getSql()); infoBuilder.setStartTime(queryInfo.getStartTime()); infoBuilder.setFinishTime(System.currentTimeMillis()); infoBuilder.setProgress(queryInfo.getProgress()); infoBuilder.setQueryMasterPort(queryInfo.getQueryMasterPort()); infoBuilder.setQueryMasterHost(queryInfo.getQueryMasterHost()); builder.addQueryList(infoBuilder.build()); } GetQueryListResponse result = builder.build(); return result; } catch (Throwable t) { throw new ServiceException(t); } }

Target:
public GetQueryListResponse getFinishedQueryList(RpcController controller, GetQueryListRequest request) throws ServiceException { try { context.getSessionManager().touch(request.getSessionId().getId()); GetQueryListResponse.Builder builder = GetQueryListResponse.newBuilder(); Collection<QueryInfo> queries = context.getQueryJobManager().getFinishedQueries(); BriefQueryInfo.Builder infoBuilder = BriefQueryInfo.newBuilder(); for (QueryInfo queryInfo : queries) { infoBuilder.setQueryId(queryInfo.getQueryId().getProto()); infoBuilder.setState(queryInfo.getQueryState()); infoBuilder.setQuery(queryInfo.getSql()); infoBuilder.setStartTime(queryInfo.getStartTime()); infoBuilder.setFinishTime(queryInfo.getFinishTime()); infoBuilder.setProgress(queryInfo.getProgress()); infoBuilder.setQueryMasterPort(queryInfo.getQueryMasterPort()); infoBuilder.setQueryMasterHost(queryInfo.getQueryMasterHost()); builder.addQueryList(infoBuilder.build()); } GetQueryListResponse result = builder.build(); return result; } catch (Throwable t) { throw new ServiceException(t); } }
Source:
protected String errorMessage(Exception e) { return "%s is not a valid duration."; }

Target:
protected String errorMessage(Exception e) { return "%s is not a valid size."; }
Source:
public ImmutableValue<Integer> cooldown() { return ImmutableSpongeValue.cachedOf(Keys.COOLDOWN, -1, this.getValue()); }

Target:
public ImmutableValue<Integer> cooldown() { return this.cooldown; }
Source:
public void deactivate() { View view = getView(); if (null == view) { return; } getDiagramEventBroker().removeNotificationListener(view, this); }

Target:
public void deactivate() { View view = getView(); if (null == view) { return; } unsubscribe(view); }
Source:
public void testIllegalLimitParameter() { String testRegion = "20:60000-80000"; String annotationVepVersion = "78"; String annotationVepCacheversion = "78"; int limit = 100000; String url = "/v1/segments/" + testRegion + "/variants?species=mmusculus_grcm38&annot-vep-version=" + annotationVepVersion + "&annot-vep-cache-version=" + annotationVepCacheversion + "&limit=" + limit; ResponseEntity response = WSTestHelpers.getRestResponse(url, restTemplate); assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode()); }

Target:
public void testIllegalLimitParameter() { String testRegion = "20:60000-80000"; String annotationVepVersion = "78"; String annotationVepCacheversion = "78"; int limit = 100000; String url = UriComponentsBuilder.fromUriString("") .path("/v1/segments/") .path(testRegion) .path("/variants") .queryParam("species", "mmusculus_grcm38") .queryParam("annot-vep-version", annotationVepVersion) .queryParam("annot-vep-cache-version", annotationVepCacheversion) .queryParam("limit", limit) .build().toString(); ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode()); }
Source:
public final void cleanExpiredUsersSessions() { Date now = new Date(); Iterator<Entry<String, SessionInfo>> iter = sessionInfoMap.entrySet().iterator(); while (iter.hasNext()) { Entry<String, SessionInfo> entry = iter.next(); ConcurrentMap<String, Object> sessionMap = entry.getValue().contentOfSession; Date hardLimit = (Date) sessionMap.get(HARD_LIMIT_PARAMETER_NAME); Date softLimit = (Date) sessionMap.get(SOFT_LIMIT_PARAMETER_NAME); if ((hardLimit != null && hardLimit.before(now)) || (softLimit != null && softLimit.before(now))) { removeSessionImpl(entry.getKey(), Acct.ReportReason.PRINCIPAL_SESSION_EXPIRED, "Session has expired"); } } }

Target:
public final void cleanExpiredUsersSessions() { Date now = new Date(); Iterator<Entry<String, SessionInfo>> iter = sessionInfoMap.entrySet().iterator(); while (iter.hasNext()) { Entry<String, SessionInfo> entry = iter.next(); ConcurrentMap<String, Object> sessionMap = entry.getValue().contentOfSession; Date hardLimit = (Date) sessionMap.get(HARD_LIMIT_PARAMETER_NAME); Date softLimit = (Date) sessionMap.get(SOFT_LIMIT_PARAMETER_NAME); if ((hardLimit != null && hardLimit.before(now)) || (softLimit != null && softLimit.before(now))) { removeSessionImpl(entry.getKey(), Acct.ReportReason.PRINCIPAL_SESSION_EXPIRED, "Session has expired for principal %1$s", getPrincipal(entry.getKey())); } } }