auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void update(Username currentUser, String md5, SecurityAuthConfig newSecurityAuthConfig, LocalizedOperationResult result) { SecurityAuthConfigUpdateCommand command = new SecurityAuthConfigUpdateCommand(goConfigService, newSecurityAuthConfig, authorizationExtension, currentUser, result, hashingService, md5); <START> validatePluginProperties(command, newSecurityAuthConfig); <END> update(currentUser, newSecurityAuthConfig, result, command); }</code><technical_language>Move this validation PluginProfileService</technical_language>

Target:
public void update(Username currentUser, String md5, SecurityAuthConfig newSecurityAuthConfig, LocalizedOperationResult result) { SecurityAuthConfigUpdateCommand command = new SecurityAuthConfigUpdateCommand(goConfigService, newSecurityAuthConfig, authorizationExtension, currentUser, result, hashingService, md5); update(currentUser, newSecurityAuthConfig, result, command); }
Source:
<code>protected void waitForAsyncCompletion() { <START> nextTransaction(); <END> transactionalFeature.nextTransaction(); eventService.waitForAsyncCompletion(); }</code><technical_language>remove this line, this is done in transactionalFeature.nextTransaction()</technical_language>

Target:
protected void waitForAsyncCompletion() { transactionalFeature.nextTransaction(); eventService.waitForAsyncCompletion(); }
Source:
<code>public void process(Element element, EFragmentHolder holder) throws Exception { ExecutableElement executableElement = (ExecutableElement) element; JMethod delegatingMethod = codeModelHelper.overrideAnnotatedMethod(executableElement, holder); JBlock previousMethodBody = codeModelHelper.removeBody(delegatingMethod); IgnoreWhen ignoreWhen = element.getAnnotation(IgnoreWhen.class); switch (ignoreWhen.value()) { case VIEW_DESTROYED: <START> String viewDestroyedFieldName = "viewDestroyed" + generationSuffix(); <END> JFieldVar viewDestroyed = holder.getGeneratedClass().fields().get(viewDestroyedFieldName); if (viewDestroyed == null) { viewDestroyed = holder.getGeneratedClass().field(PRIVATE | VOLATILE, getCodeModel().BOOLEAN, viewDestroyedFieldName); holder.getSetContentViewBlock().assign(viewDestroyed, FALSE); holder.getOnDestroyViewAfterSuperBlock().assign(viewDestroyed, TRUE); } delegatingMethod.body()._if(viewDestroyed.not())._then().add(previousMethodBody); break; case DETACHED: delegatingMethod.body()._if(invoke(holder.getGeneratedClass().staticRef("this"), "getActivity").ne(_null()))._then().add(previousMethodBody); break; } }</code><technical_language>do this holder. Add a new field in holder class, is initialised related code is created demand (lazily, call holder.getViewDestroyedField())</technical_language>

Target:
public void process(Element element, EFragmentHolder holder) throws Exception { ExecutableElement executableElement = (ExecutableElement) element; JMethod delegatingMethod = codeModelHelper.overrideAnnotatedMethod(executableElement, holder); JBlock previousMethodBody = codeModelHelper.removeBody(delegatingMethod); IgnoreWhen ignoreWhen = element.getAnnotation(IgnoreWhen.class); JBlock methodBody = delegatingMethod.body(); JConditional conditional = null; switch (ignoreWhen.value()) { case VIEW_DESTROYED: conditional = methodBody._if(holder.getViewDestroyedField().not()); break; case DETACHED: conditional = methodBody._if(invoke(holder.getGeneratedClass().staticRef("this"), "getActivity").ne(_null())); break; } conditional._then().add(previousMethodBody); }
Source:
<code>public <T> T getConfiguration(final Class<T> clazz) { if (configuration == null) { return null; } if (!clazz.isAssignableFrom(configuration.getClass())) { throw new IllegalStateException("Can not cast configuration " + configuration + " to class " + clazz); } <START> return (T) configuration; <END> }</code><technical_language>a strange of generics. configuration property is defined T</technical_language>

Target:
public <T> T getConfiguration(final Class<T> clazz) { if (!clazz.isAssignableFrom(configuration.getClass())) { throw new IllegalStateException("Can not cast configuration " + configuration + " to class " + clazz); } return (T) configuration; }
Source:
<code>public List<AttestationValue> parsePostedResp(String str){ JsonFactory jfactory = new JsonFactory(); JsonParser jParser; List<AttestationValue> values = new ArrayList<AttestationValue>(); try { jParser = jfactory.createJsonParser(str); jParser.nextToken(); while (jParser.nextToken() != JsonToken.END_OBJECT){ if(jParser.getCurrentName().equalsIgnoreCase(HEADER_HOSTS)){ while(jParser.nextToken() != JsonToken.END_ARRAY && jParser.getCurrentToken() != JsonToken.END_OBJECT){ AttestationValue value = new AttestationValue(); if (jParser.getCurrentName().equalsIgnoreCase(HEADER_HOST_NAME)){ jParser.nextToken(); value.setHostName(jParser.getText()); jParser.nextToken(); } if (jParser.getCurrentName().equalsIgnoreCase(HEADER_RESULT)){ jParser.nextToken(); value.setTrustLevel(AttestationResult.valueOf(jParser.getText().toUpperCase())); jParser.nextToken(); } if(jParser.getCurrentName().equalsIgnoreCase(HEADER_VTIME)){ jParser.nextToken(); value.setVtime(DateUtils.parse(jParser.getText())); jParser.nextToken(); } if (value.getHostName() != null){ log.debug("host_name:" +value.getHostName() +", trustLevel:" +value.getTrustLevel() +",vtime:" +value.getVtime()); values.add(value); } jParser.nextToken(); } break; } } <START> jParser.close(); <END> } catch (JsonParseException e) { log.error(e.getMessage(), e); } catch (IOException e) { log.error(e.getMessage(), e); } return values; }</code><technical_language>I suggest put this in a "finally" block</technical_language>

