auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected List<ByteBuffer> getValues() { maybeRefreshValues(); List<ByteBuffer> bbs; if (parameterMode == null) { assert values.isEmpty(); return Collections.emptyList(); } switch (parameterMode) { case NAMED: if (values.isEmpty()) return Collections.emptyList(); bbs = newArrayListWithCapacity(values.size()); for (Value value : values.values()) { bbs.add(value.bytes); } return bbs; case POSITIONAL: if (values.isEmpty()) return Collections.emptyList(); int last = (Integer)(values.lastEntry().getKey()); bbs = newArrayListWithCapacity(last + 1); for (int i = 0; i <= last; i++) { Value value = values.get(i); <START> bbs.add(value == null ? BoundStatement.UNSET : value.bytes); <END> } return bbs; default: throw new AssertionError("Unsupported parameter mode " + parameterMode); } }</code><technical_language>Moving CBUtil</technical_language>

Target:
protected List<ByteBuffer> getValues() { maybeRefreshValues(); List<ByteBuffer> bbs; if (parameterMode == null) { assert values.isEmpty(); return Collections.emptyList(); } switch (parameterMode) { case NAMED: if (values.isEmpty()) return Collections.emptyList(); bbs = newArrayListWithCapacity(values.size()); for (Value value : values.values()) { bbs.add(value.bytes); } return bbs; case POSITIONAL: if (values.isEmpty()) return Collections.emptyList(); int last = (Integer)(values.lastEntry().getKey()); bbs = newArrayListWithCapacity(last + 1); for (int i = 0; i <= last; i++) { Value value = values.get(i); bbs.add(value == null ? CBUtil.UNSET_VALUE : value.bytes); } return bbs; default: throw new AssertionError("Unsupported parameter mode " + parameterMode); } }
Source:
<code>private <T> List<T> getEntities(WebTarget target, Class<T> clazz) { List<T> entities = new ArrayList<T>(); Response responseObject = target.request(MediaType.APPLICATION_JSON_TYPE).get(); try { String response = responseObject.readEntity(String.class); int responseCode = getResponseCode(response); <START> if (responseCode == CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND.getCode() <END> | responseCode == CatalogResponse.ResponseMessage.EXCEPTION.getCode()) { throw new RuntimeException("Error occurred :"+ getResponseMessage(response)); } ObjectMapper mapper = new ObjectMapper(); JsonNode node = mapper.readTree(response); Iterator<JsonNode> it = node.get("entities").elements(); while (it.hasNext()) { entities.add(mapper.treeToValue(it.next(), clazz)); } } catch (Exception ex) { throw new RuntimeException(ex); } return entities; }</code><technical_language>other error status codes in ResponseMessage, put responseCode != CatalogResponse.ResponseMessage.SUCCESS.getCode()</technical_language>

Target:
private <T> List<T> getEntities(WebTarget target, Class<T> clazz) { List<T> entities = new ArrayList<T>(); Response responseObject = target.request(MediaType.APPLICATION_JSON_TYPE).get(); try { String response = responseObject.readEntity(String.class); int responseCode = getResponseCode(response); if (responseCode != CatalogResponse.ResponseMessage.SUCCESS.getCode()) { throw new RuntimeException("Error occurred :"+ getResponseMessage(response)); } ObjectMapper mapper = new ObjectMapper(); JsonNode node = mapper.readTree(response); Iterator<JsonNode> it = node.get("entities").elements(); while (it.hasNext()) { entities.add(mapper.treeToValue(it.next(), clazz)); } } catch (IOException ex) { throw new RuntimeException(ex); } return entities; }
Source:
<code>public void process(byte[] data, int off, int len, byte[] iv) { F8Context f8ctx = new F8Context(); f8ctx.ivAccent = new byte[BLKLEN]; cipher.init(true, new KeyParameter(maskedKey)); cipher.processBlock(iv, 0, f8ctx.ivAccent, 0); <START> cipher.init(true, new KeyParameter(encKey)); <END> f8ctx.J = 0; f8ctx.S = new byte[BLKLEN]; Arrays.fill(f8ctx.S, (byte) 0); int inLen = len; while (inLen >= BLKLEN) { processBlock(f8ctx, data, off, data, off, BLKLEN); inLen -= BLKLEN; off += BLKLEN; } if (inLen > 0) { processBlock(f8ctx, data, off, data, off, inLen); } }</code><technical_language>Ah, I it. late yesterday :-)</technical_language>

Target:
public void process(byte[] data, int off, int len, byte[] iv) { if (iv.length != BLKLEN) throw new IllegalArgumentException("iv.length != BLKLEN"); if (off < 0) throw new IllegalArgumentException("off < 0"); if (len < 0) throw new IllegalArgumentException("len < 0"); if (off + len > data.length) throw new IllegalArgumentException("off + len > data.length"); F8Context f8ctx = new F8Context(); f8ctx.ivAccent = new byte[BLKLEN]; cipher.init(true, new KeyParameter(maskedKey)); cipher.processBlock(iv, 0, f8ctx.ivAccent, 0); cipher.init(true, new KeyParameter(encKey)); f8ctx.J = 0; f8ctx.S = new byte[BLKLEN]; Arrays.fill(f8ctx.S, (byte) 0); int inLen = len; while (inLen >= BLKLEN) { processBlock(f8ctx, data, off, BLKLEN); inLen -= BLKLEN; off += BLKLEN; } if (inLen > 0) { processBlock(f8ctx, data, off, inLen); } }
Source:
<code>public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { Player p = (Player) sender; <START> <END> if (cooldown.contains(p)) { p.sendMessage(ChatColor.RED + "You must wait 10 minutes to make another advertisement."); return true; } if (args.length < 1) { return false; } String message = StringUtils.join(args, " ", 0, args.length); Bukkit.broadcastMessage(ChatColor.GREEN + "[Advertisement] " + ChatColor.GOLD + sender.getName() + ChatColor.GREEN + "] " + ChatColor.DARK_GREEN + message); cooldown.add(p); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { public void run() { p.sendMessage(ChatColor.GRAY + "You may now make another advertisement."); cooldown.remove(p); } }, 600L * 20L); }</code><technical_language>playerSender</technical_language>

