auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected int removeStorageDomainLuns(storage_domain_static storageDomain) { final List<LUNs> lunsList = DbFacade.getInstance().getLunDao().getAllForVolumeGroup(storageDomain.getstorage()); int numOfRemovedLuns = 0; for (LUNs lun : lunsList) { if (DbFacade.getInstance().getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) == null) { <START> DbFacade.getInstance().getLunDao().remove(lun.getLUN_id()); <END> numOfRemovedLuns++; } else { DbFacade.getInstance().getLunDao().updateLUNsVolumeGroupId(lun.getLUN_id(), ""); } } return numOfRemovedLuns; }</code><technical_language>Please refactor DbFacade.getInstance().getLunDao() a method..</technical_language>

Target:
protected int removeStorageDomainLuns(storage_domain_static storageDomain) { final List<LUNs> lunsList = getLunDao().getAllForVolumeGroup(storageDomain.getstorage()); int numOfRemovedLuns = 0; for (LUNs lun : lunsList) { if (DbFacade.getInstance().getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) == null) { getLunDao().remove(lun.getLUN_id()); numOfRemovedLuns++; } else { getLunDao().updateLUNsVolumeGroupId(lun.getLUN_id(), ""); } } return numOfRemovedLuns; }
Source:
<code>private static IASTNode getFirstNode(IASTTranslationUnit ast) { IASTDeclaration[] declarations = ast.getDeclarations(); return (declarations.length > 0) ? <START> declarations[0] : <END> null; }</code><technical_language>this limited declarations located in translation unit file</technical_language>

Target:
private static IASTNode getFirstNode(IASTTranslationUnit ast) { IASTDeclaration[] declarations = ast.getDeclarations(); return Arrays.stream(declarations).filter(decl -> decl.isPartOfTranslationUnitFile()).findFirst().orElse(null); }
Source:
<code>public synchronized void init() { new Thread(new Runnable() { @Override public void run() { FrameworkInfo framework = FrameworkInfo.newBuilder() .setUser("") .setName(mesosCloud.getFrameworkName()) .setCheckpoint(mesosCloud.isCheckpoint()).build(); LOGGER.info("Initializing the Mesos driver with options" + "\n" + "User: " + framework.getUser() + "\n" + "Framework Name: " + framework.getName() + "\n" + "Checkpointing: " + framework.getCheckpoint() ); driver = new MesosSchedulerDriver(JenkinsScheduler.this, framework, mesosCloud.getMaster()); Status runStatus = driver.run(); if (runStatus != Status.DRIVER_STOPPED) { <START> LOGGER.severe("The Mesos driver was aborted! Status number: " + runStatus.getNumber()); <END> } driver = null; } }).start(); }</code><technical_language>s/number/code/</technical_language>

Target:
public synchronized void init() { new Thread(new Runnable() { @Override public void run() { FrameworkInfo framework = FrameworkInfo.newBuilder() .setUser("") .setName(mesosCloud.getFrameworkName()) .setCheckpoint(mesosCloud.isCheckpoint()).build(); LOGGER.info("Initializing the Mesos driver with options" + "\n" + "User: " + framework.getUser() + "\n" + "Framework Name: " + framework.getName() + "\n" + "Checkpointing: " + framework.getCheckpoint() ); driver = new MesosSchedulerDriver(JenkinsScheduler.this, framework, mesosCloud.getMaster()); Status runStatus = driver.run(); if (runStatus != Status.DRIVER_STOPPED) { LOGGER.severe("The Mesos driver was aborted! Status code: " + runStatus.getNumber()); } driver = null; } }).start(); }
Source:
<code>private void assertArticleExistence(ArticleIdentity id, boolean expectedToExist) { boolean received404 = false; try { articleCrudService.readXml(id); } catch (InMemoryContentRepoService.InMemoryContentRepoServiceException me) { received404 = true; } catch(NotFoundException nfe) { <START> received404 = true; <END> } catch (RestClientException e) { throw e; } assertEquals(received404, !expectedToExist, (expectedToExist ? "Article expected to exist but doesn't" : "Article expected not to exist but does")); }</code><technical_language>"or version" of catch block this more succinct: } catch (InMemoryContentRepoService.InMemoryContentRepoServiceException | NotFoundException ex) { received404 = true; }</technical_language>

Target:
private void assertArticleExistence(ArticleIdentity id, boolean expectedToExist) { boolean received404 = false; try { articleCrudService.readXml(id); } catch (InMemoryContentRepoService.InMemoryContentRepoServiceException|NotFoundException nfe) { received404 = true; } catch (RestClientException e) { throw e; } assertEquals(received404, !expectedToExist, (expectedToExist ? "Article expected to exist but doesn't" : "Article expected not to exist but does")); }
Source:
<code>public String getExtendedLabelForVSM(String providedShapeURI) { for (IConfigurationElement configurationElement : extensions) { String identifier = ((ExtensionHandle) configurationElement.getParent()).getSimpleIdentifier(); if (identifier != null && identifier.equals(providedShapeURI)) { return <START> configurationElement.getAttribute(LABEL_ATTRIBUTE) + " - " + configurationElement.getNamespaceIdentifier(); END> } } return "Unknown URI"; }</code><technical_language>Add a getExtendedLabelsForVSM(IConfigurationElement) method avoid duplication</technical_language>

