auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public double impliedVolatilityFromPresentValue( SwaptionProduct swaption, RatesProvider ratesProvider, DayCount dayCount, double presentValue) { ExpandedSwaption expanded = swaption.expand(); double sign = expanded.getLongShort().sign(); <START> ArgChecker.isTrue(presentValue * sign > 0, "Present value sign must be in ligne with the option Long/Short flag "); <END> validateSwaption(ratesProvider, expanded); LocalDate valuationDate = ratesProvider.getValuationDate(); LocalDate expiryDate = expanded.getExpiryDate(); ArgChecker.isTrue(expiryDate.isAfter(valuationDate), "Expiry must be after valuation date to compute an implied volatility"); double expiry = dayCount.yearFraction(valuationDate, expiryDate); ExpandedSwap underlying = expanded.getUnderlying(); ExpandedSwapLeg fixedLeg = fixedLeg(underlying); double forward = swapPricer.parRate(underlying, ratesProvider); double pvbp = swapPricer.getLegPricer().pvbp(fixedLeg, ratesProvider); double strike = swapPricer.getLegPricer().couponEquivalent(fixedLeg, ratesProvider, pvbp); NormalFunctionData normalData = NormalFunctionData.of(forward, Math.abs(pvbp), 0.01); boolean isCall = fixedLeg.getPayReceive().isPay(); EuropeanVanillaOption option = EuropeanVanillaOption.of(strike, expiry, isCall ? PutCall.CALL : PutCall.PUT); return FORMULA_IMPLIED.impliedVolatility(normalData, option, Math.abs(presentValue)); }</code><technical_language>switched French part-way this error message</technical_language>

Target:
public double impliedVolatilityFromPresentValue( SwaptionProduct swaption, RatesProvider ratesProvider, DayCount dayCount, double presentValue) { ExpandedSwaption expanded = swaption.expand(); double sign = expanded.getLongShort().sign(); ArgChecker.isTrue(presentValue * sign > 0, "Present value sign must be in line with the option Long/Short flag "); validateSwaption(ratesProvider, expanded); LocalDate valuationDate = ratesProvider.getValuationDate(); LocalDate expiryDate = expanded.getExpiryDate(); ArgChecker.isTrue(expiryDate.isAfter(valuationDate), "Expiry must be after valuation date to compute an implied volatility"); double expiry = dayCount.yearFraction(valuationDate, expiryDate); ExpandedSwap underlying = expanded.getUnderlying(); ExpandedSwapLeg fixedLeg = fixedLeg(underlying); double forward = swapPricer.parRate(underlying, ratesProvider); double pvbp = swapPricer.getLegPricer().pvbp(fixedLeg, ratesProvider); double strike = swapPricer.getLegPricer().couponEquivalent(fixedLeg, ratesProvider, pvbp); NormalFunctionData normalData = NormalFunctionData.of(forward, Math.abs(pvbp), 0.01); boolean isCall = fixedLeg.getPayReceive().isPay(); EuropeanVanillaOption option = EuropeanVanillaOption.of(strike, expiry, isCall ? PutCall.CALL : PutCall.PUT); return FORMULA_IMPLIED.impliedVolatility(normalData, option, Math.abs(presentValue)); }
Source:
<code>public P decorate(P project) { if (!isProject(project)) { return project; } Branch branch = getBranch(project); BulkChange bc = new BulkChange(project); try { List<BranchProperty> properties = new ArrayList<BranchProperty>(branch.getProperties()); Collections.sort(properties, DescriptorOrder.reverse(BranchProperty.class)); for (BranchProperty property : properties) { ProjectDecorator<P, R> decorator = property.decorator(project); if (decorator != null) { if (project instanceof Project) { DescribableList<Publisher, Descriptor<Publisher>> publishersList = ((Project) project).getPublishersList(); <START> DescribableList buildWrappersList = ((Project) project).getBuildWrappersList(); <END> List<Publisher> publishers = decorator.publishers(publishersList.toList()); List<BuildWrapper> buildWrappers = decorator.buildWrappers(buildWrappersList.toList()); publishersList.replaceBy(publishers); buildWrappersList.replaceBy(buildWrappers); } List<JobProperty<? super P>> jobProperties = decorator.jobProperties(project.getAllProperties()); for (JobProperty<? super P> p : project.getAllProperties()) { project.removeProperty(p); } for (JobProperty<? super P> p : jobProperties) { project.addProperty(p); } decorator.project(project); } } } catch (IOException e) { } finally { bc.abort(); } return project; }</code><technical_language>[question] casting here? project instance of Project</technical_language>

Target:
public P decorate(P project) { if (!isProject(project)) { return project; } Branch branch = getBranch(project); BulkChange bc = new BulkChange(project); try { List<BranchProperty> properties = new ArrayList<BranchProperty>(branch.getProperties()); Collections.sort(properties, DescriptorOrder.reverse(BranchProperty.class)); for (BranchProperty property : properties) { JobDecorator<P, R> decorator = property.jobDecorator(project.getClass()); if (decorator != null) { if (project instanceof Project && decorator instanceof ProjectDecorator) { DescribableList<Publisher, Descriptor<Publisher>> publishersList = ((Project) project).getPublishersList(); DescribableList<BuildWrapper, Descriptor<BuildWrapper>> buildWrappersList = ((Project) project).getBuildWrappersList(); List<Publisher> publishers = ((ProjectDecorator) decorator).publishers(publishersList.toList()); List<BuildWrapper> buildWrappers = ((ProjectDecorator) decorator).buildWrappers(buildWrappersList.toList()); publishersList.replaceBy(publishers); buildWrappersList.replaceBy(buildWrappers); } List<JobProperty<? super P>> jobProperties = decorator.jobProperties(project.getAllProperties()); for (JobProperty<? super P> p : project.getAllProperties()) { project.removeProperty(p); } for (JobProperty<? super P> p : jobProperties) { project.addProperty(p); } decorator.project(project); } } } catch (IOException e) { } finally { bc.abort(); } return project; }
Source:
<code>private void trackAssignmentFailures() { if (!blacklistSendAssignentFailures) { return; } <START> Map<String, Integer> assignmentFailureWindow = new HashMap<>(); <END> assignmentFailureWindow.putAll(this.assignmentFailures); synchronized (assignmentFailures) { this.assignmentFailures.clear(); } this.sendAssignmentFailureCount.add(assignmentFailureWindow); }</code><technical_language>synchronized it, put assignmentFailureWindow.putAll(this.assignmentFailures); block need a concurrentHashMap. reduce synchronization mechanisms</technical_language>

