auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void toStringBuilder(Object object, StringBuilder builder) { if (object == null) { return; } if (object instanceof Iterable) { <START> toStringBuilder((Iterable) object, <END> builder); } else if (object instanceof Object[]) { toStringBuilder(Arrays.asList((Object[]) object), builder); } else if (object instanceof Map) { toStringBuilder((Map<String, Object>) object, builder); } else { builder.append(object.toString()); } }</code><technical_language>Generics: Iterable<Object></technical_language>

Target:
public static void toStringBuilder(Object object, StringBuilder builder) { if (object == null) { return; } if (object instanceof Iterable) { toStringBuilder((Iterable<Object>) object, builder); } else if (object instanceof Object[]) { toStringBuilder(Arrays.asList((Object[]) object), builder); } else if (object instanceof Map) { toStringBuilder((Map<String, Object>) object, builder); } else { builder.append(object.toString()); } }
Source:
<code>public void createStorageAccount(AuthenticatedContext ac, AzureClient client, String resourceGroup, String storageName, String region, CloudStack stack) { StorageAccount storageAccount = client.getStorageAccountByGroup(resourceGroup, storageName); if (storageAccount == null) { try { LOGGER.info("Creating storage account: {}", storageName); armStorage.createStorage(client, storageName, LOCALLY_REDUNDANT, resourceGroup, region, isEncryptionNeeded(stack), stack.getTags()); pollStorageAccountCreation(ac, new StorageAccountCheckerContext(client, resourceGroup, storageName)); LOGGER.info("Creating container: in storage storage account: {}", IMAGES_CONTAINER, storageName); <START> client.createContainerInStorage(resourceGroup, storageName, IMAGES_CONTAINER); <END> } catch (CloudException e) { LOGGER.warn("Error during storage account creation: {}.", storageName, e); } } else { LOGGER.info("Storage account already exist in resource group {}", storageName, resourceGroup); } }</code><technical_language>pls. a separate method for this rename this is this,</technical_language>

Target:
public void createStorageAccount(AuthenticatedContext ac, AzureClient client, String resourceGroup, String storageName, String region, CloudStack stack) { StorageAccount storageAccount = client.getStorageAccountByGroup(resourceGroup, storageName); if (storageAccount == null) { try { LOGGER.info("Creating storage account: {}", storageName); armStorage.createStorage(client, storageName, LOCALLY_REDUNDANT, resourceGroup, region, isEncryptionNeeded(stack), stack.getTags()); pollStorageAccountCreation(ac, new StorageAccountCheckerContext(client, resourceGroup, storageName)); } catch (CloudException e) { LOGGER.error("Error during storage account creation: {}.", storageName, e); throw new CloudConnectorException("Storage account creation failed.", e); } } else { LOGGER.info("Storage account already exist in resource group {}", storageName, resourceGroup); } }
Source:
<code>public void empty() { for (String cache : cacheManager.getCacheNames()) { <START> if (cacheManager.getCacheConfiguration(cache) != null) { <END> TransactionConfiguration txConfig = cacheManager.getCacheConfiguration(cache).transaction(); boolean needsTx = (txConfig != null && txConfig.transactionMode() == TransactionMode.TRANSACTIONAL && !txConfig.autoCommit()); Cache<Object, Object> c = cacheManager.getCache(cache, false); if (c == null) continue; try { if (needsTx) { c.getAdvancedCache().getTransactionManager().begin(); } c.clear(); if (needsTx) { c.getAdvancedCache().getTransactionManager().commit(); } } catch (Exception e) { throw new RuntimeException("Failed to clear cache " + cache, e); } } } }</code><technical_language>querying stuff generate caches configuration</technical_language>

Target:
public void empty() { for (String cache : cacheManager.getCacheNames()) { TransactionConfiguration txConfig = cacheManager.getCacheConfiguration(cache).transaction(); boolean needsTx = (txConfig != null && txConfig.transactionMode() == TransactionMode.TRANSACTIONAL && !txConfig.autoCommit()); Cache<Object, Object> c = cacheManager.getCache(cache, false); if (c == null) continue; try { if (needsTx) { c.getAdvancedCache().getTransactionManager().begin(); } c.clear(); if (needsTx) { c.getAdvancedCache().getTransactionManager().commit(); } } catch (Exception e) { throw new RuntimeException("Failed to clear cache " + cache, e); } } }
Source:
<code>public String getCurrentUserId() { if (currentUserId != null) { return currentUserId; } try { <START> currentUserId = this.getSession().getLoggedInUser().getUniqueId(); <END> return currentUserId; } catch (SessionUnavailableException e) { return ""; } }</code><technical_language>this live time? feel this is a super expensive call</technical_language>

Target:
public String getCurrentUserId() { try { return this.getSession().getLoggedInUser().getUniqueId(); } catch (SessionUnavailableException e) { return ""; } }
Source:
<code>public SearchResponse search(SearchRequest request) { String[] indices = request.indices(); <START> if (indices == null && indices.length != 1) { <END> throw new IllegalStateException("Search on audit must include index name: " + request); } if (! getESIndexName().equals(indices[0])) { throw new IllegalStateException("Search on audit must be on audit index: " + request); } return esClient.search(request); }</code><technical_language>indices == null && indices.length != 1 is wrong, do ||</technical_language>

Target:
public SearchResponse search(SearchRequest request) { String[] indices = request.indices(); if (indices == null || indices.length != 1) { throw new IllegalStateException("Search on audit must include index name: " + request); } if (!getESIndexName().equals(indices[0])) { throw new IllegalStateException("Search on audit must be on audit index: " + request); } return esClient.search(request); }
Source:
<code>long gtk_size_allocate (long widget, long allocation) { Point point = getLocation (); int x = point.x; int y = point.y; long screen = OS.gdk_screen_get_default (); OS.gtk_widget_realize (widget); <START> int monitorNumber = OS.gdk_screen_get_monitor_at_point(screen,point.x,point.y)+1; <END> System.out.println("monitor number is "+monitorNumber); GdkRectangle dest = new GdkRectangle (); OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest); GtkAllocation widgetAllocation = new GtkAllocation (); OS.gtk_widget_get_allocation (widget, widgetAllocation); int w = widgetAllocation.width; int h = widgetAllocation.height; if (dest.height < y + h) y -= h; if (dest.width < x + w) x -= w; OS.gtk_window_move (widget, x, y); return 0; }</code><technical_language>testing remnants. :)</technical_language>