Target:
public String getExtendedLabelForVSM(String providedShapeURI) { for (IConfigurationElement configurationElement : extensions) { String identifier = ((ExtensionHandle) configurationElement.getParent()).getSimpleIdentifier(); if (identifier != null && identifier.equals(providedShapeURI)) { return getExtendedLabelForVSM(configurationElement); } } return "Unknown URI"; }
Source:
<code>public static void checkSchema(StructType tableSchema, StructType dataSchema, int[] partitionColumnMap, String location) throws StandardException{ StructField[] tableFields = tableSchema.fields(); StructField[] dataFields = dataSchema.fields(); if (tableFields.length != dataFields.length) { throw StandardException.newException(SQLState.INCONSISTENT_NUMBER_OF_ATTRIBUTE, tableFields.length, dataFields.length, location); } StructField[] partitionedTableFields = new StructField[tableSchema.fields().length]; Set<Integer> partitionColumns = new HashSet<>(); for (int pos : partitionColumnMap) { partitionColumns.add(pos); } int index = 0; for (int i = 0; i < tableFields.length; ++i) { if (!partitionColumns.contains(i)) { partitionedTableFields[index++] = tableFields[i]; } } <START> for (int pos:partitionColumnMap) { <END> partitionedTableFields[index++] = tableFields[pos]; } for (int i = 0; i < tableFields.length - partitionColumnMap.length; ++i) { String tableFiledTypeName = partitionedTableFields[i].dataType().typeName(); String dataFieldTypeName = dataFields[i].dataType().typeName(); if (!tableFiledTypeName.equals(dataFieldTypeName)){ throw StandardException.newException(SQLState.INCONSISTENT_DATATYPE_ATTRIBUTES, tableFields[i].name(), tableFields[i].dataType().toString(), dataFields[i].name(), dataFields[i].dataType().toString(),location); } } }</code><technical_language>need populate partition columns here, check consistency of partitioning columns data schema table schema</technical_language>

Target:
public static void checkSchema(StructType tableSchema, StructType dataSchema, int[] partitionColumnMap, String location) throws StandardException{ StructField[] tableFields = tableSchema.fields(); StructField[] dataFields = dataSchema.fields(); if (tableFields.length != dataFields.length) { throw StandardException.newException(SQLState.INCONSISTENT_NUMBER_OF_ATTRIBUTE, tableFields.length, dataFields.length, location); } StructField[] partitionedTableFields = new StructField[tableSchema.fields().length]; Set<Integer> partitionColumns = new HashSet<>(); for (int pos : partitionColumnMap) { partitionColumns.add(pos); } int index = 0; for (int i = 0; i < tableFields.length; ++i) { if (!partitionColumns.contains(i)) { partitionedTableFields[index++] = tableFields[i]; } } for (int i = 0; i < tableFields.length - partitionColumnMap.length; ++i) { String tableFiledTypeName = partitionedTableFields[i].dataType().typeName(); String dataFieldTypeName = dataFields[i].dataType().typeName(); if (!tableFiledTypeName.equals(dataFieldTypeName)){ throw StandardException.newException(SQLState.INCONSISTENT_DATATYPE_ATTRIBUTES, tableFields[i].name(), tableFields[i].dataType().toString(), dataFields[i].name(), dataFields[i].dataType().toString(),location); } } }
Source:
<code>public <T> T getAdapter(Class<T> adapter) { <START> return (T) (adapter.isAssignableFrom(walk.getRepository().getClass()) <END> ? walk.getRepository() : null); }</code><technical_language>Introduces a new warning</technical_language>