Target:
private void trackAssignmentFailures() { if (!blacklistSendAssignentFailures) { return; } Map<String, Integer> assignmentFailureWindow = new HashMap<>(); synchronized (assignmentFailures) { assignmentFailureWindow.putAll(this.assignmentFailures); this.assignmentFailures.clear(); } this.sendAssignmentFailureCount.add(assignmentFailureWindow); }
Source:
<code>public static void initConnectionSettings(Configuration conf, ClientConfiguration awsConf) throws IOException { awsConf.setMaxConnections(intOption(conf, MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS, 1)); initProtocolSettings(conf, awsConf); awsConf.setMaxErrorRetry(intOption(conf, MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES, 0)); awsConf.setConnectionTimeout(intOption(conf, ESTABLISH_TIMEOUT, DEFAULT_ESTABLISH_TIMEOUT, 0)); awsConf.setSocketTimeout(intOption(conf, SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT, 0)); int sockSendBuffer = intOption(conf, SOCKET_SEND_BUFFER, DEFAULT_SOCKET_SEND_BUFFER, 2048); int sockRecvBuffer = intOption(conf, SOCKET_RECV_BUFFER, DEFAULT_SOCKET_RECV_BUFFER, 2048); <START> int requestTimeoutMillis = intOption(conf, REQUEST_TIMEOUT, <END> DEFAULT_REQUEST_TIMEOUT, 0); awsConf.setSocketBufferSizeHints(sockSendBuffer, sockRecvBuffer); awsConf.setRequestTimeout(requestTimeoutMillis); String signerOverride = conf.getTrimmed(SIGNING_ALGORITHM, ""); if (!signerOverride.isEmpty()) { LOG.debug("Signer override = {}", signerOverride); awsConf.setSignerOverride(signerOverride); } }</code><technical_language>Configuration.getTimeDuration()</technical_language>

Target:
public static void initConnectionSettings(Configuration conf, ClientConfiguration awsConf) throws IOException { awsConf.setMaxConnections(intOption(conf, MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS, 1)); initProtocolSettings(conf, awsConf); awsConf.setMaxErrorRetry(intOption(conf, MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES, 0)); awsConf.setConnectionTimeout(intOption(conf, ESTABLISH_TIMEOUT, DEFAULT_ESTABLISH_TIMEOUT, 0)); awsConf.setSocketTimeout(intOption(conf, SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT, 0)); int sockSendBuffer = intOption(conf, SOCKET_SEND_BUFFER, DEFAULT_SOCKET_SEND_BUFFER, 2048); int sockRecvBuffer = intOption(conf, SOCKET_RECV_BUFFER, DEFAULT_SOCKET_RECV_BUFFER, 2048); long requestTimeoutMillis = conf.getTimeDuration(REQUEST_TIMEOUT, DEFAULT_REQUEST_TIMEOUT, TimeUnit.SECONDS, TimeUnit.MILLISECONDS); if (requestTimeoutMillis > Integer.MAX_VALUE) { LOG.debug("Request timeout is too high({} ms). Setting to ms instead", requestTimeoutMillis, Integer.MAX_VALUE); requestTimeoutMillis = Integer.MAX_VALUE; } awsConf.setRequestTimeout((int) requestTimeoutMillis); awsConf.setSocketBufferSizeHints(sockSendBuffer, sockRecvBuffer); String signerOverride = conf.getTrimmed(SIGNING_ALGORITHM, ""); if (!signerOverride.isEmpty()) { LOG.debug("Signer override = {}", signerOverride); awsConf.setSignerOverride(signerOverride); } }
Source:
<code>public ZombieData getZombieData() { <START> System.out.println("Forge zombie"); <END> VillagerRegistry.VillagerProfession forgeProf = getVillagerTypeForge(); if (forgeProf == null) { ZombieType type = EntityUtil.typeFromNative(getZombieType()); return new SpongeZombieData(type, Optional.empty()); } return new SpongeZombieData(ZombieTypes.VILLAGER, SpongeForgeVillagerRegistry.getProfession(getVillagerTypeForge())); }</code><technical_language>remove this</technical_language>

Target:
public ZombieData getZombieData() { VillagerRegistry.VillagerProfession forgeProf = getVillagerTypeForge(); if (forgeProf == null) { ZombieType type = EntityUtil.typeFromNative(getZombieType()); return new SpongeZombieData(type, Optional.empty()); } return new SpongeZombieData(ZombieTypes.VILLAGER, SpongeForgeVillagerRegistry.getProfession(getVillagerTypeForge())); }
Source:
<code>public boolean track(byte[] key, short status, ClassWhiteList whitelist) { if (!trackSegments) { <START> return keyOnlyTracker.track(key, status, whitelist); <END> } int segment = HotRodConstants.isObjectStorage(status) ? segmentConsistentHash.getSegment(dataFormat.keyToObj(key, whitelist)) : segmentConsistentHash.getSegment(key); Set<WrappedByteArray> keys = keysPerSegment.get(segment); if (keys == null) { trackSegments = false; keyOnlyTracker = new ReplKeyTracker(drainKeys()); return keyOnlyTracker.track(key, status, whitelist); } boolean result = keys.add(new WrappedByteArray(key)); if (trace) log.trackingSegmentKey(Util.printArray(key), segment, !result); return result; }</code><technical_language>this class is but... NPE here? setting trackSegments instantiating keyOnlyTracker</technical_language>

Target:
public boolean track(byte[] key, short status, ClassWhiteList whitelist) { if (!trackSegments) return keyOnlyTracker.add(new WrappedByteArray(key)); int segment = HotRodConstants.isObjectStorage(status) ? segmentConsistentHash.getSegment(dataFormat.keyToObj(key, whitelist)) : segmentConsistentHash.getSegment(key); Set<WrappedByteArray> keys = keysPerSegment.get(segment); if (keys == null) { trackSegments = false; this.drainKeys(); return keyOnlyTracker.add(new WrappedByteArray(key)); } boolean result = keys.add(new WrappedByteArray(key)); if (trace) log.trackingSegmentKey(Util.printArray(key), segment, !result); return result; }
Source:
<code>private void dropConglomerate(long CID, Activation activation) { TransactionController tc = activation.getTransactionController(); LOG.trace(format("Dropping temporary conglomerate splice:%d", CID)); try { tc.dropConglomerate(CID); } <START> catch (StandardException e) { <END> } try { dropTable(CID); } catch (StandardException e) { } }</code><technical_language>log errors</technical_language>

