auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private LinkedList<MaxwellAbstractRowsEvent> getTransactionEvents() throws Exception { BinlogEventV4 v4Event; MaxwellAbstractRowsEvent event; LinkedList<MaxwellAbstractRowsEvent> list = new LinkedList<>(); while ( true ) { v4Event = queue.poll(100, TimeUnit.MILLISECONDS); if (v4Event == null) continue; switch(v4Event.getHeader().getEventType()) { case MySQLConstants.WRITE_ROWS_EVENT: case MySQLConstants.WRITE_ROWS_EVENT_V2: case MySQLConstants.UPDATE_ROWS_EVENT: case MySQLConstants.UPDATE_ROWS_EVENT_V2: case MySQLConstants.DELETE_ROWS_EVENT: case MySQLConstants.DELETE_ROWS_EVENT_V2: rowEventsProcessed++; event = processRowsEvent((AbstractRowEvent) v4Event); if ( event.matchesFilter() ) list.add(event); break; case MySQLConstants.TABLE_MAP_EVENT: tableCache.processEvent(this.schema, (TableMapEvent) v4Event); break; case MySQLConstants.QUERY_EVENT: QueryEvent qe = (QueryEvent) v4Event; throw new RuntimeException("Unhandled QueryEvent: " + qe); case MySQLConstants.XID_EVENT: XidEvent xe = (XidEvent) v4Event; for ( MaxwellAbstractRowsEvent e : list ) e.setXid(xe.getXid()); if ( !list.isEmpty() ) <START> list.getLast().setCommit(true); <END> return list; } } }</code><technical_language>return list of events in a transaction accumulating completely, right</technical_language>

Target:
private LinkedList<MaxwellAbstractRowsEvent> getTransactionEvents() throws Exception { BinlogEventV4 v4Event; MaxwellAbstractRowsEvent event; LinkedList<MaxwellAbstractRowsEvent> list = new LinkedList<>(); while ( true ) { v4Event = queue.poll(100, TimeUnit.MILLISECONDS); if (v4Event == null) continue; switch(v4Event.getHeader().getEventType()) { case MySQLConstants.WRITE_ROWS_EVENT: case MySQLConstants.WRITE_ROWS_EVENT_V2: case MySQLConstants.UPDATE_ROWS_EVENT: case MySQLConstants.UPDATE_ROWS_EVENT_V2: case MySQLConstants.DELETE_ROWS_EVENT: case MySQLConstants.DELETE_ROWS_EVENT_V2: rowEventsProcessed++; event = processRowsEvent((AbstractRowEvent) v4Event); if ( event.matchesFilter() ) list.add(event); break; case MySQLConstants.TABLE_MAP_EVENT: tableCache.processEvent(this.schema, (TableMapEvent) v4Event); break; case MySQLConstants.QUERY_EVENT: QueryEvent qe = (QueryEvent) v4Event; throw new RuntimeException("Unhandled QueryEvent: " + qe); case MySQLConstants.XID_EVENT: XidEvent xe = (XidEvent) v4Event; for ( MaxwellAbstractRowsEvent e : list ) e.setXid(xe.getXid()); if ( !list.isEmpty() ) list.getLast().setTXCommit(); return list; } } }
Source:
<code>public void testGetStorageQuotas() throws ExecutionException, InterruptedException { <START> VolumeQuota volumeQuota = quotaApi.getByTenant("non"); <END> assertNotNull(volumeQuota.getGigabytes()); assertNotNull(volumeQuota.getVolumes()); assertNotNull(volumeQuota.getSnapshots()); }</code><technical_language>"non" here? of default DevStack users "demo"</technical_language>

Target:
public void testGetStorageQuotas() throws ExecutionException, InterruptedException { VolumeQuota volumeQuota = quotaApi.getByTenant("demo"); assertTrue(volumeQuota.getGigabytes() >= 0); assertTrue(volumeQuota.getVolumes() >= 0); assertTrue(volumeQuota.getSnapshots() >= 0); }
Source:
<code>protected boolean doProcess(Record record) { Timer.Context timerContext = elapsedTime.time(); try { XContentBuilder documentBuilder = jsonBuilder().startObject(); Map<String, Collection<Object>> map = record.getFields().asMap(); for (Map.Entry<String, Collection<Object>> entry : map.entrySet()) { String key = entry.getKey(); Iterator<Object> iterator = entry.getValue().iterator(); while (iterator.hasNext()) { documentBuilder.field(key, iterator.next()); } } documentBuilder.endObject(); loader.addDocument(documentBuilder.bytes(), indexName, indexType, ttl); } catch (Exception e) { <START> LOGGER.warn(null); <END> throw new MorphlineRuntimeException(e); } finally { timerContext.stop(); } return super.doProcess(record); }</code><technical_language>Is a msg</technical_language>

Target:
protected boolean doProcess(Record record) { Timer.Context timerContext = elapsedTime.time(); try { XContentBuilder documentBuilder = jsonBuilder().startObject(); Map<String, Collection<Object>> map = record.getFields().asMap(); for (Map.Entry<String, Collection<Object>> entry : map.entrySet()) { String key = entry.getKey(); Iterator<Object> iterator = entry.getValue().iterator(); while (iterator.hasNext()) { documentBuilder.field(key, iterator.next()); } } documentBuilder.endObject(); loader.addDocument(documentBuilder.bytes(), indexName, indexType, ttl); } catch (Exception e) { throw new MorphlineRuntimeException(e); } finally { timerContext.stop(); } return super.doProcess(record); }
Source:
<code>public void testJoinerTransactionSurvives() throws Exception { Cache<Object, Object> c0 = manager(0).getCache(); Cache<Object, Object> c1 = manager(1).getCache(); TransactionTable tt0 = TestingUtil.extractComponent(c0, TransactionTable.class); LocalTopologyManager ltm0 = TestingUtil.extractGlobalComponent(manager(0), LocalTopologyManager.class); ltm0.setRebalancingEnabled(false); addClusterEnabledCacheManager(configurationBuilder); Cache<Object, Object> c2 = manager(2).getCache(); tm(2).begin(); c2.put("key1", "value1"); assertEquals(1, tt0.getRemoteGlobalTransaction().size()); Transaction tx2 = tm(2).suspend(); tm(1).begin(); c1.put("key2", "value2"); assertEquals(2, tt0.getRemoteGlobalTransaction().size()); Transaction tx1 = tm(1).suspend(); manager(1).stop(); TestingUtil.blockUntilViewsReceived(60000, false, c0, c2); TestingUtil.waitForRehashToComplete(c0); assertEquals(Arrays.asList(address(0)), c0.getAdvancedCache().getDistributionManager().getConsistentHash().getMembers()); <START> assertEquals(1, tt0.getRemoteGlobalTransaction().size()); <END> tm(2).resume(tx2); tm(2).commit(); }</code><technical_language>this fail intermittently if async transaction cleanup is ran this invoked</technical_language>

