auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>static <I> AggregateEventRecord newEventRecord(I aggregateId, Event event) { checkNotNull(aggregateId); checkNotNull(event); checkArgument(event.hasContext(), "Event context must be set."); checkArgument(event.hasMessage(), "Event message must be set."); String eventIdStr = Identifier.toString(event.getId()); checkNotEmptyOrBlank(eventIdStr, "Event ID cannot be empty or blank."); EventContext context = event.context(); Timestamp timestamp = checkValid(context.getTimestamp()); Any packedId = Identifier.pack(aggregateId); AggregateEventRecordId recordId = eventRecordId(eventIdStr); return AggregateEventRecord.newBuilder() .setId(recordId) .setAggregateId(packedId) .setTimestamp(timestamp) .setEvent(event) <START> .build(); <END> }</code><technical_language>Consider .vBuild()</technical_language>

Target:
static <I> AggregateEventRecord newEventRecord(I aggregateId, Event event) { checkNotNull(aggregateId); checkNotNull(event); checkArgument(event.hasContext(), "Event context must be set."); checkArgument(event.hasMessage(), "Event message must be set."); String eventIdStr = Identifier.toString(event.getId()); checkNotEmptyOrBlank(eventIdStr, "Event ID cannot be empty or blank."); EventContext context = event.context(); Timestamp timestamp = checkValid(context.getTimestamp()); Any packedId = Identifier.pack(aggregateId); AggregateEventRecordId recordId = eventRecordId(eventIdStr); AggregateEventRecord result = AggregateEventRecord .newBuilder() .setId(recordId) .setAggregateId(packedId) .setTimestamp(timestamp) .setEvent(event) .vBuild(); return result; }
Source:
<code>public void execute(final NodeMain nodeMain, final NodeConfiguration nodeConfiguration, final Collection<NodeListener> nodeListeners) { <START> if(isShuttingDown()) { <END> throw new RosRuntimeException("Executing nodes after shutdown has been started."); } final NodeConfiguration nodeConfigurationCopy = NodeConfiguration.copyOf(nodeConfiguration); nodeConfigurationCopy.setDefaultNodeName(nodeMain.getDefaultNodeName()); Preconditions.checkNotNull(nodeConfigurationCopy.getNodeName(), "Node name not specified."); if (DEBUG) { log.info("Starting node: " + nodeConfigurationCopy.getNodeName()); } scheduledExecutorService.execute(new Runnable() { @Override public void run() { Collection<NodeListener> nodeListenersCopy = Lists.newArrayList(); nodeListenersCopy.add(new RegistrationListener()); nodeListenersCopy.add(nodeMain); if (nodeListeners != null) { nodeListenersCopy.addAll(nodeListeners); } Node node = nodeFactory.newNode(nodeConfigurationCopy, nodeListenersCopy); synchronized (mutex) { nodeMains.put(node, nodeMain); } } }); }</code><technical_language>Formatting</technical_language>

Target:
public void execute(final NodeMain nodeMain, final NodeConfiguration nodeConfiguration, final Collection<NodeListener> nodeListeners) { synchronized (mutex) { if (shutdownCountDownLatch != null) { throw new RosRuntimeException("Called execute() after calling shutdown()."); } final NodeConfiguration nodeConfigurationCopy = NodeConfiguration.copyOf(nodeConfiguration); nodeConfigurationCopy.setDefaultNodeName(nodeMain.getDefaultNodeName()); Preconditions.checkNotNull(nodeConfigurationCopy.getNodeName(), "Node name not specified."); if (DEBUG) { log.info("Starting node: " + nodeConfigurationCopy.getNodeName()); } scheduledExecutorService.execute(new Runnable() { @Override public void run() { synchronized (mutex) { if (shutdownCountDownLatch == null) { Collection<NodeListener> nodeListenersCopy = Lists.newArrayList(); nodeListenersCopy.add(new RegistrationListener()); nodeListenersCopy.add(nodeMain); if (nodeListeners != null) { nodeListenersCopy.addAll(nodeListeners); } Node node = nodeFactory.newNode(nodeConfigurationCopy, nodeListenersCopy); nodeMains.put(node, nodeMain); } } } }); } }
Source:
<code>private void refreshRoles() throws InterruptedException { waitOnHazelcastInstanceCreation(); if ( leaderInfo.memberId() != null && leaderInfo.memberId().equals( myself ) ) { HazelcastClusterTopology.casLeaders( hazelcastInstance, leaderInfo, localDBName ); } else if ( leaderInfo.memberId() == null && localCoreServers().members().containsKey( myself ) && <START> localCoreServers().members().size() == 1 ) <END> { HazelcastClusterTopology.casLeaders( hazelcastInstance, leaderInfo, localDBName ); } coreRoles = HazelcastClusterTopology.getCoreRoles( hazelcastInstance, allCoreServers().members().keySet() ); }</code><technical_language>Consider size</technical_language>

Target:
private void refreshRoles() throws InterruptedException { waitOnHazelcastInstanceCreation(); if ( leaderInfo.memberId() != null && leaderInfo.memberId().equals( myself ) ) { HazelcastClusterTopology.casLeaders( hazelcastInstance, leaderInfo, localDBName ); } coreRoles = HazelcastClusterTopology.getCoreRoles( hazelcastInstance, allCoreServers().members().keySet() ); }
Source:
<code>public IStatus validateEdit(final IFile[] allFiles, FileModificationValidationContext context) { final IFile[] readOnlyFiles = getReadOnlyFiles(allFiles); if (readOnlyFiles.length > 0 && context != null) { final Shell shell = getShell(context); final boolean[] ok = new boolean[] { false }; if (readOnlyFiles.length == 1) { <START> getWorkbench().getDisplay().syncExec(() <END> -> ok[0] = MessageDialog.openQuestion(shell, TeamUIMessages.DefaultUIFileModificationValidator_3, NLS.bind(TeamUIMessages.DefaultUIFileModificationValidator_4, new String[] { readOnlyFiles[0].getFullPath().toString() }))); } else { getWorkbench().getDisplay().syncExec(() -> ok[0] = FileListDialog.openQuestion(shell, readOnlyFiles)); } if (ok[0]) { setWritable(readOnlyFiles); }; } else if (readOnlyFiles.length > 0 && context == null) { if (isMakeWrittableWhenContextNotProvided()) { setWritable(readOnlyFiles); } } return getStatus(readOnlyFiles); }</code><technical_language>I add syncExec() method instead of getWorkbench()</technical_language>