Target:
public List<AttestationValue> parsePostedResp(String str) throws JsonParseException, IOException { JsonFactory jfactory = new JsonFactory(); List<AttestationValue> values = new ArrayList<AttestationValue>(); JsonParser jParser = jfactory.createJsonParser(str); try { jParser.nextToken(); while (jParser.nextToken() != JsonToken.END_OBJECT) { if (jParser.getCurrentName().equalsIgnoreCase(HEADER_HOSTS)) { while (jParser.nextToken() != JsonToken.END_ARRAY && jParser.getCurrentToken() != JsonToken.END_OBJECT) { AttestationValue value = new AttestationValue(); if (jParser.getCurrentName().equalsIgnoreCase(HEADER_HOST_NAME)) { jParser.nextToken(); value.setHostName(jParser.getText()); jParser.nextToken(); } if (jParser.getCurrentName().equalsIgnoreCase(HEADER_RESULT)) { jParser.nextToken(); value.setTrustLevel(AttestationResultEnum.valueOf(jParser.getText().toUpperCase())); jParser.nextToken(); } if (jParser.getCurrentName().equalsIgnoreCase(HEADER_VTIME)) { jParser.nextToken(); DateFormat df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT); value.setVtime(df.parse(jParser.getText().replace("T", " "))); jParser.nextToken(); } if (value.getHostName() != null) { log.debug("host_name:" + value.getHostName() + ", trustLevel:" + value.getTrustLevel() + ",vtime:" + value.getVtime()); values.add(value); } jParser.nextToken(); } break; } } } catch (ParseException e) { log.error(String.format("Failed to set attestation time, time format is correct? [%s]", e.getMessage()), e); } finally { jParser.close(); } return values; }
Source:
<code>public DiscussionPostsAdapter(Context context, IEdxEnvironment environment) { super(context, R.layout.row_discussion_thread, environment); edx_brand_primary_base = context.getResources().getColor(R.color.edx_brand_primary_base); edx_grayscale_neutral_dark = context.getResources().getColor(R.color.edx_brand_gray_base); edx_brand_secondary_dark = context.getResources().getColor(R.color.edx_brand_secondary_dark); edx_utility_success_dark = context.getResources().getColor(R.color.edx_success_text); <START> openSansSemiBoldFont = ResourcesCompat.getFont(context, R.font.inter_semi_bold); <END> }</code><technical_language>openSansSemiBoldFont rename a general name semiBoldFont</technical_language>

Target:
public DiscussionPostsAdapter(Context context, IEdxEnvironment environment) { super(context, R.layout.row_discussion_thread, environment); edx_brand_primary_base = context.getResources().getColor(R.color.edx_brand_primary_base); edx_grayscale_neutral_dark = context.getResources().getColor(R.color.edx_brand_gray_base); edx_brand_secondary_dark = context.getResources().getColor(R.color.edx_brand_secondary_dark); edx_utility_success_dark = context.getResources().getColor(R.color.edx_success_text); semiBoldFont = ResourcesCompat.getFont(context, R.font.inter_semi_bold); }
Source:
<code>private void configureNetworksOnHosts(Map<Guid, List<Network>> networksByHost, Map<Guid, Map<String, VdsNetworkInterface>> labelsToNicsByHost) { ArrayList<VdcActionParametersBase> parameters = new ArrayList<>(); for (Guid hostId : networksByHost.keySet()) { AddNetworksByLabelParametersBuilder builder = new AddNetworksByLabelParametersBuilder(); <START> builder.buildParameters(hostId, networksByHost.get(hostId), labelsToNicsByHost.get(hostId)); <END> } getBackend().runInternalMultipleActions(VdcActionType.PersistentSetupNetworks, parameters); }</code><technical_language>save returned parameters in list</technical_language>

Target:
private void configureNetworksOnHosts(Map<Guid, List<Network>> networksByHost, Map<Guid, Map<String, VdsNetworkInterface>> labelsToNicsByHost) { ArrayList<VdcActionParametersBase> parameters = new ArrayList<>(); for (Guid hostId : networksByHost.keySet()) { AddNetworksByLabelParametersBuilder builder = new AddNetworksByLabelParametersBuilder(); parameters.add(builder.buildParameters(hostId, networksByHost.get(hostId), labelsToNicsByHost.get(hostId))); } getBackend().runInternalMultipleActions(VdcActionType.PersistentSetupNetworks, parameters); }
Source:
<code>public static int findContainerQuarkWithInode(ITmfStateSystemBuilder ssb, int containerINode) { int rootQuark = getRootContainerQuark(ssb); int parentContainerQuark = fCONTAINER_QUARK_NOT_FOUND; try { <START> List<Integer> ContainerINodeList = ssb.getSubAttributes(rootQuark, true, ContainerAttributes.CONTAINER_INODE); <END> if (ContainerINodeList.size() >= 1) { for (Integer quarkContainerINode : ContainerINodeList) { int iNode = ssb.queryOngoingState(quarkContainerINode).unboxInt(); if (iNode == containerINode) { int containerInfoQuark = ssb.getParentAttributeQuark(quarkContainerINode); parentContainerQuark = ssb.getParentAttributeQuark(containerInfoQuark); break; } } } } catch (AttributeNotFoundException e) { e.printStackTrace(); } return parentContainerQuark; }</code><technical_language>variable names start a capital letter, for class names</technical_language>

Target:
public static int findContainerQuarkWithInode(ITmfStateSystemBuilder ssb, int containerINode) { int rootQuark = getRootContainerQuark(ssb); int parentContainerQuark = CONTAINER_QUARK_NOT_FOUND; try { List<Integer> containerINodeList = ssb.getSubAttributes(rootQuark, true, ContainerAttributes.CONTAINER_INODE); if (!containerINodeList.isEmpty()) { for (Integer quarkContainerINode : containerINodeList) { int iNode = ssb.queryOngoingState(quarkContainerINode).unboxInt(); if (iNode == containerINode) { int containerInfoQuark = ssb.getParentAttributeQuark(quarkContainerINode); parentContainerQuark = ssb.getParentAttributeQuark(containerInfoQuark); break; } } } } catch (AttributeNotFoundException e) { throw new IllegalStateException(); } return parentContainerQuark; }
Source:
<code>private void initListView(@NonNull View view) { initAdapter(); listView.setAdapter(adapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (deleteMode != null) { deleteMode.finish(); } listView.clearChoices(); final CourseComponent component = adapter.getItem(position).component; if (component.isContainer()) { environment.getRouter().showCourseContainerOutline(CourseOutlineFragment.this, REQUEST_SHOW_COURSE_UNIT_DETAIL, courseData, component.getId(), null, isVideoMode); } else { environment.getRouter().showCourseUnitDetail(CourseOutlineFragment.this, REQUEST_SHOW_COURSE_UNIT_DETAIL, courseData, component.getId(), isVideoMode); } } }); listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { <START> IconImageView bulkDownload = (IconImageView) view.findViewById(R.id.bulk_download); <END> if (bulkDownload != null && bulkDownload.getIcon() == FontAwesomeIcons.fa_check) { ((AppCompatActivity) getActivity()).startSupportActionMode(deleteModelCallback); listView.setItemChecked(position, true); return true; } return false; } }); }</code><technical_language>A couple of nits: - bulkDownload final. - rename bulkDownload bulkDownloadIcon</technical_language>

