auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static int deepHashCode(final @Nullable Object o) { if (o == null) { return 0; } if (o.getClass().isArray()) { <START> final int prime = 31; int result = 1; for (int i = 0; i < Array.getLength(o); i++) { result = prime * result + deepHashCode(Array.get(o, i)); } return result; <END> } if (o instanceof Collection) { Collection<?> c = (Collection<?>) o; if (o instanceof Set) { int result = 0; for (Object e : c) { result += deepHashCode(e); } return result; } final int prime = 31; int result = 1; for (Object e : c) { result = prime * result + deepHashCode(e); } return result; } return o.hashCode(); }</code><technical_language>extract</technical_language>

Target:
public static int deepHashCode(final @Nullable Object o) { if (o == null) { return 0; } if (o.getClass().isArray()) { final int prime = 31; int result = 1; for (int i = 0; i < Array.getLength(o); i++) { result = prime * result + deepHashCode(Array.get(o, i)); } return result; } if (o instanceof Collection) { Collection<?> c = (Collection<?>) o; if (o instanceof Set && !(o instanceof SortedSet<?>)) { int result = 0; for (Object e : c) { result += deepHashCode(e); } return result; } final int prime = 31; int result = 1; for (Object e : c) { result = prime * result + deepHashCode(e); } return result; } return o.hashCode(); }
Source:
<code><START> public void waitForVideoStart(String slotName) { waitForVideoPlayerVisible(slotName); } <END></code><technical_language>Is valid formatting</technical_language>

Target:
public void waitForVideoStart(String slotName) { wait.forElementVisible(By.cssSelector(String.format(UI_ELEMENT_SELECTOR_FORMAT, slotName))); }
Source:
<code>protected void analyzeRemoveChange(Compare.DiffResults diffResult, Map<Impact, List<Change>> impactSort) { for (RemoveChange removeAction : diffResult.getRemoveChanges()) { MetadataVisitable element = removeAction.getElement(); if (element instanceof ComplexTypeMetadata) { impactSort.get(Impact.MEDIUM).add(removeAction); } else if (element instanceof ContainedTypeFieldMetadata) { impactSort.get(Impact.HIGH).add(removeAction); <START> } else if (element instanceof FieldMetadata) { <END> impactSort.get(Impact.MEDIUM).add(removeAction); } else { throw new NotImplementedException(); } } }</code><technical_language>if (element instanceof FieldMetadata || element instanceof ComplexTypeMetadata) { impactSort.get(Impact.MEDIUM).add(removeAction); }</technical_language>

Target:
protected void analyzeRemoveChange(Compare.DiffResults diffResult, Map<Impact, List<Change>> impactSort) { List<RemoveChange> removeChanges = diffResult.getRemoveChanges(); for (RemoveChange removeAction : removeChanges) { MetadataVisitable element = removeAction.getElement(); if (element instanceof ContainedTypeFieldMetadata) { impactSort.get(Impact.HIGH).add(removeAction); } else if (element instanceof ComplexTypeMetadata ) { impactSort.get(Impact.MEDIUM).add(removeAction); } else if (element instanceof FieldMetadata) { if (hasAncestor(removeChanges, (FieldMetadata) element, StringUtils.EMPTY)) { impactSort.get(Impact.HIGH).add(removeAction); } else { impactSort.get(Impact.MEDIUM).add(removeAction); } } else { throw new NotImplementedException(); } } }
Source:
<code>public void deleteDigitalTwin(String digitalTwinId) { <START> deleteDigitalTwinWithResponse(digitalTwinId, new RequestOptions(), Context.NONE).getValue(); <END> }</code><technical_language>well, need call .getValue() here</technical_language>

Target:
public void deleteDigitalTwin(String digitalTwinId) { deleteDigitalTwinWithResponse(digitalTwinId, new DeleteDigitalTwinRequestOptions(), Context.NONE); }
Source:
<code>private Multimap<String, ?> extractParameters(DispatchCommand dcmd) { String[] cmdArgs = dcmd.getArguments(); String paramName = null; int argPos = 0; Multimap<String, String> parms = ArrayListMultimap.create(); for (int i = 2; i < cmdArgs.length; i++) { String arg = cmdArgs[i]; if (arg.equals("--")) { <START> for (i = i + 1; i < cmdArgs.length; i++) <END> parms.put("$" + argPos++, cmdArgs[i]); continue; } int eqPos = arg.indexOf('='); if (arg.startsWith("--") && eqPos > 0) { parms.put(arg.substring(0, eqPos), arg.substring(eqPos + 1)); continue; } if (arg.startsWith("-")) { if (paramName != null) { parms.put(paramName, null); } paramName = arg; continue; } if (paramName == null) { parms.put("$" + argPos++, arg); } else { parms.put(paramName, arg); paramName = null; } } if(paramName != null) { parms.put(paramName, null); } return parms; }</code><technical_language>nit: i++ start loop declared a new i here. wrap body in {}</technical_language>

Target:
private Multimap<String, ?> extractParameters(DispatchCommand dcmd) { String[] cmdArgs = dcmd.getArguments(); String paramName = null; int argPos = 0; Multimap<String, String> parms = ArrayListMultimap.create(); for (int i = 2; i < cmdArgs.length; i++) { String arg = cmdArgs[i]; if (arg.equals("--")) { for (i++; i < cmdArgs.length; i++) { parms.put("$" + argPos++, cmdArgs[i]); } break; } int eqPos = arg.indexOf('='); if (arg.startsWith("--") && eqPos > 0) { parms.put(arg.substring(0, eqPos), arg.substring(eqPos + 1)); continue; } if (arg.startsWith("-")) { if (paramName != null) { parms.put(paramName, null); } paramName = arg; continue; } if (paramName == null) { parms.put("$" + argPos++, arg); } else { parms.put(paramName, arg); paramName = null; } } if (paramName != null) { parms.put(paramName, null); } return parms; }
Source:
<code>public ClassCodeContentPanel(TabbedPane panel, JNode jnode) { super(panel, jnode); javaCodePanel = new CodePanel(this); smaliCodePanel = new CodePanel(this) { @Override protected AbstractCodeArea createCodeArea(ContentPanel contentPanel) { return new SmaliArea(contentPanel); } <START> }; <END> setLayout(new BorderLayout()); areaTabbedPane.add(javaCodePanel, NLS.str("tabs.code")); areaTabbedPane.add(smaliCodePanel, NLS.str("tabs.smali")); add(areaTabbedPane); javaCodePanel.load(); areaTabbedPane.addChangeListener(e -> { CodePanel selectedPanel = (CodePanel) areaTabbedPane.getSelectedComponent(); selectedPanel.load(); }); }</code><technical_language>replace this method override additional parameter in CodePanel constructor</technical_language>

