auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public MISTDefaultExecutionEnvironmentImpl(final String serverAddr, <END> final int serverPort, final String runningJarPath) throws InjectionException, IOException { final JavaConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder(); cb.bindNamedParameter(MISTQuerySerializerImpl.RunningJarPath.class, runningJarPath); final Injector injector = Tang.Factory.getTang().newInjector(cb.build()); querySerializer = injector.getInstance(MISTQuerySerializer.class); final NettyTransceiver clientToDriver = new NettyTransceiver(new InetSocketAddress(serverAddr, serverPort)); this.proxyToDriver = SpecificRequestor.getClient(MistTaskProvider.class, clientToDriver); final TaskList taskList = proxyToDriver.getTasks(new QueryInfo()); this.tasks = taskList.getTasks(); this.taskProxyMap = new ConcurrentHashMap<IPAddress, ClientToTaskMessage>(); }</code><technical_language>public final</technical_language>

Target:
public MISTDefaultExecutionEnvironmentImpl(final String serverAddr, final int serverPort, final String runningJarPath) throws InjectionException, IOException { final JavaConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder(); cb.bindNamedParameter(RunningJarPath.class, runningJarPath); final Injector injector = Tang.Factory.getTang().newInjector(cb.build()); querySerializer = injector.getInstance(MISTQuerySerializer.class); final NettyTransceiver clientToDriver = new NettyTransceiver(new InetSocketAddress(serverAddr, serverPort)); this.proxyToDriver = SpecificRequestor.getClient(MistTaskProvider.class, clientToDriver); final TaskList taskList = proxyToDriver.getTasks(new QueryInfo()); this.tasks = taskList.getTasks(); this.taskProxyMap = new ConcurrentHashMap<>(); }
Source:
<code>public ThreadedEventHandler(final Map<String, EventFactory> typedEventFactories, final SafeCaller safeCaller) { thread = new Thread(() -> { final EventHandler worker = new EventHandler(typedEventSubscribers, typedEventFactories, safeCaller); while (running.get()) { try { final Event event = queue.poll(1, TimeUnit.HOURS); if (event == null) { logger.debug("Hey, you have really very few events."); <START> } else if (event.equals(notifyEvent)) { <END> } else { worker.handleEvent(event); } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } catch (RuntimeException ex) { logger.error("Error on event handling.", ex); } } }, "ESH-OSGiEventManager"); thread.start(); }</code><technical_language>Nope - a de-facto singleton instance of notifyEvent comparing events of potentially unknown sources do in equals()-implementations, suggest leaving this is</technical_language>

Target:
public ThreadedEventHandler(final Map<String, EventFactory> typedEventFactories, final SafeCaller safeCaller) { thread = new Thread(() -> { final EventHandler worker = new EventHandler(typedEventSubscribers, typedEventFactories, safeCaller); while (running.get()) { try { final Event event = queue.poll(1, TimeUnit.HOURS); if (event == null) { logger.debug("Hey, you have really very few events."); } else if (event == notifyEvent) { } else { worker.handleEvent(event); } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } catch (RuntimeException ex) { logger.error("Error on event handling.", ex); } } }, "ESH-OSGiEventManager"); thread.start(); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Incomparable that = (Incomparable) o; <START> return s != null ? s.equals(that.s) : that.s == null; <END> }</code><technical_language>simplified java return o == this || (o instanceof Incomparable && Objects.equals(s, ((Incomparable) o).s));</technical_language>

Target:
public boolean equals(Object o) { return o == this || (o instanceof Incomparable && Objects.equals(s, ((Incomparable) o).s)); }
Source:
<code>public ProgramState addConstraintTransitively(SymbolicValue symbolicValue, Constraint constraint) { final ProgramState[] ps = {addConstraint(symbolicValue, constraint)}; knownRelations() .filter(rsv -> rsv.isEquality() && (rsv.getLeftOp() == symbolicValue || rsv.getRightOp() == symbolicValue)) .map(rsv -> rsv.getLeftOp() == symbolicValue ? rsv.getRightOp() : rsv.getLeftOp()) <START> .forEach(sv -> ps[0] = ps[0].addConstraint(sv, constraint)); <END> return ps[0]; }</code><technical_language>I pretty for is a collector acting reduction : <LINK_0> While this final array works is nice</technical_language>

Target:
public ProgramState addConstraintTransitively(SymbolicValue symbolicValue, Constraint constraint) { List<SymbolicValue> transitiveSymbolicValues = knownRelations() .filter(rsv -> rsv.isEquality() && (rsv.getLeftOp() == symbolicValue || rsv.getRightOp() == symbolicValue)) .map(rsv -> rsv.getLeftOp() == symbolicValue ? rsv.getRightOp() : rsv.getLeftOp()) .collect(Collectors.toList()); ProgramState ps = addConstraint(symbolicValue, constraint); for (SymbolicValue sv : transitiveSymbolicValues) { ps = ps.addConstraint(sv, constraint); } return ps; }
Source:
<code>private void validateTopologyCanProcessData(final StreamsBuilder builder) { final Properties config = new Properties(); final String safeTestName = safeUniqueTestName(getClass(), testName); config.setProperty(StreamsConfig.APPLICATION_ID_CONFIG, "dummy-" + safeTestName); config.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "dummy"); config.setProperty(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.IntegerSerde.class.getName()); config.setProperty(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.StringSerde.class.getName()); config.setProperty(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory().getAbsolutePath()); try (final TopologyTestDriver topologyTestDriver = new TopologyTestDriver(builder.build(), config)) { final TestInputTopic<Integer, String> aTopic = topologyTestDriver.createInputTopic("A", new IntegerSerializer(), new StringSerializer()); final TestInputTopic<Integer, String> bTopic = topologyTestDriver.createInputTopic("B", new IntegerSerializer(), new StringSerializer()); final TestOutputTopic<Integer, String> output = topologyTestDriver.createOutputTopic("output", new IntegerDeserializer(), new StringDeserializer()); <START> aTopic.pipeInput(1, "1-alpha"); bTopic.pipeInput(1, "beta"); <END> final Map<Integer, String> x = output.readKeyValuesToMap(); assertThat(x, is(Collections.singletonMap(1, "(1-alpha,(1-alpha,beta))"))); } }</code><technical_language>nice for demonstration purposes if records keys. Maybe: suggestion aTopic.pipeInput(1, "999-alpha"); bTopic.pipeInput(999, "beta");</technical_language>