Target:
private void dropConglomerate(long CID, Activation activation) { TransactionController tc = activation.getTransactionController(); LOG.trace(format("Dropping temporary conglomerate splice:%d", CID)); try { tc.dropConglomerate(CID); } catch (StandardException e) { LOG.warn(format("Unable to drop temporary trigger conglomerate %d. Cleanup may have been called twice.", CID), e); } try { dropTable(CID); } catch (StandardException e) { LOG.warn(format("Unable to drop HBase table for temporary trigger conglomerate %d. Cleanup may have been called twice.", CID), e); } }
Source:
<code>public boolean isEnvironmentVariable(ICdtVariable variable, ICConfigurationDescription cfg) { if(variable instanceof EnvironmentVariableSupplier.EnvVarMacro) return true; <START> if (variable == null) <END> return false; IVariableContextInfo info = getVariableContextInfo(cfg); ICdtVariable var = fEnvironmentMacroSupplier.getVariable(variable.getName(), info); if(var != null && variablesEqual(var, variable)) return true; return false; }</code><technical_language>check variable for null calling this method</technical_language>

Target:
public boolean isEnvironmentVariable(ICdtVariable variable, ICConfigurationDescription cfg) { if(variable instanceof EnvironmentVariableSupplier.EnvVarMacro) return true; IVariableContextInfo info = getVariableContextInfo(cfg); ICdtVariable var = fEnvironmentMacroSupplier.getVariable(variable.getName(), info); if(var != null && variablesEqual(var, variable)) return true; return false; }
Source:
<code>public void exitLongArray(ExprParser.LongArrayContext ctx) { Long[] values = ctx.longArrayBody() == null ? new Long[0] : new Long[ctx.longArrayBody().longElement().size()]; for (int i = 0; i < values.length; i++) { if (ctx.longArrayBody().longElement(i).getText().equalsIgnoreCase(Expr.NULL_LITERAL)) { values[i] = null; } else { <START> values[i] = Long.parseLong(ctx.longArrayBody().longElement(i).getText()); <END> } } nodes.put(ctx, new LongArrayExpr(values)); }</code><technical_language>Wondering if array elements casted if longs</technical_language>

Target:
public void exitLongArray(ExprParser.LongArrayContext ctx) { Long[] values = new Long[ctx.longElement().size()]; for (int i = 0; i < values.length; i++) { if (ctx.longElement(i).NULL() != null) { values[i] = null; } else if (ctx.longElement(i).LONG() != null) { values[i] = Long.parseLong(ctx.longElement(i).LONG().getText()); } else { throw new RE("Failed to parse array element %s as a long", ctx.longElement(i).getText()); } } nodes.put(ctx, new LongArrayExpr(values)); }
Source:
<code>public DBObject getMappedExample(Example<?> example, MongoPersistentEntity<?> entity) { DBObject reference = (DBObject) converter.convertToMongoType(example.getProbe()); if (entity.hasIdProperty() && entity.getIdentifierAccessor(example.getProbe()).getIdentifier() == null) { reference.removeField(entity.getIdProperty().getFieldName()); } ExampleSpecAccessor exampleSpecAccessor = new ExampleSpecAccessor(example.getExampleSpec()); applyPropertySpecs("", reference, example.getProbeType(), exampleSpecAccessor); if (exampleSpecAccessor.isTyped()) { Set<Class<?>> restrictedTypes = new HashSet<Class<?>>(); restrictedTypes.add(example.getResultType()); <START> this.converter.getTypeMapper().writeTypeRestrictions(reference, restrictedTypes); <END> } return ObjectUtils.nullSafeEquals(NullHandler.INCLUDE, exampleSpecAccessor.getNullHandler()) ? reference : new BasicDBObject(SerializationUtils.flatMap(reference)); }</code><technical_language>Collections.singletonSet( )</technical_language>

Target:
public DBObject getMappedExample(Example<?> example, MongoPersistentEntity<?> entity) { DBObject reference = (DBObject) converter.convertToMongoType(example.getProbe()); if (entity.hasIdProperty() && entity.getIdentifierAccessor(example.getProbe()).getIdentifier() == null) { reference.removeField(entity.getIdProperty().getFieldName()); } ExampleSpecAccessor exampleSpecAccessor = new ExampleSpecAccessor(example.getExampleSpec()); applyPropertySpecs("", reference, example.getProbeType(), exampleSpecAccessor); if (exampleSpecAccessor.isTyped()) { this.converter.getTypeMapper().writeTypeRestrictions(reference, (Set) Collections.singleton(example.getResultType())); } return ObjectUtils.nullSafeEquals(NullHandler.INCLUDE, exampleSpecAccessor.getNullHandler()) ? reference : new BasicDBObject(SerializationUtils.flattenMap(reference)); }
Source:
<code>public static void parseOptionsAndPayload(DatagramReader reader, Message message) { int currentOptionNumber = 0; byte nextByte = 0; while (reader.bytesAvailable()) { nextByte = reader.readNextByte(); if (nextByte != PAYLOAD_MARKER) { int optionDeltaNibble = (0xF0 & nextByte) >> 4; currentOptionNumber = calculateNextOptionNumber(reader, currentOptionNumber, optionDeltaNibble, message); int optionLengthNibble = 0x0F & nextByte; <START> int optionLength = determineValueFromNibble(reader, optionLengthNibble, message); <END> if (reader.bytesAvailable(optionLength)) { Option option = new Option(currentOptionNumber); option.setValue(reader.readBytes(optionLength)); message.getOptions().addOption(option); } else { String msg = String.format( "Message contains option of length %d with only fewer bytes left in the message", optionLength); throw new CoAPMessageFormatException(msg, message.getMID(), message.getRawCode(), message.isConfirmable()); } } else break; } if (nextByte == PAYLOAD_MARKER) { if (!reader.bytesAvailable()) { throw new CoAPMessageFormatException( "Found payload marker (0xFF) but message contains no payload", message.getMID(), message.getRawCode(), message.isConfirmable()); } else { message.setPayload(reader.readBytesLeft()); } } else { message.setPayload((String) null); } }</code><technical_language>null check</technical_language>