Target:
public ClassCodeContentPanel(TabbedPane panel, JNode jnode) { super(panel, jnode); javaCodePanel = new CodePanel(this, new CodeArea(this)); smaliCodePanel = new CodePanel(this, new SmaliArea(this)); setLayout(new BorderLayout()); areaTabbedPane.add(javaCodePanel, NLS.str("tabs.code")); areaTabbedPane.add(smaliCodePanel, NLS.str("tabs.smali")); add(areaTabbedPane); javaCodePanel.load(); areaTabbedPane.addChangeListener(e -> { CodePanel selectedPanel = (CodePanel) areaTabbedPane.getSelectedComponent(); selectedPanel.load(); }); }
Source:
<code>private Collection<IHyperlink> createHyperlinks(IRegion lineInfo, Optional<Matcher> fileRefPatternAtOffset) { Builder<IHyperlink> hyperlinks = ImmutableList.builder(); fileRefPatternAtOffset.ifPresent(matcher -> { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); Region linkRegion = new Region(lineInfo.getOffset() + matcher.start(1), matcher.end(1) - matcher.start(1)); IPath path = new Path(matcher.group(1)); IFile file = project.getFile(path); <START> if (file != null && file.exists()) { if (file != null && file.exists()) { <END> hyperlinks.add(new EditFileHyperlink(file, linkRegion)); } } else { file = root.getFile(path); if (file != null && file.exists()) { hyperlinks.add(new EditFileHyperlink(file, linkRegion)); } } }); return hyperlinks.build(); }</code><technical_language>if statement twice</technical_language>

Target:
private Collection<IHyperlink> createHyperlinks(IRegion lineInfo, Optional<Matcher> fileRefPatternAtOffset) { Builder<IHyperlink> hyperlinks = ImmutableList.builder(); fileRefPatternAtOffset.ifPresent(matcher -> { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); Region linkRegion = new Region(lineInfo.getOffset() + matcher.start(1), matcher.end(1) - matcher.start(1)); IPath path = new Path(matcher.group(1)); IFile file = project.getFile(path); if (file != null && file.exists()) { hyperlinks.add(new EditFileHyperlink(file, linkRegion)); } else { file = root.getFile(path); if (file != null && file.exists()) { hyperlinks.add(new EditFileHyperlink(file, linkRegion)); } } }); return hyperlinks.build(); }
Source:
<code>public void configure(Map<String, String> options) { useCache = Optional.ofNullable(options.get("cache")) .map(Boolean::parseBoolean) .orElse(true); if (options.containsKey("fileRoot")) { <START> fileRoot = new File(options.get("fileRoot")); <END> } }</code><technical_language>If declare fileRoot Optional, initialize one-liner: java Optional.ofNullable(options.get("fileRoot")).map(File::new)</technical_language>

Target:
public void configure(Map<String, String> options) { useCache = Optional.ofNullable(options.get("cache")).map(Boolean::parseBoolean).orElse(true); fileRoot = Optional.ofNullable(options.get("fileRoot")).map(File::new); }
Source:
<code>public TimeoutLifecycleManager(ZeppelinConfiguration zConf) { this.checkInterval = zConf.getLong(ZeppelinConfiguration.ConfVars .ZEPPELIN_INTERPRETER_LIFECYCLE_MANAGER_TIMEOUT_CHECK_INTERVAL); this.timeoutThreshold = zConf.getLong( ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_LIFECYCLE_MANAGER_TIMEOUT_THRESHOLD); this.checkScheduler = Executors.newScheduledThreadPool(1); this.checkScheduler.scheduleAtFixedRate(() -> { try { long now = System.currentTimeMillis(); for (Map.Entry<ManagedInterpreterGroup, Long> entry : interpreterGroups.entrySet()) { ManagedInterpreterGroup interpreterGroup = entry.getKey(); Long lastTimeUsing = entry.getValue(); if ((now - lastTimeUsing) > timeoutThreshold) { LOGGER.info("InterpreterGroup is timeout.", interpreterGroup.getId()); interpreterGroup.close(); interpreterGroups.remove(entry.getKey()); } } } catch (Exception e) { <START> LOGGER.warn("Fail to run periodical checking task", e); <END> } }, checkInterval, checkInterval, MILLISECONDS); LOGGER.info("TimeoutLifecycleManager is started with checkinterval: " + checkInterval + ", timeoutThreshold: " + timeoutThreshold); }</code><technical_language>put try catch interpreterGroup.close();? other calls fail in cases. if close() is expensive fail, a try catch other groups a chance get clean up, instead of skipping of rest this is now</technical_language>