Target:
public <T> T getAdapter(Class<T> adapter) { if (adapter != Repository.class) { return null; } return adapter.cast(walk.getRepository()); }
Source:
<code>protected WebTarget newRequest(String uriString) { ResteasyClient httpClient = new ResteasyClientBuilder() <START> .establishConnectionTimeout(10, TimeUnit.SECONDS) <END> .socketTimeout(10, TimeUnit.SECONDS) .build(); WebTarget webTarget = httpClient.target(uriString); webTarget.register(new BasicAuthentication(TestConfig.getUsername(), TestConfig.getPassword())); return webTarget; }</code><technical_language>Deprecated. Please connectTimeout() (<LINK_0></technical_language>

Target:
protected WebTarget newRequest(String uriString) { ResteasyClient httpClient = new ResteasyClientBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(10, TimeUnit.SECONDS) .build(); WebTarget webTarget = httpClient.target(uriString); webTarget.register(new BasicAuthentication(TestConfig.getUsername(), TestConfig.getPassword())); return webTarget; }
Source:
<code>private void parseAndBuildConfig(ClientConfig config) throws Exception { YamlMapping yamlRootNode; try { yamlRootNode = ((YamlMapping) YamlLoader.load(in)); } catch (Exception ex) { throw new InvalidConfigurationException("Invalid YAML configuration", ex); } <START> YamlNode clientRoot = yamlRootNode.childAsMapping(ClientConfigSections.HAZELCAST_CLIENT.name.toLowerCase()); <END> if (clientRoot == null) { throw new InvalidConfigurationException("No mapping with hazelcast-client key is found in the provided " + "configuration"); } Node w3cRootNode = asW3cNode(clientRoot); replaceVariables(w3cRootNode); importDocuments(clientRoot); new YamlClientDomConfigProcessor(true, config).buildConfig(w3cRootNode); }</code><technical_language>Minor: toLowerCase is needed here</technical_language>

Target:
private void parseAndBuildConfig(ClientConfig config) throws Exception { YamlMapping yamlRootNode; try { yamlRootNode = ((YamlMapping) YamlLoader.load(in)); } catch (Exception ex) { throw new InvalidConfigurationException("Invalid YAML configuration", ex); } YamlNode clientRoot = yamlRootNode.childAsMapping(ClientConfigSections.HAZELCAST_CLIENT.name); if (clientRoot == null) { throw new InvalidConfigurationException("No mapping with hazelcast-client key is found in the provided " + "configuration"); } Node w3cRootNode = asW3cNode(clientRoot); replaceVariables(w3cRootNode); importDocuments(clientRoot); new YamlClientDomConfigProcessor(true, config).buildConfig(w3cRootNode); }
Source:
<code>public void setup() { Type elementType; switch (valueTypeName) { case "BIGINT": elementType = BIGINT; break; case "DOUBLE": elementType = DOUBLE; break; case "VARCHAR": elementType = VARCHAR; break; default: throw new UnsupportedOperationException(); } Signature signature = new Signature("$operator$CAST", FunctionKind.SCALAR, new ArrayType(elementType).getTypeSignature(), JSON.getTypeSignature()); List<RowExpression> projections = ImmutableList.of( new CallExpression(signature, new ArrayType(elementType), ImmutableList.of( <START> field(0, JSON)))); <END> pageProcessor = new ExpressionCompiler(MetadataManager.createTestMetadataManager()) .compilePageProcessor(Optional.empty(), projections) .get(); page = new Page(createChannel(POSITIONS, ARRAY_SIZE, valueBound)); }</code><technical_language>Merge this line previous</technical_language>

Target:
public void setup() { Type elementType; switch (valueTypeName) { case "BIGINT": elementType = BIGINT; break; case "DOUBLE": elementType = DOUBLE; break; case "VARCHAR": elementType = VARCHAR; break; default: throw new UnsupportedOperationException(); } Signature signature = new Signature("$operator$CAST", FunctionKind.SCALAR, new ArrayType(elementType).getTypeSignature(), JSON.getTypeSignature()); List<RowExpression> projections = ImmutableList.of( new CallExpression(signature, new ArrayType(elementType), ImmutableList.of(field(0, JSON)))); pageProcessor = new ExpressionCompiler(MetadataManager.createTestMetadataManager()) .compilePageProcessor(Optional.empty(), projections) .get(); page = new Page(createChannel(POSITION_COUNT, ARRAY_SIZE, elementType)); }
Source:
<code>public void write(Content entity, FieldWriter writer, OutputContext ctxt) throws IOException { if (entity instanceof Container) { Integer offset = 0; Integer limit = Integer.MAX_VALUE; <START> if (!Strings.isNullOrEmpty(ctxt.getRequest().getParameter("sub_item.offset"))) { <END> offset = Integer.valueOf(ctxt.getRequest().getParameter("sub_item.offset")); } if (!Strings.isNullOrEmpty(ctxt.getRequest().getParameter("sub_item.limit"))) { limit = Integer.valueOf(ctxt.getRequest().getParameter("sub_item.limit")); } Container container = (Container) entity; ImmutableList<ItemRef> orderedRefs = Ordering.natural() .onResultOf(ItemRef::getSortKey) .reverse() .nullsLast() .immutableSortedCopy(container.getItemRefs()); orderedRefs = orderedRefs.stream().skip(offset).limit(limit).collect(ImmutableCollectors.toList()); writer.writeList(childRefWriter, orderedRefs, ctxt); } }</code><technical_language>Pull a variable - duplication hurt check in conditional, do Integer.valueOf of another. pull sub_item.offset a constant. sub_items.offset consistent key</technical_language>

Target:
public void write(Content entity, FieldWriter writer, OutputContext ctxt) throws IOException { if (entity instanceof Container) { Integer offset = 0; Integer limit = Integer.MAX_VALUE; String offsetStr = ctxt.getRequest().getParameter(SUB_ITEM_OFFSET); if (!Strings.isNullOrEmpty(offsetStr)) { offset = Integer.valueOf(offsetStr); } String limitStr = ctxt.getRequest().getParameter(SUB_ITEM_LIMIT); if (!Strings.isNullOrEmpty(limitStr)) { limit = Integer.valueOf(limitStr); } Container container = (Container) entity; ImmutableList<ItemRef> orderedRefs = Ordering.natural() .onResultOf(ItemRef::getSortKey) .reverse() .nullsLast() .immutableSortedCopy(container.getItemRefs()); orderedRefs = orderedRefs.stream() .skip(offset) .limit(limit) .collect(ImmutableCollectors.toList()); writer.writeList(childRefWriter, orderedRefs, ctxt); } }
Source:
<code>protected void doRemove(String owner, String service, String name) throws NotFoundException { EntityManager manager = managerProvider.get(); SshPairImpl entity = manager.find(SshPairImpl.class, new SshPairPrimaryKey(owner, service, name)); if (entity != null) { manager.remove(entity); } else { throw new NotFoundException(String.format("Ssh pair with service '%s' and name '%s' was not found.", service, name)); } <START> <END> }</code><technical_language>remove extra lines</technical_language>

Target:
protected void doRemove(String owner, String service, String name) throws NotFoundException { EntityManager manager = managerProvider.get(); SshPairImpl entity = manager.find(SshPairImpl.class, new SshPairPrimaryKey(owner, service, name)); if (entity == null) { throw new NotFoundException(String.format("Ssh pair with service '%s' and name '%s' was not found.", service, name)); } manager.remove(entity); }
Source:
<code>public ModuleOptionsMetadata resolve(ModuleDefinition moduleDefinition) { List<ModuleOptionsMetadata> moms = new ArrayList<ModuleOptionsMetadata>(); ModuleType type = moduleDefinition.getType(); if (type == source || type == processor) { moms.add(new PojoModuleOptionsMetadata(Output.class, null, null, conversionService)); } if (type == sink || type == processor) { moms.add(new PojoModuleOptionsMetadata(Input.class, null, null, conversionService)); } <START> switch (moms.size()) { <END> case 2: return new FlattenedCompositeModuleOptionsMetadata(moms); case 1: return moms.iterator().next(); case 0: return null; default: throw new IllegalStateException("Should never happen: " + moms); } }</code><technical_language>for potential future do this: case 0: return null; case 1: return moms.iterator().next(); default: return new FlattenedCompositeModuleOptionsMetadata(moms); This avoid "should happen" default right IMO</technical_language>

Target:
public ModuleOptionsMetadata resolve(ModuleDefinition moduleDefinition) { List<ModuleOptionsMetadata> moms = new ArrayList<ModuleOptionsMetadata>(); ModuleType type = moduleDefinition.getType(); if (type == source || type == processor) { moms.add(new PojoModuleOptionsMetadata(OutputOptionsMetadata.class, null, null, conversionService)); } if (type == sink || type == processor) { moms.add(new PojoModuleOptionsMetadata(InputOptionsMetadata.class, null, null, conversionService)); } switch (moms.size()) { case 0: return null; case 1: return moms.iterator().next(); default: return new FlattenedCompositeModuleOptionsMetadata(moms); } }
Source:
<code>public synchronized boolean seek(CtfLocationInfo ctfLocationData) { boolean ret = false; if (ctfLocationData.equals(CtfLocation.INVALID_LOCATION)) { fCurLocation = NULL_LOCATION; return false; } if (fCurLocation.getLocationInfo().equals(ctfLocationData)) { return super.hasMoreEvents(); } fCurLocation = new CtfLocation(ctfLocationData); final long seekToTimestamp = ctfLocationData.getTimestamp(); final long offsetTimestamp = this.getCtfTmfTrace().timestampNanoToCycles(seekToTimestamp); try { if (offsetTimestamp < 0) { ret = super.seek(0L); } else { ret = super.seek(offsetTimestamp); } } catch (CTFException e) { Activator.getDefault().logError(e.getMessage(), e); return false; } long index = 0; ITmfEvent currentEvent = getCurrentEvent(); ret &= (currentEvent != null); ITmfEvent previousEvent = currentEvent; for (long i = 0; ret && i < ctfLocationData.getIndex(); i++) { if (seekToTimestamp >= Objects.requireNonNull(currentEvent).getTimestamp().getValue()) { index++; } else { break; } ret = advance(); previousEvent = currentEvent; currentEvent = getCurrentEvent(); } if (ret) { <START> fCurLocation = new CtfLocation(new CtfLocationInfo(Objects.requireNonNull(previousEvent).getTimestamp().getValue(), index)); <END> } else { fCurLocation = NULL_LOCATION; } return ret; }</code><technical_language>large index event next timestamp, location info timestamp, index 0</technical_language>

Target:
public synchronized boolean seek(CtfLocationInfo ctfLocationData) { boolean ret = false; if (ctfLocationData.equals(CtfLocation.INVALID_LOCATION)) { fCurLocation = NULL_LOCATION; return false; } if (fCurLocation.getLocationInfo().equals(ctfLocationData)) { return super.hasMoreEvents(); } fCurLocation = new CtfLocation(ctfLocationData); final long seekToTimestamp = ctfLocationData.getTimestamp(); final long offsetTimestamp = this.getCtfTmfTrace().timestampNanoToCycles(seekToTimestamp); try { if (offsetTimestamp < 0) { ret = super.seek(0L); } else { ret = super.seek(offsetTimestamp); } } catch (CTFException e) { Activator.getDefault().logError(e.getMessage(), e); return false; } long index = 0; ITmfEvent currentEvent = getCurrentEvent(); ret &= (currentEvent != null); ITmfEvent previousEvent = currentEvent; for (long i = 0; ret && i < ctfLocationData.getIndex(); i++) { if (seekToTimestamp >= Objects.requireNonNull(currentEvent).getTimestamp().getValue()) { index++; } else { index = 0; break; } ret = advance(); previousEvent = currentEvent; currentEvent = getCurrentEvent(); } if (ret) { fCurLocation = new CtfLocation(new CtfLocationInfo(Objects.requireNonNull(previousEvent).getTimestamp().getValue(), index)); } else { fCurLocation = NULL_LOCATION; } return ret; }
Source:
<code>public String getRunningFlowIds() { List<Integer> allIds = new ArrayList<Integer>(); getRunningFlowsIdsHelper(allIds, queuedFlowMap.values()); getRunningFlowsIdsHelper(allIds, runningFlows.values()); <START> Collections.sort(allIds); <END> return allIds.toString(); }</code><technical_language>Is sorting necessary? if so, why</technical_language>

Target:
public String getRunningFlowIds() { List<Integer> allIds = new ArrayList<Integer>(); getRunningFlowsIdsHelper(allIds, queuedFlows.getAllEntries()); getRunningFlowsIdsHelper(allIds, runningFlows.values()); Collections.sort(allIds); return allIds.toString(); }
Source:
<code>public boolean isNextStepCurrentStep() { <START> return null == this.getNextStep() || <END> CURRENT_STEP.equalsIgnoreCase(this.getNextStep()); }</code><technical_language>do need null check here? I so</technical_language>

Target:
public boolean isNextStepCurrentStep() { return CURRENT_STEP.equalsIgnoreCase(this.getNextStep()); }
Source:
<code>protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotations deliveryAnnotations) { ReadableBuffer duplicate = getData().duplicate(); final int amqpDeliveryCount = deliveryCount - 1; final ByteBuf result = PooledByteBufAllocator.DEFAULT.heapBuffer(getEncodeSize()); <START> Header localHeader = this.header; if (localHeader == null) { localHeader = new Header(); } else { localHeader = new Header(header); } localHeader.setDeliveryCount(UnsignedInteger.valueOf(amqpDeliveryCount)); TLSEncode.getEncoder().setByteBuffer(new NettyWritable(result)); TLSEncode.getEncoder().writeObject(localHeader); <END> TLSEncode.getEncoder().setByteBuffer((WritableBuffer) null); writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); result.writeBytes(duplicate.byteBuffer()); return new NettyReadable(result); }</code><technical_language>previous separate send-encoding methods avoided encoding a [new] header wasnt necessary. combining this is encoding a header send delivery-annotations, doesnt need to. If header null amqpDeliveryCount isnt >=1 skip encoding header, modifies message doesnt convey new</technical_language>

