auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void joinLeaderElection() { List<String> liveInstances = _zkclient.getChildren(KeyBuilder.liveInstances(_cluster)); Collections.sort(liveInstances); String[] nodePathParts = _instanceName.split("/"); String nodeName = nodePathParts[nodePathParts.length - 1]; nodeName = nodeName.substring(_hostname.length() + 1); int index = liveInstances.indexOf(nodeName); if (index < 0) { LOG.error("Failed to join leader election. Try reconnect the zookeeper"); connect(); return; } if (index == 0) { if (_currentSubscription != null) { _zkclient.unsubscribeDataChanges(_currentSubscription, _leaderElectionListener); } if (!_isLeader) { onBecomeLeader(); } return; } String prevCandidate = liveInstances.get(index - 1); if (!prevCandidate.equals(_currentSubscription)) { if (_currentSubscription != null) { _zkclient.unsubscribeDataChanges(_currentSubscription, _leaderElectionListener); } _currentSubscription = prevCandidate; _zkclient.subscribeDataChanges(KeyBuilder.liveInstance(_cluster, _currentSubscription), _leaderElectionListener); } boolean exists = _zkclient.exists(KeyBuilder.liveInstance(_cluster, prevCandidate), true); if (exists) { if (_isLeader) { onBecomeFollower(); } } else { try { Thread.sleep(randomGenerator.nextInt(1000)); } catch (InterruptedException ie) { } joinLeaderElection(); } }

Target:
private void joinLeaderElection() { List<String> liveInstances = _zkclient.getChildren(KeyBuilder.liveInstances(_cluster)); Collections.sort(liveInstances); String[] nodePathParts = _instanceName.split("/"); String nodeName = nodePathParts[nodePathParts.length - 1]; nodeName = nodeName.substring(_hostname.length() + 1); int index = liveInstances.indexOf(nodeName); if (index < 0) { LOG.error("Failed to join leader election. Try reconnect the zookeeper"); connect(); return; } if (index == 0) { if (_currentSubscription != null) { _zkclient.unsubscribeDataChanges(KeyBuilder.liveInstance(_cluster, _currentSubscription), _leaderElectionListener); _currentSubscription = null; } if (!_isLeader) { onBecomeLeader(); } return; } String prevCandidate = liveInstances.get(index - 1); if (!prevCandidate.equals(_currentSubscription)) { if (_currentSubscription != null) { _zkclient.unsubscribeDataChanges(KeyBuilder.liveInstance(_cluster, _currentSubscription), _leaderElectionListener); } _currentSubscription = prevCandidate; _zkclient.subscribeDataChanges(KeyBuilder.liveInstance(_cluster, _currentSubscription), _leaderElectionListener); } boolean exists = _zkclient.exists(KeyBuilder.liveInstance(_cluster, prevCandidate), true); if (exists) { if (_isLeader) { onBecomeFollower(); } } else { try { Thread.sleep(randomGenerator.nextInt(1000)); } catch (InterruptedException ie) { } joinLeaderElection(); } }
Source:
void registerSubclass(Class<? extends ParseObject> clazz) { if (!ParseObject.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException("Cannot register a type that is not a subclass of ParseObject"); } String className = ObjectSubclassInfo.getClassName(clazz); synchronized (mutex) { ObjectSubclassInfo previousInfo = registeredSubclasses.get(className); if (previousInfo != null) { if (clazz.isAssignableFrom(previousInfo.type)) { return; } else if (previousInfo.type.isAssignableFrom(clazz)) { } else { throw new IllegalArgumentException( "Tried to regiser both " + previousInfo.type.getName() + " and " + clazz.getName() + " as the ParseObject subclass of " + className + ". " + "Cannot determine the right class to use because netiher inherits from " + "the other." ); } } try { registeredSubclasses.put(className, new ObjectSubclassInfo(clazz)); } catch (NoSuchMethodException ex) { throw new IllegalArgumentException( "Cannot register a type that does not implement the default constructor!" ); } } }

Target:
void registerSubclass(Class<? extends ParseObject> clazz) { if (!ParseObject.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException("Cannot register a type that is not a subclass of ParseObject"); } String className = getClassName(clazz); Constructor<? extends ParseObject> previousConstructor = null; synchronized (mutex) { previousConstructor = registeredSubclasses.get(className); if (previousConstructor != null) { Class<? extends ParseObject> previousClass = previousConstructor.getDeclaringClass(); if (clazz.isAssignableFrom(previousClass)) { return; } else if (previousClass.isAssignableFrom(clazz)) { } else { throw new IllegalArgumentException( "Tried to register both " + previousClass.getName() + " and " + clazz.getName() + " as the ParseObject subclass of " + className + ". " + "Cannot determine the right " + "class to use because neither inherits from the other." ); } } try { registeredSubclasses.put(className, getConstructor(clazz)); } catch (NoSuchMethodException ex) { throw new IllegalArgumentException( "Cannot register a type that does not implement the default constructor!" ); } catch (IllegalAccessException ex) { throw new IllegalArgumentException( "Default constructor for " + clazz + " is not accessible." ); } } if (previousConstructor != null) { if (className.equals(getClassName(ParseUser.class))) { ParseUser.getCurrentUserController().clearFromMemory(); } else if (className.equals(getClassName(ParseInstallation.class))) { ParseInstallation.getCurrentInstallationController().clearFromMemory(); } } }
Source:
private ContentViewer getSupportingViewer(String mimeType) { return mimeTypeToViewerMap.containsKey(mimeType) ? mimeTypeToViewerMap.get(mimeType) : null; }