Target:
long gtk_size_allocate (long widget, long allocation) { Point point = getLocation (); int x = point.x; int y = point.y; long screen = OS.gdk_screen_get_default (); OS.gtk_widget_realize (widget); int monitorNumber = OS.gdk_screen_get_monitor_at_point(screen,point.x,point.y); GdkRectangle dest = new GdkRectangle (); OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest); GtkAllocation widgetAllocation = new GtkAllocation (); OS.gtk_widget_get_allocation (widget, widgetAllocation); int w = widgetAllocation.width; int h = widgetAllocation.height; if (dest.height < y + h) y -= h; if (dest.width < x + w) x -= w; OS.gtk_window_move (widget, x, y); return 0; }
Source:
<code>private static String getRelativePath(Class<?> service, Class<?> parentService) { <START> PathKey key = new PathKey(service, parentService); <END> if (pathCache.containsKey(key)) { return pathCache.get(key); } else { for (Method method : parentService.getMethods()) { if (method.getName().startsWith("get") && method.getReturnType() == service) { Path pathAnnotation = method.getAnnotation(Path.class); if (pathAnnotation!=null) { pathCache.put(key, pathAnnotation.value()); return pathAnnotation.value(); } } } } log.error("Can't find relative path for class \"" + service.getName() + "\", will return null"); return null; }</code><technical_language>avoid lookup this: String path = pathCache.get(key); if (path == null) { ... } return path;</technical_language>

Target:
private static String getRelativePath(Class<?> service, Class<?> parentService) { PathKey key = new PathKey(service, parentService); String path = pathCache.get(key); if (path!=null) { return path; } else { for (Method method : parentService.getMethods()) { if (method.getName().startsWith("get") && method.getReturnType() == service) { Path pathAnnotation = method.getAnnotation(Path.class); if (pathAnnotation != null) { pathCache.put(key, pathAnnotation.value()); return pathAnnotation.value(); } } } } log.error("Can't find relative path for class \"" + service.getName() + "\", will return null"); return null; }
Source:
<code>public String nextValue() { if (hasRolledOver && throwExceptionOnRollover) { <START> throw new RuntimeException("The generator has rolled over to the beginning"); <END> } final StringBuilder buffer = new StringBuilder(length); for (int i = 0; i < length; i++) { buffer.append(Character.toChars(characterSet[indices[i]])); } for (int i = length - 1; i >= 0; --i) { if (indices[i] >= characterSet.length - 1) { indices[i] = 0; if (i == 0 || characterSet.length == 1 && lastValue != null) { hasRolledOver = true; } } else { ++indices[i]; break; } } lastValue = buffer.toString(); return lastValue; }</code><technical_language>this a subclass of RuntimeException if folks want catch for reason parse message. alternatively, add accessor for hasRolledOver in case a user need if rolled over, want consider error</technical_language>

Target:
public String nextValue() { if (hasRolledOver && throwExceptionOnRollover) { throw new NoSuchElementException("The generator has rolled over to the beginning"); } final StringBuilder buffer = new StringBuilder(length); for (int i = 0; i < length; i++) { buffer.append(Character.toChars(characterSet[indices[i]])); } for (int i = length - 1; i >= 0; --i) { if (indices[i] >= characterSet.length - 1) { indices[i] = 0; if (i == 0 || characterSet.length == 1 && lastValue != null) { hasRolledOver = true; } } else { ++indices[i]; break; } } lastValue = buffer.toString(); return lastValue; }
Source:
<code>public void run() { try { InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line = null; long startTime = System.currentTimeMillis(); while ((line = br.readLine()) != null) { if ((System.currentTimeMillis() - startTime) > 5000) { LOGGER.info(line); startTime = System.currentTimeMillis(); } } } catch (IOException ioe) { <START> ioe.printStackTrace(); <END> } }</code><technical_language>LOGGER.warn()</technical_language>

Target:
public void run() { try { InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line = null; long startTime = System.currentTimeMillis(); while ((line = br.readLine()) != null) { if ((System.currentTimeMillis() - startTime) > 5000) { LOGGER.info(line); startTime = System.currentTimeMillis(); } } } catch (IOException ioe) { LOGGER.warn("Fail to print shell output", ioe); } }
Source:
<code>protected void init() { key = UUID.randomUUID().toString().replaceAll("-", ""); <START> value = UUID.randomUUID().toString().replaceAll("-", ""); <END> }</code><technical_language>this "key id formatting convention" is applied everywhere. create a static helper randomKey() generate key ids</technical_language>

Target:
protected void init() { key = randomString(); value = randomString(); }
Source:
<code>protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { boolean elevatorAtTop = Elevator.atTop.get(); if (!elevatorAtTop) { Elevator.setTop.event(); } float currentClampHeight = Clamp.heightReadout.get(); if (currentClampHeight < AutoLoader.clampHeightThreshold.get()) { Clamp.mode.set(Clamp.MODE_HEIGHT); Clamp.height.set(AutoLoader.clampHeightThreshold.get()); if (elevatorAtTop) { waitUntil(Clamp.atDesiredHeight); } else { waitUntil(BooleanMixing.andBooleans(Clamp.atDesiredHeight, Elevator.atTop)); } } else { if (!elevatorAtTop) { waitUntil(Elevator.atTop); } <START> } <END> Rollers.direction.set(Rollers.REVERSE); Rollers.running.set(true); Rollers.closed.set(true); waitUntil(AutoLoader.crateInPosition); Rollers.running.set(false); Rollers.closed.set(false); setClampOpen(true); setClampHeight(0.0f); singleSideTurn((long) (containerTurnTime.get() * 1000), true); pickupContainer(nudge.get()); turn(-autoZoneAngle.get(), true); waitForTime(500); DriveCode.octocanumShifting.set(true); drive(autoZoneDistance.get(), autoZoneSpeed.get()); DriveCode.octocanumShifting.set(false); waitForTime(500); depositContainer(containerHeight.get()); setClampHeight(1.0f); }</code><technical_language>stuff applies here. Note separate loading out function</technical_language>

