auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public int getSigInsertionIndex(Sha256Hash hash, ECKey signingKey) { List<byte[]> sigs = Lists.newArrayList(); List<ScriptChunk> existingChunks = chunks.subList(1, chunks.size() - 1); ScriptChunk scriptChunk = chunks.get(chunks.size() - 1); checkNotNull(scriptChunk.data); Script redeemScript = new Script(scriptChunk.data); for (ScriptChunk chunk : existingChunks) { if (chunk.opcode == OP_0) { } else { checkNotNull(chunk.data); sigs.add(chunk.data); } } int myIndex = redeemScript.findKeyInRedeem(signingKey); for (ListIterator<byte[]> iter = sigs.listIterator() ; iter.hasNext() ;) { byte[] sig = iter.next(); if (myIndex < redeemScript.findSigInRedeem(sig, hash)) { <START> return iter.previousIndex(); <END> } } return sigs.size(); }</code><technical_language>is this work local signature is in redeem script? Imagine, 2-of-3 keys k1, k2, k3 (sorted), k3 is a local key signatures s1, s2, s3. sign k1 k3. LocalTransactionSigner insert s3 in position 0 call getSigInsertionIndex in Custom signer yield -1 (myIndex = 0 sig's index is 2), which, I guess, expected</technical_language>

Target:
public int getSigInsertionIndex(Sha256Hash hash, ECKey signingKey) { List<ScriptChunk> existingChunks = chunks.subList(1, chunks.size() - 1); ScriptChunk redeemScriptChunk = chunks.get(chunks.size() - 1); checkNotNull(redeemScriptChunk.data); Script redeemScript = new Script(redeemScriptChunk.data); int sigCount = 0; int myIndex = redeemScript.findKeyInRedeem(signingKey); for (ScriptChunk chunk : existingChunks) { if (chunk.opcode == OP_0) { } else { checkNotNull(chunk.data); if (myIndex < redeemScript.findSigInRedeem(chunk.data, hash)) return sigCount; sigCount++; } } return sigCount; }
Source:
<code>public static String parseId (String json, String prefix, String key) { Gson gson = new Gson(); Type mapType = new TypeToken<Map<String, Object>>(){}.getType(); Map<String, String> jsonMap = gson.fromJson(json, mapType); Pattern p = Pattern.compile(String.format(".*%s\\/([a-z|\\-|\\d]*).*", prefix)); Matcher m = p.matcher(jsonMap.get("href")); if (m.matches()) { String dataCenterId = m.group(1); jsonMap.put(key, dataCenterId); json = (new Gson()).toJson(jsonMap); } return json; <START> } <END></code><technical_language>This class creates instances of a json parser. Instead, get jclouds Json object injected a method parameter if want static signature</technical_language>

Target:
public String parseId (String json, String prefix, String key) { Type mapType = new TypeToken<Map<String, Object>>(){}.getType(); Map<String, String> jsonMap = jsonBinder.fromJson(json, mapType); Pattern p = Pattern.compile(String.format(".*%s\\/([a-z|\\-|\\d]*).*", prefix)); Matcher m = p.matcher(jsonMap.get("href")); if (m.matches()) { String dataCenterId = m.group(1); jsonMap = new ImmutableMap.Builder<String, String>() .putAll(jsonMap) .put(key, dataCenterId) .build(); json = jsonBinder.toJson(jsonMap); } return json; }
Source:
<code>public double sum() { <START> return TimeUnit.SECONDS.convert(sum, TimeUnit.NANOSECONDS); <END> }</code><technical_language>for this case, lose numbers a decimal point</technical_language>

Target:
public double sum() { return sum / 1e9D; }
Source:
<code>public static List<String> getAllBroadcastAddresses() { try { <START> List<String> broadcastAddresses = new ArrayList<String>(); <END> final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { final NetworkInterface networkInterface = networkInterfaces.nextElement(); final List<InterfaceAddress> interfaceAddresses = networkInterface.getInterfaceAddresses(); for (InterfaceAddress interfaceAddress : interfaceAddresses) { final InetAddress addr = interfaceAddress.getAddress(); if (!addr.isLinkLocalAddress() && !addr.isLoopbackAddress() && addr instanceof Inet4Address) { broadcastAddresses.add(interfaceAddress.getBroadcast().getHostAddress()); } } } return broadcastAddresses; } catch (SocketException ex) { LOGGER.error("Could not find broadcast address: {}", ex.getMessage(), ex); return null; } }</code><technical_language>a LinkedList if size (to reduce reallocations copies)</technical_language>

Target:
public static List<String> getAllBroadcastAddresses() { List<String> broadcastAddresses = new LinkedList<String>(); try { final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { final NetworkInterface networkInterface = networkInterfaces.nextElement(); final List<InterfaceAddress> interfaceAddresses = networkInterface.getInterfaceAddresses(); for (InterfaceAddress interfaceAddress : interfaceAddresses) { final InetAddress addr = interfaceAddress.getAddress(); if (!addr.isLinkLocalAddress() && !addr.isLoopbackAddress() && addr instanceof Inet4Address) { broadcastAddresses.add(interfaceAddress.getBroadcast().getHostAddress()); } } } } catch (SocketException ex) { LOGGER.error("Could not find broadcast address: {}", ex.getMessage(), ex); } return broadcastAddresses; }
Source:
<code>public QQProfile retrieveUserProfileFromToken(WebContext context, OAuth2AccessToken accessToken) { QQProfileDefinition profileDefinition = (QQProfileDefinition) configuration.getProfileDefinition(); String openidUrl = profileDefinition.getOpenidUrl(accessToken, configuration); final OAuth20Service service = this.configuration.buildService(context, client, null); String body = sendRequestForData(service, accessToken, openidUrl, Verb.GET); String openid = profileDefinition.extractOpenid(body); String profileUrl = profileDefinition.getProfileUrl(accessToken, configuration); <START> profileUrl = profileUrl + "?openid=" + openid + "&oauth_consumer_key=" + configuration.getKey(); <END> body = sendRequestForData(service, accessToken, profileUrl, Verb.GET); if (body == null) { throw new HttpCommunicationException("Not data found for accessToken: " + accessToken); } final QQProfile profile = profileDefinition.extractUserProfile(body); addAccessTokenToProfile(profile, accessToken); profile.setId(openid); return profile; }</code><technical_language>CommonHelper.addParameter method ensure properly URL-encoded</technical_language>

Target:
public QQProfile retrieveUserProfileFromToken(WebContext context, OAuth2AccessToken accessToken) { QQProfileDefinition profileDefinition = (QQProfileDefinition) configuration.getProfileDefinition(); String openidUrl = profileDefinition.getOpenidUrl(accessToken, configuration); final OAuth20Service service = this.configuration.buildService(context, client, null); String body = sendRequestForData(service, accessToken, openidUrl, Verb.GET); String openid = profileDefinition.extractOpenid(body); String profileUrl = profileDefinition.getProfileUrl(accessToken, configuration); profileUrl = CommonHelper.addParameter(profileUrl, "openid", openid); profileUrl = CommonHelper.addParameter(profileUrl, "oauth_consumer_key", configuration.getKey()); body = sendRequestForData(service, accessToken, profileUrl, Verb.GET); if (body == null) { throw new HttpCommunicationException("Not data found for accessToken: " + accessToken); } final QQProfile profile = profileDefinition.extractUserProfile(body); addAccessTokenToProfile(profile, accessToken); profile.setId(openid); return profile; }
Source:
<code>public static boolean verify(byte[] data, byte[] signature, byte[] pub) { <START> return verify(data, ECDSASignature.decodeFromDER(signature), pub); <END> }</code><technical_language>@greenaddress this</technical_language>

Target:
public static boolean verify(byte[] data, byte[] signature, byte[] pub) { if (Secp256k1Context.isEnabled()) { try { return NativeSecp256k1.verify(data, signature, pub); } catch (NativeSecp256k1Util.AssertFailException e) { log.error("Caught AssertFailException inside secp256k1", e); return false; } } return verify(data, ECDSASignature.decodeFromDER(signature), pub); }
Source:
<code>public String installPush( @Nullable String deviceToken, @NonNull PushBackend pushBackend ) throws ThingIFException { <START> return thingIfApi.installPush(deviceToken, pushBackend); <END> }</code><technical_language>Adding this a field is good manner</technical_language>

Target:
public String installPush( @Nullable String deviceToken, @NonNull PushBackend pushBackend ) throws ThingIFException { return this.thingIfApi.installPush(deviceToken, pushBackend); }
Source:
<code>private static long unpacked(Any any) { <START> checkNotNull(any); <END> final Int64Value unpacked = unpack(any, Int64Value.class); return unpacked.getValue(); }</code><technical_language>do do for a private static method</technical_language>

Target:
private static long unpacked(Any any) { final Int64Value unpacked = unpack(any, Int64Value.class); return unpacked.getValue(); }
Source:
<code>public void run() { <START> RebalanceUtil.scheduleOnDemandPipeline(_manager.getClusterName(), 0); <END> }</code><technical_language>0L if parameter type is long</technical_language>

Target:
public void run() { RebalanceUtil.scheduleOnDemandPipeline(_manager.getClusterName(), 0L); }
Source:
<code>public void setup(final Optional<HasName> hasName) { this.metaData = new NameAndDataTypeHeaderMetaData(hasName, () -> hasTypeRef, clearDisplayNameConsumer, setDisplayNameConsumer, setTypeRefConsumer, cellEditorControls, headerEditor, EDITOR_TITLE) { @Override public String getColumnGroup() { return NAME_DATA_TYPE_COLUMN_GROUP; } <START> @Override <END> public Optional<String> getPlaceHolder() { return Optional.of("placeholder"); } }; }</code><technical_language>is this explicitly needed? super class returns Optional.empty()</technical_language>

Target:
public void setup(final Optional<HasName> hasName) { this.metaData = new NameAndDataTypeHeaderMetaData(hasName, () -> hasTypeRef, clearDisplayNameConsumer, setDisplayNameConsumer, setTypeRefConsumer, cellEditorControls, headerEditor, EDITOR_TITLE) { @Override public String getColumnGroup() { return NAME_DATA_TYPE_COLUMN_GROUP; } @Override public Optional<String> getPlaceHolder() { return Optional.of(PLACEHOLDER); } }; }
Source:
<code>public void validUsualEmail_shouldPass() throws Exception { User user = Users.signUpAndSignIn(); <START> user.setEmail(randomAlphanumeric(8) + "@" + "jtalks"); <END> Users.editProfile(user); }</code><technical_language>If check valid format - correct domain name like: user.setEmail(randomAlphanumeric(8) + "@" + "jtalks.org");</technical_language>

Target:
public void validUsualEmail_shouldPass() throws Exception { User user = Users.signUpAndSignIn(); user.setEmail(randomAlphanumeric(8) + "@" + "jtalks.org"); Users.editProfile(user); }
Source:
<code>public boolean needsFuel() { ItemStack fuel = getStackInSlot(SLOT_INPUT); <START> return InvTools.isEmpty(fuel) || sizeOf(fuel) < 8; <END> }</code><technical_language>In Blast Furnace removed isEmpty() check, it</technical_language>

Target:
public boolean needsFuel() { ItemStack fuel = getStackInSlot(SLOT_INPUT); return sizeOf(fuel) < 8; }
Source:
<code>private void mapNetworkConnectionChanged() { if (getActivity().getFilesDir() == null) { showMapNotAvailableMessage(NoMapAvailableMessage.eNoMapDueToNoAccessibleStorage); return; } mMap.post(mCoverageUrlQuery); ConnectivityManager cm = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE); <START> boolean hasNetwork = cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnectedOrConnecting(); <END> if (!hasNetwork) { showMapNotAvailableMessage(NoMapAvailableMessage.eNoMapDueToNoInternet); return; } showMapNotAvailableMessage(NoMapAvailableMessage.eHideNoMapMessage); NetworkInfo info = cm.getActiveNetworkInfo(); setHighBandwidthMap(info.getType() == ConnectivityManager.TYPE_WIFI); }</code><technical_language>L324 L333,334 racy. cm.getActiveNetworkInfo().isConnectedOrConnecting() kind of network connection including cellular is established. L333,334 checks active network is Wifi. If network connection is flapping wifi cellular, this set high res map on. change isConnectedOrConnecting() isConnected() minimize impact of network flapping, move info check L333 immediately L324</technical_language>