Target:
private ContentViewer getSupportingViewer(String mimeType) { return mimeTypeToViewerMap.get(mimeType); }
Source:
public IASTTranslationUnit getASTTranslationUnit(FileContent reader, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log) throws CoreException { final IScanner scanner= createScanner(reader, scanInfo, fileCreator, log); scanner.setComputeImageLocations((options & OPTION_NO_IMAGE_LOCATIONS) == 0); scanner.setProcessInactiveCode((options & OPTION_PARSE_INACTIVE_CODE) != 0); final ISourceCodeParser parser= createParser(scanner, log, index, false, options); if(scanInfo instanceof ExtendedScannerInfo) { ExtendedScannerInfo extendedScannerInfo = (ExtendedScannerInfo) scanInfo; IParserSettings parserSettings = extendedScannerInfo.getParserSettings(); if(parserSettings != null) { int maximumTrivialExpressions = parserSettings.getMaximumTrivialExpressionsInAggregateInitializers(); if (maximumTrivialExpressions >= 0 && (options & OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS) != 0) { if (parser instanceof AbstractGNUSourceCodeParser) { ((AbstractGNUSourceCodeParser) parser) .setMaximumTrivialExpressionsInAggregateInitializers(maximumTrivialExpressions); } } } } ICanceler canceler= null; if (log instanceof ICanceler) { canceler= (ICanceler) log; canceler.setCancelable(new ICancelable() { @Override public void cancel() { scanner.cancel(); parser.cancel(); }}); } try { IASTTranslationUnit ast= parser.parse(); ast.setIsHeaderUnit((options & OPTION_IS_SOURCE_UNIT) == 0); return ast; } finally { if (canceler != null) { canceler.setCancelable(null); } } }

Target:
public IASTTranslationUnit getASTTranslationUnit(FileContent reader, IScannerInfo scanInfo, IncludeFileContentProvider fileCreator, IIndex index, int options, IParserLogService log) throws CoreException { final IScanner scanner= createScanner(reader, scanInfo, fileCreator, log); scanner.setComputeImageLocations((options & OPTION_NO_IMAGE_LOCATIONS) == 0); scanner.setProcessInactiveCode((options & OPTION_PARSE_INACTIVE_CODE) != 0); IParserSettings parserSettings= null; if (scanInfo instanceof ExtendedScannerInfo) { ExtendedScannerInfo extendedScannerInfo = (ExtendedScannerInfo) scanInfo; parserSettings = extendedScannerInfo.getParserSettings(); } final ISourceCodeParser parser= createParser(scanner, log, index, false, options, parserSettings); ICanceler canceler= null; if (log instanceof ICanceler) { canceler= (ICanceler) log; canceler.setCancelable(new ICancelable() { @Override public void cancel() { scanner.cancel(); parser.cancel(); }}); } try { IASTTranslationUnit ast= parser.parse(); ast.setIsHeaderUnit((options & OPTION_IS_SOURCE_UNIT) == 0); return ast; } finally { if (canceler != null) { canceler.setCancelable(null); } } }
Source:
private void prepareForSending() { try { if (partitionId != null) { attemptedPartitionIds.add(partitionId); } partitionId = getPartitionForPut(attemptedPartitionIds); chunkBlobId = new BlobId(BlobId.DEFAULT_FLAG, clusterMap.getLocalDatacenterId(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), partitionId); chunkBlobProperties = new BlobProperties(buf.remaining(), passedInBlobProperties.getServiceId(), passedInBlobProperties.getOwnerId(), passedInBlobProperties.getContentType(), passedInBlobProperties.isPrivate(), passedInBlobProperties.getTimeToLiveInSeconds(), passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), false); operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, false, routerConfig.routerPutSuccessTarget, routerConfig.routerPutRequestParallelism); correlationIdToChunkPutRequestInfo.clear(); state = ChunkState.Ready; } catch (RouterException e) { setOperationExceptionAndComplete(e); } catch (Exception e) { setOperationExceptionAndComplete(new RouterException("Operation tracker could not be initialized", e, RouterErrorCode.UnexpectedInternalError)); } }

Target:
private void prepareForSending() { try { if (partitionId != null) { attemptedPartitionIds.add(partitionId); } partitionId = getPartitionForPut(attemptedPartitionIds); chunkBlobId = new BlobId(BlobId.DEFAULT_FLAG, clusterMap.getLocalDatacenterId(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), partitionId); chunkBlobProperties = new BlobProperties(buf.remaining(), passedInBlobProperties.getServiceId(), passedInBlobProperties.getOwnerId(), passedInBlobProperties.getContentType(), passedInBlobProperties.isPrivate(), passedInBlobProperties.getTimeToLiveInSeconds(), passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), passedInBlobProperties.isEncrypted()); operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, false, routerConfig.routerPutSuccessTarget, routerConfig.routerPutRequestParallelism); correlationIdToChunkPutRequestInfo.clear(); state = ChunkState.Ready; } catch (RouterException e) { setOperationExceptionAndComplete(e); } catch (Exception e) { setOperationExceptionAndComplete(new RouterException("Operation tracker could not be initialized", e, RouterErrorCode.UnexpectedInternalError)); } }
Source:
public TestHiveIntegrationSmokeTest() { this(() -> createQueryRunner( ImmutableList.of(ORDERS, CUSTOMER, LINE_ITEM, PART_SUPPLIER), ImmutableMap.of( "experimental.table-writer-merge-operator-enabled", "true", "task.writer-count", "2"), Optional.empty()), createBucketedSession(Optional.of(new SelectedRole(ROLE, Optional.of("admin")))), createMaterializeExchangesSession(Optional.of(new SelectedRole(ROLE, Optional.of("admin")))), HIVE_CATALOG, new HiveTypeTranslator()); }

Target:
public TestHiveIntegrationSmokeTest() { this(() -> createQueryRunner(ORDERS, CUSTOMER, LINE_ITEM, PART_SUPPLIER), createBucketedSession(Optional.of(new SelectedRole(ROLE, Optional.of("admin")))), createMaterializeExchangesSession(Optional.of(new SelectedRole(ROLE, Optional.of("admin")))), HIVE_CATALOG, new HiveTypeTranslator()); }
Source:
private static EventFiringWebDriver getAndroidInstance(){ DesiredCapabilities destCaps = new DesiredCapabilities(); destCaps.setCapability("deviceName", ConfigurationFactory.getConfig().getDeviceName().toString()); URL url = null; try { url = new URL("http://" + ConfigurationFactory.getConfig().getAppiumIp().toString() + "/wd/hub"); } catch (MalformedURLException e) { e.printStackTrace(); } mobileDriver = new AndroidDriver(url, destCaps); return new EventFiringWebDriver(mobileDriver); }

