auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void initialise() { <START> sceneFinalFbo = displayResolutionDependentFBOs.get(SCENE_FINAL); <END> requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE); addDesiredStateChange(new BindFBO(DEFAULT_FRAME_BUFFER_URN, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial("engine:prog.defaultTextured")); }</code><technical_language>Hmmm... another instance of problem I flagged above: this node updates FBO contained in this variable resizing occurs? defaultFBOs supposed automagically date (and work), I this functionality needs added explicitly, i.e. making this node subscribe displayResolutionDependentFBOs</technical_language>

Target:
public void initialise() { sceneFinalFbo = displayResolutionDependentFBOs.get(FINAL_BUFFER); requiresCondition(() -> worldRenderer.getCurrentRenderStage() == MONO || worldRenderer.getCurrentRenderStage() == LEFT_EYE); addDesiredStateChange(new BindFBO(DEFAULT_FRAME_BUFFER_URN, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial("engine:prog.defaultTextured")); }
Source:
<code>private IResource getWorkspaceResourceFromGitPath(IPath gitPath) { Repository repository = Activator.getDefault().getRepositoryCache() .getRepository(gitPath); if (repository == null || repository.isBare()) { return null; } try { IPath repoRelativePath = gitPath.makeRelativeTo( new Path(repository.getWorkTree().getAbsolutePath())); IProject[] project = ProjectUtil.getProjectsContaining(repository, <START> Collections.singleton(repoRelativePath.toString())); <END> if (project != null && project.length > 0) { IPath projectRelativePath = gitPath .makeRelativeTo(project[0].getLocation()); IPath rootRelativePath = project[0].getFullPath() .append(projectRelativePath); return root.getFile(rootRelativePath); } } catch (CoreException e) { } return root.getFile(gitPath); }</code><technical_language>Arrays.asList? I grock do need a singleton here</technical_language>

Target:
private IResource getWorkspaceResourceFromGitPath(IPath gitPath) { Repository repository = Activator.getDefault().getRepositoryCache() .getRepository(gitPath); if (repository == null || repository.isBare()) { return null; } try { IPath repoRelativePath = gitPath.makeRelativeTo( new Path(repository.getWorkTree().getAbsolutePath())); IProject[] projects = ProjectUtil.getProjectsContaining(repository, Collections.singleton(repoRelativePath.toString())); if (projects.length > 0) { IPath projectRelativePath = gitPath .makeRelativeTo(projects[0].getLocation()); return projects[0].getFile(projectRelativePath); } } catch (CoreException e) { } return root.getFile(gitPath); }
Source:
<code>private void setNavDrawerSize() { float screenPercent = getResources().getInteger(R.integer.nav_drawer_screen_size_percent) * 0.01f; int width = (int) (getScreenWidth() * screenPercent); <START> int maxWidth = (int) dpInPx(getResources().getInteger(R.integer.nav_drawer_max_screen_size_dp)); <END> if (width > maxWidth) { width = maxWidth; } navDrawer.getLayoutParams().width = width; }</code><technical_language>store this in R.dimens prevent convert dp px</technical_language>

Target:
private void setNavDrawerSize() { if (drawerToggle == null) { return; } float screenPercent = getResources().getInteger(R.integer.nav_drawer_screen_size_percent) * 0.01f; int width = (int) (getScreenWidth() * screenPercent); int maxWidth = (int) getResources().getDimension(R.dimen.nav_drawer_max_screen_size); navDrawer.getLayoutParams().width = Math.min(width, maxWidth); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { <START> <END> RepositoryTreeNode selectedNode = getSelectedNodes(event).get(0); final String configName; if (selectedNode instanceof RemoteNode) { configName = ((RemoteNode) selectedNode).getObject(); } else if (selectedNode instanceof PushNode) { configName = ((RemoteNode) selectedNode.getParent()).getObject(); } else { return null; } WizardDialog dlg = new WizardDialog( getView(event).getSite().getShell(), new ConfigureRemoteWizard( selectedNode.getRepository(), configName, true)); dlg.open(); return null; }</code><technical_language>unnecessary blank line</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryTreeNode selectedNode = getSelectedNodes(event).get(0); final String configName; if (selectedNode instanceof RemoteNode) configName = ((RemoteNode) selectedNode).getObject(); else if (selectedNode instanceof PushNode) configName = ((RemoteNode) selectedNode.getParent()).getObject(); else return null; WizardDialog dlg = new WizardDialog( getView(event).getSite().getShell(), new ConfigureRemoteWizard( selectedNode.getRepository(), configName, true)); dlg.open(); return null; }
Source:
<code>public Item build() { try { <START> return item; <END> } catch (Exception e) { return handleException(e); } }</code><technical_language>a workspaceitem returned</technical_language>

Target:
public WorkspaceItem build() { return workspaceItem; }
Source:
<code>static void setServerErrorCodes(ServerErrorCode[] serverErrorCodesInOrder, PartitionId partition, MockServerLayout serverLayout) { List<? extends ReplicaId> replicas = partition.getReplicaIds(); if (serverErrorCodesInOrder.length > replicas.size()) { throw new IllegalArgumentException("More server error codes provided than replicas in partition"); } int numOfNodesEachDatacenter = 3; ServerErrorCode[] serverErrorCodesInOperationTrackerOrder = new ServerErrorCode[serverErrorCodesInOrder.length]; for (int i = 0; i < numOfNodesEachDatacenter; i++) { serverErrorCodesInOperationTrackerOrder[i] = serverErrorCodesInOrder[numOfNodesEachDatacenter - 1 - i]; } for (int i = numOfNodesEachDatacenter; i < serverErrorCodesInOrder.length; i++) { serverErrorCodesInOperationTrackerOrder[i] = serverErrorCodesInOrder[serverErrorCodesInOrder.length + numOfNodesEachDatacenter - 1 - i]; } int i = 0; for (ReplicaId replica : partition.getReplicaIds()) { DataNodeId node = replica.getDataNodeId(); MockServer mockServer = serverLayout.getMockServer(node.getHostname(), node.getPort()); <START> mockServer.setServerErrorForAllRequests(serverErrorCodesInOperationTrackerOrder[i++]); <END> } }</code><technical_language>change this loop in format of for(int i = 0; i < partition.getReplicaIds().size(); ++i). order is guaranteed in a safer way. (also guarantee order of mockServer/node)</technical_language>

Target:
static void setServerErrorCodes(ServerErrorCode[] serverErrorCodesInOrder, PartitionId partition, MockServerLayout serverLayout) { List<? extends ReplicaId> replicas = partition.getReplicaIds(); if (serverErrorCodesInOrder.length > replicas.size()) { throw new IllegalArgumentException("More server error codes provided than replicas in partition"); } int numOfNodesEachDatacenter = 3; List<ServerErrorCode> serverErrorInLocalDC = Arrays.asList(serverErrorCodesInOrder).subList(0, numOfNodesEachDatacenter); List<ServerErrorCode> serverErrorInOtherDCs = Arrays.asList(serverErrorCodesInOrder).subList(numOfNodesEachDatacenter, serverErrorCodesInOrder.length); Collections.reverse(serverErrorInLocalDC); Collections.reverse(serverErrorInOtherDCs); List<ServerErrorCode> serverErrorCodesInOperationTrackerOrder = new ArrayList<>(serverErrorInLocalDC); serverErrorCodesInOperationTrackerOrder.addAll(serverErrorInOtherDCs); for (int i = 0; i < partition.getReplicaIds().size(); i++) { DataNodeId node = partition.getReplicaIds().get(i).getDataNodeId(); MockServer mockServer = serverLayout.getMockServer(node.getHostname(), node.getPort()); mockServer.setServerErrorForAllRequests(serverErrorCodesInOperationTrackerOrder.get(i)); } }
Source:
<code>public Future<VdcReturnValueBase> executeAsyncCommand(final VdcActionType actionType, <START> final VdcActionParametersBase parameters) { <END> final CommandBase<?> command = CommandsFactory.createCommand(actionType, parameters); command.persistCommand(command.getParameters().getParentCommand(), true); try { return executor.submit(new Callable<VdcReturnValueBase>() { @Override public VdcReturnValueBase call() throws Exception { return executeCommand(command); } }); } catch (RejectedExecutionException ex) { command.setCommandStatus(CommandStatus.REJECTED); cmdCallBackMap.put(command.getCommandId(), command.getCallBack() == null ? new CommandCallBack() : command.getCallBack()); return null; } }</code><technical_language>need a provide engine lock in a lock right task is submitted entity locked operation is executed of case: HA VM run operation rejected (next try 10 sec) user start right stops VM 10 sec, try run VM I reject have: 1. audit log for user bad is 2. try execute command provide a pass context, including lock, lock entity here. lock passed command executed</technical_language>

Target:
public Future<VdcReturnValueBase> executeAsyncCommand(final VdcActionType actionType, final VdcActionParametersBase parameters) { final CommandBase<?> command = CommandsFactory.createCommand(actionType, parameters); command.persistCommand(command.getParameters().getParentCommand(), true); return executor.submit(new Callable<VdcReturnValueBase>() { @Override public VdcReturnValueBase call() throws Exception { return executeCommand(command); } }); }
Source:
<code>protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) { String type = getProfilingType(); if (ProviderLaunchConfigurationDelegate.getProviderIdToRun(type) == null) { <START> handleFail(Messages.ProviderLaunchShortcut_0 + type); <END> return null; } ILaunchConfiguration config = createConfiguration(bin, false); boolean exists = false; try { for (ILaunchConfiguration cfg : getLaunchManager().getLaunchConfigurations()){ if (areEqual(config, cfg)){ exists = true; } } } catch (CoreException e) { exists = true; } if (! exists) { createConfiguration(bin); } return super.findLaunchConfiguration(bin, mode); }</code><technical_language>a space ':' 'type'</technical_language>