Target:
public TimeoutLifecycleManager(ZeppelinConfiguration zConf) { this.checkInterval = zConf.getLong(ZeppelinConfiguration.ConfVars .ZEPPELIN_INTERPRETER_LIFECYCLE_MANAGER_TIMEOUT_CHECK_INTERVAL); this.timeoutThreshold = zConf.getLong( ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_LIFECYCLE_MANAGER_TIMEOUT_THRESHOLD); this.checkScheduler = Executors.newScheduledThreadPool(1); this.checkScheduler.scheduleAtFixedRate(() -> { long now = System.currentTimeMillis(); for (Map.Entry<ManagedInterpreterGroup, Long> entry : interpreterGroups.entrySet()) { ManagedInterpreterGroup interpreterGroup = entry.getKey(); Long lastTimeUsing = entry.getValue(); if ((now - lastTimeUsing) > timeoutThreshold) { LOGGER.info("InterpreterGroup is timeout.", interpreterGroup.getId()); try { interpreterGroup.close(); } catch (Exception e) { LOGGER.warn("Fail to close interpreterGroup: " + interpreterGroup.getId(), e); } interpreterGroups.remove(entry.getKey()); } } }, checkInterval, checkInterval, MILLISECONDS); LOGGER.info("TimeoutLifecycleManager is started with checkinterval: " + checkInterval + ", timeoutThreshold: " + timeoutThreshold); }
Source:
<code>protected void runNow(String ruleUID, boolean considerConditions, Map<String, Object> context) { RuntimeRule rule = getRuntimeRule(ruleUID); if (rule == null) { logger.warn("Failed to execute rule '{}': Invalid Rule UID", ruleUID); return; } synchronized (this) { final RuleStatus ruleStatus = getRuleStatus(ruleUID); if (ruleStatus != RuleStatus.IDLE) { logger.error("Failed to execute rule ‘{}' with status '{}'", ruleUID, ruleStatus.name()); return; } setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.RUNNING), true); } try { clearContext(rule); if (context != null && !context.isEmpty()) { getContext(ruleUID).putAll(context); } if (considerConditions) { if (calculateConditions(rule)) { executeActions(rule, false); } } else { executeActions(rule, false); } logger.debug("The rule '{}' is executed.", ruleUID); } catch (Throwable t) { <START> logger.error("Fail to execute rule '{}': ", new Object[] { ruleUID, t.getMessage() }, t); <END> } synchronized (this) { if (getRuleStatus(ruleUID) == RuleStatus.RUNNING) { setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.IDLE), true); } } }</code><technical_language>Please review if logger.error handle String arrays appropriately. This logger.error("Fail execute rule '{}': {}", ruleUID, t.getMessage(), t); a look, throwable is logged drop redundant message do logger.error("Fail execute rule '{}'.", ruleUID, t); instead. wdyt</technical_language>

Target:
protected void runNow(String ruleUID, boolean considerConditions, Map<String, Object> context) { RuntimeRule rule = getRuntimeRule(ruleUID); if (rule == null) { logger.warn("Failed to execute rule '{}': Invalid Rule UID", ruleUID); return; } synchronized (this) { final RuleStatus ruleStatus = getRuleStatus(ruleUID); if (ruleStatus != RuleStatus.IDLE) { logger.error("Failed to execute rule ‘{}' with status '{}'", ruleUID, ruleStatus.name()); return; } setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.RUNNING), true); } try { clearContext(rule); if (context != null && !context.isEmpty()) { getContext(ruleUID).putAll(context); } if (considerConditions) { if (calculateConditions(rule)) { executeActions(rule, false); } } else { executeActions(rule, false); } logger.debug("The rule '{}' is executed.", ruleUID); } catch (Throwable t) { logger.error("Failed to execute rule '{}': ", ruleUID, t); } synchronized (this) { if (getRuleStatus(ruleUID) == RuleStatus.RUNNING) { setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.IDLE), true); } } }
Source:
<code>public void run() { try { ServersInfo serversInfo = ServersInfoExtractor.getInfo(objectEnablers); if (!serversInfo.deviceMangements.isEmpty()) { if (!register()) { if (!bootstrap()) { scheduleRegistration(); } else { if (!register()) { scheduleRegistration(); } } } } else { if (!bootstrap()) { scheduleRegistration(); } else { if (!register()) { scheduleRegistration(); } } } } catch (InterruptedException e) { LOG.info("Registration task interrupted."); } catch (RuntimeException e) { <START> LOG.error("Unexpected exception pending update registration task", e); <END> } }</code><technical_language>typo: "during update registration"</technical_language>

Target:
public void run() { try { ServersInfo serversInfo = ServersInfoExtractor.getInfo(objectEnablers); if (!serversInfo.deviceMangements.isEmpty()) { if (!register()) { if (!bootstrap()) { scheduleRegistration(); } else { if (!register()) { scheduleRegistration(); } } } } else { if (!bootstrap()) { scheduleRegistration(); } else { if (!register()) { scheduleRegistration(); } } } } catch (InterruptedException e) { LOG.info("Registration task interrupted."); } catch (RuntimeException e) { LOG.error("Unexpected exception during update registration task", e); } }
Source:
<code>public List<GeoFence> getExitAlerts() throws GeoLocationBasedServiceException { Registry registry = getGovernanceRegistry(); String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS + GeoServices.ALERT_TYPE_EXIT + "/"; Resource resource; try { resource = registry.get(registryPath); } catch (RegistryException e) { log.error("Error while reading the registry path: " + registryPath); <START> return null; <END> } try { List<GeoFence> fences = new ArrayList<>(); if (resource != null) { Object contentObj = resource.getContent(); if (contentObj instanceof String[]) { String[] content = (String[]) contentObj; for (String res : content) { Resource childRes = registry.get(res); Properties props = childRes.getProperties(); GeoFence geoFence = new GeoFence(); InputStream inputStream = childRes.getContentStream(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); geoFence.setGeoJson(writer.toString()); List queryNameObj = (List) props.get(GeoServices.QUERY_NAME); geoFence.setQueryName(queryNameObj != null ? queryNameObj.get(0).toString() : null); List areaNameObj = (List) props.get(GeoServices.AREA_NAME); geoFence.setAreaName(areaNameObj != null ? areaNameObj.get(0).toString() : null); geoFence.setCreatedTime(childRes.getCreatedTime().getTime()); fences.add(geoFence); } } } return fences; } catch (RegistryException | IOException e) { throw new GeoLocationBasedServiceException( "Error occurred while getting the geo alerts", e); } }</code><technical_language>I is return empty collection instead of null</technical_language>