Target:
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (cooldown.contains(playerSender)) { msg("You must wait 10 minutes to make another advertisement."); return true; } if (args.length == 0) { return false; } String message = StringUtils.join(args, " ", 0, args.length); Bukkit.broadcastMessage(ChatColor.GREEN + "[Advertisement] " + ChatColor.GOLD + sender.getName() + ChatColor.GREEN + "> " + ChatColor.DARK_GREEN + message); cooldown.add(playerSender); Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { public void run() { msg("You may now make another advertisement."); cooldown.remove(playerSender); } }, 600L * 20L); }
Source:
<code>public static ImageFileType map(org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageFileType, ImageFileType template) { switch (imageFileType) { case Unknown: return ImageFileType.UNKNOWN; case ISO: return ImageFileType.ISO; case Floppy: return ImageFileType.FLOPPY; case Disk: return ImageFileType.DISK; case All: return ImageFileType.ALL; <START> default: return null; <END> } }</code><technical_language>I if more sense default Unknown</technical_language>

Target:
public static ImageFileType map(org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageFileType, ImageFileType template) { switch (imageFileType) { case ISO: return ImageFileType.ISO; case Floppy: return ImageFileType.FLOPPY; case Disk: return ImageFileType.DISK; case All: return ImageFileType.ALL; default: return ImageFileType.UNKNOWN; } }
Source:
<code>public void afterPropertiesSet() throws Exception { ReflectionUtils.doWithMethods(type, new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException { try { Input input = AnnotationUtils.findAnnotation(method, Input.class); if (input != null) { String name = BindingBeanDefinitionRegistryUtils.getChannelName(input, method); MessageChannel sharedChannel = locateSharedChannel(name); if (sharedChannel == null) { inputHolders.put(name, new ChannelHolder( channelFactory.createBindableChannel(name, <START> (Class<? extends MessageChannel>)method.getReturnType()), true)); <END> } else { configureSharedMessageChannel(name, (Class<? extends MessageChannel>) method.getReturnType(), sharedChannel); } } } catch (Exception e) { throw new RuntimeException(e); } } }); ReflectionUtils.doWithMethods(type, new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException { try { Output output = AnnotationUtils.findAnnotation(method, Output.class); if (output != null) { String name = BindingBeanDefinitionRegistryUtils.getChannelName(output, method); MessageChannel sharedChannel = locateSharedChannel(name); if (sharedChannel == null) { outputHolders.put(name, new ChannelHolder( channelFactory.createBindableChannel(name, (Class<? extends MessageChannel>) method.getReturnType()), true)); } else { configureSharedMessageChannel(name, (Class<? extends MessageChannel>)method.getReturnType(), sharedChannel); } } } catch (Exception e) { throw new RuntimeException(e); } } }); }</code><technical_language>space cast parens</technical_language>

Target:
public void afterPropertiesSet() throws Exception { ReflectionUtils.doWithMethods(type, new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException { Input input = AnnotationUtils.findAnnotation(method, Input.class); if (input != null) { String name = BindingBeanDefinitionRegistryUtils.getChannelName(input, method); Class<? extends MessageChannel> channelType = (Class<? extends MessageChannel>) method.getReturnType(); MessageChannel sharedChannel = locateSharedChannel(name); if (sharedChannel == null) { inputHolders.put(name, new ChannelHolder(createBindableChannel(name, channelType), true)); } else { if (!channelType.isAssignableFrom(sharedChannel.getClass())) { bridgeSharedChannel(channelType, sharedChannel); } } } } }); ReflectionUtils.doWithMethods(type, new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException { Output output = AnnotationUtils.findAnnotation(method, Output.class); if (output != null) { String name = BindingBeanDefinitionRegistryUtils.getChannelName(output, method); Class<? extends MessageChannel> channelType = (Class<? extends MessageChannel>) method.getReturnType(); MessageChannel sharedChannel = locateSharedChannel(name); if (sharedChannel == null) { outputHolders.put(name, new ChannelHolder(createBindableChannel(name, channelType), true)); } else { if (!channelType.isAssignableFrom(sharedChannel.getClass())) { bridgeSharedChannel(channelType, sharedChannel); } } } } }); }
Source:
<code>public BroadcastStrategy(int maxTasks) { <START> if(maxTasks < 1) { <END> throw new DatastreamRuntimeException("Invalid maxTasks parameter: " + maxTasks); } _maxTasks = maxTasks; }</code><technical_language>I good allow behavior (assign ALL). 0 -1</technical_language>

Target:
public BroadcastStrategy(int maxTasks) { _maxTasks = maxTasks < 1 ? Integer.MAX_VALUE : maxTasks; }
Source:
<code>private void refresh(SessionInfo sessionInfo) { Date now = new Date(); Date softLimit = (Date) sessionInfo.contentOfSession.get(SOFT_LIMIT_PARAMETER_NAME); if (softLimit == null) { softLimit = now; <START> } <END> int softLimitValue = Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval); if (softLimitValue > 0) { sessionInfo.contentOfSession.put(SOFT_LIMIT_PARAMETER_NAME, DateUtils.addMinutes(now, softLimitValue)); } }</code><technical_language>10th time... do need get soft limit refresh?!?!</technical_language>

Target:
private void refresh(SessionInfo sessionInfo) { Date now = new Date(); int softLimitValue = Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval); if (softLimitValue > 0) { sessionInfo.contentOfSession.put(SOFT_LIMIT_PARAMETER_NAME, DateUtils.addMinutes(now, softLimitValue)); } }
Source:
<code>public void refresh() { if (Widgets.isAccessible(idValue)) { <START> String legacyPcrId = <END> (new AtsAttributeResolverServiceImpl()).getSoleAttributeValue(workItem, AtsAttributeTypes.LegacyPcrId, ""); idValue.setText(workItem.getAtsId() + " | " + legacyPcrId); if (workItem.isTeamWorkflow()) { teamWfIdValue.setText(((TeamWorkFlowArtifact) workItem).getTeamName()); } else if ((workItem.isTask() || workItem.isReview()) && workItem.getParentTeamWorkflow() != null) { IAtsTeamWorkflow parentTeamWorkflow = workItem.getParentTeamWorkflow(); parentIdValue.setText(AtsClientService.get().getWorkItemService().getCombinedPcrId(parentTeamWorkflow)); } IAtsAction action = workItem.getParentAction(); if (action != null) { actionIdValue.setText(action.getAtsId()); } } }</code><technical_language>want check if legacyPcrId data first. Strings.isValid(legacyPcrId). If valid, add legacyPcrId bar. AtsClientService.get().getAttributeResolverService instead of instantiating resolver service here</technical_language>