Target:
private static EventFiringWebDriver getAndroidInstance(){ DesiredCapabilities destCaps = new DesiredCapabilities(); destCaps.setCapability("deviceName", ConfigurationFactory.getConfig().getDeviceName().toString()); URL url = null; try { url = new URL("http://" + ConfigurationFactory.getConfig().getAppiumIp().toString() + "/wd/hub"); } catch (MalformedURLException e) { PageObjectLogging.log("getAndroindInstance", e.getMessage(), false); } mobileDriver = new AndroidDriver(url, destCaps); return new EventFiringWebDriver(mobileDriver); }
Source:
private void testTransactionalTable(boolean batch) { TableEnvironment tableEnv = batch ? getTableEnvWithHiveCatalog() : getStreamTableEnvWithHiveCatalog(); tableEnv.executeSql("create database db1"); try { tableEnv.executeSql("create table db1.src (x string,y string)"); hiveShell.execute("create table db1.dest (x string,y string) clustered by (x) into 3 buckets stored as orc tblproperties ('transactional'='true')"); HiveTestUtils.createTextTableInserter(hiveShell, "db1", "src") .addRow(new Object[]{"a", "b"}) .addRow(new Object[]{"c", "d"}) .commit(); try { TableEnvUtil.execInsertSqlAndWaitResult(tableEnv, "insert into db1.src select * from db1.dest"); } catch (TableException e) { assertEquals("Cannot read on the ACID table db1.dest.", e.getMessage()); } try { TableEnvUtil.execInsertSqlAndWaitResult(tableEnv, "insert into db1.dest select * from db1.src"); } catch (TableException e) { assertEquals("Cannot write on the ACID table test-catalog.db1.dest.", e.getMessage()); } } finally { tableEnv.executeSql("drop database db1 cascade"); } }

Target:
private void testTransactionalTable(boolean batch) { TableEnvironment tableEnv = batch ? getTableEnvWithHiveCatalog() : getStreamTableEnvWithHiveCatalog(); tableEnv.executeSql("create database db1"); try { tableEnv.executeSql("create table db1.src (x string,y string)"); hiveShell.execute("create table db1.dest (x string,y string) clustered by (x) into 3 buckets stored as orc tblproperties ('transactional'='true')"); List<Exception> exceptions = new ArrayList<>(); try { TableEnvUtil.execInsertSqlAndWaitResult(tableEnv, "insert into db1.src select * from db1.dest"); } catch (Exception e) { exceptions.add(e); } try { TableEnvUtil.execInsertSqlAndWaitResult(tableEnv, "insert into db1.dest select * from db1.src"); } catch (Exception e) { exceptions.add(e); } assertEquals(2, exceptions.size()); exceptions.forEach(e -> { assertTrue(e instanceof FlinkHiveException); assertEquals("Reading or writing ACID table db1.dest is not supported.", e.getMessage()); }); } finally { tableEnv.executeSql("drop database db1 cascade"); } }
Source:
public static void sendRuntimeConfig(String topologyName, TMasterCommand topologyStateControlCommand, SchedulerStateManagerAdaptor statemgr, String[] configs, NetworkUtils.TunnelConfig tunnelConfig) throws TMasterException { final String runtimeConfigKey = "runtime-config"; final String runtimeConfigUpdateEndpoint = "runtime_config/update"; String[] arguments = new String[configs.length]; for (int i = 0; i < configs.length; ++i) { arguments[i] = runtimeConfigKey + "=" + configs[i]; } TMasterUtils.sendToTMasterWithArguments( runtimeConfigUpdateEndpoint, topologyName, arguments, statemgr, tunnelConfig); LOG.log(Level.INFO, "Topology command {0} completed successfully.", topologyStateControlCommand); }

Target:
public static void sendRuntimeConfig(String topologyName, TMasterCommand topologyStateControlCommand, SchedulerStateManagerAdaptor statemgr, String[] configs, NetworkUtils.TunnelConfig tunnelConfig) throws TMasterException { final String runtimeConfigKey = "runtime-config"; final String runtimeConfigUpdateEndpoint = "runtime_config/update"; List<String> arguments = new ArrayList<String>(); for (String config: configs) { arguments.add(runtimeConfigKey + "=" + config); } TMasterUtils.sendToTMasterWithArguments( runtimeConfigUpdateEndpoint, topologyName, arguments, statemgr, tunnelConfig); LOG.log(Level.INFO, "Topology command {0} completed successfully.", topologyStateControlCommand); }
Source:
public void initializeDefaultPreferences() { final IEclipsePreferences p = DefaultScope.INSTANCE.getNode(Activator.getPluginId()); p.putInt(GitCorePreferences.core_packedGitWindowSize, 8 * 1024); p.putInt(GitCorePreferences.core_packedGitLimit, 10 * MB); p.putBoolean(GitCorePreferences.core_packedGitMMAP, false); p.putInt(GitCorePreferences.core_deltaBaseCacheLimit, 10 * MB); p.putInt(GitCorePreferences.core_streamFileThreshold, 50 * MB); p.putBoolean(GitCorePreferences.core_autoShareProjects, true); p.putBoolean(GitCorePreferences.core_autoIgnoreDerivedResources, true); p.putBoolean(GitCorePreferences.core_enableLogicalModel, true); p.put(GitCorePreferences.core_preferredModelMergeStrategy, MergeStrategy.RECURSIVE.getName()); }

Target:
public void initializeDefaultPreferences() { final IEclipsePreferences p = DefaultScope.INSTANCE.getNode(Activator.getPluginId()); p.putInt(GitCorePreferences.core_packedGitWindowSize, 8 * 1024); p.putInt(GitCorePreferences.core_packedGitLimit, 10 * MB); p.putBoolean(GitCorePreferences.core_packedGitMMAP, false); p.putInt(GitCorePreferences.core_deltaBaseCacheLimit, 10 * MB); p.putInt(GitCorePreferences.core_streamFileThreshold, 50 * MB); p.putBoolean(GitCorePreferences.core_autoShareProjects, true); p.putBoolean(GitCorePreferences.core_autoIgnoreDerivedResources, true); }
Source:
public List<PoolSubpageMetric> tinySubpages() { return new ArrayList<PoolSubpageMetric>(); }

Target:
public List<PoolSubpageMetric> tinySubpages() { return Collections.emptyList(); }
Source:
public static void onUpdate(SQLiteDatabase db, int from, int to) { Timber.d("bookmarksLocations db is updated from:"+from+", to:"+to); if (from == to) { return; } if (from < 7) { from++; onUpdate(db, from, to); return; } if (from == 7) { onCreate(db); from++; onUpdate(db, from, to); return; } if (from == 8) { from++; onUpdate(db, from, to); return; } if (from == 10 && to == 11) { from++; try { db.execSQL("ALTER TABLE bookmarksLocations ADD COLUMN location_pic STRING;"); }catch (SQLiteException exception){ Timber.e(exception); } return; } if (from == 12 && to == 13) { from++; try { db.execSQL("ALTER TABLE bookmarksLocations ADD COLUMN location_destroyed STRING;"); }catch (SQLiteException exception){ Timber.e(exception); } return; } }