Target:
public List<GeoFence> getExitAlerts() throws GeoLocationBasedServiceException { Registry registry = getGovernanceRegistry(); String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS + GeoServices.ALERT_TYPE_EXIT + "/"; Resource resource; try { resource = registry.get(registryPath); } catch (RegistryException e) { log.error("Error while reading the registry path: " + registryPath); return Collections.emptyList(); } try { List<GeoFence> fences = new ArrayList<>(); if (resource != null) { Object contentObj = resource.getContent(); if (contentObj instanceof String[]) { String[] content = (String[]) contentObj; for (String res : content) { Resource childRes = registry.get(res); Properties props = childRes.getProperties(); GeoFence geoFence = new GeoFence(); InputStream inputStream = childRes.getContentStream(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); geoFence.setGeoJson(writer.toString()); List queryNameObj = (List) props.get(GeoServices.QUERY_NAME); geoFence.setQueryName(queryNameObj != null ? queryNameObj.get(0).toString() : null); List areaNameObj = (List) props.get(GeoServices.AREA_NAME); geoFence.setAreaName(areaNameObj != null ? areaNameObj.get(0).toString() : null); geoFence.setCreatedTime(childRes.getCreatedTime().getTime()); fences.add(geoFence); } } } return fences; } catch (RegistryException | IOException e) { throw new GeoLocationBasedServiceException( "Error occurred while getting the geo alerts", e); } }
Source:
<code><START> BundleContext getBundleContext() { <END> return Optional.ofNullable(FrameworkUtil.getBundle(getClass())) .map(Bundle::getBundleContext) .orElseThrow( () -> new IllegalStateException("Could not get the bundle for " + getClass().getName())); }</code><technical_language>suggestion</technical_language>

Target:
private BundleContext getBundleContext() { return Optional.ofNullable(bundleLookup.apply(getClass())) .map(Bundle::getBundleContext) .orElseThrow( () -> new IllegalStateException("Could not get the bundle for " + getClass().getName())); }
Source:
<code>private static QueryRunner createQueryRunner() throws Exception { DistributedQueryRunner queryRunner = HiveQueryRunner.createQueryRunner(getTables(), ImmutableMap.of(), "sql-standard", ImmutableMap.of("hive.pushdown-filter-enabled", "true"), Optional.empty()); queryRunner.execute(noPushdownFilter(queryRunner.getDefaultSession()), "CREATE TABLE lineitem_ex (linenumber, orderkey, partkey, suppkey, ship_by_air, is_returned, ship_day, ship_month, ship_timestamp, commit_timestamp, keys, nested_keys, flags) AS " + "SELECT linenumber, orderkey, partkey, suppkey, " + " IF (linenumber % 5 = 0, null, shipmode = 'AIR') AS ship_by_air, " + " IF (linenumber % 7 = 0, null, returnflag = 'R') AS is_returned, " + " IF (linenumber % 4 = 0, null, CAST(day(shipdate) AS TINYINT)) AS ship_day, " + " IF (linenumber % 6 = 0, null, CAST(month(shipdate) AS TINYINT)) AS ship_month, " + " IF (linenumber % 3 = 0, null, CAST(shipdate AS TIMESTAMP)) AS ship_timestamp, " + " IF (orderkey % 3 = 0, null, CAST(commitdate AS TIMESTAMP)) AS commit_timestamp, " + " IF (orderkey % 11 = 0, null, ARRAY[orderkey, partkey, suppkey]), " + " IF (orderkey % 13 = 0, null, ARRAY[ARRAY[orderkey, partkey], ARRAY[suppkey], IF (orderkey % 17 = 0, null, ARRAY[orderkey, partkey])]), " + " IF (orderkey % 17 = 0, null, ARRAY[shipmode = 'AIR', returnflag = 'R']) " + <START> "FROM lineitem l"); <END> return queryRunner; }</code><technical_language>this change is needed</technical_language>

Target:
private static QueryRunner createQueryRunner() throws Exception { DistributedQueryRunner queryRunner = HiveQueryRunner.createQueryRunner(getTables(), ImmutableMap.of(), "sql-standard", ImmutableMap.of("hive.pushdown-filter-enabled", "true"), Optional.empty()); queryRunner.execute(noPushdownFilter(queryRunner.getDefaultSession()), "CREATE TABLE lineitem_ex (linenumber, orderkey, partkey, suppkey, ship_by_air, is_returned, ship_day, ship_month, ship_timestamp, commit_timestamp, keys, nested_keys, flags) AS " + "SELECT linenumber, orderkey, partkey, suppkey, " + " IF (linenumber % 5 = 0, null, shipmode = 'AIR') AS ship_by_air, " + " IF (linenumber % 7 = 0, null, returnflag = 'R') AS is_returned, " + " IF (linenumber % 4 = 0, null, CAST(day(shipdate) AS TINYINT)) AS ship_day, " + " IF (linenumber % 6 = 0, null, CAST(month(shipdate) AS TINYINT)) AS ship_month, " + " IF (linenumber % 3 = 0, null, CAST(shipdate AS TIMESTAMP)) AS ship_timestamp, " + " IF (orderkey % 3 = 0, null, CAST(commitdate AS TIMESTAMP)) AS commit_timestamp, " + " IF (orderkey % 11 = 0, null, ARRAY[orderkey, partkey, suppkey]), " + " IF (orderkey % 13 = 0, null, ARRAY[ARRAY[orderkey, partkey], ARRAY[suppkey], IF (orderkey % 17 = 0, null, ARRAY[orderkey, partkey])]), " + " IF (orderkey % 17 = 0, null, ARRAY[shipmode = 'AIR', returnflag = 'R']) " + "FROM lineitem"); return queryRunner; }
Source:
<code>public Group createGroupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupRelationNotAllowed, GroupRelationAlreadyExists, WrongAttributeValueException, WrongReferenceAttributeValueException, ExternallyManagedException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); if (getGroupsManagerBl().isGroupInStructureSynchronizationTree(sess, resultGroup)) { throw new ExternallyManagedException("Result group: " + resultGroup + " is externally managed!"); } else if (getGroupsManagerBl().isGroupInStructureSynchronizationTree(sess, operandGroup)) { <START> throw new ExternallyManagedException("Operand group: " + operandGroup + " is externally managed!"); <END> } if ((!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup))) { throw new PrivilegeException(sess, "createGroupUnion"); } return getGroupsManagerBl().createGroupUnion(sess, resultGroup, operandGroup, false); }</code><technical_language>I if this is a problem. members synchronized group add group union. do think</technical_language>