Target:
private void validateTopologyCanProcessData(final StreamsBuilder builder) { final Properties config = new Properties(); final String safeTestName = safeUniqueTestName(getClass(), testName); config.setProperty(StreamsConfig.APPLICATION_ID_CONFIG, "dummy-" + safeTestName); config.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "dummy"); config.setProperty(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.IntegerSerde.class.getName()); config.setProperty(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.StringSerde.class.getName()); config.setProperty(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory().getAbsolutePath()); try (final TopologyTestDriver topologyTestDriver = new TopologyTestDriver(builder.build(), config)) { final TestInputTopic<Integer, String> aTopic = topologyTestDriver.createInputTopic("A", new IntegerSerializer(), new StringSerializer()); final TestInputTopic<Integer, String> bTopic = topologyTestDriver.createInputTopic("B", new IntegerSerializer(), new StringSerializer()); final TestOutputTopic<Integer, String> output = topologyTestDriver.createOutputTopic("output", new IntegerDeserializer(), new StringDeserializer()); aTopic.pipeInput(1, "999-alpha"); bTopic.pipeInput(999, "beta"); final Map<Integer, String> x = output.readKeyValuesToMap(); assertThat(x, is(Collections.singletonMap(1, "(999-alpha,(999-alpha,beta))"))); } }
Source:
<code>public <START> Optional<List<DecorationDescriptor>> getDecorationDescriptors(IDiagramElementEditPart <END> diagramEditPart, Session session) { Optional<List<DecorationDescriptor>> decorationDescriptors = Optional.empty(); final View view = (View) diagramEditPart.getModel(); if (view != null && (shouldConsiderDetachedViews() || view.eResource() != null)) { if (shouldBeDecorated(diagramEditPart)) { List<DecorationDescriptor> createDecorationDescriptors = createDecorationDescriptors(diagramEditPart, session); if (createDecorationDescriptors != null && !createDecorationDescriptors.isEmpty()) { decorationDescriptors = Optional.of(createDecorationDescriptors); } } } return decorationDescriptors; }</code><technical_language>Do return Optional. Return empty list instead of null</technical_language>

Target:
public List<DecorationDescriptor> getDecorationDescriptors(IDiagramElementEditPart diagramEditPart, Session session) { final View view = (View) diagramEditPart.getModel(); if (view != null && (shouldConsiderDetachedViews() || view.eResource() != null)) { if (shouldBeDecorated(diagramEditPart)) { return createDecorationDescriptors(diagramEditPart, session); } } return new ArrayList<>(); }
Source:
<code>private Metacard xmlToMetacard(InputStream inputStream) { try { Metacard metacard = xmlInputTransformer.transform(inputStream); <START> metacard.setAttribute(new AttributeImpl(Core.METACARD_TAGS, "query")); <END> LOGGER.trace("Successfully parsed query metacard with id [{}]", metacard.getId()); return metacard; } catch (IOException | CatalogTransformerException e) { LOGGER.debug("Error parsing query metacard input stream", e); return null; } finally { try { inputStream.close(); } catch (IOException e) { LOGGER.debug("An error occurred while closing the input stream", e); } } }</code><technical_language>constant for "query"</technical_language>

Target:
private Metacard xmlToMetacard(InputStream inputStream) { try { Metacard metacard = xmlInputTransformer.transform(inputStream); metacard.setAttribute(new AttributeImpl(Core.METACARD_TAGS, QUERY_TAG)); LOGGER.trace("Successfully parsed query metacard with id [{}]", metacard.getId()); return metacard; } catch (IOException | CatalogTransformerException e) { LOGGER.debug("Error parsing query metacard input stream", e); return null; } finally { try { inputStream.close(); } catch (IOException e) { LOGGER.debug("An error occurred while closing the input stream", e); } } }
Source:
<code>public void testDescribeVault() throws Exception { GlacierClient client = getGlacierClient(); client.createVault("testDescribeVault"); VaultMetadata vault = getGlacierClient().describeVault("testDescribeVault"); assertEquals(vault.getVaultName(), "testDescribeVault"); assertEquals(vault.getNumberOfArchives(), 0); assertEquals(vault.getSizeInBytes(), 0); assertEquals(vault.getLastInventoryDate(), null); <START> client.deleteVaultIfEmpty("testDescribeVault"); <END> }</code><technical_language>here, enclose delete in a finally block is deleted</technical_language>

Target:
private void testDescribeVault() throws Exception { VaultMetadata vault = api.describeVault(VAULT_NAME1); assertEquals(vault.getVaultName(), VAULT_NAME1); assertEquals(vault.getNumberOfArchives(), 0); assertEquals(vault.getSizeInBytes(), 0); assertEquals(vault.getLastInventoryDate(), null); }
Source:
<code>public RemoteEndpoint selectEndpoint(QName serviceName) { if (getRegistry() == null) { return null; } if (!_endpointIdx.containsKey(serviceName)) { _endpointIdx.put(serviceName, 0); } RemoteEndpoint selectedEp = null; List<RemoteEndpoint> eps = getRegistry().getEndpoints(serviceName); if (!eps.isEmpty()) { <START> int tmp = _endpointIdx.get(serviceName); <END> tmp %= eps.size(); selectedEp = eps.get(tmp); tmp++; _endpointIdx.put(serviceName, tmp); } return selectedEp; }</code><technical_language>I personally variable name tmp. changing endpointIdx _endpointIdx _endpointIdxs</technical_language>

Target:
public RemoteEndpoint selectEndpoint(QName serviceName) { if (getRegistry() == null) { return null; } RemoteEndpoint selectedEp = null; List<RemoteEndpoint> eps = getRegistry().getEndpoints(serviceName); if (!eps.isEmpty()) { _endpointIdxs.putIfAbsent(serviceName, new AtomicInteger(0)); AtomicInteger idx = _endpointIdxs.get(serviceName); synchronized (idx) { idx.set(idx.get()%eps.size()); selectedEp = eps.get(idx.getAndIncrement()); } } return selectedEp; }
Source:
<code>public void <START> testMakeTimeZone_All() <END> throws IOException { ZoneInfoDB.TzData instance = ZoneInfoDB.getInstance(); String[] availableIDs = instance.getAvailableIDs(); Arrays.sort(availableIDs); for (String id : availableIDs) { BufferIterator bufferIterator = instance.getBufferIterator(id); ZoneInfo zoneInfo = ZoneInfo.makeTimeZone(id, bufferIterator, Long.MIN_VALUE); assertNotNull("TimeZone " + id + " was not created", zoneInfo); assertEquals(id, zoneInfo.getID()); } }</code><technical_language>interesting if this times out / runs out of memory spec devices. a good test, though</technical_language>