Target:
public void testJoinerTransactionSurvives() throws Exception { Cache<Object, Object> c0 = manager(0).getCache(); Cache<Object, Object> c1 = manager(1).getCache(); final TransactionTable tt0 = TestingUtil.extractComponent(c0, TransactionTable.class); LocalTopologyManager ltm0 = TestingUtil.extractGlobalComponent(manager(0), LocalTopologyManager.class); ltm0.setRebalancingEnabled(false); addClusterEnabledCacheManager(configurationBuilder); Cache<Object, Object> c2 = manager(2).getCache(); tm(2).begin(); c2.put("key1", "value1"); assertEquals(1, tt0.getRemoteGlobalTransaction().size()); Transaction tx2 = tm(2).suspend(); tm(1).begin(); c1.put("key2", "value2"); assertEquals(2, tt0.getRemoteGlobalTransaction().size()); Transaction tx1 = tm(1).suspend(); manager(1).stop(); TestingUtil.blockUntilViewsReceived(60000, false, c0, c2); TestingUtil.waitForRehashToComplete(c0); assertEquals(Arrays.asList(address(0)), c0.getAdvancedCache().getDistributionManager().getConsistentHash().getMembers()); eventually(new Condition() { @Override public boolean isSatisfied() throws Exception { return tt0.getRemoteTransactions().size() == 1; } }); tm(2).resume(tx2); tm(2).commit(); }
Source:
<code>public Release latest() throws IOException { <START> Release latestRelease = null; <END> final Iterator<Release> itRelease = this.iterate().iterator(); while (itRelease.hasNext()) { final Release release = itRelease.next(); if (latestRelease == null) { latestRelease = release; } else if (this.createLatest(latestRelease, release)) { latestRelease = release; } } return latestRelease; }</code><technical_language>@weisebrazil variables case non-compound, release name</technical_language>

Target:
public Release latest() throws IOException { Release latest = null; for (final Release release: this.iterate()) { if (latest == null) { latest = release; } else if (this.isNewer(latest, release)) { latest = release; } } return latest; }
Source:
<code>public void of(RecordCursor base, SqlExecutionContext executionContext) { this.base = base; this.baseRecord = base.getRecord(); final Record placeHolderRecord = base.getRecordB(); chain.clear(); while (base.hasNext()) { <START> executionContext.getSqlExecutionInterruptor().checkInterrupted(); <END> chain.put( baseRecord, base, placeHolderRecord, comparator ); } chainCursor.toTop(); }</code><technical_language>lets cache interruptor instance. If JIT leaves double de-reference loop - bad</technical_language>

Target:
public void of(RecordCursor base, SqlExecutionContext executionContext) { this.base = base; this.baseRecord = base.getRecord(); final Record placeHolderRecord = base.getRecordB(); SqlExecutionInterruptor interruptor = executionContext.getSqlExecutionInterruptor(); chain.clear(); while (base.hasNext()) { interruptor.checkInterrupted(); chain.put( baseRecord, base, placeHolderRecord, comparator ); } chainCursor.toTop(); }
Source:
<code>public void _init() { final boolean isSc = model.getServerType() == WizardModel.ServerType.SONARCLOUD; final String sqOrSc = isSc ? "SonarCloud" : "SonarQube"; notificationsCheckBox.setText("Receive notifications from " + sqOrSc); notificationsCheckBox.setVisible(model.isNotificationsSupported()); <START> notificationsCheckBox.setEnabled(model.isNotificationsSupported()); <END> notificationsCheckBox.setSelected(!model.isNotificationsDisabled()); final String docUrl = isSc ? "<LINK_1>" : "<LINK_0>"; notificationsDetails.setText("You will receive <a href=\"" + docUrl + "\">notifications</a> from " + sqOrSc + " in situations like:\n" + "<ul>" + "<li>the Quality Gate status of a bound project changes</li>" + "<li>the latest analysis of a bound project on " + sqOrSc + " raises new issues assigned to you</li>" + "</ul>"); notificationsDetails.addHyperlinkListener(new BrowserHyperlinkListener()); notificationsDetails.setVisible(model.isNotificationsSupported()); }</code><technical_language>if check box is visible I guess need disable it. this line removed</technical_language>

Target:
public void _init() { final boolean isSc = model.getServerType() == WizardModel.ServerType.SONARCLOUD; final String sqOrSc = isSc ? "SonarCloud" : "SonarQube"; notificationsCheckBox.setText("Receive notifications from " + sqOrSc); notificationsCheckBox.setSelected(!model.isNotificationsDisabled()); final String docUrl = isSc ? "<LINK_1>" : "<LINK_0>"; notificationsDetails.setText("You will receive <a href=\"" + docUrl + "\">notifications</a> from " + sqOrSc + " in situations like:\n" + "<ul>" + "<li>the Quality Gate status of a bound project changes</li>" + "<li>the latest analysis of a bound project on " + sqOrSc + " raises new issues assigned to you</li>" + "</ul>"); notificationsDetails.addHyperlinkListener(new BrowserHyperlinkListener()); }
Source:
<code>public void setStatus(String status) { <START> this.status = GlusterHookStatus.valueOf(status); <END> }</code><technical_language>this require a null check similar setcontentType()</technical_language>

