auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Map<StoreKey, StoreKey> batchConvertReplicaMetadataResponseKeys(ReplicaMetadataResponse response) throws IOException { try { List<StoreKey> storeKeysToConvert = new ArrayList<>(); <START> for (int i = 0; i < response.getReplicaMetadataResponseInfoList().size(); i++) { <END> ReplicaMetadataResponseInfo replicaMetadataResponseInfo = response.getReplicaMetadataResponseInfoList().get(i); List<MessageInfo> messageInfoList = replicaMetadataResponseInfo.getMessageInfoList(); for (MessageInfo messageInfo : messageInfoList) { storeKeysToConvert.add(messageInfo.getStoreKey()); } } return storeKeyConverter.convert(storeKeysToConvert); } catch (Exception e) { throw new IOException("Problem with store key conversion", e); } }</code><technical_language>Simpler if iterator</technical_language>

Target:
private Map<StoreKey, StoreKey> batchConvertReplicaMetadataResponseKeys(ReplicaMetadataResponse response) throws IOException { try { List<StoreKey> storeKeysToConvert = new ArrayList<>(); for (ReplicaMetadataResponseInfo replicaMetadataResponseInfo : response.getReplicaMetadataResponseInfoList()) { for (MessageInfo messageInfo : replicaMetadataResponseInfo.getMessageInfoList()) { storeKeysToConvert.add(messageInfo.getStoreKey()); } } return storeKeyConverter.convert(storeKeysToConvert); } catch (Exception e) { throw new IOException("Problem with store key conversion", e); } }
Source:
<code><START> private void mocksForUpdateBeforeSave() { <END> ParseCurrentInstallationController controller = mock(ParseCurrentInstallationController.class); when(controller.isCurrent(any(ParseInstallation.class))).thenReturn(true); ParseCorePlugins.getInstance().registerCurrentInstallationController(controller); RobolectricPackageManager packageManager = spy(RuntimeEnvironment.getRobolectricPackageManager()); doReturn("parseTest").when(packageManager).getApplicationLabel(any(ApplicationInfo.class)); RuntimeEnvironment.setRobolectricPackageManager(packageManager); ParsePlugins.Android plugins = mock(ParsePlugins.Android.class); InstallationId installationId = mock(InstallationId.class); when(installationId.get()).thenReturn("installationId"); when(plugins.installationId()).thenReturn(installationId); when(plugins.applicationContext()).thenReturn(RuntimeEnvironment.application); ParsePlugins.set(plugins); }</code><technical_language>nit: static move bottom of class</technical_language>

Target:
private static void mocksForUpdateBeforeSave() { ParseCurrentInstallationController controller = mock(ParseCurrentInstallationController.class); when(controller.isCurrent(any(ParseInstallation.class))).thenReturn(true); ParseCorePlugins.getInstance().registerCurrentInstallationController(controller); RobolectricPackageManager packageManager = spy(RuntimeEnvironment.getRobolectricPackageManager()); doReturn("parseTest").when(packageManager).getApplicationLabel(any(ApplicationInfo.class)); RuntimeEnvironment.setRobolectricPackageManager(packageManager); ParsePlugins.Android plugins = mock(ParsePlugins.Android.class); InstallationId installationId = mock(InstallationId.class); when(installationId.get()).thenReturn("installationId"); when(plugins.installationId()).thenReturn(installationId); when(plugins.applicationContext()).thenReturn(RuntimeEnvironment.application); ParsePlugins.set(plugins); }
Source:
<code>private int getNotificationIdForPost(Post post) { <START> int remotePostId = 0; <END> try { remotePostId = Integer.parseInt(post.getRemotePostId()); } catch (NumberFormatException nfe) { } return post.getLocalTableBlogId() + remotePostId; }</code><technical_language>This simplified StringUtils.stringToInt()</technical_language>

Target:
private int getNotificationIdForPost(Post post) { int remotePostId = StringUtils.stringToInt(post.getRemotePostId()); return post.getLocalTableBlogId() + remotePostId; }
Source:
<code>public List<JobDetails> start() { scheduler.start(); List<JobDetails> backgroundJobs = new ArrayList<>(); Configuration configuration = configurationService.load("org.hawkular.metrics.jobs") .toBlocking().lastOrDefault(null); deleteTenant = new DeleteTenant(session, metricsService); Map<JobDetails, Integer> deleteTenantAttempts = new ConcurrentHashMap<>(); Func2<JobDetails, Throwable, RetryPolicy> deleteTenantRetryPolicy = (details, throwable) -> () -> { logger.warn("Execution of " + details + " failed", throwable); logger.info(details + " will be retried in 5 minutes"); return Minutes.minutes(5).toStandardDuration().getMillis(); }; scheduler.register(DeleteTenant.JOB_NAME, deleteTenant, deleteTenantRetryPolicy); Boolean compressionEnabled = Boolean.valueOf(configuration.get(CompressData.ENABLED_CONFIG, "true")); if(compressionEnabled) { <START> CompressData compressDataJob = new CompressData(metricsService, configurationService); <END> scheduler.register(CompressData.JOB_NAME, compressDataJob); maybeScheduleCompressData(backgroundJobs); } return backgroundJobs; }</code><technical_language>This is confusing.. compress jobs enabled settings, things</technical_language>

Target:
public List<JobDetails> start() { scheduler.start(); List<JobDetails> backgroundJobs = new ArrayList<>(); Configuration configuration = configurationService.load("org.hawkular.metrics.jobs") .toBlocking().lastOrDefault(null); deleteTenant = new DeleteTenant(session, metricsService); Map<JobDetails, Integer> deleteTenantAttempts = new ConcurrentHashMap<>(); Func2<JobDetails, Throwable, RetryPolicy> deleteTenantRetryPolicy = (details, throwable) -> () -> { logger.warn("Execution of " + details + " failed", throwable); logger.info(details + " will be retried in 5 minutes"); return Minutes.minutes(5).toStandardDuration().getMillis(); }; scheduler.register(DeleteTenant.JOB_NAME, deleteTenant, deleteTenantRetryPolicy); CompressData compressDataJob = new CompressData(metricsService, configurationService); scheduler.register(CompressData.JOB_NAME, compressDataJob); maybeScheduleCompressData(backgroundJobs); return backgroundJobs; }
Source:
<code>public void testApplyTo() { TaskRepository repository = fixture().createRepository(); AbstractRepositoryConnector connector = TasksUiPlugin.getConnector(repository.getConnectorKind()); AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repository.getConnectorKind()); EditRepositoryWizard wizard = new EditRepositoryWizard(repository); dialog = new WizardDialog(new Shell(), wizard); dialog.create(); ITaskRepositoryPage page = wizard.getSettingsPage(); <START> org.junit.Assert.assertNull("repository.getCategory() should be null", repository.getCategory()); <END> page.applyTo(repository); org.junit.Assert.assertEquals(TaskRepository.CATEGORY_BUGS, repository.getCategory()); }</code><technical_language>I ID</technical_language>

