auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testIsLearn() { Parameters p = NetworkTestHarness.getParameters().copy(); p = p.union(NetworkTestHarness.getDayDemoTestEncoderParams()); p.set(KEY.COLUMN_DIMENSIONS, new int[] { 30 }); p.set(KEY.SYN_PERM_INACTIVE_DEC, 0.1); p.set(KEY.SYN_PERM_ACTIVE_INC, 0.1); p.set(KEY.SYN_PERM_TRIM_THRESHOLD, 0.05); p.set(KEY.SYN_PERM_CONNECTED, 0.4); p.set(KEY.MAX_BOOST, 10.0); p.set(KEY.DUTY_CYCLE_PERIOD, 7); p.set(KEY.RANDOM, new MersenneTwister(42)); Map<String, Object> params = new HashMap<>(); params.put(KEY_MODE, Mode.PURE); Network n = Network.create("test network", p) .add(Network.createRegion("r1") .add(Network.createLayer("1", p) <START> .alterParameter(KEY.AUTO_CLASSIFY, false)) <END> .add(Network.createLayer("2", p) .add(Anomaly.create(params))) .add(Network.createLayer("3", p) .add(new TemporalMemory())) .add(Network.createLayer("4", p) .add(new SpatialPooler()) .add(MultiEncoder.builder().name("").build())) .connect("1", "2") .connect("2", "3") .connect("3", "4")); n.lookup("r1").close(); n.setLearn(false); assertFalse(n.isLearn()); Region r1 = n.lookup("r1"); assertFalse(n.isLearn()); Layer<?> layer = r1.getTail(); assertFalse(layer.isLearn()); while(layer.getNext() != null) { layer = layer.getNext(); assertFalse(layer.isLearn()); } }</code><technical_language>@Hopding understand this is false if setting inferred fields below? Also, this true test is</technical_language>

Target:
public void testIsLearn() { Parameters p = NetworkTestHarness.getParameters().copy(); p = p.union(NetworkTestHarness.getDayDemoTestEncoderParams()); p.set(KEY.COLUMN_DIMENSIONS, new int[] { 30 }); p.set(KEY.SYN_PERM_INACTIVE_DEC, 0.1); p.set(KEY.SYN_PERM_ACTIVE_INC, 0.1); p.set(KEY.SYN_PERM_TRIM_THRESHOLD, 0.05); p.set(KEY.SYN_PERM_CONNECTED, 0.4); p.set(KEY.MAX_BOOST, 10.0); p.set(KEY.DUTY_CYCLE_PERIOD, 7); p.set(KEY.RANDOM, new MersenneTwister(42)); p.set(KEY.INFERRED_FIELDS, getInferredFieldsMap("dayOfWeek", CLAClassifier.class)); Map<String, Object> params = new HashMap<>(); params.put(KEY_MODE, Mode.PURE); Network n = Network.create("test network", p) .add(Network.createRegion("r1") .add(Network.createLayer("1", p) .alterParameter(KEY.AUTO_CLASSIFY, Boolean.TRUE)) .add(Network.createLayer("2", p) .add(Anomaly.create(params))) .add(Network.createLayer("3", p) .add(new TemporalMemory())) .add(Network.createLayer("4", p) .add(new SpatialPooler()) .add(MultiEncoder.builder().name("").build())) .connect("1", "2") .connect("2", "3") .connect("3", "4")); n.lookup("r1").close(); n.setLearn(false); assertFalse(n.isLearn()); Region r1 = n.lookup("r1"); assertFalse(n.isLearn()); Layer<?> layer = r1.getTail(); assertFalse(layer.isLearn()); while(layer.getNext() != null) { layer = layer.getNext(); assertFalse(layer.isLearn()); } }
Source:
<code>public void run() { long startTime = System.currentTimeMillis(); LOG.info("Recovering of runtimes is started."); for (RuntimeIdentity identity : identities) { try { <START> getInternalRuntime(identity.getWorkspaceId()); <END> } catch (Exception e) { LOG.error( "An error occurred while attempting to recover runtime '{}' using infrastructure '{}'. Reason: '{}'", identity.getWorkspaceId(), infrastructure.getName(), e.getMessage(), e); } } long finishTime = System.currentTimeMillis(); LOG.info( "All runtimes have been recovered in seconds.", TimeUnit.MILLISECONDS.toSeconds(finishTime - startTime)); }</code><technical_language>a bit confusing call get method recover something. basically side-effect. In getInternalRuntime, do need writelock for runtime? is needed for restore?? If so, I handle writelock in recoverone method getInternalRuntime simpler readlock. I agree this solution is simpler safer one, readable intuitive</technical_language>

Target:
public void run() { long startTime = System.currentTimeMillis(); LOG.info("Recovering of runtimes is started."); for (RuntimeIdentity identity : identities) { try (Unlocker ignored = lockService.writeLock(identity.getWorkspaceId())) { try { InternalRuntime<?> runtime = runtimes.get(identity.getWorkspaceId()); if (runtime == null) { LOG.info("Recovering runtime {}", identity.getWorkspaceId()); recoverOne(infrastructure, identity); } else { LOG.info("Runtime already restored. Skipping it.", identity.getWorkspaceId()); } } catch (Exception e) { LOG.error( "An error occurred while attempting to recover runtime '{}' using infrastructure '{}'. Reason: '{}'", identity.getWorkspaceId(), infrastructure.getName(), e.getMessage(), e); } } } long finishTime = System.currentTimeMillis(); LOG.info( "All runtimes have been recovered in seconds.", TimeUnit.MILLISECONDS.toSeconds(finishTime - startTime)); }
Source:
<code>public boolean isInWater() { byte var1 = 5; int maxLoop = 4; double var5 = this.getEntityBoundingBox().minY + (this.getEntityBoundingBox().maxY - this.getEntityBoundingBox().minY) * (double)(maxLoop + 0) / (double)var1 - 0.125D; double var7 = this.getEntityBoundingBox().minY + (this.getEntityBoundingBox().maxY - this.getEntityBoundingBox().minY) * (double)(maxLoop + 1) / (double)var1 - 0.125D; AxisAlignedBB var9 = new AxisAlignedBB(this.getEntityBoundingBox().minX, var5, this.getEntityBoundingBox().minZ, this.getEntityBoundingBox().maxX, var7, this.getEntityBoundingBox().maxZ); <START> if(this.worldObj.isAABBInMaterial(var9, Material.water)) { <END> return true; } return false; }</code><technical_language>remove if return result directly. more readable, is close original code. do variables a proper name</technical_language>