Target:
public void testMakeTimeZone_All() throws Exception { ZoneInfoDB.TzData instance = ZoneInfoDB.getInstance(); String[] availableIDs = instance.getAvailableIDs(); Arrays.sort(availableIDs); for (String id : availableIDs) { BufferIterator bufferIterator = instance.getBufferIterator(id); ZoneInfo zoneInfo = ZoneInfo.makeTimeZone(id, bufferIterator, Long.MIN_VALUE); assertNotNull("TimeZone " + id + " was not created", zoneInfo); assertEquals(id, zoneInfo.getID()); } }
Source:
<code>public void testActionJoinIfPossibleAndTx() throws Exception { TransactionCoordination.getInstance().bindTransaction(mockTransaction); MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_JOIN_IF_POSSIBLE); ExecutionTemplate executionTemplate = createExecutionTemplate(config); Object result = executionTemplate.execute(getEmptyTransactionCallback()); assertThat(result, is(RETURN_VALUE)); verify(mockTransaction, never()).commit(); verify(mockTransaction, never()).rollback(); <START> assertThat(TransactionCoordination.getInstance().getTransaction(), Is.is(mockTransaction)); <END> }</code><technical_language>static import</technical_language>

Target:
public void testActionJoinIfPossibleAndTx() throws Exception { getInstance().bindTransaction(mockTransaction); MuleTransactionConfig config = new MuleTransactionConfig(ACTION_JOIN_IF_POSSIBLE); ExecutionTemplate executionTemplate = createExecutionTemplate(config); Object result = executionTemplate.execute(getEmptyTransactionCallback()); assertThat(result, is(RETURN_VALUE)); verify(mockTransaction, never()).commit(); verify(mockTransaction, never()).rollback(); assertThat(getInstance().getTransaction(), is(mockTransaction)); }
Source:
<code>private void runRemoteUnmarshal() throws Exception { try { Ignite ignite = startGrid(0); byte[] one = ignite.configuration().getMarshaller().marshal(DeclaredBodyEnum.ONE); byte[] two = ignite.configuration().getMarshaller().marshal(DeclaredBodyEnum.TWO); startGrid(1); ignite.compute(ignite.cluster().forRemotes()).call(new UnmarshalCallable(one, two)); } finally { <START> stopAllGrids(); <END> } }</code><technical_language>afterTest() instead</technical_language>

Target:
private void runRemoteUnmarshal() throws Exception { Ignite ignite = startGrid(0); byte[] one = ignite.configuration().getMarshaller().marshal(DeclaredBodyEnum.ONE); byte[] two = ignite.configuration().getMarshaller().marshal(DeclaredBodyEnum.TWO); startGrid(1); ignite.compute(ignite.cluster().forRemotes()).call(new UnmarshalCallable(one, two)); }
Source:
<code>DocumentCollection getCollectionDefinitionWithRangeRangeIndex() { PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); ArrayList<String> paths = new ArrayList<>(); paths.add("/mypk"); partitionKeyDef.setPaths(paths); IndexingPolicy indexingPolicy = new IndexingPolicy(); List<IncludedPath> includedPaths = new ArrayList<>(); IncludedPath includedPath = new IncludedPath(); includedPath.setPath("/*"); List<Index> indexes = new ArrayList<>(); Index stringIndex = Index.range(DataType.STRING); <START> BridgeInternal.setProperty(ModelBridgeInternal.getJsonSerializable(stringIndex), "precision", -1); <END> indexes.add(stringIndex); Index numberIndex = Index.range(DataType.NUMBER); BridgeInternal.setProperty(ModelBridgeInternal.getJsonSerializable(numberIndex), "getPrecision", -1); indexes.add(numberIndex); includedPath.setIndexes(indexes); includedPaths.add(includedPath); indexingPolicy.setIncludedPaths(includedPaths); DocumentCollection collectionDefinition = new DocumentCollection(); collectionDefinition.setIndexingPolicy(indexingPolicy); collectionDefinition.setId(UUID.randomUUID().toString()); collectionDefinition.setPartitionKey(partitionKeyDef); return collectionDefinition; }</code><technical_language>this updated public apis for setting precision</technical_language>

Target:
DocumentCollection getCollectionDefinitionWithRangeRangeIndex() { PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); ArrayList<String> paths = new ArrayList<>(); paths.add("/mypk"); partitionKeyDef.setPaths(paths); IndexingPolicy indexingPolicy = new IndexingPolicy(); List<IncludedPath> includedPaths = new ArrayList<>(); IncludedPath includedPath = new IncludedPath("/*"); List<Index> indexes = new ArrayList<>(); indexes.add(Index.range(DataType.STRING, -1)); indexes.add(Index.range(DataType.NUMBER, -1)); includedPath.setIndexes(indexes); includedPaths.add(includedPath); indexingPolicy.setIncludedPaths(includedPaths); DocumentCollection collectionDefinition = new DocumentCollection(); collectionDefinition.setIndexingPolicy(indexingPolicy); collectionDefinition.setId(UUID.randomUUID().toString()); collectionDefinition.setPartitionKey(partitionKeyDef); return collectionDefinition; }
Source:
<code><START> private void resetAuthorities(String username) { <END> UserDetails userDetails = userDetailsService.loadUserByUsername(username); Collection<? extends GrantedAuthority> updatedAuthorities = userDetails.getAuthorities(); Object principal = toPrincipal(username); principalSecurityContextRegistry .getSecurityContexts(principal) .forEach(securityContext -> resetAuthorities(securityContext, updatedAuthorities)); }</code><technical_language>I this overlap concurrent updates authorities other threads</technical_language>