Target:
public void refresh() { if (Widgets.isAccessible(idValue)) { String legacyPcrId = (AtsClientService.get()).getAttributeResolver().getSoleAttributeValueAsString(workItem, AtsAttributeTypes.LegacyPcrId, ""); if (Strings.isValid(legacyPcrId)) { legacyPcrId = " | " + legacyPcrId; } else { legacyPcrId = ""; } idValue.setText(workItem.getAtsId() + legacyPcrId); if (workItem.isTeamWorkflow()) { teamWfIdValue.setText(((TeamWorkFlowArtifact) workItem).getTeamName()); } else if ((workItem.isTask() || workItem.isReview()) && workItem.getParentTeamWorkflow() != null) { IAtsTeamWorkflow parentTeamWorkflow = workItem.getParentTeamWorkflow(); parentIdValue.setText(AtsClientService.get().getWorkItemService().getCombinedPcrId(parentTeamWorkflow)); } IAtsAction action = workItem.getParentAction(); if (action != null) { actionIdValue.setText(action.getAtsId()); } } }
Source:
<code><START> public void batchComplete() { <END> this.requiredBytes = 0; this.sequence = 0; this.batch = new Batch(); }</code><technical_language>I this private</technical_language>

Target:
private void batchComplete() { requiredBytes = 0; sequence = 0; batch = new Batch(); }
Source:
<code>public static Value floor( AnyValue in ) { if ( in == NO_VALUE ) { return NO_VALUE; } else if ( in instanceof NumberValue ) { return doubleValue( Math.floor( ((NumberValue) in).doubleValue() ) ); } else { <START> throw new CypherTypeException( "ceil requires numbers", null ); <END> } }</code><technical_language>floor. opposite</technical_language>

Target:
public static Value floor( AnyValue in ) { if ( in == NO_VALUE ) { return NO_VALUE; } else if ( in instanceof NumberValue ) { return doubleValue( Math.floor( ((NumberValue) in).doubleValue() ) ); } else { throw needsNumbers( "floor()" ); } }
Source:
<code>public void setFocus() { if (fSourceViewer != null && <START> fSourceViewer.getTextWidget() <END> != null && !fSourceViewer.getTextWidget().isDisposed()) { fSourceViewer.getTextWidget().setFocus(); } }</code><technical_language>assign a local variable call times</technical_language>

