auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNotificationWillShowInForegroundHandler_workTimeLongerThanTimeout() throws Exception { startNotificationExtensionService("com.test.onesignal.GenerateNotificationRunner$" + "NotificationExtensionService_workTimeLongerThanTimeout"); OneSignal.setAppId("b2f7f966-d8cc-11e4-bed1-df8f05be55ba"); OneSignal.setAppContext(blankActivity); OneSignal.setNotificationWillShowInForegroundHandler(new OneSignal.AppNotificationWillShowInForegroundHandler() { @Override public void notificationWillShowInForeground(final OSNotificationGenerationJob.AppNotificationGenerationJob notificationJob) { callbackCounter++; lastAppnotificationJob = notificationJob; try { Thread.sleep(35_000L); notificationJob.complete(); } catch (InterruptedException e) { e.printStackTrace(); } } }); threadAndTaskWait(); blankActivityController.resume(); threadAndTaskWait(); ShadowTimeoutHandler.setMockDelayMillis(1); FCMBroadcastReceiver_processBundle(blankActivity, getBaseNotifBundle()); threadAndTaskWait(); assertNotNull(lastExtnotificationJob); assertNotNull(lastAppnotificationJob); assertEquals(OneSignal.OSNotificationDisplay.NOTIFICATION, lastAppnotificationJob.getNotificationDisplayOption()); assertEquals(2, callbackCounter); assertNotificationDbRecords(1); }

Target:
public void testNotificationWillShowInForegroundHandler_workTimeLongerThanTimeout() throws Exception { OneSignal.setLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.NONE); startNotificationExtensionService("com.test.onesignal.GenerateNotificationRunner$" + "NotificationExtensionService_workTimeLongerThanTimeout"); OneSignal.setAppId("b2f7f966-d8cc-11e4-bed1-df8f05be55ba"); OneSignal.setAppContext(blankActivity); OneSignal.setNotificationWillShowInForegroundHandler(new OneSignal.AppNotificationWillShowInForegroundHandler() { @Override public void notificationWillShowInForeground(final OSNotificationGenerationJob.AppNotificationGenerationJob notificationJob) { callbackCounter++; lastAppnotificationJob = notificationJob; try { Thread.sleep(3_000L); notificationJob.complete(); } catch (InterruptedException e) { e.printStackTrace(); } } }); threadAndTaskWait(); blankActivityController.resume(); threadAndTaskWait(); ShadowTimeoutHandler.setMockDelayMillis(1); FCMBroadcastReceiver_processBundle(blankActivity, getBaseNotifBundle()); threadAndTaskWait(); assertNotNull(lastExtnotificationJob); assertNotNull(lastAppnotificationJob); assertEquals(OneSignal.OSNotificationDisplay.NOTIFICATION, lastAppnotificationJob.getNotificationDisplayOption()); assertEquals(2, callbackCounter); assertNotificationDbRecords(1); }
Source:
private void removeQueues(Stream<String> queueNames) { if (isRunning()) { synchronized (this.consumersMonitor) { queueNames.forEach(queue -> { List<SimpleConsumer> consumersForQueue = this.consumersByQueue.remove(queue); if (consumersForQueue != null) { consumersForQueue.stream().forEach(consumer -> { try { consumer.getChannel().basicCancel(consumer.getConsumerTag()); this.consumers.remove(consumer); } catch (IOException e) { logger.error("Failed to cancel consumer: " + consumer, e); } }); } }); } } }

Target:
private void removeQueues(Stream<String> queueNames) { if (isRunning()) { synchronized (this.consumersMonitor) { queueNames.map(this.consumersByQueue::remove) .filter(consumer -> consumer != null) .flatMap(Collection::stream) .forEach(consumer -> { try { consumer.getChannel().basicCancel(consumer.getConsumerTag()); this.consumers.remove(consumer); } catch (IOException e) { logger.error("Failed to cancel consumer: " + consumer, e); } }); } } }
Source:
private Map<String, byte[]> getPropagatedVariables(SchedulerDBManager dbManager, EligibleTaskDescriptor eligibleTaskDescriptor, InternalJob job, InternalTask task) throws UnknownTaskException { Map<String, byte[]> variables = new HashMap<>(); if (job.getType() == JobType.TASKSFLOW && eligibleTaskDescriptor != null) { try{ TaskResultImpl taskResult = (TaskResultImpl) dbManager.loadTasksResults(job.getId(), Collections.singletonList(task.getId())).get(task.getId()); variables.putAll(taskResult.getPropagatedVariables()); } catch (DatabaseManagerException exception) { int numberOfParentTasks = eligibleTaskDescriptor.getParents().size(); if ((numberOfParentTasks > 0) && task.handleResultsArguments()) { variables = extractTaskResultsAndMergeIntoMap(dbManager, eligibleTaskDescriptor, job); } else { variables = extractJobVariables(job); } } } return variables; }

Target:
private Map<String, byte[]> getPropagatedVariables(SchedulerDBManager dbManager, EligibleTaskDescriptor eligibleTaskDescriptor, InternalJob job, InternalTask task) throws UnknownTaskException { Map<String, byte[]> variables = new HashMap<>(); if (job.getType() == JobType.TASKSFLOW && eligibleTaskDescriptor != null) { try{ TaskResultImpl taskResult = (TaskResultImpl) dbManager.loadTasksResults(job.getId(), Collections.singletonList(task.getId())).get(task.getId()); variables.putAll(taskResult.getPropagatedVariables()); } catch (DatabaseManagerException exception) { tlogger.info(task.getId(), exception.getMessage()); int numberOfParentTasks = eligibleTaskDescriptor.getParents().size(); if ((numberOfParentTasks > 0) && task.handleResultsArguments()) { variables = extractTaskResultsAndMergeIntoMap(dbManager, eligibleTaskDescriptor, job); } else { variables = extractJobVariables(job); } } } return variables; }
Source:
public int hashCode() { return Objects.hash(getElementUUID(), getCode(), type, getMessage()); }