Target:
protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { collectTote(); setClampOpen(true); setClampHeight(0.0f); singleSideTurn((long) (containerTurnTime.get() * 1000), true); pickupContainer(nudge.get()); turn(-autoZoneAngle.get(), true); waitForTime(500); DriveCode.octocanumShifting.set(true); drive(autoZoneDistance.get(), autoZoneSpeed.get()); DriveCode.octocanumShifting.set(false); waitForTime(500); depositContainer(containerHeight.get()); }
Source:
<code>public static HostAndPort getBrooklynAccessibleAddress(Entity entity, int port) { String host; PortForwardManager pfw = entity.getConfig(PORT_FORWARDING_MANAGER); if (pfw!=null) { Collection<Location> ll = entity.getLocations(); Optional<SupportsPortForwarding> machine = Machines.findUniqueElement(ll, SupportsPortForwarding.class); if (machine.isPresent()) { synchronized (BrooklynAccessUtils.class) { HostAndPort hp = pfw.lookup((MachineLocation)machine.get(), port); if (hp!=null) return hp; <START> Location l = Iterables.getOnlyElement(ll); <END> if (l instanceof SupportsPortForwarding) { Cidr source = entity.getConfig(MANAGEMENT_ACCESS_CIDR); if (source!=null) { log.debug("BrooklynAccessUtils requesting new port-forwarding rule to access "+port+" on "+entity+" (at "+l+", enabled for "+source+")"); hp = ((SupportsPortForwarding) l).getSocketEndpointFor(source, port); if (hp!=null) return hp; } else { log.warn("No "+MANAGEMENT_ACCESS_CIDR.getName()+" configured for "+entity+", so cannot forward port "+port+" " + "even though "+PORT_FORWARDING_MANAGER.getName()+" was supplied"); } } } } } host = entity.getAttribute(Attributes.HOSTNAME); if (host!=null) return HostAndPort.fromParts(host, port); throw new IllegalStateException("Cannot find way to access port "+port+" on "+entity+" from Brooklyn (no host.name)"); }</code><technical_language>this Iterables.getOnlyElement(ll) needs (MachineLocation)machine.get()</technical_language>

Target:
public static HostAndPort getBrooklynAccessibleAddress(Entity entity, int port) { String host; PortForwardManager pfw = entity.getConfig(PORT_FORWARDING_MANAGER); if (pfw!=null) { Collection<Location> ll = entity.getLocations(); Optional<SupportsPortForwarding> machine = Machines.findUniqueElement(ll, SupportsPortForwarding.class); if (machine.isPresent()) { synchronized (BrooklynAccessUtils.class) { HostAndPort hp = pfw.lookup((MachineLocation)machine.get(), port); if (hp!=null) return hp; Location l = (Location) machine.get(); if (l instanceof SupportsPortForwarding) { Cidr source = entity.getConfig(MANAGEMENT_ACCESS_CIDR); if (source!=null) { log.debug("BrooklynAccessUtils requesting new port-forwarding rule to access "+port+" on "+entity+" (at "+l+", enabled for "+source+")"); hp = ((SupportsPortForwarding) l).getSocketEndpointFor(source, port); if (hp!=null) return hp; } else { log.warn("No "+MANAGEMENT_ACCESS_CIDR.getName()+" configured for "+entity+", so cannot forward port "+port+" " + "even though "+PORT_FORWARDING_MANAGER.getName()+" was supplied"); } } } } } host = entity.getAttribute(Attributes.HOSTNAME); if (host!=null) return HostAndPort.fromParts(host, port); throw new IllegalStateException("Cannot find way to access port "+port+" on "+entity+" from Brooklyn (no host.name)"); }
Source:
<code>private Map<String, Map<String, String>> getTaskModels(JBPMProcessModel model) { Map<String, Map<String, String>> taskModels = new HashMap<>(); final List<TaskFormModel> taskFormModels = model.getTaskFormModels(); <START> for (TaskFormModel taskFormModel : taskFormModels) { <END> final Map<String, String> taskVariables = taskFormModel.getProperties().stream().collect(Collectors.toMap(ModelProperty::getName, p -> p.getTypeInfo().getClassName())); taskModels.put(taskFormModel.getTaskName(), taskVariables); } return taskModels; }</code><technical_language>Another opportunity for a nice stream pipeline</technical_language>

Target:
private Map<String, Map<String, String>> getTaskModels(JBPMProcessModel model) { return model.getTaskFormModels().stream().collect(Collectors.toMap( TaskFormModel::getTaskName, getTaskVariables() )); }
Source:
<code>protected boolean tryToReadLine( boolean applyFilter ) throws KettleFileException { String[] saGetLine = TextFileInputUtils.getLine( log, isr, data.encodingType, data.fileFormatType, data.lineStringBuilder, meta.getEnclosure(), lineNumberInFile ); String line = saGetLine[0]; <START> lineNumberInFile = Long.parseLong( saGetLine[1] ); <END> if ( line != null ) { if ( applyFilter ) { boolean isFilterLastLine = false; boolean filterOK = checkFilterRow( line, isFilterLastLine ); if ( filterOK ) { data.lineBuffer.add( new TextFileLine( line, lineNumberInFile++, data.file ) ); } else { return false; } } else { if ( !meta.content.noEmptyLines || line.length() != 0 ) { data.lineBuffer.add( new TextFileLine( line, lineNumberInFile++, data.file ) ); } } } else { data.doneReading = true; } return true; }</code><technical_language>I note this is a hack. This is unnecessary data conversion create performance issues large files</technical_language>