Target:
private synchronized void resetAuthorities(String username) { UserDetails userDetails = userDetailsService.loadUserByUsername(username); Collection<? extends GrantedAuthority> updatedAuthorities = userDetails.getAuthorities(); Object principal = toPrincipal(username); principalSecurityContextRegistry .getSecurityContexts(principal) .forEach(securityContext -> resetAuthorities(securityContext, updatedAuthorities)); }
Source:
<code>public KeyPair generateKeyPair() throws BuilderException { try { KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance("DSA"); SecureRandom rng = SecureRandom.getInstance("SHA1PRNG", "SUN"); keyGenerator.initialize(1024, rng); return (keyGenerator.generateKeyPair()); <START> } catch (Exception e) { <END> throw new BuilderException("Failed to build DSA key pair", e); } }</code><technical_language>catching exception clean</technical_language>

Target:
public KeyPair generateKeyPair() throws BuilderException { try { KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance("DSA"); SecureRandom rng = SecureRandom.getInstance("SHA1PRNG", "SUN"); keyGenerator.initialize(1024, rng); return (keyGenerator.generateKeyPair()); } catch (NoSuchAlgorithmException | NoSuchProviderException e) { throw new BuilderException("Failed to build DSA key pair", e); } }
Source:
<code>public void run() { try (SingleLockService locks = createSweepLocks()) { waitUntilSpecificTableSweeperIsInitialized(); sleepForMillis(getBackoffTimeWhenSweepHasNotRun()); <START> log.info("Starting background sweeper."); <END> while (true) { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException("The background sweeper thread is interrupted."); } SweepOutcome outcome = checkConfigAndRunSweep(locks); log.info("Sweep iteration finished with outcome: {}", SafeArg.of("sweepOutcome", outcome)); updateBatchSize(outcome); updateMetrics(outcome); sleepUntilNextRun(outcome); } } catch (InterruptedException e) { log.warn( "Shutting down background sweeper. Please restart the service to rerun background sweep."); sweepOutcomeMetrics.registerOccurrenceOf( SweepOutcome.SHUTDOWN); } catch (Throwable t) { log.error("BackgroundSweeper failed fatally and will not rerun until restarted: {}", UnsafeArg.of("message", t.getMessage()), t); sweepOutcomeMetrics.registerOccurrenceOf( SweepOutcome.FATAL); } }</code><technical_language>For non-internal-logging-framework users (which is this is aimed at), worth including thread name here, this printed time of threads run</technical_language>

Target:
public void run() { try (SingleLockService locks = createSweepLocks()) { waitUntilSpecificTableSweeperIsInitialized(); sleepForMillis(getBackoffTimeWhenSweepHasNotRun()); log.info("Starting background sweeper with thread index {}", SafeArg.of("threadIndex", threadIndex)); while (true) { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException("The background sweeper thread is interrupted."); } SweepOutcome outcome = checkConfigAndRunSweep(locks); logOutcome(outcome); updateBatchSize(outcome); updateMetrics(outcome); sleepUntilNextRun(outcome); } } catch (InterruptedException e) { log.warn( "Shutting down background sweeper. Please restart the service to rerun background sweep."); closeTableLockIfHeld(); sweepOutcomeMetrics.registerOccurrenceOf( SweepOutcome.SHUTDOWN); } catch (Throwable t) { log.error("BackgroundSweeper failed fatally and will not rerun until restarted: {}", UnsafeArg.of("message", t.getMessage()), t); closeTableLockIfHeld(); sweepOutcomeMetrics.registerOccurrenceOf( SweepOutcome.FATAL); } }
Source:
<code>static int requiredBufferCapacity( int cardinality, AggregatorFactory[] aggregatorFactories ) { final int cardinalityWithMissingValue = cardinality + 1; final int recordSize = Arrays.stream(aggregatorFactories) .mapToInt(AggregatorFactory::getMaxIntermediateSize) .sum(); <START> return Integer.BYTES + END> getUsedFlagBufferCapacity(cardinalityWithMissingValue) + cardinalityWithMissingValue * recordSize; }</code><technical_language>I understand is used, I getUsedFlagBufferCapacity (for bitset) cardinalityWithMissingValue * recordSize (for records) space is</technical_language>

Target:
static int requiredBufferCapacity( int cardinality, AggregatorFactory[] aggregatorFactories ) { final int cardinalityWithMissingValue = cardinality + 1; final int recordSize = Arrays.stream(aggregatorFactories) .mapToInt(AggregatorFactory::getMaxIntermediateSize) .sum(); return getUsedFlagBufferCapacity(cardinalityWithMissingValue) + cardinalityWithMissingValue * recordSize; }
Source:
<code>public void visit(Image image) { String url = context.encodeUrl(image.getDestination()); AltTextVisitor altTextVisitor = new AltTextVisitor(); image.accept(altTextVisitor); String altText = altTextVisitor.getAltText(); Map<String, String> attrs = new LinkedHashMap<>(); <START> if(context.shouldBeSafe()) { <END> url = context.urlSanitizer().sanitizeImageUrl(url); } attrs.put("src", url); attrs.put("alt", altText); if (image.getTitle() != null) { attrs.put("title", image.getTitle()); } html.tag("img", getAttrs(image, "img", attrs), true); }</code><technical_language>Nit: missing space if</technical_language>

Target:
public void visit(Image image) { String url = image.getDestination(); AltTextVisitor altTextVisitor = new AltTextVisitor(); image.accept(altTextVisitor); String altText = altTextVisitor.getAltText(); Map<String, String> attrs = new LinkedHashMap<>(); if (context.shouldSanitizeUrls()) { url = context.urlSanitizer().sanitizeImageUrl(url); } attrs.put("src", context.encodeUrl(url)); attrs.put("alt", altText); if (image.getTitle() != null) { attrs.put("title", image.getTitle()); } html.tag("img", getAttrs(image, "img", attrs), true); }
Source:
<code>public StringBuffer format(double x, StringBuffer sb) { if ((Math.abs(x) >= DECIMAL_MIN && x < DECIMAL_MAX) || x == 0) { x = truncate(x); long lx = (long) x; if (lx == x) sb.append(lx); else <START> sb.append(x); <END> } else { if (forcedDecimal) { coordFormatter.format(x, sb, ZERO); } else { sb.append(truncate(x)); } } return sb; }</code><technical_language>I substitute: if (lx == x) sb.append(lx); else sb.append(x); with: sb.append(lx == x ? lx : x); add missing {}</technical_language>