Target:
public static void parseOptionsAndPayload(DatagramReader reader, Message message) { if (reader == null) { throw new NullPointerException("reader must not be null!"); } if (message == null) { throw new NullPointerException("message must not be null!"); } int currentOptionNumber = 0; byte nextByte = 0; while (reader.bytesAvailable()) { nextByte = reader.readNextByte(); if (nextByte != PAYLOAD_MARKER) { int optionDeltaNibble = (0xF0 & nextByte) >> 4; currentOptionNumber = calculateNextOptionNumber(reader, currentOptionNumber, optionDeltaNibble, message); int optionLengthNibble = 0x0F & nextByte; int optionLength = determineValueFromNibble(reader, optionLengthNibble, message); if (reader.bytesAvailable(optionLength)) { Option option = new Option(currentOptionNumber); option.setValue(reader.readBytes(optionLength)); message.getOptions().addOption(option); } else { String msg = String.format( "Message contains option of length %d with only fewer bytes left in the message", optionLength); throw new CoAPMessageFormatException(msg, message.getMID(), message.getRawCode(), message.isConfirmable()); } } else break; } if (nextByte == PAYLOAD_MARKER) { if (!reader.bytesAvailable()) { throw new CoAPMessageFormatException( "Found payload marker (0xFF) but message contains no payload", message.getMID(), message.getRawCode(), message.isConfirmable()); } else { message.setPayload(reader.readBytesLeft()); } } else { message.setPayload((String) null); } }
Source:
<code>void typeSelectorKeyDownEventListener(final Object event) { if (event instanceof KeyboardEvent) { final KeyboardEvent keyEvent = (KeyboardEvent) event; if (isEnterKeyPressed(keyEvent)) { hide(true); keyEvent.preventDefault(); onClosedByKeyboard(); } else if (isEscapeKeyPressed(keyEvent)) { <START> reset(); <END> hide(false); onClosedByKeyboard(); } else if (isTabKeyPressed(keyEvent)) { if (keyEvent.shiftKey) { final Button managerButton = getManagerButton(); managerButton.focus(); } else { nameEditor.focus(); } keyEvent.preventDefault(); } } }</code><technical_language>Ouch.. if this is way.... it</technical_language>

Target:
void typeSelectorKeyDownEventListener(final Object event) { if (event instanceof KeyboardEvent) { final KeyboardEvent keyEvent = (KeyboardEvent) event; if (isEnterKeyPressed(keyEvent)) { hide(true); keyEvent.preventDefault(); onClosedByKeyboard(); } else if (isEscapeKeyPressed(keyEvent)) { reset(); hide(false); onClosedByKeyboard(); } else if (isTabKeyPressed(keyEvent)) { if (keyEvent.shiftKey) { final Button manageButton = getManageButton(); manageButton.focus(); } else { nameEditor.focus(); } keyEvent.preventDefault(); } } }
Source:
<code><START> private void fireDamageEventExplosion(final DamageSource source, final float amount, final CallbackInfoReturnable<Boolean> cir) { <END> this.fireDestroyDamageEvent(source, cir); }</code><technical_language>Fix this method prefix</technical_language>

Target:
private void impl$fireDamageEventExplosion(final DamageSource source, final float amount, final CallbackInfoReturnable<Boolean> cir) { this.fireDestroyDamageEvent(source, cir); }
Source:
<code>public static TmfStateValue newValueInt(int intValue) { if (intValue == -1) { return nullValue(); } <START> int offset = intValue & (INT_CACHE_SIZE-1); <END> IntegerStateValue cached = intCache[offset]; if (cached != null && cached.unboxInt() == intValue) { return cached; } IntegerStateValue new_value = new IntegerStateValue(intValue); intCache[offset] = new_value; return new_value; }</code><technical_language>spaces - Ctrl+Shift+F auto-format selection (or file if is selection)</technical_language>

Target:
public static TmfStateValue newValueInt(int intValue) { int offset = intValue & (INT_CACHE_SIZE -1 ); IntegerStateValue cached = intCache[offset]; if (cached != null && cached.unboxInt() == intValue) { return cached; } IntegerStateValue newValue = new IntegerStateValue(intValue); intCache[offset] = newValue; return newValue; }
Source:
<code>public void shouldDecreaseIdleWhenClosedOutsidePool() throws Throwable { Channel channel = newChannel(); tracker.channelCreated( channel, null ); assertEquals( 1, tracker.inUseChannelCount( address ) ); assertEquals( 0, tracker.idleChannelCount( address ) ); <START> channel.close(); <END> assertEquals( 1, tracker.inUseChannelCount( address ) ); assertEquals( 0, tracker.idleChannelCount( address ) ); tracker.channelReleased( channel ); assertEquals( 0, tracker.inUseChannelCount( address ) ); assertEquals( 0, tracker.idleChannelCount( address ) ); }</code><technical_language>channel.close().sync()? Channel#close() is async returns a future</technical_language>

Target:
public void shouldDecreaseIdleWhenClosedOutsidePool() throws Throwable { Channel channel = newChannel(); tracker.channelCreated( channel, null ); assertEquals( 1, tracker.inUseChannelCount( address ) ); assertEquals( 0, tracker.idleChannelCount( address ) ); channel.close().sync(); assertEquals( 1, tracker.inUseChannelCount( address ) ); assertEquals( 0, tracker.idleChannelCount( address ) ); tracker.channelReleased( channel ); assertEquals( 0, tracker.inUseChannelCount( address ) ); assertEquals( 0, tracker.idleChannelCount( address ) ); }
Source:
<code>private static String getMatchingLocation(String discoveredLocation, String pattern) { String regex = pattern.replace("*", "[^" + OsgiServiceUtils.LOCATION_END + "]+"); <START> Pattern compliedPattern = Pattern.compile(regex); <END> Matcher matcher = compliedPattern.matcher(discoveredLocation); if (!matcher.find()) { throw new IllegalArgumentException(String.format( "could not find location matching pattern \"%s\" in provided list \"%s\"", pattern, discoveredLocation)); } return matcher.group(); }</code><technical_language>if compile pattern store in a hashmap. dont compile (costs more resources, if dont reuse do advantages it...)</technical_language>

Target:
private static String getMatchingLocation(String discoveredLocation, String pattern) { Pattern compliedPattern = getCompiledPattern(pattern); Matcher matcher = compliedPattern.matcher(discoveredLocation); if (!matcher.find()) { throw new IllegalArgumentException(String.format( "could not find location matching pattern \"%s\" in provided list \"%s\"", pattern, discoveredLocation)); } return matcher.group(); }
Source:
<code>public byte[] serialize(LedgerMetadata metadata) throws IOException { int formatVersion = Math.min(maxLedgerMetadataFormatVersion, metadata.getMetadataFormatVersion()); final byte[] serialized; switch (formatVersion) { <START> case 3: <END> serialized = serializeVersion3(metadata); break; case 2: serialized = serializeVersion2(metadata); break; case 1: serialized = serializeVersion1(metadata); break; default: throw new IllegalArgumentException("Invalid format version " + formatVersion); } if (log.isDebugEnabled()) { log.debug("Serialized with format {}: {}", formatVersion, Base64.getEncoder().encodeToString(serialized)); } return serialized; }</code><technical_language>define constants for versions</technical_language>