Target:
private void initListView(@NonNull View view) { initAdapter(); listView.setAdapter(adapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (deleteMode != null) { deleteMode.finish(); } listView.clearChoices(); final CourseComponent component = adapter.getItem(position).component; if (component.isContainer()) { environment.getRouter().showCourseContainerOutline(CourseOutlineFragment.this, REQUEST_SHOW_COURSE_UNIT_DETAIL, courseData, component.getId(), null, isVideoMode); } else { environment.getRouter().showCourseUnitDetail(CourseOutlineFragment.this, REQUEST_SHOW_COURSE_UNIT_DETAIL, courseData, component.getId(), isVideoMode); } } }); listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { final IconImageView bulkDownloadIcon = (IconImageView) view.findViewById(R.id.bulk_download); if (bulkDownloadIcon != null && bulkDownloadIcon.getIcon() == FontAwesomeIcons.fa_check) { ((AppCompatActivity) getActivity()).startSupportActionMode(deleteModelCallback); listView.setItemChecked(position, true); return true; } return false; } }); }
Source:
<code>public void testExecuteOn() throws Exception { when(config.hasToNotifyStash()).thenReturn(true); SonarQubeIssuesReport report = mock(SonarQubeIssuesReport.class); when(report.countIssues()).thenReturn(10); when(stashRequestFacade.extractIssueReport(projectIssues, inputFileCache)).thenReturn(report); int issueThreshold = 100; when(stashRequestFacade.getIssueThreshold()).thenReturn(issueThreshold); <START> StashIssueReportingPostJob job = new StashIssueReportingPostJob(config, projectIssues, inputFileCache, stashRequestFacade); <END> job.executeOn(project, context); verify(stashRequestFacade, times(1)).postCommentPerIssue(eq(STASH_PROJECT), eq(STASH_REPOSITORY), eq(STASH_PULLREQUEST_ID), eq(SONARQUBE_URL), eq(report), (StashClient) Mockito.anyObject()); verify(stashRequestFacade, times(1)).postAnalysisOverview(eq(STASH_PROJECT), eq(STASH_REPOSITORY), eq(STASH_PULLREQUEST_ID), eq(SONARQUBE_URL), eq(issueThreshold), eq(report), (StashClient) Mockito.anyObject()); }</code><technical_language>Declare a member of class. gain in readability. generalized others test classes</technical_language>

Target:
public void testExecuteOn() throws Exception { when(config.hasToNotifyStash()).thenReturn(true); SonarQubeIssuesReport report = mock(SonarQubeIssuesReport.class); when(report.countIssues()).thenReturn(10); when(stashRequestFacade.extractIssueReport(projectIssues, inputFileCache)).thenReturn(report); int issueThreshold = 100; when(stashRequestFacade.getIssueThreshold()).thenReturn(issueThreshold); myJob = new StashIssueReportingPostJob(config, projectIssues, inputFileCache, stashRequestFacade); myJob.executeOn(project, context); verify(stashRequestFacade, times(1)).postCommentPerIssue(eq(STASH_PROJECT), eq(STASH_REPOSITORY), eq(STASH_PULLREQUEST_ID), eq(SONARQUBE_URL), eq(report), (StashClient) Mockito.anyObject()); verify(stashRequestFacade, times(1)).postAnalysisOverview(eq(STASH_PROJECT), eq(STASH_REPOSITORY), eq(STASH_PULLREQUEST_ID), eq(SONARQUBE_URL), eq(issueThreshold), eq(report), (StashClient) Mockito.anyObject()); }
Source:
<code>protected void ProceedProxyReturnValue() { VdcBllErrors returnStatus = GetReturnValueFromStatus(getReturnStatus()); if (returnStatus != VdcBllErrors.Done) { getVDSReturnValue().setSucceeded(false); InitializeVdsError(returnStatus); <START> } <END> }</code><technical_language>change exception</technical_language>

Target:
protected void ProceedProxyReturnValue() { VdcBllErrors returnStatus = GetReturnValueFromStatus(getReturnStatus()); switch (returnStatus) { case Done: return; default: VDSExceptionBase outEx = createDefaultConcreteException(getReturnStatus().mMessage); InitializeVdsError(returnStatus); outEx.setVdsError(getVDSReturnValue().getVdsError()); throw outEx; } }
Source:
<code>public FileWriter getOrCreateWriter(LogFilePath path, CompressionCodec codec) throws Exception { FileWriter writer = mWriters.get(path); if (writer == null) { FileUtil.delete(path.getLogFilePath()); FileUtil.delete(path.getLogFileCrcPath()); TopicPartition topicPartition = new TopicPartition(path.getTopic(), path.getKafkaPartition()); HashSet<LogFilePath> files = mFiles.get(topicPartition); if (files == null) { files = new HashSet<LogFilePath>(); mFiles.put(topicPartition, files); } if (!files.contains(path)) { files.add(path); } writer = ReflectionUtil.createFileWriter(mConfig.getFileReaderWriterFactory(), path, codec); mWriters.put(path, writer); mCreationTimes.put(path, System.currentTimeMillis() / 1000L); LOG.debug("created writer for path {}", path.getLogFilePath()); LOG.debug("Register deleteOnExit for path {}", path.getLogFilePath()); <START> FileUtil.deleteOnExit(path.getLogFilePath()); <END> FileUtil.deleteOnExit(path.getLogFileCrcPath()); } return writer; }</code><technical_language>do do individual file level dir level? consumer is writing a dir composed of PID thread id, dirs specific a instance</technical_language>