Target:
public StringBuffer format(double x, StringBuffer sb) { if ((Math.abs(x) >= DECIMAL_MIN && x < DECIMAL_MAX) || x == 0) { x = truncate(x); long lx = (long) x; if (lx == x) { sb.append(lx); } else { sb.append(x); } } else { if (forcedDecimal) { coordFormatter.format(x, sb, ZERO); } else { sb.append(truncate(x)); } } return sb; }
Source:
<code>protected void setUp() { String[] packages = getClass().getPackage().getName().split("\\."); <START> String categoryName = packages[packages.length - 1]; <END> String language = packages[packages.length - 3]; String rulesetXml = "category/" + language + "/" + categoryName + ".xml"; addRule(rulesetXml, getClass().getSimpleName().replaceFirst("Test$", "")); }</code><technical_language>This is PMD specific, I guess fail of time of PMD. subclass of SimpleAggregatorTst (or RuleTst, test a single rule)</technical_language>

Target:
protected void setUp() { }
Source:
<code>public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FLAG1; final int modifiers= getModifiers(); <START> if (shiftedKind < ITypeMarshalBuffer.FLAG4 && modifiers == 0) { <END> buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind)); } else { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | ITypeMarshalBuffer.FLAG4)); buffer.putByte((byte) kind); buffer.putByte((byte) modifiers); } }</code><technical_language>check for shiftedKind < ITypeMarshalBuffer.FLAG4 is needed anymore shiftedKind safely combined ITypeMarshalBuffer.BASIC_TYPE a short int</technical_language>

Target:
public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FIRST_FLAG; final int modifiers= getModifiers(); if (modifiers == 0) { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind)); } else { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | ITypeMarshalBuffer.LAST_FLAG)); buffer.putByte((byte) kind); buffer.putByte((byte) modifiers); } }
Source:
<code>public synchronized Map<String, Object> getMapData() { <START> return fData; <END> }</code><technical_language>return a copy please</technical_language>

Target:
public synchronized Map<String, Object> getMapData() { return ImmutableMap.copyOf(fData); }
Source:
<code>private UserInfo verifyIpRange(WebContext ctx, UserInfo info) { String actualUser = ctx.getSessionValue("default-user-id").asString(); UserInfo realUser = findUserByUserId(actualUser); if (realUser == null) { return UserInfo.NOBODY; } <START> return realUser.tryAs(Tenant.class) <END> .map(Tenant::getPermissions) .map(PermissionData::getConfig) .filter(config -> config.hasPath("security.ipRanges")) .filter(config -> config.hasPath("security.rolesToKeep")) .map(config -> Tuple.create(config.getStringList("security.ipRanges"), config.getStringList("security.rolesToKeep"))) .filter(data -> !matchesIPRange(ctx, data.getFirst())) .map(data -> removeRoles(info, data.getSecond())) .orElse(info); }</code><technical_language>perform this for single request - this complicated.</technical_language>