Target:
private void mapNetworkConnectionChanged() { if (getActivity().getFilesDir() == null) { showMapNotAvailableMessage(NoMapAvailableMessage.eNoMapDueToNoAccessibleStorage); return; } mMap.post(mCoverageUrlQuery); final ConnectivityManager cm = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE); final NetworkInfo info = cm.getActiveNetworkInfo(); final boolean hasNetwork = (info != null) && cm.getActiveNetworkInfo().isConnected(); final boolean hasWifi = (info != null) && (info.getType() == ConnectivityManager.TYPE_WIFI); if (!hasNetwork) { showMapNotAvailableMessage(NoMapAvailableMessage.eNoMapDueToNoInternet); return; } showMapNotAvailableMessage(NoMapAvailableMessage.eHideNoMapMessage); setHighBandwidthMap(hasWifi); }
Source:
<code>public SerialWorker( final List<String> queueNameList, final Client client, final String workerName, final int intervalInSeconds) { Preconditions.checkArgument( (null != queueNameList) && (!queueNameList.isEmpty()), "empty queue list provided"); Preconditions.checkArgument( null != client, "null client provided"); Preconditions.checkArgument( intervalInSeconds > 0, "only positive vlaue for intervalInSecods allowed"); this.client = client; this.intervalInSeconds = intervalInSeconds; if (Strings.isNullOrEmpty(workerName)) { this.setWorkerName(this.client.workerName()); } else { this.setWorkerName(workerName + "-" + this.client.workerName()); } for (final String queueName : queueNameList) { <START> this.queues.add(this.client.getQueues().get(queueName)); <END> } if (this.queues.isEmpty()) { throw new QlessException("empty queue list for the worker"); } else { this.queueItor = this.queues.iterator(); LOGGER.info("initialize worker"); } }</code><technical_language>sense for Client provide a getQueue method this delegation</technical_language>