Target:
protected boolean tryToReadLine( boolean applyFilter ) throws KettleFileException { TextFileLine textFileLine = TextFileInputUtils .getLine( log, isr, data.encodingType, data.fileFormatType, data.lineStringBuilder, meta.getEnclosure(), lineNumberInFile ); String line = textFileLine.line; lineNumberInFile = textFileLine.lineNumber; if ( line != null ) { if ( applyFilter ) { boolean isFilterLastLine = false; boolean filterOK = checkFilterRow( line, isFilterLastLine ); if ( filterOK ) { data.lineBuffer.add( new TextFileLine( line, lineNumberInFile++, data.file ) ); } else { return false; } } else { if ( !meta.content.noEmptyLines || line.length() != 0 ) { data.lineBuffer.add( new TextFileLine( line, lineNumberInFile++, data.file ) ); } } } else { data.doneReading = true; } return true; }
Source:
<code>public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(super.toConfig()); String streamName; <START> if (getPhysicalName().isPresent()) { <END> streamName = getPhysicalName().get(); } else { streamName = getStreamId(); } String systemName = getSystemName(); consumerAutoOffsetResetOptional.ifPresent(autoOffsetReset -> configs.put(String.format(CONSUMER_AUTO_OFFSET_RESET_CONFIG_KEY, systemName, streamName), autoOffsetReset)); consumerFetchMessageMaxBytesOptional.ifPresent(fetchMessageMaxBytes -> configs.put(String.format(CONSUMER_FETCH_MESSAGE_MAX_BYTES_CONFIG_KEY, systemName, streamName), Long.toString(fetchMessageMaxBytes))); return configs; }</code><technical_language>simplified streamName = getPhysicalName().orElse(getStreamId());</technical_language>

Target:
public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(super.toConfig()); String streamName = getPhysicalName().orElse(getStreamId()); String systemName = getSystemName(); consumerAutoOffsetResetOptional.ifPresent(autoOffsetReset -> configs.put(String.format(CONSUMER_AUTO_OFFSET_RESET_CONFIG_KEY, systemName, streamName), autoOffsetReset)); consumerFetchMessageMaxBytesOptional.ifPresent(fetchMessageMaxBytes -> configs.put(String.format(CONSUMER_FETCH_MESSAGE_MAX_BYTES_CONFIG_KEY, systemName, streamName), Long.toString(fetchMessageMaxBytes))); return configs; }
Source:
<code>public ExitStatus afterStep(StepExecution stepExecution) { if (exitCode == 0) { return ExitStatus.COMPLETED; } else { return ExitStatus.FAILED; <START> } <END> }</code><technical_language>SystemCommandTasklet allows injection of a SystemProcessExitCodeMapper map exit codes system processes ExitStatus. reason allow type of mapping here</technical_language>

Target:
public ExitStatus afterStep(StepExecution stepExecution) { return systemProcessExitCodeMapper.getExitStatus(exitCode); }
Source:
<code>public void sendSuccessEmail(ExecutableFlow flow) { EmailMessage message = new EmailMessage(mailHost, mailUser, mailPassword); message.setFromAddress(mailSender); message.setTLS(tls); <START> message.setAuth(usesAuth); <END> ExecutionOptions option = flow.getExecutionOptions(); MailCreator mailCreator = DefaultMailCreator.getCreator(option.getMailCreator()); logger.debug("ExecutorMailer using mail creator:" + mailCreator.getClass().getCanonicalName()); boolean mailCreated = mailCreator.createSuccessEmail(flow, message, azkabanName, scheme, clientHostname, clientPortNumber); if (mailCreated && !testMode) { try { message.sendEmail(); } catch (MessagingException e) { logger.error("Email message send failed", e); } } }</code><technical_language>call super.hasMailAuth()</technical_language>

Target:
public void sendSuccessEmail(ExecutableFlow flow) { EmailMessage message = new EmailMessage(mailHost, mailUser, mailPassword); message.setFromAddress(mailSender); message.setTLS(tls); message.setAuth(super.hasMailAuth()); ExecutionOptions option = flow.getExecutionOptions(); MailCreator mailCreator = DefaultMailCreator.getCreator(option.getMailCreator()); logger.debug("ExecutorMailer using mail creator:" + mailCreator.getClass().getCanonicalName()); boolean mailCreated = mailCreator.createSuccessEmail(flow, message, azkabanName, scheme, clientHostname, clientPortNumber); if (mailCreated && !testMode) { try { message.sendEmail(); } catch (MessagingException e) { logger.error("Email message send failed", e); } } }
Source:
<code>public void testCreateSchema_DefaultAccess_AnonymousUsers() throws OrmException { db.create(); final SystemConfig config = db.getSystemConfig(); <START> assertDefaultRight(RefRight.REGEX_SYMBOL+"refs/*", config.anonymousGroupId, <END> ApprovalCategory.READ, 1, 1); }</code><technical_language>Style-nit: Spaces operators +</technical_language>

Target:
public void testCreateSchema_DefaultAccess_AnonymousUsers() throws OrmException { db.create(); final SystemConfig config = db.getSystemConfig(); assertDefaultRight("refs/*", config.anonymousGroupId, ApprovalCategory.READ, 1, 1); }
Source:
<code>public void openFile(String filePath, String fileType) throws IOException { Optional<ExternalFileType> type = ExternalFileTypes.getInstance().getExternalFileTypeByExt(fileType); String viewer; if (type.isPresent() && !type.get().getOpenWithApplication().isEmpty()) { viewer = type.get().getOpenWithApplication(); } else { viewer = "xdg-open"; } String[] cmdArray = { viewer, filePath }; Process p; p = Runtime.getRuntime().exec(cmdArray); BufferedReader in = new BufferedReader(new InputStreamReader(p.getErrorStream())); String line; <START> line = in.readLine(); <END> }</code><technical_language>@calixtus said, nice if add a logging statement here: Add private static final Logger LOGGER = LoggerFactory.getLogger(Linux.class); top of class LOGGER.debug("Received output: " + line)</technical_language>

Target:
public void openFile(String filePath, String fileType) throws IOException { Optional<ExternalFileType> type = ExternalFileTypes.getInstance().getExternalFileTypeByExt(fileType); String viewer; if (type.isPresent() && !type.get().getOpenWithApplication().isEmpty()) { viewer = type.get().getOpenWithApplication(); } else { viewer = "xdg-open"; } String[] cmdArray = { viewer, filePath }; Process p = Runtime.getRuntime().exec(cmdArray); BufferedReader in = new BufferedReader(new InputStreamReader(p.getErrorStream())); String line; line = in.readLine(); LOGGER.debug("Received output: " + line); }
Source:
<code><START> private Diff findMasterEquivalence(Diff diff, boolean mergeRightToLeft) { <END> Diff masterDiff = null; final Iterator<Diff> equivalentDiffs = diff.getEquivalence().getDifferences().iterator(); while (masterDiff == null && equivalentDiffs.hasNext()) { final Diff candidate = equivalentDiffs.next(); if (hasRealConflict(candidate)) { masterDiff = candidate; } else if (diff instanceof ReferenceChange && candidate instanceof ReferenceChange) { final ReferenceChange diffRC = (ReferenceChange)diff; final ReferenceChange candidateRC = (ReferenceChange)candidate; if (diffRC.getReference().getEOpposite() == candidateRC.getReference() && candidate.getState() == DifferenceState.UNRESOLVED) { if (isOneToManyAndAdd(diffRC, candidateRC, mergeRightToLeft) || isOneToOneAndSet(diffRC, candidateRC, mergeRightToLeft)) { masterDiff = candidate; } } } } return masterDiff; }</code><technical_language>Yes, imply implementation wrong, I wish avoid potential trouble :p</technical_language>