Target:
public boolean isInWater() { int maxLoop = 4; double y1 = this.getEntityBoundingBox().minY + (this.getEntityBoundingBox().maxY - this.getEntityBoundingBox().minY) * (double)(maxLoop + 0) / (double)4.875; double z2 = this.getEntityBoundingBox().minY + (this.getEntityBoundingBox().maxY - this.getEntityBoundingBox().minY) * (double)(maxLoop + 1) / (double)4.875; AxisAlignedBB aabb = new AxisAlignedBB(this.getEntityBoundingBox().minX, 5, this.getEntityBoundingBox().minZ, this.getEntityBoundingBox().maxX, z2, this.getEntityBoundingBox().maxZ); return this.worldObj.isAABBInMaterial(aabb, Material.water); }
Source:
<code>public void managerEmitterHandlingTest() throws Exception { emitter.purgeAllData(); metric.notifyManager(); Date from = new Date(); synchronized (this) { try { wait(2000); } catch (InterruptedException e) { e.printStackTrace(); } } Date to = new Date(); List<InMemoryHistoryNode> nodes = emitter.getDrawMetric("FakeMetric", from, to, false); <START> assertEquals("Failed to report metric", 1, nodes.size()); <END> assertEquals("Failed to report metric", nodes.get(0).getValue(), 4); }</code><technical_language>a race condition in this test. metric is guaranteed emitted in interval [from,to]. call metric.notifyManager() declare from, metric emitted starting time. (In theory, metric emission in a separate thread, get emitted _after_ end time to.) I move Date = new Date(); line metric.notifyManager(); line</technical_language>

Target:
public void managerEmitterHandlingTest() throws Exception { emitter.purgeAllData(); Date from = new Date(); metric.notifyManager(); synchronized (this) { try { wait(2000); } catch (InterruptedException e) { e.printStackTrace(); } } Date to = new Date(); List<InMemoryHistoryNode> nodes = emitter.getMetrics("FakeMetric", from, to, false); assertEquals("Failed to report metric", 1, nodes.size()); assertEquals("Failed to report metric", nodes.get(0).getValue(), 4); }
Source:
<code>public static Scope getSurroundingScope(DetailAST node) { Scope returnValue = null; for (DetailAST token = node.getParent(); token != null; token = token.getParent()) { final int type = token.getType(); <START> if (TokenUtil.isOfType(type, TokenTypes.CLASS_DEF, <END> TokenTypes.INTERFACE_DEF, TokenTypes.ANNOTATION_DEF, TokenTypes.ENUM_DEF)) { final DetailAST mods = token.findFirstToken(TokenTypes.MODIFIERS); final Scope modScope = getScopeFromMods(mods); if (returnValue == null || returnValue.isIn(modScope)) { returnValue = modScope; } } else if (TokenUtil.isOfType(type, TokenTypes.LITERAL_NEW)) { returnValue = Scope.ANONINNER; break; } } return returnValue; }</code><technical_language>a dedicated method for Class/Interface/Enum/Annotation checking. TokenUtil.isTypeDeclaration(tokenType)</technical_language>

Target:
public static Scope getSurroundingScope(DetailAST node) { Scope returnValue = null; for (DetailAST token = node.getParent(); token != null; token = token.getParent()) { final int type = token.getType(); if (TokenUtil.isTypeDeclaration(type)) { final DetailAST mods = token.findFirstToken(TokenTypes.MODIFIERS); final Scope modScope = getScopeFromMods(mods); if (returnValue == null || returnValue.isIn(modScope)) { returnValue = modScope; } } else if (type == TokenTypes.LITERAL_NEW) { returnValue = Scope.ANONINNER; break; } } return returnValue; }
Source:
<code>public static ByteBuf encodeSimpleMetadata( ByteBufAllocator allocator, char[] username, char[] password) { int usernameLength = CharByteBufUtil.utf8Bytes(username); <START> if (usernameLength > 256) { <END> throw new IllegalArgumentException( "Username should be shorter than or equal to 256 bytes length in UTF-8 encoding"); } int passwordLength = CharByteBufUtil.utf8Bytes(password); int capacity = AUTH_TYPE_ID_LENGTH + USERNAME_BYTES_LENGTH + usernameLength + passwordLength; final ByteBuf buffer = allocator .buffer(capacity, capacity) .writeByte(WellKnownAuthType.SIMPLE.getIdentifier() | STREAM_METADATA_KNOWN_MASK) .writeByte(usernameLength); CharByteBufUtil.writeUtf8(buffer, username); CharByteBufUtil.writeUtf8(buffer, password); return buffer; }</code><technical_language>256 overflow in writeByte below</technical_language>

Target:
public static ByteBuf encodeSimpleMetadata( ByteBufAllocator allocator, char[] username, char[] password) { int usernameLength = CharByteBufUtil.utf8Bytes(username); if (usernameLength > 255) { throw new IllegalArgumentException( "Username should be shorter than or equal to 255 bytes length in UTF-8 encoding"); } int passwordLength = CharByteBufUtil.utf8Bytes(password); int capacity = AUTH_TYPE_ID_LENGTH + USERNAME_BYTES_LENGTH + usernameLength + passwordLength; final ByteBuf buffer = allocator .buffer(capacity, capacity) .writeByte(WellKnownAuthType.SIMPLE.getIdentifier() | STREAM_METADATA_KNOWN_MASK) .writeByte(usernameLength); CharByteBufUtil.writeUtf8(buffer, username); CharByteBufUtil.writeUtf8(buffer, password); return buffer; }
Source:
<code>@Override public long getNodeStartTime() { <START> LongMetricImpl startTime = sysreg.metric("NodeStartTime", null); <END> startTime.add(nodeStartTime); return startTime.value(); }</code><technical_language>*NodeStartTime* changed request</technical_language>

Target:
@Override public long getNodeStartTime() { return nodeStartTime; }
Source:
<code>public boolean isInstanceOfScoped(EObject object, EClass clazz) { Object typeKey = toKey(object.eClass()); if (!doCalculateInstanceOf(typeKey, <START> clazz)) <END> { return false; } final Set<EObject> instances = instanceStore.getInstanceSet(typeKey); return instances != null && instances.contains(object); }</code><technical_language>parameter toKey(clazz) instead of clazz, support dynamic EMF mode. (sorry for catching earlier)</technical_language>