Target:
public FileWriter getOrCreateWriter(LogFilePath path, CompressionCodec codec) throws Exception { FileWriter writer = mWriters.get(path); if (writer == null) { FileUtil.delete(path.getLogFilePath()); FileUtil.delete(path.getLogFileCrcPath()); TopicPartition topicPartition = new TopicPartition(path.getTopic(), path.getKafkaPartition()); HashSet<LogFilePath> files = mFiles.get(topicPartition); if (files == null) { files = new HashSet<LogFilePath>(); mFiles.put(topicPartition, files); } if (!files.contains(path)) { files.add(path); } writer = ReflectionUtil.createFileWriter(mConfig.getFileReaderWriterFactory(), path, codec); mWriters.put(path, writer); mCreationTimes.put(path, System.currentTimeMillis() / 1000L); LOG.debug("created writer for path {}", path.getLogFilePath()); LOG.debug("Register deleteOnExit for path {}", path.getLogFilePath()); FileUtil.deleteOnExit(path.getLogFileParentDir()); FileUtil.deleteOnExit(path.getLogFileDir()); FileUtil.deleteOnExit(path.getLogFilePath()); FileUtil.deleteOnExit(path.getLogFileCrcPath()); } return writer; }
Source:
<code>public static void main(String[] args) throws Exception { if (args.length < 2) { System.err.println("Usage: WebServer <[hostname:]port> <yaml configuration file>"); System.exit(1); } String[] hostnamePort = args[0].split(":"); int port; if (hostnamePort.length == 2) { port = Integer.parseInt(hostnamePort[1]); } else { port = Integer.parseInt(hostnamePort[0]); } JmxCollector jc = new JmxCollector(new File(args[1])).register(); <START> HTTPServer server = new HTTPServer(port); <END> }</code><technical_language>want existing host support around</technical_language>

Target:
public static void main(String[] args) throws Exception { if (args.length < 2) { System.err.println("Usage: WebServer <[hostname:]port> <yaml configuration file>"); System.exit(1); } String[] hostnamePort = args[0].split(":"); int port; InetSocketAddress socket; if (hostnamePort.length == 2) { port = Integer.parseInt(hostnamePort[1]); socket = new InetSocketAddress(hostnamePort[0], port); } else { port = Integer.parseInt(hostnamePort[0]); socket = new InetSocketAddress(port); } new JmxCollector(new File(args[1])).register(); new HTTPServer(socket, CollectorRegistry.defaultRegistry); }
Source:
<code>public void test_simple_version_with_refresh() throws Exception { execute("create table test (id integer primary key, value string)"); ensureGreen(); execute("insert into test (id, value) values (?, ?) returning _seq_no", new Object[]{1, "value1_1"}); long seqNo = (long) response.rows()[0][0]; assertThat(seqNo, equalTo(0L)); execute("refresh table test"); execute("update test set value = 'value1_2' where id = 1 returning _seq_no, _primary_term"); seqNo = (long) response.rows()[0][0]; assertThat(seqNo, equalTo(1L)); execute("update test set value = 'value1_1' where id = 1 and _seq_no = 0 and _primary_term = 1 returning _seq_no, _primary_term"); assertThat(response.rowCount(), equalTo(0L)); <START> <END> execute("delete from test where id = 1 and _seq_no = 0 and _primary_term = 1"); assertThat(response.rowCount(), equalTo(0L)); execute("select _version from test where id=1"); assertThat(response.rows()[0][0], equalTo(2L)); execute("refresh table test"); execute("select _version, _seq_no from test"); assertThat(response.rows()[0][0], equalTo(2L)); assertThat(response.rows()[0][1], equalTo(1L)); }</code><technical_language>a refresh is missing in updates</technical_language>

Target:
public void test_simple_version_with_refresh() throws Exception { execute("create table test (id integer primary key, value string)"); ensureGreen(); execute("insert into test (id, value) values (?, ?) returning _seq_no", new Object[]{1, "value1_1"}); long seqNo = (long) response.rows()[0][0]; assertThat(seqNo, equalTo(0L)); execute("refresh table test"); execute("update test set value = 'value1_2' where id = 1 returning _seq_no, _primary_term"); seqNo = (long) response.rows()[0][0]; assertThat(seqNo, equalTo(1L)); execute("refresh table test"); execute("update test set value = 'value1_1' where id = 1 and _seq_no = 0 and _primary_term = 1 returning _seq_no, _primary_term"); assertThat(response.rowCount(), equalTo(0L)); execute("refresh table test"); execute("delete from test where id = 1 and _seq_no = 0 and _primary_term = 1"); assertThat(response.rowCount(), equalTo(0L)); for (int i = 0; i < 10; i++) { execute("select _version from test where id=1"); assertThat(response.rows()[0][0], equalTo(2L)); } execute("refresh table test"); for (int i = 0; i < 10; i++) { execute("select _version, _seq_no from test"); assertThat(response.rowCount(), equalTo(1L)); assertThat(response.rows()[0][0], equalTo(2L)); assertThat(response.rows()[0][1], equalTo(1L)); } }
Source:
<code>public BlobProperties(long blobSize, String serviceId, String ownerId, String contentType, boolean isPrivate, long timeToLiveInSeconds, long creationTimeInMs) { this.blobSize = blobSize; this.serviceId = serviceId; this.ownerId = ownerId; this.contentType = contentType; this.isPrivate = isPrivate; this.creationTimeInMs = creationTimeInMs; long maxAllowedTTLInMs = Utils.getMaxSupportedTimeInMs() - creationTimeInMs; if (TimeUnit.SECONDS.toMillis(timeToLiveInSeconds) > maxAllowedTTLInMs) { <START> this.timeToLiveInSeconds = -1; <END> } else { this.timeToLiveInSeconds = timeToLiveInSeconds; } }</code><technical_language>constant here</technical_language>