Target:
protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotations deliveryAnnotations) { ReadableBuffer duplicate = getData().duplicate(); final int amqpDeliveryCount = deliveryCount - 1; final ByteBuf result = PooledByteBufAllocator.DEFAULT.heapBuffer(getEncodeSize()); Header localHeader = this.header; if (localHeader == null) { if (deliveryCount > 1) { localHeader = new Header(); } } else { localHeader = new Header(header); } if (localHeader != null) { localHeader.setDeliveryCount(UnsignedInteger.valueOf(amqpDeliveryCount)); TLSEncode.getEncoder().setByteBuffer(new NettyWritable(result)); TLSEncode.getEncoder().writeObject(localHeader); TLSEncode.getEncoder().setByteBuffer((WritableBuffer) null); } writeDeliveryAnnotationsForSendBuffer(result, deliveryAnnotations); duplicate.position(encodedHeaderSize + encodedDeliveryAnnotationsSize); result.writeBytes(duplicate.byteBuffer()); return new NettyReadable(result); }
Source:
<code>private static IEditorPart findEditor(Object inputElement, boolean activate) { if (inputElement instanceof IJavaElement) { ICompilationUnit cu= (ICompilationUnit)((IJavaElement)inputElement).getAncestor(IJavaElement.COMPILATION_UNIT); if (cu != null) { IWorkbenchPage page= JavaPlugin.getActivePage(); IEditorPart editor= page != null ? editor= page.getActiveEditor() : null; if (editor != null) { boolean isCompareEditorInput= isCompareEditorInput(editor.getEditorInput()); if (isCompareEditorInput || !JavaModelUtil.isPrimary(cu)) { <START> if (isCompareEditorInput) { return editor; } <END> IEditorInput editorInput = editor.getEditorInput(); IJavaElement editorCU= getEditorInputJavaElement(editorInput, false); if (cu.equals(editorCU)) { if (activate && page.getActivePart() != editor) { page.activate(editor); } return editor; } } } } } return null; }</code><technical_language>I suggest pull this out of enclosing if, disjoint cases other if (currently enclosing) care isCompareEditorInput more</technical_language>