Target:
public byte[] serialize(LedgerMetadata metadata) throws IOException { int formatVersion = metadata.getMetadataFormatVersion(); final byte[] serialized; switch (formatVersion) { case METADATA_FORMAT_VERSION_3: serialized = serializeVersion3(metadata); break; case METADATA_FORMAT_VERSION_2: serialized = serializeVersion2(metadata); break; case METADATA_FORMAT_VERSION_1: serialized = serializeVersion1(metadata); break; default: throw new IllegalArgumentException("Invalid format version " + formatVersion); } if (log.isDebugEnabled()) { String serializedStr; if (formatVersion > METADATA_FORMAT_VERSION_2) { serializedStr = Base64.getEncoder().encodeToString(serialized); } else { serializedStr = new String(serialized, UTF_8); } log.debug("Serialized with format {}: {}", formatVersion, serializedStr); } return serialized; }
Source:
<code>public StandardBuilder ignoreFailure() { <START> ignoreFailure = true; <END> return this; }</code><technical_language>call ignoreFailure(true) for consistency</technical_language>

Target:
public StandardBuilder ignoreFailure() { return ignoreFailure(true); }
Source:
<code>public String getName(ITmfEvent event) { if (fNameStateValue != null) { <START> getNameFromXmlStateValue(event, fName, fNameStateValue); <END> } return fName.toString(); }</code><technical_language>this method modify fName, is a string builder, this is called appended to? get name_prefix_firsttime_secondtime_thirdtime, I mistaken? I a copy of fName, simply start it</technical_language>

Target:
public String getName(ITmfEvent event) { StringBuilder name = new StringBuilder(PATTERN_SEGMENT_NAME_PREFIX); if (fNameStateValue != null) { getNameFromXmlStateValue(event, name, fNameStateValue); } else { name.append(fSegmentNameAttribute); } return name.toString(); }
Source:
<code>public static PDPrintStyle getPointStyle (JSONObject oskariStyle, PDDocument doc) throws IOException { PDPrintStyle style = new PDPrintStyle(); JSONObject image = JSONHelper.optJSONObject(oskariStyle, "image", () -> new JSONObject()); int shape = image.optInt("shape", 5); JSONObject imageFill = JSONHelper.optJSONObject(image, "fill", () -> new JSONObject()); String fillColor = JSONHelper.optString(imageFill, "color"); style.setFillColor(ColorUtil.parseColor(fillColor)); int size = image.optInt("size", 3); <START> style.setIcon(getIcon(doc, shape, fillColor, size)); <END> setLabelStyle(style, oskariStyle); return style; }</code><technical_language>This receive null fillColor is a param for replace("$fill", fillColor). a default color instead is "null"/unrecognized color black that</technical_language>

Target:
public static PDPrintStyle getPointStyle (JSONObject oskariStyle, PDDocument doc) throws IOException { PDPrintStyle style = new PDPrintStyle(); setImageStyle(style, oskariStyle, doc); setLabelStyle(style, oskariStyle); return style; }
Source:
<code>public void versionUpdatesForGetAfterRefreshMillis() throws InterruptedException { assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, 1L)); waitForUpdate(); assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, 2L)); waitForUpdate(); <START> waitForUpdate(); <END> assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, 3L)); }</code><technical_language>nit: this a test, right? versionDoesNotUpdateIfSupplierIsNotCalled</technical_language>

Target:
public void versionUpdatesForGetAfterRefreshMillis() throws InterruptedException { assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, UNINITIALIZED_VERSION + 1L)); waitForUpdate(); assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, UNINITIALIZED_VERSION + 2L)); waitForUpdate(); assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, UNINITIALIZED_VERSION + 3L)); }
Source:
<code>public void stop() { for(String connectorType : _connectors.keySet()) { try { _connectors.get(connectorType).stop(); } catch (Exception ex) { LOG.warn(String.format("Connector stop threw an exception for connectorType %s, " + "Swallowing it and continuing shutdown.", connectorType), ex); } } <START> _eventProducerPool.shutdown(); <END> while (_eventThread.isAlive()) { try { _eventThread.interrupt(); _eventThread.join(EVENT_THREAD_JOIN_TIMEOUT); } catch (InterruptedException e) { LOG.warn("Exception caught while stopping coordinator", e); } } _adapter.disconnect(); }</code><technical_language>shutdown happen event thread is interupted? In other words, get event shutdown producer</technical_language>

Target:
public void stop() { for(String connectorType : _connectors.keySet()) { try { _connectors.get(connectorType).stop(); } catch (Exception ex) { LOG.warn(String.format("Connector stop threw an exception for connectorType %s, " + "Swallowing it and continuing shutdown.", connectorType), ex); } } while (_eventThread.isAlive()) { try { _eventThread.interrupt(); _eventThread.join(EVENT_THREAD_JOIN_TIMEOUT); } catch (InterruptedException e) { LOG.warn("Exception caught while stopping coordinator", e); } } _eventProducerPool.shutdown(); _adapter.disconnect(); }
Source:
<code>static String trimPathDepth(String path, int maxDepth) { int count = 0; <START> String pathSeparator = "/"; <END> StringBuilder sb = new StringBuilder(); StringTokenizer pathTokenizer = new StringTokenizer(path, pathSeparator); while (pathTokenizer.hasMoreElements() && count++ < maxDepth) { sb.append(pathSeparator); sb.append(pathTokenizer.nextToken()); } path = sb.toString(); return path; }</code><technical_language>constant</technical_language>