Target:
protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) { String type = getProfilingType(); if (ProviderLaunchConfigurationDelegate.getProviderIdToRun(type) == null) { handleFail(Messages.ProviderLaunchShortcut_0 + " " + type); return null; } ILaunchConfiguration config = createConfiguration(bin, false); boolean exists = false; try { for (ILaunchConfiguration cfg : getLaunchManager().getLaunchConfigurations()){ if (areEqual(config, cfg)){ exists = true; } } } catch (CoreException e) { exists = true; } if (! exists) { createConfiguration(bin); } return super.findLaunchConfiguration(bin, mode); }
Source:
<code>public GlobalProperty saveGlobalProperty(GlobalProperty gp) throws APIException { if (gp.getProperty() != null && gp.getProperty().length() > 0) { if (gp.getProperty().equals(OpenmrsConstants.GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST)) { if (gp.getPropertyValue() != null && !gp.getPropertyValue().isEmpty() <START> && !gp.getPropertyValue().contains(LocaleUtility.getDefaultLocale().getLanguage())) { <END> gp.setPropertyValue(getAllowedLocales().toString().substring(1, getAllowedLocales().toString().length() - 1)); throw new APIException(Context.getMessageSourceService().getMessage( "general.locale.localeListNotIncludingDefaultLocale", new Object[] { LocaleUtility.getDefaultLocale() }, null)); } } else if (gp.getProperty().equals(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE)) { if (gp.getPropertyValue() != null && !gp.getPropertyValue().isEmpty()) { boolean containsLocale = false; for (Locale locale : getAllowedLocales()) { if (gp.getPropertyValue().startsWith(locale.getLanguage())) { containsLocale = true; } } if (!containsLocale) { String value = gp.getPropertyValue(); gp.setPropertyValue(LocaleUtility.getDefaultLocale().toString()); throw new APIException((Context.getMessageSourceService().getMessage( "general.locale.defaultNotInAllowedLocalesList", new Object[] { value }, null))); } } } CustomDatatypeUtil.saveIfDirty(gp); dao.saveGlobalProperty(gp); notifyGlobalPropertyChange(gp); return gp; } return gp; }</code><technical_language>compare locale objects - check if propertyValue is null is sufficient, check if is empty</technical_language>