Target:
public SerialWorker( final List<String> queueNameList, final Client client, final String workerName, final int intervalInSeconds) { Preconditions.checkArgument( (null != queueNameList) && (!queueNameList.isEmpty()), "empty queue list provided"); Preconditions.checkArgument( null != client, "null client provided"); Preconditions.checkArgument( intervalInSeconds > 0, "only positive value for intervalInSeconds allowed"); this.client = client; this.intervalInSeconds = intervalInSeconds; if (Strings.isNullOrEmpty(workerName)) { this.setWorkerName(this.client.workerName()); } else { this.setWorkerName(workerName + "-" + this.client.workerName()); } for (final String queueName : queueNameList) { this.queues.add(this.client.getQueue(queueName)); } if (this.queues.isEmpty()) { throw new QlessException("empty queue list for the worker"); } else { this.queueIter = this.queues.iterator(); LOGGER.info("initialize worker"); } }
Source:
<code>public AvroServiceImpl(Collection<AvroReplacementDescriptor> replacements, Map<Class<?>, Class<AvroSchemaFactory<?>>> factories) { this.replacements = new ArrayList<>(replacements); this.factories = new HashMap<>(factories); <START> this.replacements.sort(null); <END> createContext(); }</code><technical_language>do Comparator.naturalOrder() instead of null</technical_language>

Target:
public AvroServiceImpl(Collection<AvroReplacementDescriptor> replacements, Map<Class<?>, Class<AvroSchemaFactory<?>>> factories) { this.replacements = new ArrayList<>(replacements); this.factories = new HashMap<>(factories); this.replacements.sort(Comparator.naturalOrder()); createContext(); }
Source:
<code>public DevicePolice(RobotAssertionManager assertionManager) { this.assertionManager = assertionManager; <START> registeredDevices = new ArrayList<String>(); <END> }</code><technical_language>LinkedList</technical_language>

Target:
public DevicePolice(RobotAssertionManager assertionManager) { this.assertionManager = assertionManager; registeredDevices = new LinkedList<String>(); }
Source:
<code>private NodeState getLocalNodeState(Set<String> allServers, Set<String> allConnectedNodes, long epoch, SequencerMetrics sequencerMetrics) { <START> Map<String, Boolean> connectivity = allServers <END> .stream() .collect(Collectors.toMap(Function.identity(), allConnectedNodes::contains)); NodeConnectivity localConnectivity = NodeConnectivity.builder() .endpoint(localEndpoint) .type(NodeConnectivityType.CONNECTED) .connectivity(ImmutableMap.copyOf(connectivity)) .build(); return NodeState.builder() .connectivity(localConnectivity) .heartbeat(new HeartbeatTimestamp(epoch, heartbeatCounter.incrementHeartbeat())) .sequencerMetrics(sequencerMetrics) .build(); }</code><technical_language>I do understand this . please explain intention. is this map representing</technical_language>

Target:
private NodeState getLocalNodeState(Set<String> allServers, Set<String> allConnectedNodes, long epoch, SequencerMetrics sequencerMetrics) { Map<String, ConnectionStatus> connectivity = new HashMap<>(); allServers.forEach(server -> { connectivity.put(server, ConnectionStatus.fromBool(allConnectedNodes.contains(server))); }); NodeConnectivity localConnectivity = NodeConnectivity.connectivity( localEndpoint, ImmutableMap.copyOf(connectivity) ); return NodeState.builder() .connectivity(localConnectivity) .heartbeat(new HeartbeatTimestamp(epoch, heartbeatCounter.incrementHeartbeat())) .sequencerMetrics(sequencerMetrics) .build(); }
Source:
<code>public static VmDevice addManagedDevice(VmDeviceId id, VmDeviceGeneralType type, VmDeviceType device, Map<String, Object> specParams, boolean is_plugged, Boolean isReadOnly, Map<String, String> customProp, boolean isUsingScsiReservation) { VmDevice managedDevice = new VmDevice(id, type, device.getName(), "", 0, specParams, true, is_plugged, isReadOnly, "", customProp, null, null, isUsingScsiReservation); dao.save(managedDevice); if (type == VmDeviceGeneralType.DISK || type == VmDeviceGeneralType.INTERFACE) { <START> VmBase vmBase = DbFacade.getInstance().getVmStaticDao().get(managedDevice.getId().getVmId()); <END> updateBootOrderInVmDeviceAndStoreToDB(vmBase); } return managedDevice; }</code><technical_language>part changed</technical_language>

Target:
public static VmDevice addManagedDevice(VmDeviceId id, VmDeviceGeneralType type, VmDeviceType device, Map<String, Object> specParams, boolean is_plugged, Boolean isReadOnly, Map<String, String> customProp, boolean isUsingScsiReservation) { VmDevice managedDevice = new VmDevice(id, type, device.getName(), "", 0, specParams, true, is_plugged, isReadOnly, "", customProp, null, null, isUsingScsiReservation); dao.save(managedDevice); if (type == VmDeviceGeneralType.DISK || type == VmDeviceGeneralType.INTERFACE) { VmBase vmBase = dbFacade.getVmStaticDao().get(id.getVmId()); updateBootOrderInVmDeviceAndStoreToDB(vmBase); } return managedDevice; }
Source:
<code>public void setup() { string1 = "string1"; string3 = "string3"; <START> inner = new PersistenceTestObjectInner(); <END> inner.setup(); }</code><technical_language>this object _PersistenceTestObjectInner_ is created in constructor</technical_language>