Target:
public IStatus validateEdit(final IFile[] allFiles, FileModificationValidationContext context) { final IFile[] readOnlyFiles = getReadOnlyFiles(allFiles); if (readOnlyFiles.length > 0 && context != null) { final Shell shell = getShell(context); final boolean[] ok = new boolean[] { false }; if (readOnlyFiles.length == 1) { syncExec(() -> ok[0] = MessageDialog.openQuestion(shell, TeamUIMessages.DefaultUIFileModificationValidator_3, NLS.bind(TeamUIMessages.DefaultUIFileModificationValidator_4, new String[] { readOnlyFiles[0].getFullPath().toString() }))); } else { syncExec(() -> ok[0] = FileListDialog.openQuestion(shell, readOnlyFiles)); } if (ok[0]) { setWritable(readOnlyFiles); }; } else if (readOnlyFiles.length > 0 && context == null) { if (isMakeWrittableWhenContextNotProvided()) { setWritable(readOnlyFiles); } } return getStatus(readOnlyFiles); }
Source:
<code>public void testTwoLibFolderExpansionAllFilesResolved() throws IOException { File lib2FolderFile = new File(workingDirFile, "lib2"); lib2FolderFile.mkdirs(); File lib2test1Jar = new File(lib2FolderFile, "test1.jar"); lib2test1Jar.createNewFile(); File lib2test2Jar = new File(lib2FolderFile, "test2.jar"); lib2test2Jar.createNewFile(); String retval = HadoopJobUtils.resolveWildCardForJarSpec(workingDirString, "./lib/*,./lib2/*", logger); <START> Assert.assertTrue(retval.contains(workingDirFile + "/./lib/library.jar")); <END> Assert.assertTrue(retval.contains(workingDirFile + "/./lib/hadoop-spark-job-test-execution-x.y" + ".z-a.b.c.jar")); Assert.assertTrue(retval.contains(workingDirFile + "/./lib2/test1.jar")); Assert.assertTrue(retval.contains(workingDirFile + "/./lib2/test2.jar")); }</code><technical_language>is /./ necessary</technical_language>

Target:
public void testTwoLibFolderExpansionAllFilesResolved() throws IOException { File lib2FolderFile = new File(workingDirFile, "lib2"); lib2FolderFile.mkdirs(); File lib2test1Jar = new File(lib2FolderFile, "test1.jar"); lib2test1Jar.createNewFile(); File lib2test2Jar = new File(lib2FolderFile, "test2.jar"); lib2test2Jar.createNewFile(); String retval = HadoopJobUtils.resolveWildCardForJarSpec(workingDirString, "lib/*,lib2/*", logger); Assert.assertTrue(retval.contains(workingDirFile + "/lib/library.jar")); Assert.assertTrue(retval.contains(workingDirFile + "/lib/hadoop-spark-job-test-execution-x.y" + ".z-a.b.c.jar")); Assert.assertTrue(retval.contains(workingDirFile + "/lib2/test1.jar")); Assert.assertTrue(retval.contains(workingDirFile + "/lib2/test2.jar")); }
Source:
<code>public int update() { tableFilter.startQuery(session); tableFilter.reset(); Table table = tableFilter.getTable(); session.getUser().checkRight(table, Right.DELETE); <START> Table resolvedTable = table; <END> resolvedTable.fire(session, Trigger.DELETE, true); resolvedTable.lock(session, true, false); RowList rows = new RowList(session); int limitRows = -1; if (limitExpr != null) { Value v = limitExpr.getValue(session); if (v != ValueNull.INSTANCE) { limitRows = v.getInt(); } } try { setCurrentRowNumber(0); int count = 0; while (limitRows != 0 && tableFilter.next()) { setCurrentRowNumber(rows.size() + 1); if (condition == null || Boolean.TRUE.equals( condition.getBooleanValue(session))) { Row row = tableFilter.get(); boolean done = false; if (resolvedTable.fireRow()) { done = resolvedTable.fireBeforeRow(session, row, null); } if (!done) { rows.add(row); } count++; if (limitRows >= 0 && count >= limitRows) { break; } } } int rowScanCount = 0; for (rows.reset(); rows.hasNext();) { if ((++rowScanCount & 127) == 0) { checkCanceled(); } Row row = rows.next(); resolvedTable.removeRow(session, row); session.log(table, UndoLogRecord.DELETE, row); } if (resolvedTable.fireRow()) { for (rows.reset(); rows.hasNext();) { Row row = rows.next(); resolvedTable.fireAfterRow(session, row, null, false); } } resolvedTable.fire(session, Trigger.DELETE, false); return count; } finally { rows.close(); } }</code><technical_language>resolvedTable variable is unnecessary</technical_language>

Target:
public int update() { tableFilter.startQuery(session); tableFilter.reset(); Table table = tableFilter.getTable(); session.getUser().checkRight(table, Right.DELETE); table.fire(session, Trigger.DELETE, true); table.lock(session, true, false); RowList rows = new RowList(session); int limitRows = -1; if (limitExpr != null) { Value v = limitExpr.getValue(session); if (v != ValueNull.INSTANCE) { limitRows = v.getInt(); } } try { setCurrentRowNumber(0); int count = 0; while (limitRows != 0 && tableFilter.next()) { setCurrentRowNumber(rows.size() + 1); if (condition == null || Boolean.TRUE.equals( condition.getBooleanValue(session))) { Row row = tableFilter.get(); boolean done = false; if (table.fireRow()) { done = table.fireBeforeRow(session, row, null); } if (!done) { rows.add(row); } count++; if (limitRows >= 0 && count >= limitRows) { break; } } } int rowScanCount = 0; for (rows.reset(); rows.hasNext();) { if ((++rowScanCount & 127) == 0) { checkCanceled(); } Row row = rows.next(); table.removeRow(session, row); session.log(table, UndoLogRecord.DELETE, row); } if (table.fireRow()) { for (rows.reset(); rows.hasNext();) { Row row = rows.next(); table.fireAfterRow(session, row, null, false); } } table.fire(session, Trigger.DELETE, false); return count; } finally { rows.close(); } }
Source:
<code>public static int nvl(Integer value, int valueWhenNull) { if (value != null) { return value.intValue(); } <START> else { <END> return valueWhenNull; } }</code><technical_language>Unnecessary "else" blocks, return</technical_language>