Target:
static String trimPathDepth(String path, int maxDepth) { int count = 0; StringBuilder sb = new StringBuilder(); StringTokenizer pathTokenizer = new StringTokenizer(path, PATH_SEPERATOR); while (pathTokenizer.hasMoreElements() && count++ < maxDepth) { sb.append(PATH_SEPERATOR); sb.append(pathTokenizer.nextToken()); } path = sb.toString(); return path; }
Source:
<code>public void testTurboJpegStatus() { try{ Runtime.getRuntime().loadLibrary("turbojpeg"); } catch (java.lang.UnsatisfiedLinkError e) { Runtime.getRuntime().loadLibrary("turbojpeg"); } <START> TurboJpegStatus status = new TurboJpegStatus(); <END> assertTrue(status.getModule().length() > 0); assertTrue(status.getName().length() > 0); assertTrue(status.getComponent().get().length() > 0); assertTrue(status.getMessage().get().length() > 0); if (!status.isAvailable()) { return; } assertTrue(status.getMessage().get().contains("Wrapper Version")); }</code><technical_language>match coding conventions: Shoud try { ... } catch { ... } (spacing bracket location)</technical_language>

Target:
public void testTurboJpegStatus() { TurboJpegStatus status = new TurboJpegStatus(); assertTrue(status.getModule().length() > 0); assertTrue(status.getName().length() > 0); assertTrue(status.getComponent().get().length() > 0); assertTrue(status.getMessage().get().length() > 0); if (!status.isAvailable()) { return; } assertTrue(status.getMessage().get().contains("Wrapper Version")); }
Source:
<code>public void whenPromptHasAnswer_answerTextViewShowsCorrectDate() { FormEntryPrompt prompt = promptWithQuestionDefAndAnswer(questionDef, new DateData(dateAnswer.toDate())); DatePickerDetails datePickerDetails = DateTimeWidgetUtils.getDatePickerDetails(prompt.getQuestion().getAppearanceAttr()); DateWidget widget = createWidget(prompt); assertEquals(widget.binding.widgetAnswerText.getText(), DateTimeWidgetUtils.getDateTimeLabel(dateAnswer.toDate(), datePickerDetails, false, widget.getContext())); <START> } <END></code><technical_language>Yeah I fine</technical_language>

Target:
public void whenPromptHasAnswer_answerTextViewShowsCorrectDate() { FormEntryPrompt prompt = promptWithQuestionDefAndAnswer(questionDef, new DateData(dateAnswer.toDate())); DatePickerDetails datePickerDetails = DateTimeWidgetUtils.getDatePickerDetails(prompt.getQuestion().getAppearanceAttr()); DateWidget widget = createWidget(prompt); assertEquals(widget.binding.dateAnswerText.getText(), DateTimeWidgetUtils.getDateTimeLabel(dateAnswer.toDate(), datePickerDetails, false, widget.getContext())); }
Source:
<code>public File getStudioClasspathLocation() { return new File(OServer.class.getProtectionDomain() .getCodeSource() .getLocation() <START> .getPath()).toPath().resolveSibling("orientdb-studio-2.2.0.jar").toFile(); <END> }</code><technical_language>This code updated time is a newer version of library. improve this a bit more dynamic future-proof</technical_language>