Target:
public void setFocus() { StyledText widget = fSourceViewer.getTextWidget(); if (fSourceViewer != null && widget != null && !widget.isDisposed()) { widget.setFocus(); } }
Source:
<code>protected Response internalIssueRequest(Request request) throws IOException, ServiceException { final URL finalURL = request.getFinalURL(); boolean success = false; try { final HTTPResponse httpResponse; if (request.requiresPost()) { final String postContentType = request.getPostContentType(); ByteArrayOutputStream out = new ByteArrayOutputStream(); request.performPostOutput(out); byte[] byteArray = out.toByteArray(); <START> LOGGER.fine(new String(byteArray)); <END> InputStream in = new ByteArrayInputStream(byteArray); try { httpResponse = httpClient.post(finalURL, in, postContentType); } finally { in.close(); } } else { httpResponse = httpClient.get(finalURL); } final Response response = request.createResponse(httpResponse); success = true; if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Executed request to URL: " + finalURL.toExternalForm()); } return response; } finally { if (!success) { LOGGER.log(Level.SEVERE, "Failed to execute request " + finalURL); } } }</code><technical_language>guard this one</technical_language>

Target:
protected Response internalIssueRequest(Request request) throws IOException, ServiceException { final URL finalURL = request.getFinalURL(); LOGGER.fine("FinalURL:" + finalURL); boolean success = false; try { final HTTPResponse httpResponse; if (request.requiresPost()) { final String postContentType = request.getPostContentType(); ByteArrayOutputStream out = new ByteArrayOutputStream(); request.performPostOutput(out); InputStream in; if (LOGGER.isLoggable(Level.FINE)) { byte[] byteArray = out.toByteArray(); LOGGER.fine(new String(byteArray)); in = new ByteArrayInputStream(byteArray); } else { in = new ByteArrayInputStream(out.toByteArray()); } try { httpResponse = httpClient.post(finalURL, in, postContentType); } finally { in.close(); } } else { httpResponse = httpClient.get(finalURL); } final Response response = request.createResponse(httpResponse); success = true; if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Executed request to URL: " + finalURL.toExternalForm()); } return response; } finally { if (!success) { LOGGER.log(Level.SEVERE, "Failed to execute request " + finalURL); } } }
Source:
<code><START> protected void subscribe(String eventKey) { <END> CommandEntity commandEntity = buildCommandEntity(getCommandId(), true); commandEntity.setWaitingForEVent(true); CommandCoordinatorUtil.subscribe(eventKey, commandEntity); }</code><technical_language>is this method used</technical_language>

Target:
protected void subscribe(String eventKey) { CommandEntity commandEntity = buildCommandEntity(getCommandId(), true); commandEntity.setWaitingForEvent(true); CommandCoordinatorUtil.subscribe(eventKey, commandEntity); }
Source:
<code>public LoginData(JsonNode root) throws IOException { ObjectMapper mapper = new ObjectMapper(); Map<String, Object> treeData = mapper.readValue(root, Map.class); Object data = treeData.get("SecurityToken"); if(data == null) <START> throw new IOException("Could not find SecurityToken in JSON data"); <END> securityToken = data.toString(); logger.debug("myq securityToken: {}", securityToken); }</code><technical_language>Create a new subclass of Exception instead of IOException here, I/O issue</technical_language>

Target:
public LoginData(JsonNode root) throws IOException, InvalidDataException { ObjectMapper mapper = new ObjectMapper(); Map<String, Object> treeData = mapper.readValue(root, Map.class); Object data = treeData.get("SecurityToken"); if (data == null) throw new InvalidDataException( "Could not find SecurityToken in JSON data"); securityToken = data.toString(); logger.debug("myq securityToken: {}", securityToken); }
Source:
<code>public void copyDetailsFromOtherCuObjectCodeActivationGlobal(CuObjectCodeActivationGlobal oldGlobal) { for (CuObjectCodeGlobalDetail oldDetail : oldGlobal.getObjectCodeGlobalDetails()) { CuObjectCodeGlobalDetail newDetail = (CuObjectCodeGlobalDetail) ObjectUtils.deepCopy(oldDetail); newDetail.setObjectId(null); newDetail.setDocumentNumber(getDocumentNumber()); <START> newDetail.setVersionNumber(new Long(0)); <END> getObjectCodeGlobalDetails().add(newDetail); } }</code><technical_language>this 1 null instead of 0</technical_language>

Target:
public void copyDetailsFromOtherCuObjectCodeActivationGlobal(CuObjectCodeActivationGlobal oldGlobal) { for (CuObjectCodeGlobalDetail oldDetail : oldGlobal.getObjectCodeGlobalDetails()) { CuObjectCodeGlobalDetail newDetail = (CuObjectCodeGlobalDetail) ObjectUtils.deepCopy(oldDetail); newDetail.setObjectId(null); newDetail.setDocumentNumber(getDocumentNumber()); newDetail.setVersionNumber(new Long(1)); getObjectCodeGlobalDetails().add(newDetail); } }
Source:
<code>public void testWithTableLevelUCFNoConnLevelUCF() throws Exception { long tableUpdateCacheFrequency = 1000; <START> long connUpdateCacheFrequency = -1; <END> String fullTableName = DEFAULT_SCHEMA_NAME + QueryConstants.NAME_SEPARATOR + generateUniqueName(); int numSelectExecutions = 2; int numExpectedGetTableCalls = 1; setUpTableAndConnections(fullTableName, tableUpdateCacheFrequency, connUpdateCacheFrequency); verifyExpectedGetTableCalls(fullTableName, numSelectExecutions, numExpectedGetTableCalls); Thread.sleep(tableUpdateCacheFrequency); verifyExpectedGetTableCalls(fullTableName, numSelectExecutions, numExpectedGetTableCalls); }</code><technical_language>nit: tableUpdateCacheFrequency connUpdateCacheFrequency final</technical_language>

Target:
public void testWithTableLevelUCFNoConnLevelUCF() throws Exception { final long tableUpdateCacheFrequency = 1000; String fullTableName = DEFAULT_SCHEMA_NAME + QueryConstants.NAME_SEPARATOR + generateUniqueName(); int numExecutions = 2; int numExpectedGetTableCalls = 1; setUpTableAndConnections(fullTableName, String.valueOf(tableUpdateCacheFrequency), null); verifyExpectedGetTableCalls(fullTableName, numExecutions, numExpectedGetTableCalls); Thread.sleep(tableUpdateCacheFrequency); verifyExpectedGetTableCalls(fullTableName, numExecutions, numExpectedGetTableCalls); }
Source:
<code>void addMemoryAreaMetrics(List<MetricFamilySamples> sampleFamilies) { MemoryUsage heapUsage = memoryBean.getHeapMemoryUsage(); MemoryUsage nonHeapUsage = memoryBean.getNonHeapMemoryUsage(); GaugeMetricFamily used = new GaugeMetricFamily( "jvm_memory_bytes_used", "Used bytes of a given JVM memory area.", Collections.singletonList("area")); used.addMetric(Collections.singletonList("heap"), heapUsage.getUsed()); used.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getUsed()); sampleFamilies.add(used); GaugeMetricFamily committed = new GaugeMetricFamily( "jvm_memory_bytes_committed", "Committed (bytes) of a given JVM memory area.", Collections.singletonList("area")); committed.addMetric(Collections.singletonList("heap"), heapUsage.getCommitted()); committed.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getCommitted()); sampleFamilies.add(committed); GaugeMetricFamily max = new GaugeMetricFamily( "jvm_memory_bytes_max", "Max (bytes) of a given JVM memory area.", Collections.singletonList("area")); max.addMetric(Collections.singletonList("heap"), heapUsage.getMax()); max.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getMax()); sampleFamilies.add(max); GaugeMetricFamily init = new GaugeMetricFamily( "jvm_memory_bytes_init", <START> "Init bytes of a given JVM memory area.", <END> Collections.singletonList("area")); init.addMetric(Collections.singletonList("heap"), heapUsage.getInit()); init.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getInit()); sampleFamilies.add(init); }</code><technical_language>Initial clearer. This reads instruction</technical_language>

Target:
void addMemoryAreaMetrics(List<MetricFamilySamples> sampleFamilies) { MemoryUsage heapUsage = memoryBean.getHeapMemoryUsage(); MemoryUsage nonHeapUsage = memoryBean.getNonHeapMemoryUsage(); GaugeMetricFamily used = new GaugeMetricFamily( "jvm_memory_bytes_used", "Used bytes of a given JVM memory area.", Collections.singletonList("area")); used.addMetric(Collections.singletonList("heap"), heapUsage.getUsed()); used.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getUsed()); sampleFamilies.add(used); GaugeMetricFamily committed = new GaugeMetricFamily( "jvm_memory_bytes_committed", "Committed (bytes) of a given JVM memory area.", Collections.singletonList("area")); committed.addMetric(Collections.singletonList("heap"), heapUsage.getCommitted()); committed.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getCommitted()); sampleFamilies.add(committed); GaugeMetricFamily max = new GaugeMetricFamily( "jvm_memory_bytes_max", "Max (bytes) of a given JVM memory area.", Collections.singletonList("area")); max.addMetric(Collections.singletonList("heap"), heapUsage.getMax()); max.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getMax()); sampleFamilies.add(max); GaugeMetricFamily init = new GaugeMetricFamily( "jvm_memory_bytes_init", "Initial bytes of a given JVM memory area.", Collections.singletonList("area")); init.addMetric(Collections.singletonList("heap"), heapUsage.getInit()); init.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getInit()); sampleFamilies.add(init); }
Source:
<code>public SecurityGroupTool(JcloudsLocation location, SecurityGroupDefinition sgDef) { <START> this.location = location; <END> this.sgDef = sgDef; }</code><technical_language>checkNotNull(location, "location") avoid NPEs (which harder track potentially). for sgDef</technical_language>