Target:
private Diff findMasterEquivalence(Diff diff, boolean mergeRightToLeft) { final List<Diff> equivalentDiffs = diff.getEquivalence().getDifferences(); final Optional<Diff> firstConflicting = Iterables.tryFind(equivalentDiffs, hasConflict(ConflictKind.REAL)); if (firstConflicting.isPresent()) { return firstConflicting.get(); } Diff masterDiff = null; if (diff instanceof ReferenceChange) { final ReferenceChange diffRC = (ReferenceChange)diff; final Iterator<Diff> eOppositeDiffs = Iterators.filter(equivalentDiffs.iterator(), isDiffOnEOppositeOf(diffRC)); while (masterDiff == null && eOppositeDiffs.hasNext()) { final ReferenceChange candidate = (ReferenceChange)eOppositeDiffs.next(); if (isOneToManyAndAdd(diffRC, candidate, mergeRightToLeft)) { masterDiff = candidate; } else if (!isSet(diffRC, mergeRightToLeft) && isOneToOneAndSet(diffRC, candidate, mergeRightToLeft)) { masterDiff = candidate; } } } return masterDiff; }
Source:
<code>private void printWindowState(Stage mainStage) { StringBuilder bob = new StringBuilder(); bob.append("SCREEN DATA:"); <START> bob.append("JabRefPreferences.WINDOW_MAXIMISED: " + mainStage.isMaximized() + "\n"); <END> bob.append("JabRefPreferences.POS_X: " + mainStage.getX() + "\n"); bob.append("JabRefPreferences.POS_Y: " + mainStage.getY() + "\n"); bob.append("JabRefPreferences.SIZE_X: " + mainStage.getWidth() + "\n"); bob.append("JabRefPreferences.SIZE_Y: " + mainStage.getHeight() + "\n"); LOGGER.debug(bob.toString()); }</code><technical_language>JabRefPreferences replaced MainStage ? (As this print values stored in preferences)</technical_language>

Target:
private void printWindowState(Stage mainStage) { StringBuilder bob = new StringBuilder(); bob.append("SCREEN DATA:"); bob.append("mainStage.WINDOW_MAXIMISED: " + mainStage.isMaximized() + "\n"); bob.append("mainStage.POS_X: " + mainStage.getX() + "\n"); bob.append("mainStage.POS_Y: " + mainStage.getY() + "\n"); bob.append("mainStage.SIZE_X: " + mainStage.getWidth() + "\n"); bob.append("mainStages.SIZE_Y: " + mainStage.getHeight() + "\n"); LOGGER.debug(bob.toString()); }
Source:
<code>protected Object internalExecute() throws ServiceLocalException, Exception { HttpWebRequest response = null; try { response = this.validateAndEmitRequest(); return this.readResponse(response); } catch (IOException ex) { throw new ServiceRequestException(String. format(Strings.ServiceRequestFailed, ex.getMessage(), ex)); } catch (Exception e) { if (response != null) { this.getService().processHttpResponseHeaders(TraceFlags. EwsResponseHttpHeaders, response); } throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } finally { try { <START> response.close(); <END> } catch (Exception e2) { response = null; } } }</code><technical_language>a null check calling close() response. Kind of similar do in catch block above</technical_language>

Target:
protected Object internalExecute() throws ServiceLocalException, Exception { HttpWebRequest response = null; try { response = this.validateAndEmitRequest(); return this.readResponse(response); } catch (IOException ex) { throw new ServiceRequestException(String. format(Strings.ServiceRequestFailed, ex.getMessage(), ex)); } catch (Exception e) { if (response != null) { this.getService().processHttpResponseHeaders(TraceFlags. EwsResponseHttpHeaders, response); } throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } finally { try { if (response != null) { response.close(); } } catch (Exception e2) { response = null; } } }
Source:
<code>private void assertMinimumTimestampIsAtLeast(String sstableMetadata, long expectedMinimum) { Pattern pattern = Pattern.compile("Minimum timestamp: ([0-9]*)"); Matcher timestampMatcher = pattern.matcher(sstableMetadata); <START> assertThat(timestampMatcher.find()).isTrue(); <END> assertThat(Long.parseLong(timestampMatcher.group(1))).isGreaterThanOrEqualTo(expectedMinimum); }</code><technical_language>this give a friendly error message fails</technical_language>

Target:
private void assertMinimumTimestampIsAtLeast(String sstableMetadata, long expectedMinimum) { assertThat(parseMinimumTimestamp(sstableMetadata)).isGreaterThanOrEqualTo(expectedMinimum); }
Source:
<code>public void releaseAllResources() { if (isReleased.compareAndSet(false, true)) { <START> checkState(parent instanceof PipelinedApproximateSubpartition); <END> ((PipelinedApproximateSubpartition) parent).releaseView(); } }</code><technical_language>I this method is called downstream RPC, task shutdown other cases. If so, completely skipping of super.releaseAllResources lead resource leaks in cases. WDYT</technical_language>

Target:
public void releaseAllResources() { isReleased.compareAndSet(false, true); }
Source:
<code>private void loginToAdminAccountsManagementPage() { accountsPageUrl = createUrl(Const.ActionURIs.ADMIN_ACCOUNT_MANAGEMENT_PAGE + "?all=true"); accountsPage = loginAdminToPageForAdminUiTests(browser, accountsPageUrl, AdminAccountManagementPage.class); boolean isDevEnvironment = Boolean.parseBoolean(System.getProperty("isDevEnvironment")); <START> if (!isDevEnvironment) { <END> accountsPage.waitForPageToFinishLoadingOnNonDevEnvironment(); } accountsPage.verifyIsCorrectPage(); }</code><technical_language>fine if this is done checking for dev environment right</technical_language>