Target:
public File getStudioClasspathLocation() { return new File(OServer.class.getProtectionDomain() .getCodeSource() .getLocation() .getPath()).toPath() .resolveSibling(String.format("orientdb-studio-%s.jar", ORIENTDB_STUDO_VERSION)) .toFile(); }
Source:
<code>private HashSet<ASTMethodCallExpression> getPreviousMethodCalls(final AbstractApexNode<?> self) { final HashSet<ASTMethodCallExpression> innerMethodCalls = new HashSet<>(); <START> final ASTBlockStatement blockStatement = self.getFirstParentOfType(ASTBlockStatement.class); <END> if (blockStatement != null) { List<ASTMethodCallExpression> nodes = blockStatement.findDescendantsOfType(ASTMethodCallExpression.class); mapCallToMethodDecl(self, innerMethodCalls, nodes); } final List<ASTMethod> specialMethods = findSpecialMethods(self); for (ASTMethod method : specialMethods) { innerMethodCalls.addAll(method.findDescendantsOfType(ASTMethodCallExpression.class)); } mapCallToMethodDecl(self, innerMethodCalls, new ArrayList<ASTMethodCallExpression>(innerMethodCalls)); return innerMethodCalls; }</code><technical_language>checking block is enough. of as: if (checkPerms()) { if (myOtherCondition) { // DML } else { // DML } } blocks DML, check (assuming blocks defined similarly Java grammar, imported jars certain). recursively move block block reach method block (avoid class block). This approach guarantee analyzing correct branches only, sibling blocks in current block's execution path</technical_language>

Target:
private HashSet<ASTMethodCallExpression> getPreviousMethodCalls(final AbstractApexNode<?> self) { final HashSet<ASTMethodCallExpression> innerMethodCalls = new HashSet<>(); final ASTMethod outerMethod = self.getFirstParentOfType(ASTMethod.class); if (outerMethod != null) { final ASTBlockStatement blockStatement = outerMethod.getFirstChildOfType(ASTBlockStatement.class); recursivelyEvaluateCRUDMethodCalls(self, innerMethodCalls, blockStatement); final List<ASTMethod> constructorMethods = findConstructorlMethods(self); for (ASTMethod method : constructorMethods) { innerMethodCalls.addAll(method.findDescendantsOfType(ASTMethodCallExpression.class)); } mapCallToMethodDecl(self, innerMethodCalls, new ArrayList<ASTMethodCallExpression>(innerMethodCalls)); } return innerMethodCalls; }
Source:
<code>private File createFile(String string) throws IOException { <START> File f = File.createTempFile(string, "tdat"); <END> files.add(f); return f; }</code><technical_language>do in a directory other system temp directory</technical_language>

Target:
private File createFile(String string) throws IOException { trash.mkdirs(); File f = File.createTempFile(string, "tdat", trash); files.add(f); return f; }
Source:
<code>public void passthroughProfileDoesNotContainFilterIdButDefaultWillBeUsed() { <START> passthroughProfileContainsSupportedPropertiesTest(true, false, DEFAULT_GUID, INVALID_NETWORK_FILTER_ID); <END> assertThat(validator.passthroughProfileContainsSupportedProperties(true), failsWith(EngineMessage.ACTION_TYPE_FAILED_PASSTHROUGH_PROFILE_CONTAINS_NOT_SUPPORTED_PROPERTIES)); }</code><technical_language>Instead of 'INVALID_NETWORK_FILTER_ID' pass null</technical_language>

Target:
public void passthroughProfileDoesNotContainFilterIdButDefaultWillBeUsed() { passthroughProfileContainsSupportedPropertiesTest(true, false, DEFAULT_GUID, null); assertThat(validator.passthroughProfileContainsSupportedProperties(true), failsWith(EngineMessage.ACTION_TYPE_FAILED_PASSTHROUGH_PROFILE_CONTAINS_NOT_SUPPORTED_PROPERTIES)); }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(1024); sb.append("<pool>"); if (minPoolSize != null) { sb.append("<").append(Pool.Tag.MIN_POOL_SIZE).append(">"); sb.append(minPoolSize); sb.append("</").append(Pool.Tag.MIN_POOL_SIZE).append(">"); } if (initialPoolSize != null) { sb.append("<").append(Pool.Tag.INITIAL_POOL_SIZE).append(">"); sb.append(initialPoolSize); sb.append("</").append(Pool.Tag.INITIAL_POOL_SIZE).append(">"); } if (maxPoolSize != null) { sb.append("<").append(Pool.Tag.MAX_POOL_SIZE).append(">"); sb.append(maxPoolSize); sb.append("</").append(Pool.Tag.MAX_POOL_SIZE).append(">"); } if (prefill != null) { sb.append("<").append(Pool.Tag.PREFILL).append(">"); sb.append(prefill); sb.append("</").append(Pool.Tag.PREFILL).append(">"); } <START> if (fair != null) <END> { sb.append("<").append(Pool.Tag.FAIR).append(">"); sb.append(fair); sb.append("</").append(Pool.Tag.CAPACITY).append(">"); } if (useStrictMin != null) { sb.append("<").append(Pool.Tag.USE_STRICT_MIN).append(">"); sb.append(useStrictMin); sb.append("</").append(Pool.Tag.USE_STRICT_MIN).append(">"); } if (flushStrategy != null) { sb.append("<").append(Pool.Tag.FLUSH_STRATEGY).append(">"); sb.append(flushStrategy); sb.append("</").append(Pool.Tag.FLUSH_STRATEGY).append(">"); } if (capacity != null) { sb.append("<").append(Pool.Tag.CAPACITY).append(">"); sb.append(capacity); sb.append("</").append(Pool.Tag.CAPACITY).append(">"); } sb.append("</pool>"); return sb.toString(); }</code><technical_language>print if != default</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(1024); sb.append("<pool>"); if (minPoolSize != null) { sb.append("<").append(Pool.Tag.MIN_POOL_SIZE).append(">"); sb.append(minPoolSize); sb.append("</").append(Pool.Tag.MIN_POOL_SIZE).append(">"); } if (initialPoolSize != null) { sb.append("<").append(Pool.Tag.INITIAL_POOL_SIZE).append(">"); sb.append(initialPoolSize); sb.append("</").append(Pool.Tag.INITIAL_POOL_SIZE).append(">"); } if (maxPoolSize != null) { sb.append("<").append(Pool.Tag.MAX_POOL_SIZE).append(">"); sb.append(maxPoolSize); sb.append("</").append(Pool.Tag.MAX_POOL_SIZE).append(">"); } if (prefill != null) { sb.append("<").append(Pool.Tag.PREFILL).append(">"); sb.append(prefill); sb.append("</").append(Pool.Tag.PREFILL).append(">"); } if (useStrictMin != null) { sb.append("<").append(Pool.Tag.USE_STRICT_MIN).append(">"); sb.append(useStrictMin); sb.append("</").append(Pool.Tag.USE_STRICT_MIN).append(">"); } if (fair != null && !fair.equals(Defaults.FAIR)) { sb.append("<").append(Pool.Tag.FAIR).append(">"); sb.append(fair); sb.append("</").append(Pool.Tag.FAIR).append(">"); } if (flushStrategy != null) { sb.append("<").append(Pool.Tag.FLUSH_STRATEGY).append(">"); sb.append(flushStrategy); sb.append("</").append(Pool.Tag.FLUSH_STRATEGY).append(">"); } if (capacity != null) { sb.append("<").append(Pool.Tag.CAPACITY).append(">"); sb.append(capacity); sb.append("</").append(Pool.Tag.CAPACITY).append(">"); } sb.append("</pool>"); return sb.toString(); }
Source:
<code>public void addResults(QueryStatusInfo statusInfo, QueryData data) { if (types.get() == null && statusInfo.getColumns() != null) { types.set(getTypes(statusInfo.getColumns())); } if (data.getData() != null) { checkState(types.get() != null, "Type information is missing"); List<Column> columns = statusInfo.getColumns(); for (List<Object> fields : data.getData()) { try { XContentBuilder dataBuilder = jsonBuilder().startObject(); for (int i = 0; i < fields.size(); i++) { Type type = types.get().get(i); Object value = convertValue(fields.get(i), type); dataBuilder.field(columns.get(i).getName(), value); } dataBuilder.endObject(); client.prepareIndex(tableName, "doc").setSource(dataBuilder.string(), JSON).get(); } catch (IOException e) { <START> throw new UncheckedIOException("Failure loading data into Elasticsearch index: " + tableName, e); <END> } } } }</code><technical_language>nit: Failure -> Error</technical_language>

Target:
public void addResults(QueryStatusInfo statusInfo, QueryData data) { if (types.get() == null && statusInfo.getColumns() != null) { types.set(getTypes(statusInfo.getColumns())); } if (data.getData() == null) { return; } checkState(types.get() != null, "Type information is missing"); List<Column> columns = statusInfo.getColumns(); for (List<Object> fields : data.getData()) { try { XContentBuilder dataBuilder = jsonBuilder().startObject(); for (int i = 0; i < fields.size(); i++) { Type type = types.get().get(i); Object value = convertValue(fields.get(i), type); dataBuilder.field(columns.get(i).getName(), value); } dataBuilder.endObject(); client.prepareIndex(tableName, "doc") .setSource(dataBuilder.string(), JSON) .get(); } catch (IOException e) { throw new UncheckedIOException("Error loading data into Elasticsearch index: " + tableName, e); } } }
Source:
<code>public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final Trade trade) { if (trade instanceof TradeWrapper) { TradeWrapper tradeWrapper = (TradeWrapper) trade; <START> DirectBeanFudgeBuilder<TradeWrapper> builder = new DirectBeanFudgeBuilder<>(JodaBeanUtils.metaBean(trade.getClass())); <END> MutableFudgeMsg wrapperMsg = builder.buildMessage(serializer, tradeWrapper); FudgeSerializer.addClassHeader(wrapperMsg, trade.getClass()); return wrapperMsg; } else { final MutableFudgeMsg tradeMsg = buildMessageImpl(serializer, trade); tradeMsg.add(null, FudgeSerializer.TYPES_HEADER_ORDINAL, FudgeWireType.STRING, Trade.class.getName()); return tradeMsg; } }</code><technical_language>line length</technical_language>