Target:
public void testApplyTo() { TaskRepository repository = fixture().createRepository(); EditRepositoryWizard wizard = new EditRepositoryWizard(repository); dialog = new WizardDialog(new Shell(), wizard); dialog.create(); ITaskRepositoryPage page = wizard.getSettingsPage(); org.junit.Assert.assertNull("repository.getCategory() should be null", repository.getCategory()); page.applyTo(repository); org.junit.Assert.assertEquals(TaskRepository.CATEGORY_BUGS, repository.getCategory()); }
Source:
<code>public void perform() throws MassiveException { final Faction faction1 = this.readArg(); final Faction faction2 = this.readArg(msenderFaction); Rel relationBetweenFactions = faction1.getRelationTo(faction2); String relationText = relationBetweenFactions.getColor().toString() + relationBetweenFactions.getDescFactionMany(); if (relationBetweenFactions == Rel.MEMBER && msenderFaction != faction1) relationText = "<silver>the same faction"; <START> msg(faction1.getName(msenderFaction) +"<i> and "+ faction2.getName(msenderFaction) +"<i> are "+ relationText + "<i>."); <END> }</code><technical_language>I this cleaner format syntax concatenation. is a var-arg version of msg method ends processing content parse command <LINK_0></technical_language>

Target:
public void perform() throws MassiveException { final Faction faction1 = this.readArg(); final Faction faction2 = this.readArg(msenderFaction); Rel relationBetweenFactions = faction1.getRelationTo(faction2); String relationText = relationBetweenFactions.getColor().toString() + relationBetweenFactions.getDescFactionMany(); if (relationBetweenFactions == Rel.MEMBER && msenderFaction != faction1) relationText = "<silver>the same faction"; msg( "%s <i>and %s <i>are %s<i>.", faction1.getName(msenderFaction), faction2.getName(msenderFaction), relationText); }
Source:
<code>void testConnection(boolean loginValid, String url) { <START> this.url.set(url); <END> try { if (isGuest()) { subscription = userRepository.status(url) .compose(applySchedulers()) .subscribe(new LoginSubscriber()); } else if (loginValid) { subscription = userRepository.login(url, username.get(), password.get()) .compose(applySchedulers()) .subscribe(new LoginSubscriber()); } } catch (IllegalArgumentException illArgE) { Log.e(TAG, illArgE.getMessage(), illArgE); loginError.setValue(illArgE); } }</code><technical_language>change url if tested successfully</technical_language>