Target:
private void loginToAdminAccountsManagementPage() { accountsPageUrl = createUrl(Const.ActionURIs.ADMIN_ACCOUNT_MANAGEMENT_PAGE + "?all=true"); accountsPage = loginAdminToPageForAdminUiTests(browser, accountsPageUrl, AdminAccountManagementPage.class); accountsPage.waitForAdminAccountsManagementPageToFinishLoading(); accountsPage.verifyIsCorrectPage(); }
Source:
<code>private void onLightAddedInternal(FullLight light) { ThingUID thingUID = getThingUID(light); ThingTypeUID thingTypeUID = getThingTypeUID(light); String modelId = light.getModelID(); if (thingUID != null && thingTypeUID != null) { ThingUID bridgeUID = hueBridgeHandler.getThing().getUID(); Map<String, Object> properties = new HashMap<>(); properties.put(LIGHT_ID, light.getId()); <START> if (modelId != null) { <END> properties.put(Thing.PROPERTY_MODEL_ID, modelId.replaceAll(NORMALIZE_ID_REGEX, "_")); } String uniqueID = light.getUniqueID(); if (uniqueID != null) { properties.put(UNIQUE_ID, uniqueID); } DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withThingType(thingTypeUID) .withProperties(properties).withBridge(bridgeUID).withRepresentationProperty(UNIQUE_ID) .withLabel(light.getName()).build(); thingDiscovered(discoveryResult); } else { logger.debug("discovered unsupported light of type '{}' and model '{}' with id {}", light.getType(), modelId, light.getId()); } }</code><technical_language>If modelId is if thingUID != null && thingTypeUID != null I move variable definition initialization this branch</technical_language>

Target:
private void onLightAddedInternal(FullLight light) { ThingUID thingUID = getThingUID(light); ThingTypeUID thingTypeUID = getThingTypeUID(light); String modelId = light.getNormalizedModelID(); if (thingUID != null && thingTypeUID != null) { ThingUID bridgeUID = hueBridgeHandler.getThing().getUID(); Map<String, Object> properties = new HashMap<>(); properties.put(LIGHT_ID, light.getId()); if (modelId != null) { properties.put(Thing.PROPERTY_MODEL_ID, modelId); } String uniqueID = light.getUniqueID(); if (uniqueID != null) { properties.put(UNIQUE_ID, uniqueID); } DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withThingType(thingTypeUID) .withProperties(properties).withBridge(bridgeUID).withRepresentationProperty(UNIQUE_ID) .withLabel(light.getName()).build(); thingDiscovered(discoveryResult); } else { logger.debug("discovered unsupported light of type '{}' and model '{}' with id {}", light.getType(), modelId, light.getId()); } }
Source:
<code>public final BackPressureReason emit(CoreEvent event) { onEventConsumer.accept(event); long remainingCapacity = fluxSink.requestedFromDownstream(); if (remainingCapacity == 0) { return EVENTS_ACCUMULATED; <START> } else if (remainingCapacity > (bufferSize > CORES * 2 ? CORES : 0)) { <END> fluxSink.next(intoSink(event)); return null; } else { synchronized (fluxSink) { if (remainingCapacity > 0) { fluxSink.next(intoSink(event)); return null; } else { return EVENTS_ACCUMULATED; } } } }</code><technical_language>increase size of this buffer reduce error rate</technical_language>

Target:
public final BackPressureReason emit(CoreEvent event) { onEventConsumer.accept(event); long remainingCapacity = fluxSink.requestedFromDownstream(); if (remainingCapacity == 0) { return EVENTS_ACCUMULATED; } else if (remainingCapacity > (bufferSize > CORES * 4 ? CORES : 0)) { fluxSink.next(intoSink(event)); return null; } else { synchronized (fluxSink) { if (remainingCapacity > 0) { fluxSink.next(intoSink(event)); return null; } else { return EVENTS_ACCUMULATED; } } } }
Source:
<code>private static boolean exists(Object path) { if (path instanceof String) { return Files.exists(Paths.get((String) path)); } if (path instanceof Path) { return Files.exists(((Path) path)); } if (path instanceof File) { return ((File) path).exists(); } <START> throw new IllegalStateException("Unsupported type: " + path.getClass().getName()); <END> }</code><technical_language>This IllegalArgumentException argument is invalid. IllegalStateException means class is in incompatible state for current method invocation</technical_language>

Target:
private static boolean exists(Object path) { if (path instanceof String) { return Files.exists(Paths.get((String) path)); } if (path instanceof Path) { return Files.exists((Path) path); } if (path instanceof File) { return ((File) path).exists(); } throw new IllegalArgumentException("Unsupported type for @FileExists: " + path.getClass().getName()); }
Source:
<code>private Set<String> getMissingFields(GraphQLInputObjectType type, Map<String, ObjectField> objectFieldMap) { <START> return type.getFields().parallelStream() <END> .filter(field -> field.getType() instanceof GraphQLNonNull) .map(GraphQLInputObjectField::getName) .filter(((Predicate<String>) objectFieldMap::containsKey).negate()) .collect(Collectors.toSet()); }</code><technical_language>please out parallelStream() call. offer benefit a stream possibly cross threads. server environments sensitive arbitrary code running ForkJoin.commonPool() In this case < 10 messages. is benefit problems</technical_language>

Target:
private Set<String> getMissingFields(GraphQLInputObjectType type, Map<String, ObjectField> objectFieldMap) { return type.getFields().stream() .filter(field -> field.getType() instanceof GraphQLNonNull) .map(GraphQLInputObjectField::getName) .filter(((Predicate<String>) objectFieldMap::containsKey).negate()) .collect(Collectors.toSet()); }
Source:
<code>void uninstall() { StyledText editorTextWidget = fEditorViewer.getTextWidget(); if (editorTextWidget.getContent() != null) { editorTextWidget.getContent().removeTextChangeListener(this); } if (fEditorViewer instanceof ITextViewerExtension4) { ((ITextViewerExtension4) fEditorViewer).removeTextPresentationListener(this); } fEditorViewer.removeViewportListener(this); editorTextWidget.removeControlListener(this); <START> fScaledFonts.values().forEach(font -> font.dispose()); <END> }</code><technical_language>method reference</technical_language>