Target:
public int hashCode() { return HashUtil.combineHashCodes(Objects.hashCode(getElementUUID()), Objects.hashCode(getCode()), Objects.hashCode(type), Objects.hashCode(getMessage()), Objects.hashCode(getMessageKey()), Objects.hashCode(getMessageArguments())); }
Source:
public String toString() { return wrapped.toString(); }

Target:
public String toString() { return "CopyThreadLocalRunnable{ " + wrapped.toString() + " }"; }
Source:
public void fold(ColumnValueSelector selector) { if (firstString == null) { firstString = (String) selector.getObject(); } }

Target:
public void fold(ColumnValueSelector selector) { if (!isReset) { firstString = (String) selector.getObject(); isReset = true; } }
Source:
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) { xml.attribute("cid", bobHash.toCid()); if (bobData != null) { xml.attribute("max-age", String.valueOf(bobData.getMaxAge())); xml.attribute("type", bobData.getType()); xml.rightAngleBracket(); try { xml.escape(new String(bobData.getContent(), "UTF-8")); } catch (UnsupportedEncodingException e) { } } else { xml.setEmptyElement(); } return xml; }

Target:
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) { xml.attribute("cid", bobHash.toCid()); if (bobData != null) { xml.attribute("max-age", String.valueOf(bobData.getMaxAge())); xml.attribute("type", bobData.getType()); xml.rightAngleBracket(); xml.escape(bobData.getBase64Encoded()); } else { xml.setEmptyElement(); } return xml; }
Source:
private void prepareAddOffsetsToTxnResponse(final Errors error, final String consumerGroupId, final long producerId, final short producerEpoch) { client.prepareResponse(body -> { AddOffsetsToTxnRequest addOffsetsToTxnRequest = (AddOffsetsToTxnRequest) body; assertEquals(consumerGroupId, addOffsetsToTxnRequest.data.groupId()); assertEquals(transactionalId, addOffsetsToTxnRequest.data.transactionalId()); assertEquals(producerId, addOffsetsToTxnRequest.data.producerId()); assertEquals(producerEpoch, addOffsetsToTxnRequest.data.producerEpoch()); return true; }, new AddOffsetsToTxnResponse( new AddOffsetsToTxnResponseData() .setThrottleTimeMs(0) .setErrorCode(error.code())) ); }

Target:
private void prepareAddOffsetsToTxnResponse(final Errors error, final String consumerGroupId, final long producerId, final short producerEpoch) { client.prepareResponse(body -> { AddOffsetsToTxnRequest addOffsetsToTxnRequest = (AddOffsetsToTxnRequest) body; assertEquals(consumerGroupId, addOffsetsToTxnRequest.data.groupId()); assertEquals(transactionalId, addOffsetsToTxnRequest.data.transactionalId()); assertEquals(producerId, addOffsetsToTxnRequest.data.producerId()); assertEquals(producerEpoch, addOffsetsToTxnRequest.data.producerEpoch()); return true; }, new AddOffsetsToTxnResponse( new AddOffsetsToTxnResponseData() .setErrorCode(error.code())) ); }
Source:
public PermissionSubject(Guid objectId, VdcObjectType objectType, ActionGroup actionGroup) { this(objectId, objectType, actionGroup, null); }

Target:
public PermissionSubject(Guid objectId, VdcObjectType objectType, ActionGroup actionGroup) { this(objectId, objectType, actionGroup, VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION); }
Source:
public PaymentUpdate map(int index, ResultSet r, StatementContext ctx) throws SQLException { return PaymentUpdate.create( r.getString("external_id"), r.getString("status"), r.getString("error_message") ); }

Target:
public PaymentUpdate map(int index, ResultSet r, StatementContext ctx) throws SQLException { return PaymentUpdate.create( r.getString("external_id"), r.getString("status"), r.getString("error_msg") ); }
Source:
private boolean isMigrationSucceeded() { return dbVm.getStatus() == VMStatus.MigratingTo && (vdsmVm.getVmDynamic().getStatus().isRunning() || vdsmVm.getVmDynamic().getStatus() == VMStatus.Paused); }

Target:
private boolean isMigrationSucceeded() { return dbVm.getStatus() == VMStatus.MigratingTo && vdsmVm.getVmDynamic().getStatus().isRunningOrPaused(); }
Source:
TextLayout getTextLayout(int lineIndex) { if (lineSpacingProvider == null) { return getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), styledText.lineSpacing); } int newLineSpacing = styledText.lineSpacing; Integer spacing = lineSpacingProvider.getLineSpacing(lineIndex); if (spacing != null) { newLineSpacing = spacing; } if (isSameLineSpacing(lineIndex, newLineSpacing)) { return getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), newLineSpacing); } TextLayout layout = getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), styledText.lineSpacing); if (layout.getSpacing() != newLineSpacing) { layout.setSpacing(newLineSpacing); if (lineSpacingComputing) { return layout; } try { lineSpacingComputing = true; styledText.resetCache(lineIndex, styledText.getLineCount()); styledText.setVariableLineHeight(); styledText.setCaretLocation(); styledText.redraw(); } finally { lineSpacingComputing = false; } } return layout; }

Target:
TextLayout getTextLayout(int lineIndex) { if (lineSpacingProvider == null) { return getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), styledText.lineSpacing); } int newLineSpacing = styledText.lineSpacing; Integer spacing = lineSpacingProvider.getLineSpacing(lineIndex); if (spacing != null && spacing.intValue() >= 0) { newLineSpacing = spacing; } if (isSameLineSpacing(lineIndex, newLineSpacing)) { return getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), newLineSpacing); } TextLayout layout = getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), styledText.lineSpacing); if (layout.getSpacing() != newLineSpacing) { layout.setSpacing(newLineSpacing); if (lineSpacingComputing) { return layout; } try { lineSpacingComputing = true; styledText.resetCache(lineIndex, styledText.getLineCount()); styledText.setVariableLineHeight(); styledText.setCaretLocation(); styledText.redraw(); } finally { lineSpacingComputing = false; } } return layout; }
Source:
private boolean computeMerged() { if (!merged.contains(revision)) { while (mergedPos > 0) { CommitInfo c = changes.get(mergedPos).commit(); JsArrayString b = changes.get(mergedPos).branches(); if (b.get(0) != null) { merged.add(c.commit()); } mergedPos--; } return true; } return false; }