Target:
public GlobalProperty saveGlobalProperty(GlobalProperty gp) throws APIException { if (gp.getProperty() != null && gp.getProperty().length() > 0) { if (gp.getProperty().equals(OpenmrsConstants.GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST)) { if (gp.getPropertyValue() != null) { List<Locale> localeList = new ArrayList<Locale>(); for (String localeString : gp.getPropertyValue().split(",")) { localeList.add(LocaleUtility.fromSpecification(localeString.trim())); } if (!localeList.contains(LocaleUtility.getDefaultLocale())) { gp.setPropertyValue(StringUtils.join(getAllowedLocales(), ", ")); throw new APIException(Context.getMessageSourceService().getMessage( "general.locale.localeListNotIncludingDefaultLocale", new Object[] { LocaleUtility.getDefaultLocale() }, null)); } } } else if (gp.getProperty().equals(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCALE)) { if (gp.getPropertyValue() != null) { List<Locale> localeList = getAllowedLocales(); if (!localeList.contains(LocaleUtility.fromSpecification(gp.getPropertyValue().trim()))) { String value = gp.getPropertyValue(); gp.setPropertyValue(LocaleUtility.getDefaultLocale().toString()); throw new APIException((Context.getMessageSourceService().getMessage( "general.locale.defaultNotInAllowedLocalesList", new Object[] { value }, null))); } } } CustomDatatypeUtil.saveIfDirty(gp); dao.saveGlobalProperty(gp); notifyGlobalPropertyChange(gp); return gp; } return gp; }
Source:
<code>private void updateLayoutType(String value) { layout = value; YoungAndroidListViewAddDataPropertyEditor editor = (YoungAndroidListViewAddDataPropertyEditor) properties.getProperty(PROPERTY_NAME_LISTVIEW_ADD_DATA).getEditor(); editor.setLayout(layout); <START> if(!currentItems.isEmpty()) { <END> createLabelItem(currentItems); } }</code><technical_language>Code style: space if</technical_language>

Target:
private void updateLayoutType(String value) { layout = Integer.parseInt(value); YoungAndroidListViewAddDataPropertyEditor editor = (YoungAndroidListViewAddDataPropertyEditor) properties.getProperty(PROPERTY_NAME_LISTVIEW_ADD_DATA).getEditor(); editor.setLayout(layout); if (!currentItems.isEmpty()) { createLabelItem(currentItems); } }
Source:
<code>public static int getStandardMargin(Context context) { Resources resources = context.getResources(); int marginStandard = dpFromPx(context, resources.getDimensionPixelSize(R.dimen.margin_standard)); <START> return marginStandard - FIELD_HORIZONTAL_MARGIN_MODIFIER; <END> }</code><technical_language>good move this contstant this file name WIDGET_ANSWER_STANDARD_MARGIN_MODIFIER</technical_language>

Target:
public static int getStandardMargin(Context context) { Resources resources = context.getResources(); int marginStandard = dpFromPx(context, resources.getDimensionPixelSize(R.dimen.margin_standard)); return marginStandard - WIDGET_ANSWER_STANDARD_MARGIN_MODIFIER; }
Source:
<code>RFileScanner(Opts opts) { if (!opts.auths.equals(Authorizations.EMPTY) && !opts.useSystemIterators) { throw new IllegalArgumentException("Set authorizations and specified not to use system iterators"); } this.opts = opts; if (opts.indexCacheSize > 0 || opts.dataCacheSize > 0) { <START> ConfigurationCopy cc = new ConfigurationCopy(); <END> cc.set(Property.TSERV_CACHE_FACTORY_IMPL, LruBlockCacheFactory.class.getName()); try { factory = BlockCacheFactory.getInstance(cc); } catch (Exception e) { throw new RuntimeException("Error creating BlockCacheFactory", e); } BlockCacheConfigurationHelper helper = null; if (opts.indexCacheSize > 0) { helper = new BlockCacheConfigurationHelper(cc, CacheType.INDEX, factory); helper.set(CacheType.ENABLED_SUFFIX, Boolean.TRUE.toString()); helper.set(BlockCacheConfiguration.BLOCK_SIZE_PROPERTY, Long.toString(CACHE_BLOCK_SIZE)); helper.set(BlockCacheConfiguration.MAX_SIZE_PROPERTY, Long.toString(opts.indexCacheSize)); } if (opts.dataCacheSize > 0) { if (null == helper) { helper = new BlockCacheConfigurationHelper(CacheType.DATA, factory); } else { helper.switchCacheType(CacheType.DATA); } helper.set(CacheType.ENABLED_SUFFIX, Boolean.TRUE.toString()); helper.set(BlockCacheConfiguration.BLOCK_SIZE_PROPERTY, Long.toString(CACHE_BLOCK_SIZE)); helper.set(BlockCacheConfiguration.MAX_SIZE_PROPERTY, Long.toString(opts.dataCacheSize)); } factory.start(helper.getConfiguration()); this.indexCache = factory.getBlockCache(CacheType.INDEX); if (null == indexCache) { this.indexCache = new NoopCache(); } this.dataCache = factory.getBlockCache(CacheType.DATA); if (null == this.dataCache) { this.dataCache = new NoopCache(); } } }</code><technical_language>RFileScanner opts.tableConfig allows user set accumulo properties. this create this cache. This allow a user change cache factory impl</technical_language>

Target:
RFileScanner(Opts opts) { if (!opts.auths.equals(Authorizations.EMPTY) && !opts.useSystemIterators) { throw new IllegalArgumentException("Set authorizations and specified not to use system iterators"); } this.opts = opts; if (opts.indexCacheSize > 0 || opts.dataCacheSize > 0) { ConfigurationCopy cc = new ConfigurationCopy(DefaultConfiguration.getInstance()); if (null != opts.tableConfig) { opts.tableConfig.forEach(cc::set); } try { blockCacheManager = BlockCacheManager.getClientInstance(cc); if (opts.indexCacheSize > 0) { cc.set(Property.TSERV_INDEXCACHE_SIZE, Long.toString(opts.indexCacheSize)); } if (opts.dataCacheSize > 0) { cc.set(Property.TSERV_DATACACHE_SIZE, Long.toString(opts.dataCacheSize)); } blockCacheManager.start(cc); this.indexCache = blockCacheManager.getBlockCache(CacheType.INDEX); this.dataCache = blockCacheManager.getBlockCache(CacheType.DATA); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } } if (null == indexCache) { this.indexCache = new NoopCache(); } if (null == this.dataCache) { this.dataCache = new NoopCache(); } }
Source:
<code>void removeSegment( final DataSegment segment, final DataSegmentChangeCallback callback, final boolean scheduleDrop ) { try { announcer.unannounceSegment(segment); segmentsToDelete.add(segment); Runnable runnable = new Runnable() { @Override public void run() { Status result = null; try { synchronized (lock) { if (segmentsToDelete.remove(segment)) { segmentManager.dropSegment(segment); File segmentInfoCacheFile = new File(config.getInfoDir(), segment.getIdentifier()); if (!segmentInfoCacheFile.delete()) { log.warn("Unable to delete segmentInfoCacheFile[%s]", segmentInfoCacheFile); } } } result = Status.SUCCESS; } catch (Exception e) { log.makeAlert(e, "Failed to remove segment! Possible resource leak!") .addData("segment", segment) .emit(); result = Status.failed(e.getMessage()); } finally { updateStatusAndResolveWaitingFutures(new SegmentChangeRequestDrop(segment), result); } } }; <START> if (scheduleDrop) { <END> log.info( "Completely removing [%s] in [%,d] millis", segment.getIdentifier(), config.getDropSegmentDelayMillis() ); exec.schedule( runnable, config.getDropSegmentDelayMillis(), TimeUnit.MILLISECONDS ); } } catch (Exception e) { log.makeAlert(e, "Failed to remove segment") .addData("segment", segment) .emit(); updateStatusAndResolveWaitingFutures(new SegmentChangeRequestDrop(segment), Status.failed(e.getMessage())); } finally { callback.execute(); } }</code><technical_language>Is me, if scheduleDrop==false this drop segment</technical_language>