Target:
public Group createGroupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupRelationNotAllowed, GroupRelationAlreadyExists, WrongAttributeValueException, WrongReferenceAttributeValueException, ExternallyManagedException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); if (getGroupsManagerBl().isGroupInStructureSynchronizationTree(sess, resultGroup)) { throw new ExternallyManagedException("Result group: " + resultGroup + " is externally managed!"); } if ((!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup))) { throw new PrivilegeException(sess, "createGroupUnion"); } return getGroupsManagerBl().createGroupUnion(sess, resultGroup, operandGroup, false); }
Source:
<code>public void processEntry(MarshalledEntry<K, V> marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { if (!taskContext.isStopped()) { <START> InternalCacheEntry<K, V> ice = PersistenceUtil.convert(marshalledEntry, entryFactory); <END> if (!ice.isExpired(timeService.wallClockTime())) { action.apply(marshalledEntry.getKey(), ice); } if (Thread.interrupted()) { throw new InterruptedException(); } } }</code><technical_language>curious if avoid converting MarshalledEntry InternalCacheEntry checking expiration. MarshalledEntry.getMetadata() here</technical_language>

Target:
public void processEntry(MarshalledEntry<K, V> marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { if (!taskContext.isStopped()) { InternalMetadata metadata = marshalledEntry.getMetadata(); if (metadata == null || !metadata.isExpired(timeService.wallClockTime())) { InternalCacheEntry<K, V> ice = PersistenceUtil.convert(marshalledEntry, entryFactory); action.apply(marshalledEntry.getKey(), ice); } if (Thread.interrupted()) { throw new InterruptedException(); } } }
Source:
<code>public void visitMethod(MethodTree tree) { super.visitMethod(tree); if (tree.block() != null) { CFG cfg = CFG.build(tree); try { UCFG uCFG = buildUCfg(tree, cfg); UCFGtoProtobuf.toProtobufFile(uCFG, filePath()); } catch (Exception e) { <START> LOG.error("Cannot generate ucfg in file "+fileKey+" for method at line"+tree.firstToken().line(), e); <END> } index++; } }</code><technical_language>@benzonico spaces +?:)</technical_language>

Target:
public void visitMethod(MethodTree tree) { super.visitMethod(tree); if (tree.block() != null) { CFG cfg = CFG.build(tree); try { UCFG uCFG = buildUCfg(tree, cfg); UCFGtoProtobuf.toProtobufFile(uCFG, filePath()); } catch (Exception e) { LOG.error("Cannot generate ucfg in file " + fileKey + " for method at line" + tree.firstToken().line(), e); } } }
Source:
<code>public void execute() throws MojoExecutionException, MojoFailureException { String osgiVersionStr = getOSGiVersion(); if (osgiVersionStr != null) { try { Version osgiVersion = Version.parseVersion(osgiVersionStr); if (!VersioningHelper.QUALIFIER.equals(osgiVersion.getQualifier())) { project.getProperties().put(BUILD_QUALIFIER_PROPERTY, osgiVersion.getQualifier()); project.getProperties().put(UNQUALIFIED_VERSION_PROPERTY, osgiVersion.getMajor() + "." + osgiVersion.getMinor() + "." + osgiVersion.getMicro()); return; } } catch (IllegalArgumentException e) { throw new MojoFailureException("Not a valid OSGi version " + osgiVersionStr + " for project " + project); } } String qualifier = forceContextQualifier; if (qualifier == null) { qualifier = buildPropertiesParser.parse(baseDir).getForceContextQualifier(); } if (qualifier == null) { Date timestamp = getBuildTimestamp(); qualifier = getQualifier(timestamp); } project.getProperties().put(BUILD_QUALIFIER_PROPERTY, qualifier); project.getProperties().put(UNQUALIFIED_VERSION_PROPERTY, getUnqualifiedVersion()); <START> getLog().info("Qualifier: " + getUnqualifiedVersion() + "." + qualifier); <END> }</code><technical_language>log is unqualified version qualifier, actually, qualifier</technical_language>

Target:
public void execute() throws MojoExecutionException, MojoFailureException { TychoProjectVersion projectVersion = calculateQualifiedVersion(); project.getProperties().put(BUILD_QUALIFIER_PROPERTY, projectVersion.qualifier); project.getProperties().put(UNQUALIFIED_VERSION_PROPERTY, projectVersion.unqualifiedVersion); getLog().info("The project's OSGi version is " + projectVersion.getOSGiVersion()); }
Source:
<code>private void findTop() throws IOException { while (source.hasTop()) { long colType = source.getTopKey().getTimestamp() & ColumnConstants.PREFIX_MASK; if (colType == TX_DONE_PREFIX || colType == WRITE_PREFIX || colType == DEL_LOCK_PREFIX) { source.skipToPrefix(source.getTopKey(), RLOCK_PREFIX); continue; } else if (colType == RLOCK_PREFIX) { if (ReadLockUtil.isDelete(source.getTopKey())) { lastDelete.set(source.getTopKey()); } else { if (lastDelete.equals(source.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)) { long ts1 = ReadLockUtil.decodeTs(source.getTopKey().getTimestamp() & TIMESTAMP_MASK); long ts2 = ReadLockUtil.decodeTs(lastDelete.getTimestamp() & TIMESTAMP_MASK); if (ts1 != ts2) { return; } } else { return; } } source.next(); continue; } else if (colType == DATA_PREFIX || colType == LOCK_PREFIX || colType == ACK_PREFIX) { source.skipColumn(source.getTopKey()); continue; } else { <START> throw new IllegalArgumentException("Uknown column type " + source.getTopKey()); <END> } } }</code><technical_language>Unknown Column Type</technical_language>

Target:
private void findTop() throws IOException { while (source.hasTop()) { long colType = source.getTopKey().getTimestamp() & ColumnConstants.PREFIX_MASK; if (colType == TX_DONE_PREFIX || colType == WRITE_PREFIX || colType == DEL_LOCK_PREFIX) { source.skipToPrefix(source.getTopKey(), RLOCK_PREFIX); continue; } else if (colType == RLOCK_PREFIX) { if (ReadLockUtil.isDelete(source.getTopKey())) { lastDelete.set(source.getTopKey()); } else { if (lastDelete.equals(source.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)) { long ts1 = ReadLockUtil.decodeTs(source.getTopKey().getTimestamp() & TIMESTAMP_MASK); long ts2 = ReadLockUtil.decodeTs(lastDelete.getTimestamp() & TIMESTAMP_MASK); if (ts1 != ts2) { return; } } else { return; } } source.next(); continue; } else if (colType == DATA_PREFIX || colType == LOCK_PREFIX || colType == ACK_PREFIX) { source.skipColumn(source.getTopKey()); continue; } else { throw new IllegalArgumentException("Unknown column type " + source.getTopKey()); } } }
Source:
<code>void updateContainerBucket(Long bucketKey, String serviceId, String containerId, long value) { if (bucketKey != null && containerBuckets.containsKey(bucketKey)) { <START> Map<String, Map<String, Long>> deltaInValidDataSizePerContainer = containerBuckets.get(bucketKey); <END> updateNestedMapHelper(deltaInValidDataSizePerContainer, serviceId, containerId, value); } }</code><technical_language>deltaInValidDataSize is good enough. in line 138</technical_language>

Target:
void updateContainerBucket(Long bucketKey, String serviceId, String containerId, long value) { if (bucketKey != null && containerBuckets.containsKey(bucketKey)) { Map<String, Map<String, Long>> existingBucketEntry = containerBuckets.get(bucketKey); updateNestedMapHelper(existingBucketEntry, serviceId, containerId, value); } }
Source:
<code>private PartitionBy partitionByForString(String key) { if ( key == null ) return null; switch(key) { case "table": return PartitionBy.TABLE; case "database": return PartitionBy.DATABASE; case "primary_key": return PartitionBy.PRIMARY_KEY; case "column": return PartitionBy.COLUMN; default: <START> return null; <END> } }</code><technical_language>default database before</technical_language>

Target:
private PartitionBy partitionByForString(String key) { if ( key == null ) return PartitionBy.DATABASE; switch(key) { case "table": return PartitionBy.TABLE; case "database": return PartitionBy.DATABASE; case "primary_key": return PartitionBy.PRIMARY_KEY; case "column": return PartitionBy.COLUMN; default: throw new RuntimeException("Unknown partitionBy string: " + key); } }
Source:
<code>public boolean isDone(final TreeWalk walker) { <START> return pathRaw.length == walker.getRawPath().length; <END> }</code><technical_language>I generate a copy of path right test length of it. expose a method TreeWalk exports path length</technical_language>

Target:
public boolean isDone(final TreeWalk walker) { return pathRaw.length == walker.getPathLength(); }
Source:
<code>public void registerAttributes(ManagementResourceRegistration resourceRegistration) { AbstractWriteAttributeHandler writeAttribute = new ActiveMQReloadRequiredHandlers.WriteAttributeHandler(ATTRIBUTES); for (AttributeDefinition attribute : ATTRIBUTES) { resourceRegistration.registerReadWriteAttribute(attribute, null, writeAttribute); } <START> HAPolicySynchronizationStatusReadHandler.registerMasterAttributes(resourceRegistration); <END> }</code><technical_language>This registered HC</technical_language>

Target:
public void registerAttributes(ManagementResourceRegistration resourceRegistration) { AbstractWriteAttributeHandler writeAttribute = new ActiveMQReloadRequiredHandlers.WriteAttributeHandler(ATTRIBUTES); for (AttributeDefinition attribute : ATTRIBUTES) { resourceRegistration.registerReadWriteAttribute(attribute, null, writeAttribute); } if(registerRuntime) { HAPolicySynchronizationStatusReadHandler.registerMasterAttributes(resourceRegistration); } }
Source:
<code>protected Optional<TypedValue> getValue(String name, StatementContext ctx) { <START> Method method = ctx.getConfig(ClassMethodCache.class).getCache() <END> .computeIfAbsent(obj.getClass(), ObjectMethodArguments::load) .get(name); if (method == null) { return Optional.empty(); } QualifiedType<?> type = QualifiedType.of(method.getGenericReturnType()) .withAnnotations(ctx.getConfig(Qualifiers.class).qualifiers(method)); Object value = invokeMethod(method, ctx); return Optional.of(new TypedValue(type, value)); }</code><technical_language>Minor nit, ClassMethodCache is a slight misnomer, caching no-arg methods</technical_language>

Target:
protected Optional<TypedValue> getValue(String name, StatementContext ctx) { Method method = NULLARY_METHOD_CACHE.get(obj.getClass(), ctx).get(name); if (method == null) { return Optional.empty(); } QualifiedType<?> type = QualifiedType.of(method.getGenericReturnType()) .withAnnotations(ctx.getConfig(Qualifiers.class).findFor(method)); Object value = invokeMethod(method, ctx); return Optional.of(new TypedValue(type, value)); }
Source:
<code>public static void main(String[] args) { try { CLIParse parser = new CLIParse(args); if (parser.hasArg("?") || parser.hasArg("help") || args.length == 0) { printUsage(); return; } if (!validate(parser)) { return; } String alias = "engine"; if (parser.hasArg("alias")) { alias = parser.getArg("alias"); } if (parser.hasArg("enc")) { System.out.println( EncryptionUtils.encrypt( parser.getArg("string"), parser.getArg("store"), parser.getArg("pass"), alias ).trim().replace("\r\n", "") ); } else if (parser.hasArg("dec")) { System.out.println( EncryptionUtils.decrypt( parser.getArg("string"), parser.getArg("store"), parser.getArg("pass"), alias ) ); } else if (parser.hasArg("pvk")) { System.out.write( pvk( parser.getArg("store"), parser.getArg("pass"), alias ) ); } else if (parser.hasArg("pubkey2ssh")) { System.out.println( pubkey2ssh( parser.getArg("store"), parser.getArg("pass"), alias ) ); } System.exit(0); } catch (Exception e) { System.out.println("Operation failed!"); <START> System.exit(1); <END> } }</code><technical_language>Juan, I prefer a single exit point multiple points. Do mind defining Integer exitCode = 0 in method beginning, a single System.exit(exitCode) method's end? simply need set this in catch block 1</technical_language>

Target:
public static void main(String[] args) { int exitCode = 0; try { CLIParse parser = new CLIParse(args); if (parser.hasArg("?") || parser.hasArg("help") || args.length == 0) { printUsage(); return; } if (!validate(parser)) { exitCode = 1; return; } String alias = "engine"; if (parser.hasArg("alias")) { alias = parser.getArg("alias"); } if (parser.hasArg("enc")) { System.out.println( EncryptionUtils.encrypt( parser.getArg("string"), parser.getArg("store"), parser.getArg("pass"), alias ).trim().replace("\r\n", "") ); } else if (parser.hasArg("dec")) { System.out.println( EncryptionUtils.decrypt( parser.getArg("string"), parser.getArg("store"), parser.getArg("pass"), alias ) ); } else if (parser.hasArg("pvk")) { System.out.write( pvk( parser.getArg("store"), parser.getArg("pass"), alias ) ); } else if (parser.hasArg("pubkey2ssh")) { System.out.println( pubkey2ssh( parser.getArg("store"), parser.getArg("pass"), alias ) ); } } catch (Exception e) { System.out.println("Operation failed!"); exitCode = 1; } finally { System.exit(exitCode); } }
Source:
<code>public void shutdown() throws InterruptedException { for (VoltNetwork vn : m_networks) { vn.shutdown(); } <START> ReverseDNSCache.m_es.shutdown(); <END> }</code><technical_language>catch exceptions vn.shutdown() ensure ReverseDNSCache.m_es.shutdown() is invoked</technical_language>

Target:
public void shutdown() throws InterruptedException { for (VoltNetwork vn : m_networks) { vn.shutdown(); } }
Source:
<code>public void run(ExternalContext externalContext) { <START> if (isAppModeBatch) { <END> initializeRunId(); } LocalJobPlanner planner = getPlanner(); try { List<JobConfig> jobConfigs = planner.prepareJobs(); if (jobConfigs.isEmpty()) { throw new SamzaException("No jobs to run."); } jobConfigs.forEach(jobConfig -> { LOG.debug("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); StreamProcessor processor = createStreamProcessor(jobConfig, appDesc, sp -> new LocalStreamProcessorLifecycleListener(sp, jobConfig), Optional.ofNullable(externalContext)); processors.add(processor); }); numProcessorsToStart.set(processors.size()); processors.forEach(StreamProcessor::start); } catch (Throwable throwable) { cleanup(); appStatus = ApplicationStatus.unsuccessfulFinish(throwable); shutdownLatch.countDown(); throw new SamzaException(String.format("Failed to start application: %s", new ApplicationConfig(appDesc.getConfig()).getGlobalAppId()), throwable); } }</code><technical_language>remove this check do this check initializeRunId()</technical_language>

Target:
public void run(ExternalContext externalContext) { initializeRunId(); LocalJobPlanner planner = getPlanner(); try { List<JobConfig> jobConfigs = planner.prepareJobs(); if (jobConfigs.isEmpty()) { throw new SamzaException("No jobs to run."); } jobConfigs.forEach(jobConfig -> { LOG.debug("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); StreamProcessor processor = createStreamProcessor(jobConfig, appDesc, sp -> new LocalStreamProcessorLifecycleListener(sp, jobConfig), Optional.ofNullable(externalContext)); processors.add(processor); }); numProcessorsToStart.set(processors.size()); processors.forEach(StreamProcessor::start); } catch (Throwable throwable) { cleanup(); appStatus = ApplicationStatus.unsuccessfulFinish(throwable); shutdownLatch.countDown(); throw new SamzaException(String.format("Failed to start application: %s", new ApplicationConfig(appDesc.getConfig()).getGlobalAppId()), throwable); } }
Source:
<code>public static Class<?> getColumnClass(Column column) { switch (column) { case HREF_ID: return Integer.class; case REQUEST_TIMESTAMP: return Date.class; case RESPONSE_TIMESTAMP: return Date.class; case HREF_TYPE: return Integer.class; case METHOD: return String.class; case URL: return String.class; case STATUS_CODE: return Integer.class; case STATUS_REASON: return String.class; case RTT: return Integer.class; case SIZE_MESSAGE: case SIZE_REQUEST_HEADER: case SIZE_REQUEST_BODY: case SIZE_RESPONSE_HEADER: case SIZE_RESPONSE_BODY: return Integer.class; case SESSION_ID: return Long.class; case HIGHEST_ALERT: return AlertRiskTableCellItem.class; case NOTE: return Boolean.class; case TAGS: return String.class; case CUSTOM: return null; case HOSTNAME: <START> return String.class; <END> case PATH_AND_QUERY: return String.class; case PATH: return String.class; case QUERY: return String.class; default: return String.class; } }</code><technical_language>fall-through</technical_language>

Target:
public static Class<?> getColumnClass(Column column) { switch (column) { case HREF_ID: return Integer.class; case REQUEST_TIMESTAMP: return Date.class; case RESPONSE_TIMESTAMP: return Date.class; case HREF_TYPE: return Integer.class; case METHOD: return String.class; case URL: case HOSTNAME: case PATH_AND_QUERY: return String.class; case STATUS_CODE: return Integer.class; case STATUS_REASON: return String.class; case RTT: return Integer.class; case SIZE_MESSAGE: case SIZE_REQUEST_HEADER: case SIZE_REQUEST_BODY: case SIZE_RESPONSE_HEADER: case SIZE_RESPONSE_BODY: return Integer.class; case SESSION_ID: return Long.class; case HIGHEST_ALERT: return AlertRiskTableCellItem.class; case NOTE: return Boolean.class; case TAGS: return String.class; case CUSTOM: return null; default: return String.class; } }
Source:
<code>public List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> getPendingOperations (@HeaderParam("Accept") String acceptHeader, @PathParam("id") String id, List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> resultOperations) { if (log.isDebugEnabled()) { log.debug("Invoking Android pending operations:" + id); } Message message = new Message(); MediaType responseMediaType = AndroidAPIUtils.getResponseMediaType(acceptHeader); try { if (resultOperations != null) { updateOperations(resultOperations); } } catch (OperationManagementException e) { <START> message.setResponseMessage("Issue in retrieving operation management service instance"); <END> log.error(message.getResponseMessage(), e); } DeviceIdentifier deviceIdentifier = AndroidAPIUtils.convertToDeviceIdentifierObject(id); List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> operations; try { operations = AndroidAPIUtils.getPendingOperations(deviceIdentifier); } catch (OperationManagementException e) { message.setResponseMessage("Issue in retrieving operation management service instance"); message.setResponseCode(Response.Status.INTERNAL_SERVER_ERROR.toString()); log.error(message.getResponseMessage(), e); throw new AndroidOperationException(message, responseMediaType); } return operations; }</code><technical_language>assign error message a proper String variable pass for logging instance of "Message"</technical_language>

Target:
public List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> getPendingOperations (@HeaderParam("Accept") String acceptHeader, @PathParam("id") String id, List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> resultOperations) { if (log.isDebugEnabled()) { log.debug("Invoking Android pending operations:" + id); } Message message = new Message(); MediaType responseMediaType = AndroidAPIUtils.getResponseMediaType(acceptHeader); try { if (resultOperations != null) { updateOperations(resultOperations); } } catch (OperationManagementException e) { message.setResponseMessage("Issue in retrieving operation management service instance"); log.error(message.getResponseMessage(), e); } DeviceIdentifier deviceIdentifier = AndroidAPIUtils.convertToDeviceIdentifierObject(id); List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> operations; try { operations = AndroidAPIUtils.getPendingOperations(deviceIdentifier); } catch (OperationManagementException e) { String errorMessage = "Issue in retrieving operation management service instance"; message.setResponseMessage(errorMessage); message.setResponseCode(Response.Status.INTERNAL_SERVER_ERROR.toString()); log.error(errorMessage, e); throw new AndroidOperationException(message, responseMediaType); } return operations; }
Source:
<code>public void handle(String input, Console console) { isInvincible = SolShip.isInvincible; if(hero.isDead()){ console.warn("Cannot make invincible when dead"); return; } if(hero.isTranscendent()){ console.warn("Cannot make invincible when transdencent"); return; } if(isInvincible == false){ console.warn("Set player as invincible"); SolShip.setInvincible(); <START> }else if(isInvincible == true){ <END> console.warn("Set player as non invincible"); SolShip.setNonInvincible(); } }</code><technical_language>suggestion } else if (isInvincible == true) {</technical_language>

Target:
public void handle(String input, Console console) { if (hero.isDead()) { console.warn("Cannot make invincible when dead"); return; } if (hero.isTranscendent()) { console.warn("Cannot make invincible when transdencent"); return; } if (!hero.isInvincible()) { console.info("Set player as invincible"); hero.setInvincible(true); } else if (hero.isInvincible()) { console.info("Set player as non invincible"); hero.setInvincible(false); } }
Source:
<code>public static ImmutablePair<String, String> executeCommand(String command, File workingDir) { <START> return executeCommand(command, true, Optional.of(ByteStreams.nullOutputStream()), Optional.of(ByteStreams.nullOutputStream()), workingDir); <END> }</code><technical_language>1. This call next method DEFAULT_TIMEOUT_MILLISECONDS extra param 2. Line 85/86 call this method null extra parameter. I that, command, true, Optional.of(ByteStreams.nullOutputStream()), Optional.of(ByteStreams.nullOutputStream()) in file, 3 times</technical_language>

Target:
public static ImmutablePair<String, String> executeCommand(String command, File workingDir) { return executeCommand(command, workingDir, DEFAULT_TIMEOUT_MILLISECONDS); }
Source:
<code>private boolean shouldUpdateDiskProperties() { return getOldDisk().isBoot() != getNewDisk().isBoot() || getOldDisk().getDiskInterface().getValue() != getNewDisk().getDiskInterface().getValue() || getOldDisk().getPropagateErrors().getValue() != getNewDisk().getPropagateErrors().getValue() || getOldDisk().isWipeAfterDelete() != getNewDisk().isWipeAfterDelete() || getOldDisk().isShareable() != getNewDisk().isShareable() || !StringUtils.equalsIgnoreCase(getOldDisk().getDiskDescription(), getNewDisk().getDiskDescription()) || <START> !StringUtils.equalsIgnoreCase(getOldDisk().getDiskAlias(), getNewDisk().getDiskAlias()); <END> }</code><technical_language>ignore case</technical_language>

Target:
private boolean shouldUpdateDiskProperties() { return getOldDisk().isBoot() != getNewDisk().isBoot() || getOldDisk().getDiskInterface().getValue() != getNewDisk().getDiskInterface().getValue() || getOldDisk().getPropagateErrors().getValue() != getNewDisk().getPropagateErrors().getValue() || getOldDisk().isWipeAfterDelete() != getNewDisk().isWipeAfterDelete() || getOldDisk().isShareable() != getNewDisk().isShareable() || !StringUtils.equals(getOldDisk().getDiskDescription(), getNewDisk().getDiskDescription()) || !StringUtils.equals(getOldDisk().getDiskAlias(), getNewDisk().getDiskAlias()); }
Source:
<code>public StanzaIdElement(String id, String by) { <START> this.id = id; <END> this.by = by; }</code><technical_language>Missing StringUtils.isNotNullOrEmpty() check</technical_language>

Target:
public StanzaIdElement(String id, String by) { super(id); this.by = by; }
Source:
<code><START> protected final synchronized void destroyThreadPool() { <END> if (threadPool != null) { LOG.debug("Destroying thread pool"); HadoopExecutors.shutdown(threadPool, LOG, THREAD_POOL_SHUTDOWN_DELAY, TimeUnit.SECONDS); threadPool = null; } }</code><technical_language>nit: final</technical_language>

Target:
protected synchronized void destroyThreadPool() { if (threadPool != null) { LOG.debug("Destroying thread pool"); HadoopExecutors.shutdown(threadPool, LOG, THREAD_POOL_SHUTDOWN_DELAY_SECONDS, TimeUnit.SECONDS); threadPool = null; } }
Source:
<code>private Instance awaitAvailable(Instance instance, InstanceApi iapi) { for (int n = 0; n < 40; n = n + 1) { Instance updatedInstance = iapi.get(instance.getId()); if (updatedInstance.getStatus() == Instance.Status.ACTIVE) return updatedInstance; if (updatedInstance.getStatus() == Instance.Status.UNRECOGNIZED) return null; try { Thread.sleep(15000); } catch (InterruptedException e) { <START> logger.info(e.getStackTrace().toString()); <END> } } return null; }</code><technical_language>Info warn..</technical_language>

Target:
private Instance awaitAvailable(Instance instance, InstanceApi iapi) { for (int n = 0; n < 100; n = n + 1) { Instance updatedInstance = iapi.get(instance.getId()); if (updatedInstance.getStatus() == Instance.Status.ACTIVE) return updatedInstance; if (updatedInstance.getStatus() == Instance.Status.UNRECOGNIZED) return null; Uninterruptibles.sleepUninterruptibly(15, TimeUnit.SECONDS); } return null; }