Target:
private void computeMerged() { if (!merged.contains(revision)) { while (mergedPos > 0) { CommitInfo c = changes.get(mergedPos).commit(); JsArrayString b = changes.get(mergedPos).branches(); if (b.get(0) != null) { merged.add(c.commit()); } mergedPos--; } } }
Source:
private void extractZip(Path tempZipPath) throws IOException { ZipFile zip = new ZipFile(tempZipPath.toFile()); zip.stream().forEach(entry -> { try { String path = COMPONENTS_DIR + File.separator + entry.getName(); if (!entry.isDirectory()) { storageManager.saveFile(path, PROTECTED_RESOURCE, zip.getInputStream(entry)); } else if (!storageManager.exists(path, PROTECTED_RESOURCE)) { storageManager.createDirectory(path, PROTECTED_RESOURCE); } } catch (ApsSystemException | IOException ex) { logger.error("Error while extracting zip file", ex); throw new InstallationException("Unable to extract zip file", ex); } }); }

Target:
private void extractZip(Path tempZipPath) throws IOException { try (ZipFile zip = new ZipFile(tempZipPath.toFile())) { for (ZipEntry entry : Collections.list(zip.entries())) { String path = COMPONENTS_DIR + File.separator + entry.getName(); if (!entry.isDirectory()) { storageManager.saveFile(path, PROTECTED_RESOURCE, zip.getInputStream(entry)); } else if (!storageManager.exists(path, PROTECTED_RESOURCE)) { storageManager.createDirectory(path, PROTECTED_RESOURCE); } } } catch (ApsSystemException | IOException ex) { logger.error("Error while extracting zip file", ex); throw new InstallationException("Unable to extract zip file", ex); } }
Source:
public void onMessage(Session session, String message) { if (securityTokenHolder.getRealmTokenMap().size() == 0) { onError(session, new SecureWebSocketException("User not logged in.", message)); } else { runWithUser( session, () -> { try { ws.onMessage(session, message); } catch (IOException e) { LOGGER.error("Failed to receive ws message.", e); } }); } }

Target:
public void onMessage(Session session, String message) { if (isUserLoggedIn()) { runWithUser( session, () -> { try { ws.onMessage(session, message); } catch (IOException e) { LOGGER.error("Failed to receive ws message.", e); } }); } else { onError(session, new WebSocketAuthenticationException("User not logged in.", message)); } }
Source:
public static synchronized DiffRepository lookup( Class clazz, DiffRepository baseRepository, Filter filter) { DiffRepository diffRepository = MAP_CLASS_TO_REPOSITORY.get(clazz); if (diffRepository == null) { final URL refFile = findFile(clazz, ".xml"); final File logFile = new File( Sources.of(refFile).file().getAbsolutePath() .replace(".xml", "_surefire.xml")); diffRepository = new DiffRepository(refFile, logFile, baseRepository, filter); MAP_CLASS_TO_REPOSITORY.put(clazz, diffRepository); } return diffRepository; }

Target:
public static synchronized DiffRepository lookup( Class clazz, DiffRepository baseRepository, Filter filter) { DiffRepository diffRepository = MAP_CLASS_TO_REPOSITORY.get(clazz); if (diffRepository == null) { final URL refFile = findFile(clazz, ".xml"); final String refFilePath = Sources.of(refFile).file().getAbsolutePath(); final File logFile = new File(refFilePath.replace(".xml", "_actual.xml")); assert !refFilePath.equals(logFile.getAbsolutePath()); diffRepository = new DiffRepository(refFile, logFile, baseRepository, filter); MAP_CLASS_TO_REPOSITORY.put(clazz, diffRepository); } return diffRepository; }
Source:
public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); }

Target:
public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); for (AttributeDefinition attr : STRONG_ATTRIBUTES) { resourceRegistration.registerReadOnlyAttribute(attr, null); } }
Source:
public void testMapperForDelegatesToRegistry() { ColumnMapper<?> mapper = new FooMapper(); JdbiConfig config = new JdbiConfig(); config.mappingRegistry.addColumnMapper(mapper); final StatementContext context = new StatementContext(config); assertThat(context.findColumnMapperFor(Foo.class).get()).isEqualTo(mapper); }