Target:
private void removeSegment( final DataSegment segment, final DataSegmentChangeCallback callback, final boolean scheduleDrop ) { Status result = null; try { announcer.unannounceSegment(segment); segmentsToDelete.add(segment); Runnable runnable = new Runnable() { @Override public void run() { try { synchronized (lock) { if (segmentsToDelete.remove(segment)) { segmentManager.dropSegment(segment); File segmentInfoCacheFile = new File(config.getInfoDir(), segment.getIdentifier()); if (!segmentInfoCacheFile.delete()) { log.warn("Unable to delete segmentInfoCacheFile[%s]", segmentInfoCacheFile); } } } } catch (Exception e) { log.makeAlert(e, "Failed to remove segment! Possible resource leak!") .addData("segment", segment) .emit(); } } }; if (scheduleDrop) { log.info( "Completely removing [%s] in [%,d] millis", segment.getIdentifier(), config.getDropSegmentDelayMillis() ); exec.schedule( runnable, config.getDropSegmentDelayMillis(), TimeUnit.MILLISECONDS ); } else { runnable.run(); } result = Status.SUCCESS; } catch (Exception e) { log.makeAlert(e, "Failed to remove segment") .addData("segment", segment) .emit(); result = Status.failed(e.getMessage()); } finally { updateRequestStatus(new SegmentChangeRequestDrop(segment), result); callback.execute(); } }
Source:
<code><START> public static Map<String, String> getTermCounts(IndexReader reader, String termStr) throws IOException, ParseException { <END> EnglishAnalyzer ea = new EnglishAnalyzer(CharArraySet.EMPTY_SET); QueryParser qp = new QueryParser(LuceneDocumentGenerator.FIELD_BODY, ea); TermQuery q = (TermQuery)qp.parse(termStr); Term t = q.getTerm(); Map<String, String> termInfo = Map.ofEntries( Map.entry("rawTerm", termStr), Map.entry("stemmedTerm", q.toString(LuceneDocumentGenerator.FIELD_BODY)), Map.entry("collectionFreq", String.valueOf(reader.totalTermFreq(t))), Map.entry("docFreq", String.valueOf(reader.docFreq(t))) ); return termInfo; }</code><technical_language>separate methods? analyzeTerm return stemmed form? Then, getTermCounts return aMap<String, Long>, need turn numbers strings..</technical_language>

Target:
public static Map<String, Long> getTermCounts(IndexReader reader, String termStr) throws IOException, ParseException { EnglishAnalyzer ea = new EnglishAnalyzer(CharArraySet.EMPTY_SET); QueryParser qp = new QueryParser(LuceneDocumentGenerator.FIELD_BODY, ea); TermQuery q = (TermQuery) qp.parse(termStr); Term t = q.getTerm(); Map<String, Long> termInfo = Map.ofEntries( Map.entry("collectionFreq", reader.totalTermFreq(t)), Map.entry("docFreq", Long.valueOf(reader.docFreq(t))) ); return termInfo; }
Source:
<code>public JAXBContextWrapper(final Class<?>[] classes, final Map<String, Object> properties, JAXBConfig config) throws JAXBException { processConfig(config); try { if (System.getSecurityManager() == null) { wrappedContext = JAXBContext.newInstance(classes, properties); } else { wrappedContext = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBContext>() { @Override public JAXBContext run() throws JAXBException { return JAXBContext.newInstance(classes, properties); } }); } } catch (PrivilegedActionException paex) { <START> throw new JAXBException(paex.getMessage()); <END> } }</code><technical_language>I suggest change this JAXBException(paex.getMessage(), paex) , stacktrace of original exception</technical_language>

Target:
public JAXBContextWrapper(final Class<?>[] classes, final Map<String, Object> properties, JAXBConfig config) throws JAXBException { processConfig(config); try { if (System.getSecurityManager() == null) { wrappedContext = JAXBContext.newInstance(classes, properties); } else { wrappedContext = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBContext>() { @Override public JAXBContext run() throws JAXBException { return JAXBContext.newInstance(classes, properties); } }); } } catch (PrivilegedActionException paex) { throw new JAXBException(paex.getMessage(),paex); } }
Source:
<code>public synchronized void step() { world.step(); if ( null != solutionRecorder ) <START> { <END> solutionRecorder.appendStepEnd( ); } }</code><technical_language>allow this null? I generally prefer to</technical_language>