Target:
public boolean isInstanceOfScoped(EObject object, EClass clazz) { Object typeKey = toKey(object.eClass()); if (!doCalculateInstanceOf(typeKey, toKey(clazz))) { return false; } final Set<EObject> instances = instanceStore.getInstanceSet(typeKey); return instances != null && instances.contains(object); }
Source:
<code>protected void configure(HttpSecurity http) throws Exception { http .anonymous() <START> .principal("custom") <END> .and() .anonymous(); }</code><technical_language>groovy test configuring key principal</technical_language>

Target:
protected void configure(HttpSecurity http) throws Exception { http .anonymous() .key("key") .principal("principal") .and() .anonymous(); }
Source:
<code>private static ByteBuffer makeCatalogVersionAndBytes( int catalogVersion, long txnId, long uniqueId, byte[] catalogBytes, byte[] catalogHash, byte[] deploymentBytes) { ByteBuffer versionAndBytes = ByteBuffer.allocate( 4 + catalogBytes.length + 4 + deploymentBytes.length + 4 + 8 + 8 + 20 + 20 ); versionAndBytes.putInt(catalogVersion); versionAndBytes.putLong(txnId); versionAndBytes.putLong(uniqueId); if (catalogHash != null) { versionAndBytes.put(catalogHash); } else { try { <START> versionAndBytes.put((new InMemoryJarfile(catalogBytes)).getSha1Hash()); <END> } catch (IOException ioe) { VoltDB.crashLocalVoltDB("Unable to build InMemoryJarfile from bytes, should never happen.", true, ioe); } } versionAndBytes.put(makeDeploymentHash(deploymentBytes)); versionAndBytes.putInt(catalogBytes.length); versionAndBytes.put(catalogBytes); versionAndBytes.putInt(deploymentBytes.length); versionAndBytes.put(deploymentBytes); return versionAndBytes; }</code><technical_language>a conditional reassignment of catalogHash: if catalogHash == null try { catalogHash = new InMemoryJarfile(catalogBytes)).getSha1Hash(); ... unconditional versionAndBytes.put(catalogHash);</technical_language>

Target:
private static ByteBuffer makeCatalogVersionAndBytes( int catalogVersion, long txnId, long uniqueId, byte[] catalogBytes, byte[] catalogHash, byte[] deploymentBytes) { ByteBuffer versionAndBytes = ByteBuffer.allocate( 4 + catalogBytes.length + 4 + deploymentBytes.length + 4 + 8 + 8 + 20 + 20 ); if (catalogHash == null) { try { catalogHash = (new InMemoryJarfile(catalogBytes)).getSha1Hash(); } catch (IOException ioe) { VoltDB.crashLocalVoltDB("Unable to build InMemoryJarfile from bytes, should never happen.", true, ioe); } } versionAndBytes.putInt(catalogVersion); versionAndBytes.putLong(txnId); versionAndBytes.putLong(uniqueId); versionAndBytes.put(catalogHash); versionAndBytes.put(makeDeploymentHash(deploymentBytes)); versionAndBytes.putInt(catalogBytes.length); versionAndBytes.put(catalogBytes); versionAndBytes.putInt(deploymentBytes.length); versionAndBytes.put(deploymentBytes); return versionAndBytes; }
Source:
<code>private static BytecodeNode cast( BytecodeGeneratorContext generatorContext, BytecodeNode argument, Type actualType, TypeSignature requiredType) { if (actualType.getTypeSignature().equals(requiredType)) { return argument; } FunctionHandle functionHandle = generatorContext .getFunctionManager() <START> .lookupCast(fromOperatorType(CAST), actualType.getTypeSignature(), requiredType); <END> return generatorContext.generateCall(CAST.name(), generatorContext.getFunctionManager().getScalarFunctionImplementation(functionHandle), ImmutableList.of(argument)); }</code><technical_language>fromOperatorType is unnecessary</technical_language>

Target:
private static BytecodeNode cast( BytecodeGeneratorContext generatorContext, BytecodeNode argument, Type actualType, TypeSignature requiredType) { if (actualType.getTypeSignature().equals(requiredType)) { return argument; } FunctionHandle functionHandle = generatorContext .getFunctionManager() .lookupCast(CastType.CAST, actualType.getTypeSignature(), requiredType); return generatorContext.generateCall(CAST.name(), generatorContext.getFunctionManager().getScalarFunctionImplementation(functionHandle), ImmutableList.of(argument)); }
Source:
<code><START> public PagedIterable<ModelData> createModels(List<String> models) { <END> return new PagedIterable<>(digitalTwinsAsyncClient.createModels(models)); }</code><technical_language>Thanks for adding this</technical_language>

Target:
public List<ModelData> createModels(List<String> models) { return createModelsWithResponse(models, Context.NONE).getValue(); }
Source:
<code>public void testNonBundleFails() throws Exception { Repository newRepo = createBareRepository(); thrown.expect(TransportException.class); fetchFromBundle(newRepo, "Not a bundle <START> file".getBytes(StandardCharsets.UTF_8)); <END> }</code><technical_language>Import this static for consistency rest of code base</technical_language>

Target:
public void testNonBundleFails() throws Exception { Repository newRepo = createBareRepository(); thrown.expect(TransportException.class); fetchFromBundle(newRepo, "Not a bundle file".getBytes(UTF_8)); }
Source:
<code>public void put(K key, V value) { <START> if (inFlightRequests.putIfAbsent(key, value) != null) { <END> return; } Futures.getUnchecked(valuePutter.apply(Maps.immutableEntry(key, value))); }</code><technical_language>similarly here, if this is general, lost updates..</technical_language>

Target:
public void put(K key, V value) { Futures.getUnchecked(valuePutter.apply(Maps.immutableEntry(key, value))); }
Source:
<code>@Test public void arrayIterable() throws Exception { FormUrlEncodedTypedOutput fe = new FormUrlEncodedTypedOutput(); <START> fe.addField("ping", Arrays.asList(new String[]{"pong", "pong-too"})); <END> ByteArrayOutputStream out = new ByteArrayOutputStream(); fe.writeTo(out); String actual = new String(out.toByteArray(), "UTF-8"); assertThat(actual).isEqualTo("ping=pong&ping=pong-too"); }</code><technical_language>Drop new String[] above</technical_language>