Target:
public void testMapperForDelegatesToRegistry() { ColumnMapper<?> mapper = new FooMapper(); JdbiConfig config = new JdbiConfig(); config.mappingRegistry.addColumnMapper(mapper); final StatementContext context = new StatementContext(config); assertThat(context.findColumnMapperFor(Foo.class)).contains(mapper); }
Source:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setPeerClassLoadingEnabled(peerClassLoadingEnabled()); if (!igniteInstanceName.equals(NO_CACHE_IGNITE_INSTANCE_NAME)) { CacheConfiguration cacheCfg = defaultCacheConfiguration(); cacheCfg.setCacheMode(cacheMode()); cacheCfg.setAtomicityMode(atomicityMode()); cacheCfg.setLoadPreviousValue(true); cacheCfg.setRebalanceMode(ASYNC); cacheCfg.setWriteSynchronizationMode(FULL_SYNC); cacheCfg.setNearConfiguration(nearConfiguration()); if (atomicityMode() != TRANSACTIONAL_SNAPSHOT) { cacheCfg.setCacheStoreFactory(new StoreFactory()); cacheCfg.setReadThrough(true); cacheCfg.setWriteThrough(true); } else cacheCfg.setIndexedTypes(Integer.class, Integer.class); cfg.setCacheConfiguration(cacheCfg); } else cfg.setClientMode(true); cfg.setIncludeEventTypes(org.apache.ignite.events.EventType.EVTS_ALL); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); return cfg; }

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setPeerClassLoadingEnabled(peerClassLoadingEnabled()); if (!igniteInstanceName.equals(NO_CACHE_IGNITE_INSTANCE_NAME)) { CacheConfiguration cacheCfg = defaultCacheConfiguration(); cacheCfg.setCacheMode(cacheMode()); cacheCfg.setAtomicityMode(atomicityMode()); cacheCfg.setLoadPreviousValue(true); cacheCfg.setRebalanceMode(ASYNC); cacheCfg.setWriteSynchronizationMode(FULL_SYNC); cacheCfg.setNearConfiguration(nearConfiguration()); if (atomicityMode() != TRANSACTIONAL_SNAPSHOT) { cacheCfg.setCacheStoreFactory(new StoreFactory()); cacheCfg.setReadThrough(true); cacheCfg.setWriteThrough(true); } else cacheCfg.setIndexedTypes(Integer.class, Integer.class); cfg.setCacheConfiguration(cacheCfg); } else cfg.setClientMode(true); cfg.setIncludeEventTypes(EVTS_ALL); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); return cfg; }
Source:
public List<T> peek(final int max) { try { final List<T> entries = new ArrayList<T>(max); queueFile.forEach(new QueueFile.ElementReader() { int count; @Override public boolean read(InputStream in, int length) throws IOException { byte[] data = new byte[length]; in.read(data, 0, length); entries.add(converter.from(data)); return ++count < max; } }); return entries; } catch (IOException e) { throw new FileException("Failed to peek.", e, file); } }

Target:
public List<T> peek(final int max) { try { final List<T> entries = new ArrayList<T>(max); queueFile.forEach(new QueueFile.ElementVisitor() { int count; @Override public boolean read(InputStream in, int length) throws IOException { byte[] data = new byte[length]; in.read(data, 0, length); entries.add(converter.from(data)); return ++count < max; } }); return unmodifiableList(entries); } catch (IOException e) { throw new FileException("Failed to peek.", e, file); } }
Source:
public LabelTypes getLabelTypes() { if (labelTypes == null) { synchronized (this) { if (labelTypes != null) { return labelTypes; } Map<String, LabelType> types = Maps.newLinkedHashMap(); for (LabelType type : dbLabelTypes.getLabelTypes()) { types.put(type.getName(), type); } List<ProjectState> projects = Lists.newArrayList(tree()); Collections.reverse(projects); for (ProjectState s : projects) { for (LabelType type : s.getConfig().getLabelSections()) { types.put(type.getName(), type); } } List<LabelType> all = Lists.newArrayListWithCapacity(types.size()); for (LabelType type : types.values()) { if (!type.getValues().isEmpty()) { all.add(type); } } labelTypes = new LabelTypes(Collections.unmodifiableList(all)); } } return labelTypes; }

Target:
public LabelTypes getLabelTypes() { Map<String, LabelType> types = Maps.newLinkedHashMap(); for (LabelType type : dbLabelTypes.getLabelTypes()) { types.put(type.getName(), type); } List<ProjectState> projects = Lists.newArrayList(tree()); Collections.reverse(projects); for (ProjectState s : projects) { for (LabelType type : s.getConfig().getLabelSections()) { types.put(type.getName(), type); } } List<LabelType> all = Lists.newArrayListWithCapacity(types.size()); for (LabelType type : types.values()) { if (!type.getValues().isEmpty()) { all.add(type); } } return new LabelTypes(Collections.unmodifiableList(all)); }
Source:
void unbindResource(OsgiVaadinStaticResource resource) { Delegate registration = resourceToDelegate.remove(resource); if (registration != null && httpService != null) { httpService.unregister(registration.alias); } }

Target:
void unbindResource(OsgiVaadinStaticResource resource) { httpService.unregister(resource.getAlias()); }
Source:
public DefaultEventGateway build() { validate(); return new DefaultEventGateway(this); }

Target:
public DefaultEventGateway build() { return new DefaultEventGateway(this); }
Source:
protected EntryLoggerAllocator getEntryLoggerAllocator() { return entryLoggerAllocator; }

Target:
EntryLoggerAllocator getEntryLoggerAllocator() { return entryLoggerAllocator; }
Source:
public DataLagMonitor(SystemConfiguration sysConfig, MetricService metricService, MailService mailService) { _metricService = metricService; _mailService = mailService; _dataLagQueryExpression = sysConfig.getValue(com.salesforce.dva.argus.system.SystemConfiguration.Property.DATA_LAG_QUERY_EXPRESSION); _dataLagThreshold = Long.valueOf(sysConfig.getValue(com.salesforce.dva.argus.system.SystemConfiguration.Property.DATA_LAG_QUERY_EXPRESSION)); _dataLagNotificationEmailId = sysConfig.getValue(com.salesforce.dva.argus.system.SystemConfiguration.Property.DATA_LAG_NOTIFICATION_EMAIL_ADDRESS); _hostName = sysConfig.getHostname(); }

Target:
public DataLagMonitor(SystemConfiguration sysConfig, MetricService metricService, MailService mailService) { _metricService = metricService; _mailService = mailService; _dataLagQueryExpression = sysConfig.getValue(com.salesforce.dva.argus.system.SystemConfiguration.Property.DATA_LAG_QUERY_EXPRESSION); _dataLagThreshold = Long.valueOf(sysConfig.getValue(com.salesforce.dva.argus.system.SystemConfiguration.Property.DATA_LAG_THRESHOLD)); _dataLagNotificationEmailId = sysConfig.getValue(com.salesforce.dva.argus.system.SystemConfiguration.Property.DATA_LAG_NOTIFICATION_EMAIL_ADDRESS); _hostName = sysConfig.getHostname(); _logger.info("Data lag monitor initialized"); }
Source:
public void editingLocalCss_002_UserWithoudAdminRightsHasNoEditOption() { WikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN); wiki.openWikiPage(); CommonFunctions.logInCookie(Properties.userName, Properties.password); wiki.openArticle(this.mediaWikiCss); wiki.waitForElementNotPresent(this.editButtonSelector); }