Target:
public void setup() { string1 = "string1"; string3 = "string3"; inner.setup(); }
Source:
<code>public synchronized static boolean canSystemGrantMemory(long xms, long xmx, long freeMemDecrAmt) throws Exception { if (!memCheckEnabled) { <START> throw new Exception("memory check is disabled"); <END> } if (freeMemAmount < LOW_MEM_THRESHOLD) { logger.info(String.format("Free memory amount (%d kb) is less than low mem threshold (%d kb), memory request declined.", freeMemAmount, LOW_MEM_THRESHOLD)); return false; } if (freeMemAmount >= LOW_MEM_THRESHOLD && freeMemAmount < 2 * LOW_MEM_THRESHOLD) { logger.info(String.format("Free memory amount (%d kb) is less than 2x low mem threshold (%d kb), re-read /proc/meminfo", freeMemAmount, LOW_MEM_THRESHOLD)); readMemoryInfoFile(); } if (freeMemAmount < LOW_MEM_THRESHOLD) { logger.info(String.format("Free memory amount (%d kb) is less than low mem threshold (%d kb), memory request declined.", freeMemAmount, LOW_MEM_THRESHOLD)); return false; } if (freeMemAmount - xmx < LOW_MEM_THRESHOLD) { logger.info(String.format("Free memory amount minus xmx (%d - %d kb) is less than low mem threshold (%d kb), memory request declined.", freeMemAmount, xmx, LOW_MEM_THRESHOLD)); return false; } if (freeMemDecrAmt > 0) { freeMemAmount -= freeMemDecrAmt; logger.info(String.format("Memory (%d kb) granted. Current free memory amount is %d kb", freeMemDecrAmt, freeMemAmount)); } else { freeMemAmount -= xms; logger.info(String.format("Memory (%d kb) granted. Current free memory amount is %d kb", xms, freeMemAmount)); } return true; }</code><technical_language>this change</technical_language>

Target:
public synchronized static boolean canSystemGrantMemory(long xms, long xmx, long freeMemDecrAmt) { if (!memCheckEnabled) { return true; } if (freeMemAmount < LOW_MEM_THRESHOLD) { logger.info(String.format("Free memory amount (%d kb) is less than low mem threshold (%d kb), memory request declined.", freeMemAmount, LOW_MEM_THRESHOLD)); return false; } if (freeMemAmount >= LOW_MEM_THRESHOLD && freeMemAmount < 2 * LOW_MEM_THRESHOLD) { logger.info(String.format("Free memory amount (%d kb) is less than 2x low mem threshold (%d kb), re-read /proc/meminfo", freeMemAmount, LOW_MEM_THRESHOLD)); readMemoryInfoFile(); } if (freeMemAmount < LOW_MEM_THRESHOLD) { logger.info(String.format("Free memory amount (%d kb) is less than low mem threshold (%d kb), memory request declined.", freeMemAmount, LOW_MEM_THRESHOLD)); return false; } if (freeMemAmount - xmx < LOW_MEM_THRESHOLD) { logger.info(String.format("Free memory amount minus xmx (%d - %d kb) is less than low mem threshold (%d kb), memory request declined.", freeMemAmount, xmx, LOW_MEM_THRESHOLD)); return false; } if (freeMemDecrAmt > 0) { freeMemAmount -= freeMemDecrAmt; logger.info(String.format("Memory (%d kb) granted. Current free memory amount is %d kb", freeMemDecrAmt, freeMemAmount)); } else { freeMemAmount -= xms; logger.info(String.format("Memory (%d kb) granted. Current free memory amount is %d kb", xms, freeMemAmount)); } return true; }
Source:
<code>private boolean shouldAskOverlayPermission(){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if(SalesforceReactActivity.this.getReactNativeHost().getReactInstanceManager().getDevSupportManager().getDevSupportEnabled()){ <START> if (!Settings.canDrawOverlays(this)) { <END> return true; } } } return false; }</code><technical_language>is code prompt user grant permission</technical_language>

Target:
private boolean shouldAskOverlayPermission(){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if(SalesforceReactActivity.this.getReactNativeHost().getReactInstanceManager().getDevSupportManager().getDevSupportEnabled()){ if (!Settings.canDrawOverlays(this)) { showPermissionWarning(); return true; } else{ hidePermissionWarning(); } } } return false; }
Source:
<code><START> private boolean shouldReassignMac(VmNetworkInterface iface) { <END> return (getParameters().isReassignBadMacs() && vNicHasBadMac(iface)) || getParameters().isImportAsNewEntity() || StringUtils.isEmpty(iface.getMacAddress()); }</code><technical_language>This patch introduces a small regression. Previously (at intention), if importedVm empty mac, engine assign a new one. if failed (the free macs in pool), exception. mac left empty. in this case exception. Please verify Dan is ok new behaviour. If not, this small regression fixed</technical_language>

Target:
private boolean shouldReassignMac(VmNetworkInterface iface) { return StringUtils.isEmpty(iface.getMacAddress()) || (getParameters().isReassignBadMacs() && vNicHasBadMac(iface)) || getParameters().isImportAsNewEntity(); }
Source:
<code>public void setup() throws ClientException { <START> client = new Client(getPublicKey(), getSecretKey()); <END> }</code><technical_language>move Client initialize BaseLiveTest re-use in other test classes</technical_language>

Target:
public void setup() throws Exception { client = getLiveClient(); }
Source:
<code>private static Properties loadProps() { String registryClassProp = System.getProperty(REGISTRY_CLASS_PROP); String registryNameProp = System.getProperty(REGISTRY_NAME_PROP); <START> String defaultRegistryName = System.getProperty(DEFAULT_REGISTRY_NAME); <END> String registryJmxNameProp = System.getProperty(REGISTRY_JMX_NAME_PROP); Properties props = new Properties(); if (registryClassProp != null) { props.setProperty(REGISTRY_CLASS_PROP, registryClassProp); } if (registryNameProp != null) { props.setProperty(REGISTRY_NAME_PROP, registryNameProp); } if (defaultRegistryName != null) { props.setProperty(DEFAULT_REGISTRY_NAME, defaultRegistryName); } if (registryJmxNameProp != null) { props.setProperty(REGISTRY_JMX_NAME_PROP, registryJmxNameProp); } return props; }</code><technical_language>missed this previous pass. DEFAULT_REGISTRY_NAME is default for REGISTRY_NAME_PROP this line removed line 124 String registryNameProp = System.getProperty(REGISTRY_NAME_PROP, DEFAULT_REGISTRY_NAME);</technical_language>