Target:
void testConnection(boolean loginValid, String url) { testedUrl = url; try { if (isGuest()) { subscription = userRepository.status(url) .compose(applySchedulers()) .subscribe(new LoginSubscriber()); } else if (loginValid) { subscription = userRepository.login(url, username.get(), password.get()) .compose(applySchedulers()) .subscribe(new LoginSubscriber()); } } catch (IllegalArgumentException illArgE) { Log.e(TAG, illArgE.getMessage(), illArgE); loginError.setValue(illArgE); } }
Source:
<code>public final PlanNode optimize( PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { PlanNode result; long duration; try { long start = System.nanoTime(); result = doOptimize(plan, session, types, symbolAllocator, idAllocator); duration = System.nanoTime() - start; } catch (RuntimeException e) { stats.recordFailure(this); throw e; } stats.record(this, duration); return result; <START> } <END></code><technical_language>recording duration of 0 modifies stats in case of failure (I recall 0 meaningful data point is count metrics in TimeDistribution)</technical_language>

Target:
public final PlanNode optimize( PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { PlanNode result; long duration; try { long start = System.nanoTime(); result = delegate.optimize(plan, session, types, symbolAllocator, idAllocator); duration = System.nanoTime() - start; } catch (RuntimeException e) { stats.recordFailure(delegate); throw e; } stats.record(delegate, duration); return result; }
Source:
<code>public HdfsNotebookRepo(ZeppelinConfiguration conf) throws IOException { this.conf = conf; String hadoopConfDir = System.getenv("HADOOP_CONF_DIR"); <START> try { <END> rootDir = new Path(conf.getNotebookDir()); hdfsUtils = new HdfsUtils(conf.getNotebookDir(), hadoopConfDir); hdfsUtils.mkdirs(rootDir); } catch (URISyntaxException e) { throw new IOException(e); } }</code><technical_language>Is right exception caught HADOOP_CONF_DIR is defined</technical_language>

Target:
public HdfsNotebookRepo(ZeppelinConfiguration conf) throws IOException { this.conf = conf; try { rootDir = removeProtocol(conf.getNotebookDir()); hdfsSite = new HdfsSite(conf); hdfsSite.mkdirs(rootDir); } catch (URISyntaxException e) { throw new IOException(e); } }
Source:
<code>protected Map<Key<?>, ?> getValues(EntityZombie dataHolder) { Map<Key<?>, Object> values = Maps.newHashMap(); net.minecraft.entity.monster.ZombieType nativeType = dataHolder.getZombieType(); ZombieType type = ZombieUtils.typeFromNative(nativeType); values.put(Keys.ZOMBIE_TYPE, type); <START> if(type == ZombieTypes.VILLAGER) { <END> values.put(Keys.VILLAGER_ZOMBIE_PROFESSION, Optional.empty()); return values; } values.put(Keys.VILLAGER_ZOMBIE_PROFESSION, ZombieUtils.profFromNative(nativeType)); return values; }</code><technical_language>if (</technical_language>

Target:
protected Map<Key<?>, ?> getValues(EntityZombie dataHolder) { Map<Key<?>, Object> values = Maps.newHashMap(); net.minecraft.entity.monster.ZombieType nativeType = dataHolder.getZombieType(); ZombieType type = EntityUtil.typeFromNative(nativeType); values.put(Keys.ZOMBIE_TYPE, type); if (type != ZombieTypes.VILLAGER) { values.put(Keys.VILLAGER_ZOMBIE_PROFESSION, Optional.empty()); return values; } values.put(Keys.VILLAGER_ZOMBIE_PROFESSION, EntityUtil.profFromNative(nativeType)); return values; }
Source:
<code>private Widget createCodeTransformMenuButton() { if (codeTransform_ == null) { ImageResource icon = ThemeResources.INSTANCE.codeTransform(); ToolbarPopupMenu menu = new ToolbarPopupMenu(); menu.addItem(commands_.codeCompletion().createMenuItem(false)); menu.addSeparator(); menu.addItem(commands_.goToHelp().createMenuItem(false)); menu.addItem(commands_.goToFunctionDefinition().createMenuItem(false)); menu.addItem(commands_.findUsages().createMenuItem(false)); menu.addSeparator(); menu.addItem(commands_.extractFunction().createMenuItem(false)); menu.addItem(commands_.extractLocalVariable().createMenuItem(false)); menu.addSeparator(); menu.addItem(commands_.reflowComment().createMenuItem(false)); menu.addItem(commands_.commentUncomment().createMenuItem(false)); menu.addItem(commands_.insertRoxygenSkeleton().createMenuItem(false)); menu.addSeparator(); menu.addItem(commands_.reindent().createMenuItem(false)); menu.addItem(commands_.reformatCode().createMenuItem(false)); <START> menu.addItem(commands_.showDiagnosticsActiveDocument().createMenuItem(false)); <END> menu.addItem(commands_.showDiagnosticsProject().createMenuItem(false)); codeTransform_ = new ToolbarButton("", icon, menu); codeTransform_.setTitle("Code Tools"); } return codeTransform_; }</code><technical_language>a menu separator</technical_language>

Target:
private Widget createCodeTransformMenuButton() { if (codeTransform_ == null) { ImageResource icon = ThemeResources.INSTANCE.codeTransform(); ToolbarPopupMenu menu = new ToolbarPopupMenu(); menu.addItem(commands_.codeCompletion().createMenuItem(false)); menu.addSeparator(); menu.addItem(commands_.goToHelp().createMenuItem(false)); menu.addItem(commands_.goToFunctionDefinition().createMenuItem(false)); menu.addItem(commands_.findUsages().createMenuItem(false)); menu.addSeparator(); menu.addItem(commands_.extractFunction().createMenuItem(false)); menu.addItem(commands_.extractLocalVariable().createMenuItem(false)); menu.addSeparator(); menu.addItem(commands_.reflowComment().createMenuItem(false)); menu.addItem(commands_.commentUncomment().createMenuItem(false)); menu.addItem(commands_.insertRoxygenSkeleton().createMenuItem(false)); menu.addSeparator(); menu.addItem(commands_.reindent().createMenuItem(false)); menu.addItem(commands_.reformatCode().createMenuItem(false)); menu.addSeparator(); menu.addItem(commands_.showDiagnosticsActiveDocument().createMenuItem(false)); menu.addItem(commands_.showDiagnosticsProject().createMenuItem(false)); codeTransform_ = new ToolbarButton("", icon, menu); codeTransform_.setTitle("Code Tools"); } return codeTransform_; }
Source:
<code>public void testParsingNormalDate() { String dateString = "\"2014-11-06T20:16:45Z\""; Gson gson = newGson(); Date date = gson.fromJson(dateString, Date.class); <START> assertNotNull(date); <END> }</code><technical_language>verify Date parsed correctly well</technical_language>

Target:
public void testParsingNormalDate() { String dateString = "\"2014-11-06T20:16:45Z\""; Gson gson = newGson(); Date date = gson.fromJson(dateString, Date.class); Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); calendar.setTime(date); assertEquals(2014, calendar.get(Calendar.YEAR)); assertEquals(Calendar.NOVEMBER, calendar.get(Calendar.MONTH)); assertEquals(6, calendar.get(Calendar.DAY_OF_MONTH)); assertEquals(20, calendar.get(Calendar.HOUR_OF_DAY)); assertEquals(16, calendar.get(Calendar.MINUTE)); assertEquals(45, calendar.get(Calendar.SECOND)); }
Source:
<code>private List<AggregateStateId> fill(StandStorage storage, int count, Supplier<AggregateStateId<ProjectId>> idSupplier) { <START> List<AggregateStateId> ids = new LinkedList<>(); <END> for (int i = 0; i < count; i++) { AggregateStateId genericId = idSupplier.get(); Message state = newState(genericId); EntityRecord record = newRecord(state); storage.write(genericId, record); ids.add(genericId); } return ids; }</code><technical_language>Strictly saying, this new ArrayList<>(count);</technical_language>

Target:
private List<AggregateStateId> fill(StandStorage storage, int count, Supplier<AggregateStateId<ProjectId>> idSupplier) { List<AggregateStateId> ids = new ArrayList<>(count); for (int i = 0; i < count; i++) { AggregateStateId genericId = idSupplier.get(); Message state = newState(genericId); EntityRecord record = newRecord(state); storage.write(genericId, record); ids.add(genericId); } return ids; }
Source:
<code>private void recordInHistory( final ChatReceivedMessage chatReceivedMessage, final ChatterSession session) { CompletableFuture.runAsync( () -> lobbyChatHistoryDao.recordMessage(chatReceivedMessage, session.getApiKeyId()), <START> threadpool) <END> .exceptionally( e -> { log.error("Error recording chat message in database history table", e); return null; }); }</code><technical_language>Is a specific reason this threadpool default provided single argument overload of this method</technical_language>

Target:
private void recordInHistory( final ChatReceivedMessage chatReceivedMessage, final ChatterSession session) { CompletableFuture.runAsync( () -> lobbyChatHistoryDao.recordMessage(chatReceivedMessage, session.getApiKeyId())) .exceptionally( e -> { log.error("Error recording chat message in database history table", e); return null; }); }
Source:
<code>private void publishValueToItems(List<String> itemNames, WR3223CommandType wr3223CommandType, Object value) { <START> if (value != null) { <END> State state = null; if (wr3223CommandType.getItemClass() == NumberItem.class) { try { if (logger.isDebugEnabled()) { logger.debug("WR3223Binding.publishValueToItems: publish command with number ", wr3223CommandType.getCommand(), value.toString().trim()); } state = DecimalType.valueOf(value.toString().trim()); } catch (NumberFormatException nfe) { logger.error("Can't set value to item type because it's not a decimal number.", value, wr3223CommandType.getCommand()); } } else if (wr3223CommandType.getItemClass() == SwitchItem.class) { state = parseBooleanValue(value); if (logger.isDebugEnabled()) { logger.debug("WR3223 publish switch item to {}.", wr3223CommandType.getCommand(), state); } } else if (wr3223CommandType.getItemClass() == ContactItem.class) { state = parseBooleanValue(value) == OnOffType.ON ? OpenClosedType.CLOSED : OpenClosedType.OPEN; if (logger.isDebugEnabled()) { logger.debug("WR3223 publish contact item to {}.", wr3223CommandType.getCommand(), state); } } else { logger.error("Can't set value to item type {}.", value, wr3223CommandType.getCommand()); } if (state != null) { for (String itemName : itemNames) { eventPublisher.postUpdate(itemName, state); } } } else { logger.error("Can't set NULL value to item type {}.", wr3223CommandType.getCommand()); } }</code><technical_language>Consider inverting this if conditional reduce nesting</technical_language>

Target:
private void publishValueToItems(List<String> itemNames, WR3223CommandType wr3223CommandType, Object value) { if (value == null) { logger.error("Can't set NULL value to item type {}.", wr3223CommandType.getCommand()); return; } State state = null; if (wr3223CommandType.getItemClass() == NumberItem.class) { try { if (logger.isDebugEnabled()) { logger.debug("WR3223Binding.publishValueToItems: publish command with number ", wr3223CommandType.getCommand(), value.toString().trim()); } state = DecimalType.valueOf(value.toString().trim()); } catch (NumberFormatException nfe) { logger.error("Can't set value to item type because it's not a decimal number.", value, wr3223CommandType.getCommand()); } } else if (wr3223CommandType.getItemClass() == SwitchItem.class) { state = parseBooleanValue(value); if (logger.isDebugEnabled()) { logger.debug("WR3223 publish switch item to {}.", wr3223CommandType.getCommand(), state); } } else if (wr3223CommandType.getItemClass() == ContactItem.class) { state = parseBooleanValue(value) == OnOffType.ON ? OpenClosedType.CLOSED : OpenClosedType.OPEN; if (logger.isDebugEnabled()) { logger.debug("WR3223 publish contact item to {}.", wr3223CommandType.getCommand(), state); } } else { logger.error("Can't set value to item type {}.", value, wr3223CommandType.getCommand()); } if (state != null) { for (String itemName : itemNames) { eventPublisher.postUpdate(itemName, state); } } }
Source:
<code>private void register(Bundle parameters) throws Exception { final Map<String, String> parameterMap = new HashMap<>(); for (String key : parameters.keySet()) { parameterMap.put(key, parameters.getString(key)); } Response<ResponseBody> response = loginService.register(parameterMap).execute(); if (!response.isSuccessful()) { final int errorCode = response.code(); final String errorBody = response.errorBody().string(); <START> if ((errorCode == 400 || errorCode == 409) && !android.text.TextUtils.isEmpty(errorBody)) { <END> try { final FormFieldMessageBody body = gson.fromJson(errorBody, FormFieldMessageBody.class); if (body != null && body.size() > 0) { throw new RegistrationException(body); } } catch (JsonSyntaxException ex) { } } throw new HttpResponseStatusException(errorCode); } }</code><technical_language>difficult link this a static member variable (off in a constants file something) enum something? I tend magic numbers, common codes</technical_language>

Target:
private void register(Bundle parameters) throws Exception { final Map<String, String> parameterMap = new HashMap<>(); for (String key : parameters.keySet()) { parameterMap.put(key, parameters.getString(key)); } Response<ResponseBody> response = loginService.register(parameterMap).execute(); if (!response.isSuccessful()) { final int errorCode = response.code(); final String errorBody = response.errorBody().string(); if ((errorCode == HttpStatus.BAD_REQUEST || errorCode == HttpStatus.CONFLICT) && !android.text.TextUtils.isEmpty(errorBody)) { try { final FormFieldMessageBody body = gson.fromJson(errorBody, FormFieldMessageBody.class); if (body != null && body.size() > 0) { throw new RegistrationException(body); } } catch (JsonSyntaxException ex) { } } throw new HttpResponseStatusException(errorCode); } }
Source:
<code>private IStatus verifyContent() throws IOException { SignedContentFactory verifierFactory = ServiceHelper.getService(Activator.getContext(), SignedContentFactory.class); SignedContent signedContent; try { signedContent = verifierFactory.getSignedContent(inputFile); } catch (GeneralSecurityException e) { return new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, Messages.SignatureVerification_failedRead + inputFile, e); } catch (ZipException e) { return Status.OK_STATUS; } ArrayList<IStatus> allStatus = new ArrayList<>(0); SignedContentEntry[] entries = signedContent.getSignedEntries(); for (SignedContentEntry <START> entrie : <END> entries) { try { entrie.verify(); } catch (InvalidContentException e) { allStatus.add(new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, Messages.SignatureVerification_invalidContent + entrie.getName(), e)); }catch (OutOfMemoryError e) { allStatus.add(new Status(IStatus.ERROR, Activator.ID, Messages.SignatureVerifier_OutOfMemory, e)); break; } } if (allStatus.size() > 0) return new MultiStatus(Activator.ID, IStatus.ERROR, allStatus.toArray(new IStatus[allStatus.size()]), Messages.SignatureVerification_invalidFileContent + inputFile, null); return Status.OK_STATUS; }</code><technical_language>entry is proper name</technical_language>