Target:
void uninstall() { StyledText editorTextWidget = fEditorViewer.getTextWidget(); if (editorTextWidget.getContent() != null) { editorTextWidget.getContent().removeTextChangeListener(this); } if (fEditorViewer instanceof ITextViewerExtension4) { ((ITextViewerExtension4) fEditorViewer).removeTextPresentationListener(this); } fEditorViewer.removeViewportListener(this); editorTextWidget.removeControlListener(this); fScaledFonts.values().forEach(Font::dispose); }
Source:
<code>default List<T> padTo(int length, T element) { if(length == 0) { return this; } else { <START> return appendAll(Stream.gen(() -> element).take(length)); <END> } }</code><technical_language>take(length - this.length()), I right</technical_language>

Target:
default List<T> padTo(int length, T element) { if(length <= length()) { return this; } else { return appendAll(Stream.gen(() -> element).take(length - length())); } }
Source:
<code>private void checkImportBlacklist(String userData) throws Exception { <START> mod tree = new AnalyzingParser(new ANTLRStringStream(userData), "", "ascii").parseModule(); <END> Visitor vis = new Visitor() { @Override public Object visitImport(Import node) throws Exception { for (alias importName : node.getInternalNames()) { if (backList.contains(importName.getInternalName())) { throw ProcessingErrorCode.createInvalidPythonImportErrorException(new RuntimeException(), importName.getInternalName()); } } return node; } @Override public Object visitImportFrom(ImportFrom node) throws Exception { if (backList.contains(node.getInternalModule())) { throw ProcessingErrorCode.createInvalidPythonImportErrorException(new RuntimeException(), node.getInternalModule()); } for (alias importName : node.getInternalNames()) { if (backList.contains(node.getInternalModule() + "." + importName.getInternalName())) { throw ProcessingErrorCode.createInvalidPythonImportErrorException(new RuntimeException(), node.getInternalModule() + "." + importName.getInternalName()); } } return node; } }; for (PythonTree c : tree.getChildren()) { try { vis.visit(c); } catch (Exception e) { interpreter.close(); interpreter = null; throw e; } } }</code><technical_language>a question ascii, is ok</technical_language>

Target:
private void checkImportBlacklist(String userData) throws Exception { mod tree = new AnalyzingParser(new ANTLRStringStream(userData), "", "ascii").parseModule(); Visitor vis = new Visitor() { @Override public Object visitImport(Import node) throws Exception { for (alias importName : node.getInternalNames()) { if (moduleBlacklist.contains(importName.getInternalName())) { throw ProcessingErrorCode.createInvalidPythonImportErrorException(importName.getInternalName()); } } return node; } @Override public Object visitImportFrom(ImportFrom node) throws Exception { if (moduleBlacklist.contains(node.getInternalModule())) { throw ProcessingErrorCode.createInvalidPythonImportErrorException(node.getInternalModule()); } for (alias importName : node.getInternalNames()) { if (moduleBlacklist.contains(node.getInternalModule() + "." + importName.getInternalName())) { throw ProcessingErrorCode.createInvalidPythonImportErrorException( node.getInternalModule() + "." + importName.getInternalName()); } } return node; } }; for (PythonTree c : tree.getChildren()) { try { vis.visit(c); } catch (Exception e) { interpreter.close(); interpreter = null; throw e; } } }
Source:
<code>public Token getGithubUserTokens(@ApiParam(hidden = true) @Auth Token authToken, @ApiParam(value = "User to return") @PathParam("userId") long userId) { User user = userDAO.findById(authToken.getUserId()); <START> if (!user.getIsAdmin() && user.getId() != userId) { <END> throw new WebApplicationException(HttpStatus.SC_FORBIDDEN); } return tokenDAO.findGithubByUserId(userId); }</code><technical_language>This predicate copied pasted again. Please split this out a method in case need change this en masse (say add a new role type). IDE a refactoring tool help</technical_language>

Target:
public Token getGithubUserTokens(@ApiParam(hidden = true) @Auth Token authToken, @ApiParam(value = "User to return") @PathParam("userId") long userId) { User user = userDAO.findById(authToken.getUserId()); Helper.checkUser(user, userId); return tokenDAO.findGithubByUserId(userId); }
Source:
<code>public void refresh() { final View view = getView(); <START> if (view == null) { <END> return; } if (decorationService == null) { return; } if (ExampleUtils.isAllocatedTo((CallBehaviorAction) view.getElement(), ExampleUtils.NODE_A_STEREOTYPE) != nodeAMarked) { nodeAMarked = !nodeAMarked; if (nodeAMarked) { decorationService.addDecoration(getMarkerA(), getView()); } else { decorationService.removeDecoration(getMarkerA().toString()); } getHost().refresh(); } if (ExampleUtils.isAllocatedTo((CallBehaviorAction) view.getElement(), ExampleUtils.NODE_B_STEREOTYPE) != nodeBMarked) { nodeBMarked = !nodeBMarked; if (nodeBMarked) { decorationService.addDecoration( view.getElement().toString(), "NodeBDecoration", view.getElement(), org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImageDescriptor(Activator.ID, "icons/NodeB.gif"), org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImageDescriptor(Activator.ID, "icons/NodeB.gif"), PreferedPosition.SOUTH_WEST, "NodeB decoration Without marker", 0); } else { decorationService.removeDecoration(view.getElement().toString()); } getHost().refresh(); } }</code><technical_language>'null' operande</technical_language>