Target:
public void editingLocalCss_002_UserWithoudAdminRightsHasNoEditOption() { WikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN); wiki.openWikiPage(); CommonFunctions.logInCookie(Properties.userName, Properties.password); wiki.openArticle(URLsContent.mediaWikiCss); wiki.verifyEditButtonNotPresent(); }
Source:
private boolean assigneeSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; Optional<TurboUser> assignee = model.getAssigneeOfIssue(issue); if (!assignee.isPresent()) return false; List<TurboUser> usersOfRepo = model.getUsersOfRepo(issue.getRepoId()); boolean shouldWarnUser = !usersOfRepo.stream() .filter(user -> user.getLoginName().contains(content.get().toLowerCase()) || user.getRealName().contains(content.get().toLowerCase())) .findAny() .isPresent(); if (shouldWarnUser) { throw new SemanticException(String.format("Cannot find username containing %s in %s%n", content.get(), issue.getRepoId())); } String content = this.content.get().toLowerCase(); String login = assignee.get().getLoginName() == null ? "" : assignee.get().getLoginName().toLowerCase(); String name = assignee.get().getRealName() == null ? "" : assignee.get().getRealName().toLowerCase(); return login.contains(content) || name.contains(content); }

Target:
private boolean assigneeSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; Optional<TurboUser> assignee = model.getAssigneeOfIssue(issue); if (!assignee.isPresent()) return false; enforceUserInRepoCondition(model, issue.getRepoId(), content.get()); String content = this.content.get().toLowerCase(); String login = assignee.get().getLoginName() == null ? "" : assignee.get().getLoginName().toLowerCase(); String name = assignee.get().getRealName() == null ? "" : assignee.get().getRealName().toLowerCase(); return login.contains(content) || name.contains(content); }
Source:
private void createApplicationDistribution() throws IOException { File distFile = new File(this.buildDirectory, this.project.getArtifactId() + "-" + this.project .getVersion() + "." + fileExtension.extensionName); AbstractArchiver archiver; if (fileExtension == ApplicationDistributionExtensions.zip) { archiver = new ZipArchiver(); } else { TarArchiver tarArchiver = new TarArchiver(); TarArchiver.TarCompressionMethod tarCompressionMethod = new TarArchiver.TarCompressionMethod(); tarCompressionMethod.setValue("gzip"); tarArchiver.setCompression(tarCompressionMethod); archiver = tarArchiver; } archiver.enableLogging(new PlexusLoggerWrapper(getLog())); archiver.addDirectory(getWisdomRootDirectory(), "wisdom", new String[0], new String[]{ "*-cache/**", "logs/**"}); archiver.setDestFile(distFile); archiver.createArchive(); if (attachDistribution) { projectHelper.attachArtifact(project, fileExtension.extensionName, distFile); } }

Target:
private void createApplicationDistribution() throws IOException { File distFile = new File(this.buildDirectory, this.project.getArtifactId() + "-" + this.project .getVersion() + "." + fileExtension.extensionName); AbstractArchiver archiver; if (fileExtension == ApplicationDistributionExtensions.zip) { archiver = new ZipArchiver(); } else { TarArchiver tarArchiver = new TarArchiver(); TarArchiver.TarCompressionMethod tarCompressionMethod = new TarArchiver.TarCompressionMethod(); tarCompressionMethod.setValue("gzip"); tarArchiver.setCompression(tarCompressionMethod); archiver = tarArchiver; } archiver.enableLogging(new PlexusLoggerWrapper(getLog())); archiver.addDirectory(getWisdomRootDirectory(), new String[0], new String[]{ "*-cache/**", "logs/**"}); archiver.setDestFile(distFile); archiver.createArchive(); if (attachDistribution) { projectHelper.attachArtifact(project, fileExtension.extensionName, distFile); } }
Source:
public void uninstall() { StyledText text= this.fViewer.getTextWidget(); if (text != null && !text.isDisposed()) { text.removeMouseListener(this.fMouseTracker); text.removeMouseTrackListener(this.fMouseTracker); text.removeMouseMoveListener(this.fMouseTracker); } if (fViewer != null) { ((ITextViewerExtension4) fViewer).removeTextPresentationListener(updateStylesWidth); fViewer.removeViewportListener(visibleLines); } fViewer= null; fPainter= null; }

Target:
public void uninstall() { StyledText text= this.fViewer.getTextWidget(); if (text != null && !text.isDisposed()) { text.removeMouseListener(this.fMouseTracker); text.removeMouseTrackListener(this.fMouseTracker); text.removeMouseMoveListener(this.fMouseTracker); } if (fViewer != null) { if (fViewer instanceof ITextViewerExtension4) { ((ITextViewerExtension4) fViewer).removeTextPresentationListener(updateStylesWidth); } fViewer.removeViewportListener(visibleLines); } fViewer= null; fPainter= null; }
Source:
public Response addProvider(@Context HttpServletRequest request, NuxeoOAuth2ServiceProvider provider) throws IOException, RestOperationException { if (!((NuxeoPrincipal)getContext().getCoreSession().getPrincipal()).isAdministrator()) { return Response.status(Status.FORBIDDEN).build(); } Framework.doPrivileged(() -> { OAuth2ServiceProviderRegistry registry = Framework.getService(OAuth2ServiceProviderRegistry.class); registry.addProvider(provider.getServiceName(), provider.getDescription(), provider.getTokenServerURL(), provider.getAuthorizationServerURL(), provider.getUserAuthorizationURL(), provider.getClientId(), provider.getClientSecret(), provider.getScopes(), provider.isEnabled()); }); return Response.ok(getProvider(provider.getServiceName())).build(); }