Target:
private static IEditorPart findEditor(Object inputElement, boolean activate) { if (inputElement instanceof IJavaElement) { ICompilationUnit cu= (ICompilationUnit)((IJavaElement)inputElement).getAncestor(IJavaElement.COMPILATION_UNIT); if (cu != null) { IWorkbenchPage page= JavaPlugin.getActivePage(); IEditorPart editor= page != null ? editor= page.getActiveEditor() : null; if (editor != null) { boolean isCompareEditorInput= isCompareEditorInput(editor.getEditorInput()); if (isCompareEditorInput) { return editor; } if (!JavaModelUtil.isPrimary(cu)) { IEditorInput editorInput = editor.getEditorInput(); IJavaElement editorCU= getEditorInputJavaElement(editorInput, false); if (cu.equals(editorCU)) { if (activate && page.getActivePart() != editor) { page.activate(editor); } return editor; } } } } } return null; }
Source:
<code>private Operator getWindowOperator(final String queryId, final WindowOperatorInfo wOpInfo, final ClassLoader classLoader) throws IllegalArgumentException, IOException, ClassNotFoundException { final String operatorId = operatorIdGenerator.generate(); final Operator operator; switch (wOpInfo.getWindowOperatorType()) { case TIME: operator = new TimeWindowOperator<>( queryId, operatorId, wOpInfo.getWindowSize(), wOpInfo.getWindowInterval()); break; case COUNT: operator = new CountWindowOperator<>( queryId, operatorId, wOpInfo.getWindowSize(), wOpInfo.getWindowInterval()); break; case SESSION: operator = new SessionWindowOperator<>( queryId, operatorId, wOpInfo.getWindowInterval()); break; case JOIN: <START> final List<ByteBuffer> objectList = wOpInfo.getFunctions(); <END> final BiPredicate joinPred = (BiPredicate) deserializeLambda(objectList.get(0), classLoader); operator = new JoinOperator<>(queryId, operatorId, joinPred); break; default: throw new IllegalArgumentException("MISTTask: Invalid window operator type " + wOpInfo.getWindowOperatorType().toString()); } return operator; }</code><technical_language>function</technical_language>

Target:
private Operator getWindowOperator(final String queryId, final WindowOperatorInfo wOpInfo, final ClassLoader classLoader) throws IllegalArgumentException, IOException, ClassNotFoundException { final String operatorId = operatorIdGenerator.generate(); final Operator operator; switch (wOpInfo.getWindowOperatorType()) { case TIME: operator = new TimeWindowOperator<>( queryId, operatorId, wOpInfo.getWindowSize(), wOpInfo.getWindowInterval()); break; case COUNT: operator = new CountWindowOperator<>( queryId, operatorId, wOpInfo.getWindowSize(), wOpInfo.getWindowInterval()); break; case SESSION: operator = new SessionWindowOperator<>( queryId, operatorId, wOpInfo.getWindowInterval()); break; case JOIN: final List<ByteBuffer> functionList = wOpInfo.getFunctions(); final BiPredicate joinPred = (BiPredicate) deserializeLambda(functionList.get(0), classLoader); operator = new JoinOperator<>(queryId, operatorId, joinPred); break; default: throw new IllegalArgumentException("MISTTask: Invalid window operator type " + wOpInfo.getWindowOperatorType().toString()); } return operator; }
Source:
<code>private void processRetryOps() { if (!retryQueue.isEmpty()) { boolean interrupted = false; retryQueue.drainTo(localRetryOps, drainSize); int i = 0; <START> while (i < localRetryOps.size()) { <END> try { localRetryOps.get(i).apply(); i++; } catch (final InterruptedException e) { interrupted = true; LOG.log(Level.FINE, "Op.apply() failed with InterruptedException, try again", e); } } if (interrupted) { interrupt(); } localRetryOps.clear(); } }</code><technical_language>iterator? for (final Op retryOp : localRetryOps) { try { op.apply(); } }</technical_language>

Target:
private void processRetryOps() { if (!retryQueue.isEmpty()) { retryQueue.drainTo(localRetryOps, drainSize); for (final Op retryOp : localRetryOps) { retryOp.retry(); } localRetryOps.clear(); } }
Source:
<code>protected Step transform() { return generateStep(NORMALIZE_VARIANTS, <START> new VariantsTransform(updateVariantOptionsWithJobSpecificValues(getVariantOptions()), getPipelineOptions())); <END> }</code><technical_language>Is do this update a step initialization, in a @PostConstruct method</technical_language>

Target:
protected Step transform() { return generateStep(NORMALIZE_VARIANTS, new VariantsTransform(getVariantOptions(), getPipelineOptions())); }
Source:
<code>public Lock(LockDataTypes.LockId lockId, LockListener lockListener, LockClient.ClientContext clientContext, LockConfig lockConfig) { this.lockId = lockId; this.clientContext = clientContext; this.lockListener = lockListener; this.eventConsumer = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("lock-event-consumer").build()); <START> this.lockConfig = lockConfig; <END> initializeStates(); this.state = states.get(LockStateType.NO_LEASE); eventConsumer.submit(this::consume); }</code><technical_language>avoid code repetition this call other constructor NO_LEASE init state. this(lockId, lockListener, clientContext, lockConfig, LockStateType.NO_LEASE)</technical_language>