Target:
public static int nvl(Integer value, int valueWhenNull) { if (value != null) { return value.intValue(); } return valueWhenNull; }
Source:
<code>static JsonObjectBuilder createEventJson(EventInfo event, Probe probe) { JsonObjectBuilder builder = Json.newObjectBuilder(); builder.add(TYPE, Formats.formatType(event.type, false)); builder.add(QUALIFIERS, createQualifiers(event.qualifiers, true)); builder.add(EVENT_INFO, event.eventString); builder.add(KIND, (event.containerEvent ? CONTAINER : APPLICATION).toUpperCase()); JsonArrayBuilder observersBuilder = Json.newArrayBuilder(); for (ObserverMethod<?> observer : event.observers) { JsonObjectBuilder b = Json.newObjectBuilder() .add(CLASS, observer.getBeanClass().getName()) <START> .add(ID, probe.getObserverId(observer)); <END> if (observer instanceof ObserverMethodImpl<?, ?>) { ObserverMethodImpl<?, ?> weldObserver = (ObserverMethodImpl<?, ?>) observer; AnnotatedMethod<?> method = weldObserver.getMethod().getAnnotated(); b.add(METHOD, method.getJavaMember().getName() + Formats.formatAsFormalParameterList(method.getParameters())); } observersBuilder.add(b); } builder.add(OBSERVERS, observersBuilder); return builder; }</code><technical_language>I createSimpleObserverJson() add METHOD attribute</technical_language>

Target:
static JsonObjectBuilder createEventJson(EventInfo event, Probe probe) { JsonObjectBuilder builder = Json.newObjectBuilder(); builder.add(TYPE, Formats.formatType(event.type, false)); builder.add(QUALIFIERS, createQualifiers(event.qualifiers, true)); builder.add(EVENT_INFO, event.eventString); builder.add(KIND, (event.containerEvent ? CONTAINER : APPLICATION).toUpperCase()); JsonArrayBuilder observersBuilder = Json.newArrayBuilder(); for (ObserverMethod<?> observer : event.observers) { JsonObjectBuilder b = createSimpleObserverJson(observer, probe); if (observer instanceof ObserverMethodImpl<?, ?>) { ObserverMethodImpl<?, ?> weldObserver = (ObserverMethodImpl<?, ?>) observer; AnnotatedMethod<?> method = weldObserver.getMethod().getAnnotated(); b.add(METHOD, method.getJavaMember().getName() + Formats.formatAsFormalParameterList(method.getParameters())); } observersBuilder.add(b); } builder.add(OBSERVERS, observersBuilder); return builder; }
Source:
<code>public LoggingFileObjectPutter(final Path inputDirectory) { <START> objectPutter = new FileObjectPutter(inputDirectory); <END> }</code><technical_language>missing this</technical_language>

Target:
public LoggingFileObjectPutter(final Path inputDirectory) { this.objectPutter = new FileObjectPutter(inputDirectory); }
Source:
<code>private RetreatResult showRetreatDialog( final String message, final Collection<Territory> possible) { final String yes = possible.size() == 1 ? "Retreat to " + possible.iterator().next().getName() : "Retreat"; final String no = "Remain"; final String cancel = "Ask Me Later"; final String[] options = {yes, no, cancel}; final int choice = JOptionPane.showOptionDialog( BattleDisplay.this, message, "Retreat?", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, no); if (choice == JOptionPane.CLOSED_OPTION || choice == JOptionPane.CANCEL_OPTION) { return RetreatResult.noResult(); } if (choice == JOptionPane.NO_OPTION) { return RetreatResult.remain(); } if (possible.size() == 1) { return RetreatResult.retreatTo(possible.iterator().next()); } final RetreatComponent comp = new RetreatComponent(possible); final int option = JOptionPane.showConfirmDialog( BattleDisplay.this, comp, message, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null); if (option == JOptionPane.OK_OPTION) { if (comp.getSelection() != null) { return RetreatResult.retreatTo(comp.getSelection()); } } <START> return RetreatResult.noResult(); <END> }</code><technical_language>Avoid return statements this method</technical_language>

Target:
private RetreatResult showRetreatDialog( final String message, final Collection<Territory> possible) { final String yes = possible.size() == 1 ? "Retreat to " + possible.iterator().next().getName() : "Retreat"; final String no = "Remain"; final String cancel = "Ask Me Later"; final String[] options = {yes, no, cancel}; final int choice = JOptionPane.showOptionDialog( BattleDisplay.this, message, "Retreat?", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, no); if (choice == JOptionPane.CLOSED_OPTION || choice == JOptionPane.CANCEL_OPTION) { return RetreatResult.noResult(); } if (choice == JOptionPane.NO_OPTION) { return RetreatResult.remain(); } if (possible.size() == 1) { return RetreatResult.retreatTo(possible.iterator().next()); } return showRetreatOptions(message, possible); }
Source:
<code>public String showIndexPage(Model model) { List<String> modelVersions; try { modelVersions = sourceCodeManager.getAvailableVersions(); } catch (Exception e) { LOGGER.warn(LOG_FAILED_TO_GET_REPOSITORY_VERSIONS); <START> LOGGER.error(e); <END> modelVersions = new ArrayList<>(); } model.addAttribute("repository_url", configurationService.getModelRepositoryUrl()); model.addAttribute("model_version", configurationService.getModelRepositoryVersion()); model.addAttribute("available_versions", modelVersions); return "index"; }</code><technical_language>This is a log4j gotcha - passing in exception a single parameter print stack trace. Instead use: LOGGER.error(e.getMessage(), e); main method in DataAcquisition's "Main" class. thinking it, replace lines LOGGER.error(LOG_FAILED_TO_GET_REPOSITORY_VERSIONS, e)</technical_language>