Target:
public void setStatus(String status) { if (status != null) { this.status = GlusterHookStatus.valueOf(status); } else { this.status = null; } }
Source:
<code>public boolean visit(final DhcpEntryRules dhcp) throws ResourceUnavailableException { final VirtualRouter router = dhcp.getRouter(); final Commands commands = new Commands(Command.OnError.Stop); final NicVO nicVo = dhcp.getNicVo(); final UserVmVO userVM = dhcp.getUserVM(); final DeployDestination destination = dhcp.getDestination(); final boolean remove = dhcp.isRemove(); <START> if (destination != null && router.getPodIdToDeployIn().longValue() == destination.getPod().getId()) { <END> _commandSetupHelper.createDhcpEntryCommand(router, userVM, nicVo, remove, commands); return _networkGeneralHelper.sendCommandsToRouter(router, commands); } return true; }</code><technical_language>more defensive add router != null && router.getPodIdToDeployIn() != null. In general defensive is safer I think</technical_language>

Target:
public boolean visit(final DhcpEntryRules dhcp) throws ResourceUnavailableException { final VirtualRouter router = dhcp.getRouter(); final Commands commands = new Commands(Command.OnError.Stop); final NicVO nicVo = dhcp.getNicVo(); final UserVmVO userVM = dhcp.getUserVM(); final DeployDestination destination = dhcp.getDestination(); final boolean remove = dhcp.isRemove(); if (router != null && (remove || (destination != null && destination.getPod() != null && router.getPodIdToDeployIn() != null && router.getPodIdToDeployIn().longValue() == destination.getPod().getId()))) { _commandSetupHelper.createDhcpEntryCommand(router, userVM, nicVo, remove, commands); return _networkGeneralHelper.sendCommandsToRouter(router, commands); } return true; }
Source:
<code>private synchronized void saveAccounts() { if (accountFile == null) return; if (!accountFile.exists()) { try { accountFile.createNewFile(); } catch (IOException e) { LOG.error( "could not create file: " + accountFile.getAbsolutePath() + " to store account data"); return; } } ByteArrayOutputStream out = new ByteArrayOutputStream(); XStream xStream = createXStream(); FileOutputStream dataOut = null; try { dataOut = new FileOutputStream(accountFile); <START> xStream.toXML(new ImmutablePair(activeAccount, accounts), out); <END> byte[] encryptedAccountData = Crypto.encrypt(out.toByteArray(), secretKey); dataOut.write(encryptedAccountData); dataOut.flush(); } catch (RuntimeException e) { LOG.error("internal error while storing account data", e); return; } catch (Exception e) { LOG.error("could not store account data", e); return; } finally { IOUtils.closeQuietly(dataOut); } LOG.debug("saved " + accounts.size() + " account(s)"); }</code><technical_language>List<XMPPAcounts> accountsToSave = new ArrayList<>(accounts) int activeAccountIdx = accountsToSave.indexOf(acivteAccount) new ImmutablePair(activeAccountIdx, accountsToSave)</technical_language>

Target:
private synchronized void saveAccounts() { if (accountFile == null) return; if (!accountFile.exists()) { try { accountFile.createNewFile(); } catch (IOException e) { LOG.error( "could not create file: " + accountFile.getAbsolutePath() + " to store account data"); return; } } ByteArrayOutputStream out = new ByteArrayOutputStream(); XStream xStream = createXStream(); FileOutputStream dataOut = null; try { dataOut = new FileOutputStream(accountFile); ArrayList<XMPPAccount> accountsToSave = new ArrayList<>(accounts); int activeAccountIndex = accountsToSave.indexOf(activeAccount); xStream.toXML(new AccountStoreInformation(activeAccountIndex, accountsToSave), out); byte[] encryptedAccountData = Crypto.encrypt(out.toByteArray(), secretKey); dataOut.write(encryptedAccountData); dataOut.flush(); } catch (RuntimeException e) { LOG.error("internal error while storing account data", e); return; } catch (Exception e) { LOG.error("could not store account data", e); return; } finally { IOUtils.closeQuietly(dataOut); } LOG.debug("saved " + accounts.size() + " account(s)"); }
Source:
<code>public Command getCommand(Request request) { if (understandsRequest(request)) { EditPart editPart = getHost(); ResetOriginChangeModelOperation operation = null; if (editPart instanceof DiagramEditPart) { operation = new ResetOriginChangeModelOperation((DiagramEditPart) editPart); } else if (editPart instanceof AbstractDiagramContainerEditPart) { AbstractDiagramContainerEditPart adcp = (AbstractDiagramContainerEditPart) editPart; if <START> (adcp.isRegionContainer()) <END> { operation = new ResetOriginChangeModelOperation((AbstractDiagramContainerEditPart) editPart); } } if (operation != null) { ICommand command = CommandFactory.createICommand(((IGraphicalEditPart) editPart).getEditingDomain(), operation); return new ICommandProxy(command); } } return super.getCommand(request); }</code><technical_language>if(!adcp.isRegionContainer())</technical_language>

Target:
public Command getCommand(Request request) { if (understandsRequest(request)) { EditPart editPart = getHost(); ResetOriginChangeModelOperation operation = null; if (editPart instanceof DiagramEditPart) { operation = new ResetOriginChangeModelOperation((DiagramEditPart) editPart); } else if (editPart instanceof AbstractDiagramContainerEditPart) { AbstractDiagramContainerEditPart adcp = (AbstractDiagramContainerEditPart) editPart; if (!adcp.isRegionContainer()) { operation = new ResetOriginChangeModelOperation((AbstractDiagramContainerEditPart) editPart); } } if (operation != null) { ICommand command = CommandFactory.createICommand(((IGraphicalEditPart) editPart).getEditingDomain(), operation); return new ICommandProxy(command); } } return super.getCommand(request); }
Source:
<code>private String getJMSSubResourcePath(String subscriptionID, String topicName) { String resourcePath = this.topicStoragePath; topicName = topicName.replaceAll("\\.", "/"); if (!topicName.startsWith("/")) { resourcePath = resourcePath + "/"; } if (topicName.contains("*")) { <START> topicName = topicName.substring(0, topicName.indexOf("*")); <END> } else if (topicName.contains("#")) { topicName = topicName.substring(0, topicName.indexOf("#")); } resourcePath = resourcePath + topicName; if (!resourcePath.endsWith("/")) { resourcePath = resourcePath + "/"; } resourcePath = resourcePath + (EventBrokerConstants.EB_CONF_JMS_SUBSCRIPTION_COLLECTION_NAME + "/" + subscriptionID); return resourcePath; }</code><technical_language>String.html#indexOf(int) here</technical_language>