Target:
private static Properties loadProps() { String registryClassProp = System.getProperty(REGISTRY_CLASS_PROP); String registryNameProp = System.getProperty(REGISTRY_NAME_PROP); String registryJmxNameProp = System.getProperty(REGISTRY_JMX_NAME_PROP); Properties props = new Properties(); if (registryClassProp != null) { props.setProperty(REGISTRY_CLASS_PROP, registryClassProp); } if (registryNameProp != null) { props.setProperty(REGISTRY_NAME_PROP, registryNameProp); } if (registryJmxNameProp != null) { props.setProperty(REGISTRY_JMX_NAME_PROP, registryJmxNameProp); } return props; }
Source:
<code>public void run() { MembersView newMembersView = decideNewMembersView(localMemberMap, membersToAsk); clusterServiceLock.lock(); try { if (!clusterService.isJoined()) { if (logger.isFineEnabled()) { logger.fine("Ignoring decided members view after mastership claim: " + newMembersView + ", because not joined!"); } return; } MemberImpl localMember = clusterService.getLocalMember(); if (!newMembersView.containsMember(localMember.getAddress(), localMember.getUuid())) { if (logger.isFineEnabled()) { logger.fine("Ignoring decided members view after mastership claim: " + newMembersView + ", because current local member: " + localMember + " not in decided members view."); } return; } updateMembers(newMembersView); clusterService.getClusterJoinManager().reset(); sendMemberListToOthers(); logger.info("Mastership is claimed with: " + newMembersView); <START> node.getNodeExtension().scheduleClusterVersionAutoUpgrade(); <END> } finally { clusterServiceLock.unlock(); } }</code><technical_language>this superfluous here, updateMembers(newMembersView) invoke scheduleClusterVersionAutoUpgrade</technical_language>

Target:
public void run() { MembersView newMembersView = decideNewMembersView(localMemberMap, membersToAsk); clusterServiceLock.lock(); try { if (!clusterService.isJoined()) { if (logger.isFineEnabled()) { logger.fine("Ignoring decided members view after mastership claim: " + newMembersView + ", because not joined!"); } return; } MemberImpl localMember = clusterService.getLocalMember(); if (!newMembersView.containsMember(localMember.getAddress(), localMember.getUuid())) { if (logger.isFineEnabled()) { logger.fine("Ignoring decided members view after mastership claim: " + newMembersView + ", because current local member: " + localMember + " not in decided members view."); } return; } updateMembers(newMembersView); clusterService.getClusterJoinManager().reset(); sendMemberListToOthers(); logger.info("Mastership is claimed with: " + newMembersView); } finally { clusterServiceLock.unlock(); } }
Source:
<code>public void pruneQueryInfo() { Optional<QueryInfo> finalInfo = finalQueryInfo.get(); if (!finalInfo.isPresent() || !finalInfo.get().getOutputStage().isPresent()) { return; } QueryInfo queryInfo = finalInfo.get(); StageInfo outputStage = queryInfo.getOutputStage().get(); StageInfo prunedOutputStage = new StageInfo( outputStage.getStageId(), outputStage.getState(), outputStage.getSelf(), null, outputStage.getTypes(), outputStage.getStageStats(), ImmutableList.of(), ImmutableList.of(), outputStage.getFailureCause()); QueryInfo prunedQueryInfo = new QueryInfo( queryInfo.getQueryId(), queryInfo.getSession(), queryInfo.getState(), getMemoryPool().getId(), queryInfo.isScheduled(), queryInfo.getSelf(), queryInfo.getFieldNames(), queryInfo.getQuery(), pruneQueryStats(queryInfo.getQueryStats()), queryInfo.getSetCatalog(), queryInfo.getSetSchema(), queryInfo.getSetSessionProperties(), queryInfo.getResetSessionProperties(), queryInfo.getAddedPreparedStatements(), queryInfo.getDeallocatedPreparedStatements(), queryInfo.getStartedTransactionId(), queryInfo.isClearTransactionId(), queryInfo.getUpdateType(), Optional.of(prunedOutputStage), queryInfo.getFailureInfo(), <START> queryInfo.getErrorCode(), queryInfo.getWarnings(), <END> queryInfo.getInputs(), queryInfo.getOutput(), queryInfo.getPlan(), queryInfo.isCompleteInfo(), queryInfo.getResourceGroupName()); finalQueryInfo.compareAndSet(finalInfo, Optional.of(prunedQueryInfo)); }</code><technical_language>newline</technical_language>