Target:
public BlobProperties(long blobSize, String serviceId, String ownerId, String contentType, boolean isPrivate, long timeToLiveInSeconds, long creationTimeInMs) { this.blobSize = blobSize; this.serviceId = serviceId; this.ownerId = ownerId; this.contentType = contentType; this.isPrivate = isPrivate; this.creationTimeInMs = creationTimeInMs; if (timeToLiveInSeconds + TimeUnit.MILLISECONDS.toSeconds(creationTimeInMs) > Integer.MAX_VALUE) { this.timeToLiveInSeconds = Utils.Infinite_Time; } else { this.timeToLiveInSeconds = timeToLiveInSeconds; } }
Source:
<code>public DynamicConfigurationProvider(String name, ExtensionModel extension, ConfigurationModel config, ResolverSet resolverSet, ConnectionProviderValueResolver connectionProviderResolver, ExpirationPolicy expirationPolicy, ReflectionCache reflectionCache, ExpressionManager expressionManager, MuleContext muleContext) { super(name, extension, config, muleContext); this.configurationInstanceFactory = new ConfigurationInstanceFactory<>(extension, config, resolverSet, reflectionCache, expressionManager, muleContext); this.reflectionCache = reflectionCache; this.expressionManager = expressionManager; this.resolverSet = resolverSet; this.connectionProviderResolver = connectionProviderResolver; this.expirationPolicy = expirationPolicy; <START> cache = Caffeine.newBuilder().expireAfterWrite(expirationPolicy.getMaxIdleTime(), expirationPolicy.getTimeUnit()).build(); <END> }</code><technical_language>expireAfterAccess</technical_language>

Target:
public DynamicConfigurationProvider(String name, ExtensionModel extension, ConfigurationModel config, ResolverSet resolverSet, ConnectionProviderValueResolver connectionProviderResolver, ExpirationPolicy expirationPolicy, ReflectionCache reflectionCache, ExpressionManager expressionManager, MuleContext muleContext) { super(name, extension, config, muleContext); this.configurationInstanceFactory = new ConfigurationInstanceFactory<>(extension, config, resolverSet, reflectionCache, expressionManager, muleContext); this.reflectionCache = reflectionCache; this.expressionManager = expressionManager; this.resolverSet = resolverSet; this.connectionProviderResolver = connectionProviderResolver; this.expirationPolicy = expirationPolicy; this.extensionManager = (DefaultExtensionManager) muleContext.getExtensionManager(); cache = Caffeine.newBuilder().expireAfterAccess(expirationPolicy.getMaxIdleTime(), expirationPolicy.getTimeUnit()) .removalListener((key, value, cause) -> extensionManager .disposeConfiguration(((ResolverResultAndEvent) key).getResolverSetResult().toString(), (ConfigurationInstance) value)) .build(key -> createConfiguration(key.getResolverSetResult(), key.getEvent())); }
Source:
<code>private void hookFillMenu(Menu menu) { ScenarioParser parser = new ScenarioParser(); <START> Bundle bundle = Platform.getBundle(Constants.BUNDLE_ID); <END> File stateLocation = Platform.getStateLocation(bundle).toFile(); hookDirectoryScenarios(menu, parser, stateLocation); new MenuItem(menu, SWT.SEPARATOR); MenuItem menuItemCategory = new MenuItem(menu, SWT.CASCADE); menuItemCategory.setText("Open scenarios directory\u2026"); menuItemCategory.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { Program.launch(stateLocation.getAbsolutePath()); } }); new MenuItem(menu, SWT.SEPARATOR); hookPredefinedScenarios(menu); }</code><technical_language>get bundle easier: FrameworkUtil.getBundle(getClass());</technical_language>

Target:
private void hookFillMenu(Menu menu) { ScenarioParser parser = new ScenarioParser(); Bundle bundle = FrameworkUtil.getBundle(getClass()); File stateLocation = Platform.getStateLocation(bundle).toFile(); hookDirectoryScenarios(menu, parser, stateLocation); new MenuItem(menu, SWT.SEPARATOR); MenuItem menuItemCategory = new MenuItem(menu, SWT.CASCADE); menuItemCategory.setText("Open scenarios directory\u2026"); menuItemCategory.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { Program.launch(stateLocation.getAbsolutePath()); } }); new MenuItem(menu, SWT.SEPARATOR); hookPredefinedScenarios(menu); }
Source:
<code>static WorkloadClockConfiguration generateLoad(JLoadProfile jLoadProfile) { WorkloadClockConfiguration clockConfiguration = null; if (jLoadProfile instanceof JLoadProfileRps) { clockConfiguration = new RpsClockConfiguration(); ((RpsClockConfiguration) clockConfiguration).setValue(((JLoadProfileRps) jLoadProfile).getRequestsPerSecond()); ((RpsClockConfiguration) clockConfiguration).setWarmUpTime(((JLoadProfileRps) jLoadProfile).getWarmUpTimeInSeconds()); ((RpsClockConfiguration) clockConfiguration).setMaxThreadNumber((int) ((JLoadProfileRps) jLoadProfile).getMaxLoadThreads()); <START> } else if (jLoadProfile instanceof JLoadProfileUserGroups) { <END> clockConfiguration = new UserGroupsClockConfiguration(); List<User> users = ((JLoadProfileUserGroups) jLoadProfile).getUserGroups().stream() .map(jLoadUser -> new User(String.valueOf(jLoadUser.getNumberOfUsers()), String.valueOf(jLoadUser.getSlewRateUsersPerSecond()), jLoadUser.getStartDelayInSeconds() + "s", "1s", jLoadUser.getLifeTimeInSeconds() + "s")) .collect(toList()); ((UserGroupsClockConfiguration) clockConfiguration).setUsers(users); FixedDelay delay = new FixedDelay(((JLoadProfileUserGroups) jLoadProfile).getDelayBetweenInvocationsInSeconds()); ((UserGroupsClockConfiguration) clockConfiguration).setDelay(delay); int tickInterval = ((JLoadProfileUserGroups) jLoadProfile).getTickInterval(); ((UserGroupsClockConfiguration) clockConfiguration).setTickInterval(tickInterval); } return clockConfiguration; }</code><technical_language>another PR</technical_language>