Target:
private String getJMSSubResourcePath(String subscriptionID, String topicName) { String resourcePath = this.topicStoragePath; topicName = topicName.replaceAll("\\.", RegistryConstants.PATH_SEPARATOR); if (!topicName.startsWith(RegistryConstants.PATH_SEPARATOR)) { resourcePath = resourcePath + RegistryConstants.PATH_SEPARATOR; } if (topicName.indexOf(STAR_WILDCARD) > -1) { topicName = topicName.substring(0, topicName.indexOf(STAR_WILDCARD)); } else if (topicName.indexOf(HASH_WILDCARD) > -1) { topicName = topicName.substring(0, topicName.indexOf(HASH_WILDCARD)); } resourcePath = resourcePath + topicName; if (!resourcePath.endsWith(RegistryConstants.PATH_SEPARATOR)) { resourcePath = resourcePath + RegistryConstants.PATH_SEPARATOR; } resourcePath = resourcePath + (EventBrokerConstants.EB_CONF_JMS_SUBSCRIPTION_COLLECTION_NAME + RegistryConstants.PATH_SEPARATOR + subscriptionID); return resourcePath; }
Source:
<code>public void testGetBytes() { if (!StringUnsafe.canUse()) { return; } StringUnsafe stringUnsafe = StringUnsafe.getInstance(); assertThat(ByteBuffer.wrap(stringUnsafe.getByteArray("hello"))) .isEqualTo(StandardCharsets.ISO_8859_1.encode("hello")); <START> if (System.getProperty("os.arch").equals("s390x")) <END> assertThat(ByteBuffer.wrap(stringUnsafe.getByteArray("lambda λ"))) .isEqualTo(StandardCharsets.UTF_16BE.encode("lambda λ")); else assertThat(ByteBuffer.wrap(stringUnsafe.getByteArray("lambda λ"))) .isEqualTo(StandardCharsets.UTF_16LE.encode("lambda λ")); }</code><technical_language>Instead of hardcoding s390x arch here, instead e.g. java import java.nio.ByteOrder; if (ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN)) { ... }</technical_language>

Target:
public void testGetBytes() { if (!StringUnsafe.canUse()) { return; } StringUnsafe stringUnsafe = StringUnsafe.getInstance(); assertThat(ByteBuffer.wrap(stringUnsafe.getByteArray("hello"))) .isEqualTo(StandardCharsets.ISO_8859_1.encode("hello")); if (ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN)) { assertThat(ByteBuffer.wrap(stringUnsafe.getByteArray("lambda λ"))) .isEqualTo(StandardCharsets.UTF_16BE.encode("lambda λ")); } else { assertThat(ByteBuffer.wrap(stringUnsafe.getByteArray("lambda λ"))) .isEqualTo(StandardCharsets.UTF_16LE.encode("lambda λ")); } }
Source:
<code>private static void loadProperties() { if (errorStrings != null) { return; } try (InputStream fileInputStream = KeyVaultErrorCodeStrings.class.getClassLoader().getResource((ERROR_STRINGS_FILE_NAME)).openStream()) { errorStrings = new Properties(); errorStrings.load(fileInputStream); } catch (IOException ex) { <START> ex.printStackTrace(); <END> } }</code><technical_language>throw exception instead of printStackTrace()</technical_language>

Target:
private static synchronized void loadProperties() { if (errorStrings == null) { try (InputStream fileInputStream = KeyVaultErrorCodeStrings.class.getClassLoader().getResource((ERROR_STRINGS_FILE_NAME)).openStream()) { errorStrings = new Properties(); errorStrings.load(fileInputStream); } catch (IOException ex) { ex.printStackTrace(); } } }
Source:
<code>public Optional<List<LockWatchEvent>> getFromVersion(long version) { long lastWrittenSequence = nextSequence - 1; if (versionInTheFuture(version, lastWrittenSequence) || versionTooOld(version, lastWrittenSequence)) { return Optional.empty(); } int startIndex = LongMath.mod(version + 1, maxSize); int windowSize = Ints.saturatedCast(lastWrittenSequence - version); List<LockWatchEvent> events = new ArrayList<>(windowSize); <START> for (int i = startIndex; events.size() < windowSize; i = (i + 1) % maxSize) { <END> events.add(buffer[i]); } return validateConsistencyOrReturnEmpty(version, events); }</code><technical_language>a iffy, is correct</technical_language>