Target:
private IStatus verifyContent() throws IOException { SignedContentFactory verifierFactory = ServiceHelper.getService(Activator.getContext(), SignedContentFactory.class); SignedContent signedContent; try { signedContent = verifierFactory.getSignedContent(inputFile); } catch (GeneralSecurityException e) { return new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, Messages.SignatureVerification_failedRead + inputFile, e); } catch (ZipException e) { return Status.OK_STATUS; } ArrayList<IStatus> allStatus = new ArrayList<>(0); SignedContentEntry[] entries = signedContent.getSignedEntries(); for (SignedContentEntry entry : entries) { try { entry.verify(); } catch (InvalidContentException e) { allStatus.add(new Status(IStatus.ERROR, Activator.ID, MirrorRequest.ARTIFACT_PROCESSING_ERROR, Messages.SignatureVerification_invalidContent + entry.getName(), e)); }catch (OutOfMemoryError e) { allStatus.add(new Status(IStatus.ERROR, Activator.ID, Messages.SignatureVerifier_OutOfMemory, e)); break; } } if (allStatus.size() > 0) return new MultiStatus(Activator.ID, IStatus.ERROR, allStatus.toArray(new IStatus[allStatus.size()]), Messages.SignatureVerification_invalidFileContent + inputFile, null); return Status.OK_STATUS; }
Source:
<code>public List<ReplicaId> getReplicaIdsByState(ReplicaState state, String dcName) { List<ReplicaId> replicas = new ArrayList<>(); <START> replicaIds.forEach(r -> { if (replicaAndState.get(r) == state && (dcName == null || r.getDataNodeId().getDatacenterName().equals(dcName))) { replicas.add(r); } }); <END> return replicas; }</code><technical_language>nit: this is a filter function, filter replicaIds.stream().filter(r -> replicaAndState.get(r) == state && (dcName == null || r.getDataNodeId().getDatacenterName().equals(dcName))).collect(Collections.toList());</technical_language>