Target:
public void refresh() { final View view = getView(); if (null == view) { return; } if (null == decorationService) { return; } if (ExampleUtils.isAllocatedTo((CallBehaviorAction) view.getElement(), ExampleUtils.NODE_A_STEREOTYPE) != nodeAMarked) { nodeAMarked = !nodeAMarked; if (nodeAMarked) { decorationService.addDecoration(getMarkerA(), getView()); } else { decorationService.removeDecoration(getMarkerA().toString()); } getHost().refresh(); } if (ExampleUtils.isAllocatedTo((CallBehaviorAction) view.getElement(), ExampleUtils.NODE_B_STEREOTYPE) != nodeBMarked) { nodeBMarked = !nodeBMarked; if (nodeBMarked) { decorationService.addDecoration( view.getElement().toString(), "NodeBDecoration", view.getElement(), org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImageDescriptor(Activator.ID, "icons/NodeB.gif"), org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImageDescriptor(Activator.ID, "icons/NodeB.gif"), PreferedPosition.SOUTH_WEST, "NodeB decoration Without marker", 0); } else { decorationService.removeDecoration(view.getElement().toString()); } getHost().refresh(); } }
Source:
<code>private JSONObject execute(final String command, final Object... args) { AXE.inject(this.driver, this.script, this.skipFrames); this.driver.manage().timeouts().setScriptTimeout(this.timeout, TimeUnit.SECONDS); JSONObject result= new JSONObject(); if (args.length > 0) <START> for (Object arg: args) { <END> Object response = ((JavascriptExecutor) this.driver).executeAsyncScript(command, arg); JSONObject oneResult = new JSONObject((Map)response); for (String key : oneResult.keySet()) { result.accumulate(key, oneResult.get(key)); } } else { Object response = ((JavascriptExecutor) this.driver).executeAsyncScript(command, args); result = new JSONObject((Map)response); } String error = result.getString("error"); if (error != null && !error.isEmpty()) { throw new AxeRuntimeException(error); } JSONObject results = result.getJSONObject("results"); return results; }</code><technical_language>1. execute axe for webelement ? Concerned perf implications - axe injected page for time etc. 2. convert webelements CSS selectors include option</technical_language>

Target:
private JSONObject execute(final String command, final Object... args) { AXE.inject(this.driver, this.script, this.skipFrames); this.driver.manage().timeouts().setScriptTimeout(this.timeout, TimeUnit.SECONDS); Object response = ((JavascriptExecutor) this.driver).executeAsyncScript(command, args); JSONObject result = new JSONObject((Map) response); String error = result.getString("error"); if (error != null && !error.isEmpty()) { throw new AxeRuntimeException(error); } JSONObject results = result.getJSONObject("results"); return results; }
Source:
<code>private boolean uncheckInactive(Object element) { int unchecked = 0; boolean isInactive = false; Object[] children = fContentProvider.getChildren(element); for (Object child : children) { if (uncheckInactive(child)) { unchecked++; } } if (fTree.getChecked(element)) { isInactive = element instanceof ITimeGraphEntry && !fActiveProvider.isActive((ITimeGraphEntry) element); if (isInactive && <START> unchecked == children.length) { <END> fTree.setChecked(element, false); } } return !fTree.getChecked(element); }</code><technical_language>trick, if wasChildChecked need call isActive() uncheck element</technical_language>

Target:
private boolean uncheckInactive(Object element) { boolean wasChildChecked = false; for (Object child : fContentProvider.getChildren(element)) { wasChildChecked |= uncheckInactive(child); } if (fTree.getChecked(element) && !wasChildChecked) { if (element instanceof ITimeGraphEntry && !fActiveProvider.isActive((ITimeGraphEntry) element)) { fTree.setChecked(element, false); } } return fTree.getChecked(element); }
Source:
<code>protected void startScan() { logger.debug("Starting Astro discovery scan"); PointType location = locationProvider.getLocation(); if (location == null) { logger.debug("LocationProvider.getLocation() is not set -> Will not provide any discovery results"); return; } <START> ThingTypeUID sunType = new ThingTypeUID(BINDING_ID, SUN); <END> ThingTypeUID moonType = new ThingTypeUID(BINDING_ID, MOON); ThingUID sunThing = new ThingUID(sunType, LOCAL); ThingUID moonThing = new ThingUID(moonType, LOCAL); String propGeolocation = String.format("%s,%s", location.getLatitude(), location.getLongitude()); thingDiscovered(DiscoveryResultBuilder.create(sunThing).withLabel("Local Sun") .withProperty("geolocation", propGeolocation).build()); thingDiscovered(DiscoveryResultBuilder.create(moonThing).withLabel("Local Moon") .withProperty("geolocation", propGeolocation).build()); }</code><technical_language>this exists 'AstroBindingConstants.THING_TYPE_SUN'</technical_language>

Target:
protected void startScan() { logger.debug("Starting Astro discovery scan"); PointType location = locationProvider.getLocation(); if (location == null) { logger.debug("LocationProvider.getLocation() is not set -> Will not provide any discovery results"); return; } ThingUID sunThing = new ThingUID(AstroBindingConstants.THING_TYPE_SUN, LOCAL); ThingUID moonThing = new ThingUID(AstroBindingConstants.THING_TYPE_MOON, LOCAL); String propGeolocation; if (location.getAltitude() != null) { propGeolocation = String.format("%s,%s,%s", location.getLatitude(), location.getLongitude(), location.getAltitude()); } else { propGeolocation = String.format("%s,%s", location.getLatitude(), location.getLongitude()); } thingDiscovered(DiscoveryResultBuilder.create(sunThing).withLabel("Local Sun") .withProperty("geolocation", propGeolocation).build()); thingDiscovered(DiscoveryResultBuilder.create(moonThing).withLabel("Local Moon") .withProperty("geolocation", propGeolocation).build()); }
Source:
<code>private void resetData() { for (CounterAnalysis analysis : fModules) { ITmfStateSystem ss = analysis.getStateSystem(); if (ss == null) { continue; } for (Integer quark : fQuarks) { <START> deleteSeries(createSeriesName(ss, quark)); <END> } } fQuarks = new TreeSet<>(); }</code><technical_language>of AIOOB exception above, this work. I if clear more broadly, viewer clear data was</technical_language>

Target:
private void resetData() { for (CounterAnalysis analysis : fModules) { ITmfStateSystem ss = analysis.getStateSystem(); if (ss == null) { continue; } for (Integer quark : fQuarks) { deleteSeries(createSeriesName(ss, quark)); } } fQuarks.clear(); }
Source:
<code>public AlluxioHiveMetastore(TableMasterClient client) { <START> requireNonNull(client, "client is null"); <END> this.client = client; }</code><technical_language>java this.client = requireNonNull(client, "client is null");</technical_language>

Target:
public AlluxioHiveMetastore(TableMasterClient client) { this.client = requireNonNull(client, "client is null"); }