Target:
@Test public void arrayIterable() throws Exception { FormUrlEncodedTypedOutput fe = new FormUrlEncodedTypedOutput(); fe.addField("ping", Arrays.asList("pong", "pong-too")); ByteArrayOutputStream out = new ByteArrayOutputStream(); fe.writeTo(out); String actual = new String(out.toByteArray(), "UTF-8"); assertThat(actual).isEqualTo("ping=pong&ping=pong-too"); }
Source:
<code><START> public abstract Ref getRef(String name) throws IOException; <END> public Ref getExactRef(String name) throws IOException { int slash = name.lastIndexOf('/'); return getRefs(name.substring(0, slash+1)).get(name); }</code><technical_language>I deprecate getRef(String) add findRef(String) replaces it. This more clear caller is for a ref matches input. matches static findRef() below. getRef(String) concrete call findRef(String), mark @Deprecated. offer a default implementation of findRef(String) (see below). This a non-breaking API change get JGit 5</technical_language>

Target:
public abstract Ref getRef(String name) throws IOException; public Ref exactRef(String name) throws IOException { int slash = name.lastIndexOf('/'); Ref result = getRefs(name.substring(0, slash + 1)).get(name); if (result != null || slash != -1) { return result; } for (Ref ref : getAdditionalRefs()) { if (name.equals(ref.getName())) { return ref; } } return null; }
Source:
<code>public void testGetVirtualGuestOperatingSystemsWithMissingReferenceCode() { ContainerVirtualGuestConfigurationOption os = ContainerVirtualGuestConfigurationOption.builder() .productItemPrice(ProductItemPrice.builder() .hourlyRecurringFee(0.131f) .recurringFee("90.63") .item(ProductItem.builder().description("Windows Server 2012 Datacenter Edition (64bit)").build()) .build()) .template(VirtualGuest.builder().build()) .build(); ContainerVirtualGuestConfiguration conf = ContainerVirtualGuestConfiguration.builder() .blockDevices(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) .datacenters(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) .memory(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) .networkComponents(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) <START> .operatingSystems(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of(os)) <END> .processors(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) .build(); Set<OperatingSystem> virtualGuestOperatingSystems = conf.getVirtualGuestOperatingSystems(); assertTrue(virtualGuestOperatingSystems.isEmpty()); }</code><technical_language>Add another OS set, verify right ignored</technical_language>

Target:
public void testGetVirtualGuestOperatingSystemsWithMissingReferenceCode() { ContainerVirtualGuestConfigurationOption osValid = ContainerVirtualGuestConfigurationOption.builder() .productItemPrice(ProductItemPrice.builder() .hourlyRecurringFee(0) .recurringFee("0") .item(ProductItem.builder().description("CentOS - Latest").build()) .build()) .template(VirtualGuest.builder().operatingSystemReferenceCode("CENTOS_LATEST").build()) .build(); ContainerVirtualGuestConfigurationOption osInvalid = ContainerVirtualGuestConfigurationOption.builder() .productItemPrice(ProductItemPrice.builder() .hourlyRecurringFee(0.131f) .recurringFee("90.63") .item(ProductItem.builder().description("Windows Server 2012 Datacenter Edition (64bit)").build()) .build()) .template(VirtualGuest.builder().build()) .build(); ContainerVirtualGuestConfiguration conf = ContainerVirtualGuestConfiguration.builder() .blockDevices(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) .datacenters(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) .memory(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) .networkComponents(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) .operatingSystems(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of(osValid, osInvalid)) .processors(ImmutableSet.<ContainerVirtualGuestConfigurationOption>of()) .build(); Set<OperatingSystem> virtualGuestOperatingSystems = conf.getVirtualGuestOperatingSystems(); OperatingSystem os = Iterables.getOnlyElement(virtualGuestOperatingSystems); assertEquals(os.getOperatingSystemReferenceCode(), osValid.getTemplate().getOperatingSystemReferenceCode()); }
Source:
<code>private boolean internalCanDoAction() { boolean returnValue = false; try { Transaction transaction = null; if (!isCanDoActionSupportsTransaction()) { transaction = TransactionSupport.suspend(); } try { returnValue = isUserAuthorizedToRunAction() && isBackwardsCompatible() && validateInputs() && acquireLock() && canDoAction() && internalValidateAndSetQuota(); if (!returnValue && getReturnValue().getCanDoActionMessages().size() > 0) { List<String> canDos = getBackend().getErrorsTranslator(). TranslateErrorText(getReturnValue().getCanDoActionMessages()); log.warn("CanDoAction of action '{}' failed for user {}. Reasons: {}", getActionType(), getUserName(), <START> StringUtils.join(canDos, ',')); <END> } } finally { if (transaction != null) { TransactionSupport.resume(transaction); } } } catch (DataAccessException dataAccessEx) { log.error("Data access error during CanDoActionFailure.", dataAccessEx); addCanDoActionMessage(EngineMessage.CAN_DO_ACTION_DATABASE_CONNECTION_FAILURE); } catch (RuntimeException ex) { log.error("Error during CanDoActionFailure.", ex); addCanDoActionMessage(EngineMessage.CAN_DO_ACTION_GENERAL_FAILURE); } finally { if (!returnValue) { freeLock(); } } return returnValue; }</code><technical_language>is this needed? I find convenient enum error, searchable easily in code, string</technical_language>

Target:
private boolean internalCanDoAction() { boolean returnValue = false; try { Transaction transaction = null; if (!isCanDoActionSupportsTransaction()) { transaction = TransactionSupport.suspend(); } try { returnValue = isUserAuthorizedToRunAction() && isBackwardsCompatible() && validateInputs() && acquireLock() && canDoAction() && internalValidateAndSetQuota(); if (!returnValue && getReturnValue().getCanDoActionMessages().size() > 0) { log.warn("CanDoAction of action '{}' failed for user {}. Reasons: {}", getActionType(), getUserName(), StringUtils.join(getReturnValue().getCanDoActionMessages(), ',')); } } finally { if (transaction != null) { TransactionSupport.resume(transaction); } } } catch (DataAccessException dataAccessEx) { log.error("Data access error during CanDoActionFailure.", dataAccessEx); addCanDoActionMessage(EngineMessage.CAN_DO_ACTION_DATABASE_CONNECTION_FAILURE); } catch (RuntimeException ex) { log.error("Error during CanDoActionFailure.", ex); addCanDoActionMessage(EngineMessage.CAN_DO_ACTION_GENERAL_FAILURE); } finally { if (!returnValue) { freeLock(); } } return returnValue; }
Source:
<code>public Block readBlock(Type type) throws IOException { if (!rowGroupOpen) { openRowGroup(); } if (readOffset > 0) { if (presentStream != null) { readOffset = presentStream.countBitsSet(readOffset); } for (StreamReader structField : structFields.values()) { structField.prepareNextRead(readOffset); } } List<Type> typeParameters = type.getTypeParameters(); boolean[] nullVector = new boolean[nextBatchSize]; Block[] blocks; if (presentStream == null) { blocks = getBlocksForType(type, nextBatchSize); } else { int nullValues = presentStream.getUnsetBits(nextBatchSize, nullVector); if (nullValues != nextBatchSize) { blocks = getBlocksForType(type, nextBatchSize - nullValues); } else { blocks = new Block[typeParameters.size()]; <START> for (int i = 0; i < typeParameters.size(); i++) { <END> blocks[i] = typeParameters.get(i).createBlockBuilder(null, 0).build(); } } } verify(Arrays.stream(blocks) .mapToInt(Block::getPositionCount) .distinct() .count() == 1); Block rowBlock = RowBlock.fromFieldBlocks(nullVector, blocks); readOffset = 0; nextBatchSize = 0; return rowBlock; }</code><technical_language>typeParameters is in this branch move declaration here</technical_language>