Target:
public Response addProvider(@Context HttpServletRequest request, NuxeoOAuth2ServiceProvider provider) throws IOException, RestOperationException { checkPermission(); Framework.doPrivileged(() -> { OAuth2ServiceProviderRegistry registry = Framework.getService(OAuth2ServiceProviderRegistry.class); registry.addProvider(provider.getServiceName(), provider.getDescription(), provider.getTokenServerURL(), provider.getAuthorizationServerURL(), provider.getUserAuthorizationURL(), provider.getClientId(), provider.getClientSecret(), provider.getScopes(), provider.isEnabled()); }); return Response.ok(getProvider(provider.getServiceName())).build(); }
Source:
public OkHttpClient build() { OkHttpClient.Builder builder = new OkHttpClient.Builder(); builder.proxy(proxy); if (connectTimeoutMs >= 0) { builder.connectTimeout(connectTimeoutMs, TimeUnit.MILLISECONDS); } if (readTimeoutMs >= 0) { builder.readTimeout(readTimeoutMs, TimeUnit.MILLISECONDS); } if (proxyLogin != null) { + builder.proxyAuthenticator((route, response) -> { + Request.Builder newRequest = response.request().newBuilder(); + return newRequest.header("Proxy-Authorization", Credentials.basic(proxyLogin, nullToEmpty(proxyPassword))).build(); + }); + } builder.addInterceptor(this::completeHeaders); ConnectionSpec tls = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) .allEnabledTlsVersions() .allEnabledCipherSuites() .supportsTlsExtensions(true) .build(); builder.connectionSpecs(asList(tls, ConnectionSpec.CLEARTEXT)); X509TrustManager trustManager = sslTrustManager != null ? sslTrustManager : systemDefaultTrustManager(); SSLSocketFactory sslFactory = sslSocketFactory != null ? sslSocketFactory : systemDefaultSslSocketFactory(trustManager); builder.sslSocketFactory(sslFactory, trustManager); return builder.build(); }

Target:
public OkHttpClient build() { OkHttpClient.Builder builder = new OkHttpClient.Builder(); builder.proxy(proxy); if (connectTimeoutMs >= 0) { builder.connectTimeout(connectTimeoutMs, TimeUnit.MILLISECONDS); } if (readTimeoutMs >= 0) { builder.readTimeout(readTimeoutMs, TimeUnit.MILLISECONDS); } if (proxyLogin != null) { builder.proxyAuthenticator((route, response) -> { Request.Builder newRequest = response.request().newBuilder(); return newRequest.header("Proxy-Authorization", Credentials.basic(proxyLogin, nullToEmpty(proxyPassword))).build(); }); } builder.addInterceptor(this::completeHeaders); ConnectionSpec tls = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) .allEnabledTlsVersions() .allEnabledCipherSuites() .supportsTlsExtensions(true) .build(); builder.connectionSpecs(asList(tls, ConnectionSpec.CLEARTEXT)); X509TrustManager trustManager = sslTrustManager != null ? sslTrustManager : systemDefaultTrustManager(); SSLSocketFactory sslFactory = sslSocketFactory != null ? sslSocketFactory : systemDefaultSslSocketFactory(trustManager); builder.sslSocketFactory(sslFactory, trustManager); return builder.build(); }
Source:
public AbfsRestOperation createPath(final String path, final boolean isFile, final boolean overwrite, final String permission, final String umask) throws AzureBlobFileSystemException { final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders(); if (!overwrite) { requestHeaders.add(new AbfsHttpHeader(IF_NONE_MATCH, AbfsHttpConstants.STAR)); } if (permission != null && !permission.isEmpty()) { requestHeaders.add(new AbfsHttpHeader(HttpHeaderConfigurations.X_MS_PERMISSIONS, permission)); } if (umask != null && !umask.isEmpty()) { requestHeaders.add(new AbfsHttpHeader(HttpHeaderConfigurations.X_MS_UMASK, umask)); } final AbfsUriQueryBuilder abfsUriQueryBuilder = createDefaultUriQueryBuilder(); abfsUriQueryBuilder.addQuery(QUERY_PARAM_RESOURCE, isFile ? FILE : DIRECTORY); if (authType == AuthType.SAS) { String operation = isFile ? SASTokenProvider.CREATEFILE_OPERATION : SASTokenProvider.MKDIR_OPERATION; appendSASTokenToQuery(path, operation, abfsUriQueryBuilder); } final URL url = createRequestUrl(path, abfsUriQueryBuilder.toString()); final AbfsRestOperation op = new AbfsRestOperation( AbfsRestOperationType.CreatePath, this, HTTP_METHOD_PUT, url, requestHeaders); op.execute(); return op; }

Target:
public AbfsRestOperation createPath(final String path, final boolean isFile, final boolean overwrite, final String permission, final String umask) throws AzureBlobFileSystemException { final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders(); if (!overwrite) { requestHeaders.add(new AbfsHttpHeader(IF_NONE_MATCH, AbfsHttpConstants.STAR)); } if (permission != null && !permission.isEmpty()) { requestHeaders.add(new AbfsHttpHeader(HttpHeaderConfigurations.X_MS_PERMISSIONS, permission)); } if (umask != null && !umask.isEmpty()) { requestHeaders.add(new AbfsHttpHeader(HttpHeaderConfigurations.X_MS_UMASK, umask)); } final AbfsUriQueryBuilder abfsUriQueryBuilder = createDefaultUriQueryBuilder(); abfsUriQueryBuilder.addQuery(QUERY_PARAM_RESOURCE, isFile ? FILE : DIRECTORY); String operation = isFile ? SASTokenProvider.CREATEFILE_OPERATION : SASTokenProvider.MKDIR_OPERATION; appendSASTokenToQuery(path, operation, abfsUriQueryBuilder); final URL url = createRequestUrl(path, abfsUriQueryBuilder.toString()); final AbfsRestOperation op = new AbfsRestOperation( AbfsRestOperationType.CreatePath, this, HTTP_METHOD_PUT, url, requestHeaders); op.execute(); return op; }
Source:
public void clearRedisCache() { Jedis jedis = new Jedis(host, port); jedis.flushAll(); jedis.disconnect(); }