Target:
public synchronized void step() { world.step(); solutionRecorder.appendStepEnd( ); }
Source:
<code>protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitMethodDeclaration(@NotNull GoMethodDeclaration o) { super.visitMethodDeclaration(o); visitDeclaration(o, false); } @Override public void visitFunctionDeclaration(@NotNull GoFunctionDeclaration o) { super.visitFunctionDeclaration(o); if (GoTestFinder.isTestFile(o.getContainingFile()) && GoTestFunctionType.fromName(o.getName()) != null) { return; } visitDeclaration(o, true); } private void visitDeclaration(@NotNull GoFunctionOrMethodDeclaration o, boolean checkParameters) { GoSignature signature = o.getSignature(); if (signature == null) return; if (checkParameters) { GoParameters parameters = signature.getParameters(); visitParameterList(parameters.getParameterDeclarationList(), "parameter"); } GoResult result = signature.getResult(); GoParameters returnParameters = result != null ? result.getParameters() : null; if (returnParameters != null) { visitParameterList(returnParameters.getParameterDeclarationList(), "named return parameter"); } } private void visitParameterList(List<GoParameterDeclaration> parameters, String what) { Query<PsiReference> search; for (GoParameterDeclaration parameterDeclaration : parameters) { if (parameterDeclaration.getParamDefinitionList().isEmpty()) { search = ReferencesSearch.search(parameterDeclaration, parameterDeclaration.getUseScope()); if (search.findFirst() == null) { holder.registerProblem( parameterDeclaration, "Unused " + what, ProblemHighlightType.LIKE_UNUSED_SYMBOL, <START> new GoDeleteQuickFix("Remove " + what, parameterDeclaration.getElementType())); <END> } continue; } for (GoParamDefinition parameter : parameterDeclaration.getParamDefinitionList()) { ProgressManager.checkCanceled(); if (parameter.isBlank()) continue; search = ReferencesSearch.search(parameter, parameter.getUseScope()); if (search.findFirst() != null) continue; String paramName = parameter.getIdentifier().getText(); holder.registerProblem( parameter, "Unused " + what + " '" + paramName + "'", ProblemHighlightType.LIKE_UNUSED_SYMBOL, new GoRenameToBlankQuickFix(parameter), new GoDeleteQuickFix("Remove " + what, parameter.getElementType()) ); } } } }; }</code><technical_language>quick fix, fix change usages</technical_language>

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitMethodDeclaration(@NotNull GoMethodDeclaration o) { super.visitMethodDeclaration(o); visitDeclaration(holder, o.getSignature(), false); } @Override public void visitFunctionDeclaration(@NotNull GoFunctionDeclaration o) { super.visitFunctionDeclaration(o); if (GoTestFinder.isTestFile(o.getContainingFile()) && GoTestFunctionType.fromName(o.getName()) != null) { return; } visitDeclaration(holder, o.getSignature(), true); } @Override public void visitFunctionLit(@NotNull GoFunctionLit o) { super.visitFunctionLit(o); visitDeclaration(holder, o.getSignature(), true); } }; }
Source:
<code>private String getAssigneesStr(IAtsWorkItem workItem, ArtifactReadable action) { String results = ""; if (isShowHeaderFull()) { results = workItem.getStateMgr().getAssigneesStr(); } else { String currState = action.getSoleAttributeAsString(AtsAttributeTypes.CurrentState); String[] split = currState.split(";"); <START> String assignees = split[1]; <END> assignees = assignees.replaceAll("><", "; "); assignees = assignees.replaceAll(">", ""); assignees = assignees.replaceAll("<", ""); results = assignees; } return results; }</code><technical_language>this change is equivalent before. i this fixes anything</technical_language>