Target:
static WorkloadClockConfiguration generateLoad(JLoadProfile jLoadProfile) { WorkloadClockConfiguration clockConfiguration = null; if (jLoadProfile instanceof JLoadProfileRps) { clockConfiguration = new RpsClockConfiguration(); ((RpsClockConfiguration) clockConfiguration).setValue(((JLoadProfileRps) jLoadProfile).getRequestsPerSecond()); ((RpsClockConfiguration) clockConfiguration).setWarmUpTime(((JLoadProfileRps) jLoadProfile).getWarmUpTimeInSeconds()); ((RpsClockConfiguration) clockConfiguration).setMaxThreadNumber((int) ((JLoadProfileRps) jLoadProfile).getMaxLoadThreads()); } else if (jLoadProfile instanceof JLoadProfileUserGroups) { JLoadProfileUserGroups profileUserGroups = (JLoadProfileUserGroups) jLoadProfile; List<User> users = profileUserGroups.getUserGroups().stream() .map(userGroup -> new User(String.valueOf(userGroup.getNumberOfUsers()), String.valueOf(userGroup.getSlewRateUsersPerSecond()), userGroup.getStartDelayInSeconds() + "s", "1s", userGroup.getLifeTimeInSeconds() + "s")) .collect(toList()); UserGroupsClockConfiguration userGroupsClockConfiguration = new UserGroupsClockConfiguration(); userGroupsClockConfiguration.setUsers(users); userGroupsClockConfiguration.setDelay(new FixedDelay(profileUserGroups.getDelayBetweenInvocationsInSeconds())); userGroupsClockConfiguration.setTickInterval(profileUserGroups.getTickInterval()); clockConfiguration = userGroupsClockConfiguration; } return clockConfiguration; }
Source:
<code>public ForemanHostProviderProxy(Provider hostProvider) { this.hostProvider = hostProvider; try { URL hostUrl = new URL(hostProvider.getUrl()); if (hostUrl.getProtocol().equalsIgnoreCase(HTTPS_PROTOCOL)) { <START> String trustStorePath = FILE_URL_PREFIX + EngineLocalConfig.getInstance().getPKIExternalTrustStore(); <END> String trustStorePassword = EngineLocalConfig.getInstance().getPKIExternalTrustStorePassword(); httpClient = new SecuredHostHttpClient(hostUrl, new URL(trustStorePath), trustStorePassword, false); } else { httpClient = new HttpClient(); } objectMapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); Credentials hostProviderCredentials = new UsernamePasswordCredentials(hostProvider.getUsername(), hostProvider.getPassword()); httpClient.getState().setCredentials(AuthScope.ANY, hostProviderCredentials); httpClient.getState().setAuthenticationPreemptive(true); } catch (MalformedURLException e) { throw new VdcBLLException(VdcBllErrors.PROVIDER_FAILURE, e.getMessage()); } }</code><technical_language>if store is missing</technical_language>

Target:
public ForemanHostProviderProxy(Provider hostProvider) { this.hostProvider = hostProvider; initHttpClient(hostProvider.getUrl()); }
Source:
<code>public Construct exec(Target t, com.laytonsmith.core.environments.Environment environment, Construct... args ) throws ConfigRuntimeException { MCLocation loc = ObjectGenerator.GetGenerator().location(args[0], null, t); if(loc.getBlock().isCommandBlock()) { MCCommandBlock cb = loc.getBlock().getCommandBlock(); String name = ""; if(args.length == 2) { <START> if(!(args[1] instanceof CString)) { <END> throw new ConfigRuntimeException("Parameter 2 of " + getName() + " must be a string", ExceptionType.CastException, t); } name = args[1].val(); } cb.setName(name); return new CVoid(t); } else { throw new ConfigRuntimeException("The block at the specified location is not a command block", ExceptionType.FormatException, t); } }</code><technical_language>interesting allow CNull here, actually, allow for more flexible code. Setting a CNull clear command</technical_language>

Target:
public Construct exec(Target t, com.laytonsmith.core.environments.Environment environment, Construct... args ) throws ConfigRuntimeException { String name = null; if(args.length == 2 && !(args[1] instanceof CNull)) { if(!(args[1] instanceof CString)) { throw new ConfigRuntimeException("Parameter 2 of " + getName() + " must be a string or null", ExceptionType.CastException, t); } name = args[1].val(); } MCLocation loc = ObjectGenerator.GetGenerator().location(args[0], null, t); if(loc.getBlock().isCommandBlock()) { MCCommandBlock cb = loc.getBlock().getCommandBlock(); cb.setName(name); return new CVoid(t); } else { throw new ConfigRuntimeException("The block at the specified location is not a command block", ExceptionType.FormatException, t); } }
Source:
<code>public IStatus openTraceFromPath(String projectRoot, String path, Shell shell, String tracetypeHint) throws CoreException { TmfTraceType tt = TmfTraceType.getInstance(); TraceTypeHelper traceTypeToSet = null; try { <START> traceTypeToSet = TmfTraceTypeUIUtils.selectTraceType(tt, path, shell, tracetypeHint); <END> } catch (TmfTraceImportException e) { MessageBox mb = new MessageBox(shell); mb.setMessage(e.getMessage()); mb.open(); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()); } if (traceTypeToSet == null) { return Status.CANCEL_STATUS; } IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectRoot); IFolder folder = project.getFolder(TmfTraceFolder.TRACE_FOLDER_NAME); String traceName = getTraceName(path, folder); if (traceExists(path, folder)) { return openTraceFromProject(projectRoot, traceName); } final IPath tracePath = folder.getFullPath().append(traceName); final IPath pathString = Path.fromOSString(path); IResource linkedTrace = TmfImportHelper.createLink(folder, pathString, traceName); if (linkedTrace != null && linkedTrace.exists()) { IStatus ret = TmfTraceTypeUIUtils.setTraceType(tracePath, traceTypeToSet); if (ret.isOK()) { ret = openTraceFromProject(projectRoot, traceName); } return ret; } return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TmfOpenTraceHelper_LinkFailed); }</code><technical_language>selectTraceType method get TmfTraceType.getInstance() directly, avoid tt variable caller changing signature of method</technical_language>