Target:
public static void onUpdate(SQLiteDatabase db, int from, int to) { Timber.d("bookmarksLocations db is updated from:"+from+", to:"+to); switch (from) { case 7: onCreate(db); case 8: case 9: case 10: try { db.execSQL("ALTER TABLE bookmarksLocations ADD COLUMN location_pic STRING;"); } catch (SQLiteException exception){ Timber.e(exception); } case 11: case 12: try { db.execSQL("ALTER TABLE bookmarksLocations ADD COLUMN location_destroyed STRING;"); }catch (SQLiteException exception){ Timber.e(exception); } break; } }
Source:
protected OperationRequest makeOperationRequest(ReplicaId replicaId) { if(!sslEnabledColos.contains(replicaId.getDataNodeId().getDatacenterName())) { return new GetBlobPropertiesOperationRequest(connectionPool, responseQueue, context, blobId, replicaId, makeGetRequest(), clusterMap, this, false); } else{ return new GetBlobPropertiesOperationRequest(connectionPool, responseQueue, context, blobId, replicaId, makeGetRequest(), clusterMap, this, true); } }

Target:
protected OperationRequest makeOperationRequest(ReplicaId replicaId) { return new GetBlobPropertiesOperationRequest(connectionPool, responseQueue, context, blobId, replicaId, makeGetRequest(), clusterMap, this); }
Source:
public AnnotationRoutingStrategy(Class<? extends Annotation> annotationType) { this(annotationType, UnresolvedRoutingKeyPolicy.RANDOM_KEY); }

Target:
public AnnotationRoutingStrategy(Class<? extends Annotation> annotationType) { this(annotationType, UnresolvedRoutingKeyPolicy.ERROR); }
Source:
public synchronized void putIfAbsent(String key, String value) { if(getProperty(key) == null) { put(key,value); } }

Target:
public synchronized TypedProperties putIfAbsent(String key, String value) { if (getProperty(key) == null) { put(key, value); } return this; }
Source:
private void pushAdapter(ITestDevice device, String bitness) throws DeviceNotAvailableException, IOException { VtsCompatibilityInvocationHelper invocationHelper = createVtsHelper(); File adapterDir = new File( invocationHelper.getTestsDir(), String.format(VTS_NATIVE_TEST_DIR, bitness)); File adapter = FileUtil.findFile(adapterDir, mAdapterBinaryName); if (adapter != null) { CLog.i("Pushing %s", mAdapterBinaryName); device.pushFile( adapter, String.format(TARGET_NATIVE_TEST_DIR, bitness) + mAdapterBinaryName); } else { throw new RuntimeException("Could not find adapter: " + mAdapterBinaryName); } }

Target:
private void pushAdapter(ITestDevice device, String bitness) throws DeviceNotAvailableException, IOException, NoSuchElementException { VtsCompatibilityInvocationHelper invocationHelper = createVtsHelper(); File adapterDir = new File( invocationHelper.getTestsDir(), String.format(VTS_NATIVE_TEST_DIR, bitness)); File adapter = FileUtil.findFile(adapterDir, mAdapterBinaryName); if (adapter != null) { CLog.i("Pushing %s", mAdapterBinaryName); device.pushFile( adapter, String.format(TARGET_NATIVE_TEST_DIR, bitness) + mAdapterBinaryName); } else { throw new NoSuchElementException("Could not find adapter: " + mAdapterBinaryName); } }
Source:
protected Class<? extends BaseBlockRender> getRenderer() { return RenderQuartzTorch.class; }

Target:
protected Class<? extends RenderQuartzTorch> getRenderer() { return RenderQuartzTorch.class; }
Source:
public ArrayMutableBlockBuffer(BlockPalette palette, Vector3i start, Vector3i size) { super(start, size); this.palette = palette; this.data = new PackedBackingData(size.getX() * size.getY() * size.getZ(), palette.getHighestId()); }

Target:
public ArrayMutableBlockBuffer(BlockPalette palette, Vector3i start, Vector3i size) { super(start, size); this.palette = palette; int airId = palette.getOrAssign(AIR); int dataSize = area(); this.data = new PackedBackingData(dataSize, palette.getHighestId()); if (airId != 0) { for (int i = 0; i < dataSize; i++) { this.data.set(i, airId); } } }
Source:
private IndexDiffData doReload(final Repository repository) { currentRepository = repository; IndexDiffCacheEntry cacheEntry = org.eclipse.egit.core.Activator.getDefault().getIndexDiffCache().getIndexDiffCacheEntry(currentRepository); cacheEntry.addIndexDiffChangedListener(myIndexDiffListener); return cacheEntry.getIndexDiff(); }

Target:
private IndexDiffData doReload(final Repository repository) { currentRepository = repository; IndexDiffCacheEntry entry = org.eclipse.egit.core.Activator.getDefault().getIndexDiffCache().getIndexDiffCacheEntry(currentRepository); if(cacheEntry != null && cacheEntry != entry) cacheEntry.removeIndexDiffChangedListener(myIndexDiffListener); cacheEntry = entry; cacheEntry.addIndexDiffChangedListener(myIndexDiffListener); return cacheEntry.getIndexDiff(); }
Source:
public synchronized void commit() throws IOException { if (logStream != null) { logStream.flush(); } for (FileOutputStream log : streamsToFlush) { log.flush(); if (forceSync) { long startSyncNS = System.nanoTime(); log.getChannel().force(false); long syncElapsedMS = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS); if (syncElapsedMS > fsyncWarningThresholdMS) { if(serverStats != null) { serverStats.incrementFsyncThresholdExceedCount(); } else { LOG.warn("fsyncWarningThresholdMS exceeded, but serverStats not added in FileTxnLog!"); } LOG.warn("fsync-ing the write ahead log in " + Thread.currentThread().getName() + " took " + syncElapsedMS + "ms which will adversely effect operation latency. " + "See the ZooKeeper troubleshooting guide"); } } } while (streamsToFlush.size() > 1) { streamsToFlush.removeFirst().close(); } }