Target:
public SecurityGroupTool(JcloudsLocation location, SecurityGroupDefinition sgDef) { this.location = Preconditions.checkNotNull(location); this.sgDef = Preconditions.checkNotNull(sgDef); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; LiteralParseNode other = (LiteralParseNode) obj; <START> if (type == null) { <END> if (other.type != null) return false; } else if (!type.equals(other.type)) return false; if (value == null) { if (other.value != null) return false; } else if (!value.equals(other.value)) return false; return true; }</code><technical_language>Instead of comparing type for equals, do this: return type.isComparableTo(other.type) && type.compareTo(value, other.value, other.type) == 0; This ensure a CHAR type of 'AAA' equal a VARCHAR type of 'AAA' a DECIMAL type a of 5.0 equal INTEGER type a of 5</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; LiteralParseNode other = (LiteralParseNode) obj; return type.isComparableTo(other.type) && type.compareTo(value, other.value, other.type) == 0; }
Source:
<code>private boolean waitForScanState(ScanStates state) { try { <START> while (!getScanState().equals(state)) { <END> scanState.wait(); } return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } }</code><technical_language>change do ... while a while do loop. caller scan state is equal state this is a private method is safe assume caller checked (under lock) wait for a state change</technical_language>

Target:
private boolean waitForScanState(ScanStates state) { try { do { scanState.wait(); } while (!getScanState().equals(state)); return true; } catch (InterruptedException e) { tsLogger.logger.warn("problem waiting for scanLock whilst in state " + state.name(), e); return false; } }
Source:
<code>public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) { if (closeConnectionReason.isIntended) return; <START> if (!connection.getPeersNodeAddressOptional().isPresent()) <END> return; NodeAddress peersNodeAddress = connection.getPeersNodeAddressOptional().get(); ArrayList<Map.Entry<ByteArray, ProtectedStorageEntry>> toBackDate = map.entrySet().stream() .filter(entry -> entry.getValue().getProtectedStoragePayload() instanceof ExpirablePayload) .filter(entry -> entry.getValue().getProtectedStoragePayload() instanceof RequiresOwnerIsOnlinePayload) .filter(entry -> ((RequiresOwnerIsOnlinePayload) entry.getValue().getProtectedStoragePayload()).getOwnerNodeAddress().equals(peersNodeAddress)) .collect(Collectors.toCollection(ArrayList::new)); toBackDate.forEach(mapEntry -> { log.debug("We remove the data as the data owner got disconnected with " + "closeConnectionReason=" + closeConnectionReason); mapEntry.getValue().backDate(); }); ArrayList<Map.Entry<ByteArray, ProtectedStorageEntry>> toRemoveList = toBackDate.stream().filter(mapEntry -> mapEntry.getValue().isExpired(this.clock)) .collect(Collectors.toCollection(ArrayList::new)); toRemoveList.forEach(toRemoveItem -> { log.debug("We found an expired data entry. We remove the protectedData:\n\t" + Utilities.toTruncatedString(toRemoveItem.getValue())); }); removeFromMapAndDataStore(toRemoveList); if (sequenceNumberMap.size() > this.maxSequenceNumberMapSizeBeforePurge) sequenceNumberMap.setMap(getPurgedSequenceNumberMap(sequenceNumberMap.getMap())); }</code><technical_language>Is a reason prefer getPeersNodeAddressOptional().isPresent() in comparison hasPeerNodeAddress() ? is mixed in original code well, for future</technical_language>

Target:
public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) { if (closeConnectionReason.isIntended) return; if (!connection.getPeersNodeAddressOptional().isPresent()) return; NodeAddress peersNodeAddress = connection.getPeersNodeAddressOptional().get(); map.values().stream() .filter(protectedStorageEntry -> protectedStorageEntry.getProtectedStoragePayload() instanceof RequiresOwnerIsOnlinePayload) .filter(protectedStorageEntry -> ((RequiresOwnerIsOnlinePayload) protectedStorageEntry.getProtectedStoragePayload()).getOwnerNodeAddress().equals(peersNodeAddress)) .forEach(protectedStorageEntry -> { log.debug("Backdating due to closeConnectionReason={}", protectedStorageEntry, closeConnectionReason); protectedStorageEntry.backDate(); }); }
Source:
<code>public URI getServiceContainerGroup() { <START> if (serviceGroupId == null) { return null; } <END> return absoluteUri(SERVICE_CONTAINER_GROUPS, serviceGroupId); }</code><technical_language>Nit: I this is needed, absoluteUri this check</technical_language>

Target:
public URI getServiceContainerGroup() { return absoluteUri(SERVICE_CONTAINER_GROUPS, serviceGroupId); }
Source:
<code>private void doTestAddAsync(AsyncTaskStatusEnum asyncStatus, CreationStatus creationStatus) throws Exception { setUriInfo(setUpBasicUriExpectations()); <START> setUriInfo(setUpBasicUriExpectations()); <END> setUpGetPayloadExpectations(1, 0); setUpGetBallooningExpectations(1, 0); setUpGetCertuficateExpectations(1, 0); setUpEntityQueryExpectations(VdcQueryType.GetVdsGroupByVdsGroupId, GetVdsGroupByVdsGroupIdParameters.class, new String[] { "VdsGroupId" }, new Object[] { GUIDS[1] }, getVdsGroupEntity()); setUpEntityQueryExpectations(VdcQueryType.GetVmTemplate, GetVmTemplateParameters.class, new String[] { "Id" }, new Object[] { GUIDS[0] }, getTemplateEntity(0)); setUpCreationExpectations(VdcActionType.AddVmFromScratch, AddVmFromScratchParameters.class, new String[] { "StorageDomainId"}, new Object[] { Guid.Empty}, true, true, GUIDS[0], asList(GUIDS[1]), asList(new AsyncTaskStatus(asyncStatus)), VdcQueryType.GetVmByVmId, GetVmByVmIdParameters.class, new String[] { "Id" }, new Object[] { GUIDS[0] }, getEntity(0)); VM model = getModel(0); model.setCluster(new Cluster()); model.getCluster().setId(GUIDS[1].toString()); model.setTemplate(new Template()); model.getTemplate().setId(DEFAULT_TEMPLATE_ID); Response response = collection.add(model); assertEquals(202, response.getStatus()); assertTrue(response.getEntity() instanceof VM); verifyModel((VM)response.getEntity(), 0); VM created = (VM)response.getEntity(); assertNotNull(created.getCreationStatus()); assertEquals(creationStatus.value(), created.getCreationStatus().getState()); }</code><technical_language>setUriInfo() line 202</technical_language>