Target:
public IStatus openTraceFromPath(String projectRoot, String path, Shell shell, String tracetypeHint) throws CoreException { TraceTypeHelper traceTypeToSet = null; try { traceTypeToSet = TmfTraceTypeUIUtils.selectTraceType(path, shell, tracetypeHint); } catch (TmfTraceImportException e) { MessageBox mb = new MessageBox(shell); mb.setMessage(e.getMessage()); mb.open(); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()); } if (traceTypeToSet == null) { return Status.CANCEL_STATUS; } IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectRoot); IFolder folder = project.getFolder(TmfTraceFolder.TRACE_FOLDER_NAME); String traceName = getTraceName(path, folder); if (traceExists(path, folder)) { return openTraceFromProject(projectRoot, traceName); } final IPath tracePath = folder.getFullPath().append(traceName); final IPath pathString = Path.fromOSString(path); IResource linkedTrace = TmfImportHelper.createLink(folder, pathString, traceName); if (linkedTrace != null && linkedTrace.exists()) { IStatus ret = TmfTraceTypeUIUtils.setTraceType(tracePath, traceTypeToSet); if (ret.isOK()) { ret = openTraceFromProject(projectRoot, traceName); } return ret; } return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TmfOpenTraceHelper_LinkFailed); }
Source:
<code>public static long getTtlInSecsFromExpiryMs(long expiresAtMs, long creationTimeMs) { if (expiresAtMs == Utils.Infinite_Time) { return Utils.Infinite_Time; } <START> return Math.max(0, TimeUnit.MILLISECONDS.toSeconds(expiresAtMs - creationTimeMs)); <END> }</code><technical_language>return expiresAtMs == Utils.Infinite_Time ? Utils.Infinite_Time : Math.max(0, TimeUnit.MILLISECONDS.toSeconds(expiresAtMs - creationTimeMs));</technical_language>

Target:
public static long getTtlInSecsFromExpiryMs(long expiresAtMs, long creationTimeMs) { return expiresAtMs == Utils.Infinite_Time ? Utils.Infinite_Time : Math.max(0, TimeUnit.MILLISECONDS.toSeconds(expiresAtMs - creationTimeMs)); }
Source:
<code>private void handleBulkWriteError(List<BulkWriteError> errors, List<DocCtx> docs) { docUpdateActual.addAll(docs); for (BulkWriteError e : errors) { DocCtx doc = docs.get(e.getIndex()); if (e.getCode() == 11000 || e.getCode() == 11001) { doc.addError(Error.get("update", MongoCrudConstants.ERR_DUPLICATE, e.getMessage())); } else { doc.addError(Error.get("update", MongoCrudConstants.ERR_SAVE_ERROR, e.getMessage())); } } <START> numFailed += (int) errors.stream().map(e -> e.getIndex()).distinct().count(); <END> }</code><technical_language>Instead of this, numFailed in loop above</technical_language>

Target:
private void handleBulkWriteError(List<BulkWriteError> errors, List<DocCtx> docs) { for (BulkWriteError e : errors) { DocCtx doc = docs.get(e.getIndex()); if (e.getCode() == 11000 || e.getCode() == 11001) { doc.addError(Error.get("update", MongoCrudConstants.ERR_DUPLICATE, e.getMessage())); } else { doc.addError(Error.get("update", MongoCrudConstants.ERR_SAVE_ERROR, e.getMessage())); } } }
Source:
<code>public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); Announcement announcement = null; <START> mType = ORIGINAL; <END> ObjectMapper mapper = new ObjectMapper(); try { announcement = mapper.readValue(getIntent().getStringExtra("Announcement"), Announcement.class); FragUtils.replace(R.id.container, AnnouncementFragment.newInstance(announcement), this); } catch (IOException exception) { String error = "Announcement"; Toast.makeText(this, getString(R.string.cannot_be_displayed, error), Toast.LENGTH_SHORT).show(); onBackPressed(); } }</code><technical_language>mType is originally 0</technical_language>

Target:
public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); Announcement announcement = null; ObjectMapper mapper = new ObjectMapper(); try { announcement = mapper.readValue(getIntent().getStringExtra("Announcement"), Announcement.class); FragUtils.replace(R.id.container, AnnouncementFragment.newInstance(announcement), this); } catch (IOException exception) { String error = "Announcement"; Toast.makeText(this, getString(R.string.cannot_be_displayed, error), Toast.LENGTH_SHORT).show(); onBackPressed(); } }
Source:
<code>protected void fillTimeGraphEntryContextMenu(@NonNull IMenuManager menuManager) { ISelection selection = getSite().getSelectionProvider().getSelection(); if (selection instanceof StructuredSelection) { StructuredSelection sSel = (StructuredSelection) selection; if (sSel.getFirstElement() instanceof ControlFlowEntry) { ControlFlowEntry entry = (ControlFlowEntry) sSel.getFirstElement(); <START> if (fShowFollowThreadAction) { <END> menuManager.add(new FollowThreadAction(ControlFlowView.this, entry.getName(), entry.getThreadId(), entry.getTrace())); } } } }</code><technical_language>I pinning disable this action</technical_language>

Target:
protected void fillTimeGraphEntryContextMenu(@NonNull IMenuManager menuManager) { ISelection selection = getSite().getSelectionProvider().getSelection(); if (selection instanceof StructuredSelection) { StructuredSelection sSel = (StructuredSelection) selection; if (sSel.getFirstElement() instanceof ControlFlowEntry) { ControlFlowEntry entry = (ControlFlowEntry) sSel.getFirstElement(); menuManager.add(new FollowThreadAction(ControlFlowView.this, entry.getName(), entry.getThreadId(), entry.getTrace())); } } }
Source:
<code>public VALUE get(KEY key) throws IOException { if (cache != null) { CacheValue<VALUE> cacheValue = cache.get(new CacheKey<>(key)); if (cacheValue == null) { return getFromTable(key); } else { if (cacheValue.getLastOperation() != CacheValue.OperationType.DELETED) { return cacheValue.getValue(); } else { <START> return null; <END> } } } else { return getFromTable(key); } }</code><technical_language>Instead of making delete operation a special case, in case of delete push a null cache. automatically return null</technical_language>

Target:
public VALUE get(KEY key) throws IOException { CacheValue< VALUE > cacheValue = cache.get(new CacheKey<>(key)); if (cacheValue == null) { return getFromTable(key); } else { return cacheValue.getValue(); } }
Source:
<code><START> public ServletInputStream getInputStream() throws IOException { <END> if (stream == null) { stream = createInputStream(); } return (stream); }</code><technical_language>methods override annotated @Override. I quickly if is correct not</technical_language>