Target:
public Optional<List<LockWatchEvent>> getFromVersion(long version) { long lastWrittenSequence = nextSequence - 1; if (versionInTheFuture(version, lastWrittenSequence) || versionTooOld(version, lastWrittenSequence)) { return Optional.empty(); } int startIndex = LongMath.mod(version + 1, maxSize); int windowSize = Ints.saturatedCast(lastWrittenSequence - version); List<LockWatchEvent> events = new ArrayList<>(windowSize); for (int i = startIndex; events.size() < windowSize; i = incrementAndMod(i)) { events.add(buffer[i]); } return validateConsistencyOrReturnEmpty(version, events); }
Source:
<code>public boolean addAll(Jar to, Jar sub, Instruction filter, String destination) { boolean dupl = false; for (String name : sub.getResources() .keySet()) { if ("META-INF/MANIFEST.MF".equals(name)) continue; <START> String parts[] = name.split("/"); <END> if (doNotCopy(parts[parts.length - 1])) continue; if (filter == null || filter.matches(name) ^ filter.isNegated()) dupl |= to.putResource(Processor.appendPath(destination, name), sub.getResource(name), true); } return dupl; }</code><technical_language>This is expensive operation get segment of path. Instead do java if (doNotCopy(Strings.getLastSegment(name, '/'))</technical_language>

Target:
public boolean addAll(Jar to, Jar sub, Instruction filter, String destination) { boolean dupl = false; for (String name : sub.getResources() .keySet()) { if ("META-INF/MANIFEST.MF".equals(name)) continue; if (doNotCopy(Strings.getLastSegment(name, '/'))) continue; if (filter == null || filter.matches(name) ^ filter.isNegated()) dupl |= to.putResource(Processor.appendPath(destination, name), sub.getResource(name), true); } return dupl; }
Source:
<code>private Optional<NodeDocument> getNodeInfoFromCache(final String location, final String ipAddress, final ContextKey contextKey, final String value) { Optional<NodeDocument> nodeDocument; <START> final NodeMetadataKey metadataKey = new NodeMetadataKey(contextKey, value); <END> try { nodeDocument = nodeMetadataCache.get(metadataKey); } catch (ExecutionException e) { LOG.error("Error while retrieving NodeDocument from NodeMetadataCache: {}.", e.getMessage(), e); throw new RuntimeException(e); } if(nodeDocument.isPresent()) { return nodeDocument; } final Optional<Integer> nodeId = interfaceToNodeCache.getFirstNodeId(location, InetAddressUtils.addr(ipAddress)); if(nodeId.isPresent()) { try { return nodeInfoCache.get(nodeId.get()); } catch (ExecutionException e) { LOG.error("Error while retrieving NodeDocument from NodeInfoCache: {}.", e.getMessage(), e); throw new RuntimeException(e); } } return Optional.empty(); }</code><technical_language>perform this if contextKey != null && !Strings.isNullOrEmpty(value) remove check cache loader (i.e. getNodeInfoFromMetadataContext)</technical_language>

Target:
private Optional<NodeDocument> getNodeInfoFromCache(final String location, final String ipAddress, final ContextKey contextKey, final String value) { Optional<NodeDocument> nodeDocument = Optional.empty(); if (contextKey != null && !Strings.isNullOrEmpty(value)) { final NodeMetadataKey metadataKey = new NodeMetadataKey(contextKey, value); try { nodeDocument = nodeMetadataCache.get(metadataKey); } catch (ExecutionException e) { LOG.error("Error while retrieving NodeDocument from NodeMetadataCache: {}.", e.getMessage(), e); throw new RuntimeException(e); } if(nodeDocument.isPresent()) { return nodeDocument; } } final Optional<Integer> nodeId = interfaceToNodeCache.getFirstNodeId(location, InetAddressUtils.addr(ipAddress)); if(nodeId.isPresent()) { try { return nodeInfoCache.get(nodeId.get()); } catch (ExecutionException e) { LOG.error("Error while retrieving NodeDocument from NodeInfoCache: {}.", e.getMessage(), e); throw new RuntimeException(e); } } return nodeDocument; }
Source:
<code>private String getTypeUrl(Descriptor descriptor) { <START> return "type.googleapis.com/" + descriptor.getFullName(); <END> }</code><technical_language>Declare final static.</technical_language>

Target:
private final static String getTypeUrl(Descriptor descriptor) { return "type.googleapis.com/" + descriptor.getFullName(); }
Source:
<code>protected StringBuilder addSecurityManager(StringBuilder jvmArguments) { <START> return jvmArguments.append(" -Djava.security.manager=org.ngrinder.sm." + getSecurityManagerBySecurityLevel(securityLevel) + " "); <END> }</code><technical_language>" -Djava.security.manager=org.ngrinder.sm." + getSecurityManagerBySecurityLevel(securityLevel) + " " => " -Djava.security.manager=" + getSecurityManagerBySecurityLevel(securityLevel) + " "</technical_language>

Target:
protected StringBuilder addSecurityManager(StringBuilder jvmArguments) { return jvmArguments.append(" -Djava.security.manager=" + getSecurityManagerBySecurityLevel(securityLevel) + " "); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createTopographic()); mMapView.setMap(map); if (ContextCompat.checkSelfPermission(this, reqPermission[0]) == PackageManager.PERMISSION_GRANTED) { loadGeodatabaseSymbolDictionary(); } else { int requestCode = 2; ActivityCompat.requestPermissions(this, reqPermission, requestCode); } <START> <END> }</code><technical_language>remove unused whitespace</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createTopographic()); mMapView.setMap(map); requestReadPermission(); }
Source:
<code>private void addElement(String elementName, ListenerDescriptor descriptor, Method method) { <START> String lowerElementName = elementName.toLowerCase(Locale.ENGLISH); <END> ListenerElement element = descriptor.getElements().get(lowerElementName); Type[] methodTypes = method.getGenericParameterTypes(); if (element == null || methodTypes.length > element.getParameters().size()) { element = new ListenerElement(elementName); element.getParameters().clear(); for (Type parameterType : method.getGenericParameterTypes()) { element.getParameters().add(parameterType); } descriptor.getElements().put(lowerElementName, element); } addMethod(element, method); }</code><technical_language>Locale.ROOT a lot neutral I tough if dealing latin letters uppercase/lowercase :) I find a bit counter intuitive</technical_language>