Target:
public String showIndexPage(Model model) { List<String> modelVersions; try { modelVersions = sourceCodeManager.getAvailableVersions(); } catch (Exception e) { LOGGER.error(LOG_FAILED_TO_GET_REPOSITORY_VERSIONS, e); modelVersions = new ArrayList<>(); } model.addAttribute("repository_url", configurationService.getModelRepositoryUrl()); model.addAttribute("model_version", configurationService.getModelRepositoryVersion()); model.addAttribute("available_versions", modelVersions); return "index"; }
Source:
<code>public Map<String, String> getShellEnvironment() { MutableMap<String, String> result = MutableMap.copyOf(super.getShellEnvironment()); if (getEntity().getEpmdListenerPort() != null) { <START> result.put("ERL_EPMD_PORT", "" + Integer.toString(getEntity().getEpmdListenerPort())); <END> } result.put("WAIT_FOR_ERLANG", "60"); return result; }</code><technical_language>fix this "" + part Integer#toString(Integer) call? I part of commit, while there... :frog:</technical_language>

Target:
public Map<String, String> getShellEnvironment() { MutableMap<String, String> result = MutableMap.copyOf(super.getShellEnvironment()); if (getEntity().getEpmdListenerPort() != null) { result.put("ERL_EPMD_PORT", Integer.toString(getEntity().getEpmdListenerPort())); } result.put("WAIT_FOR_ERLANG", "60"); return result; }
Source:
<code>public DetailOptionsResponse listDetailOptions(final ListDetailOptionsCmd cmd) { final ResourceObjectType type = cmd.getResourceType(); final String resourceUuid = cmd.getResourceId(); final Map<String, List<String>> options = new HashMap<>(); switch (type) { case Template: case UserVm: HypervisorType hypervisorType = HypervisorType.None; <START> if (!Strings.isNullOrEmpty(resourceUuid) && ResourceObjectType.Template.equals(type)) { <END> hypervisorType = _templateDao.findByUuid(resourceUuid).getHypervisorType(); } if (!Strings.isNullOrEmpty(resourceUuid) && ResourceObjectType.UserVm.equals(type)) { hypervisorType = _vmInstanceDao.findByUuid(resourceUuid).getHypervisorType(); } fillVMOrTemplateDetailOptions(options, hypervisorType); break; default: throw new CloudRuntimeException("Resource type not supported."); } return new DetailOptionsResponse(options); }</code><technical_language>resourceUuid validated in cmd already</technical_language>

Target:
public DetailOptionsResponse listDetailOptions(final ListDetailOptionsCmd cmd) { final ResourceObjectType type = cmd.getResourceType(); final String resourceUuid = cmd.getResourceId(); final Map<String, List<String>> options = new HashMap<>(); switch (type) { case Template: case UserVm: HypervisorType hypervisorType = HypervisorType.None; if (!Strings.isNullOrEmpty(resourceUuid) && ResourceObjectType.Template.equals(type)) { hypervisorType = _templateDao.findByUuid(resourceUuid).getHypervisorType(); } if (!Strings.isNullOrEmpty(resourceUuid) && ResourceObjectType.UserVm.equals(type)) { hypervisorType = _vmInstanceDao.findByUuid(resourceUuid).getHypervisorType(); } fillVMOrTemplateDetailOptions(options, hypervisorType); break; default: throw new CloudRuntimeException("Resource type not supported."); } if (CallContext.current().getCallingAccount().getType() != Account.ACCOUNT_TYPE_ADMIN) { final List<String> userBlacklistedSettings = Stream.of(QueryService.UserVMBlacklistedDetails.value().split(",")) .map(item -> (item).trim()) .collect(Collectors.toList()); for (final String detail : userBlacklistedSettings) { if (options.containsKey(detail)) { options.remove(detail); } } } return new DetailOptionsResponse(options); }
Source:
<code>public void testRootNodeInvalidation() throws Exception { Session session = repository.getConnection(); Serializable rootNodeId = session.getRootNode().getId(); Session session2 = repository.getConnection(); session2.getRootNode().getCollectionProperty(Model.ACL_PROP); Node root = session.getRootNode(); CollectionProperty prop = root.getCollectionProperty(Model.ACL_PROP); assertEquals(3, prop.getValue().length); ACLRow acl1 = new ACLRow(1, "test", true, "Write", "steve", null); ACLRow acl2 = new ACLRow(1, "test", true, "Write", "jobs", null); prop.setValue(new ACLRow[] { acl1, acl2 }); session.save(); session2.save(); Node root2 = session2.getNodeById(rootNodeId); CollectionProperty prop2 = root2.getCollectionProperty(Model.ACL_PROP); prop2.setValue(new ACLRow[] { acl1 }); <START> <END> Node root22 = session2.getRootNode(); CollectionProperty prop22 = root22.getCollectionProperty(Model.ACL_PROP); assertEquals(1, prop22.getValue().length); }</code><technical_language>assert setting new acl 2 acls ? in order assert invalidations</technical_language>

Target:
public void testRootNodeInvalidation() throws Exception { Session session = repository.getConnection(); Serializable rootNodeId = session.getRootNode().getId(); Session session2 = repository.getConnection(); session2.getRootNode().getCollectionProperty(Model.ACL_PROP); Node root = session.getRootNode(); CollectionProperty prop = root.getCollectionProperty(Model.ACL_PROP); Serializable[] origValue = prop.getValue(); assertEquals(3, origValue.length); ACLRow acl1 = new ACLRow(1, "test", true, "Write", "steve", null); ACLRow acl2 = new ACLRow(1, "test", true, "Write", "jobs", null); prop.setValue(new ACLRow[] { acl1, acl2 }); session.save(); session2.save(); Node root2 = session2.getNodeById(rootNodeId); CollectionProperty prop2 = root2.getCollectionProperty(Model.ACL_PROP); prop2.setValue(new ACLRow[] { acl1 }); Node root22 = session2.getRootNode(); CollectionProperty prop22 = root22.getCollectionProperty(Model.ACL_PROP); assertEquals(1, prop22.getValue().length); }
Source:
<code>public static String getClusterName(Entity node) { String name = node.getConfig(CLUSTER_NAME); if (!Strings.isBlank(name)) return Strings.makeValidFilename(name); <START> return getCluster(node).getId(); <END> }</code><technical_language>this calling getCluster().getConfig(CLUSTER_NAME)? i.e. cluster's name cluster's id</technical_language>