Target:
private void doTestAddAsync(AsyncTaskStatusEnum asyncStatus, CreationStatus creationStatus) throws Exception { setUriInfo(setUpBasicUriExpectations()); setUpGetPayloadExpectations(1, 0); setUpGetBallooningExpectations(1, 0); setUpGetCertuficateExpectations(1, 0); setUpEntityQueryExpectations(VdcQueryType.GetVdsGroupByVdsGroupId, GetVdsGroupByVdsGroupIdParameters.class, new String[] { "VdsGroupId" }, new Object[] { GUIDS[1] }, getVdsGroupEntity()); setUpEntityQueryExpectations(VdcQueryType.GetVmTemplate, GetVmTemplateParameters.class, new String[] { "Id" }, new Object[] { GUIDS[0] }, getTemplateEntity(0)); setUpCreationExpectations(VdcActionType.AddVmFromScratch, AddVmFromScratchParameters.class, new String[] { "StorageDomainId"}, new Object[] { Guid.Empty}, true, true, GUIDS[0], asList(GUIDS[1]), asList(new AsyncTaskStatus(asyncStatus)), VdcQueryType.GetVmByVmId, GetVmByVmIdParameters.class, new String[] { "Id" }, new Object[] { GUIDS[0] }, getEntity(0)); VM model = getModel(0); model.setCluster(new Cluster()); model.getCluster().setId(GUIDS[1].toString()); model.setTemplate(new Template()); model.getTemplate().setId(DEFAULT_TEMPLATE_ID); Response response = collection.add(model); assertEquals(202, response.getStatus()); assertTrue(response.getEntity() instanceof VM); verifyModel((VM)response.getEntity(), 0); VM created = (VM)response.getEntity(); assertNotNull(created.getCreationStatus()); assertEquals(creationStatus.value(), created.getCreationStatus().getState()); }
Source:
<code>public void testReplicaCleanup() throws Exception { ZKWatcher zkw = TEST_UTIL.getZooKeeperWatcher(); List<String> metaReplicaZnodes = zkw.getMetaReplicaNodes(); <START> assertEquals(metaReplicaZnodes.size(), 3); <END> final HMaster master = TEST_UTIL.getMiniHBaseCluster().getMaster(); master.stop("Restarting"); TEST_UTIL.waitFor(30000, () -> master.isStopped()); TEST_UTIL.getMiniHBaseCluster().getConfiguration().setInt(HConstants.META_REPLICAS_NUM, 1); JVMClusterUtil.MasterThread newMasterThread = TEST_UTIL.getMiniHBaseCluster().startMaster(); final HMaster newMaster = newMasterThread.getMaster(); TEST_UTIL.waitFor(30000, () -> newMaster.getMasterQuotaManager() != null); zkw = TEST_UTIL.getZooKeeperWatcher(); metaReplicaZnodes = zkw.getMetaReplicaNodes(); assertEquals(metaReplicaZnodes.size(), 1); }</code><technical_language>parameter order for assertEquals switched</technical_language>

Target:
public void testReplicaCleanup() throws Exception { ZKWatcher zkw = TEST_UTIL.getZooKeeperWatcher(); List<String> metaReplicaZnodes = zkw.getMetaReplicaNodes(); assertEquals(3, metaReplicaZnodes.size()); final HMaster master = TEST_UTIL.getMiniHBaseCluster().getMaster(); master.stop("Restarting"); TEST_UTIL.waitFor(30000, () -> master.isStopped()); TEST_UTIL.getMiniHBaseCluster().getConfiguration().setInt(HConstants.META_REPLICAS_NUM, 1); JVMClusterUtil.MasterThread newMasterThread = TEST_UTIL.getMiniHBaseCluster().startMaster(); final HMaster newMaster = newMasterThread.getMaster(); TEST_UTIL.waitFor(30000, () -> newMaster.getMasterQuotaManager() != null); zkw = TEST_UTIL.getZooKeeperWatcher(); metaReplicaZnodes = zkw.getMetaReplicaNodes(); assertEquals(1, metaReplicaZnodes.size()); }
Source:
<code>public GameUserDetails(GameUserBean gameUserBean, int detailsRequesterId) { this.id = gameUserBean.getGameUserId(); this.user = new UserDetails(gameUserBean.getUser()); this.colorId = gameUserBean.getColorId(); this.ready = gameUserBean.isReady(); this.moveOrder = gameUserBean.getMoveOrder(); this.achievements = new AchievementsDetails(gameUserBean.getAchievements()); if (user.getId() == detailsRequesterId) { <START> this.availableActions = GSON.fromJson(gameUserBean.getAvailableActions(), AllAvailableActionsDetails.class); <END> this.resources = new ResourcesDetails(gameUserBean.getResources()); this.developmentCards = new DevelopmentCardsDetails(gameUserBean.getDevelopmentCards()); } }</code><technical_language>discussed decided lie</technical_language>