Target:
public List<ReplicaId> getReplicaIdsByState(ReplicaState state, String dcName) { return replicaIds.stream() .filter(r -> replicaAndState.get(r) == state && (dcName == null || r.getDataNodeId() .getDatacenterName() .equals(dcName))) .collect(Collectors.toList()); }
Source:
<code>boolean isMetadataSynced() { MediaSession.QueueItem currItem = null; for (MediaSession.QueueItem item : getQueue()) { if (item.getQueueId() == getActiveQueueID()) { <START> currItem = item; <END> } } if (currItem == null || !queueItemToMetadata(currItem).getDescription() .equals(getMetadata().getDescription())) { if (DEBUG) { Log.d(TAG, "Metadata currently out of sync for Google Play Music"); Log.d(TAG, " └ Current queueItem: " + currItem); Log.d(TAG, " └ Current metadata : " + getMetadata().getDescription()); } return false; } return true; }</code><technical_language>break</technical_language>

Target:
boolean isMetadataSynced() { MediaSession.QueueItem currItem = null; for (MediaSession.QueueItem item : getQueue()) { if (item.getQueueId() == getActiveQueueID()) { currItem = item; break; } } if (currItem == null || !queueItemToMetadata(currItem).getDescription() .equals(getMetadata().getDescription())) { if (DEBUG) { Log.d(TAG, "Metadata currently out of sync for Google Play Music"); Log.d(TAG, " └ Current queueItem: " + currItem); Log.d(TAG, " └ Current metadata : " + getMetadata().getDescription()); } return false; } return true; }
Source:
<code>private void check() { try { final Properties props = new Properties(); final Session session = Session.getInstance(props); <START> final URLName urlName = new URLName( <END> "pop3", this.host, this.port, null, this.user, this.password ); final Store store = session.getStore(urlName); store.connect(); final Folder inbox = store.getFolder("inbox"); inbox.open(Folder.READ_WRITE); final FlagTerm unseen = new FlagTerm( new Flags(Flags.Flag.SEEN), false ); final Message[] messages = inbox.search(unseen); for (final Message each : messages) { this.action.run(each); } inbox.close(true); store.close(); } catch (final NoSuchProviderException ex) { throw new IllegalStateException(ex); } catch (final MessagingException ex) { throw new IllegalStateException(ex); } }</code><technical_language>@erimerturk rename this url name</technical_language>