Target:
public void clearRedisCache() { Jedis jedis = new Jedis(host, port); String response = jedis.flushAll(); if (!response.equals("OK")) { logger.warn("Unexpected response from redis flushAll command: " + response); } jedis.disconnect(); }
Source:
private static boolean canInspect(GoReferenceExpression o, @Nullable GoReceiver receiver) { if (receiver == null) return false; GoType resolveType = receiver.getType(); if (resolveType == null) return false; PsiElement parent = o.getParent(); if (resolveType instanceof GoPointerType) { if (parent instanceof GoUnaryExpr) { if (((GoUnaryExpr)parent).getMul() != null) return false; } } GoType underlyingType = resolveType.getUnderlyingType(); if (underlyingType instanceof GoChannelType || underlyingType instanceof GoArrayOrSliceType ) { return false; } return true; }

Target:
private static boolean canInspect(GoReferenceExpression o, @Nullable GoReceiver receiver) { if (receiver == null) return false; GoType resolveType = receiver.getType(); if (resolveType == null) return false; PsiElement parent = o.getParent(); if (resolveType instanceof GoPointerType) { if (parent instanceof GoUnaryExpr) { if (((GoUnaryExpr)parent).getMul() != null) return false; } } GoType underlyingType = resolveType.getUnderlyingType(); return !(underlyingType instanceof GoChannelType || underlyingType instanceof GoArrayOrSliceType || underlyingType instanceof GoMapType); }
Source:
public EventHubSpout( final EventHubSpoutConfig spoutConfig, final IStateStore store, final IPartitionManagerFactory pmFactory, final IEventHubReceiverFactory recvFactory) { this.eventHubConfig = spoutConfig; this.checkpointIntervalInSeconds = spoutConfig.getCheckpointIntervalInSeconds(); this.lastCheckpointTime = System.currentTimeMillis(); stateStore = store; this.pmFactory = pmFactory; if (this.pmFactory == null) { this.pmFactory = new IPartitionManagerFactory() { private static final long serialVersionUID = -3134660797825594845L; @Override public IPartitionManager create(EventHubConfig ehConfig, String partitionId, IStateStore stateStore, IEventHubReceiver receiver) { return new PartitionManager(spoutConfig, partitionId, stateStore, receiver); } }; } this.recvFactory = recvFactory; if (this.recvFactory == null) { this.recvFactory = new IEventHubReceiverFactory() { private static final long serialVersionUID = 7215384402396274196L; @Override public IEventHubReceiver create(EventHubConfig spoutConfig, String partitionId) { return new EventHubReceiverImpl(spoutConfig, partitionId); } }; } }

Target:
public EventHubSpout( final EventHubSpoutConfig spoutConfig, final IStateStore store, final IPartitionManagerFactory pmFactory, final IEventHubReceiverFactory recvFactory) { this.eventHubConfig = spoutConfig; this.checkpointIntervalInSeconds = spoutConfig.getCheckpointIntervalInSeconds(); this.lastCheckpointTime = System.currentTimeMillis(); this.stateStore = store; this.pmFactory = pmFactory == null ? new PartitionManagerFactory() : pmFactory; this.recvFactory = recvFactory == null ? new EventHubReceiverFactory() : recvFactory; this.eventHubPath = String.join("/", spoutConfig.getTargetAddress(), spoutConfig.getEntityPath()); }
Source:
public void setFiles(ArrayList<Uri> files) { this.files = files; }

Target:
public void setFiles(ArrayList<Uri> files) { mFiles = files; }
Source:
protected void createFieldEditors() { Composite main = getFieldEditorParent(); Group initialGroup = new Group(main, SWT.SHADOW_ETCHED_IN); initialGroup.setText(UIText.DialogsPreferencePage_InitialGroupHeader); GridDataFactory.fillDefaults().grab(true, false).span(GROUP_SPAN, 1) .applyTo(initialGroup); addField(new BooleanFieldEditor( UIPreferences.SHOW_INITIAL_CONFIG_DIALOG, UIText.DialogsPreferencePage_ShowInitialConfigCheckbox, initialGroup)); updateMargins(initialGroup); Group confirmGroup = new Group(main, SWT.SHADOW_ETCHED_IN); GridDataFactory.fillDefaults().grab(true, false).span(GROUP_SPAN, 1) .applyTo(confirmGroup); confirmGroup .setText(UIText.DialogsPreferencePage_HideConfirmationGroupHeader); addField(new BooleanFieldEditor(UIPreferences.REBASE_HIDE_CONFIRM, UIText.DialogsPreferencePage_RebaseCheckbox, confirmGroup)); addField(new ComboFieldEditor(UIPreferences.SHOW_DETACHED_HEAD_WARNING, UIText.DialogsPreferencePage_DetachedHeadCombo, TOGGLE_OPTIONS, confirmGroup)); addField(new ComboFieldEditor(UIPreferences.SHOW_HOME_DIR_WARNING, UIText.DialogsPreferencePage_HomeDirWarning, TOGGLE_OPTIONS, confirmGroup)); updateMargins(confirmGroup); }