Target:
public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final Trade trade) { final MutableFudgeMsg tradeMsg = buildMessageImpl(serializer, trade); tradeMsg.add(null, FudgeSerializer.TYPES_HEADER_ORDINAL, FudgeWireType.STRING, Trade.class.getName()); return tradeMsg; }
Source:
<code>public void addKerberosAuthentication(UserEntity userEntity, String principalName, boolean persist) throws AmbariException { addAuthentication(userEntity, UserAuthenticationType.KERBEROS, principalName, new Validator() { <START> @Override <END> public void validate(UserEntity userEntity, String key) throws AmbariException { if (!CollectionUtils.isEmpty(userAuthenticationDAO.findByTypeAndKey(UserAuthenticationType.KERBEROS, key))) { throw new AmbariException("The authentication type already exists for this principal"); } } }, persist); }</code><technical_language>do lambda approach</technical_language>

Target:
public void addKerberosAuthentication(UserEntity userEntity, String principalName, boolean persist) throws AmbariException { addAuthentication(userEntity, UserAuthenticationType.KERBEROS, principalName, (user, key) -> { if (!CollectionUtils.isEmpty(userAuthenticationDAO.findByTypeAndKey(UserAuthenticationType.KERBEROS, key))) { throw new AmbariException("The authentication type already exists for this principal"); } }, persist); }
Source:
<code>public InterpreterResult interpret(String st, InterpreterContext context) throws InterpreterException { <START> assertVersion(); <END> z.setInterpreterContext(context); z.setGui(context.getGui()); z.setNoteGui(context.getNoteGui()); InterpreterContext.set(context); jsc.setJobGroup(buildJobGroupId(context), buildJobDesc(context), false); jsc.setLocalProperty("spark.scheduler.pool", context.getLocalProperties().get("pool")); InterpreterOutput out = context.out; PrintStream scalaOut = Console.out(); PrintStream newOut = (out != null) ? new PrintStream(out) : null; Console.setOut(newOut); InterpreterResult result = interpreter.interpret(st, context); Console.setOut(scalaOut); return result; }</code><technical_language>for instance, in interpret, nicer return message in InterpreterResult throwing exception</technical_language>

Target:
public InterpreterResult interpret(String st, InterpreterContext context) throws InterpreterException { if (isSparkVersionUnsupported()) { return unsupportedMessage; } z.setInterpreterContext(context); z.setGui(context.getGui()); z.setNoteGui(context.getNoteGui()); InterpreterContext.set(context); jsc.setJobGroup(buildJobGroupId(context), buildJobDesc(context), false); jsc.setLocalProperty("spark.scheduler.pool", context.getLocalProperties().get("pool")); InterpreterOutput out = context.out; PrintStream scalaOut = Console.out(); PrintStream newOut = (out != null) ? new PrintStream(out) : null; Console.setOut(newOut); InterpreterResult result = interpreter.interpret(st, context); Console.setOut(scalaOut); return result; }
Source:
<code>protected void activate(Map<String, Object> parameters) { <START> minThreads = (Integer) parameters.get(CONFIG_MIN_THREADS); <END> maxThreads = (Integer) parameters.get(CONFIG_MAX_THREADS); keepAliveTimeout = (Integer) parameters.get(CONFIG_KEEP_ALIVE); queueSize = (Integer) parameters.get(CONFIG_QUEUE_SIZE); threadPool = new ThreadPoolExecutor(minThreads, maxThreads, keepAliveTimeout, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(queueSize), new NamedThreadFactory("jetty")); logger.info("jetty thread pool started with min threads {}, max threads {}", minThreads, maxThreads); }</code><technical_language>(int) sufficient</technical_language>

Target:
protected void activate(Map<String, Object> parameters) { getConfigParameters(parameters); }
Source:
<code>public void loadValues(IProject project) { <START> Preferences prefs = DocCommentOwnerManager.getInstance().getPreferences(project); <END> newLineAfterBrief.setSelection(prefs.getBoolean(DocCommentOwnerManager.DOXYGEN_NEW_LINE_AFTER_BRIEF, DocCommentOwnerManager.DEF_DOXYGEN_NEW_LINE_AFTER_BRIEF)); useBriefTag.setSelection(prefs.getBoolean(DocCommentOwnerManager.DOXYGEN_USE_BRIEF_TAG, DocCommentOwnerManager.DEF_DOXYGEN_USE_BRIEF_TAG)); useJavadocStyle.setSelection(prefs.getBoolean(DocCommentOwnerManager.DOXYGEN_USE_JAVADOC_TAGS, DocCommentOwnerManager.DEF_DOXYGEN_USE_JAVADOC_TAGS)); usePrePostTag.setSelection(prefs.getBoolean(DocCommentOwnerManager.DOXYGEN_USE_PRE_POST_TAGS, DocCommentOwnerManager.DEF_DOXYGEN_USE_PRE_POST_TAGS)); useStructuredCommands.setSelection(prefs.getBoolean(DocCommentOwnerManager.DOXYGEN_USE_STRUCTURED_COMMANDS, DocCommentOwnerManager.DEF_DOXYGEN_USE_STRUCTURED_COMMANDS)); }</code><technical_language>I expect preference listeners process selection. this code shoter If a "function" (Button, String) - a preference listener</technical_language>

Target:
public void loadValues(IProject project) { initialize(newLineAfterBrief, DocCommentOwnerManager.DOXYGEN_NEW_LINE_AFTER_BRIEF, project, DocCommentOwnerManager.DEF_DOXYGEN_NEW_LINE_AFTER_BRIEF); initialize(useBriefTag, DocCommentOwnerManager.DOXYGEN_USE_BRIEF_TAG, project, DocCommentOwnerManager.DEF_DOXYGEN_USE_BRIEF_TAG); initialize(useJavadocStyle, DocCommentOwnerManager.DOXYGEN_USE_JAVADOC_TAGS, project, DocCommentOwnerManager.DEF_DOXYGEN_USE_JAVADOC_TAGS); initialize(usePrePostTag, DocCommentOwnerManager.DOXYGEN_USE_PRE_POST_TAGS, project, DocCommentOwnerManager.DEF_DOXYGEN_USE_PRE_POST_TAGS); initialize(useStructuralCommands, DocCommentOwnerManager.DOXYGEN_USE_STRUCTURAL_COMMANDS, project, DocCommentOwnerManager.DEF_DOXYGEN_USE_STRUCTURED_COMMANDS); }