Target:
public void pruneQueryInfo() { Optional<QueryInfo> finalInfo = finalQueryInfo.get(); if (!finalInfo.isPresent() || !finalInfo.get().getOutputStage().isPresent()) { return; } QueryInfo queryInfo = finalInfo.get(); StageInfo outputStage = queryInfo.getOutputStage().get(); StageInfo prunedOutputStage = new StageInfo( outputStage.getStageId(), outputStage.getState(), outputStage.getSelf(), null, outputStage.getTypes(), outputStage.getStageStats(), ImmutableList.of(), ImmutableList.of(), outputStage.getFailureCause()); QueryInfo prunedQueryInfo = new QueryInfo( queryInfo.getQueryId(), queryInfo.getSession(), queryInfo.getState(), getMemoryPool().getId(), queryInfo.isScheduled(), queryInfo.getSelf(), queryInfo.getFieldNames(), queryInfo.getQuery(), pruneQueryStats(queryInfo.getQueryStats()), queryInfo.getSetCatalog(), queryInfo.getSetSchema(), queryInfo.getSetPath(), queryInfo.getSetSessionProperties(), queryInfo.getResetSessionProperties(), queryInfo.getAddedPreparedStatements(), queryInfo.getDeallocatedPreparedStatements(), queryInfo.getStartedTransactionId(), queryInfo.isClearTransactionId(), queryInfo.getUpdateType(), Optional.of(prunedOutputStage), queryInfo.getFailureInfo(), queryInfo.getErrorCode(), queryInfo.getWarnings(), queryInfo.getInputs(), queryInfo.getOutput(), queryInfo.isCompleteInfo(), queryInfo.getResourceGroupId()); finalQueryInfo.compareAndSet(finalInfo, Optional.of(prunedQueryInfo)); }
Source:
<code>public DirectCompilerResult visitExpressionList(FEEL_1_1Parser.ExpressionListContext ctx) { List<DirectCompilerResult> exprs = new ArrayList<>(); for (int i = 0; i < ctx.getChildCount(); i++) { if (ctx.getChild(i) instanceof FEEL_1_1Parser.ExpressionContext) { FEEL_1_1Parser.ExpressionContext childCtx = (FEEL_1_1Parser.ExpressionContext) ctx.getChild(i); DirectCompilerResult child = visit(childCtx); if (!replaceEqualForUnaryTest) { exprs.add(child); } else { if (child.resultType == BuiltInType.UNARY_TEST) { exprs.add(child); } else if (child.resultType == BuiltInType.RANGE) { DirectCompilerResult replaced = createUnaryTestExpression(childCtx, child, UnaryOperator.IN); exprs.add(replaced); <START> } else if (child.resultType == BuiltInType.BOOLEAN) { <END> DirectCompilerResult replaced = createUnaryTestExpression(childCtx, child, UnaryOperator.TEST); exprs.add(replaced); } else { DirectCompilerResult replaced = createUnaryTestExpression(childCtx, child, UnaryOperator.EQ); exprs.add(replaced); } } } } MethodCallExpr list = new MethodCallExpr(null, "list"); exprs.stream().map(DirectCompilerResult::getExpression).forEach(list::addArgument); return DirectCompilerResult.of(list, BuiltInType.LIST, DirectCompilerResult.mergeFDs(exprs.toArray(new DirectCompilerResult[]{}))); }</code><technical_language>Sorry, convided this work in cases --can please check child.expression contains a JavaParser.NameExpr for "?" well? is easy determine type of result, BuiltinType.ANY match</technical_language>

Target:
public DirectCompilerResult visitExpressionList(FEEL_1_1Parser.ExpressionListContext ctx) { List<DirectCompilerResult> exprs = new ArrayList<>(); for (int i = 0; i < ctx.getChildCount(); i++) { if (ctx.getChild(i) instanceof FEEL_1_1Parser.ExpressionContext) { FEEL_1_1Parser.ExpressionContext childCtx = (FEEL_1_1Parser.ExpressionContext) ctx.getChild(i); DirectCompilerResult child = visit(childCtx); exprs.add(child); } } MethodCallExpr list = new MethodCallExpr(null, "list"); exprs.stream().map(DirectCompilerResult::getExpression).forEach(list::addArgument); return DirectCompilerResult.of(list, BuiltInType.LIST, DirectCompilerResult.mergeFDs(exprs.toArray(new DirectCompilerResult[]{}))); }
Source:
<code>private void replaceThing(Thing oldThing, Thing newThing) { <START> final ThingHandler thingHandler = thingHandlers.get(newThing.getUID()); <END> if (oldThing != newThing) { this.things.remove(oldThing); this.things.add(newThing); if (thingHandler != null) { newThing.setHandler(thingHandler); } if (oldThing != null) { oldThing.setHandler(null); } } }</code><technical_language>If is do if oldThing == newThing, moving this line if branch, is executed if necessary</technical_language>

Target:
private ThingHandler replaceThing(Thing oldThing, Thing newThing) { final ThingHandler thingHandler = thingHandlers.get(newThing.getUID()); if (oldThing != newThing) { this.things.remove(oldThing); this.things.add(newThing); if (thingHandler != null) { newThing.setHandler(thingHandler); } if (oldThing != null) { oldThing.setHandler(null); } } return thingHandler; }
Source:
<code>private boolean fetchJobResult(int rows, TDJobOperator job) <START> { <END> Optional<ArrayValue> firstRow = job.getResult(ite -> ite.hasNext() ? Optional.of(ite.next()) : Optional.absent()); if (!firstRow.isPresent()) { throw new RuntimeException("Got unexpected empty result for count job: " + job.getJobId()); } ArrayValue row = firstRow.get(); if (row.size() != 1) { throw new RuntimeException("Got unexpected result row size for count job: " + row.size()); } Value count = row.get(0); IntegerValue actualRows; try { actualRows = count.asIntegerValue(); } catch (MessageTypeCastException e) { throw new RuntimeException("Got unexpected value type count job: " + count.getValueType()); } return BigInteger.valueOf(rows).compareTo(actualRows.asBigInteger()) <= 0; }</code><technical_language>I check status != TDJob.Status.SUCCESS (as TdWaitOperatorFactory.fetchJobResult does). This code throws unexpected empty result for count job is unexpected. throw TaskExecutionException execution log of job job failed</technical_language>

Target:
private boolean fetchJobResult(int rows, TDJobOperator job) { Optional<ArrayValue> firstRow = job.getResult(ite -> ite.hasNext() ? Optional.of(ite.next()) : Optional.absent()); if (!firstRow.isPresent()) { throw new TaskExecutionException("Got unexpected empty result for count job: " + job.getJobId(), ConfigElement.empty()); } ArrayValue row = firstRow.get(); if (row.size() != 1) { throw new TaskExecutionException("Got unexpected result row size for count job: " + row.size(), ConfigElement.empty()); } Value count = row.get(0); IntegerValue actualRows; try { actualRows = count.asIntegerValue(); } catch (MessageTypeCastException e) { throw new TaskExecutionException("Got unexpected value type count job: " + count.getValueType(), ConfigElement.empty()); } return BigInteger.valueOf(rows).compareTo(actualRows.asBigInteger()) <= 0; }
Source:
<code>public static FluidAttributes createVanillaFluidAttributes(Fluid fluid) { if (fluid instanceof EmptyFluid) return net.minecraftforge.fluids.FluidAttributes.builder(fluid, new net.minecraft.util.ResourceLocation("white"), new net.minecraft.util.ResourceLocation("white")) .translationKey("block.minecraft.air") <START> .color(0).density(0).temperature(0).luminosity(0).viscosity(0).density(0).build(); <END> if (fluid instanceof WaterFluid) return net.minecraftforge.fluids.FluidAttributes.Water.builder(fluid, new net.minecraft.util.ResourceLocation("block/water_still"), new net.minecraft.util.ResourceLocation("block/water_flow")) .overlay(new net.minecraft.util.ResourceLocation("block/water_overlay")) .translationKey("block.minecraft.water") .color(0x3F76E4).build(); if (fluid instanceof LavaFluid) return net.minecraftforge.fluids.FluidAttributes.builder(fluid, new net.minecraft.util.ResourceLocation("block/lava_still"), new net.minecraft.util.ResourceLocation("block/lava_flow")) .translationKey("block.minecraft.lava") .luminosity(15).density(3000).viscosity(6000).temperature(1300).build(); throw new RuntimeException("Mod fluids must override createAttributes."); }</code><technical_language>Densty is set in this line</technical_language>