Target:
public synchronized void commit() throws IOException { if (logStream != null) { logStream.flush(); } for (FileOutputStream log : streamsToFlush) { log.flush(); if (forceSync) { long startSyncNS = System.nanoTime(); log.getChannel().force(false); long syncElapsedMS = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS); if (syncElapsedMS > fsyncWarningThresholdMS) { if(serverStats != null) { serverStats.incrementFsyncThresholdExceedCount(); } LOG.warn("fsync-ing the write ahead log in " + Thread.currentThread().getName() + " took " + syncElapsedMS + "ms which will adversely effect operation latency. " + "See the ZooKeeper troubleshooting guide"); } } } while (streamsToFlush.size() > 1) { streamsToFlush.removeFirst().close(); } }
Source:
public void checksignatureHelpProvider() { editor.goToCursorPositionVisible(25, 38); editor.typeTextIntoEditor(ENTER.toString()); editor.typeTextIntoEditor("printVar.print("); try { editor.waitExpTextIntoShowHintsPopUp(""); } catch (WebDriverException ex) { fail("Known permanent failure: issue <LINK_0>"); } }

Target:
public void checksignatureHelpProvider() { editor.goToCursorPositionVisible(25, 38); editor.typeTextIntoEditor(ENTER.toString()); editor.typeTextIntoEditor("printVar.print("); try { editor.waitExpTextIntoShowHintsPopUp("setVAlue: string"); } catch (WebDriverException ex) { fail("Known permanent failure <LINK_0>", ex); } }
Source:
synchronized boolean tryAcquirePersistentLock() { Preconditions.checkState(!isShutDown, "This PersistentLockManager is shut down, and cannot be used to acquire locks."); try { lockId = persistentLockService.acquireBackupLock("Sweep"); log.info("Successfully acquired persistent lock for sweep: {}", SafeArg.of("lockId", lockId)); return true; } catch (CheckAndSetException e) { List<byte[]> actualValues = e.getActualValues(); if (!actualValues.isEmpty()) { LockEntry actualEntry = LockEntry.fromStoredValue(actualValues.get(0)); if (actualEntry.instanceId().equals(lockId.value())) { throw new IllegalStateException( "Acquiring a lock is unsupported when we've already acquired a lock"); } else { lockId = null; } } lockFailureMeter.mark(); log.info("Failed to acquire persistent lock for sweep. Waiting and retrying."); return false; } catch (NotInitializedException e) { log.info("The LockStore is not initialized yet. Waiting and retrying."); return false; } }

Target:
synchronized boolean tryAcquirePersistentLock() { Preconditions.checkState(!isShutDown, "This PersistentLockManager is shut down, and cannot be used to acquire locks."); try { lockId = persistentLockService.acquireBackupLock("Sweep"); log.info("Successfully acquired persistent lock for sweep: {}", SafeArg.of("lockId", lockId)); return true; } catch (CheckAndSetException e) { List<byte[]> actualValues = e.getActualValues(); if (!actualValues.isEmpty()) { LockEntry actualEntry = LockEntry.fromStoredValue(actualValues.get(0)); log.debug("CAS failed on lock acquire. We thought the lockId was {}, and the database has {}", SafeArg.of("lockId", lockId), SafeArg.of("actualEntry", actualEntry)); if (lockId != null && actualEntry.instanceId().equals(lockId.value())) { log.info("Attempted to acquire the a new lock when we already held a lock." + " The acquire failed, but our lock is still valid, so we still hold the lock."); return true; } else { lockId = null; } } lockFailureMeter.mark(); log.info("Failed to acquire persistent lock for sweep. Waiting and retrying."); return false; } catch (NotInitializedException e) { log.info("The LockStore is not initialized yet. Waiting and retrying."); return false; } }
Source:
public void testValidatePipe() throws Exception { String sc = PasswordHash.createHash("password"); session.put("key", sc ); pipe.setHashSessionKey("key"); pipe.configure(); PipeRunResult res = doPipe(pipe, "password", session); assertEquals("success", res.getPipeForward().getName()); }

Target:
public void testValidatePipe() throws Exception { pipe.configure(); PipeRunResult res = doPipe(pipe, "password", session); assertTrue(PasswordHash.validatePassword("password", res.getResult().asString())); assertEquals("success", res.getPipeForward().getName()); }
Source:
private void onShareClicked() { String videoUrl = getVideoUrl(); final int ts = getPlaybackSeekBar().getProgress() / 1000; if (!isLive() && videoUrl.contains("<LINK_0>") && ts >= 0) { videoUrl += ("&t=" + ts); } ShareUtils.shareUrl(service, getVideoTitle(), videoUrl); }

Target:
private void onShareClicked() { final int ts = getPlaybackSeekBar().getProgress() / 1000; final MediaSourceTag metadata = getCurrentMetadata(); String videoUrl = getVideoUrl(); if (!isLive() && ts >= 0 && metadata != null && metadata.getMetadata().getServiceId() == YouTube.getServiceId()) { videoUrl += ("&t=" + ts); } ShareUtils.shareUrl(service, getVideoTitle(), videoUrl); }
Source:
protected void doStop() throws Exception { super.doStop(); if (log.isTraceEnabled()) { log.trace("Shutting down consumer gracefully"); } dbzEngine.stop(); getEndpoint().getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService); }

Target:
protected void doStop() throws Exception { dbzEngine.stop(); getEndpoint().getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService); super.doStop(); }
Source:
protected VDSReturnValue getStatsForDomain() { VDS spmVds = LinqUtils.first(LinqUtils.filter(getAllRunningVdssInPool(), new Predicate<VDS>() { @Override public boolean eval(VDS vds) { return vds.getSpmStatus() == VdsSpmStatus.SPM; } })); return runVdsCommand(VDSCommandType.GetStorageDomainStats, new GetStorageDomainStatsVDSCommandParameters(spmVds.getId(), getParameters().getStorageDomainId())); }