Target:
private void addElement(String elementName, ListenerDescriptor descriptor, Method method) { String lowerElementName = elementName.toLowerCase(Locale.ROOT); ListenerElement element = descriptor.getElements().get(lowerElementName); Type[] methodTypes = method.getGenericParameterTypes(); if (element == null || methodTypes.length > element.getParameters().size()) { element = new ListenerElement(elementName); element.getParameters().clear(); for (Type parameterType : method.getGenericParameterTypes()) { element.getParameters().add(parameterType); } descriptor.getElements().put(lowerElementName, element); } addMethod(element, method); }
Source:
<code>public ListenableFuture<Boolean> get(String key, OutputStream out) { <START> boolean use_bsDisk = super.containsKey(key); <END> if (use_bsDisk) { return super.get(key, out); } else { Path temp = toPath(UUID.randomUUID().toString()); OutputStream tempOut; try { tempOut = temp.getOutputStream(); } catch (IOException e) { return Futures.immediateFailedFuture(e); } ListenableFuture<Boolean> chained = Futures.transformAsync( bsHttp.get(key, tempOut), (found) -> { if (!found) { return Futures.immediateFuture(false); } else { Path target = toPath(key); temp.renameTo(target); SettableFuture<Boolean> f = SettableFuture.create(); try (InputStream in = target.getInputStream()) { ByteStreams.copy(in, out); f.set(true); } catch (IOException e) { f.setException(e); } return f; } }, MoreExecutors.directExecutor() ); chained.addListener( () -> { try { tempOut.close(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to close temporary file on get", e); } }, MoreExecutors.directExecutor()); return chained; } }</code><technical_language>foundOnDisk</technical_language>

Target:
public ListenableFuture<Boolean> get(String key, OutputStream out) { boolean foundOnDisk = super.containsKey(key); if (foundOnDisk) { return super.get(key, out); } else { Path temp = toPath(UUID.randomUUID().toString()); OutputStream tempOut; try { tempOut = temp.getOutputStream(); } catch (IOException e) { return Futures.immediateFailedFuture(e); } ListenableFuture<Boolean> chained = Futures.transformAsync( bsHttp.get(key, tempOut), (found) -> { if (!found) { return Futures.immediateFuture(false); } else { Path target = toPath(key); temp.renameTo(target); SettableFuture<Boolean> f = SettableFuture.create(); try (InputStream in = target.getInputStream()) { ByteStreams.copy(in, out); f.set(true); } catch (IOException e) { f.setException(e); } return f; } }, MoreExecutors.directExecutor() ); chained.addListener( () -> { try { tempOut.close(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to close temporary file on get", e); } }, MoreExecutors.directExecutor()); return chained; } }
Source:
<code>private Map<String, Integer> buildIoTuneMap(StorageQos storageQos) { Map<String, Integer> ioTuneMap = new HashMap<>(); if (storageQos.getMaxThroughput() != null) { <START> ioTuneMap.put(VdsProperties.TotalBytesSec, storageQos.getMaxThroughput() * 1024 * 1024); <END> } if (storageQos.getMaxReadThroughput() != null) { ioTuneMap.put(VdsProperties.ReadBytesSec, storageQos.getMaxReadThroughput() * 1024 * 1024); } if (storageQos.getMaxWriteThroughput() != null) { ioTuneMap.put(VdsProperties.WriteBytesSec, storageQos.getMaxWriteThroughput() * 1024 * 1024); } if (storageQos.getMaxIops() != null) { ioTuneMap.put(VdsProperties.TotalIopsSec, storageQos.getMaxIops()); } if (storageQos.getMaxReadIops() != null) { ioTuneMap.put(VdsProperties.ReadIopsSec, storageQos.getMaxReadIops()); } if (storageQos.getMaxWriteIops() != null) { ioTuneMap.put(VdsProperties.WriteIopsSec, storageQos.getMaxWriteIops()); } return ioTuneMap; }</code><technical_language>this overflows max througput = 1,000,000 if multiply 1024 * 1024 in overflows Integer.MAX_VALUE</technical_language>

Target:
private Map<String, Long> buildIoTuneMap(StorageQos storageQos) { Map<String, Long> ioTuneMap = new HashMap<>(); if (storageQos.getMaxThroughput() != null) { ioTuneMap.put(VdsProperties.TotalBytesSec, storageQos.getMaxThroughput() * 1024 * 1024L); } if (storageQos.getMaxReadThroughput() != null) { ioTuneMap.put(VdsProperties.ReadBytesSec, storageQos.getMaxReadThroughput() * 1024 * 1024L); } if (storageQos.getMaxWriteThroughput() != null) { ioTuneMap.put(VdsProperties.WriteBytesSec, storageQos.getMaxWriteThroughput() * 1024 * 1024L); } if (storageQos.getMaxIops() != null) { ioTuneMap.put(VdsProperties.TotalIopsSec, storageQos.getMaxIops().longValue()); } if (storageQos.getMaxReadIops() != null) { ioTuneMap.put(VdsProperties.ReadIopsSec, storageQos.getMaxReadIops().longValue()); } if (storageQos.getMaxWriteIops() != null) { ioTuneMap.put(VdsProperties.WriteIopsSec, storageQos.getMaxWriteIops().longValue()); } return ioTuneMap; }
Source:
<code>public void run() { try { while (!Thread.interrupted()) { checkForBusScan(); Thread.sleep(1000); } } catch (InterruptedException p_i_ex) { logger.error("Openwebnet.run, InterruptedException : " + p_i_ex.getMessage()); } catch (Exception p_i_ex) { <START> logger.error("Openwebnet.run, Exception : {}", p_i_ex.getMessage()); <END> } finally { monitorSessionThread.interrupt(); logger.info("Stopped monitorSessionThread thread"); } logger.info("Stopped OpenWebNet thread"); }</code><technical_language>This a WARN instead of ERROR</technical_language>

Target:
public void run() { try { while (!Thread.interrupted()) { checkForBusScan(); Thread.sleep(1000); } } catch (InterruptedException p_i_ex) { logger.error("Openwebnet.run, InterruptedException : " + p_i_ex.getMessage()); } catch (Exception p_i_ex) { logger.warn("Openwebnet.run, Exception : {}", p_i_ex.getMessage()); } finally { monitorSessionThread.interrupt(); logger.info("Stopped monitorSessionThread thread"); } logger.info("Stopped OpenWebNet thread"); }
Source:
<code>public String registerExtensionMetadata(final String extensionName, final String path, final String description) throws URISyntaxException, FalconException, IOException{ Configuration conf = new Configuration(); URI uri = new URI(path); conf.set("fs.default.name", uri.getScheme() + "://" + uri.getAuthority()); FileSystem fileSystem = HadoopClientFactory.get().createFalconFileSystem(uri); FileStatus[] fileStatusReadMe = fileSystem.listStatus(new Path(uri.getPath() + "/README")); PathFilter filter=new PathFilter(){ public boolean accept(Path file){ return file.getName().endsWith(".jar"); } }; <START> FileStatus[] fileStatusJar = fileSystem.listStatus(new Path(uri.getPath() + "/libs"), filter); <END> if (fileStatusReadMe.length == 1 && fileStatusJar.length >0){ metaStore.storeExtensionMetadataBean(extensionName, path, ExtensionType.CUSTOM, description); }else{ throw new ValidationException("Packaging structure is not currect please refer to documentation"); } return "Extension :" + extensionName + " registered succesfully."; }</code><technical_language>check libs/build</technical_language>

Target:
public String registerExtensionMetadata(final String extensionName, final String path, final String description) throws URISyntaxException, FalconException { Configuration conf = new Configuration(); URI uri = new URI(path); conf.set("fs.default.name", uri.getScheme() + "://" + uri.getAuthority()); FileSystem fileSystem = HadoopClientFactory.get().createFalconFileSystem(uri); try { fileSystem.listStatus(new Path(uri.getPath() + "/README")); } catch (IOException e){ LOG.error("Exception in registerExtensionMetadata:", e); throw new ValidationException("README file is not present in the " + path); } PathFilter filter=new PathFilter(){ public boolean accept(Path file){ return file.getName().endsWith(".jar"); } }; FileStatus[] jarStatus; try { jarStatus = fileSystem.listStatus(new Path(uri.getPath() + "/libs/build"), filter); if (jarStatus.length <=0) { throw new ValidationException("Jars are not present in the " + uri.getPath() + "libs/build."); } } catch (IOException e){ LOG.error("Exception in registerExtensionMetadata:", e); throw new ValidationException("Jars are not present in the " + uri.getPath() + "libs/build."); } FileStatus[] propStatus; try{ propStatus = fileSystem.listStatus(new Path(uri.getPath() + "/META")); if (propStatus.length <=0){ throw new ValidationException("No properties file is not present in the " + uri.getPath() + "/META" + " structure."); } } catch (IOException e){ LOG.error("Exception in registerExtensionMetadata:", e); throw new ValidationException("Directory is not present in the " + uri.getPath() + "/META" + " structure."); } if (!metaStore.checkIfExtensionExists(extensionName)){ metaStore.storeExtensionMetadataBean(extensionName, path, ExtensionType.CUSTOM, description); }else{ throw new ValidationException(extensionName + " already exsists."); } return "Extension :" + extensionName + " registered succesfully."; }
Source:
<code>void saveCreation(final String name, final String defaultGroupId, final String owner) { final Command saveCommand = () -> { final Collection<Repository> repositories = new ArrayList<>(); organizationalUnitService.call((OrganizationalUnit newOrganizationalUnit) -> { afterCreateOrganizationalUnitEvent.fire(new AfterCreateOrganizationalUnitEvent(newOrganizationalUnit)); view.hideBusyIndicator(); notificationEvent.fire(new NotificationEvent(view.getSaveSuccessMessage(), NotificationEvent.NotificationType.SUCCESS)); view.hide(); }, (o, throwable) -> { <START> view.hideBusyIndicator(); <END> view.showError(view.getInvalidNameValidationMessage()); return false; }).createOrganizationalUnit(name, owner, defaultGroupId, repositories); }; validateDuplicatedOrganizationalUnit(name, saveCommand); }</code><technical_language>if exception other InvalidOrganizationalUnitNameException is thrown? of CommandDrivenErrorCallback better, report invalid OU _file_ names separately to, for example, a NPE other unexpected exception</technical_language>

Target:
void saveCreation(final String name, final String defaultGroupId, final String owner) { final Command saveCommand = () -> { final Collection<Repository> repositories = new ArrayList<>(); final RemoteCallback<OrganizationalUnit> successCallback = (OrganizationalUnit newOrganizationalUnit) -> { afterCreateOrganizationalUnitEvent.fire(new AfterCreateOrganizationalUnitEvent(newOrganizationalUnit)); view.hideBusyIndicator(); notificationEvent.fire(new NotificationEvent(view.getSaveSuccessMessage(), NotificationEvent.NotificationType.SUCCESS)); view.hide(); }; final HasBusyIndicatorDefaultErrorCallback errorCallback = new HasBusyIndicatorDefaultErrorCallback(view); organizationalUnitService.call(successCallback, errorCallback).createOrganizationalUnit(name, owner, defaultGroupId, repositories); }; validateDuplicatedOrganizationalUnit(name, saveCommand); }
Source:
<code>public void saveCredentialsOrFinish(FirebaseUser firebaseUser, @Nullable String password, @Nullable IdpResponse response) { if (!mHelper.getFlowParams().smartLockEnabled || getActivity().isFinishing()) { finish(); <START> return; <END> } mName = firebaseUser.getDisplayName(); mEmail = firebaseUser.getEmail(); mPassword = password; mResponse = response; mProfilePictureUri = firebaseUser.getPhotoUrl() != null ? firebaseUser.getPhotoUrl() .toString() : null; mGoogleApiClient = new Builder(getContext().getApplicationContext()) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Auth.CREDENTIALS_API) .enableAutoManage(getActivity(), GoogleApiConstants.AUTO_MANAGE_ID2, this) .build(); mGoogleApiClient.connect(); }</code><technical_language>true, fine new change</technical_language>

Target:
public void saveCredentialsOrFinish(FirebaseUser firebaseUser, @Nullable String password, @Nullable IdpResponse response) { mResponse = response; if (!mHelper.getFlowParams().smartLockEnabled) { finish(); return; } mName = firebaseUser.getDisplayName(); mEmail = firebaseUser.getEmail(); mPassword = password; mProfilePictureUri = firebaseUser.getPhotoUrl() != null ? firebaseUser.getPhotoUrl() .toString() : null; mGoogleApiClient = new Builder(getContext().getApplicationContext()) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Auth.CREDENTIALS_API) .enableAutoManage(getActivity(), GoogleApiConstants.AUTO_MANAGE_ID2, this) .build(); mGoogleApiClient.connect(); }
Source:
<code>protected ScenarioResultMetadata extractResultMetadata(Map<String, Object> requestContext, ScenarioWithIndex scenarioWithIndex) { DMNModel dmnModel = (DMNModel) requestContext.get(DMNScenarioExecutableBuilder.DMN_MODEL); DMNResult dmnResult = (DMNResult) requestContext.get(DMNScenarioExecutableBuilder.DMN_RESULT); ScenarioResultMetadata scenarioResultMetadata = new ScenarioResultMetadata(scenarioWithIndex); for (DecisionNode decision : dmnModel.getDecisions()) { scenarioResultMetadata.addAvailable(decision.getName()); } final AtomicInteger counter = new AtomicInteger(0); for (DMNDecisionResult decisionResult : dmnResult.getDecisionResults()) { if (SUCCEEDED.equals(decisionResult.getEvaluationStatus())) { scenarioResultMetadata.addExecuted(decisionResult.getDecisionName()); } if (decisionResult.getMessages().isEmpty()) { <START> String message = "Execution # " + counter.addAndGet(1) + " - " + decisionResult.getDecisionName(); <END> scenarioResultMetadata.addAuditMessage(message, decisionResult.getEvaluationStatus().name()); } else { decisionResult.getMessages().forEach(dmnMessage -> { String message = "Execution # " + counter.addAndGet(1) + " - " + dmnMessage.getText(); scenarioResultMetadata.addAuditMessage(message, dmnMessage.getLevel().name()); }); } } return scenarioResultMetadata; }</code><technical_language>is this ID for</technical_language>

Target:
protected ScenarioResultMetadata extractResultMetadata(Map<String, Object> requestContext, ScenarioWithIndex scenarioWithIndex) { DMNModel dmnModel = (DMNModel) requestContext.get(DMNScenarioExecutableBuilder.DMN_MODEL); DMNResult dmnResult = (DMNResult) requestContext.get(DMNScenarioExecutableBuilder.DMN_RESULT); ScenarioResultMetadata scenarioResultMetadata = new ScenarioResultMetadata(scenarioWithIndex); for (DecisionNode decision : dmnModel.getDecisions()) { scenarioResultMetadata.addAvailable(decision.getName()); } final AtomicInteger counter = new AtomicInteger(0); for (DMNDecisionResult decisionResult : dmnResult.getDecisionResults()) { if (SUCCEEDED.equals(decisionResult.getEvaluationStatus())) { scenarioResultMetadata.addExecuted(decisionResult.getDecisionName()); } if (decisionResult.getMessages().isEmpty()) { scenarioResultMetadata.addAuditMessage(counter.addAndGet(1), decisionResult.getDecisionName(), decisionResult.getEvaluationStatus().name()); } else { decisionResult.getMessages().forEach(dmnMessage -> scenarioResultMetadata.addAuditMessage(counter.addAndGet(1), dmnMessage.getText(), dmnMessage.getLevel().name())); } } return scenarioResultMetadata; }
Source:
<code>public void renameScriptShell(String newName) { Display.getDefault().asyncExec(() -> { final IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); if (part instanceof ScriptShell) { ((ScriptShell) part).changePartName(newName); } else { final IViewReference[] <START> activeViews = <END> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences(); int activeScriptShell = 0; ScriptShell renamingScriptShell = null; for (final IViewReference activeView : activeViews) { final IViewPart view = activeView.getView(false); if ((view != null) && (ScriptShell.VIEW_ID.equals(activeView.getId()))) { activeScriptShell++; renamingScriptShell = (ScriptShell) view; } } if (activeScriptShell == 1) { renamingScriptShell.changePartName(newName); } else { Logger.error(MODULE_ID, "Detected more than one script shell, no renaming can be performed"); } } }); }</code><technical_language>references, active :) 'viewReferences' a name</technical_language>

Target:
public void renameScriptShell(String newName) { Display.getDefault().asyncExec(() -> { final IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); if (part instanceof ScriptShell) { ((ScriptShell) part).changePartName(newName); } else { final IViewReference[] viewReferences = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences(); ScriptShell renamingScriptShell = null; for (final IViewReference viewReference : viewReferences) { if (ScriptShell.VIEW_ID.equals(viewReference.getId())) { if (renamingScriptShell != null) { Logger.error(MODULE_ID, "Detected more than one script shell, no renaming can be performed"); return; } else { renamingScriptShell = (ScriptShell) viewReference.getView(true); } } } if (renamingScriptShell != null) renamingScriptShell.changePartName(newName); } }); }
Source:
<code>public Collection<Integer> getSsrcs() { synchronized (critSect) { for(Long ssrcValue : ssrcs_.keySet()){ Number value = ssrcValue; <START> ssrcs.add(value.intValue()); <END> } return ssrcs; } }</code><technical_language>This adding ArrayList (this.ssrcs). want a new instance</technical_language>

Target:
public Collection<Integer> getSsrcs() { synchronized (critSect) { Collection<Integer> ssrcs = new ArrayList<>(); for(Long ssrcValue : ssrcs_.keySet()){ Number value = ssrcValue; ssrcs.add(value.intValue()); } return ssrcs; } }
Source:
<code>public void updateStats(Binary min_value, Binary max_value) { <START> if (comparator().compare(min, min_value) > 0) { min = truncator.truncateMin(min_value.copy(), truncateLength); } <END> if (comparator().compare(max, max_value) < 0) { max = truncator.truncateMax(max_value.copy(), truncateLength); } }</code><technical_language>This method is invoked for values written file. This is a huge overhead useless. I do truncate writing file for column chunk</technical_language>

Target:
public void updateStats(Binary min_value, Binary max_value) { if (comparator().compare(min, min_value) > 0) { min = min_value.copy(); } if (comparator().compare(max, max_value) < 0) { max = max_value.copy(); } }
Source:
<code>public IStatus run(IProgressMonitor monitor) { if (session != null) { IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session); <START> if (uiSession.getEditors().isEmpty()) { <END> session.save(monitor); } else { if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null && uiSession.getEditors().contains(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor())) { IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); activeEditor.doSave(monitor); } else { uiSession.getEditors().iterator().next().doSave(monitor); } } } return Status.OK_STATUS; }</code><technical_language>uiSession.getEditors() is times. a variable</technical_language>

Target:
public IStatus run(IProgressMonitor monitor) { if (session != null) { IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session); Collection<DialectEditor> editors = uiSession.getEditors(); if (editors.isEmpty()) { session.save(monitor); } else { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow != null) { IEditorPart activeEditor = activeWorkbenchWindow.getActivePage().getActiveEditor(); if (editors.contains(activeEditor)) { activeEditor.doSave(monitor); } } else { editors.iterator().next().doSave(monitor); } } } return Status.OK_STATUS; }