Target:
private void check() throws MessagingException { Store store = null; Folder inbox = null; try { final Properties props = new Properties(); final Session session = Session.getInstance(props); final URLName url = new URLName( "pop3", this.host, this.port, null, this.user, this.password ); store = session.getStore(url); store.connect(); inbox = store.getFolder("inbox"); if (!inbox.exists()) { throw new IllegalStateException("inbox folder not exist!"); } inbox.open(Folder.READ_WRITE); final FlagTerm unseen = new FlagTerm( new Flags(Flags.Flag.SEEN), false ); for (final Message msg : inbox.search(unseen)) { this.action.run(msg); } } catch (final NoSuchProviderException ex) { throw new IllegalStateException(ex); } finally { inbox.close(true); store.close(); } }
Source:
<code>public static List<byte[]> extractFiles(InputStream rawIn, String boundary) { try { int maxLineSize = 1024; InputStream in = new BufferedInputStream(rawIn); String first = readLine(in, maxLineSize); if (!first.substring(2).equals(boundary)) throw new IllegalStateException("Incorrect boundary! " + boundary + " != " + first.substring(2)); <START> byte[] firstHeaders = readUntil("\r\n\r\n".getBytes(), in); <END> byte[] boundaryBytes = ("\r\n--" + boundary).getBytes(); List<byte[]> files = new ArrayList<>(); while (true) { byte[] file = readUntil(boundaryBytes, in); files.add(file); byte[] headers = readUntil("\r\n\r\n".getBytes(), in); if (headers.length == 0 || Arrays.equals(headers, "--".getBytes())) return files; } } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>nice a static final var for this double newline string constant is defined in palces</technical_language>

Target:
public static List<byte[]> extractFiles(InputStream rawIn, String boundary) { try { int maxLineSize = 1024; InputStream in = new BufferedInputStream(rawIn); String first = readLine(in, maxLineSize); if (!first.substring(2).equals(boundary)) throw new IllegalStateException("Incorrect boundary! " + boundary + " != " + first.substring(2)); byte[] firstHeaders = readUntil(DOUBLE_NEW_LINE, in); byte[] boundaryBytes = ("\r\n--" + boundary).getBytes(); List<byte[]> files = new ArrayList<>(); while (true) { byte[] file = readUntil(boundaryBytes, in); files.add(file); byte[] headers = readUntil(DOUBLE_NEW_LINE, in); if (headers.length == 0 || Arrays.equals(headers, "--".getBytes())) return files; } } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>public void testSendFailsIfExceptionThrown() throws MailException, ExecutionException, InterruptedException { <START> _thrown.expectCause(org.hamcrest.CoreMatchers.instanceOf(MailException.class)); <END> _server.stop(); final RenderedReport report = TestBeanFactory.createRenderedReportBuilder().build(); _sender.send( TestBeanFactory.createRecipientBuilder().build(), ImmutableMap.of(new HtmlReportFormat.Builder().build(), report) ).toCompletableFuture().get(); }</code><technical_language>nit. checkstyle rules allow static import if hamcrest</technical_language>

Target:
public void testSendFailsIfExceptionThrown() throws MailException, ExecutionException, InterruptedException { _thrown.expectCause(instanceOf(MailException.class)); _server.stop(); final RenderedReport report = TestBeanFactory.createRenderedReportBuilder().build(); _sender.send( TestBeanFactory.createRecipientBuilder().build(), ImmutableMap.of(new HtmlReportFormat.Builder().build(), report) ).toCompletableFuture().get(); }
Source:
<code>private void doRemove(final Object objectToRemove, final PersistTo persistTo, final ReplicateTo replicateTo) { ensureNotIterable(objectToRemove); maybeEmitEvent(new BeforeDeleteEvent<Object>(objectToRemove)); if (objectToRemove instanceof String) { execute(new BucketCallback<Boolean>() { @Override public Boolean doInBucket() throws InterruptedException, ExecutionException { try { RawJsonDocument deletedDoc = client.remove((String) objectToRemove, persistTo, replicateTo, RawJsonDocument.class); return deletedDoc != null; } catch (Exception e) { handleWriteResultError("Delete document failed: " + e.getMessage(), e); return false; } } }); maybeEmitEvent(new AfterDeleteEvent<Object>(objectToRemove)); return; } final CouchbaseDocument converted = new CouchbaseDocument(); converter.write(objectToRemove, converted); execute(new BucketCallback<Boolean>() { @Override public Boolean doInBucket() { try { <START> RawJsonDocument deletedDoc = client.remove((String) objectToRemove, persistTo, replicateTo, <END> RawJsonDocument.class); return deletedDoc != null; } catch (Exception e) { handleWriteResultError("Delete document failed: " + e.getMessage(), e); return false; } } }); maybeEmitEvent(new AfterDeleteEvent<Object>(objectToRemove)); }</code><technical_language>this copy-paste row 643 above. is wrong, running integration tests shown (compare code change)</technical_language>

Target:
private void doRemove(final Object objectToRemove, final PersistTo persistTo, final ReplicateTo replicateTo) { ensureNotIterable(objectToRemove); maybeEmitEvent(new BeforeDeleteEvent<Object>(objectToRemove)); if (objectToRemove instanceof String) { execute(new BucketCallback<Boolean>() { @Override public Boolean doInBucket() throws InterruptedException, ExecutionException { try { RawJsonDocument deletedDoc = client.remove((String) objectToRemove, persistTo, replicateTo, RawJsonDocument.class); return deletedDoc != null; } catch (Exception e) { handleWriteResultError("Delete document failed: " + e.getMessage(), e); return false; } } }); maybeEmitEvent(new AfterDeleteEvent<Object>(objectToRemove)); return; } final CouchbaseDocument converted = new CouchbaseDocument(); converter.write(objectToRemove, converted); execute(new BucketCallback<Boolean>() { @Override public Boolean doInBucket() { try { RawJsonDocument deletedDoc = client.remove(converted.getId(), persistTo, replicateTo , RawJsonDocument.class); return deletedDoc != null; } catch (Exception e) { handleWriteResultError("Delete document failed: " + e.getMessage(), e); return false; } } }); maybeEmitEvent(new AfterDeleteEvent<Object>(objectToRemove)); }
Source:
<code><START> public DataFetcherResult(T data, List<GraphQLError> errors) { <END> this.data = data; this.errors = requireNonNull(errors); }</code><technical_language>Assuming data null? Is annotation project mark nullable parameters</technical_language>

Target:
public DataFetcherResult(T data, List<GraphQLError> errors) { this.data = data; this.errors = unmodifiableList(assertNotNull(errors)); }
Source:
<code><START> private static String getenv(String name) { <END> String value = System.getenv(name); if (value == null) { logger.warning("Environment variable " + name + " is undefined"); value = "MISSING"; } return value; }</code><technical_language>IMO throw Exception logging error - failing deployment OK me, long user find out _why_ failure occurred. (If values specified, **the function work.**)</technical_language>

Target:
private static String getenv(String name) { String value = System.getenv(name); if (value == null) { logger.warning("Environment variable " + name + " was not set"); value = "MISSING"; } return value; }
Source:
<code>public static void writeResultsToFile(JsonObject submission) { String resultsFile = jstring(submission, RemoteContext.SUBMISSION_RESULTS_FILE); if(resultsFile == null) return; List<String> lines = new ArrayList<>(); JsonObject results_json = object(submission, RemoteContext.SUBMISSION_RESULTS); if(results_json == null) return; lines.add(results_json.toString()); try{ Files.write(Paths.get(resultsFile), lines); <START> } catch(IOException ioe){ <END> ioe.printStackTrace(); } }</code><technical_language>catch effectively ignore exceptions, submission fail</technical_language>

Target:
public static void writeResultsToFile(JsonObject submission) throws IOException { String resultsFile = jstring(submission, RemoteContext.SUBMISSION_RESULTS_FILE); if(resultsFile == null) return; JsonObject results_json = object(submission, RemoteContext.SUBMISSION_RESULTS); if(results_json == null) return; Files.write(Paths.get(resultsFile), results_json.toString().getBytes(StandardCharsets.UTF_8)); }
Source:
<code>private boolean puppetIsInstalled() throws IOException { int exitCode; try { exitCode = ProgramUtils.executeCommand( this.logger, <START> new String[]{"which", "puppet"}, <END> null, null); } catch (InterruptedException e) { exitCode = 1; } return exitCode == 0; }</code><technical_language>**puppet -v** instead, is more portable operating systems (yes, including Windows Mac)</technical_language>

Target:
private boolean puppetIsInstalled() throws IOException { int exitCode; try { exitCode = ProgramUtils.executeCommand( this.logger, new String[]{"puppet", "-v"}, null, null); } catch (InterruptedException | IOException e) { exitCode = 1; } return exitCode == 0; }
Source:
<code>private synchronized void scheduleRetry() { <START> schedExecutor.schedule(() -> updatePartitionInfo(), retrySleepTime, TimeUnit.MILLISECONDS); <END> retrySleepTime = Math.min(maxSleepTime, (long) (1.5 * retrySleepTime) + (long) (retrySleepTime * Math.random())); }</code><technical_language>IntelliJ is suggesting method reference this::updatePartitionInfo () -> updatePartitionInfo()</technical_language>

Target:
private synchronized void scheduleRetry() { schedExecutor.schedule(this::updatePartitionInfo, retrySleepTime, TimeUnit.MILLISECONDS); retrySleepTime = Math.min(maxSleepTime, (long) (1.5 * retrySleepTime) + (long) (retrySleepTime * Math.random())); }
Source:
<code><START> private void updateCopiedTemplateImages(List<DiskImage> copiedImagesList, <END> List<DiskImage> originaTemplatelmages, Guid storageDomainId) { List<DiskImage> clonedTemplateDiskImages = new ArrayList<>(getImages()); List<Guid> imagesContainedInStorageDomain = getImagesGuidFromStorage(storageDomainId, getStoragePoolId()); int index = 0; for (DiskImage templateDiskImage : clonedTemplateDiskImages) { if (storageDomainId.equals(originaTemplatelmages.get(index).getStorageIds().get(0))) { continue; } if (imagesContainedInStorageDomain.contains(templateDiskImage.getId())) { log.info("Found a copied image of '{}' on Storage Domain id '{}'", templateDiskImage.getId(), storageDomainId); templateDiskImage.getStorageIds().add(storageDomainId); } index++; } }</code><technical_language>copiedImagesList parameter</technical_language>

Target:
private void updateCopiedTemplateImages(List<DiskImage> copiedImagesList, List<DiskImage> originaTemplatelmages, Guid storageDomainId) { List<Guid> imagesContainedInStorageDomain = getImagesGuidFromStorage(storageDomainId, getStoragePoolId()); int index = 0; for (DiskImage templateDiskImage : copiedImagesList) { if (storageDomainId.equals(originaTemplatelmages.get(index).getStorageIds().get(0))) { continue; } if (imagesContainedInStorageDomain.contains(templateDiskImage.getId())) { log.info("Found a copied image of '{}' on Storage Domain id '{}'", templateDiskImage.getId(), storageDomainId); templateDiskImage.getStorageIds().add(storageDomainId); } index++; } }
Source:
<code><START> public final boolean hasSourceInfo() throws InvalidTokenException { <END> if (!hasSourceInfoBeenRequested) { Class<? extends NNode> nodeClass = getNNodeClass(); hasSourceInfo = HasSourceInfo.class.isAssignableFrom(nodeClass); hasSourceInfoBeenRequested = true; } return hasSourceInfo; }</code><technical_language>Definitively, JayceFormatException is right here. But, related this CL. I a question. Is NUMBER_VALUE a SourceInfo? If no, I is a good method return false, right</technical_language>

Target:
public final boolean hasSourceInfo() { if (!hasSourceInfoBeenRequested) { try { hasSourceInfo = HasSourceInfo.class.isAssignableFrom(getNNodeClass()); } catch (InvalidTokenException e) { hasSourceInfo = false; } finally { hasSourceInfoBeenRequested = true; } } return hasSourceInfo; }
Source:
<code>public void testUpdater() { IHttpUtil mockHttp = new MockHttpUtil(); Updater upd = new Updater(); upd = spy(upd); MockSystemClock clock = new MockSystemClock(); long now = System.currentTimeMillis(); clock.setCurrentTime(now); ServiceLocator.getInstance().putService(IHttpUtil.class, mockHttp); ServiceLocator.getInstance().putService(ISystemClock.class, clock); <START> doReturn(false).when(upd).wifiExclusiveAndUnavailable(Mockito.any(Context.class)); <END> assertFalse(upd.checkForUpdates(activity, "")); assertEquals(0, Updater.sLastUpdateCheck); assertFalse(upd.checkForUpdates(activity, null)); assertEquals(0, Updater.sLastUpdateCheck); assertTrue(upd.checkForUpdates(activity, "anything_else")); assertEquals("1.3.0", upd.stripBuildHostName("1.3.0.Victors-MBPr")); assertEquals("1.3.0", upd.stripBuildHostName("1.3.0")); }</code><technical_language>I generally this test, split up. testUpdater() method is meant test parsing of version numbers. test for version number parsing, a separate verify a checkForUpdates call returns false update sLastUpdate timestamp</technical_language>

Target:
public void testUpdater() { IHttpUtil mockHttp = new MockHttpUtil(); Updater upd = new Updater(); upd = spy(upd); MockSystemClock clock = new MockSystemClock(); long now = System.currentTimeMillis(); clock.setCurrentTime(now); ServiceLocator.getInstance().putService(IHttpUtil.class, mockHttp); ServiceLocator.getInstance().putService(ISystemClock.class, clock); doReturn(false).when(upd).wifiExclusiveAndUnavailable(Mockito.any(Context.class)); assertFalse(upd.checkForUpdates(activity, "")); assertFalse(upd.checkForUpdates(activity, null)); assertTrue(upd.checkForUpdates(activity, "anything_else")); assertEquals("1.3.0", upd.stripBuildHostName("1.3.0.Victors-MBPr")); assertEquals("1.3.0", upd.stripBuildHostName("1.3.0")); }
Source:
<code><START> public void modelComplete(boolean global) { <END> refresh(); waitCursor(false); }</code><technical_language>changing this API update job call this method. do differently though</technical_language>

Target:
public void modelComplete(boolean global) { refreshTree(); waitCursor(false); }
Source:
<code>public ClusterEventMonitor(ClusterStatusMonitor clusterStatusMonitor, String phaseName) { _phaseName = phaseName; _clusterStatusMonitor = clusterStatusMonitor; _duration = new HistogramDynamicMetric("DurationGauge", new Histogram( new SlidingTimeWindowArrayReservoir(HelixUtil <START> .getSystemPropertyAsLong(RESET_INTERVAL_SYSTEM_PROPERTY_KEY, DEFAULT_RESET_INTERVAL_MS), <END> TimeUnit.MILLISECONDS))); _count = new SimpleDynamicMetric("EventCounter", 0l); _maxDuration = new SimpleDynamicMetric("MaxSingleDurationGauge", 0l); _totalDuration = new SimpleDynamicMetric("TotalDurationCounter", 0l); }</code><technical_language>avoid duplicate code, create a protected method in parent class DynamicMBeanProvider get interval? logic fine me. Note RESET_INTERVAL_SYSTEM_PROPERTY_KEY DEFAULT_RESET_INTERVAL_MS there</technical_language>

Target:
public ClusterEventMonitor(ClusterStatusMonitor clusterStatusMonitor, String phaseName) { _phaseName = phaseName; _clusterStatusMonitor = clusterStatusMonitor; _duration = new HistogramDynamicMetric("DurationGauge", new Histogram( new SlidingTimeWindowArrayReservoir(getResetIntervalInMs(), TimeUnit.MILLISECONDS))); _count = new SimpleDynamicMetric("EventCounter", 0l); _maxDuration = new SimpleDynamicMetric("MaxSingleDurationGauge", 0l); _totalDuration = new SimpleDynamicMetric("TotalDurationCounter", 0l); }
Source:
<code>protected int doWork() { initializeAggregationState(); try { IOUtil.assertFileIsReadable(IOUtil.getPath(INPUT)); <START> if (VCF != null) IOUtil.assertFileIsReadable(IOUtil.getPath(VCF)); <END> IOUtil.assertFileIsReadable(REFERENCE_SEQUENCE); IOUtil.assertFilesAreReadable(INTERVALS); } catch (final IOException e) { log.error(e, "A problem occurred:", e.getMessage()); return 1; } final int returnValue = processData(); if (returnValue == 0) { log.info("Iteration complete, generating metric files"); aggregatorList.forEach(this::writeMetricsFileForAggregator); log.info(String.format("Examined %d loci, Processed %d loci, Skipped %d loci.\n" + "Computation took %d seconds.", nTotalLoci, nProcessedLoci, nSkippedLoci, progressLogger.getElapsedSeconds())); } return returnValue; }</code><technical_language>format lines if (VCF != null) { ... }</technical_language>

Target:
protected int doWork() { initializeAggregationState(); try { IOUtil.assertFileIsReadable(IOUtil.getPath(INPUT)); if (VCF != null) { IOUtil.assertFileIsReadable(IOUtil.getPath(VCF)); } IOUtil.assertFileIsReadable(REFERENCE_SEQUENCE); IOUtil.assertFilesAreReadable(INTERVALS); } catch (final IOException e) { log.error(e, "A problem occurred:", e.getMessage()); return 1; } final int returnValue = processData(); if (returnValue == 0) { log.info("Iteration complete, generating metric files"); aggregatorList.forEach(this::writeMetricsFileForAggregator); log.info(String.format("Examined %d loci, Processed %d loci, Skipped %d loci.\n" + "Computation took %d seconds.", nTotalLoci, nProcessedLoci, nSkippedLoci, progressLogger.getElapsedSeconds())); } return returnValue; }
Source:
<code>private static Element getDomainsElement(Document document, ISessionInfo session) { Element domainsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DOMAINS); for (IDomainInfo domain : session.getDomains()) { Element domainElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN); String domainType = SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL; <START> if (!domain.isKernel()) { <END> domainType = SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST; } addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_TYPE, domainType); String bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_PER_UID; switch (domain.getBufferType()) { case BUFFER_PER_UID: break; case BUFFER_PER_PID: bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_PER_PID; break; case BUFFER_SHARED: bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_GLOBAL; break; case BUFFER_TYPE_UNKNOWN: default: throw new IllegalArgumentException(Messages.SessionConfigXML_UnknownDomainBufferType); } addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_DOMAIN_BUFFER_TYPE, bufferType); domainElement.appendChild(getChannelsElement(document, domain.isKernel(), domain.getChannels())); domainsElement.appendChild(domainElement); } return domainsElement; }</code><technical_language>a java domain? In case, is wrong assume if is kernel is UST. I guess update IDomainInfo interface assumes is kernel UST. leave a todo here</technical_language>