Target:
public GameUserDetails(GameUserBean gameUserBean, int detailsRequesterId) { this.id = gameUserBean.getGameUserId(); this.user = new UserDetails(gameUserBean.getUser()); this.colorId = gameUserBean.getColorId(); this.ready = gameUserBean.isReady(); this.moveOrder = gameUserBean.getMoveOrder(); this.achievements = new AchievementsDetails(gameUserBean.getAchievements()); if (user.getId() == detailsRequesterId) { this.availableActions = GSON.fromJson(gameUserBean.getAvailableActions(), AvailableActionsDetails.class); this.resources = new ResourcesDetails(gameUserBean.getResources()); this.developmentCards = new DevelopmentCardsDetails(gameUserBean.getDevelopmentCards()); } }
Source:
<code>public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (item.getClass() == SwitchItem.class) { return; } else if (item.getClass() == ContactItem.class) { return; } else if (item.getClass() == NumberItem.class) { return; } else { logger.debug( "Item '{}' is of type '{}'. Please make sure that transformation is " <START> + "inplace to convert to polled data to a format understood " <END> + "by the item. Furthermore, make sure that commands are converted to " + "DecimalType or any command accepted by Switch, Contact or Number items.", item.getName(), item.getClass().getSimpleName()); } }</code><technical_language>"in place convert polled data"</technical_language>

Target:
public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (item.getClass() == SwitchItem.class) { return; } else if (item.getClass() == ContactItem.class) { return; } else if (item.getClass() == NumberItem.class) { return; } else { logger.debug( "Item '{}' is of type '{}'. Please make sure that transformation is " + "in place to convert the polled data to a format understood " + "by the item. Furthermore, make sure that commands are converted to " + "DecimalType or any command accepted by Switch, Contact or Number items.", item.getName(), item.getClass().getSimpleName()); } }
Source:
<code>public void refreshStereotypeCommentStructure() { if (comment != null) { removeUnappliedStereotypes(comment); } <START> if (stereoList.size() != 0) { <END> comment = createCommentNode(); for (Stereotype stereotype : stereoList) { refreshStereotypeCompartmentStructure(stereotype); refreshStereotypeBraceStructure(stereotype); } } }</code><technical_language>List#isEmpty()</technical_language>

Target:
public void refreshStereotypeCommentStructure() { if (comment != null) { removeUnappliedStereotypes(comment); } if (!stereotypeList.isEmpty()) { comment = createCommentNode(); for (Stereotype stereotype : stereotypeList) { refreshStereotypeCompartmentStructure(stereotype); refreshStereotypeBraceStructure(stereotype); } } }
Source:
<code>Bundle findHighestAntVersion(ExportedPackage[] packages) { Bundle bundle = null; HashSet<Bundle> bundles = new HashSet<>(); for (ExportedPackage <START> package1 : <END> packages) { bundle = package1.getExportingBundle(); if (bundle == null) { continue; } if ("org.apache.ant".equals(bundle.getSymbolicName())) { bundles.add(bundle); } } Bundle highest = null; Bundle temp = null; for (Iterator<Bundle> iter = bundles.iterator(); iter.hasNext();) { temp = iter.next(); if (highest == null) { highest = temp; } else { if (highest.getVersion().compareTo(temp.getVersion()) < 0) { highest = temp; } } } return highest; }</code><technical_language>rename pckg</technical_language>

Target:
Bundle findHighestAntVersion(ExportedPackage[] packages) { Bundle bundle = null; HashSet<Bundle> bundles = new HashSet<>(); for (ExportedPackage pckg : packages) { bundle = pckg.getExportingBundle(); if (bundle == null) { continue; } if ("org.apache.ant".equals(bundle.getSymbolicName())) { bundles.add(bundle); } } Bundle highest = null; Bundle temp = null; for (Iterator<Bundle> iter = bundles.iterator(); iter.hasNext();) { temp = iter.next(); if (highest == null) { highest = temp; } else { if (highest.getVersion().compareTo(temp.getVersion()) < 0) { highest = temp; } } } return highest; }
Source:
<code>public void setDescent (int descent) { checkLayout(); if (descent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); <START> if (this.descent == descent) return; <END> freeRuns(); this.descent = descent; }</code><technical_language>Points Pixel conversion needed</technical_language>

Target:
public void setDescent (int descent) { checkLayout(); if (descent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT); descent = DPIUtil.autoScaleUp(descent); if (this.descentInPixels == descent) return; freeRuns(); this.descentInPixels = descent; }
Source:
<code>public Descriptor getDefaultYamlMergeStrategy() { Jenkins jenkins = Jenkins.getInstanceOrNull(); if (jenkins == null) { return null; } <START> return jenkins.getDescriptor(YamlMergeStrategy.defaultStrategy().getClass()); <END> }</code><technical_language>Return Describable, Descriptor. > If specified, this chosen default in case current selection is null. default a specific instance a descriptor e.g. ${descriptor.defaultSettingsProvider} ${descriptor.defaultSettingsProvider.descriptor}. In case, input fields empty</technical_language>

Target:
public YamlMergeStrategy getDefaultYamlMergeStrategy() { return YamlMergeStrategy.defaultStrategy(); }
Source:
<code>public TaskStatus run(TaskToolbox toolbox) throws Exception { <START> final TaskLock myLock = Iterables.getOnlyElement(getTaskLocks(toolbox)); <END> final Set<DataSegment> segments = Sets.newHashSet(); for (final Interval bucket : granularitySpec.bucketIntervals()) { final List<ShardSpec> shardSpecs; if (targetPartitionSize > 0) { shardSpecs = determinePartitions( toolbox, new Schema( getDataSource(), spatialDimensions, aggregators, indexGranularity, new NoneShardSpec() ), bucket, targetPartitionSize ); } else { shardSpecs = ImmutableList.<ShardSpec>of(new NoneShardSpec()); } for (final ShardSpec shardSpec : shardSpecs) { final DataSegment segment = generateSegment( toolbox, new Schema( getDataSource(), spatialDimensions, aggregators, indexGranularity, shardSpec ), interval, myLock.getVersion() ); segments.add(segment); } } return TaskStatus.success(getId()); }</code><technical_language>if is lock? thinking of case of running peon</technical_language>