Target:
private UserInfo verifyIpRange(WebContext ctx, UserInfo info) { String actualUser = ctx.getSessionValue(scope.getScopeId() + "-user-id").asString(); UserAccount account = fetchAccount(actualUser, null); if (account == null) { return UserInfo.NOBODY; } Tenant tenant = account.getTenant().getValue(); if (tenant != null && !tenant.matchesIPRange(ctx)) { return createUserWithLimitedRoles(info, tenant.getRolesToKeepAsSet()); } return info; }
Source:
<code>public void recognizePiiEntitiesStringListWithOptions() { List<String> documents = Arrays.asList( "My SSN is 555-55-5555.", "Visa card 0111 1111 1111 1111." ); TextAnalyticsRequestOptions requestOptions = new TextAnalyticsRequestOptions().setIncludeStatistics(true) .setModelVersion("latest"); textAnalyticsAsyncClient.recognizePiiEntitiesBatch(documents, "en", requestOptions) .subscribe(piiEntitiesResults -> { TextDocumentBatchStatistics batchStatistics = piiEntitiesResults.getStatistics(); System.out.printf("Batch statistics, transaction count: %s, valid document count: %s.%n", batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount()); piiEntitiesResults.forEach(recognizePiiEntitiesResult -> recognizePiiEntitiesResult.getEntities().forEach(entity -> System.out.printf( "Recognized Personally Identifiable Information entity: %s, entity category: %s," <START> + " entity subcategory: %s, offset: %s, length: %s, confidence score: %f.%n", <END> entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getOffset(), entity.getLength(), entity.getConfidenceScore()))); }); END: com.azure.ai.textanalytics.TextAnalyticsAsyncClient.recognizePiiEntitiesBatch#Iterable-String-TextAnalyticsRequestOptions }</code><technical_language>this concise this added in java docs docs verbose</technical_language>

Target:
public void recognizePiiEntitiesStringListWithOptions() { List<String> documents = Arrays.asList( "My SSN is 859-98-0987.", "Visa card 0111 1111 1111 1111." ); TextAnalyticsRequestOptions requestOptions = new TextAnalyticsRequestOptions().setIncludeStatistics(true) .setModelVersion("latest"); textAnalyticsAsyncClient.recognizePiiEntitiesBatch(documents, "en", requestOptions) .subscribe(piiEntitiesResults -> { TextDocumentBatchStatistics batchStatistics = piiEntitiesResults.getStatistics(); System.out.printf("Batch statistics, transaction count: %s, valid document count: %s.%n", batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount()); piiEntitiesResults.forEach(recognizePiiEntitiesResult -> recognizePiiEntitiesResult.getEntities().forEach(entity -> System.out.printf( "Recognized Personally Identifiable Information entity: %s, entity category: %s," + " entity subcategory: %s, confidence score: %f.%n", entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore()))); }); END: com.azure.ai.textanalytics.TextAnalyticsAsyncClient.recognizePiiEntitiesBatch#Iterable-String-TextAnalyticsRequestOptions }
Source:
<code>public static VCFHeader createFakeHeader(final Set<VCFHeaderLine> metaData, final Set<String> additionalColumns, final SAMSequenceDictionary sequenceDict) { <START> metaData.add(new VCFHeaderLine(VCFHeaderVersion.VCF4_0.getFormatString(), VCFHeaderVersion.VCF4_0.getVersionString())); <END> metaData.add(new VCFHeaderLine("two", "2")); additionalColumns.add("extra1"); additionalColumns.add("extra2"); final VCFHeader ret = new VCFHeader(metaData, additionalColumns); ret.setSequenceDictionary(sequenceDict); return ret; }</code><technical_language>I this removed, VCF4_2</technical_language>

Target:
public static VCFHeader createFakeHeader(final Set<VCFHeaderLine> metaData, final Set<String> additionalColumns, final SAMSequenceDictionary sequenceDict) { metaData.add(new VCFHeaderLine("two", "2")); additionalColumns.add("extra1"); additionalColumns.add("extra2"); final VCFHeader ret = new VCFHeader(metaData, additionalColumns); ret.setSequenceDictionary(sequenceDict); return ret; }
Source:
<code>private void recoverSegment(long segmentIndex, long segmentId, PbdSegmentName segmentName) throws IOException { PBDSegment<M> segment; if (segmentName.m_quarantined) { segment = new PbdQuarantinedSegment<>(segmentName.m_file, segmentIndex, segmentId); } else { segment = m_pbdSegmentFactory.create(segmentIndex, segmentId, segmentName.m_file, m_usageSpecificLog, m_extraHeaderSerializer); <START> if (!segment.isFinal()) { <END> m_usageSpecificLog.warn("Segment " + segment.file() + " (final: " + segment.isFinal() + "), has been recovered but is not in a final state"); } else if (m_usageSpecificLog.isDebugEnabled()) { m_usageSpecificLog.debug( "Segment " + segment.file() + " (final: " + segment.isFinal() + "), has been recovered"); } m_segments.put(segment.segmentIndex(), segment); segment.close(); } m_segments.put(segment.segmentIndex(), segment); }</code><technical_language>try/catch block removed? isFinal() throw exception caught ensure segment properly closed quarantined</technical_language>

Target:
private void recoverSegment(long segmentIndex, long segmentId, PbdSegmentName segmentName) throws IOException { PBDSegment<M> segment; if (segmentName.m_quarantined) { segment = new PbdQuarantinedSegment<>(segmentName.m_file, segmentIndex, segmentId); } else { segment = m_pbdSegmentFactory.create(segmentIndex, segmentId, segmentName.m_file, m_usageSpecificLog, m_extraHeaderSerializer); try { if (segment.getNumEntries() == 0 && m_segments.isEmpty()) { if (m_usageSpecificLog.isDebugEnabled()) { m_usageSpecificLog.debug("Found Empty Segment with entries: " + segment.getNumEntries() + " For: " + segment.file().getName()); m_usageSpecificLog.debug("Segment " + segment.file() + " (final: " + segment.isFinal() + "), will be closed and deleted during init"); } segment.closeAndDelete(); return; } if (!segment.isFinal()) { m_usageSpecificLog.warn("Segment " + segment.file() + " (final: " + segment.isFinal() + "), has been recovered but is not in a final state"); } else if (m_usageSpecificLog.isDebugEnabled()) { m_usageSpecificLog.debug( "Segment " + segment.file() + " (final: " + segment.isFinal() + "), has been recovered"); } } catch (IOException e) { m_usageSpecificLog.warn( "Failed to retrieve entry count from segment " + segment.file() + ". Quarantining segment", e); quarantineSegment(segment); return; } finally { segment.close(); } } m_segments.put(segment.segmentIndex(), segment); }
Source:
<code>public void runInToolingApi(CancellationTokenSource tokenSource, IProgressMonitor monitor) throws Exception { try { SubMonitor progress = SubMonitor.convert(monitor, 5); progress.setTaskName((String.format("Synchronizing Gradle build at %s with workspace", this.gradleBuild.getBuildConfig().getRootProjectDirectory()))); new ImportRootProjectOperation(this.gradleBuild.getBuildConfig(), this.newProjectHandler).run(progress.newChild(1)); Collection<EclipseProject> rootProjects = ModelProviderUtil.fetchAllEclipseProjectsWithSyncTask(this.gradleBuild, tokenSource, FetchStrategy.FORCE_RELOAD, progress.newChild(1)); Set<EclipseProject> allProjects = collectAll(rootProjects); new ValidateProjectLocationOperation(allProjects).run(progress.newChild(1)); new RunOnImportTasksOperation(allProjects, this.gradleBuild.getBuildConfig()).run(progress.newChild(1), tokenSource); this.failures = new SynchronizeGradleBuildOperation(allProjects, this.gradleBuild, this.newProjectHandler, ProjectConfigurators.create(this.gradleBuild, CorePlugin.extensionManager().loadConfigurators())).run(progress.newChild(1)); <START> ((DefaultModelProvider)this.gradleBuild.getModelProvider()).getCache().put(EclipseProject.class, rootProjects); <END> } finally { this.gradleBuild.projectConnectionCache.invalidateAll(); } }</code><technical_language>do do this here, added caching phased actions too</technical_language>

Target:
public void runInToolingApi(CancellationTokenSource tokenSource, IProgressMonitor monitor) throws Exception { try { SubMonitor progress = SubMonitor.convert(monitor, 5); progress.setTaskName((String.format("Synchronizing Gradle build at %s with workspace", this.gradleBuild.getBuildConfig().getRootProjectDirectory()))); new ImportRootProjectOperation(this.gradleBuild.getBuildConfig(), this.newProjectHandler).run(progress.newChild(1)); Set<EclipseProject> allProjects = collectAll(this.gradleBuild.modelProvider.fetchEclipseProjectAndRunSyncTasks(tokenSource, progress.newChild(1))); new ValidateProjectLocationOperation(allProjects).run(progress.newChild(1)); new RunOnImportTasksOperation(allProjects, this.gradleBuild.getBuildConfig()).run(progress.newChild(1), tokenSource); this.failures = new SynchronizeGradleBuildOperation(allProjects, this.gradleBuild, this.newProjectHandler, ProjectConfigurators.create(this.gradleBuild, CorePlugin.extensionManager().loadConfigurators())).run(progress.newChild(1)); } finally { this.gradleBuild.projectConnectionCache.invalidateAll(); } }
Source:
<code>public void signalReady(Constraints viewConstraints) { String normalizedConstraints = getNormalizedConstraints(viewConstraints); Path signalPath = new Path(signalDirectory, normalizedConstraints); Path stagedSignalPath = new Path(signalDirectory, normalizedConstraints + STAGED_SIGNAL_POSTFIX); try{ FileContext context = FileContext.getFileContext(conf); final FSDataOutputStream os = context.create(stagedSignalPath, <START> EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE), CreateOpts.perms(FsPermission.getDefault())); <END> os.writeUTF(String.valueOf(System.currentTimeMillis())); os.close(); context.rename(stagedSignalPath, signalPath, Rename.OVERWRITE); } catch (IOException e) { throw new DatasetIOException("Could not access signal path: " + signalPath, e); } }</code><technical_language>unfortunate I is do rename overwrite atomically Filesytem API. long Kite intend continue support for hadoop1</technical_language>

Target:
public void signalReady(Constraints viewConstraints) { try { rootFileSystem.mkdirs(signalDirectory); } catch (IOException e) { throw new DatasetIOException("Unable to create signal manager directory: " + signalDirectory, e); } String normalizedConstraints = getNormalizedConstraints(viewConstraints); Path signalPath = new Path(signalDirectory, normalizedConstraints); try{ FSDataOutputStream os = rootFileSystem.create(signalPath, true); os.close(); } catch (IOException e) { throw new DatasetIOException("Could not access signal path: " + signalPath, e); } }
Source:
<code>public void validate_shouldFailIfTheConceptDatatypeIsNull() throws Exception { Concept concept = new Concept(); concept.addName(new ConceptName("some name",Context.getLocale())); concept.addDescription(new ConceptDescription("some description",null)); concept.setConceptClass(new ConceptClass()); Errors errors = new BindException(concept, "concept"); new ConceptValidator().validate(concept, errors); <START> Assert.assertTrue(errors.hasErrors()); <END> }</code><technical_language>check if errors contains error key "Concept.datatype.empty"</technical_language>

Target:
public void validate_shouldFailIfTheConceptDatatypeIsNull() throws Exception { Concept concept = new Concept(); concept.addName(new ConceptName("some name",Context.getLocale())); concept.addDescription(new ConceptDescription("some description",null)); concept.setConceptClass(new ConceptClass(1)); Errors errors = new BindException(concept, "concept"); new ConceptValidator().validate(concept, errors); Assert.assertEquals(errors.getFieldError("datatype").getCode(), "Concept.datatype.empty"); }
Source:
<code>public int hashCode() { <START> return hf.newHasher(32) <END> .putLong(fSeq) .putLong(fAckseq) .putLong(fFlags).hash().asInt(); }</code><technical_language>---> this here</technical_language>

Target:
public int hashCode() { return hf.newHasher() .putLong(fSeq) .putLong(fAckseq) .putLong(fFlags).hash().asInt(); }
Source:
<code>boolean isComposedOf(Expression exprList[], int start, int end, OrderedIntHashSet excludeSet) { if (opType == OpTypes.VALUE) { return true; } if (excludeSet.contains(opType)) { return true; } for (int i = start; i < end; i++) { if (equals(exprList[i])) { return true; } } <START> if (opType == OpTypes.CAST && nodes.length == 1 && nodes[0].opType == OpTypes.DYNAMIC_PARAM) { <END> return true; } switch (opType) { case OpTypes.LIKE : case OpTypes.MATCH_SIMPLE : case OpTypes.MATCH_PARTIAL : case OpTypes.MATCH_FULL : case OpTypes.MATCH_UNIQUE_SIMPLE : case OpTypes.MATCH_UNIQUE_PARTIAL : case OpTypes.MATCH_UNIQUE_FULL : case OpTypes.UNIQUE : case OpTypes.EXISTS : case OpTypes.TABLE_SUBQUERY : case OpTypes.ROW_SUBQUERY : case OpTypes.COUNT : case OpTypes.APPROX_COUNT_DISTINCT: case OpTypes.SUM : case OpTypes.MIN : case OpTypes.MAX : case OpTypes.AVG : case OpTypes.EVERY : case OpTypes.SOME : case OpTypes.STDDEV_POP : case OpTypes.STDDEV_SAMP : case OpTypes.VAR_POP : case OpTypes.VAR_SAMP : return false; } if (nodes.length == 0) { return false; } boolean result = true; for (int i = 0; i < nodes.length; i++) { result &= (nodes[i] == null || nodes[i].isComposedOf(exprList, start, end, excludeSet)); } return result; }</code><technical_language>Minor: personally prefer moving this switch block. Also, if is a CAST, 1 child, 2nd condition is unnecessary</technical_language>

Target:
boolean isComposedOf(Expression exprList[], int start, int end, OrderedIntHashSet excludeSet) { if (opType == OpTypes.VALUE) { return true; } if (excludeSet.contains(opType)) { return true; } for (int i = start; i < end; i++) { if (equals(exprList[i])) { return true; } } switch (opType) { case OpTypes.CAST: assert(1 == nodes.length); if (nodes[0].opType == OpTypes.DYNAMIC_PARAM) { return true; } break; case OpTypes.LIKE : case OpTypes.MATCH_SIMPLE : case OpTypes.MATCH_PARTIAL : case OpTypes.MATCH_FULL : case OpTypes.MATCH_UNIQUE_SIMPLE : case OpTypes.MATCH_UNIQUE_PARTIAL : case OpTypes.MATCH_UNIQUE_FULL : case OpTypes.UNIQUE : case OpTypes.EXISTS : case OpTypes.TABLE_SUBQUERY : case OpTypes.ROW_SUBQUERY : case OpTypes.COUNT : case OpTypes.APPROX_COUNT_DISTINCT: case OpTypes.SUM : case OpTypes.MIN : case OpTypes.MAX : case OpTypes.AVG : case OpTypes.EVERY : case OpTypes.SOME : case OpTypes.STDDEV_POP : case OpTypes.STDDEV_SAMP : case OpTypes.VAR_POP : case OpTypes.VAR_SAMP : return false; } if (nodes.length == 0) { return false; } boolean result = true; for (int i = 0; i < nodes.length; i++) { result &= (nodes[i] == null || nodes[i].isComposedOf(exprList, start, end, excludeSet)); } return result; }
Source:
<code>public Set<MessageHandlerInterceptor<? super EventMessage<?>>> getHandlerInterceptors() { <START> return interceptors; <END> }</code><technical_language>return a read-only version of List (not set) here. want people this is method register interceptors</technical_language>

Target:
public List<MessageHandlerInterceptor<? super EventMessage<?>>> getHandlerInterceptors() { return Collections.unmodifiableList(interceptors); }
Source:
<code><START> public AndroidLocalFilesDirectory(Context context) { <END> this.context = context; }</code><technical_language>Constructor package now</technical_language>

Target:
AndroidLocalFilesDirectory(Context context) { this.context = context; }
Source:
<code>public Map migrate(Map request) { String dst = (String)request.get("dst"); String vmId = (String)request.get("vmId"); boolean success = true; final VM vm = getActiveHost().getRunningVMs().get(vmId); if (vm == null) { log.info("VM not found: " + vmId); throw new RuntimeException("VM not found: " + vmId); } VM targetVM = vm.clone(); vm.setStatus(VM.VMStatus.MigratingFrom); targetVM.setStatus(VM.VMStatus.MigratingTo); String targetServerName = dst; int idx = dst.indexOf(':'); if(idx != -1) { targetServerName = dst.substring(0, idx); } final Host targetHost = getHostByName(targetServerName); if (targetHost == null) { log.info("Target host not found: " + dst); throw new RuntimeException("Target host not found: " + dst + ", name: " + targetServerName); } targetVM.setHost(targetHost); targetHost.getRunningVMs().put(targetVM.getId(), targetVM); TaskProcessor.getInstance().addTask(new TaskRequest(TaskType.FINISH_MIGRATED_FROM_VM, 10000l, vm)); TaskProcessor.getInstance().addTask(new TaskRequest(TaskType.FINISH_MIGRATED_TO_VM, 10000l, targetVM)); TaskProcessor.getInstance().addTask(new TaskRequest(TaskType.FINISH_MIGRATED_FROM_VM_REMOVE_FROM_HOST, 20000l, vm)); <START> Map resultMap = map(); <END> Map statusMap = map(); statusMap.put("message", success ? "Migration process starting" : "VM not found"); statusMap.put("code", (success ? "0" : "100")); resultMap.put("status", statusMap); log.info("Migrating VM from host: to: {}", new Object[] { vm.getId(), vm.getHost().getName(), targetHost.getName() }); return resultMap; }</code><technical_language>Consider Map<String, Object></technical_language>

Target:
public Map migrate(Map request) { String dst = (String)request.get("dst"); String vmId = (String)request.get("vmId"); boolean success = true; final VM vm = getActiveHost().getRunningVMs().get(vmId); if (vm == null) { log.info("VM not found: " + vmId); throw new RuntimeException("VM not found: " + vmId); } VM targetVM = vm.clone(); vm.setStatus(VM.VMStatus.MigratingFrom); targetVM.setStatus(VM.VMStatus.MigratingTo); String targetServerName = dst; int idx = dst.indexOf(':'); if(idx != -1) { targetServerName = dst.substring(0, idx); } final Host targetHost = getHostByName(targetServerName); if (targetHost == null) { log.info("Target host not found: " + dst); throw new RuntimeException("Target host not found: " + dst + ", name: " + targetServerName); } targetVM.setHost(targetHost); targetHost.getRunningVMs().put(targetVM.getId(), targetVM); TaskProcessor.getInstance().addTask(new TaskRequest(TaskType.FINISH_MIGRATED_FROM_VM, 10000l, vm)); TaskProcessor.getInstance().addTask(new TaskRequest(TaskType.FINISH_MIGRATED_TO_VM, 10000l, targetVM)); TaskProcessor.getInstance().addTask(new TaskRequest(TaskType.FINISH_MIGRATED_FROM_VM_REMOVE_FROM_HOST, 20000l, vm)); Map<String, Object> resultMap = map(); Map statusMap = map(); statusMap.put("message", success ? "Migration process starting" : "VM not found"); statusMap.put("code", (success ? "0" : "100")); resultMap.put("status", statusMap); log.info("Migrating VM from host: to: {}", new Object[] { vm.getId(), vm.getHost().getName(), targetHost.getName() }); return resultMap; }
Source:
<code>private void configureJavaHome(CompilerConfiguration compilerConfiguration) throws MojoExecutionException { if (useJDK != JDKUsage.BREE) { return; } String toolchainId = getTargetExecutionEnvironment().getProfileName(); DefaultJavaToolChain toolChain = toolchainProvider.findMatchingJavaToolChain(session, toolchainId); if (toolChain == null) { throw new MojoExecutionException("useJDK = BREE configured, but no toolchain of type 'jdk' with id '" + toolchainId + "' found. See <LINK_0>"); } <START> compilerConfiguration.addCompilerCustomArgument("--system", toolChain.getJavaHome()); <END> configureBootClassPath(compilerConfiguration, toolChain); }</code><technical_language>This work java 8</technical_language>

Target:
private void configureJavaHome(CompilerConfiguration compilerConfiguration) throws MojoExecutionException { if (useJDK != JDKUsage.BREE) { return; } String toolchainId = getTargetExecutionEnvironment().getProfileName(); DefaultJavaToolChain toolChain = toolchainProvider.findMatchingJavaToolChain(session, toolchainId); if (toolChain == null) { throw new MojoExecutionException("useJDK = BREE configured, but no toolchain of type 'jdk' with id '" + toolchainId + "' found. See <LINK_0>"); } compilerConfiguration.addCompilerCustomArgument("use.java.home", toolChain.getJavaHome()); configureBootClassPath(compilerConfiguration, toolChain); }
Source:
<code>public void reset() { <START> this.transportFactories.nullifyBoth(); <END> this.tracerFactory = null; this.storages.nullifyBoth(); this.delivery = Delivery.local(); resetDeploymentType(); }</code><technical_language>call this method reset() clear()</technical_language>

Target:
public void reset() { this.transportFactory.reset(); this.tracerFactory.reset(); this.storageFactory.reset(); this.delivery.reset(); Class<? extends EnvironmentType> currentEnv = environment().type(); this.delivery.use(Delivery.local(), currentEnv); resetDeploymentType(); }