Target:
public static FluidAttributes createVanillaFluidAttributes(Fluid fluid) { if (fluid instanceof EmptyFluid) return net.minecraftforge.fluids.FluidAttributes.builder( new net.minecraft.util.ResourceLocation("white"), new net.minecraft.util.ResourceLocation("white")) .translationKey("block.minecraft.air") .color(0).density(0).temperature(0).luminosity(0).viscosity(0).build(fluid); if (fluid instanceof WaterFluid) return net.minecraftforge.fluids.FluidAttributes.Water.builder( new net.minecraft.util.ResourceLocation("block/water_still"), new net.minecraft.util.ResourceLocation("block/water_flow")) .overlay(new net.minecraft.util.ResourceLocation("block/water_overlay")) .translationKey("block.minecraft.water") .color(0x3F76E4).build(fluid); if (fluid instanceof LavaFluid) return net.minecraftforge.fluids.FluidAttributes.builder( new net.minecraft.util.ResourceLocation("block/lava_still"), new net.minecraft.util.ResourceLocation("block/lava_flow")) .translationKey("block.minecraft.lava") .luminosity(15).density(3000).viscosity(6000).temperature(1300).build(fluid); throw new RuntimeException("Mod fluids must override createAttributes."); }
Source:
<code>static List<String> decodeAttributeValue(final String attributeValue) { <START> return ParsingUtils.split(attributeValue, VALUE_DELIMITER).stream(). <END> map(a -> { try { return URLDecoder.decode(a.trim(), "UTF-8"); } catch (final UnsupportedEncodingException ex) { throw new TribbleException("Error decoding attribute", ex); } }). collect(Collectors.toList()); }</code><technical_language>Streams overhead. I this is happen a lot I a loop instead</technical_language>