Target:
protected VDSReturnValue getStatsForDomain() { VDS spmVds = LinqUtils.first(getAllRunningVdssInPool()); return runVdsCommand(VDSCommandType.GetStorageDomainStats, new GetStorageDomainStatsVDSCommandParameters(spmVds.getId(), getParameters().getStorageDomainId())); }
Source:
public ModuleCrawlerResult crawl( ModuleRecord parentRecord ) throws ParserException, IOException, ModuleException { crawlModule( parentRecord ); this.cache.put( parentRecord.source(), parentRecord ); while( modulesToCrawl.peek() != null ) { Source module = modulesToCrawl.poll(); if( this.result.isRecordInResult( module.source() ) ) { continue; } if( this.cache.containsKey( module.source() ) ) { this.result.addModuleRecord( this.cache.get( module.source() ) ); continue; } ModuleRecord p = parser.parse( module ); this.cache.put( p.source(), p ); crawlModule( p ); } return this.result; }

Target:
private CrawlerResult crawl( ModuleRecord parentRecord ) throws ParserException, IOException, ModuleException { CrawlerResult result = new CrawlerResult(); Queue< ModuleSource > dependencies = new LinkedList<>(); result.addModuleRecord( parentRecord ); dependencies.addAll( this.crawlModule( parentRecord ) ); while( dependencies.peek() != null ) { ModuleSource module = dependencies.poll(); if( result.isRecordInResult( module.uri() ) ) { continue; } if( ModuleCrawler.inCache( module.uri() ) ) { result.addModuleRecord( ModuleCrawler.getRecordFromCache( module.uri() ) ); continue; } ModuleParser parser = new ModuleParser( parserConfiguration ); ModuleRecord p = parser.parse( module ); result.addModuleRecord( p ); dependencies.addAll( this.crawlModule( p ) ); } return result; }
Source:
public io.confluent.connect.storage.format.RecordWriter getRecordWriter( final HdfsSinkConnectorConfig conf, final String filename ) { return new io.confluent.connect.storage.format.RecordWriter() { final CompressionCodecName compressionCodecName = CompressionCodecName.SNAPPY; final int blockSize = 256 * 1024 * 1024; final int pageSize = 64 * 1024; final Path path = new Path(filename); Schema schema = null; ParquetWriter<GenericRecord> writer = null; @Override public void write(SinkRecord record) { if (schema == null) { schema = record.valueSchema(); } if (writer == null) { try { log.info("Opening record writer for: {}", filename); org.apache.avro.Schema avroSchema = avroData.fromConnectSchema(schema); writer = new AvroParquetWriter<>( path, avroSchema, compressionCodecName, blockSize, pageSize, true, conf.getHadoopConfiguration() ); log.debug("Opened record writer for: {}", filename); } catch (IOException e) { log.debug( "Error creating AvroParquetWriter for file '{}', {}, and schema {}: ", filename, compressionCodecName, schema, e ); throw new ConnectException(e); } } log.trace("Sink record: {}", record.toString()); Object value = avroData.fromConnectData(record.valueSchema(), record.value()); try { writer.write((GenericRecord) value); } catch (IOException e) { throw new ConnectException(e); } } @Override public void close() { if (writer != null) { try { writer.close(); } catch (IOException e) { throw new ConnectException(e); } } } @Override public void commit() }; }

Target:
public io.confluent.connect.storage.format.RecordWriter getRecordWriter( final HdfsSinkConnectorConfig conf, final String filename ) { return new io.confluent.connect.storage.format.RecordWriter() { final CompressionCodecName compressionCodecName = CompressionCodecName.SNAPPY; final int blockSize = 256 * 1024 * 1024; final int pageSize = 64 * 1024; final Path path = new Path(filename); Schema schema = null; ParquetWriter<GenericRecord> writer = null; @Override public void write(SinkRecord record) { if (schema == null) { schema = record.valueSchema(); } if (writer == null) { try { log.info("Opening record writer for: {}", filename); org.apache.avro.Schema avroSchema = avroData.fromConnectSchema(schema); writer = new AvroParquetWriter<>( path, avroSchema, compressionCodecName, blockSize, pageSize, true, conf.getHadoopConfiguration() ); log.debug("Opened record writer for: {}", filename); } catch (IOException e) { log.warn( "Error creating for file '{}', {}, and schema {}: ", AvroParquetWriter.class.getSimpleName(), filename, compressionCodecName, schema, e ); throw new ConnectException(e); } } log.trace("Sink record: {}", record.toString()); Object value = avroData.fromConnectData(record.valueSchema(), record.value()); try { writer.write((GenericRecord) value); } catch (IOException e) { throw new ConnectException(e); } } @Override public void close() { if (writer != null) { try { writer.close(); } catch (IOException e) { throw new ConnectException(e); } } } @Override public void commit() }; }
Source:
public ResponseEntity moveSampleListFolder(@PathVariable final String crop, @PathVariable final Integer folderId, @RequestParam final Integer newParentId) { Map<String, Object> map; try { map = this.sampleListService.moveSampleListFolder(folderId, newParentId); } catch (final MiddlewareException e) { final ErrorResponse response = new ErrorResponse(); response.addError("Something went wrong, please try again"); return new ResponseEntity<>(response, HttpStatus.CONFLICT); } return new ResponseEntity<>(map,HttpStatus.OK); }

Target:
public ResponseEntity moveSampleListFolder(@PathVariable final String crop, @PathVariable final Integer folderId, @RequestParam final Integer newParentId) { final Map<String, Object> map; try { map = this.sampleListService.moveSampleListFolder(folderId, newParentId); } catch (final MiddlewareException e) { final ErrorResponse response = new ErrorResponse(); response.addError("Something went wrong, please try again"); return new ResponseEntity<>(response, HttpStatus.CONFLICT); } return new ResponseEntity<>(map, HttpStatus.OK); }
Source:
public void testCSRFEnabledAllowedMethodFromBrowser() throws Exception { StartupProperties.get().setProperty("falcon.security.csrf.enabled", "true"); mockHeader("Mozilla/5.0", null); mockGetMethod(); mockRunFilter(); Mockito.verify(mockResponse, Mockito.never()).sendError(HttpServletResponse.SC_BAD_REQUEST, CSRF_ERROR_MESSAGE); }