Target:
private String getAssigneesStr(IAtsWorkItem workItem, ArtifactReadable action) { String results = ""; if (isShowHeaderFull()) { results = workItem.getStateMgr().getAssigneesStr(); } else { String currState = action.getSoleAttributeAsString(AtsAttributeTypes.CurrentState); String[] split = currState.split(";"); if (split.length >= 2) { String assignees = split[1]; assignees = assignees.replaceAll("><", "; "); assignees = assignees.replaceAll(">", ""); assignees = assignees.replaceAll("<", ""); results = assignees; } } return results; }
Source:
<code>public static InfinispanContext getInstance() { <START> if (INSTANCE == null) { <END> Map<String, String> properties = new HashMap<String, String>() {{ put(HOST, System.getProperty(HOST, "127.0.0.1")); put(PORT, System.getProperty(PORT, "11222")); put(USERNAME, System.getProperty(USERNAME, "user")); put(PASSWORD, System.getProperty(PASSWORD, "user")); }}; INSTANCE = new InfinispanContext(properties); } return INSTANCE; }</code><technical_language>[Lazy holder](<LINK_0> pattern initialize INSTANCE field</technical_language>

Target:
public static InfinispanContext getInstance() { return LazyHolder.INSTANCE; }
Source:
<code>public void testComplete(TestPage test, TestSummary testSummary) { increaseCompletedTests(); if (firstFailure != null) { notifier.fireTestFailure(new Failure(descriptionFor(test), firstFailure)); fireTestFinishedFor(test); } else if (testSummary.getExceptions() > 0) { notifier.fireTestFailure(new Failure(descriptionFor(test), new Exception("Exception occurred on page " + test.getFullPath()))); fireTestFinishedFor(test); } else if (testSummary.getWrong() > 0) { notifier.fireTestFailure(new Failure(descriptionFor(test), new AssertionError("Test failures occurred on page " + test.getFullPath()))); fireTestFinishedFor(test); } else { fireTestFinishedFor(test); <START> } <END> }</code><technical_language>do single fireTestFinishedFor() if statement I suppose. docs a fireTestFinished event executed for fireTestStarted event</technical_language>

Target:
public void testComplete(TestPage test, TestSummary testSummary) { increaseCompletedTests(); if (firstFailure != null) { notifier.fireTestFailure(new Failure(descriptionFor(test), firstFailure)); } else if (testSummary.getExceptions() > 0) { notifier.fireTestFailure(new Failure(descriptionFor(test), new Exception("Exception occurred on page " + test.getFullPath()))); } else if (testSummary.getWrong() > 0) { notifier.fireTestFailure(new Failure(descriptionFor(test), new AssertionError("Test failures occurred on page " + test.getFullPath()))); } fireTestFinishedFor(test); }
Source:
<code>static void setPermissionsToOwnerOnly(File file) throws IOException { try { Method setReadable = File.class.getMethod("setReadable", boolean.class, boolean.class); Method setWritable = File.class.getMethod("setWritable", boolean.class, boolean.class); Method setExecutable = File.class.getMethod("setExecutable", boolean.class, boolean.class); if (!(Boolean) setReadable.invoke(file, false, false) || !(Boolean) setWritable.invoke(file, false, false) || !(Boolean) setExecutable.invoke(file, false, false)) { LOGGER.warning("unable to change permissions for everybody: " + file); } if (!(Boolean) setReadable.invoke(file, true, true) || !(Boolean) setWritable.invoke(file, true, true) || !(Boolean) setExecutable.invoke(file, true, true)) { LOGGER.warning("unable to change permissions for owner: " + file); } } catch (InvocationTargetException exception) { Throwable cause = exception.getCause(); Throwables.propagateIfPossible(cause, IOException.class); throw new RuntimeException(cause); } catch (NoSuchMethodException exception) { LOGGER.warning( "Unable to set permissions for " + file <START> + ", likely because you are running a version of Java prior to 1.6"); <END> } catch (SecurityException exception) { } catch (IllegalAccessException exception) { } catch (IllegalArgumentException exception) { } }</code><technical_language>Is this right error message here</technical_language>

Target:
static void setPermissionsToOwnerOnly(File file) { try { if (!file.setReadable(false, false) || !file.setWritable(false, false) || !file.setExecutable(false, false)) { LOGGER.warning("unable to change permissions for everybody: " + file); } if (!file.setReadable(true, true) || !file.setWritable(true, true) || !file.setExecutable(true, true)) { LOGGER.warning("unable to change permissions for owner: " + file); } } catch (SecurityException exception) { } catch (IllegalArgumentException exception) { } }
Source:
<code>private void addAttrsFromFile(XmlFile file) { Map<StyleableDefinitionImpl, String[]> parentMap = new HashMap<StyleableDefinitionImpl, String[]>(); final XmlDocument document = file.getDocument(); if (document == null) return; final XmlTag rootTag = document.getRootTag(); if (rootTag == null || !TAG_RESOURCES.equals(rootTag.getName())) return; String attrGroup = ""; for (XmlTag tag : rootTag.getSubTags()) { String tagName = tag.getName(); if (tagName.equals(TAG_ATTR)) { AttributeDefinition def = parseAttrTag(tag, null); if (def != null) { def.setAttrGroup(attrGroup); } } else if (tagName.equals(TAG_DECLARE_STYLEABLE)) { StyleableDefinitionImpl def = parseDeclareStyleableTag(tag, parentMap); if (def.getName().equals("Theme")) { parseAndAddAttrGroups(tag); } } else if (tagName.equals(TAG_EAT_COMMENT)) { String newAttrGroup = getCommentBeforeEatComment(tag); if (newAttrGroup.length() <= ATTR_GROUP_MAX_CHARACTERS) { attrGroup = newAttrGroup; } } } for (Map.Entry<StyleableDefinitionImpl, String[]> entry : parentMap.entrySet()) { StyleableDefinitionImpl definition = entry.getKey(); String[] parentNames = entry.getValue(); for (String parentName : parentNames) { StyleableDefinitionImpl parent = getStyleableByName(parentName); if (parent != null) { definition.addParent(parent); parent.addChild(definition); } else { LOG.info("Found tag with unknown parent: " + parentName); } } } }</code><technical_language>double space "are"</technical_language>

Target:
private void addAttrsFromFile(XmlFile file) { Map<StyleableDefinitionImpl, String[]> parentMap = new HashMap<StyleableDefinitionImpl, String[]>(); final XmlDocument document = file.getDocument(); if (document == null) return; final XmlTag rootTag = document.getRootTag(); if (rootTag == null || !TAG_RESOURCES.equals(rootTag.getName())) return; String attrGroup = ""; for (XmlTag tag : rootTag.getSubTags()) { String tagName = tag.getName(); if (tagName.equals(TAG_ATTR)) { AttributeDefinition def = parseAttrTag(tag, null); if (def != null) { def.setAttrGroup(attrGroup); } } else if (tagName.equals(TAG_DECLARE_STYLEABLE)) { StyleableDefinitionImpl def = parseDeclareStyleableTag(tag, parentMap); if (def != null && def.getName().equals("Theme")) { parseAndAddAttrGroups(tag); } } else if (tagName.equals(TAG_EAT_COMMENT)) { String newAttrGroup = getCommentBeforeEatComment(tag); if (newAttrGroup.length() <= ATTR_GROUP_MAX_CHARACTERS) { attrGroup = newAttrGroup; } } } for (Map.Entry<StyleableDefinitionImpl, String[]> entry : parentMap.entrySet()) { StyleableDefinitionImpl definition = entry.getKey(); String[] parentNames = entry.getValue(); for (String parentName : parentNames) { StyleableDefinitionImpl parent = getStyleableByName(parentName); if (parent != null) { definition.addParent(parent); parent.addChild(definition); } else { LOG.info("Found tag with unknown parent: " + parentName); } } } }
Source:
<code>private String getMcqAddInfo(FeedbackMcqQuestionDetails questionDetails) { <START> String additionalInfo = "Multiple-choice (single answer) question options:\n"; <END> return appendMultiChoiceInfo(additionalInfo, questionDetails.getGenerateOptionsFor(), questionDetails.getMcqChoices(), questionDetails.isOtherEnabled()); }</code><technical_language>\n -> System.lineSeparator(). Similarly in other parts of this file</technical_language>

Target:
private String getMcqAddInfo(FeedbackMcqQuestionDetails questionDetails) { String additionalInfo = "Multiple-choice (single answer) question options:" + System.lineSeparator(); return appendMultiChoiceInfo(additionalInfo, questionDetails.getGenerateOptionsFor(), questionDetails.getMcqChoices(), questionDetails.isOtherEnabled()); }
Source:
<code>private static String[] generateEmptyStrings(int num) { <START> String[] strings = new String[num]; <END> for (int i = 0; i < num; ++i) { strings[i] = ""; } return strings; }</code><technical_language>do: String[] strings = new String[num]; Arrays.fill(strings, ""); return strings; ? :)</technical_language>

Target:
private String[] generateEmptyStrings(int num) { String[] strings = new String[num]; Arrays.fill(strings, ""); return strings; }
Source:
<code>public void testMovePlan() { final Plan plan = PlanImpl.newBuilder() .addTransferStep(Constants.NAMESPACE_WORKER, <START> new TransferStepImpl(EVAL_ID_PREFIX + 0, EVAL_ID_PREFIX + 1, new DataInfoImpl())) <END> .addTransferStep(Constants.NAMESPACE_WORKER, new TransferStepImpl(EVAL_ID_PREFIX + 2, EVAL_ID_PREFIX + 3, new DataInfoImpl())) .addTransferStep(Constants.NAMESPACE_SERVER, new TransferStepImpl(EVAL_ID_PREFIX + 4, EVAL_ID_PREFIX + 5, new DataInfoImpl())) .addTransferStep(Constants.NAMESPACE_SERVER, new TransferStepImpl(EVAL_ID_PREFIX + 6, EVAL_ID_PREFIX + 7, new DataInfoImpl())) .build(); final ETPlan etPlan = compiler.compile(plan, 0); final Set<Op> initialOps = etPlan.getInitialOps(); assertEquals(4, initialOps.size()); initialOps.forEach(op -> { assertEquals(Op.OpType.MOVE, op.getOpType()); assertTrue(etPlan.onComplete(op).isEmpty()); }); }</code><technical_language>new DataInfoImpl() is called times; a static constant (e.g., DUMMY_DATA)</technical_language>