Target:
public Lock(LockDataTypes.LockId lockId, LockListener lockListener, LockClient.ClientContext clientContext, LockConfig lockConfig) { this(lockId, lockListener, clientContext, lockConfig, LockStateType.NO_LEASE); }
Source:
<code>private boolean handleSSLFailure(Certificate[] lastChain) throws CommandLineException { printLine("Unable to connect due to unrecognised server certificate"); for (Certificate current : lastChain) { if (current instanceof X509Certificate) { X509Certificate x509Current = (X509Certificate) current; Map<String, String> fingerprints = FingerprintGenerator.generateFingerprints(x509Current); printLine("Subject - " + x509Current.getSubjectX500Principal().getName()); printLine("Issuer - " + x509Current.getIssuerDN().getName()); printLine("Valid From - " + x509Current.getNotBefore()); printLine("Valid To - " + x509Current.getNotAfter()); for (String alg : fingerprints.keySet()) { printLine(alg + " : " + fingerprints.get(alg)); } printLine(""); } } for (;;) { String response; if (trustManager.isModifyTrustStore()) { response = readLine("Accept certificate? [N]o, [T]emporarily, [P]ermenantly : ", false, true); } else { response = readLine("Accept certificate? [N]o, [T]emporarily : ", false, true); } if (response == null) return false; <START> if (response != null && response.length() == 1) { <END> switch (response.toLowerCase(Locale.ENGLISH).charAt(0)) { case 'n': return false; case 't': trustManager.storeChainTemporarily(lastChain); return true; case 'p': if (trustManager.isModifyTrustStore()) { trustManager.storeChainPermenantly(lastChain); return true; } } } } }</code><technical_language>This if (response == null) { return false; } else if (response.length() == 1) {</technical_language>

Target:
private boolean handleSSLFailure(Certificate[] lastChain) throws CommandLineException { printLine("Unable to connect due to unrecognised server certificate"); for (Certificate current : lastChain) { if (current instanceof X509Certificate) { X509Certificate x509Current = (X509Certificate) current; Map<String, String> fingerprints = FingerprintGenerator.generateFingerprints(x509Current); printLine("Subject - " + x509Current.getSubjectX500Principal().getName()); printLine("Issuer - " + x509Current.getIssuerDN().getName()); printLine("Valid From - " + x509Current.getNotBefore()); printLine("Valid To - " + x509Current.getNotAfter()); for (String alg : fingerprints.keySet()) { printLine(alg + " : " + fingerprints.get(alg)); } printLine(""); } } for (;;) { String response; if (trustManager.isModifyTrustStore()) { response = readLine("Accept certificate? [N]o, [T]emporarily, [P]ermenantly : ", false, true); } else { response = readLine("Accept certificate? [N]o, [T]emporarily : ", false, true); } if (response == null) return false; else if (response.length() == 1) { switch (response.toLowerCase(Locale.ENGLISH).charAt(0)) { case 'n': return false; case 't': trustManager.storeChainTemporarily(lastChain); return true; case 'p': if (trustManager.isModifyTrustStore()) { trustManager.storeChainPermenantly(lastChain); return true; } } } } }
Source:
<code>public void testCheckAccessThreadGroup() { carbonSecurityManager = mock(CarbonSecurityManager.class); ThreadGroup threadGroup = mock(ThreadGroup.class); <START> carbonSecurityManager.checkAccess(threadGroup); <END> }</code><technical_language>testing method checkAccess, mock carbonSecurityManager class. need create a real object of carbonSecurityManager class call method</technical_language>

Target:
public void testCheckAccessThreadGroup() { System.setProperty("denied.system.properties", "mockDeniedProperty"); carbonSecurityManager = new CarbonSecurityManager(); ThreadGroup threadGroup = mock(ThreadGroup.class); carbonSecurityManager.checkAccess(threadGroup); }
Source:
<code>public void emit(final Context context, final Event event) { checkNotNull(event); checkNotNull(context); final WebResource.Builder builder = client .resource(resolveEventPath(event.getClass())) .accept(MediaType.APPLICATION_JSON_TYPE) .type(MediaType.APPLICATION_JSON_TYPE); contextSerializer.serialize(context, builder); try { final ClientResponse response = builder.put(ClientResponse.class, event); final ClientResponse.Status status = response.getClientResponseStatus(); if ( ! ACCEPTED.equals(status)) { throw new KasperException("event submission failed with status <" + status.getReasonPhrase() + ">"); } } catch (final Exception e) { <START> e.printStackTrace(); <END> throw new KasperException("Unable to send event : " + event.getClass().getName(), e); } }</code><technical_language>log remove no</technical_language>

Target:
public void emit(final Context context, final Event event) { checkNotNull(event); checkNotNull(context); final WebResource.Builder builder = client .resource(resolveEventPath(event.getClass())) .accept(MediaType.APPLICATION_JSON_TYPE) .type(MediaType.APPLICATION_JSON_TYPE); contextSerializer.serialize(context, builder); try { final ClientResponse response = builder.put(ClientResponse.class, event); final ClientResponse.Status status = response.getClientResponseStatus(); if ( ! ACCEPTED.equals(status)) { throw new KasperException("event submission failed with status <" + status.getReasonPhrase() + ">"); } } catch (final Exception e) { throw new KasperException("Unable to send event : " + event.getClass().getName(), e); } }
Source:
<code><START> public Options(Dimension screenRes) { <END> setInstance(this); this.dimension = screenRes; factoryRng = new Random(); spawnRng = factoryRng; this.setBackGround(DEFAULT_BACKGROUND_IMAGE); this.setMusicFileName(DEFAULT_MUSIC_FILENAME); this.setHitSoundFileName(DEFAULT_HIT_SOUND_FILENAME); this.setLaserSoundFileName(DEFAULT_LASER_SOUND_FILENAME); this.setAmmoPickupSoundFileName(DEFAULT_PICKUP_SOUND_FILENAME); playingMusic = false; mutedMusic = false; mutedSfx = false; musicVolume = 1.0f; sfxVolume = 1.0f; }</code><technical_language>Please this private protected</technical_language>

Target:
public Options(Dimension screenRes) { setInstance(this); this.dimension = screenRes; factoryRng = new Random(); spawnRng = factoryRng; this.setBackGround(DEFAULT_BACKGROUND_IMAGE); this.setMusicFileName(DEFAULT_MUSIC_FILENAME); this.setEatSoundFileName(DEFAULT_EAT_SOUND_FILENAME); this.setLaserSoundFileName(DEFAULT_LASER_SOUND_FILENAME); this.setPickupSoundFileName(DEFAULT_PICKUP_SOUND_FILENAME); playingMusic = false; mutedMusic = false; mutedSfx = false; musicVolume = 1.0f; sfxVolume = 1.0f; }
Source:
<code>protected void createControls(Composite composite) { fAncestor = createMergeViewer(composite, MergeViewerSide.ANCESTOR); fAncestor.addSelectionChangedListener(this); fLeft = createMergeViewer(composite, MergeViewerSide.LEFT); fLeft.addSelectionChangedListener(this); fRight = createMergeViewer(composite, MergeViewerSide.RIGHT); fRight.addSelectionChangedListener(this); IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager(); ITheme currentTheme = null; <START> if (themeManager != null) { <END> currentTheme = themeManager.getCurrentTheme(); } fColors = new EMFCompareColor(this, currentTheme, getCompareConfiguration()); composite.addControlListener(new ControlListener() { public void controlResized(ControlEvent e) { redrawCenterControl(); } public void controlMoved(ControlEvent e) { } }); }</code><technical_language>tend initialization this: final A a; if (cond) { a = something; } else { a = null; } This clear a is set null;</technical_language>

Target:
protected void createControls(Composite composite) { fAncestor = createMergeViewer(composite, MergeViewerSide.ANCESTOR); fAncestor.addSelectionChangedListener(this); fLeft = createMergeViewer(composite, MergeViewerSide.LEFT); fLeft.addSelectionChangedListener(this); fRight = createMergeViewer(composite, MergeViewerSide.RIGHT); fRight.addSelectionChangedListener(this); IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager(); final ITheme currentTheme; if (themeManager != null) { currentTheme = themeManager.getCurrentTheme(); } else { currentTheme = null; } fColors = new EMFCompareColor(this.getControl(), currentTheme, getCompareConfiguration()); composite.addControlListener(new ControlListener() { public void controlResized(ControlEvent e) { redrawCenterControl(); } public void controlMoved(ControlEvent e) { } }); }
Source:
<code>public void push(RowMap r) throws Exception { try { PutRecordResult putResult = kinesis.putRecord( this.stream, ByteBuffer.wrap(r.toJSON().toString().getBytes()), r.getDatabase(), Long.toString(counter.getAndIncrement()) ); this.context.setPosition(r); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Success - put result in kinesis stream -> " + putResult.toString()); LOGGER.debug("Position -> " + r.getPosition()); } } catch (ResourceNotFoundException e) { e.printStackTrace(); } catch (InvalidArgumentException e) { e.printStackTrace(); } catch (ProvisionedThroughputExceededException e) { e.printStackTrace(); } catch (SQLException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>of four: SQLException caught; if setPosition throws a SQLException want do is silently fail. in cases other 3 thrown, generally crash fix common crash cases log try limp along</technical_language>

Target:
public void push(RowMap r) throws Exception { PutRecordResult putResult = kinesis.putRecord( this.stream, ByteBuffer.wrap(r.toJSON().toString().getBytes()), r.getDatabase(), Long.toString(counter.getAndIncrement()) ); this.context.setPosition(r); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Success - put result in kinesis stream -> " + putResult.toString()); LOGGER.debug("Position -> " + r.getPosition()); } }
Source:
<code>public void handleEditPostResult(int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK || data == null || !isAdded()) { return; } int localId = data.getIntExtra(EditPostActivity.EXTRA_POST_LOCAL_ID, 0); final PostModel post = mPostStore.getPostByLocalPostId(localId); if ((post == null) && !data.getBooleanExtra(EditPostActivity.EXTRA_IS_DISCARDABLE, false)) { ToastUtils.showToast(getActivity(), R.string.post_not_found, ToastUtils.Duration.LONG); return; } <START> UploadUtils.handleEditPostResultSnackbars(getActivity(), <END> getActivity().findViewById(R.id.coordinator), data, post, mSite, new View.OnClickListener() { @Override public void onClick(View v) { UploadUtils .publishPost(getActivity(), post, mSite, mDispatcher); } }); }</code><technical_language>wondering - post null if post == null EXTRA_IS_DISCARDABLE is true? If null, suggest removing (post == null) check. Wdyt</technical_language>

Target:
public void handleEditPostResult(int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK || data == null || !isAdded()) { return; } int localId = data.getIntExtra(EditPostActivity.EXTRA_POST_LOCAL_ID, 0); final PostModel post = mPostStore.getPostByLocalPostId(localId); if (post == null) { if (!data.getBooleanExtra(EditPostActivity.EXTRA_IS_DISCARDABLE, false)) { ToastUtils.showToast(getActivity(), R.string.post_not_found, ToastUtils.Duration.LONG); } return; } UploadUtils.handleEditPostResultSnackbars(getActivity(), getActivity().findViewById(R.id.coordinator), data, post, mSite, new View.OnClickListener() { @Override public void onClick(View v) { UploadUtils .publishPost(getActivity(), post, mSite, mDispatcher); } }); }
Source:
<code>public void performApply(ILaunchConfigurationWorkingCopy configuration) { ArrayList<String> api = new ArrayList<>(); ArrayList<String> internal = new ArrayList<>(); ArrayList<String> jar = new ArrayList<>(); ArrayList<String> report = new ArrayList<>(); ArrayList<String> reportto = new ArrayList<>(); for (Pattern pattern : this.patterns) { switch (pattern.kind) { case Pattern.API: { api.add(pattern.pattern); break; } case Pattern.INTERNAL: { internal.add(pattern.pattern); break; } case Pattern.JAR: { jar.add(pattern.pattern); break; } case Pattern.REPORT: { report.add(pattern.pattern); break; } case Pattern.REPORT_TO: { reportto.add(pattern.pattern); break; } default: break; } } <START> configuration.setAttribute(ApiUseLaunchDelegate.API_PATTERNS_LIST, !api.isEmpty() ? api : (List<String>) null); <END> configuration.setAttribute(ApiUseLaunchDelegate.INTERNAL_PATTERNS_LIST, !internal.isEmpty() ? internal : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.JAR_PATTERNS_LIST, !jar.isEmpty() ? jar : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.REPORT_PATTERNS_LIST, !report.isEmpty() ? report : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.REPORT_TO_PATTERNS_LIST, !reportto.isEmpty() ? reportto : (List<String>) null); }</code><technical_language>readable</technical_language>

Target:
public void performApply(ILaunchConfigurationWorkingCopy configuration) { ArrayList<String> api = new ArrayList<>(); ArrayList<String> internal = new ArrayList<>(); ArrayList<String> jar = new ArrayList<>(); ArrayList<String> report = new ArrayList<>(); ArrayList<String> reportto = new ArrayList<>(); for (Pattern pattern : this.patterns) { switch (pattern.kind) { case Pattern.API: { api.add(pattern.pattern); break; } case Pattern.INTERNAL: { internal.add(pattern.pattern); break; } case Pattern.JAR: { jar.add(pattern.pattern); break; } case Pattern.REPORT: { report.add(pattern.pattern); break; } case Pattern.REPORT_TO: { reportto.add(pattern.pattern); break; } default: break; } } configuration.setAttribute(ApiUseLaunchDelegate.API_PATTERNS_LIST, api.size() > 0 ? api : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.INTERNAL_PATTERNS_LIST, internal.size() > 0 ? internal : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.JAR_PATTERNS_LIST, jar.size() > 0 ? jar : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.REPORT_PATTERNS_LIST, report.size() > 0 ? report : (List<String>) null); configuration.setAttribute(ApiUseLaunchDelegate.REPORT_TO_PATTERNS_LIST, reportto.size() > 0 ? reportto : (List<String>) null); }
Source:
<code>public void markEdgeNeedLightUpdate(BlockPos pos, EnumSkyBlock type) { if(type == EnumSkyBlock.BLOCK) return; int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); Cube cube = this.getCube(x, y, z); <START> if (cube != null) { <END> int localX = Coords.blockToLocal(x); int localY = Coords.blockToLocal(y); int localZ = Coords.blockToLocal(z); if (localX == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.WEST); } else if (localX == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.EAST); } if (localY == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.DOWN); } else if (localY == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.UP); } if (localZ == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.NORTH); } else if (localZ == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.SOUTH); } } }</code><technical_language>invert if() if (cube == null) return;. Early return IS more readable in cases (you need scroll end of if() is else statement for example)</technical_language>