Target:
public void testCSRFEnabledAllowedMethodFromBrowser() throws Exception { StartupProperties.get().setProperty("falcon.security.csrf.enabled", "true"); mockHeader("Mozilla/5.0", null); mockGetMethod(); mockRunFilter(); Mockito.verify(mockResponse, Mockito.never()).sendError(HttpServletResponse.SC_FORBIDDEN, RestCsrfPreventionFilter.CSRF_ERROR_MESSAGE); }
Source:
public void setUp() throws IOException { serverAddress += wireMock.port(); communicator = Mockito.mock(UrlCommunicator.class); tmcApi = new TmcApi(communicator, settings); settings.setUsername("username"); settings.setPassword("password"); HttpResult fakeResult = new HttpResult(ExampleJson.allCoursesExample, 200, true); Mockito.when(communicator.makeGetRequestWithAuthentication(URI.create(Mockito.anyString()))) .thenReturn(fakeResult); }

Target:
public void setUp() throws IOException { serverAddress += wireMock.port(); communicator = Mockito.mock(UrlCommunicator.class); tmcApi = new TmcApi(communicator, settings); settings.setUsername("username"); settings.setPassword("password"); HttpResult fakeResult = new HttpResult(ExampleJson.allCoursesExample, 200, true); Mockito.when(communicator.makeGetRequestWithAuthentication(Mockito.any(URI.class))) .thenReturn(fakeResult); }
Source:
public static IntervalList concatenate(final IntervalList list1, final IntervalList list2) { final SAMFileHeader header = list1.getHeader().clone(); header.setSortOrder(SAMFileHeader.SortOrder.unsorted); final IntervalList merged = new IntervalList(header); merged.addall(list1.getIntervals()); SequenceUtil.assertSequenceDictionariesEqual(merged.getHeader().getSequenceDictionary(), list2.getHeader().getSequenceDictionary()); merged.addall(list2.intervals); return merged; }

Target:
public static IntervalList concatenate(final IntervalList list1, final IntervalList list2) { final SAMFileHeader header = list1.getHeader().clone(); return new IntervalList(header).addOther(list1).addOther(list2); }
Source:
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { Iterator<String> beanNames = beanFactory.getBeanNamesIterator(); while (beanNames.hasNext()) { String beanName = beanNames.next(); if (beanFactory.containsBeanDefinition(beanName)) { BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName); if (beanDefinition instanceof AnnotatedBeanDefinition) { AnnotatedBeanDefinition annotatedBeanDefinition = (AnnotatedBeanDefinition) beanDefinition; if (annotatedBeanDefinition.getMetadata().hasAnnotation(JGivenStage.class.getName())) { String className = beanDefinition.getBeanClassName(); Class<?> stageClass = createStageClass(beanName, className); beanDefinition.setBeanClassName(stageClass.getName()); } } } } }

Target:
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { String[] beanNames = beanFactory.getBeanDefinitionNames(); for (String beanName : beanNames) { if (beanFactory.containsBeanDefinition(beanName)) { BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName); if (beanDefinition instanceof AnnotatedBeanDefinition) { AnnotatedBeanDefinition annotatedBeanDefinition = (AnnotatedBeanDefinition) beanDefinition; if (annotatedBeanDefinition.getMetadata().hasAnnotation(JGivenStage.class.getName())) { String className = beanDefinition.getBeanClassName(); Class<?> stageClass = createStageClass(beanName, className); beanDefinition.setBeanClassName(stageClass.getName()); } } } } }
Source:
public ElideDynamicEntityCompiler(String path, DBPasswordExtractor dbPasswordExtractor) throws Exception { if (DynamicConfigHelpers.isNullOrEmpty(path)) { throw new IllegalArgumentException("Config path is null"); } HandlebarsHydrator hydrator = new HandlebarsHydrator(); DynamicConfigValidator dynamicConfigValidator = new DynamicConfigValidator(path); dynamicConfigValidator.readAndValidateConfigs(); ElideTableConfig tableConfig = dynamicConfigValidator.getElideTableConfig(); ElideSecurityConfig securityConfig = dynamicConfigValidator.getElideSecurityConfig(); ElideDBConfig elideSQLDBConfig = dynamicConfigValidator.getElideSQLDBConfig(); tableClasses = hydrator.hydrateTableTemplate(tableConfig); securityClasses = hydrator.hydrateSecurityTemplate(securityConfig); for (Entry<String, String> entry : tableClasses.entrySet()) { classNames.add(PACKAGE_NAME + entry.getKey()); } for (Entry<String, String> entry : securityClasses.entrySet()) { classNames.add(PACKAGE_NAME + entry.getKey()); } StringBuilder sb = new StringBuilder(); Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().getResources("/"); while (resources.hasMoreElements()) { URL url = resources.nextElement(); String fileName = url.getFile(); sb.append(fileName.substring(0, fileName.lastIndexOf("!"))).append(File.pathSeparator); } String classpath = sb.toString(); if (classpath != null && !classpath.equals("")) { log.debug("Classpath = " + classpath); compiler.useOptions("-classpath", sb.toString()); } compiler.useParentClassLoader(Thread.currentThread().getContextClassLoader()); compile(); elideSQLDBConfig.getDbconfigs().forEach(config -> { connectionDetailsMap.put(config.getName(), new ConnectionDetails(getDataSource(config, dbPasswordExtractor), config.getDialect())); }); }