Target:
public Block readBlock(Type type) throws IOException { if (!rowGroupOpen) { openRowGroup(); } if (readOffset > 0) { if (presentStream != null) { readOffset = presentStream.countBitsSet(readOffset); } for (StreamReader structField : structFields.values()) { structField.prepareNextRead(readOffset); } } boolean[] nullVector = new boolean[nextBatchSize]; Block[] blocks; if (presentStream == null) { blocks = getBlocksForType(type, nextBatchSize); } else { int nullValues = presentStream.getUnsetBits(nextBatchSize, nullVector); if (nullValues != nextBatchSize) { blocks = getBlocksForType(type, nextBatchSize - nullValues); } else { List<Type> typeParameters = type.getTypeParameters(); blocks = new Block[typeParameters.size()]; for (int i = 0; i < typeParameters.size(); i++) { blocks[i] = typeParameters.get(i).createBlockBuilder(null, 0).build(); } } } verify(Arrays.stream(blocks) .mapToInt(Block::getPositionCount) .distinct() .count() == 1); Block rowBlock = RowBlock.fromFieldBlocks(nullVector, blocks); readOffset = 0; nextBatchSize = 0; return rowBlock; }
Source:
<code>public CallStatus run() { RequestMetrics.Context context = metrics.startHealthRequest(); LOGGER.debug("run: health"); Error.reset(); Error.push("rest"); Error.push(getClass().getSimpleName()); try { Map<String, HealthCheck.Result> healthCheckResults = new LinkedHashMap<>(); CallStatus callStatus = new CallStatus(); <START> for (Map.Entry<String, Result> entry : CrudCheckRegistry.getHealthCheckRegistry().runHealthChecks().entrySet()) { <END> if (entry.getValue().isHealthy()) { LOGGER.debug("healthCheck is OK", entry.getKey()); healthCheckResults.put(entry.getKey(), entry.getValue()); } else { String errorDetails = entry.getKey().toString() + " " + entry.getValue().getDetails(); Error.push("healthCheck failed! " + errorDetails); LOGGER.debug("healthCheck failed!", errorDetails); return new CallStatus(Error.get(RestCrudConstants.ERR_REST_CHECK_HEALTH, errorDetails)); } } return new CallStatus(new CrudCheckResponse(healthCheckResults)); } catch (Error e) { context.markRequestException(e); LOGGER.error("checkHealth failure: {}", e); return new CallStatus(e); } catch (Exception e) { context.markRequestException(e); LOGGER.error("checkHealth failure: {}", e); return new CallStatus(Error.get(RestCrudConstants.ERR_REST_CHECK_HEALTH, e.toString())); } finally { context.endRequestMonitoring(); } }</code><technical_language>this passed in registry. begs question, command for a health registry? reuse command registries for /health /diagnostics. I some of error messages change wondering if worth duplicate class. a huge deal way, simplify maintenance / review a bit</technical_language>

Target:
public CallStatus run() { RequestMetrics.Context context = metrics.startHealthRequest(); LOGGER.debug("run: health"); Error.reset(); Error.push("rest"); Error.push(getClass().getSimpleName()); try { Response.Status healthCheckResponse = Response.Status.OK; Map<String, HealthCheck.Result> healthCheckResults = new LinkedHashMap<>(); for (Map.Entry<String, Result> entry : healthCheckRegistry.runHealthChecks().entrySet()) { if (entry.getValue().isHealthy()) { LOGGER.debug("healthCheck is OK", entry.getKey()); healthCheckResults.put(entry.getKey(), entry.getValue()); } else { String errorDetails = entry.getKey().toString() + " " + entry.getValue().getDetails(); Error.push("healthCheck failed! " + errorDetails); LOGGER.debug("healthCheck failed!", errorDetails); healthCheckResults.put(entry.getKey(), entry.getValue()); healthCheckResponse = Response.Status.SERVICE_UNAVAILABLE; } } return new CallStatus(new CrudCheckResponse(healthCheckResults), healthCheckResponse); } catch (Error e) { context.markRequestException(e); LOGGER.error("checkHealth failure: {}", e); return new CallStatus(e); } catch (Exception e) { context.markRequestException(e); LOGGER.error("checkHealth failure: {}", e); return new CallStatus(Error.get(RestCrudConstants.ERR_REST_CHECK_HEALTH, e.toString())); } finally { context.endRequestMonitoring(); } }
Source:
<code>private List<StudentAttributes> getOldStudentsForMigration(ScriptTarget target) { List<StudentAttributes> students; if (target == ScriptTarget.BY_TIME) { Calendar startCal = Calendar.getInstance(); startCal.add(Calendar.DAY_OF_YEAR, -1 * numDays); students = getOldStudentsSince(startCal.getTime()); } else if (target == ScriptTarget.BY_COURSE) { students = getOldStudentsForCourse(courseId); } else if (target == ScriptTarget.ALL) { students = getAllOldStudents(); } else { students = null; Assumption.fail("no target selected"); } <START> return students; <END> }</code><technical_language>I this way: java if (target == ...) { return ...; } else if (target == ...) { return ...; } Assumption.fail("no target selected"); return null; yet, switch(target)</technical_language>

Target:
private List<StudentAttributes> getOldStudentsForMigration(ScriptTarget target) { switch (target) { case BY_TIME: Calendar startCal = Calendar.getInstance(); startCal.add(Calendar.DAY_OF_YEAR, -1 * numDays); return getOldStudentsSince(startCal.getTime()); case BY_COURSE: return getOldStudentsForCourse(courseId); case ALL: return getAllOldStudents(); default: Assumption.fail("no target selected"); return null; } }
Source:
<code>public Transaction beginTransaction(TxIsolation isolation) { SpiTransaction t = transactionManager.createTransaction(true, isolation.getLevel()); <START> return transactionManager.wrapAsScopedTransaction(t); <END> }</code><technical_language>Why? This for a reason etc</technical_language>