Target:
public void markEdgeNeedLightUpdate(BlockPos pos, EnumSkyBlock type) { if (type == EnumSkyBlock.BLOCK) return; int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); Cube cube = this.getCube(x, y, z); if (cube == null) return; int localX = Coords.blockToLocal(x); int localY = Coords.blockToLocal(y); int localZ = Coords.blockToLocal(z); if (localX == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.WEST); } else if (localX == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.EAST); } if (localY == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.DOWN); } else if (localY == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.UP); } if (localZ == 0) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.NORTH); } else if (localZ == 15) { cube.markEdgeNeedSkyLightUpdate(EnumFacing.SOUTH); } }
Source:
<code>private void registerAllOvfDisks(List<DiskImage> ovfStoreDiskImages) { for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) { ovfStoreDiskImage.setDiskAlias("OVF_STORE"); ovfStoreDiskImage.setDiskDescription("OVF_STORE"); ovfStoreDiskImage.setShareable(true); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(ovfStoreDiskImage, getParameters().getStorageDomainId()); String result = "succeeded"; try { if (!runInternalAction(VdcActionType.RegisterDisk, registerDiskParams, null).getSucceeded()) { result = "failed"; } } catch (Exception e) { result = "failed"; log.error(e); } <START> log.infoFormat("Register new floating OVF_STORE disk with disk id {0} for storage domain {1} has {2}", <END> ovfStoreDiskImage.getId(), getParameters().getStorageDomainId(), result); } }</code><technical_language>belong a patch</technical_language>