Target:
public void testMovePlan() { final Plan plan = PlanImpl.newBuilder() .addTransferStep(Constants.NAMESPACE_WORKER, new TransferStepImpl(EVAL_ID_PREFIX + 0, EVAL_ID_PREFIX + 1, DUMMY_DATA_INFO)) .addTransferStep(Constants.NAMESPACE_WORKER, new TransferStepImpl(EVAL_ID_PREFIX + 2, EVAL_ID_PREFIX + 3, DUMMY_DATA_INFO)) .addTransferStep(Constants.NAMESPACE_SERVER, new TransferStepImpl(EVAL_ID_PREFIX + 4, EVAL_ID_PREFIX + 5, DUMMY_DATA_INFO)) .addTransferStep(Constants.NAMESPACE_SERVER, new TransferStepImpl(EVAL_ID_PREFIX + 6, EVAL_ID_PREFIX + 7, DUMMY_DATA_INFO)) .build(); final int numAvailableEvals = 0; final ETPlan etPlan = compiler.compile(plan, numAvailableEvals); final Set<Op> initialOps = etPlan.getInitialOps(); assertEquals(4, initialOps.size()); initialOps.forEach(op -> { assertEquals(Op.OpType.MOVE, op.getOpType()); assertTrue(etPlan.onComplete(op).isEmpty()); }); }
Source:
<code>public void createSubscription(final String subscriptionId, final List<String> topics, final List<Cursor> cursors) { try { createPersistentEmptyNode("/nakadi/subscriptions/%s", subscriptionId); createPersistentEmptyNode("/nakadi/subscriptions/%s/topology", subscriptionId); for (final String topic : topics) { createPersistentEmptyNode("/nakadi/subscriptions/%s/topics/%s", subscriptionId, topic); createPersistentEmptyNode("/nakadi/subscriptions/%s/topics/%s/partitions", subscriptionId, topic); } for (final Cursor cursor: cursors) { final String path = String.format("/nakadi/subscriptions/%s/topics/%s/partitions/%s", subscriptionId, cursor.getTopic(), cursor.getPartition()); zooKeeperHolder .get() <START> .create() <END> .forPath(path, cursor.getOffset().getBytes()); } } catch (Exception e) { throw new NakadiRuntimeException("Error when tried to create subscription in ZooKeeper", e); } }</code><technical_language>creatingParentsIfNeeded() unnecessary create parent folders lines 24 [26-29]</technical_language>

Target:
public void createSubscription(final String subscriptionId, final List<String> topics, final List<Cursor> cursors) { try { createPersistentEmptyNode("/nakadi/subscriptions/%s/topology", subscriptionId); for (final Cursor cursor: cursors) { final String path = String.format("/nakadi/subscriptions/%s/topics/%s/partitions/%s", subscriptionId, cursor.getTopic(), cursor.getPartition()); zooKeeperHolder .get() .create() .creatingParentsIfNeeded() .forPath(path, cursor.getOffset().getBytes()); } } catch (Exception e) { throw new NakadiRuntimeException("Error when tried to create subscription in ZooKeeper", e); } }
Source:
<code>public void computeAABB(final AABB aabb, final Transform xf, int childIndex) { final Vec2 lower = aabb.lowerBound; final Vec2 upper = aabb.upperBound; final Vec2 v1 = m_vertices[0]; final float xfqc = xf.q.c; final float xfqs = xf.q.s; final float xfpx = xf.p.x; final float xfpy = xf.p.y; lower.x = (xfqc * v1.x - xfqs * v1.y) + xfpx; <START> lower.y = xfqs * v1.x + xfqc * v1.y + xfpy; <END> upper.x = lower.x; upper.y = lower.y; for (int i = 1; i < vertexCount; ++i) { Vec2 v2 = m_vertices[i]; float vx = (xfqc * v2.x - xfqs * v2.y) + xfpx; float vy = xfqs * v2.x + xfqc * v2.y + xfpy; lower.x = lower.x < vx ? lower.x : vx; lower.y = lower.y < vy ? lower.y : vy; upper.x = upper.x > vx ? upper.x : vx; upper.y = upper.y > vy ? upper.y : vy; } lower.x -= getRadius(); lower.y -= getRadius(); upper.x += getRadius(); upper.y += getRadius(); }</code><technical_language>Please revert equations consistent. new assert lines fine</technical_language>

Target:
public void computeAABB(final AABB aabb, final Transform xf, int childIndex) { final Vec2 lower = aabb.lowerBound; final Vec2 upper = aabb.upperBound; final Vec2 v1 = m_vertices[0]; final float xfqc = xf.q.c; final float xfqs = xf.q.s; final float xfpx = xf.p.x; final float xfpy = xf.p.y; lower.x = (xfqc * v1.x - xfqs * v1.y) + xfpx; lower.y = (xfqs * v1.x + xfqc * v1.y) + xfpy; upper.x = lower.x; upper.y = lower.y; for (int i = 1; i < vertexCount; ++i) { Vec2 v2 = m_vertices[i]; float vx = (xfqc * v2.x - xfqs * v2.y) + xfpx; float vy = xfqs * v2.x + xfqc * v2.y + xfpy; lower.x = lower.x < vx ? lower.x : vx; lower.y = lower.y < vy ? lower.y : vy; upper.x = upper.x > vx ? upper.x : vx; upper.y = upper.y > vy ? upper.y : vy; } lower.x -= getRadius(); lower.y -= getRadius(); upper.x += getRadius(); upper.y += getRadius(); }
Source:
<code>public Set<X509Certificate> getCertificates() { synchronized (mLock) { if (mCertificates != null) { return mCertificates; } try { Set<X509Certificate> certificates = new ArraySet<>(mKeyStore.size()); for (Enumeration<String> en = mKeyStore.aliases(); en.hasMoreElements();) { final String alias = en.nextElement(); <START> final X509Certificate cert = (X509Certificate) mKeyStore.getCertificate(alias); <END> if (cert != null) { certificates.add(cert); } } mCertificates = certificates; return mCertificates; } catch (KeyStoreException e) { throw new RuntimeException("Failed to load certificates from KeyStore", e); } } }</code><technical_language>KeyStore types of entries: secret key, private key + cert chain, trusted (CA) cert. getCertificate returns a non-null cert for entry types. However, code include trusted (CA) certs ignore private key + cert chain entries. fix this, filter KeyStore.isCertificateEntry(alias) KeyStore.getEntry instanceof KeyStore.TrustedCertificateEntry</technical_language>

