auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean mayProceed(String studyOid , StudySubjectBean ssBean) throws Exception { <START> boolean accessPermission = false; <END> StudyBean study = getParentStudy(studyOid); StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource); StudyParameterValueBean pStatus = spvdao.findByHandleAndStudy(study.getId(),"participantPortal"); participantPortalRegistrar=new ParticipantPortalRegistrar(); String pManageStatus =participantPortalRegistrar.getRegistrationStatus(studyOid).toString(); ENDING , INACTIVE String participateStatus = pStatus.getValue().toString(); String studyStatus = study.getStatus().getName().toString(); logger.info("pManageStatus: "+ pManageStatus + " participantStatus: " + participateStatus+ " studyStatus: " + studyStatus + " studySubjectStatus: "+ssBean.getStatus().getName()); System.out.println("pManageStatus: "+ pManageStatus + " participantStatus: " + participateStatus+ " studyStatus: " + studyStatus + " studySubjectStatus: "+ssBean.getStatus().getName()); if (participateStatus.equals("enabled") && studyStatus.equals("available") && pManageStatus.equals("ACTIVE") && ssBean.getStatus()==Status.AVAILABLE) { accessPermission = true; } return accessPermission; }</code><technical_language>Refactor this method mayProceed(studyOID)</technical_language>

Target:
private boolean mayProceed(String studyOid , StudySubjectBean ssBean) throws Exception { boolean accessPermission = false; logger.info( " studySubjectStatus: "+ssBean.getStatus().getName()); System.out.println( " studySubjectStatus: "+ssBean.getStatus().getName()); if (mayProceed(studyOid) && ssBean.getStatus()==Status.AVAILABLE) { accessPermission = true; } return accessPermission; }
Source:
<code>public void validateUpdateWipeAfterDeleteForFloatingDisk() { when(diskDao.get(diskImageGuid)).thenReturn(createDiskImage()); command.getParameters().getDiskInfo().setWipeAfterDelete(true); initializeCommand(); <START> command.getParameters().setDiskVmElement(null); mockNullVm(); <END> ValidateTestUtils.runAndAssertValidateSuccess(command); }</code><technical_language>is a lot of code duplication for test, diff is set 2 lines, extract logic a method call floating disk check attached disk</technical_language>