Target:
private void registerAllOvfDisks(List<DiskImage> ovfStoreDiskImages) { for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) { ovfStoreDiskImage.setDiskAlias(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setDiskDescription(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setShareable(true); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(ovfStoreDiskImage, getParameters().getStorageDomainId()); String result = "succeeded"; if (!runInternalAction(VdcActionType.RegisterDisk, registerDiskParams, null).getSucceeded()) { result = "failed"; } log.infoFormat("Register new floating OVF_STORE disk with disk id {0} for storage domain {1} has {2}", ovfStoreDiskImage.getId(), getParameters().getStorageDomainId(), result); addOvfStoreDiskToDomain(ovfStoreDiskImage); } }
Source:
<code>long calculateTimeoutSeconds() { int minimum = 10; <START> int size = dataContainer.size(); <END> if (size < 10_000) return minimum; return Math.round(Math.log1p(size) * 10); }</code><technical_language>call sizeIncludingExpired</technical_language>

Target:
long calculateTimeoutSeconds() { int minimum = 10; int size = dataContainer.sizeIncludingExpired(); if (size < 10_000) return minimum; return Math.round(Math.log1p(size) * 10); }
Source:
<code>protected void initExtendedEditorConfiguration() { if (configuration == null) { final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + AppliedStereotypeProperty.class.getName()); if (languagePreferred != null && !"".equals(languagePreferred)) { configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, new <START> AppliedStereotypeProperty(null, null)); <END> } else { configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, new AppliedStereotypeProperty(null, null)); } } }</code><technical_language>null, null ? I check, strange... is required a mistake</technical_language>

Target:
protected void initExtendedEditorConfiguration() { if (configuration == null) { final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + AppliedStereotypeProperty.class.getName()); if (languagePreferred != null && !"".equals(languagePreferred)) { configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()); } else { configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement()); } } }