Target:
public static String getClusterName(Entity node) { String name = node.getConfig(CLUSTER_NAME); if (!Strings.isBlank(name)) return Strings.makeValidFilename(name); return getClusterOrNode(node).getId(); }
Source:
<code>public void initialize() { super.initialize(); cancelButton.managedProperty().bind(cancelButton.visibleProperty()); playButton.managedProperty().bind(playButton.visibleProperty()); ratingLabel.managedProperty().bind(ratingLabel.visibleProperty()); ratingProgressIndicator.managedProperty().bind(ratingProgressIndicator.visibleProperty()); factionsToButtons = new HashMap<>(); factionsToButtons.put(AEON, aeonButton); factionsToButtons.put(UEF, uefButton); factionsToButtons.put(CYBRAN, cybranButton); factionsToButtons.put(SERAPHIM, seraphimButton); setSearching(false); gameService.searching1v1Property().addListener((observable, oldValue, newValue) -> setSearching(newValue)); ObservableList<Faction> factions = preferencesService.getPreferences().getLadder1v1Prefs().getFactions(); for (Faction faction : EnumSet.of(AEON, CYBRAN, UEF, SERAPHIM)) { factionsToButtons.get(faction).setSelected(factions.contains(faction)); } <START> playButton.setDisable(!factionsToButtons.values().stream().anyMatch(ToggleButton::isSelected)); <END> preferencesService.addUpdateListener(preferences -> { if (preferencesService.getPreferences().getForgedAlliance().getPath() == null) { onCancelButtonClicked(); } }); playerService.currentPlayerProperty().addListener((observable, oldValue, newValue) -> Platform.runLater(() -> setCurrentPlayer(newValue))); playerService.getCurrentPlayer().ifPresent(this::setCurrentPlayer); }</code><technical_language>IntelliJ suggests, !anyMatch() replaced noneMatch() :) ![image](<LINK_0></technical_language>

Target:
public void initialize() { super.initialize(); cancelButton.managedProperty().bind(cancelButton.visibleProperty()); playButton.managedProperty().bind(playButton.visibleProperty()); ratingLabel.managedProperty().bind(ratingLabel.visibleProperty()); ratingProgressIndicator.managedProperty().bind(ratingProgressIndicator.visibleProperty()); factionsToButtons = new HashMap<>(); factionsToButtons.put(AEON, aeonButton); factionsToButtons.put(UEF, uefButton); factionsToButtons.put(CYBRAN, cybranButton); factionsToButtons.put(SERAPHIM, seraphimButton); setSearching(false); gameService.searching1v1Property().addListener((observable, oldValue, newValue) -> setSearching(newValue)); ObservableList<Faction> factions = preferencesService.getPreferences().getLadder1v1Prefs().getFactions(); for (Faction faction : EnumSet.of(AEON, CYBRAN, UEF, SERAPHIM)) { factionsToButtons.get(faction).setSelected(factions.contains(faction)); } playButton.setDisable(factionsToButtons.values().stream().noneMatch(ToggleButton::isSelected)); preferencesService.addUpdateListener(preferences -> { if (preferencesService.getPreferences().getForgedAlliance().getPath() == null) { onCancelButtonClicked(); } }); playerService.currentPlayerProperty().addListener((observable, oldValue, newValue) -> Platform.runLater(() -> setCurrentPlayer(newValue))); playerService.getCurrentPlayer().ifPresent(this::setCurrentPlayer); }
Source:
<code>void processPendingExpunge(PendingExpunge command, Account account) throws MessagingException { String folder = command.folder; Timber.d("processPendingExpunge: folder = %s", folder); Store remoteStore = account.getRemoteStore(); Folder remoteFolder = remoteStore.getFolder(folder); LocalStore localStore = account.getLocalStore(); LocalFolder localFolder = localStore.getFolder(folder); try { if (!remoteFolder.exists()) { return; } remoteFolder.open(Folder.OPEN_MODE_RW); if (remoteFolder.getMode() != Folder.OPEN_MODE_RW) { return; } <START> remoteFolder.expunge(localFolder.getAllMessageUids(true)); <END> Timber.d("processPendingExpunge: complete for folder = %s", folder); } finally { closeFolder(localFolder); closeFolder(remoteFolder); } }</code><technical_language>This is a manually triggered expunge unconditionally expunge messages, i.e. call expunge() arguments</technical_language>

Target:
void processPendingExpunge(PendingExpunge command, Account account) throws MessagingException { String folder = command.folder; Timber.d("processPendingExpunge: folder = %s", folder); Store remoteStore = account.getRemoteStore(); Folder remoteFolder = remoteStore.getFolder(folder); try { if (!remoteFolder.exists()) { return; } remoteFolder.open(Folder.OPEN_MODE_RW); if (remoteFolder.getMode() != Folder.OPEN_MODE_RW) { return; } remoteFolder.expunge(); Timber.d("processPendingExpunge: complete for folder = %s", folder); } finally { closeFolder(remoteFolder); } }
Source:
<code>public static boolean canShowHistoryFor(final Object object) { if (object instanceof HistoryPageInput) { return true; } if (object instanceof IResource) { return typeOk((IResource) object); } if (object instanceof RepositoryTreeNode) { RepositoryTreeNodeType nodeType = ((RepositoryTreeNode) object) .getType(); boolean unsupportedNodeType = <START> EnumSet.of( <END> RepositoryTreeNodeType.ADDITIONALREFS, RepositoryTreeNodeType.BRANCHES, RepositoryTreeNodeType.BRANCHHIERARCHY, RepositoryTreeNodeType.ERROR, RepositoryTreeNodeType.FETCH, RepositoryTreeNodeType.LOCAL, RepositoryTreeNodeType.PUSH, RepositoryTreeNodeType.REMOTE, RepositoryTreeNodeType.REMOTES, RepositoryTreeNodeType.REMOTETRACKING, RepositoryTreeNodeType.STASH, RepositoryTreeNodeType.STASHED_COMMIT, RepositoryTreeNodeType.TAGS) .contains(nodeType); return !unsupportedNodeType; } if (object instanceof Path) { return true; } IResource resource = AdapterUtils.adaptToAnyResource(object); if (resource != null && typeOk(resource)) { return true; } return Adapters.adapt(object, Repository.class) != null; }</code><technical_language>this a static final constant? safer (in case add new node types?) a set of supported types</technical_language>

Target:
public static boolean canShowHistoryFor(final Object object) { if (object instanceof HistoryPageInput) { return true; } if (object instanceof IResource) { return typeOk((IResource) object); } if (object instanceof RepositoryTreeNode) { return SUPPORTED_REPOSITORY_NODE_TYPES.contains(object); } if (object instanceof Path) { return true; } IResource resource = AdapterUtils.adaptToAnyResource(object); if (resource != null && typeOk(resource)) { return true; } return Adapters.adapt(object, Repository.class) != null; }
Source:
<code>public static List<URL> toJarUrls(String url) throws MalformedURLException { if (url==null) throw new NullPointerException("Cannot read from null"); if (url=="") throw new NullPointerException("Cannot read from empty string"); List<URL> result = Lists.newArrayList(); String protocol = Urls.getProtocol(url); if (protocol!=null) { if ("file".equals(protocol)) { url = ResourceUtils.tidyFileUrl(url); } result.add(new URL(url)); } else { String tidiedPath = Os.tidyPath(url); File tidiedFile = new File(tidiedPath); if (tidiedFile.isDirectory()) { List<File> toscan = Lists.newLinkedList(); toscan.add(tidiedFile); while (toscan.size() > 0) { File file = toscan.remove(0); if (file.isFile()) { if (file.getName().toLowerCase().endsWith(".jar")) { result.add(new URL("file://"+file.getAbsolutePath())); } } else if (file.isDirectory()) { for (File subfile : file.listFiles()) { toscan.add(subfile); } } else { log.info("Cannot read "+file+"; not a file or directory"); } } } else { <START> result.add(new URL("file://"+tidiedFile)); <END> } } return result; }</code><technical_language>tidiedFile.toUri.toUrl</technical_language>

Target:
public static List<URL> toJarUrls(String url) throws MalformedURLException { if (url==null) throw new NullPointerException("Cannot read from null"); if (url=="") throw new NullPointerException("Cannot read from empty string"); List<URL> result = Lists.newArrayList(); String protocol = Urls.getProtocol(url); if (protocol!=null) { if ("file".equals(protocol)) { url = ResourceUtils.tidyFileUrl(url); } result.add(new URL(url)); } else { String tidiedPath = Os.tidyPath(url); File tidiedFile = new File(tidiedPath); if (tidiedFile.isDirectory()) { List<File> toscan = Lists.newLinkedList(); toscan.add(tidiedFile); while (toscan.size() > 0) { File file = toscan.remove(0); if (file.isFile()) { if (file.getName().toLowerCase().endsWith(".jar")) { result.add(new URL("file://"+file.getAbsolutePath())); } } else if (file.isDirectory()) { for (File subfile : file.listFiles()) { toscan.add(subfile); } } else { log.info("Cannot read "+file+"; not a file or directory"); } } } else { result.add(tidiedFile.toURI().toURL()); } } return result; }
Source:
<code>public void testAcquire() throws Exception { final Environment env = Mockito.mock(Environment.class); final InetAddress address = Mockito.mock(InetAddress.class); final Environments server = Mockito.mock(Environments.class); Mockito.doReturn(env).when(server).acquire(); Mockito.doReturn(address).when(env).address(); MatcherAssert.assertThat( <START> env, Matchers.equalTo(server.acquire()) <END> ); MatcherAssert.assertThat( address, Matchers.equalTo(env.address()) ); Mockito.verify(env, Mockito.times(1)).address(); }</code><technical_language>be: MatcherAssert.assertThat( server.acquire(), Matchers.equalTo(env) )</technical_language>

Target:
public void testAcquire() throws Exception { final Environment env = Mockito.mock(Environment.class); final InetAddress address = Mockito.mock(InetAddress.class); final Environments server = Mockito.mock(Environments.class); Mockito.doReturn(env).when(server).acquire(); Mockito.doReturn(address).when(env).address(); MatcherAssert.assertThat( server.acquire(), Matchers.equalTo(env) ); MatcherAssert.assertThat( env.address() , Matchers.equalTo(address) ); Mockito.verify(env); }
Source:
<code>private synchronized void scheduleTaskIfNecessary(TaskHandle taskHandle) { if (taskHandle.getRunningLeafSplits() < min(minimumNumberOfDriversPerTask, taskHandle.getMaxDriversPerTask().orElse(Integer.MAX_VALUE))) { PrioritizedSplitRunner split = taskHandle.pollNextSplit(); <START> if (split != null) { <END> startSplit(split); splitQueuedTime.add(Duration.nanosSince(split.getCreatedNanos())); } } }</code><technical_language>a separate property taskHandle.getMinDriversPerTask. logic sense, e.g: schedule next task if taskHandle.getMaxDriversPerTask() drivers. exceed limit</technical_language>

Target:
private synchronized void scheduleTaskIfNecessary(TaskHandle taskHandle) { if (taskHandle.getRunningLeafSplits() < min(guaranteedNumberOfDriversPerTask, taskHandle.getMaxDriversPerTask().orElse(Integer.MAX_VALUE))) { PrioritizedSplitRunner split = taskHandle.pollNextSplit(); if (split != null) { startSplit(split); splitQueuedTime.add(Duration.nanosSince(split.getCreatedNanos())); } } }
Source:
<code>public void mouseClicked(final MouseEvent e) { try { VirtualFile virtualFile = editorDocOps.getVirtualFile(fileName, displayFileName, windowObjects.getFileNameContentsMap().get(fileName)); FileEditorManager.getInstance(windowObjects.getProject()). openFile(virtualFile, true, true); Document document = EditorFactory.getInstance().createDocument(windowObjects. getFileNameContentsMap().get(fileName)); editorDocOps.addHighlighting(windowObjects. getFileNameNumbersMap().get(fileName), document); editorDocOps.gotoLine(windowObjects. getFileNameNumbersMap().get(fileName).get(0), document); } catch (Exception exception) { exception.printStackTrace(); <START> } <END> }</code><technical_language>Notify user this? click filename in response? UX is destroyed here</technical_language>

Target:
public void mouseClicked(final MouseEvent e) { try { VirtualFile virtualFile = editorDocOps.getVirtualFile(fileName, displayFileName, windowObjects.getFileNameContentsMap().get(fileName)); FileEditorManager.getInstance(windowObjects.getProject()). openFile(virtualFile, true, true); Document document = EditorFactory.getInstance().createDocument(windowObjects. getFileNameContentsMap().get(fileName)); editorDocOps.addHighlighting(windowObjects. getFileNameNumbersMap().get(fileName), document); editorDocOps.gotoLine(windowObjects. getFileNameNumbersMap().get(fileName).get(0), document); } catch (Exception exception) { KBNotification.getInstance().error(exception); exception.printStackTrace(); } }
Source:
<code>public static Appenderator createOffline( DataSchema schema, AppenderatorConfig config, FireDepartmentMetrics metrics, DataSegmentPusher dataSegmentPusher, ObjectMapper objectMapper, IndexIO indexIO, IndexMerger indexMerger ) { return new AppenderatorImpl( schema, config, metrics, dataSegmentPusher, objectMapper, null, new DataSegmentAnnouncer() { @Override public void announceSegment(DataSegment segment) throws IOException { } @Override public void unannounceSegment(DataSegment segment) throws IOException { } @Override public void announceSegments(Iterable<DataSegment> segments) throws IOException { } @Override public void unannounceSegments(Iterable<DataSegment> segments) throws IOException { } @Override public boolean isAnnounced(DataSegment segment) { return false; } }, null, null, indexIO, indexMerger, <START> MapCache.create(500000), <END> new CacheConfig() ); }</code><technical_language>universal specifically MapCache (CaffeineCache is in-memory, local cache) of specific size. replace Appendirators AppendiratorBuilder, allows configure batteries of arguments one-by-one named configuration methods? distinguish "realtime" "offline" stages, e. g. in beginning of chain: java AppenderatorBuilder.offline() // .realtime(segmentAnnouncer) .setIndexMerger(...) .setCache(...) .build(); in end: java AppenderatorBuilder.create() .setIndexMerger(..) .setCache(..) .buildRealtime() // .buildOffline() in some other</technical_language>

Target:
public static Appenderator createOffline( DataSchema schema, AppenderatorConfig config, FireDepartmentMetrics metrics, DataSegmentPusher dataSegmentPusher, ObjectMapper objectMapper, IndexIO indexIO, IndexMerger indexMerger ) { return new AppenderatorImpl( schema, config, metrics, dataSegmentPusher, objectMapper, null, new DataSegmentAnnouncer() { @Override public void announceSegment(DataSegment segment) throws IOException { } @Override public void unannounceSegment(DataSegment segment) throws IOException { } @Override public void announceSegments(Iterable<DataSegment> segments) throws IOException { } @Override public void unannounceSegments(Iterable<DataSegment> segments) throws IOException { } @Override public boolean isAnnounced(DataSegment segment) { return false; } }, null, null, indexIO, indexMerger, null, null ); }
Source:
<code>private boolean isEnabled(ProviderFactory factory, Config.Scope scope) { if (!scope.getBoolean("enabled", true)) { return false; } if (factory instanceof EnvironmentDependentProviderFactory) { return ((EnvironmentDependentProviderFactory) factory).isSupported(); } if (factory instanceof FeatureDependentProviderFactory) { return Optional.ofNullable(((FeatureDependentProviderFactory) factory).getRequiredFeatures()).orElse(Collections.emptySet()) .stream().allMatch(requiredFeature -> Profile.isFeatureEnabled(requiredFeature)); <START> } <END> return true; }</code><technical_language>@stianst Is ok merge this additional feature in common services this PR, a separate PR (addition of FeatureDependentProviderFactory, handling here)</technical_language>

Target:
private boolean isEnabled(ProviderFactory factory, Config.Scope scope) { if (!scope.getBoolean("enabled", true)) { return false; } if (factory instanceof EnvironmentDependentProviderFactory) { return ((EnvironmentDependentProviderFactory) factory).isSupported(); } return true; }
Source:
<code>private void updateNics(List<NetworkInterfaceModel> nics) { nicList.clear(); Collections.sort(nics); List<NetworkGroup> groups = new ArrayList<>(); for (NetworkInterfaceModel nic : nics) { groups.add(new NetworkGroup(nic, eventBus, style)); } nicList.addAll(groups, !rendered); <START> nicGroups = groups; <END> }</code><technical_language>if assign local variable field, skip local variable field in method</technical_language>

Target:
private void updateNics(List<NetworkInterfaceModel> nics) { nicList.clear(); Collections.sort(nics); nicGroups = new ArrayList<>(); for (NetworkInterfaceModel nic : nics) { nicGroups.add(new NetworkGroup(nic, eventBus, style)); } nicList.addAll(nicGroups, !rendered); }
Source:
<code>void handleTerminationSignal() { <START> UserConsole.getLogger().info("Intercepted a signal, terminating job"); <END> killService.kill(KillService.KillSource.SYSTEM_SIGNAL); }</code><technical_language>signal a level concept of users. want more user friendly "received request quit..."</technical_language>

Target:
void handleTerminationSignal() { UserConsole.getLogger().info("Kill requested, terminating job"); killService.kill(KillService.KillSource.SYSTEM_SIGNAL); }
Source:
<code>public ContainerProcesses top(String container, String... psArgs) throws IOException { final List<Pair<String, ?>> headers = new ArrayList<>(2); headers.add(Pair.of("Content-Type", "text/plain")); headers.add(Pair.of("Content-Length", 0)); final DockerConnection connection = openConnection(dockerDaemonUri).method("GET") .path("/containers/" + container + "/top") .headers(headers); if (psArgs != null && psArgs.length != 0) { StringBuilder psArgsQueryBuilder = new StringBuilder(); <START> for (int i = 0, l = psArgs.length; i < l; i++) { <END> if (i > 0) { psArgsQueryBuilder.append('+'); } psArgsQueryBuilder.append(URLEncoder.encode(psArgs[i], "UTF-8")); } connection.query("ps_args", psArgsQueryBuilder.toString()); } try { final DockerResponse response = connection.request(); final int status = response.getStatus(); if (200 != status) { throw new DockerException(getDockerExceptionMessage(response), status); } return parseResponseStreamAndClose(response.getInputStream(), ContainerProcesses.class); } catch (JsonParseException e) { throw new IOException(e.getLocalizedMessage(), e); } finally { connection.close(); } }</code><technical_language>i understand this loop replaced <code>Arrays.stream</code> + <code>Stream.map</code> + <code>Collectors.joining</code></technical_language>

Target:
public ContainerProcesses top(String container, String... psArgs) throws IOException { final List<Pair<String, ?>> headers = new ArrayList<>(2); headers.add(Pair.of("Content-Type", MediaType.TEXT_PLAIN)); headers.add(Pair.of("Content-Length", 0)); final DockerConnection connection = openConnection(dockerDaemonUri).method("GET") .path("/containers/" + container + "/top") .headers(headers); if (psArgs != null && psArgs.length != 0) { StringBuilder psArgsQueryBuilder = new StringBuilder(); for (int i = 0, l = psArgs.length; i < l; i++) { if (i > 0) { psArgsQueryBuilder.append('+'); } psArgsQueryBuilder.append(URLEncoder.encode(psArgs[i], "UTF-8")); } connection.query("ps_args", psArgsQueryBuilder.toString()); } try { final DockerResponse response = connection.request(); final int status = response.getStatus(); if (OK.getStatusCode() != status) { throw new DockerException(getDockerExceptionMessage(response), status); } return parseResponseStreamAndClose(response.getInputStream(), ContainerProcesses.class); } catch (JsonParseException e) { throw new IOException(e.getLocalizedMessage(), e); } finally { connection.close(); } }
Source:
<code><START> private void removeFromMap(Map<String, Map<ServerLocationAndMemberId, LoadHolder>> map, <END> String[] groups, ServerLocation location, String memberId) { ServerLocationAndMemberId locationAndMemberId = new ServerLocationAndMemberId(location, memberId); for (String group : groups) { Map<ServerLocationAndMemberId, LoadHolder> groupMap = map.get(group); if (groupMap != null) { groupMap.remove(locationAndMemberId); if (groupMap.size() == 0) { map.remove(group); } } } Map groupMap = map.get(null); groupMap.remove(locationAndMemberId); }</code><technical_language>This is a new method be, leat, unit tested. package private, annotate @VisibleForTesting access LocatorLoadSnapshotJUnitTest and/or LocatorLoadSnapshotIntegrationTest</technical_language>

Target:
void removeFromMap(Map<String, Map<ServerLocationAndMemberId, LoadHolder>> map, String[] groups, ServerLocation location, String memberId) { ServerLocationAndMemberId locationAndMemberId = new ServerLocationAndMemberId(location, memberId); for (String group : groups) { Map<ServerLocationAndMemberId, LoadHolder> groupMap = map.get(group); if (groupMap != null) { groupMap.remove(locationAndMemberId); if (groupMap.size() == 0) { map.remove(group); } } } Map groupMap = map.get(null); groupMap.remove(locationAndMemberId); }
Source:
<code>public void initComponent() { final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(); boolean shownAlready; synchronized (propertiesComponent) { String storedVersion = propertiesComponent.getValue(GO_PROJECT_TUTORIAL_NOTIFICATION_SHOWN, "0.0"); shownAlready = VersionComparatorUtil.compare(storedVersion, PLUGIN_VERSION) == 0; if (!shownAlready) { propertiesComponent.setValue(GO_PROJECT_TUTORIAL_NOTIFICATION_SHOWN, PLUGIN_VERSION); } } if (shownAlready) { return; } <START> NotificationGroup group = NotificationGroup.findRegisteredGroup("Plugins Suggestion"); <END> if (group == null) { return; } final Notification notification = group.createNotification( "Learn how to setup a new Go project", "Please visit our " + "<a href=\"<LINK_0>\">wiki page<a/>" + " to learn how to setup a new Go project", NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER ); Notifications.Bus.notify(notification); }</code><technical_language>understand do need group. Notifications.Bus.notify(new Notification()); Group name created. 'Plugins Suggestion' is name, user able associate Plugin. 'Go'-group (it's in quick fixes) new 'Go' word</technical_language>

Target:
public void initComponent() { final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(); boolean shownAlready; synchronized (propertiesComponent) { String storedVersion = propertiesComponent.getValue(GO_PROJECT_TUTORIAL_NOTIFICATION_SHOWN, "0.0"); shownAlready = VersionComparatorUtil.compare(storedVersion, PLUGIN_VERSION) == 0; propertiesComponent.setValue(GO_PROJECT_TUTORIAL_NOTIFICATION_SHOWN, PLUGIN_VERSION); } if (shownAlready) { return; } Notifications.Bus.notify(new Notification( "Go plugin notifications", "Learn how to setup a new Go project", "Please visit our " + "<a href=\"<LINK_0>\">wiki page<a/>" + " to learn how to setup a new Go project", NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER)); }
Source:
<code>private void invokeQueuedHandlers(Object rv, Throwable throwable) { if (trace) log.tracef("Resuming invocation of command %s with %d handlers", command, queueSize()); while (true) { InvocationCallback function = queuePoll(); if (function == null) { if (throwable == null) { future.complete(rv); } else { future.completeExceptionally(throwable); } return; } try { if (throwable != null) { throwable = CompletableFutures.extractException(throwable); } rv = function.apply(ctx, command, rv, throwable); throwable = null; } catch (Throwable t) { rv = null; throwable = t; } if (rv instanceof InvocationStage) { InvocationStage currentStage = (InvocationStage) rv; if (!currentStage.isDone()) { <START> currentStage.toCompletableFuture().whenComplete(this); <END> return; } else { try { rv = currentStage.get(); } catch (Throwable t) { throwable = t; } } } } }</code><technical_language>suggestion currentStage.addCallback(ctx, command,this); else branch involves throwing catching exception, I if cheaper skip isDone() check call addCallback() instead</technical_language>

Target:
private void invokeQueuedHandlers(Object rv, Throwable throwable) { if (trace) log.tracef("Resuming invocation of command %s with %d handlers", command, queueSize()); while (true) { InvocationCallback function = queuePoll(); if (function == null) { if (throwable == null) { future.complete(rv); } else { future.completeExceptionally(throwable); } return; } try { if (throwable != null) { throwable = CompletableFutures.extractException(throwable); } rv = function.apply(ctx, command, rv, throwable); throwable = null; } catch (Throwable t) { rv = null; throwable = t; } if (rv instanceof InvocationStage) { InvocationStage currentStage = (InvocationStage) rv; currentStage.addCallback(ctx, command, this); return; } } }
Source:
<code>public void beforeCompletion() throws EJBException, RemoteException { <START> log.info("beforeCompletion called"); <END> checker.setSynchronizedBefore(); }</code><technical_language>log.trace</technical_language>

Target:
public void beforeCompletion() throws EJBException, RemoteException { log.trace("beforeCompletion called"); checker.setSynchronizedBefore(); }