Target:
static List<String> decodeAttributeValue(final String attributeValue) { final List<String> splitValues = ParsingUtils.split(attributeValue, Gff3Constants.VALUE_DELIMITER); final List<String> decodedValues = new ArrayList<>(); for (final String encodedValue : splitValues) { try { decodedValues.add(URLDecoder.decode(encodedValue.trim(), "UTF-8")); } catch (final UnsupportedEncodingException ex) { throw new TribbleException("Error decoding attribute " + encodedValue, ex); } } return decodedValues; }
Source:
<code>public void handleAction(ActionParameters params) throws ActionException { params.requireLoggedInUser(); final long id = ConversionHelper.getLong(params.getHttpParam(PARAM_ID), -1); if(id == -1) { throw new ActionParamsException("Parameter missing or non-numeric: " + PARAM_ID + "=" + params.getHttpParam(PARAM_ID)); } final UserLayer userLayer = userLayerDbService.getUserLayerById(id); final UserLayerStyle style = new UserLayerStyle(); if(userLayer == null) { throw new ActionParamsException("Userlayer id doesn't exist: " + id); } if(!userLayer.isOwnedBy(params.getUser().getUuid())) { throw new ActionDeniedException("Userlayer belongs to another user"); } <START> userLayer.setLayer_name(params.getHttpParam(PARAM_NAME)); <END> userLayer.setLayer_desc(params.getHttpParam(PARAM_DESC)); userLayer.setLayer_source(params.getHttpParam(PARAM_SOURCE)); try { final JSONObject stylejs = JSONHelper .createJSONObject(params.getHttpParam(PARAM_STYLE)); style.setId(id); style.populateFromJSON(stylejs); } catch (JSONException e) { throw new ActionException("Unable to populate style from JSON", e); } userLayerDbService.updateUserLayerCols(userLayer); userLayerDbService.updateUserLayerStyleCols(style); JSONObject ulayer = userlayerService.parseUserLayer2JSON(userLayer); JSONObject permissions = OskariLayerWorker.getAllowedPermissions(); JSONHelper.putValue(ulayer, "permissions", permissions); ResponseHelper.writeResponse(params, ulayer); }</code><technical_language>If parameters set in request do want replace current values? If call userLayer.setLayer_name(params.getHttpParam(PARAM_NAME, userLayer.getLayer_name());</technical_language>

Target:
public void handleAction(ActionParameters params) throws ActionException { params.requireLoggedInUser(); final long id = params.getRequiredParamLong(PARAM_ID); final UserLayer userLayer = userLayerDbService.getUserLayerById(id); final UserLayerStyle style = new UserLayerStyle(); if(userLayer == null) { throw new ActionParamsException("Userlayer id doesn't exist: " + id); } if(!userLayer.isOwnedBy(params.getUser().getUuid())) { throw new ActionDeniedException("Userlayer belongs to another user"); } userLayer.setLayer_name(params.getRequiredParam(PARAM_NAME)); userLayer.setLayer_desc(params.getHttpParam(PARAM_DESC, userLayer.getLayer_desc())); userLayer.setLayer_source(params.getHttpParam(PARAM_SOURCE, userLayer.getLayer_source())); try { final JSONObject stylejs = JSONHelper .createJSONObject(params.getHttpParam(PARAM_STYLE)); style.setId(id); style.populateFromJSON(stylejs); } catch (JSONException e) { throw new ActionParamsException("Unable to populate style from JSON", e); } userLayerDbService.updateUserLayerCols(userLayer); userLayerDbService.updateUserLayerStyleCols(style); JSONObject ulayer = userlayerService.parseUserLayer2JSON(userLayer); JSONObject permissions = OskariLayerWorker.getAllowedPermissions(); JSONHelper.putValue(ulayer, "permissions", permissions); ResponseHelper.writeResponse(params, ulayer); }
Source:
<code>String getShortDescription() { if(shortDesc!=null) { return shortDesc; } String description=null; if(bundle!=null && bundle.getHeaders()!=null) { description = bundle.getHeaders().get(Constants.BUNDLE_DESCRIPTION); <START> } if(obrResource!=null && obrResource.getProperties()!=null) { <END> Object descrObj = obrResource.getProperties().get(Resource.DESCRIPTION); if(descrObj instanceof String) { description = (String)descrObj; } } if(description!=null) { if(description.length()>MAX_SHORT_DESCRIPTION_CHAR_COUNT) { StringBuilder shortDescBuilder = new StringBuilder(); for(String word : description.split(" ")) { if(shortDescBuilder.length()+word.length() < MAX_SHORT_DESCRIPTION_CHAR_COUNT) { shortDescBuilder.append(word); shortDescBuilder.append(" "); } else { shortDescBuilder.append(".."); break; } } shortDesc = shortDescBuilder.toString(); description = shortDesc; } return description; } else { return ""; } }</code><technical_language>is "else if"</technical_language>

Target:
public String getShortDescription() { if(shortDesc!=null) { return shortDesc; } String description=null; if(bundle!=null && bundle.getHeaders()!=null) { description = bundle.getHeaders().get(Constants.BUNDLE_DESCRIPTION); } else if(obrResource!=null && obrResource.getProperties()!=null) { Object descrObj = obrResource.getProperties().get(Resource.DESCRIPTION); if(descrObj instanceof String) { description = (String)descrObj; } } if(description!=null) { if(description.length()>MAX_SHORT_DESCRIPTION_CHAR_COUNT) { StringBuilder shortDescBuilder = new StringBuilder(); for(String word : description.split(" ")) { if(shortDescBuilder.length()+word.length() < MAX_SHORT_DESCRIPTION_CHAR_COUNT) { shortDescBuilder.append(word); shortDescBuilder.append(" "); } else { shortDescBuilder.append(".."); break; } } shortDesc = shortDescBuilder.toString(); description = shortDesc; } return description; } else { return ""; } }
Source:
<code>public com.azure.core.http.HttpClient build() { HttpClient nettyHttpClient; if (this.connectionProvider != null) { if (this.baseHttpClient != null) { throw logger.logExceptionAsError(new IllegalStateException("connectionProvider cannot be set on an " + "existing reactor netty HttpClient.")); } nettyHttpClient = HttpClient.create(this.connectionProvider); } else { nettyHttpClient = this.baseHttpClient == null ? HttpClient.create() : this.baseHttpClient; } Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; nettyHttpClient = nettyHttpClient .port(port) .wiretap(enableWiretap) .tcpConfiguration(tcpConfig -> { if (nioEventLoopGroup != null) { tcpConfig = tcpConfig.runOn(nioEventLoopGroup); } ProxyOptions buildProxyOptions = (proxyOptions == null) <START> ? ProxyOptions.loadFromEnvironment(buildConfiguration) <END> : proxyOptions; if (buildProxyOptions != null) { tcpConfig = tcpConfig.proxy(typeSpec -> typeSpec.type(mapProxyType(buildProxyOptions.getType(), logger)) .address(proxyOptions.getAddress()) .username(proxyOptions.getUsername()) .password(user -> proxyOptions.getPassword()) .nonProxyHosts(proxyOptions.getNonProxyHosts())); } return tcpConfig; }); return new NettyAsyncHttpClient(nettyHttpClient); }</code><technical_language>nit: loadFromConfiguration a name passing configuration this method (and configuration load data environment else)</technical_language>

Target:
public com.azure.core.http.HttpClient build() { HttpClient nettyHttpClient; if (this.connectionProvider != null) { if (this.baseHttpClient != null) { throw logger.logExceptionAsError(new IllegalStateException("connectionProvider cannot be set on an " + "existing reactor netty HttpClient.")); } nettyHttpClient = HttpClient.create(this.connectionProvider); } else { nettyHttpClient = this.baseHttpClient == null ? HttpClient.create() : this.baseHttpClient; } Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; nettyHttpClient = nettyHttpClient .port(port) .wiretap(enableWiretap) .tcpConfiguration(tcpConfig -> { if (nioEventLoopGroup != null) { tcpConfig = tcpConfig.runOn(nioEventLoopGroup); } ProxyOptions buildProxyOptions = (proxyOptions == null) ? ProxyOptions.fromConfiguration(buildConfiguration) : proxyOptions; if (buildProxyOptions != null) { tcpConfig = tcpConfig.proxy(typeSpec -> typeSpec.type(mapProxyType(buildProxyOptions.getType(), logger)) .address(proxyOptions.getAddress()) .username(proxyOptions.getUsername()) .password(user -> proxyOptions.getPassword()) .nonProxyHosts(proxyOptions.getNonProxyHosts())); } return tcpConfig; }); return new NettyAsyncHttpClient(nettyHttpClient); }
Source:
<code>public JMXConnectionTypeFragment() { providerMap = UIExtensionManager.getConnectionUIElements(); <START> childFragmentMap = new HashMap<String, WizardFragment>(); <END> }</code><technical_language>Optional more compact childFragmentMap = new HashMap<>(); BTW, creating attribute instead of constructor</technical_language>

Target:
public JMXConnectionTypeFragment() { providerMap = UIExtensionManager.getConnectionUIElements(); childFragmentMap = new HashMap<>(); }
Source:
<code>private BlobSoftRef getBlobSoftRef() { if (blobSoftRef == null) { try { <START> this.blobSoftRef = (BlobSoftRef) field.get(accessPath.apply(descriptor.getReferenceInstance())); <END> } catch (Exception e) { throw Exceptions.handle() .to(Mixing.LOG) .error(e) .withSystemErrorMessage( "Unable to obtain a BlobSoftRef object from entity ref field ('%s' in '%s'): %s (%s)", getName(), descriptor.getType().getName()) .handle(); } } return blobSoftRef; }</code><technical_language>suggestion blobSoftRef = (BlobSoftRef) field.get(accessPath.apply(descriptor.getReferenceInstance()));</technical_language>

Target:
private BlobSoftRef getBlobSoftRef() { if (blobSoftRef == null) { try { blobSoftRef = (BlobSoftRef) field.get(accessPath.apply(descriptor.getReferenceInstance())); } catch (Exception e) { throw Exceptions.handle() .to(Mixing.LOG) .error(e) .withSystemErrorMessage( "Unable to obtain a BlobSoftRef object from entity ref field ('%s' in '%s'): %s (%s)", getName(), descriptor.getType().getName()) .handle(); } } return blobSoftRef; }
Source:
<code>public void read1() { <START> for (int i = 0; i < 500000; i++) { <END> sum += d1.get(i); } }</code><technical_language>this count parameterized</technical_language>

Target:
public void read1() { for (int i = 0; i < values; i++) { sum += d1.get(i); } }