Target:
public ServletInputStream getInputStream() throws IOException { return stream; }
Source:
<code>public void verify(Text text, final EStructuralFeature feature) { final VerifyListener verifyListener = new VerifyListener() { @Override public void verifyText(VerifyEvent e) { final String currentText = Text.class.cast(e.widget).getText(); final String changedText = currentText.substring(0, e.start) + e.text + currentText.substring(e.end); final Diagnostic diag = preSetValidationService.validate(feature, changedText); if (diag.getSeverity() == Diagnostic.OK) { return; } e.doit = false; } }; <START> if (preSetValidationService != null) { text.addVerifyListener(verifyListener); } <END> }</code><technical_language>avoid creating instance add it</technical_language>

Target:
public void verify(Text text, final EStructuralFeature feature) { if (preSetValidationService != null) { final VerifyListener verifyListener = new VerifyListener() { @Override public void verifyText(VerifyEvent e) { final String currentText = Text.class.cast(e.widget).getText(); final String changedText = currentText.substring(0, e.start) + e.text + currentText.substring(e.end); final Diagnostic diag = preSetValidationService.validate(feature, changedText); if (diag.getSeverity() == Diagnostic.OK) { return; } e.doit = false; } }; text.addVerifyListener(verifyListener); } }
Source:
<code>private int getIndexForKey(String key) { int index = 0; for (DataSnapshot snapshot : mSnapshots) { if (snapshot.getKey().equals(key)) { return index; } <START> index++; <END> } throw new IllegalArgumentException("Key not found"); }</code><technical_language>Revert this change please</technical_language>

Target:
private int getIndexForKey(String key) { int index = 0; for (DataSnapshot snapshot : mSnapshots) { if (snapshot.getKey().equals(key)) { return index; } else { index++; } } throw new IllegalArgumentException("Key not found"); }
Source:
<code>private void reloadUrl(String url, @Nullable String pdfFilePath) { mIsPdf = false; if (mPdfAndroidJavascriptBridge != null) { mPdfAndroidJavascriptBridge.cleanUp(); mWebView.removeJavascriptInterface("PdfAndroidJavascriptBridge"); } if (pdfFilePath != null && isPdfRenderingSupported() && TextUtils.equals(PDF_LOADER_URL, url)) { mProgressBar.setProgress(80); mIsPdf = true; mPdfAndroidJavascriptBridge = new PdfAndroidJavascriptBridge(pdfFilePath, new PdfAndroidJavascriptBridge.Callbacks() { @Override public void onFailure() { <START> offerExternalApp(); <END> } @Override public void onLoad() { mProgressBar.setProgress(100); mProgressBar.setVisibility(GONE); } }); mWebView.addJavascriptInterface(mPdfAndroidJavascriptBridge, "PdfAndroidJavascriptBridge"); mWebView.setInitialScale(1); } mWebView.reloadUrl(url); }</code><technical_language>reset progress hide here</technical_language>

Target:
private void reloadUrl(String url, @Nullable String pdfFilePath) { mIsPdf = false; if (mPdfAndroidJavascriptBridge != null) { mPdfAndroidJavascriptBridge.cleanUp(); mWebView.removeJavascriptInterface("PdfAndroidJavascriptBridge"); } if (pdfFilePath != null && isPdfRenderingSupported() && TextUtils.equals(PDF_LOADER_URL, url)) { setProgress(80); mIsPdf = true; mPdfAndroidJavascriptBridge = new PdfAndroidJavascriptBridge(pdfFilePath, new PdfAndroidJavascriptBridge.Callbacks() { @Override public void onFailure() { offerExternalApp(); setProgress(100); } @Override public void onLoad() { setProgress(100); } }); mWebView.addJavascriptInterface(mPdfAndroidJavascriptBridge, "PdfAndroidJavascriptBridge"); mWebView.setInitialScale(1); } mWebView.reloadUrl(url); }
Source:
<code>public void addRepresentation (String fileName, int zoom) { if (fileName == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); int imageSelectorIndex = DPIUtil.mapZoomToImageSelectorIndex(zoom); if (imageSelectorIndex == device.getImageSelector ()) { <START> initNative (fileName); <END> } dpiFilename [imageSelectorIndex] = fileName; addRepresentation (new ImageData(fileName), zoom); }</code><technical_language>code required? care in next addRepresentation call</technical_language>

Target:
public void addRepresentation (String fileName, int zoom) { if (fileName == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); int imageSelectorIndex = DPIUtil.mapZoomToImageSelectorIndex(zoom); if (imageSelectorIndex == getImageSelector ()) { initNative (fileName); } imageRepFileNames [imageSelectorIndex] = fileName; addRepresentation (new ImageData(fileName), zoom); }
Source:
<code>public void add(int index, T element) { if (comparingSet.add(element)) { try { super.add(index, element); } catch (IndexOutOfBoundsException ioobException) { comparingSet.remove(element); <START> throw new IndexOutOfBoundsException(); <END> } } }</code><technical_language>nicely done! consideration: ioobException contains information wrong (i.e. actual index size of list) catching throwing a new lose this information. please change stacktrace message of original exception passed on: } catch (IndexOutOfBoundsException ioobException) { comparingSet.remove(element); throw ioobException;</technical_language>

Target:
public void add(int index, T element) { if (comparingSet.add(element)) { try { super.add(index, element); } catch (IndexOutOfBoundsException ioobException) { comparingSet.remove(element); throw ioobException; } } }
Source:
<code>public void add(EntityType entity) { validateAddAllowed(entity); <START> createAcl(entity); <END> super.add(entity); }</code><technical_language>Tricky! validateAddAllowed currently checks if WRITE_META permission entity. Acl created check. This breaks OneClickImporter</technical_language>

Target:
public void add(EntityType entity) { createAcl(entity); super.add(entity); }
Source:
<code>private boolean contains(CodeSource codeSource) { if (codeSource == null) return false; URL <START> url = <END> codeSource.getLocation(); if (url == null) return false; for (URL url1 : urls) { if (url1 == url) { return true; } } return false; }</code><technical_language>rename this url variable location simply variable name url in foreach loop</technical_language>

Target:
private boolean contains(CodeSource codeSource) { if (codeSource == null) return false; URL location = codeSource.getLocation(); if (location == null) return false; for (URL url : urls) { if (url == location) { return true; } } return false; }