Target:
public ElideDynamicEntityCompiler(String path, DBPasswordExtractor dbPasswordExtractor) throws Exception { if (DynamicConfigHelpers.isNullOrEmpty(path)) { throw new IllegalArgumentException("Config path is null"); } HandlebarsHydrator hydrator = new HandlebarsHydrator(); DynamicConfigValidator dynamicConfigValidator = new DynamicConfigValidator(path); dynamicConfigValidator.readAndValidateConfigs(); ElideTableConfig tableConfig = dynamicConfigValidator.getElideTableConfig(); ElideSecurityConfig securityConfig = dynamicConfigValidator.getElideSecurityConfig(); ElideDBConfig elideSQLDBConfig = dynamicConfigValidator.getElideSQLDBConfig(); tableClasses = hydrator.hydrateTableTemplate(tableConfig); securityClasses = hydrator.hydrateSecurityTemplate(securityConfig); for (Entry<String, String> entry : tableClasses.entrySet()) { classNames.add(PACKAGE_NAME + entry.getKey()); } for (Entry<String, String> entry : securityClasses.entrySet()) { classNames.add(PACKAGE_NAME + entry.getKey()); } compiler.useParentClassLoader(getClass().getClassLoader()); compile(); elideSQLDBConfig.getDbconfigs().forEach(config -> { connectionDetailsMap.put(config.getName(), new ConnectionDetails(getDataSource(config, dbPasswordExtractor), config.getDialect())); }); }
Source:
public void theGetRetrieveSpecificConfigurationRequestIsReceived() throws Throwable { this.correlationUidPattern = Pattern.compile(this.organisationId.getOrganisationId() + "\\|\\|\\|\\S{17}\\|\\|\\|\\S{17}"); this.testCase = this.wsdlProjectFactory.createWsdlTestCase(SOAP_PROJECT_XML, TEST_SUITE_XML, TEST_CASE_XML); PROPERTIES_MAP.put("DeviceIdentificationE", this.deviceId.getDeviceId()); PROPERTIES_MAP.put("OrganisationIdentification", this.organisationId.getOrganisationId()); final TestCaseResult runTestStepByName = this.testCaseRunner.runWsdlTestCase(this.testCase, PROPERTIES_MAP, TEST_CASE_NAME_REQUEST); final TestStepResult runTestStepByNameResult = runTestStepByName.getRunTestStepByName(); final WsdlTestCaseRunner wsdlTestCaseRunner = runTestStepByName.getResults(); assertEquals(TestStepStatus.OK, runTestStepByNameResult.getStatus()); for (final TestStepResult tcr : wsdlTestCaseRunner.getResults()) { this.response = ((MessageExchange) tcr).getResponseContent(); this.correlationUidMatcher = this.correlationUidPattern.matcher(this.response); } this.correlationUidMatcher.find(); this.correlationUid = this.correlationUidMatcher.group(); }

Target:
public void theGetRetrieveSpecificConfigurationRequestIsReceived() throws Throwable { this.correlationUidPattern = Pattern.compile(this.organisationId.getOrganisationId() + "\\|\\|\\|\\S{17}\\|\\|\\|\\S{17}"); this.testCase = this.wsdlProjectFactory.createWsdlTestCase(SOAP_PROJECT_XML, TEST_SUITE_XML, TEST_CASE_XML); PROPERTIES_MAP.put("DeviceIdentificationE", this.deviceId.getDeviceId()); PROPERTIES_MAP.put("OrganisationIdentification", this.organisationId.getOrganisationId()); final TestCaseResult runTestStepByName = this.testCaseRunner.runWsdlTestCase(this.testCase, PROPERTIES_MAP, TEST_CASE_NAME_REQUEST); final TestStepResult runTestStepByNameResult = runTestStepByName.getRunTestStepByName(); final WsdlTestCaseRunner wsdlTestCaseRunner = runTestStepByName.getResults(); assertEquals(TestStepStatus.OK, runTestStepByNameResult.getStatus()); for (final TestStepResult tcr : wsdlTestCaseRunner.getResults()) { this.response = ((MessageExchange) tcr).getResponseContent(); this.correlationUidMatcher = this.correlationUidPattern.matcher(this.response); } assertTrue(this.correlationUidMatcher.find()); this.correlationUid = this.correlationUidMatcher.group(); }
Source:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); designerProject.convertToModelingProject(); final EObject eObject = localSession.getOpenedSession().getSemanticResources().iterator().next().getContents().iterator().next().eContents().iterator().next(); Assert.assertTrue("The element is not an EPackage as expected", eObject instanceof EPackage); Assert.assertEquals("The element is not the EPackage expected", "p1", ((EPackage) eObject).getName()); p1 = (EPackage) eObject; }

Target:
protected void onSetUpAfterOpeningDesignerPerspective() throws Exception { sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE); localSession = designerPerspective.openSessionFromFile(sessionAirdResource); designerProject.convertToModelingProject(); }
Source:
public boolean isAC3() { return getCodecA() != null && ("ac3".equals(getCodecA()) || "a52".equals(getCodecA()) || "liba52".equals(getCodecA())); }

Target:
public boolean isAC3() { return getCodecA() != null && ("ac3".equals(getCodecA()) || getCodecA().contains("a52")); }
Source:
public void setUp() { app = new TestRealmApp(); RealmUser user = SyncTestUtils.Companion.createTestUser(app); config = configFactory.createSyncConfigurationBuilder(user).build(); }

Target:
public void setUp() { app = new TestRealmApp(); RealmUser user = SyncTestUtils.createTestUser(app); config = configFactory.createSyncConfigurationBuilder(user).build(); }
Source:
public Notifier register(String notifierName, NotificationContext ctx) { LOG.debug("Registering notifier name {}, NotificationContext {}", notifierName, ctx); Notifier notifier = loadNotifier(ctx.getConfig().getJarPath(), ctx.getConfig().getClassName()); Notifier registeredNotifier = notifiers.putIfAbsent(notifierName, notifier); if (registeredNotifier == null) { LOG.debug("Initializing notifier"); notifier.open(ctx); registeredNotifier = notifier; } LOG.debug("Notifier registered", notifierName); return registeredNotifier; }

Target:
public Notifier register(String notifierName, NotificationContext ctx) { LOG.info("Registering notifier name {}, NotificationContext {}", notifierName, ctx); Notifier notifier = loadNotifier(ctx.getConfig().getJarPath(), ctx.getConfig().getClassName()); Notifier registeredNotifier = notifiers.putIfAbsent(notifierName, notifier); if (registeredNotifier == null) { LOG.info("Initializing notifier"); notifier.open(ctx); registeredNotifier = notifier; } LOG.info("Notifier registered", notifierName); return registeredNotifier; }
Source:
private void clearStaleSessionCookies(StaplerRequest req, StaplerResponse rsp, String contextPath) { for (Cookie cookie : req.getCookies()) { if (cookie.getName().startsWith("JSESSIONID.")) { String cookieContextPath = cookie.getPath(); boolean pathMatches; if (cookieContextPath == null) { pathMatches = contextPath.equals("/"); } else { pathMatches = cookieContextPath.equals(contextPath); } if (pathMatches) { cookie.setMaxAge(0); cookie.setValue(""); rsp.addCookie(cookie); } } } }

Target:
private void clearStaleSessionCookies(StaplerRequest req, StaplerResponse rsp, String contextPath) { final String cookieName = "JSESSIONID."; for (Cookie cookie : req.getCookies()) { if (cookie.getName().startsWith(cookieName)) { LOGGER.log(Level.FINE, "Removing cookie {0} during logout", cookie.getName()); cookie.setMaxAge(0); cookie.setValue(""); rsp.addCookie(cookie); } } }