Target:
protected void createFieldEditors() { Composite main = getFieldEditorParent(); Group confirmGroup = new Group(main, SWT.SHADOW_ETCHED_IN); GridDataFactory.fillDefaults().grab(true, false).span(GROUP_SPAN, 1) .applyTo(confirmGroup); confirmGroup .setText(UIText.DialogsPreferencePage_HideConfirmationGroupHeader); GridDataFactory.fillDefaults().grab(true, false).span(GROUP_SPAN, 1) .applyTo(confirmGroup); addField(new BooleanFieldEditor( UIPreferences.SHOW_INITIAL_CONFIG_DIALOG, UIText.DialogsPreferencePage_ShowInitialConfigCheckbox, confirmGroup)); addField(new BooleanFieldEditor(UIPreferences.SHOW_REBASE_CONFIRM, UIText.DialogsPreferencePage_RebaseCheckbox, confirmGroup)); addField(new BooleanFieldEditor( UIPreferences.SHOW_DETACHED_HEAD_WARNING, UIText.DialogsPreferencePage_DetachedHeadCombo, confirmGroup)); addField(new BooleanFieldEditor(UIPreferences.SHOW_HOME_DIR_WARNING, UIText.DialogsPreferencePage_HomeDirWarning, confirmGroup)); updateMargins(confirmGroup); }
Source:
public void handleGetAllAttributeValuesResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final String resultData) { LOGGER.debug("handleGetAllAttributeValuesResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send( ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(resultData) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleGetAllAttributeValuesResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final String resultData) { LOGGER.debug("handleGetAllAttributeValuesResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(resultData) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send( responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
private void confirmUnplug() { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().deactivateVmDisksTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantDeactivateVMDisksMsg()); model.setHashName("deactivate_vm_disk"); setWindow(model); model.getLatch().setEntity(false); ArrayList<String> items = new ArrayList<String>(); for (Object selected : getSelectedItems()) { items.add(((Disk) selected).getDiskAlias()); } model.setItems(items); UICommand unPlug = new UICommand("OnConfirmUnplug", this); unPlug.setTitle(ConstantsManager.getInstance().getConstants().ok()); unPlug.setIsDefault(true); model.getCommands().add(unPlug); UICommand cancel = new UICommand("Cancel", this); cancel.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancel.setIsCancel(true); model.getCommands().add(cancel); }

Target:
private void confirmUnplug() { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().deactivateVmDisksTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantDeactivateVMDisksMsg()); model.setHashName("deactivate_vm_disk"); setWindow(model); ArrayList<String> items = new ArrayList<String>(); for (Object selected : getSelectedItems()) { items.add(((Disk) selected).getDiskAlias()); } model.setItems(items); UICommand unPlug = new UICommand("OnConfirmUnplug", this); unPlug.setTitle(ConstantsManager.getInstance().getConstants().ok()); unPlug.setIsDefault(true); model.getCommands().add(unPlug); UICommand cancel = new UICommand("Cancel", this); cancel.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancel.setIsCancel(true); model.getCommands().add(cancel); }
Source:
public Collection<? extends Action> createFor(@Nonnull Job job) { try { if (nonNull(JobInfoHelpers.triggerFrom(job, GitHubBranchTrigger.class))) { return Collections.singleton(forProject(job)); } } catch (Exception ex) { LOGGER.warn("Bad configured project - {}", job.getFullName(), ex.getMessage()); return Collections.emptyList(); } return Collections.emptyList(); }

Target:
public Collection<? extends Action> createFor(@Nonnull Job job) { try { if (nonNull(ghBranchTriggerFromJob(job))) { return Collections.singleton(forProject(job)); } } catch (Exception ex) { LOGGER.warn("Bad configured project - {}", job.getFullName(), ex.getMessage()); return Collections.emptyList(); } return Collections.emptyList(); }
Source:
public Response pdf(@ApiParam(value = "Osoitetiedot", required = true) final AddressLabelBatch input, @Context HttpServletRequest request) { String documentId; try { byte[] pdf = labelBuilder.printPDF(input); DocumentId docId = downloadCache.addDocument(new Download("application/pdf;charset=utf-8", "addresslabels.pdf", pdf)); documentId = docId.getDocumentId(); } catch (Exception e) { e.printStackTrace(); LOG.error("AddressLabel PDF failed: {}", e.getMessage()); return createFailureResponse(request); } return createResponse(request, documentId + ".pdf"); }

Target:
public Response pdf(@ApiParam(value = "Osoitetiedot", required = true) final AddressLabelBatch input, @Context HttpServletRequest request) { try { byte[] pdf = labelBuilder.printPDF(input); DocumentId docId = downloadCache.addDocument(new Download("application/pdf;charset=utf-8", "addresslabels.pdf", pdf)); return createResponse(request, docId.getDocumentId() + ".pdf"); } catch (Exception e) { LOG.error("AddressLabel PDF failed: {}", e); return createFailureResponse(request); } }
Source:
public SSLSession getSslSession() { SocketFactory socketFactory = connectionInternal.connection.getConfiguration().getSocketFactory(); String host = connectionInternal.connection.getConfiguration().getHost().ace; SSLSocket sslSocket = null; UInt16 port = connectionInternal.connection.getConfiguration().getPort(); try { sslSocket = (SSLSocket) socketFactory.createSocket(host, port.intValue()); } catch (IOException e) { Logger.getAnonymousLogger().log(Level.WARNING, "Couldn't obtain SSLSocket", e); return null; } SSLSession session = sslSocket.getSession(); return session; }

Target:
public SSLSession getSslSession() { return websocket.getSSLSession(); }
Source:
private void createDynamicMenu(Menu menu, final Repository[] repositories) { if (!isMultipleSelection(repositories)) { Repository repository = repositories[0]; createNewBranchMenuItem(menu, repository); if (hasBranches(repository)) { createSeparator(menu); } } int itemCount = createMostActiveBranchesMenuItems(menu, repositories); if (!isMultipleSelection(repositories)) { createSeparator(menu); createSwitchToCommitItem(menu, repositories[0]); } if (!isMultipleSelection(repositories) && itemCount > 0) { createSeparator(menu); createOtherMenuItem(menu, repositories[0]); } if (itemCount == 0 && isMultipleSelection(repositories)) { createDisabledMenu(menu, UIText.SwitchToMenu_NoCommonBranchesFound); } }

Target:
private void createDynamicMenu(Menu menu, final Repository[] repositories) { if (!isMultipleSelection(repositories)) { Repository repository = repositories[0]; createNewBranchMenuItem(menu, repository); if (hasBranches(repository)) { createSeparator(menu); } } int itemCount = createMostActiveBranchesMenuItems(menu, repositories); if (!isMultipleSelection(repositories)) { createSeparator(menu); createSwitchToCommitItem(menu, repositories[0]); if (itemCount > 0) { createOtherMenuItem(menu, repositories[0]); } } if (itemCount == 0 && isMultipleSelection(repositories)) { createDisabledMenu(menu, UIText.SwitchToMenu_NoCommonBranchesFound); } }