Target:
public Transaction beginTransaction(TxIsolation isolation) { SpiTransaction t = transactionManager.createTransaction(true, isolation.getLevel()); try { transactionManager.set(t); } catch (PersistenceException existingTransactionError) { t.end(); throw existingTransactionError; } return t; }
Source:
<code>private MagicCommandFunctionality classpathAddJar() { return (code, command, message, executionCount) -> { String[] split = command.split(" "); try { if (split.length != 4) { throw new IllegalStateException("Wrong command format: " + CLASSPATH_ADD_JAR); } String path = split[3]; if (doesPathContainsWildCards(path)) { getPaths(path) .forEach(currentPath -> kernel.addJarToClasspath(new PathToJar(currentPath))); <START> } else { <END> validatePath(path); this.kernel.addJarToClasspath(new PathToJar(path)); } return getMagicCommandItem(code, message, executionCount); } catch (IllegalStateException e) { return new MagicCommandItemWithResult( messageCreator .buildOutputMessage(message, e.getMessage(), true), messageCreator.buildReplyWithoutStatus(message, executionCount) ); } }; }</code><technical_language>expanding wildcard instead of letting java handle it. i this a problem windows is a small limit total size of classpath. otoh i ability report matched files</technical_language>

Target:
private MagicCommandFunctionality classpathAddJar() { return (code, command, message, executionCount) -> { String[] split = command.split(" "); try { if (split.length != 4) { throw new IllegalStateException("Wrong command format: " + CLASSPATH_ADD_JAR); } String path = split[3]; if (doesPathContainsWildCards(path)) { validateWildcardPath(path); getPaths(path) .forEach(currentPath -> kernel.addJarToClasspath(new PathToJar(currentPath))); } else { validatePath(path); this.kernel.addJarToClasspath(new PathToJar(path)); } return getMagicCommandItem(code, message, executionCount); } catch (IllegalStateException e) { return new MagicCommandItemWithResult( messageCreator .buildOutputMessage(message, e.getMessage(), true), messageCreator.buildReplyWithoutStatus(message, executionCount) ); } }; }
Source:
<code>private static void checkFunctionLike(SubscriptionContext ctx) { FunctionLike functionLike = (FunctionLike) ctx.syntaxNode(); Tree enclosingLoop = enclosingLoop(functionLike); if(enclosingLoop == null || !enclosingLoop.is(Tree.Kind.WHILE_STMT, Tree.Kind.FOR_STMT, Tree.Kind.GENERATOR_EXPR, Tree.Kind.LIST_COMPREHENSION)) { return; } <START> if (isCalledWithinLoop(functionLike, enclosingLoop)) { return; } if (isReturnedInLoop(enclosingLoop, functionLike)) { return; } <END> Set<Symbol> enclosingScopeSymbols = getEnclosingScopeSymbols(functionLike); for (Symbol symbol : enclosingScopeSymbols) { List<Tree> problematicUsages = new ArrayList<>(); List<Tree> bindingUsages = new ArrayList<>(); for (Usage usage : symbol.usages()) { Tree usageTree = usage.tree(); if (isUsedInFunctionLike(usageTree, functionLike) && !usage.isBindingUsage()) { problematicUsages.add(usageTree); } if (usage.isBindingUsage() && isWithinEnclosingLoop(usageTree, enclosingLoop)) { bindingUsages.add(usageTree); } } reportIssue(ctx, functionLike, problematicUsages, bindingUsages); } }</code><technical_language>Minor suggestion: a visitor loop a single visit check if function is called loop if returned in loop</technical_language>

Target:
private static void checkFunctionLike(SubscriptionContext ctx) { FunctionLike functionLike = (FunctionLike) ctx.syntaxNode(); Tree enclosingLoop = enclosingLoop(functionLike); if(enclosingLoop == null || !enclosingLoop.is(Tree.Kind.WHILE_STMT, Tree.Kind.FOR_STMT, Tree.Kind.GENERATOR_EXPR, Tree.Kind.LIST_COMPREHENSION)) { return; } if (isReturnedOrCalledWithinLoop(functionLike, enclosingLoop)) { return; } Set<Symbol> enclosingScopeSymbols = getEnclosingScopeSymbols(enclosingLoop); for (Symbol symbol : enclosingScopeSymbols) { List<Tree> problematicUsages = new ArrayList<>(); List<Tree> bindingUsages = new ArrayList<>(); for (Usage usage : symbol.usages()) { Tree usageTree = usage.tree(); if (isUsedInFunctionLike(usageTree, functionLike) && !usage.isBindingUsage()) { problematicUsages.add(usageTree); } if (usage.isBindingUsage() && isWithinEnclosingLoop(usageTree, enclosingLoop)) { bindingUsages.add(usageTree); } } reportIssue(ctx, functionLike, problematicUsages, bindingUsages); } }
Source:
<code>public static MediaType detectMediaType(InputStream inputStream) throws IOException { if (!inputStream.markSupported()) throw new UnsupportedOperationException("InputStream marking support is required!"); Detector detector = new AutoDetectParser().getDetector(); <START> return detector.detect(inputStream, new Metadata()); <END> }</code><technical_language>skip storing detector in a variable call return new AutoDetectParser().getDetector().detect(inputStream, new Metadata());</technical_language>

Target:
public static MediaType detectMediaType(InputStream inputStream) throws IOException { if (!inputStream.markSupported()) throw new UnsupportedOperationException("InputStream marking support is required!"); return new AutoDetectParser().getDetector().detect(inputStream, new Metadata()); }
Source:
<code>public static PackIndex read(InputStream fd) throws IOException, CorruptObjectException { final byte[] hdr = new byte[8]; IO.readFully(fd, hdr, 0, hdr.length); if (isTOC(hdr)) { final int v = NB.decodeInt32(hdr, 4); switch (v) { case 2: return new PackIndexV2(fd); default: throw new <START> UnsupportedPackIndexVersionException(MessageFormat .format(JGitText.get().unsupportedPackIndexVersion, Integer.valueOf(v))); <END> } } return new PackIndexV1(fd, hdr); }</code><technical_language>Pass only, format message constructor</technical_language>