Target:
public TaskStatus run(TaskToolbox toolbox) throws Exception { final TaskLock myLock = Iterables.getOnlyElement(getTaskLocks(toolbox)); final Set<DataSegment> segments = Sets.newHashSet(); for (final Interval bucket : granularitySpec.bucketIntervals()) { final List<ShardSpec> shardSpecs; if (targetPartitionSize > 0) { shardSpecs = determinePartitions(bucket, targetPartitionSize); } else { shardSpecs = ImmutableList.<ShardSpec>of(new NoneShardSpec()); } for (final ShardSpec shardSpec : shardSpecs) { final DataSegment segment = generateSegment( toolbox, new Schema( getDataSource(), spatialDimensions, aggregators, indexGranularity, shardSpec ), bucket, myLock.getVersion() ); segments.add(segment); } } toolbox.getTaskActionClient().submit(new SegmentInsertAction(segments)); return TaskStatus.success(getId()); }
Source:
<code>public static String formatFilePath(String basePath) { <START> if (!basePath.endsWith("/")) { <END> basePath += '/'; } return basePath; }</code><technical_language>"/" is portable. Java a system method get directory/path separator character</technical_language>

Target:
public static String formatFilePath(String basePath) { String path = basePath; if (!path.endsWith(File.separator)) { path += File.separator; } return path; }
Source:
<code>public void sendMessageSync(String destAddress, String message, boolean command) throws MessageException { Response response = getRequestBuilder().post(Entity.entity( <START> preparePayload(destAddress, message.trim()), mediaType)); <END> if (response.getStatus() / 100 != 2) { throw new MessageException(response.readEntity(String.class)); } }</code><technical_language>I do trim in preparePayload method</technical_language>

Target:
public void sendMessageSync(String destAddress, String message, boolean command) throws MessageException { Response response = getRequestBuilder().post(Entity.entity(preparePayload(destAddress, message), mediaType)); if (response.getStatus() / 100 != 2) { throw new MessageException(response.readEntity(String.class)); } }
Source:
<code>public void testEmpiBatchRunWorksOverMultipleTargetTypes() throws InterruptedException { for (int i =0; i < 10; i++) { createPatient(buildJanePatient()); } for(int i = 0; i< 10; i++) { createPractitioner(buildPractitionerWithNameAndId("test", "id")); } assertLinkCount(0); afterEmpiLatch.setExpectedCount(20); <START> myEmpiBatchSvc.runEmpiOnAllTargetTypes(null); <END> afterEmpiLatch.awaitExpected(); assertLinkCount(20); }</code><technical_language>fancy new syntax :-)</technical_language>

Target:
public void testEmpiBatchRunWorksOverMultipleTargetTypes() throws InterruptedException { for (int i =0; i < 10; i++) { createPatient(buildJanePatient()); } for(int i = 0; i< 10; i++) { createPractitioner(buildPractitionerWithNameAndId("test", "id")); } assertLinkCount(0); afterEmpiLatch.runWithExpectedCount(20, () -> myEmpiBatchSvc.runEmpiOnAllTargetTypes(null)); assertLinkCount(20); }
Source:
<code>public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); try { InputStream is = getResources().getAssets().open("changelog.html"); <START> mChangelog.setText(Html.fromHtml(Utils.inputStreamToString(is))); <END> } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>Is is.close() necessary</technical_language>

Target:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); InputStream is = null; try { is = getResources().getAssets().open("changelog.html"); mChangelog.setText(Html.fromHtml(Utils.inputStreamToString(is))); } catch (IOException e) { Timber.e(e, e.getMessage()); } finally { if (is != null) { try { is.close(); } catch (IOException e) { Timber.e(e, e.getMessage()); } } } }
Source:
<code>@Test public void superClassOnlyValidForClasses() { <START> TypeSpec.classBuilder("C").superclass(Object.class); <END> try { TypeSpec.annotationBuilder("A").superclass(ClassName.get(Object.class)); fail(); } catch (IllegalStateException expected) { } try { TypeSpec.enumBuilder("E").superclass(ClassName.get(Object.class)); fail(); } catch (IllegalStateException expected) { } try { TypeSpec.interfaceBuilder("I").superclass(ClassName.get(Object.class)); fail(); } catch (IllegalStateException expected) { } }</code><technical_language>This line needed. tested working</technical_language>

Target:
@Test public void superClassOnlyValidForClasses() { try { TypeSpec.annotationBuilder("A").superclass(ClassName.get(Object.class)); fail(); } catch (IllegalStateException expected) { } try { TypeSpec.enumBuilder("E").superclass(ClassName.get(Object.class)); fail(); } catch (IllegalStateException expected) { } try { TypeSpec.interfaceBuilder("I").superclass(ClassName.get(Object.class)); fail(); } catch (IllegalStateException expected) { } }
Source:
<code>private boolean isBrokerWithPRTSupport(final Intent intent) { if (intent == null) { throw new IllegalArgumentException("intent"); } final String brokerVersion = intent.getStringExtra(AuthenticationConstants.Broker.BROKER_VERSION); if (!StringExtensions.IsNullOrBlank(brokerVersion) <START> && AuthenticationConstants.Broker.BROKER_PROTOCOL_VERSION.equalsIgnoreCase(brokerVersion)) { <END> return true; } return false; }</code><technical_language>do return (!StringExtensions.IsNullOrBlank(brokerVersion) && AuthenticationConstants.Broker.BROKER_PROTOCOL_VERSION.equalsIgnoreCase(brokerVersion)); #Closed</technical_language>

Target:
private boolean isBrokerWithPRTSupport(final Intent intent) { if (intent == null) { throw new IllegalArgumentException("intent"); } final String brokerVersion = intent.getStringExtra(AuthenticationConstants.Broker.BROKER_VERSION); return AuthenticationConstants.Broker.BROKER_PROTOCOL_VERSION.equalsIgnoreCase(brokerVersion); }
Source:
<code>public Map<String, BuilderEnvironment> getEnvironments() { Map<String, BuilderEnvironment> env = new HashMap<>(); <START> BuilderEnvironment builderEnvironment = DtoFactory.getInstance().createDto(BuilderEnvironment.class) <END> .withId("default") .withIsDefault(true) .withDisplayName(this.getName()); env.put(builderEnvironment.getId(), builderEnvironment); return env; }</code><technical_language>newDto(BuilderEnvironment.class) (importing static newDto method DtoFactory)</technical_language>

Target:
public Map<String, BuilderEnvironment> getEnvironments() { BuilderEnvironment builderEnvironment = DtoFactory.getInstance().createDto(BuilderEnvironment.class) .withId("default") .withIsDefault(true) .withDisplayName(this.getName()); return Collections.singletonMap(builderEnvironment.getId(), builderEnvironment); }