Target:
private static Element getDomainsElement(Document document, ISessionInfo session) { Element domainsElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DOMAINS); for (IDomainInfo domain : session.getDomains()) { Element domainElement = document.createElement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN); String domainType = domain.isKernel() ? SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL : SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST; addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_TYPE, domainType); String bufferType = null; switch (domain.getBufferType()) { case BUFFER_PER_UID: bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_PER_UID; break; case BUFFER_PER_PID: bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_PER_PID; break; case BUFFER_SHARED: bufferType = SessionConfigStrings.CONFIG_BUFFER_TYPE_GLOBAL; break; case BUFFER_TYPE_UNKNOWN: default: throw new IllegalArgumentException(Messages.SessionConfigXML_UnknownDomainBufferType); } addElementContent(document, domainElement, SessionConfigStrings.CONFIG_ELEMENT_DOMAIN_BUFFER_TYPE, bufferType); domainElement.appendChild(getChannelsElement(document, domain.isKernel(), domain.getChannels())); domainsElement.appendChild(domainElement); } return domainsElement; }
Source:
<code>private void updateComponentCompletely(Component component, User user) { try { prepareComponent(component); <START> } catch (SW360Exception e) { <END> log.warn("Could not prepare component for complete deletion: " + component.getId(), e); return; } componentRepository.update(component); sendMailNotificationsForComponentUpdate(component, user.getEmail()); }</code><technical_language>I do this exception handling is appropriate. logging a warning is functionally equivalent ignoring exception I ignore it</technical_language>

Target:
private void updateComponentCompletely(Component component, User user) throws SW360Exception { prepareComponent(component); Component actual = componentRepository.get(component.getId()); assertNotNull(actual, "Could not find component to update!"); updateComponentInternal(component, actual, user); }