Target:
public static PackIndex read(InputStream fd) throws IOException, CorruptObjectException { final byte[] hdr = new byte[8]; IO.readFully(fd, hdr, 0, hdr.length); if (isTOC(hdr)) { final int v = NB.decodeInt32(hdr, 4); switch (v) { case 2: return new PackIndexV2(fd); default: throw new UnsupportedPackIndexVersionException(v); } } return new PackIndexV1(fd, hdr); }
Source:
<code>public Fragment getFirstFragment() { return CourseTabsDashboardFragment.newInstance( <START> (EnrolledCoursesResponse) getIntent().getExtras().getSerializable(EXTRA_COURSE_DATA), <END> getIntent().getStringExtra(EXTRA_COURSE_ID), getIntent().getStringExtra(EXTRA_SCREEN_NAME)); }</code><technical_language>getIntent().getSerializableExtra(EXTRA_COURSE_DATA)</technical_language>

Target:
public Fragment getFirstFragment() { return CourseTabsDashboardFragment.newInstance( (EnrolledCoursesResponse) getIntent().getSerializableExtra(EXTRA_COURSE_DATA), getIntent().getStringExtra(EXTRA_COURSE_ID), getIntent().getStringExtra(EXTRA_SCREEN_NAME)); }
Source:
<code>public double getTonnage() { if (getType().getKgPerShot() > 0) { return getType().getKgPerShot() * shots/1000.0; } <START> return ((double)shots / getType().getShots()); <END> }</code><technical_language>suggestion return ((double) shots / getType().getShots());</technical_language>

Target:
public double getTonnage() { if (getType().getKgPerShot() > 0) { return getType().getKgPerShot() * (shots / 1000.0); } return ((double) shots / getType().getShots()); }
Source:
<code>public LStat lstat(FS fs, File file) throws NoSuchFileException, NotDirectoryException { String path = file.getAbsolutePath(); int[] rawlstat = lstatImpl(path); if (rawlstat.length != 11) <START> throw new IllegalArgumentException("lstat() didn't return int[11]"); <END> return new LStat(rawlstat); }</code><technical_language>localize this string</technical_language>

Target:
public LStat lstat(FS fs, File file) throws NoSuchFileException, NotDirectoryException { String path = file.getAbsolutePath(); int[] rawlstat = lstatImpl(path); if (rawlstat.length != 11) throw new IllegalArgumentException( JGitText.get().lstatImplIllegalResult); return new LStat(rawlstat); }
Source:
<code>public LocalStackContainer() { <START> this(TestcontainersConfiguration.getInstance().getLocalStackImage().split(":")[1]); <END> }</code><technical_language>default, provided image</technical_language>

Target:
public LocalStackContainer() { super(TestcontainersConfiguration.getInstance().getLocalStackImage()); sharedSetup(); }
Source:
<code>public static AbstractItem resolveForCLI( @Argument(required=true,metaVar="NAME",usage="Job name") String name) throws CmdLineException { AbstractItem item = Jenkins.getInstance().getItemByFullName(name, AbstractItem.class); if (item==null) { AbstractProject project = AbstractProject.findNearest(name); <START> throw new CmdLineException(null, Messages.AbstractItem_NoSuchJobExists(name, project == null ? "" : project.getFullName())); <END> } return item; }</code><technical_language>IIRC fixed in PRs, merged. sense add instead of empty string</technical_language>

Target:
public static AbstractItem resolveForCLI( @Argument(required=true,metaVar="NAME",usage="Job name") String name) throws CmdLineException { AbstractItem item = Jenkins.getInstance().getItemByFullName(name, AbstractItem.class); if (item==null) { AbstractProject project = AbstractProject.findNearest(name); throw new CmdLineException(null, project == null ? Messages.AbstractItem_NoSuchJobExistsWithoutSuggestion(name) : Messages.AbstractItem_NoSuchJobExists(name, project.getFullName())); } return item; }
Source:
<code>public static Matrix4 createRotationMatrix(final Axis axis, double angle) { Matrix4 ret = new Matrix4(); <START> return ret.setToRotation(axis, angle); <END> }</code><technical_language>return new Matrix4().setToRotation(axis, angle);</technical_language>

Target:
public static Matrix4 createRotationMatrix(final Axis axis, double angle) { return new Matrix4().setToRotation(axis, angle); }
Source:
<code>public static NuageVspPluginClientLoader getClientLoader(String relativePath, String[] cmsUserInfo, int numRetries, int retryInterval, <START> String nuageVspCmsId) throws Exception { <END> NuageVspPluginClientLoader nuageVspPluginClientClassloader = new NuageVspPluginClientLoader(NUAGE_PLUGIN_CLIENT_JAR_FILE); nuageVspPluginClientClassloader.loadClasses(relativePath, cmsUserInfo, numRetries, retryInterval, nuageVspCmsId); return nuageVspPluginClientClassloader; }</code><technical_language>This throws is broad. Please enumerate expected checked exceptions thrown</technical_language>

Target:
public static NuageVspPluginClientLoader getClientLoader(String relativePath, String[] cmsUserInfo, int numRetries, int retryInterval, String nuageVspCmsId) throws ConfigurationException { NuageVspPluginClientLoader nuageVspPluginClientClassloader = new NuageVspPluginClientLoader(NUAGE_PLUGIN_CLIENT_JAR_FILE); nuageVspPluginClientClassloader.loadClasses(relativePath, cmsUserInfo, numRetries, retryInterval, nuageVspCmsId); return nuageVspPluginClientClassloader; }
Source:
<code>List<IndexEntry> getValidIndexEntriesForIndexSegment(Offset indexSegmentStartOffset, long deleteReferenceTimeMs, long expiryReferenceTimeMs) { List<IndexEntry> validEntries = new ArrayList<>(); if (referenceIndex.containsKey(indexSegmentStartOffset)) { for (Map.Entry<MockId, IndexValue> indexSegmentEntry : referenceIndex.get(indexSegmentStartOffset).entrySet()) { MockId key = indexSegmentEntry.getKey(); IndexValue value = indexSegmentEntry.getValue(); if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { validEntries.add(new IndexEntry(key, value)); if (!isDeletedAt(key, deleteReferenceTimeMs) && !isExpiredAt(key, expiryReferenceTimeMs) && value.getOriginalMessageOffset() != IndexValue.UNKNOWN_ORIGINAL_MESSAGE_OFFSET && value.getOriginalMessageOffset() >= indexSegmentStartOffset.getOffset()) { validEntries.add(new IndexEntry(key, allKeys.get(key).getFirst())); } } else if (!isExpiredAt(key, expiryReferenceTimeMs)) { if (!deletedKeys.contains(key)) { validEntries.add(new IndexEntry(key, value)); } else if (!isDeletedAt(key, deleteReferenceTimeMs)) { <START> validEntries.add(new IndexEntry(key, value)); <END> } } } } return validEntries; }</code><technical_language>this true? else this throw exception</technical_language>