Target:
public Set<X509Certificate> getCertificates() { synchronized (mLock) { if (mCertificates != null) { return mCertificates; } try { Set<X509Certificate> certificates = new ArraySet<>(mKeyStore.size()); for (Enumeration<String> en = mKeyStore.aliases(); en.hasMoreElements();) { String alias = en.nextElement(); if (!mKeyStore.isCertificateEntry(alias)) { continue; } X509Certificate cert = (X509Certificate) mKeyStore.getCertificate(alias); if (cert != null) { certificates.add(cert); } } mCertificates = certificates; return mCertificates; } catch (KeyStoreException e) { throw new RuntimeException("Failed to load certificates from KeyStore", e); } } }
Source:
<code><START> public static String networkPrefixLengthToNetmask(int prefixLength) { <END> if (prefixLength > 31 || prefixLength < 1) { throw new IllegalArgumentException("Network prefix length is not within bounds"); } int ipv4Netmask = 0xFFFFFFFF; ipv4Netmask <<= (32 - prefixLength); byte[] octets = new byte[] { (byte) (ipv4Netmask >>> 24), (byte) (ipv4Netmask >>> 16), (byte) (ipv4Netmask >>> 8), (byte) ipv4Netmask }; String result = ""; for (int i = 0; i < 4; i++) { result += octets[i] & 0xff; if (i < 3) { result += "."; } } return result; }</code><technical_language>null annotation</technical_language>

Target:
public static @NonNull String networkPrefixLengthToNetmask(int prefixLength) { if (prefixLength > 31 || prefixLength < 1) { throw new IllegalArgumentException("Network prefix length is not within bounds"); } int ipv4Netmask = 0xFFFFFFFF; ipv4Netmask <<= (32 - prefixLength); byte[] octets = new byte[] { (byte) (ipv4Netmask >>> 24), (byte) (ipv4Netmask >>> 16), (byte) (ipv4Netmask >>> 8), (byte) ipv4Netmask }; String result = ""; for (int i = 0; i < 4; i++) { result += octets[i] & 0xff; if (i < 3) { result += "."; } } return result; }
Source:
<code>private void createMarkers() { Collection<FileInfo> files = fRevisionInContext.getFiles().values(); deleteAllMarkers(); for (FileInfo fileInfo : files) { IResource workspaceFile = new OpenCompareEditor(fGerritClient, fChangeInfo) .getCorrespondingWorkspaceFile(fileInfo); if (workspaceFile == null) { workspaceFile = ResourcesPlugin.getWorkspace().getRoot(); } EList<CommentInfo> sortedComments = ModelHelpers.sortComments(fileInfo.getAllComments()); boolean addingMarker = false; for (CommentInfo commentInfo : sortedComments) { addMarker(commentInfo, workspaceFile); addingMarker = true; } if (addingMarker) { <START> openMarkerView(); <END> } } }</code><technical_language>I this code is necessary method invoking this method is opening marker view on</technical_language>

Target:
private void createMarkers() { Collection<FileInfo> files = fRevisionInContext.getFiles().values(); deleteAllMarkers(); for (FileInfo fileInfo : files) { IResource workspaceFile = new OpenCompareEditor(fGerritClient, fChangeInfo) .getCorrespondingWorkspaceFile(fileInfo); if (workspaceFile == null) { workspaceFile = ResourcesPlugin.getWorkspace().getRoot(); } EList<CommentInfo> sortedComments = ModelHelpers.sortComments(fileInfo.getAllComments()); boolean addingMarker = false; for (CommentInfo commentInfo : sortedComments) { addMarker(commentInfo, workspaceFile); addingMarker = true; } if (addingMarker) { openMarkerView(IWorkbenchPage.VIEW_CREATE); } } }
Source:
<code>public Calendar getSummary_date() { <START> SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); <END> Calendar calendar = Calendar.getInstance(); try { Date date = format.parse(this.summary_date); calendar.setTime(date); } catch (ParseException e) { } return calendar; }</code><technical_language>extract a constant</technical_language>

Target:
public Calendar getSummary_date() { final SimpleDateFormat format = new SimpleDateFormat(enphaseDateFormatString); Calendar calendar = Calendar.getInstance(); try { Date date = format.parse(this.summary_date); calendar.setTime(date); } catch (ParseException e) { logger.debug("summary_date has an unknown format", this.summary_date); } return calendar; }
Source:
<code>public Mono<ModelData> getModel(String modelId) { return getModelWithResponse(modelId) <START> .map(response -> response.getValue()); <END> }</code><technical_language>replaced method reference: java .map(Response::getValue);</technical_language>

Target:
public Mono<ModelData> getModel(String modelId) { return getModelWithResponse(modelId) .map(Response::getValue); }
Source:
<code>public boolean equalsToMemberName(String name) { <START> return memberName != null && memberName.equals(name); <END> }</code><technical_language>this return true memberName name null</technical_language>

Target:
private boolean equalsToMemberName(String name) { return memberName != null && memberName.equals(name); }
Source:
<code>private boolean fromInstance(Symbol owner) { for (Symbol outerClass : outerClasses) { Type ownerType = owner.type(); <START> if (owner.equals(outerClass) || (ownerType != null && outerClass.type().isSubtypeOf(ownerType))) { <END> return true; } } return false; }</code><technical_language>type of owner null. encounter one? I equality test is useless, isSubtypeOf check for type equality</technical_language>

Target:
private boolean fromInstance(Symbol owner) { for (Symbol outerClass : outerClasses) { Type ownerType = owner.type(); if (ownerType != null) { if (owner.equals(outerClass) || outerClass.type().isSubtypeOf(ownerType)) { return true; } else { return fromInstance(ownerType.symbol().owner()); } } } return false; }