Target:
public void validateUpdateWipeAfterDeleteForFloatingDisk() { validateUpdateWipeAfterDelete(null, true); }
Source:
<code>public void addressesInHeadersAddedWithoutSlashes() throws Exception { final Socket socket = BkBasicTest.createMockSocket(); final AtomicReference<Request> ref = new AtomicReference<>(); new BkBasic( req -> { ref.set(req); <START> return new RsOf( <END> () -> Collections.singletonList("HTTP/1.1 200 OK"), req::body ); } ).accept(socket); final Request request = ref.get(); final RqHeaders.Smart smart = new RqHeaders.Smart( new RqHeaders.Base(request) ); MatcherAssert.assertThat( smart.single( "X-Takes-LocalAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( smart.single( "X-Takes-RemoteAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( new RqSocket(request).getLocalAddress(), Matchers.notNullValue() ); MatcherAssert.assertThat( new RqSocket(request).getRemoteAddress(), Matchers.notNullValue() ); }</code><technical_language>@fanifieiev above</technical_language>

Target:
public void addressesInHeadersAddedWithoutSlashes() throws Exception { final Socket socket = BkBasicTest.createMockSocket(); final AtomicReference<Request> ref = new AtomicReference<>(); new BkBasic( req -> { ref.set(req); return new ResponseOf( () -> Collections.singletonList("HTTP/1.1 200 OK"), req::body ); } ).accept(socket); final Request request = ref.get(); final RqHeaders.Smart smart = new RqHeaders.Smart( new RqHeaders.Base(request) ); MatcherAssert.assertThat( smart.single( "X-Takes-LocalAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( smart.single( "X-Takes-RemoteAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( new RqSocket(request).getLocalAddress(), Matchers.notNullValue() ); MatcherAssert.assertThat( new RqSocket(request).getRemoteAddress(), Matchers.notNullValue() ); }
Source:
<code>public void testAttemptLoadWithFileSystemFileDNE() throws Exception { Properties testProperties = PropertiesLoader.attemptLoadWithFileSystem(NON_EXISTENT_FILENAME, null); <START> Assert.assertEquals( <END> "Returns empty properties", Collections.emptySet(), testProperties.entrySet()); }</code><technical_language>String.format(...) instead of concatenation</technical_language>

Target:
public void testAttemptLoadWithFileSystemFileDNE() throws Exception { Properties testProperties = PropertiesLoader.attemptLoadWithFileSystem(NON_EXISTENT_FILENAME, null); assertThat(testProperties.entrySet(), is(empty())); }
Source:
<code>public abstract @Nullable PcapPacket parseNextPacket() throws IOException, BadPcapFileException, BadPacketException; public synchronized void <START> skipNextPacket() <END> throws IOException, BadPcapFileException { if (getFileChannel().size() - getFileChannel().position() == 0) { return; } if (getFileChannel().size() - getFileChannel().position() < PcapFileValues.PACKET_HEADER_SIZE) { throw new BadPcapFileException("A pcap header is invalid."); } ByteBuffer pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PACKET_HEADER_SIZE); pcapPacketHeader.clear(); pcapPacketHeader.order(ByteOrder.BIG_ENDIAN); getFileChannel().read(pcapPacketHeader); pcapPacketHeader.flip(); pcapPacketHeader.position(PcapFileValues.INCLUDED_LENGTH_POSITION); long includedPacketLength = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getInt()); if (getFileChannel().size() - getFileChannel().position() < includedPacketLength) { throw new BadPcapFileException("A packet header is invalid."); } getFileChannel().position(getFileChannel().position() + includedPacketLength); fFileIndex.put(++fCurrentRank, getFileChannel().position()); }</code><technical_language>this is abstract ? This implementation is working file, ng override</technical_language>

Target:
public abstract @Nullable PcapPacket parseNextPacket() throws IOException, BadPcapFileException, BadPacketException; public abstract void skipNextPacket() throws IOException, BadPcapFileException; public abstract void seekPacket(long rank) throws IOException, BadPcapFileException; public synchronized long getTotalNbPackets() throws IOException, BadPcapFileException { if (fTotalNumberPackets == -1) { long rank = fCurrentRank; fCurrentRank = fFileIndex.floorKey(rank); while (hasNextPacket()) { skipNextPacket(); } fTotalNumberPackets = fCurrentRank; fCurrentRank = rank; seekPacket(rank); } return fTotalNumberPackets; }
Source:
<code>public String getUsage() { String typeString = getType().getSimpleName(); if (isArray()) { <START> typeString += getArrayDelimiter() + typeString; <END> } String cmd = typeString + (hasName() ? " " + getName() : ""); if (required) { cmd = "<" + cmd + ">"; } else { cmd = "(" + cmd + ")"; } return cmd; }</code><technical_language>StringBuilder, concatenation, for multiline string building this</technical_language>

Target:
public String getUsage() { String simpleTypeName = getType().getSimpleName(); StringBuilder usage = new StringBuilder(simpleTypeName); if (isArray()) { usage.append(getArrayDelimiter()).append(simpleTypeName); } if (hasName()) { usage.append(' ').append(getName()); } if (required) { usage.insert(0, '<'); usage.append('>'); } else { usage.insert(0, '('); usage.append(')'); } return usage.toString(); }
Source:
<code>public void testCreateTwoBorderNodesAtSameLocationWithThinGridSpacing() { int gridStep = 50; editor.setSnapToGrid(true, gridStep, 2); SWTBotGefEditPart packageP4 = editor.getEditPart(PACKAGE_4_NAME, AbstractDiagramContainerEditPart.class); Rectangle packageAbsoluteBounds = editor.getAbsoluteBounds(packageP4); Point creationLocation = packageAbsoluteBounds.getTopLeft().translate(20, 20); createBorderedNode(BORDERED_NODE_CREATION_ON_PACKAGE_TOOL_NAME_2, creationLocation.x, creationLocation.y); createBorderedNode(BORDERED_NODE_CREATION_ON_PACKAGE_TOOL_NAME_2, creationLocation.x, creationLocation.y); IGraphicalEditPart firstNewNode = (IGraphicalEditPart) editor.getEditPart("new Enum2", AbstractDiagramBorderNodeEditPart.class).part(); <START> assertTrue("For BorderNode 'new Enum2', the <END> x coordinate or y coordinate of top left corner should be on the grid should be on the grid.", checkLocationAlignOnGrid(firstNewNode, gridStep)); IGraphicalEditPart secondNewNode = (IGraphicalEditPart) editor.getEditPart("new Enum3", AbstractDiagramBorderNodeEditPart.class).part(); assertTrue("For BorderNode 'new Enum3', the x coordinate or y coordinate of top left corner should be on the grid should be on the grid.", checkLocationAlignOnGrid(secondNewNode, gridStep)); }</code><technical_language>Add location grid step. In case of failure, helps understand problem</technical_language>

Target:
public void testCreateTwoBorderNodesAtSameLocationWithThinGridSpacing() { int gridStep = 50; editor.setSnapToGrid(true, gridStep, 2); SWTBotGefEditPart packageP4 = editor.getEditPart(PACKAGE_4_NAME, AbstractDiagramContainerEditPart.class); Rectangle packageAbsoluteBounds = editor.getAbsoluteBounds(packageP4); Point creationLocation = packageAbsoluteBounds.getTopLeft().translate(20, 20); createBorderedNode(BORDERED_NODE_CREATION_ON_PACKAGE_TOOL_NAME_2, creationLocation.x, creationLocation.y); createBorderedNode(BORDERED_NODE_CREATION_ON_PACKAGE_TOOL_NAME_2, creationLocation.x, creationLocation.y); IGraphicalEditPart firstNewNode = (IGraphicalEditPart) editor.getEditPart("new Enum2", AbstractDiagramBorderNodeEditPart.class).part(); checkLocationAlignOnGrid(firstNewNode, "BorderNode 'new Enum2'"); IGraphicalEditPart secondNewNode = (IGraphicalEditPart) editor.getEditPart("new Enum3", AbstractDiagramBorderNodeEditPart.class).part(); checkLocationAlignOnGrid(secondNewNode, "BorderNode 'new Enum3'"); }
Source:
<code>private void fetchPresenterWidgetTemplate(PresenterOptions presenterOptions) throws Exception { PresenterWidgetOptions presenterWidgetOptions = new PresenterWidgetOptions(); presenterWidgetOptions.setSingleton(presenterConfigModel.isUseSingleton()); try { createdPresenterWidgetTemplates = CreatePresenterWidget.run(presenterOptions, presenterWidgetOptions, true); } catch (Exception e) { <START> throw e; <END> } }</code><technical_language>Catch</technical_language>

Target:
private void fetchPresenterWidgetTemplate(PresenterOptions presenterOptions) throws Exception { PresenterWidgetOptions presenterWidgetOptions = new PresenterWidgetOptions(); presenterWidgetOptions.setSingleton(presenterConfigModel.isUseSingleton()); createdPresenterWidgetTemplates = CreatePresenterWidget.run(presenterOptions, presenterWidgetOptions, true); }
Source:
<code>public void testConvertSecondsToMinutes() { long seconds = 1800L; Pair<Long, TimeUnit> expectedResults = TimeConverter.autoConvert(seconds, TimeUnit.SECONDS); <START> assertEquals(expectedResults.getFirst().longValue() , 30L); <END> }</code><technical_language>asserting expected TimeUnit well</technical_language>

Target:
public void testConvertSecondsToMinutes() { long seconds = 1800L; Pair<Long, TimeUnit> expectedResults = TimeConverter.autoConvert(seconds, TimeUnit.SECONDS); assertEquals(expectedResults.getFirst().longValue() , 30L); assertEquals(expectedResults.getSecond(), TimeUnit.MINUTES); }
Source:
<code>public void loadBuiltInDefaultFilter() { for (String pattern : java.util.Arrays.asList(new String[] { "/.project", "/.cproject", "/.settings/", "**/coredir.[0-9]*/", <START> "**/core", "!**/core/", "**/core.[0-9]*" })) { END> addPattern(pattern, true); } }</code><technical_language>John wrote: ** supported. ** result *. */core matches core somefolder/core. match somefolder/subdir/core. If want match core level want change "**/core" simply "core". for "core", "!core/", "core.[0-9]*"</technical_language>

Target:
public void loadBuiltInDefaultFilter() { for (String pattern : java.util.Arrays.asList(new String[] { "/.project", "/.cproject", "/.settings/", "coredir.[0-9]*/", "core", "!core/", "core.[0-9]*", "!core.[0-9]*/" })) { addPattern(pattern, true); } }
Source:
<code>public Mono<Void> deleteAll(Publisher<? extends T> entityStream) { Assert.notNull(entityStream, "EntityStream must not be null!"); return deleteById(Flux.from(entityStream) .handle((o, synchronousSink) -> { <START> ID id = entityInformation.getId(o); <END> if (id != null) { synchronousSink.next(id); } })); }</code><technical_language>entity Id is unexpected situation handled error</technical_language>

Target:
public Mono<Void> deleteAll(Publisher<? extends T> entityStream) { Assert.notNull(entityStream, "EntityStream must not be null!"); return Flux.from(entityStream) .map(entity -> { ID id = entityInformation.getId(entity); if (id == null) { throw new IllegalStateException("Entity id must not be null!"); } return convertId(id); }) .collectList() .map(objects -> { return new StringQuery(QueryBuilders.idsQuery() .addIds(objects.toArray(new String[0])) .toString()); }) .flatMap(query -> { return elasticsearchOperations .deleteBy(query, entityInformation.getJavaType(), entityInformation.getIndexCoordinates()); }) .then(); }
Source:
<code>private void openGeoPackage() { String geoPackagePath = Environment.getExternalStorageDirectory() + getString(R.string.local_folder) + getString(R.string.file_name); Log.d(TAG, geoPackagePath); GeoPackage geoPackage = new GeoPackage(geoPackagePath); geoPackage.loadAsync(); geoPackage.addDoneLoadingListener(() -> { if (geoPackage.getLoadStatus() == LoadStatus.LOADED) { FeatureTable geoPackageTable = geoPackage.getGeoPackageFeatureTables().get(0); if (geoPackageTable == null) { Toast.makeText(MainActivity.this, "No feature table found in the package!", Toast.LENGTH_LONG); <START> Log.e(TAG, "No feature table found in this package!"); <END> } FeatureLayer featureLayer = new FeatureLayer(geoPackageTable); mMap.getOperationalLayers().add(featureLayer); } else { Toast.makeText(MainActivity.this, "GeoPackage failed to load! " + geoPackage.getLoadError(), Toast.LENGTH_LONG); Log.e(TAG, "GeoPackage failed to load!" + geoPackage.getLoadError()); } }); }</code><technical_language>Need exit function if table null</technical_language>

Target:
private void openGeoPackage() { String geoPackagePath = Environment.getExternalStorageDirectory() + getString(R.string.local_folder) + getString(R.string.file_name); Log.d(TAG, geoPackagePath); GeoPackage geoPackage = new GeoPackage(geoPackagePath); geoPackage.loadAsync(); geoPackage.addDoneLoadingListener(() -> { if (geoPackage.getLoadStatus() == LoadStatus.LOADED) { FeatureTable geoPackageTable = geoPackage.getGeoPackageFeatureTables().get(0); if (geoPackageTable == null) { Toast.makeText(MainActivity.this, "No feature table found in the package!", Toast.LENGTH_LONG).show(); Log.e(TAG, "No feature table found in this package!"); return; } FeatureLayer featureLayer = new FeatureLayer(geoPackageTable); mMap.getOperationalLayers().add(featureLayer); } else { Toast.makeText(MainActivity.this, "GeoPackage failed to load! " + geoPackage.getLoadError(), Toast.LENGTH_LONG).show(); Log.e(TAG, "GeoPackage failed to load!" + geoPackage.getLoadError()); } }); }
Source:
<code>private void decreaseBuffersInBacklogUnsafe(boolean isBuffer) { assert Thread.holdsLock(buffers); if (isBuffer) { buffersInBacklog--; <START> parent.notifyDecreaseBacklog(buffersInBacklog); <END> } }</code><technical_language>lines replaced with: parent.notifyDecreaseBacklog(--buffersInBacklog);</technical_language>

Target:
private void decreaseBuffersInBacklogUnsafe(boolean isBuffer) { assert Thread.holdsLock(buffers); if (isBuffer) { buffersInBacklog--; } }
Source:
<code>public String getClusterName() { final String clusterName = client.getClientConfig().getClusterName(); <START> if (clusterName == null) { <END> throw new RuntimeException("Cluster name cannot be null on the client which participates in XA Transaction"); } return clusterName; }</code><technical_language>a clusterName null</technical_language>

Target:
public String getClusterName() { return client.getClientConfig().getClusterName(); }
Source:
<code>public static void main(String[] args) { ExecutorService es = Executors.newFixedThreadPool(1000); ReaderWriterLock lock = new ReaderWriterLock(); AtomicInteger index = new AtomicInteger(0); IntStream.range(0, 100).forEach(i -> { Runnable task = null; <START> if (ran.nextFloat() <= 0.6) { <END> task = new Runnable() { @Override public void run() { Lock writeLock = lock.writeLock(); writeLock.lock(); try { int cur = index.getAndIncrement(); System.out.println("Writer " + cur + " begin"); simulateReadOrWrite(); System.out.println("Writer " + cur + " finish"); } finally { writeLock.unlock(); } } }; } else { task = new Runnable() { @Override public void run() { Lock readLock = lock.readLock(); readLock.lock(); try { int cur = index.getAndIncrement(); System.out.println("Reader " + cur + " begin"); simulateReadOrWrite(); System.out.println("Reader " + cur + " finish"); } finally { readLock.unlock(); } } }; } es.submit(task); }); }</code><technical_language>random numbers here? I allocate number of readers writers. readers writers extracted class instead of anonymous classes</technical_language>

Target:
public static void main(String[] args) { ExecutorService executeService = Executors.newFixedThreadPool(1000); ReaderWriterLock lock = new ReaderWriterLock(); IntStream.range(0, 10) .forEach(i -> executeService.submit(new Reader("Reader " + i, lock.readLock()))); IntStream.range(0, 10) .forEach(i -> executeService.submit(new Writer("Writer " + i, lock.writeLock()))); executeService.shutdown(); try { executeService.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { System.out.println("Error waiting for ExecutorService shutdown"); } }
Source:
<code><START> public List<ECSTaskTemplate> getAllTemplates() { <END> List<ECSTaskTemplate> dynamicTemplates = TaskTemplateMap.get().getTemplates(this); List<ECSTaskTemplate> allTemplates = new CopyOnWriteArrayList<>(); allTemplates.addAll(dynamicTemplates); if (templates != null) { allTemplates.addAll(templates); } return allTemplates; }</code><technical_language>This method private</technical_language>

Target:
private List<ECSTaskTemplate> getAllTemplates() { List<ECSTaskTemplate> dynamicTemplates = TaskTemplateMap.get().getTemplates(this); List<ECSTaskTemplate> allTemplates = new CopyOnWriteArrayList<>(); allTemplates.addAll(dynamicTemplates); if (templates != null) { allTemplates.addAll(templates); } return allTemplates; }
Source:
<code>public void onResume() { super.onResume(); PermissionHandler.executeIfLocationPermissionGranted(this.activity, new PermissionGrantedCallback(PermissionRequestContext.CacheDetailActivity) { @Override public void execute() { <START> Log.d("CacheDetailActivity.OnResumePermissionGrantedCallback.execute"); <END> final Sensors sensors = Sensors.getInstance(); sensors.setupGeoDataObservables(Settings.useGooglePlayServices(), Settings.useLowPowerMode()); sensors.setupDirectionObservable(); resumeDisposables.addAll(geoDirUpdate.start(GeoDirHandler.UPDATE_GEODIR), startTimer()); } }); final List<String> toRefresh; synchronized (dirtyCaches) { toRefresh = new ArrayList<>(dirtyCaches); dirtyCaches.clear(); } if (!toRefresh.isEmpty()) { AndroidRxUtils.refreshScheduler.scheduleDirect(new Runnable() { @Override public void run() { for (final String geocode : toRefresh) { final Geocache cache = DataStore.loadCache(geocode, LoadFlags.LOAD_WAYPOINTS); if (cache != null) { caches.remove(cache); caches.add(cache); } } displayExecutor.execute(new DisplayRunnable(CGeoMap.this)); } }); } }</code><technical_language>copy paste? CacheDetailActivity</technical_language>

Target:
public void onResume() { super.onResume(); PermissionHandler.executeIfLocationPermissionGranted(this.activity, new PermissionGrantedCallback(PermissionRequestContext.CacheDetailActivity) { @Override public void execute() { Log.d("CGeoMap.OnResumePermissionGrantedCallback.execute"); final Sensors sensors = Sensors.getInstance(); sensors.setupGeoDataObservables(Settings.useGooglePlayServices(), Settings.useLowPowerMode()); sensors.setupDirectionObservable(); resumeDisposables.addAll(geoDirUpdate.start(GeoDirHandler.UPDATE_GEODIR), startTimer()); } }); final List<String> toRefresh; synchronized (dirtyCaches) { toRefresh = new ArrayList<>(dirtyCaches); dirtyCaches.clear(); } if (!toRefresh.isEmpty()) { AndroidRxUtils.refreshScheduler.scheduleDirect(new Runnable() { @Override public void run() { for (final String geocode : toRefresh) { final Geocache cache = DataStore.loadCache(geocode, LoadFlags.LOAD_WAYPOINTS); if (cache != null) { caches.remove(cache); caches.add(cache); } } displayExecutor.execute(new DisplayRunnable(CGeoMap.this)); } }); } }
Source:
<code>private TableReference getSingleTable() throws TException { Set<TableReference> lockTables = schemaMutationLockTables.getAllLockTables(); if (lockTables.size() > 1) { Set<TableReference> emptyLockTables = lockTables.stream() <START> .filter(schemaMutationLockTables::isLockTableEmpty) <END> .collect(Collectors.toSet()); if (lockTables.size() - emptyLockTables.size() > 1) { throw new IllegalStateException("Multiple schema mutation lock tables have been created.\n" + "This happens when multiple nodes have themselves as lockLeader in the configuration.\n" + "Please ensure the lockLeader is the same for each node, stop all Atlas clients using this " + "keyspace, restart your cassandra cluster and run the clean-cass-locks-state cli command.\n" + "The tables that clashed were: " + lockTables); } if (lockTables.size() == emptyLockTables.size()) { emptyLockTables.remove(emptyLockTables.iterator().next()); } for (TableReference emptyLockTable : emptyLockTables) { schemaMutationLockTables.dropLockTable(emptyLockTable); } lockTables.removeAll(emptyLockTables); } return Iterables.getOnlyElement(lockTables); }</code><technical_language>this potentially risky? empty table, another node fill table get dropping it. in case</technical_language>

Target:
private TableReference getSingleTable() throws TException { Set<TableReference> lockTables = schemaMutationLockTables.getAllLockTables(); if (lockTables.size() > 1) { throw new IllegalStateException("Multiple schema mutation lock tables have been created.\n" + "This happens when multiple nodes have themselves as lockLeader in the configuration.\n" + "Please ensure the lockLeader is the same for each node, stop all Atlas clients using this " + "keyspace, restart your cassandra cluster and run the clean-cass-locks-state cli command.\n" + "The tables that clashed were: " + lockTables); } return Iterables.getOnlyElement(lockTables); }
Source:
<code>protected void process(PipelineReportFromDatanode pipelineReportFromDatanode) { Preconditions.checkNotNull(pipelineReportFromDatanode); Pipeline pipeline; PipelineReportsProto pipelineReport = pipelineReportFromDatanode.getReport(); for (PipelineReport report : pipelineReport.getPipelineReportList()) { PipelineID pipelineID = PipelineID .getFromProtobuf(report.getPipelineID()); try { pipeline = pipelineManager.getPipeline(pipelineID); } catch (PipelineNotFoundException e) { continue; } <START> if (processedPipelineIDs.contains(pipelineID)) { <END> continue; } if (pipeline.getFactor() == HddsProtos.ReplicationFactor.THREE && pipeline.getPipelineState() == Pipeline.PipelineState.OPEN) { currentHealthyPipelineCount++; getSafeModeMetrics().incCurrentHealthyPipelinesCount(); } processedPipelineIDs.add(pipelineID); } if (scmInSafeMode()) { SCMSafeModeManager.getLogger().info( "SCM in safe mode. Healthy pipelines reported count is {}, " + "required healthy pipeline reported count is {}", currentHealthyPipelineCount, healthyPipelineThresholdCount); } }</code><technical_language>move this check</technical_language>

Target:
protected void process(PipelineReportFromDatanode pipelineReportFromDatanode) { Preconditions.checkNotNull(pipelineReportFromDatanode); Pipeline pipeline; PipelineReportsProto pipelineReport = pipelineReportFromDatanode.getReport(); for (PipelineReport report : pipelineReport.getPipelineReportList()) { PipelineID pipelineID = PipelineID .getFromProtobuf(report.getPipelineID()); if (processedPipelineIDs.contains(pipelineID)) { continue; } try { pipeline = pipelineManager.getPipeline(pipelineID); } catch (PipelineNotFoundException e) { continue; } if (pipeline.getFactor() == HddsProtos.ReplicationFactor.THREE && pipeline.getPipelineState() == Pipeline.PipelineState.OPEN) { currentHealthyPipelineCount++; getSafeModeMetrics().incCurrentHealthyPipelinesCount(); } processedPipelineIDs.add(pipelineID); } if (scmInSafeMode()) { SCMSafeModeManager.getLogger().info( "SCM in safe mode. Healthy pipelines reported count is {}, " + "required healthy pipeline reported count is {}", currentHealthyPipelineCount, healthyPipelineThresholdCount); } }
Source:
<code>private synchronized void flushWrittenBytesToServiceInternal(final long offset, final boolean retainUncommitedData, final boolean isClose) throws IOException { <START> try (AbfsPerfInfo tracker = new AbfsPerfInfo(client.getAbfsPerfTracker(), "flushWrittenBytesToServiceInternal", "flush")) { <END> tracker.registerResult(client.flush(path, offset, retainUncommitedData, isClose).getResult()).registerSuccess(true); } catch (AzureBlobFileSystemException ex) { if (ex instanceof AbfsRestOperationException) { if (((AbfsRestOperationException) ex).getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { throw new FileNotFoundException(ex.getMessage()); } } throw new IOException(ex); } this.lastFlushOffset = offset; }</code><technical_language>80 chars extract</technical_language>

Target:
private synchronized void flushWrittenBytesToServiceInternal(final long offset, final boolean retainUncommitedData, final boolean isClose) throws IOException { AbfsPerfTracker tracker = client.getAbfsPerfTracker(); try (AbfsPerfInfo perfInfo = new AbfsPerfInfo(tracker, "flushWrittenBytesToServiceInternal", "flush")) { AbfsRestOperation op = client.flush(path, offset, retainUncommitedData, isClose); perfInfo.registerResult(op.getResult()).registerSuccess(true); } catch (AzureBlobFileSystemException ex) { if (ex instanceof AbfsRestOperationException) { if (((AbfsRestOperationException) ex).getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { throw new FileNotFoundException(ex.getMessage()); } } throw new IOException(ex); } this.lastFlushOffset = offset; }
Source:
<code>public boolean updateBlobMetadata(BlobId blobId, String fieldName, Object value) throws BlobStorageException { Objects.requireNonNull(blobId, "BlobId cannot be null"); Objects.requireNonNull(fieldName, "Field name cannot be null"); try { BlockBlobClient blobClient = getBlockBlobClient(blobId, false); Timer.Context storageTimer = azureMetrics.blobUpdateTime.time(); try { BlobProperties blobProperties = blobClient.getProperties(); if (blobProperties == null) { logger.debug("Blob not found.", blobId); return false; } String etag = blobProperties.getETag(); Map<String, String> metadata = blobProperties.getMetadata(); String textValue = String.valueOf(value); if (!textValue.equals(metadata.get(fieldName))) { metadata.put(fieldName, textValue); if (updateCallback != null) { try { updateCallback.call(); <START> } catch (Exception ex) { <END> } } BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setIfMatch(etag); blobClient.setMetadataWithResponse(metadata, blobRequestConditions, null, Context.NONE); } return true; } finally { storageTimer.stop(); } } catch (BlobStorageException e) { if (isNotFoundError(e.getErrorCode())) { return false; } if (e.getErrorCode() == BlobErrorCode.CONDITION_NOT_MET) { azureMetrics.blobUpdateConflictCount.inc(); } throw e; } }</code><technical_language>log exception</technical_language>

Target:
public boolean updateBlobMetadata(BlobId blobId, String fieldName, Object value) throws BlobStorageException { Objects.requireNonNull(blobId, "BlobId cannot be null"); Objects.requireNonNull(fieldName, "Field name cannot be null"); try { BlockBlobClient blobClient = getBlockBlobClient(blobId, false); Timer.Context storageTimer = azureMetrics.blobUpdateTime.time(); try { BlobProperties blobProperties = blobClient.getProperties(); if (blobProperties == null) { logger.debug("Blob not found.", blobId); return false; } String etag = blobProperties.getETag(); Map<String, String> metadata = blobProperties.getMetadata(); String textValue = String.valueOf(value); if (!textValue.equals(metadata.get(fieldName))) { metadata.put(fieldName, textValue); if (updateCallback != null) { try { updateCallback.call(); } catch (Exception ex) { logger.error("Error in update callback", ex); } } BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setIfMatch(etag); blobClient.setMetadataWithResponse(metadata, blobRequestConditions, null, Context.NONE); } return true; } finally { storageTimer.stop(); } } catch (BlobStorageException e) { if (isNotFoundError(e.getErrorCode())) { return false; } if (e.getErrorCode() == BlobErrorCode.CONDITION_NOT_MET) { azureMetrics.blobUpdateConflictCount.inc(); } throw e; } }
Source:
<code>private int getCacheDuration(){ <START> String duration = System.getProperty(SYSTEM_PROPERTY_CACHE_DURATION, "300"); <END> try { return Integer.parseInt(duration); } catch(NumberFormatException e) { String message = String.format("cannot parse system property: %s with value=%s, using default instead." , SYSTEM_PROPERTY_CACHE_DURATION , duration); LOG.warn(message, e); } return 300; }</code><technical_language>Integer.getInteger retrieve integer sys prop</technical_language>

Target:
private int getCacheDuration(){ return Integer.getInteger(SYSTEM_PROPERTY_CACHE_DURATION, 300); }
Source:
<code>public boolean hasLicenseInfo() { <START> return !(license.equals("") && licenseShortName.equals("") & licenseUrl.equals("")); <END> }</code><technical_language>I want logical AND, double ampersands. !license.isEmpty && !licenseShortName.isEmpty && !licenseUrl.isEmpty() instead</technical_language>

Target:
public boolean hasLicenseInfo() { return !license.isEmpty() && !licenseShortName.isEmpty() && !licenseUrl.isEmpty(); }
Source:
<code>public Response updateRolesForScope(ScopeListDTO body, MessageContext messageContext) throws APIManagementException { String tenantDomain = MultitenantUtils.getTenantDomain(RestApiUtil.getLoggedInUsername()); JsonObject existingTenantConfObject = new JsonObject(); try { APIMRegistryService apimRegistryService = new APIMRegistryServiceImpl(); String existingTenantConf = apimRegistryService.getConfigRegistryResourceContent(tenantDomain, APIConstants.API_TENANT_CONF_LOCATION); existingTenantConfObject = new JsonParser().parse(existingTenantConf).getAsJsonObject(); } catch (RegistryException | UserStoreException e) { APIUtil.handleException("Couldn't read tenant configuration from tenant registry", e); } try { <START> <END> JSONObject responseJson = new JSONObject(); JSONArray scopeJson = new JSONArray(); for(int i = 0; i < body.getList().size(); i++) { JSONObject scopeRoleJson = new JSONObject(); scopeRoleJson.put("Name", body.getList().get(i).getName()); scopeRoleJson.put("Roles", body.getList().get(i).getRoles()); scopeJson.put(scopeRoleJson); } responseJson.put("Scope", scopeJson); existingTenantConfObject.remove("RESTAPIScopes"); Gson gson = new Gson(); existingTenantConfObject.add("RESTAPIScopes", gson.fromJson(responseJson.toString(), JsonElement.class)); APIUtil.updateTenantConf(existingTenantConfObject.toString(),tenantDomain); Map<String, String> scopeRoleMapping = APIUtil.getRESTAPIScopesForTenant(MultitenantUtils .getTenantDomain(RestApiUtil.getLoggedInUsername())); ScopeListDTO scopeListDTO = SystemScopesMappingUtil.fromScopeListToScopeListDTO(scopeRoleMapping); return Response.ok().entity(scopeListDTO).build(); } catch (APIManagementException e) { String errorMessage = "Error when updating the list of scopes-role mapping."; RestApiUtil.handleInternalServerError(errorMessage, e, log); } return null; }</code><technical_language>Remove additional line</technical_language>

Target:
public Response updateRolesForScope(ScopeListDTO body, MessageContext messageContext) throws APIManagementException { JSONObject newScopeRoleJson = SystemScopesMappingUtil.createJsonObjectOfScopeMapping(body); APIUtil.updateTenantConfOfRoleScopeMapping(newScopeRoleJson, RestApiUtil.getLoggedInUsername()); Map<String, String> scopeRoleMapping = APIUtil.getRESTAPIScopesForTenant(MultitenantUtils .getTenantDomain(RestApiUtil.getLoggedInUsername())); ScopeListDTO scopeListDTO = SystemScopesMappingUtil.fromScopeListToScopeListDTO(scopeRoleMapping); return Response.ok().entity(scopeListDTO).build(); }
Source:
<code>Bitmap quickMemoryCacheCheck(String key) { Bitmap cached = cache.get(key); if (cached != null) { stats.dispatchCacheHit(); } else { <START> stats.dispatchCacheMiss(); <END> } return cached; }</code><technical_language>need change method names more descriptive</technical_language>

Target:
Bitmap quickMemoryCacheCheck(String key) { Bitmap cached = cache.get(key); if (cached != null) { stats.dispatchCacheHit(); } return cached; }
Source:
<code>void subscription() { <START> final BoundedContext boundedContext = setupBoundedContextWithProjectAggregateRepo(); <END> final SubscriptionService subscriptionService = SubscriptionService.newBuilder() .add(boundedContext) .build(); final MemoizeStreamObserver<Subscription> observer = new MemoizeStreamObserver<>(); subscriptionService.subscribe(null, observer); assertNull(observer.streamFlowValue()); assertFalse(observer.isCompleted()); assertNotNull(observer.throwable()); assertInstanceOf(NullPointerException.class, observer.throwable()); }</code><technical_language>I finals here. remove those</technical_language>

Target:
void subscription() { BoundedContext boundedContext = setupBoundedContextWithProjectAggregateRepo(); SubscriptionService subscriptionService = SubscriptionService.newBuilder() .add(boundedContext) .build(); MemoizeStreamObserver<Subscription> observer = new MemoizeStreamObserver<>(); subscriptionService.subscribe(null, observer); assertNull(observer.streamFlowValue()); assertFalse(observer.isCompleted()); assertNotNull(observer.throwable()); assertInstanceOf(NullPointerException.class, observer.throwable()); }
Source:
<code>void createWereBetweenPredicate() { <START> final Command command1 = requestFactory.createCommand(StringValue.getDefaultInstance(), <END> minutesAgo(5)); final Command command2 = requestFactory.createCommand(Int64Value.getDefaultInstance(), minutesAgo(2)); final Command command3 = requestFactory.createCommand(BoolValue.getDefaultInstance(), secondsAgo(30)); final Command command4 = requestFactory.createCommand(BoolValue.getDefaultInstance(), secondsAgo(20)); final Command command5 = requestFactory.createCommand(BoolValue.getDefaultInstance(), secondsAgo(5)); final ImmutableList<Command> commands = ImmutableList.of(command1, command2, command3, command4, command5); final Iterable<Command> filter = Iterables.filter( commands, Commands.wereWithinPeriod(minutesAgo(3), secondsAgo(10)) ); assertEquals(3, FluentIterable.from(filter) .size()); }</code><technical_language>this moment rename local declarations fiveMinsAgo, twoMinsAgo etc</technical_language>

Target:
void createWereBetweenPredicate() { final Command fiveMinsAgo = requestFactory.createCommand(StringValue.getDefaultInstance(), minutesAgo(5)); final Command twoMinsAgo = requestFactory.createCommand(Int64Value.getDefaultInstance(), minutesAgo(2)); final Command thirtySecondsAgo = requestFactory.createCommand(BoolValue.getDefaultInstance(), secondsAgo(30)); final Command twentySecondsAgo = requestFactory.createCommand(BoolValue.getDefaultInstance(), secondsAgo(20)); final Command fiveSecondsAgo = requestFactory.createCommand(BoolValue.getDefaultInstance(), secondsAgo(5)); final ImmutableList<Command> commands = ImmutableList.of(fiveMinsAgo, twoMinsAgo, thirtySecondsAgo, twentySecondsAgo, fiveSecondsAgo); final Iterable<Command> filter = Iterables.filter( commands, Commands.wereWithinPeriod(minutesAgo(3), secondsAgo(10)) ); assertEquals(3, FluentIterable.from(filter) .size()); }
Source:
<code>public void testOrderingPostProcessors() throws IOException { final Resource left = input.getLeft(); final Resource right = input.getRight(); final IComparisonScope scope = EMFCompare.createDefaultScope(left, right); PostProcessorDescriptorRegistryImpl registry = new PostProcessorDescriptorRegistryImpl(); registry.put(TestPostProcessor1.class.getName(), new TestPostProcessorDescriptor(Pattern.compile(""), null, new TestPostProcessor1(), 1)); registry.put(TestPostProcessor2.class.getName(), new TestPostProcessorDescriptor(Pattern .compile("<LINK_0>"), null, new TestPostProcessor2(), 10)); registry.put(TestPostProcessor3.class.getName(), new TestPostProcessorDescriptor(Pattern .compile("<LINK_0>"), null, new TestPostProcessor3(), 9)); registry.put(TestPostProcessor4.class.getName(), new TestPostProcessorDescriptor(Pattern .compile("<LINK_0>"), null, new TestPostProcessor4(), 11)); EMFCompare.builder().setPostProcessorRegistry(registry).build().compare(scope); List<IPostProcessor> postProcessors = registry.getPostProcessors(scope); assertTrue(postProcessors.get(0) instanceof TestPostProcessor3); assertTrue(postProcessors.get(1) instanceof TestPostProcessor2); <START> assertTrue(postProcessors.get(2) instanceof TestPostProcessor4); <END> }</code><technical_language>wish more post-processors present in list: assertEquals(3, postProcessors.size());</technical_language>

Target:
public void testOrderingPostProcessors() throws IOException { final Resource left = input.getLeft(); final Resource right = input.getRight(); final IComparisonScope scope = EMFCompare.createDefaultScope(left, right); PostProcessorDescriptorRegistryImpl registry = new PostProcessorDescriptorRegistryImpl(); registry.put(TestPostProcessor1.class.getName(), new TestPostProcessorDescriptor(Pattern.compile(""), null, new TestPostProcessor1(), 1)); registry.put(TestPostProcessor2.class.getName(), new TestPostProcessorDescriptor(Pattern .compile("<LINK_0>"), null, new TestPostProcessor2(), 10)); registry.put(TestPostProcessor3.class.getName(), new TestPostProcessorDescriptor(Pattern .compile("<LINK_0>"), null, new TestPostProcessor3(), 9)); registry.put(TestPostProcessor4.class.getName(), new TestPostProcessorDescriptor(Pattern .compile("<LINK_0>"), null, new TestPostProcessor4(), 11)); EMFCompare.builder().setPostProcessorRegistry(registry).build().compare(scope); List<IPostProcessor> postProcessors = registry.getPostProcessors(scope); assertEquals(3, postProcessors.size()); assertTrue(postProcessors.get(0) instanceof TestPostProcessor3); assertTrue(postProcessors.get(1) instanceof TestPostProcessor2); assertTrue(postProcessors.get(2) instanceof TestPostProcessor4); }
Source:
<code>public void init() throws Exception { StreamConfig configuration = getConfiguration(); ClassLoader userClassLoader = getUserCodeClassLoader(); StreamConfig.Input[] inputs = configuration.getInputs(userClassLoader); ArrayList<IndexedInputGate>[] inputLists = new ArrayList[ <START> (int) Arrays.stream(inputs) .filter(input -> (input instanceof StreamConfig.NetworkInput)) .count()]; <END> WatermarkGauge[] watermarkGauges = new WatermarkGauge[inputs.length]; for (int i = 0; i < inputLists.length; i++) { inputLists[i] = new ArrayList<>(); } for (int i = 0; i < inputs.length; i++) { watermarkGauges[i] = new WatermarkGauge(); mainOperator.getMetricGroup().gauge(MetricNames.currentInputWatermarkName(i + 1), watermarkGauges[i]); } MinWatermarkGauge minInputWatermarkGauge = new MinWatermarkGauge(watermarkGauges); mainOperator.getMetricGroup().gauge(MetricNames.IO_CURRENT_INPUT_WATERMARK, minInputWatermarkGauge); List<StreamEdge> inEdges = configuration.getInPhysicalEdges(userClassLoader); int numberOfInputs = configuration.getNumberOfNetworkInputs(); for (int i = 0; i < numberOfInputs; i++) { int inputType = inEdges.get(i).getTypeNumber(); IndexedInputGate reader = getEnvironment().getInputGate(i); inputLists[inputType - 1].add(reader); } createInputProcessor(inputLists, inputs, watermarkGauges); getEnvironment().getMetricGroup().gauge(MetricNames.IO_CURRENT_INPUT_WATERMARK, minInputWatermarkGauge::getValue); }</code><technical_language>configuration.getNumberOfNetworkInputs below</technical_language>

Target:
public void init() throws Exception { StreamConfig configuration = getConfiguration(); ClassLoader userClassLoader = getUserCodeClassLoader(); InputConfig[] inputs = configuration.getInputs(userClassLoader); ArrayList[] inputLists = new ArrayList[configuration.getNumberOfNetworkInputs()]; WatermarkGauge[] watermarkGauges = new WatermarkGauge[inputs.length]; for (int i = 0; i < inputLists.length; i++) { inputLists[i] = new ArrayList<>(); } for (int i = 0; i < inputs.length; i++) { watermarkGauges[i] = new WatermarkGauge(); mainOperator.getMetricGroup().gauge(MetricNames.currentInputWatermarkName(i + 1), watermarkGauges[i]); } MinWatermarkGauge minInputWatermarkGauge = new MinWatermarkGauge(watermarkGauges); mainOperator.getMetricGroup().gauge(MetricNames.IO_CURRENT_INPUT_WATERMARK, minInputWatermarkGauge); List<StreamEdge> inEdges = configuration.getInPhysicalEdges(userClassLoader); int numberOfInputs = configuration.getNumberOfNetworkInputs(); for (int i = 0; i < numberOfInputs; i++) { int inputType = inEdges.get(i).getTypeNumber(); IndexedInputGate reader = getEnvironment().getInputGate(i); inputLists[inputType - 1].add(reader); } createInputProcessor(inputLists, inputs, watermarkGauges); getEnvironment().getMetricGroup().gauge(MetricNames.IO_CURRENT_INPUT_WATERMARK, minInputWatermarkGauge::getValue); }
Source:
<code>public void setResponseData(String data) { <START> if(data!=null && !data.equals("") && <END> responseContentType!= null && responseContentType.toLowerCase().indexOf("application/json")!=-1){ try{ JSONObject responseJSON = new JSONObject(data); this.responseData = responseJSON.toString(); }catch(Exception e){ e.printStackTrace(); } }else { this.responseData = data; } }</code><technical_language>reformat response data.. this retain database value</technical_language>

Target:
public void setResponseData(String data) { this.responseData = data; }
Source:
<code>public IndexedInts getRow() { final IndexedInts row = selector.getRow(); if (row.size() == 1) { if (nullAdjustment == 0) { return row; } else { return new SingleIndexedInt(row.get(0) + nullAdjustment); } } else { <START> return new SingleIndexedInt(0); <END> } }</code><technical_language>cached, SingleIndexedInt.of() cache 0-127 :)</technical_language>

Target:
public IndexedInts getRow() { final IndexedInts row = selector.getRow(); if (row.size() == 1) { if (nullAdjustment == 0) { return row; } else { return SingleIndexedInt.of(row.get(0) + nullAdjustment); } } else { return SingleIndexedInt.of(0); } }
Source:
<code>public ShiroPasswordEncoder(final PasswordService delegate) { <START> this.delegate = delegate; <END> }</code><technical_language>add a CommonHelper.assertNotNull("delegate", delegate); check</technical_language>

Target:
public ShiroPasswordEncoder(final PasswordService delegate) { CommonHelper.assertNotNull("delegate", delegate); this.delegate = delegate; }
Source:
<code>private Map<String, ResourceAssignment> calculateAssignment( ResourceControllerDataProvider clusterData, Map<HelixConstants.ChangeType, Set<String>> clusterChanges, Map<String, Resource> resourceMap, Set<String> activeNodes, Map<String, ResourceAssignment> baseline, Map<String, ResourceAssignment> prevBestPossibleAssignment) throws HelixRebalanceException { long startTime = System.currentTimeMillis(); LOG.info("Start calculating for an assignment"); ClusterModel clusterModel; try { clusterModel = ClusterModelProvider.generateClusterModel(clusterData, resourceMap, activeNodes, clusterChanges, baseline, prevBestPossibleAssignment); } catch (Exception ex) { throw new HelixRebalanceException("Failed to generate cluster model.", HelixRebalanceException.Type.INVALID_CLUSTER_STATUS, ex); } OptimalAssignment optimalAssignment = _rebalanceAlgorithm.calculate(clusterModel); Map<String, ResourceAssignment> newAssignment = optimalAssignment.getOptimalResourceAssignment(); <START> LOG.info("Finish calculateAssignment(). Took: ms.", System.currentTimeMillis() - startTime); <END> return newAssignment; }</code><technical_language>"Finish calculating assignment." Usually, pasting code details in log. Consider if change method name in future</technical_language>

Target:
private Map<String, ResourceAssignment> calculateAssignment( ResourceControllerDataProvider clusterData, Map<HelixConstants.ChangeType, Set<String>> clusterChanges, Map<String, Resource> resourceMap, Set<String> activeNodes, Map<String, ResourceAssignment> baseline, Map<String, ResourceAssignment> prevBestPossibleAssignment) throws HelixRebalanceException { long startTime = System.currentTimeMillis(); LOG.info("Start calculating for an assignment"); ClusterModel clusterModel; try { clusterModel = ClusterModelProvider.generateClusterModel(clusterData, resourceMap, activeNodes, clusterChanges, baseline, prevBestPossibleAssignment); } catch (Exception ex) { throw new HelixRebalanceException("Failed to generate cluster model.", HelixRebalanceException.Type.INVALID_CLUSTER_STATUS, ex); } OptimalAssignment optimalAssignment = _rebalanceAlgorithm.calculate(clusterModel); Map<String, ResourceAssignment> newAssignment = optimalAssignment.getOptimalResourceAssignment(); LOG.info("Finish calculating an assignment. Took: ms.", System.currentTimeMillis() - startTime); return newAssignment; }
Source:
<code>private void addMonitors(AbstractMonitors monitors, Timeline timeline) { monitors.addMonitor(new CpuUsageMonitor(jmxConnectionProvider, timeline)); monitors.addMonitor(new MemoryUsageMonitor(jmxConnectionProvider, timeline)); monitors.addMonitor(new GcMonitor(jmxConnectionProvider, timeline)); monitors.addMonitor(new OpenFilesMonitor(jmxConnectionProvider, timeline)); <START> monitors.addMonitor(new RssMonitor(timeline)); <END> if (interfaceName != null) { monitors.addMonitor(NetworkBytesMonitor.createReceiveMonitor(interfaceName, timeline)); monitors.addMonitor(NetworkBytesMonitor.createTransmitMonitor(interfaceName, timeline)); } }</code><technical_language>add a platform check creating monitor. RadarGun run Windows yet, in plans</technical_language>

Target:
private void addMonitors(AbstractMonitors monitors, Timeline timeline) { monitors.addMonitor(new CpuUsageMonitor(jmxConnectionProvider, timeline)); monitors.addMonitor(new MemoryUsageMonitor(jmxConnectionProvider, timeline)); monitors.addMonitor(new GcMonitor(jmxConnectionProvider, timeline)); monitors.addMonitor(new OpenFilesMonitor(jmxConnectionProvider, timeline)); if (SystemUtils.IS_LINUX) { monitors.addMonitor(new RssMonitor(timeline)); } if (interfaceName != null) { monitors.addMonitor(NetworkBytesMonitor.createReceiveMonitor(interfaceName, timeline)); monitors.addMonitor(NetworkBytesMonitor.createTransmitMonitor(interfaceName, timeline)); } }
Source:
<code>public void initClusterConnection() { try { <START> connect(); <END> } catch (ConnectionException ex) { LOGGER.error("Creation connection failed due to", ex); throw new RuntimeException(ex); } }</code><technical_language>"Initial connection"</technical_language>

Target:
public void initClusterConnection() { try { connect(); } catch (ConnectionException ex) { LOGGER.error("Initial connection failed due to", ex); throw new RuntimeException(ex); } }