Target:
List<IndexEntry> getValidIndexEntriesForIndexSegment(Offset indexSegmentStartOffset, long deleteReferenceTimeMs, long expiryReferenceTimeMs) { List<IndexEntry> validEntries = new ArrayList<>(); if (referenceIndex.containsKey(indexSegmentStartOffset)) { for (Map.Entry<MockId, IndexValue> indexSegmentEntry : referenceIndex.get(indexSegmentStartOffset).entrySet()) { MockId key = indexSegmentEntry.getKey(); IndexValue value = indexSegmentEntry.getValue(); if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { validEntries.add(new IndexEntry(key, value)); if (value.getOriginalMessageOffset() != IndexValue.UNKNOWN_ORIGINAL_MESSAGE_OFFSET && value.getOriginalMessageOffset() != value.getOffset().getOffset() && value.getOriginalMessageOffset() >= indexSegmentStartOffset.getOffset() && !isDeletedAt(key, deleteReferenceTimeMs) && !isExpiredAt(key, expiryReferenceTimeMs)) { validEntries.add(new IndexEntry(key, allKeys.get(key).getFirst())); } } else if (!isExpiredAt(key, expiryReferenceTimeMs)) { if (!deletedKeys.contains(key)) { validEntries.add(new IndexEntry(key, value)); } else if (!isDeletedAt(key, deleteReferenceTimeMs)) { validEntries.add(new IndexEntry(key, value)); } } } } return validEntries; }
Source:
<code>public void run(String realfile, int port) { <START> String file = "reactivesocket-tck-drivers/src/main/test/resources/servertest$.txt"; <END> if (realfile != null) { file = realfile; } TcpReactiveSocketServer server = TcpReactiveSocketServer.create(port); JavaServerDriver jsd = new JavaServerDriver(file, server, mutex); jsd.run(); }</code><technical_language>this path is wrong -main</technical_language>

Target:
public void run(String realfile, int port) { String file = "reactivesocket-tck-drivers/src/main/resources/server$.txt"; if (realfile != null) { file = realfile; } TcpReactiveSocketServer server = TcpReactiveSocketServer.create(port); JavaServerDriver jsd = new JavaServerDriver(file, server, mutex); jsd.run(); }
Source:
<code>public void onSiteEditorsChanged(OnSiteEditorsChanged event) { if (event.isError()) { return; } if (TextUtils.isEmpty(event.site.getMobileEditor())) { if (AppPrefs.isDefaultAppWideEditorPreferenceSet()) { String defaultEditor = AppPrefs.isGutenbergDefaultForNewPosts() ? SiteUtils.GB_EDITOR_NAME : SiteUtils.AZTEC_EDITOR_NAME; mDispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorAction( new DesignateMobileEditorPayload(event.site, defaultEditor))); AnalyticsUtils.trackWithSiteDetails( AppPrefs.isGutenbergDefaultForNewPosts() ? Stat.EDITOR_GUTENBERG_ENABLED <START> : Stat.EDITOR_GUTENBERG_DISABLED, <END> mSite); } } notifyUpdatedOnUiThread(); }</code><technical_language>Note if emit _DISABLED event here, a spike users upgraded app version 13.0. users actively disabled block editor rather, app broadcasting fact classic editor saved backend. prefer if emit this avoid confusion reading tracks but, a "one time" event a real issue. WDYT</technical_language>

Target:
public void onSiteEditorsChanged(OnSiteEditorsChanged event) { if (event.isError()) { return; } notifyUpdatedOnUiThread(); }
Source:
<code>public List<RefactoringPageRow> buildResponse(final List<KObject> kObjects) { final List<RefactoringPageRow> result = new ArrayList<RefactoringPageRow>(kObjects.size()); for (final KObject kObject : kObjects) { for (KProperty property : kObject.getProperties()) { <START> if (property.getName().equals(ResourceType.FORM.toString())) { <END> String formId = (String) property.getValue(); final Path path = Paths.convert(ioService.get(URI.create(kObject.getKey()))); Map<String, Path> map = new HashMap<String, Path>(); map.put(formId, path); RefactoringMapPageRow row = new RefactoringMapPageRow(); row.setValue(map); result.add(row); } } } return result; }</code><technical_language>I know, long is this List<KObject> this pretty inefficient - iterate property of KObject create result. this improved somehow? improvement mind is add break end of if block, skip additional properties find Property Resource type form :)</technical_language>

Target:
public List<RefactoringPageRow> buildResponse(final List<KObject> kObjects) { final List<RefactoringPageRow> result = new ArrayList<RefactoringPageRow>(kObjects.size()); for (final KObject kObject : kObjects) { String formId = findFormId(kObject.getProperties()); if (formId != null) { final Path path = Paths.convert(ioService.get(URI.create(kObject.getKey()))); Map<String, Path> map = new HashMap<String, Path>(); map.put(formId, path); RefactoringMapPageRow row = new RefactoringMapPageRow(); row.setValue(map); result.add(row); } } return result; }
Source:
<code>public ParametersBuilder add(int year, int month, int day, int hour, int minute, int second, int nanosecond, String zone, ZoneId defaultTimeZone) { if ( isNanosecondPrecisionSupported() ) { <START> nanosecond = 0; <END> } return add( defaultTimeZone, year, month, day, hour, minute, second, nanosecond, zone ); }</code><technical_language>if condition be: if ( !isNanosecondPrecisionSupported() )</technical_language>

Target:
public ParametersBuilder add(int year, int month, int day, int hour, int minute, int second, int nanosecond, String zone, ZoneId defaultTimeZone) { if ( !isNanosecondPrecisionSupported() ) { nanosecond = 0; } return add( defaultTimeZone, year, month, day, hour, minute, second, nanosecond, zone ); }
Source:
<code>public LoadQueuePeonTester() { super( null, null, null, null, null, new TestDruidCoordinatorConfig( <START> null, <END> null, null, new Duration(1), null, null, 10, null, false, false, new Duration("PT1s") ) ); }</code><technical_language>class a builder, I ask changing</technical_language>

Target:
public LoadQueuePeonTester() { super( null, null, null, Execs.scheduledSingleThreaded("LoadQueuePeonTester--%d"), null, new TestDruidCoordinatorConfig( null, null, null, new Duration(1), null, null, 10, null, false, false, new Duration("PT1s"), Duration.millis(10) ) ); }