auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void setupUI(boolean isOrientationChange) { if (this.getString(R.string.panes).equals("two") && !mNoDetailMode) { if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { setupLandscapeDualPaneView(); } else { setContentView(R.layout.entity_select_layout); restoreExistingSelection(isOrientationChange); } } else { setContentView(R.layout.entity_select_layout); } AdapterView visibleView; GridView gridView = (GridView)this.findViewById(R.id.screen_entity_select_grid); ListView listView = ((ListView)this.findViewById(R.id.screen_entity_select_list)); if (shortSelect.shouldBeLaidOutInGrid()) { visibleView = gridView; gridView.setVisibility(View.VISIBLE); gridView.setNumColumns(shortSelect.getNumEntitiesToDisplayPerRow()); listView.setVisibility(View.GONE); } else { visibleView = listView; listView.setVisibility(View.VISIBLE); gridView.setVisibility(View.GONE); EntitySelectViewSetup.setupDivider(this, listView, shortSelect.usesEntityTileView()); } visibleView.setOnItemClickListener(this); initUIComponents(); restoreLastQueryString(); persistAdapterState(visibleView); <START> setupPreHoneycombFooter(attemptInitCallout()); <END> setupMapNav(); }</code><technical_language>pull attemptInitCallout() out line? I understand, called of honeycomb status, is confusing logically coupling</technical_language>

Target:
private void setupUI(boolean isOrientationChange) { if (this.getString(R.string.panes).equals("two") && !mNoDetailMode) { if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { setupLandscapeDualPaneView(); } else { setContentView(R.layout.entity_select_layout); restoreExistingSelection(isOrientationChange); } } else { setContentView(R.layout.entity_select_layout); } AdapterView visibleView; GridView gridView = (GridView)this.findViewById(R.id.screen_entity_select_grid); ListView listView = ((ListView)this.findViewById(R.id.screen_entity_select_list)); if (shortSelect.shouldBeLaidOutInGrid()) { visibleView = gridView; gridView.setVisibility(View.VISIBLE); gridView.setNumColumns(shortSelect.getNumEntitiesToDisplayPerRow()); listView.setVisibility(View.GONE); } else { visibleView = listView; listView.setVisibility(View.VISIBLE); gridView.setVisibility(View.GONE); EntitySelectViewSetup.setupDivider(this, listView, shortSelect.usesEntityTileView()); } visibleView.setOnItemClickListener(this); initUIComponents(); restoreLastQueryString(); persistAdapterState(visibleView); attemptInitCallout(); setupPreHoneycombFooter(); setupMapNav(); }
Source:
<code>public void refreshGroup(GroupInfo info) { Object[] listenersArray = listeners.getListeners(); <START> for (Object element : listenersArray) { <END> ((IJobProgressManagerListener)element).refreshGroup(info); } }</code><technical_language>inline listeners.getListeners()</technical_language>

Target:
public void refreshGroup(GroupInfo info) { for (Object element : listeners.getListeners()) { ((IJobProgressManagerListener)element).refreshGroup(info); } }
Source:
<code>public <T extends StreamOperator<OUT>> T createStreamOperator(StreamOperatorParameters<OUT> parameters) { final OperatorID operatorId = parameters.getStreamConfig().getOperatorID(); final OperatorEventGateway gateway = parameters.getOperatorEventDispatcher().getOperatorEventGateway(operatorId); final SourceOperator<OUT, ?> sourceOperator = instantiateSourceOperator( source::createReader, gateway, source.getSplitSerializer(), eventTimeConfig); sourceOperator.setup(parameters.getContainingTask(), parameters.getStreamConfig(), parameters.getOutput()); <START> sourceOperator.processingTimeService = parameters.getProcessingTimeService(); <END> parameters.getOperatorEventDispatcher().registerEventHandler(operatorId, sourceOperator); @SuppressWarnings("unchecked") final T castedOperator = (T) sourceOperator; return castedOperator; }</code><technical_language>put in constructor of SourceOperator</technical_language>

Target:
public <T extends StreamOperator<OUT>> T createStreamOperator(StreamOperatorParameters<OUT> parameters) { final OperatorID operatorId = parameters.getStreamConfig().getOperatorID(); final OperatorEventGateway gateway = parameters.getOperatorEventDispatcher().getOperatorEventGateway(operatorId); final SourceOperator<OUT, ?> sourceOperator = instantiateSourceOperator( source::createReader, gateway, source.getSplitSerializer(), watermarkStrategy, parameters.getProcessingTimeService()); sourceOperator.setup(parameters.getContainingTask(), parameters.getStreamConfig(), parameters.getOutput()); parameters.getOperatorEventDispatcher().registerEventHandler(operatorId, sourceOperator); @SuppressWarnings("unchecked") final T castedOperator = (T) sourceOperator; return castedOperator; }
Source:
<code>public EurekaClient eurekaClient(ApplicationInfoManager manager, EurekaClientConfig config, EurekaInstanceConfig instance, @Autowired(required = false) HealthCheckHandler healthCheckHandler) { ApplicationInfoManager appManager; if(AopUtils.isAopProxy(manager)) { appManager = ProxyUtils.getTargetObject(manager); } else { appManager = manager; } <START> appManager.getInfo(); END> CloudEurekaClient cloudEurekaClient = new CloudEurekaClient(appManager, config, this.optionalArgs, this.context); cloudEurekaClient.registerHealthCheck(healthCheckHandler); return cloudEurekaClient; }</code><technical_language>This force initialization pulled target out. Probaby pulling target out (you check)</technical_language>

Target:
public EurekaClient eurekaClient(ApplicationInfoManager manager, EurekaClientConfig config, EurekaInstanceConfig instance, @Autowired(required = false) HealthCheckHandler healthCheckHandler) { ApplicationInfoManager appManager; if(AopUtils.isAopProxy(manager)) { appManager = ProxyUtils.getTargetObject(manager); } else { appManager = manager; } CloudEurekaClient cloudEurekaClient = new CloudEurekaClient(appManager, config, this.optionalArgs, this.context); cloudEurekaClient.registerHealthCheck(healthCheckHandler); return cloudEurekaClient; }
Source:
<code>public static Collection<Thread> findThreadsByName(final String threadName, final String threadGroupName) { if (threadName == null) { throw new IllegalArgumentException("The thread name must not be null"); } if (threadGroupName == null) { throw new IllegalArgumentException("The thread group name must not be null"); } final Collection<Thread> result = new ArrayList<Thread>(); for(final ThreadGroup group : findThreadGroups(new NamePredicate(threadGroupName))) { <START> result.addAll(findThreads(group, false, new NamePredicate(threadName))); <END> } return Collections.unmodifiableCollection(result); }</code><technical_language>NamePredicate object is in iteration. instance is required of for loop</technical_language>

Target:
public static Collection<Thread> findThreadsByName(final String threadName, final String threadGroupName) { if (threadName == null) { throw new IllegalArgumentException("The thread name must not be null"); } if (threadGroupName == null) { throw new IllegalArgumentException("The thread group name must not be null"); } final Collection<ThreadGroup> threadGroups = findThreadGroups(new NamePredicate(threadGroupName)); if(threadGroups.isEmpty()) { return Collections.EMPTY_LIST; } final Collection<Thread> result = new ArrayList<Thread>(); final NamePredicate threadNamePredicate = new NamePredicate(threadName); for(final ThreadGroup group : threadGroups) { result.addAll(findThreads(group, false, threadNamePredicate)); } return Collections.unmodifiableCollection(result); }
Source:
<code><START> default Token refreshToken(String refreshUrl, Token token, HttpClient client, TokenDAO tokenDAO, String clientID, <END> String clientSecret, String payload) { try { Optional<String> asString = ResourceUtilities.refreshPost(refreshUrl, null, client, clientID, clientSecret, payload); if (asString.isPresent()) { String accessToken; String refreshToken; LOG.info(token.getUsername() + ": RESOURCE CALL: {}", refreshUrl); String json = asString.get(); Gson gson = new Gson(); Map<String, String> map = new HashMap<>(); map = (Map<String, String>)gson.fromJson(json, map.getClass()); accessToken = map.get("access_token"); refreshToken = map.get("refresh_token"); token.setContent(accessToken); token.setRefreshToken(refreshToken); long create = tokenDAO.create(token); return tokenDAO.findById(create); } else { throw new CustomWebApplicationException("Could not retrieve " + refreshUrl + " token based on code", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } catch (UnsupportedEncodingException ex) { LOG.info(token.getUsername() + ": " + ex.toString()); throw new CustomWebApplicationException(ex.toString(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } }</code><technical_language>I this generic. I a guarantee response body for providers same, e.g., call field access_token else call accessToken. wrong this part of standard. test BitBucket verify works</technical_language>

Target:
default Token refreshToken(String refreshUrl, Token token, HttpClient client, TokenDAO tokenDAO, String clientID, String clientSecret, String payload) { try { Optional<String> asString = ResourceUtilities.refreshPost(refreshUrl, null, client, clientID, clientSecret, payload); if (asString.isPresent()) { String accessToken; String refreshToken; LOG.info(token.getUsername() + ": RESOURCE CALL: {}", refreshUrl); String json = asString.get(); Gson gson = new Gson(); Map<String, String> map = new HashMap<>(); map = (Map<String, String>)gson.fromJson(json, map.getClass()); accessToken = map.get("access_token"); refreshToken = map.get("refresh_token"); token.setContent(accessToken); token.setRefreshToken(refreshToken); long create = tokenDAO.create(token); return tokenDAO.findById(create); } else { String domain; try { URI uri = new URI(refreshUrl); domain = uri.getHost(); } catch (URISyntaxException e) { domain = "web site"; } throw new CustomWebApplicationException("Could not retrieve " + domain + " token based on code", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } catch (UnsupportedEncodingException ex) { LOG.info(token.getUsername() + ": " + ex.toString()); throw new CustomWebApplicationException(ex.toString(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } }
Source:
<code>private int getGivenRecipientIndex(int questionNum, String recipient) { List<WebElement> recipients = getQuestionResponsesSection(questionNum) .findElements(By.cssSelector("#given-responses #response-recipient")); for (int i = 0; i < recipients.size(); i++) { if (recipients.get(i).getText().split("To: ")[1].equals(recipient)) { return i; } } <START> throw new RuntimeException("Recipient not found: " + recipient); <END> }</code><technical_language>other throw new RuntimeException changed Assert.fail</technical_language>

Target:
private int getGivenRecipientIndex(int questionNum, String recipient) { List<WebElement> recipients = getQuestionResponsesSection(questionNum) .findElements(By.cssSelector("#given-responses #response-recipient")); for (int i = 0; i < recipients.size(); i++) { if (recipients.get(i).getText().split("To: ")[1].equals(recipient)) { return i; } } throw new AssertionError("Recipient not found: " + recipient); }
Source:
<code>private boolean checkIfCollapsed() { boolean result = false; if (titleAnchor != null) { String styleString = titleAnchor.getStyleName(); if (styleString != null) { String[] styles = styleString.split(" "); <START> for (String style: styles) { <END> if (style.equals(PatternflyConstants.COLLAPSED)) { result = true; break; } } } } else { result = startCollapsed; } return result; }</code><technical_language>Java 8 Stream#findFirst() this code more expressive</technical_language>

Target:
private boolean checkIfCollapsed() { boolean result = false; if (titleAnchor != null) { String styleString = titleAnchor.getStyleName(); if (styleString != null) { String[] styles = styleString.split(" "); Optional<String> found = Arrays.asList(styles).stream().filter( s -> s.equals(PatternflyConstants.COLLAPSED)).findFirst(); result = found.isPresent(); } } else { result = startCollapsed; } return result; }
Source:
<code><START> HistogramMetricImpl histogram(String srvcName, Method mtd) { <END> MethodHistogramHolder histogramHolder = Optional.ofNullable(invocationHistograms.get(srvcName)) .orElse(Collections.emptyMap()).get(mtd.getName()); return histogramHolder == null ? null : histogramHolder.getHistogram(mtd); }</code><technical_language>This method is supposed called threads. invocationHistograms is a HashMap, of invocationHistograms is a HashMap. Moreover, HistogramHolder#getHistogram is synchronized (but HistogramHolder#addIfAbsent is synchronized). way, of Optional this code more readable, IMHO. I suggest this variant HistogramMetricImpl histogram(String srvcName, Method mtd) { Map<String, MethodHistogramHolder> srvHistos = invocationHistograms.get(srvcName); if (srvHistos == null) return null; synchronized (srvHistos) { MethodHistogramHolder holder = srvHistos.get(mtd.getName()); return holder != null ? holder.getHistogram(mtd): null; } }</technical_language>

Target:
HistogramMetricImpl histogram(String srvcName, Method mtd) { Map<String, HistogramHolder> srvHistograms = invocationHistograms.get(srvcName); if (srvHistograms == null) return null; HistogramHolder holder = srvHistograms.get(mtd.getName()); return holder == null ? null : holder.histogram(mtd); }
Source:
<code>public void a_message_is_shown_under_the_field(String msg, String field) throws Throwable { String nameOrPhoneErrorSelector = ".list-unstyled > li:nth-child(1)"; <START> String phoneErrorSelector = "#phoneDiv > div > div > ul > li:nth-child(1)"; <END> WebDriverWait webDriverWait = new WebDriverWait(getDriver(), TIMEOUT); if (field.equals("phone")) { assertTrue(webDriverWait.until(textToBe(By.cssSelector(phoneErrorSelector), msg))); } else { assertTrue(webDriverWait.until(textToBe(By.cssSelector(nameOrPhoneErrorSelector), msg))); } }</code><technical_language>Please avoid of complex locators. Please constants</technical_language>

Target:
public void a_message_is_shown_under_the_field(String msg, String field) { WebDriverWait webDriverWait = new WebDriverWait(getDriver(), TIMEOUT); switch (field) { case "name": assertTrue(webDriverWait.until( textToBe(By.cssSelector("#" + NAME_ERRORS_DIV_ID + FIRST_CHILD_OF_UNORDERED_LIST), msg))); break; case "email": assertTrue(webDriverWait.until( textToBe(By.cssSelector("#" + EMAIL_ERRORS_DIV_ID + FIRST_CHILD_OF_UNORDERED_LIST), msg))); break; case "phone": assertTrue(webDriverWait.until( textToBe(By.cssSelector("#" + PHONE_ERRORS_DIV_ID + FIRST_CHILD_OF_UNORDERED_LIST), msg))); break; } }
Source:
<code>protected Network getNetworkFromDb(Guid vdsGroupId) { <START> List<Network> networks = getNetworkDAO().getAllForCluster(vdsGroupId); <END> for (Network network : networks) { if (network.getName().equals(getNetworkName())) { return network; } } return null; }</code><technical_language>This variable inlined in for</technical_language>

Target:
protected Network getNetworkFromDb(Guid vdsGroupId) { for (Network network : getNetworkDAO().getAllForCluster(vdsGroupId)) { if (network.getName().equals(getNetworkName())) { return network; } } return null; }
Source:
<code>private void decodeRowType2() throws IOException { <START> if(optionByteAligned) resetBuffer(); <END> decode1D(); }</code><technical_language>Code style: curly brackets, space if</technical_language>

Target:
private void decodeRowType2() throws IOException { if (optionByteAligned) { resetBuffer(); } decode1D(); }
Source:
<code>public String toString() { return "Capabilities{" <START> + "poolName='" + poolName + '\'' <END> + ", qosSupport='" + qosSupport + '\'' + ", allocatedCapacityGb='" + allocatedCapacityGb + '\'' + ", driverVersion='" + driverVersion + '\'' + ", freeCapacityGb='" + freeCapacityGb + '\'' + ", locationInfo='" + locationInfo + '\'' + ", timestamp='" + timestamp + '\'' + ", volumeBackendName='" + volumeBackendName + '\'' + ", totalCapacityGb='" + totalCapacityGb + '\'' + ", reservedPercentage='" + reservedPercentage + '\'' + ", vendorName='" + vendorName + '\'' + ", storageProtocol='" + storageProtocol + '\'' + ", extraSpecs='" + extraSpecs + '\'' + '}'; }</code><technical_language>convention is ',' instead of '\'</technical_language>

Target:
public String toString() { return "Capabilities{" + "poolName='" + poolName + ", qosSupport='" + qosSupport + ", allocatedCapacityGb='" + allocatedCapacityGb + ", driverVersion='" + driverVersion + ", freeCapacityGb='" + freeCapacityGb + ", locationInfo='" + locationInfo + ", timestamp='" + timestamp + ", volumeBackendName='" + volumeBackendName + ", totalCapacityGb='" + totalCapacityGb + ", reservedPercentage='" + reservedPercentage + ", vendorName='" + vendorName + ", storageProtocol='" + storageProtocol + ", extraSpecs='" + extraSpecs + '}'; }
Source:
<code>private void applyTransformations(GLTF gltf, TFloatList vertices, TFloatList normals) { GLTFNode node = null; <START> for(GLTFNode curr : gltf.getNodes()) { <END> if(curr.getMesh() == 0) { node = curr; break; } } Matrix4f transform = new Matrix4f(Matrix4f.IDENTITY); if(node != null) { if (node.getMatrix() == null) { Vector3f position = new Vector3f(); Quat4f rotation = new Quat4f(Quat4f.IDENTITY); Vector3f scale = new Vector3f(Vector3f.one()); if (node.getTranslation() != null) { position.set(node.getTranslation()); } if (node.getRotation() != null) { rotation.set(node.getRotation()); } if (node.getScale() != null) { scale.set(node.getScale()); } transform.set(new Matrix4f(rotation, position, 1.0f)); transform.set(0, 0, scale.getX()*transform.get(0, 0)); transform.set(0, 1, scale.getX()*transform.get(0, 1)); transform.set(0, 2, scale.getX()*transform.get(0, 2)); transform.set(1, 0, scale.getY()*transform.get(1, 0)); transform.set(1, 1, scale.getY()*transform.get(1, 1)); transform.set(1, 2, scale.getY()*transform.get(1, 2)); transform.set(2, 0, scale.getZ()*transform.get(2, 0)); transform.set(2, 1, scale.getZ()*transform.get(2, 1)); transform.set(2, 2, scale.getZ()*transform.get(2, 2)); } else { transform.set(node.getMatrix()); } } applyTransformations(vertices, transform, false); transform.setTranslation(new Vector3f()); applyTransformations(normals, transform, true); }</code><technical_language>Minor whitespace style issues elsewhere, Checkstyle hooked run in IDE modified files</technical_language>

Target:
private void applyTransformations(GLTF gltf, TFloatList vertices, TFloatList normals) { int nodeIndex = -1; for (int i = 0; i < gltf.getNodes().size(); i++) { if (gltf.getNodes().get(i).getMesh() == 0) { nodeIndex = i; break; } } Matrix4f transform = getMatrix(gltf, nodeIndex); applyTransformations(vertices, transform, false); transform.setTranslation(new Vector3f()); applyTransformations(normals, transform, true); }
Source:
<code>public boolean accept(File dir, String name) { <START> return name.contains(baseLogfile) || name.matches(logPattern); <END> }</code><technical_language>String.matches recompile regex time. compile Pattern once. java private final Pattern logPattern; LogFilter(String logFile, String logPattern) { this.logPattern = Pattern.compile(logPattern); ... } ... return name.contains(baseLogFile) || pattern.matcher(name).matches();</technical_language>

Target:
public boolean accept(File dir, String name) { return name.contains(baseLogFile) || logPattern.matcher(name).matches(); }
Source:
<code>public CompletionStage<Void> setAvailabilityMode(AvailabilityMode availabilityMode) { if (availabilityMode != this.availabilityMode) { <START> if (notifier.hasListener(PartitionStatusChanged.class)) { <END> return notifier.notifyPartitionStatusChanged(availabilityMode, true) .thenCompose(ignore -> { updateAvailabilityMode(availabilityMode); return notifier.notifyPartitionStatusChanged(availabilityMode, false); }); } else { return updateAvailabilityMode(availabilityMode); } } else { return CompletableFutures.completedNull(); } }</code><technical_language>This performance-sensitive</technical_language>

Target:
public CompletionStage<Void> setAvailabilityMode(AvailabilityMode availabilityMode) { if (availabilityMode != this.availabilityMode) { return notifier.notifyPartitionStatusChanged(availabilityMode, true) .thenCompose(ignore -> { updateAvailabilityMode(availabilityMode); return notifier.notifyPartitionStatusChanged(availabilityMode, false); }); } else { return CompletableFutures.completedNull(); } }
Source:
<code>private Transactional getTransactionalAnnotationRecursive(Annotation... annotationsOnMember) { if(annotationsOnMember == null) return null; Class<? extends Annotation> stereotypeAnnotation = null; for(Annotation annotation: annotationsOnMember) { if(annotation.annotationType().equals(Transactional.class)) { return (Transactional) annotation; } if (beanManager.isStereotype(annotation.annotationType())) { <START> stereotypeAnnotation = annotation.annotationType(); <END> } } if(stereotypeAnnotation != null) { return getTransactionalAnnotationRecursive(stereotypeAnnotation.getAnnotations()); } return null; }</code><technical_language>I if is more stereotype annotation (which is allowed), this override variable inspect of is incorrect</technical_language>

Target:
private Transactional getTransactionalAnnotationRecursive(Annotation... annotationsOnMember) { if(annotationsOnMember == null) return null; Set<Class<? extends Annotation>> stereotypeAnnotations = new HashSet<>(); for(Annotation annotation: annotationsOnMember) { if(annotation.annotationType().equals(Transactional.class)) { return (Transactional) annotation; } if (beanManager.isStereotype(annotation.annotationType())) { stereotypeAnnotations.add(annotation.annotationType()); } } for(Class<? extends Annotation> stereotypeAnnotation: stereotypeAnnotations) { return getTransactionalAnnotationRecursive(beanManager.getStereotypeDefinition(stereotypeAnnotation)); } return null; }
Source:
<code>private List<Partition> batchGetPartitions(AWSGlueAsync glueClient, String tableName) throws IOException { List<Partition> partitions = new ArrayList<>(); String nextToken = null; try { do { GetPartitionsRequest getPartitionsRequest = new GetPartitionsRequest() .withCatalogId(mGlueConfiguration.get(Property.CATALOG_ID)) .withDatabaseName(mGlueDbName) .withTableName(tableName) .withMaxResults(mGlueConfiguration.getInt(Property.MAX_GLUE_FETCH_PARTITIONS)) .withNextToken(nextToken); GetPartitionsResult getPartitionsResult = glueClient.getPartitions(getPartitionsRequest); <START> getPartitionsResult.getPartitions().forEach(partition -> partitions.add(partition)); <END> nextToken = getPartitionsResult.getNextToken(); LOG.debug("Glue table {}.{} added partitions.", mGlueDbName, tableName, partitions.size()); } while (nextToken != null); if (partitions != null) { LOG.info("Glue table {}.{} has partitions.", mGlueDbName, tableName, partitions.size()); if (LOG.isDebugEnabled()) { partitions.stream().forEach(partition -> LOG.debug("Glue table {}.{} with partition: {}.", partition.getDatabaseName(), tableName, partition.toString())); } } return partitions; } catch (AWSGlueException e) { throw new IOException("Cannot get partition information for table: " + tableName + " in Database: " + mGlueDbName + "; Catalog ID: " + mGlueConfiguration.get(Property.CATALOG_ID) + ". error: " + e.getMessage(), e); } }</code><technical_language>this partitions.addAll(getPartitionsResult.getPartitions()</technical_language>

Target:
private List<Partition> batchGetPartitions(AWSGlueAsync glueClient, String tableName) throws IOException { List<Partition> partitions = new ArrayList<>(); String nextToken = null; try { do { GetPartitionsRequest getPartitionsRequest = new GetPartitionsRequest() .withCatalogId(mGlueConfiguration.get(Property.CATALOG_ID)) .withDatabaseName(mGlueDbName) .withTableName(tableName) .withMaxResults(mGlueConfiguration.getInt(Property.MAX_GLUE_FETCH_PARTITIONS)) .withNextToken(nextToken); GetPartitionsResult getPartitionsResult = glueClient.getPartitions(getPartitionsRequest); partitions.addAll(getPartitionsResult.getPartitions()); nextToken = getPartitionsResult.getNextToken(); LOG.debug("Glue table {}.{} adding batch partitions with total partitions.", mGlueDbName, tableName, getPartitionsResult.getPartitions().size(), partitions.size()); } while (nextToken != null); if (partitions != null) { LOG.info("Glue table {}.{} has partitions.", mGlueDbName, tableName, partitions.size()); if (LOG.isDebugEnabled()) { partitions.stream().forEach(partition -> LOG.debug("Glue table {}.{} with partition: {}.", partition.getDatabaseName(), tableName, partition.toString())); } } return partitions; } catch (AWSGlueException e) { throw new IOException("Cannot get partition information for table: " + tableName + " in Database: " + mGlueDbName + "; Catalog ID: " + mGlueConfiguration.get(Property.CATALOG_ID) + ". error: " + e.getMessage(), e); } }
Source:
<code>private static boolean isReturnValueUsed(CallExpressionTree tree) { Tree parent = ((JavaScriptTree) tree).getParent(); if (parent.is(CONDITIONAL_OR, CONDITIONAL_AND)) { return ((BinaryExpressionTree) parent).leftOperand().equals(tree); } if (parent.is(CONDITIONAL_EXPRESSION)) { return ((ConditionalExpressionTree) parent).condition().equals(tree); } <START> return !parent.is(Kind.EXPRESSION_STATEMENT); <END> }</code><technical_language>@vilchik-elena if parent is a parenthesised expression</technical_language>

Target:
private static boolean isReturnValueUsed(CallExpressionTree tree) { Tree parent = getParentIgnoreParenthesis(tree); if (parent.is(CONDITIONAL_OR, CONDITIONAL_AND)) { return ((BinaryExpressionTree) parent).leftOperand().equals(tree); } if (parent.is(CONDITIONAL_EXPRESSION)) { return ((ConditionalExpressionTree) parent).condition().equals(tree); } return !parent.is(Kind.EXPRESSION_STATEMENT); }
Source:
<code>public boolean accept(File dir, String name) { if (new Date().getTime() - dir.lastModified() < MAX_TIME_AGENT_LOG_RETRIEVAL) { <START> return name.endsWith(".log"); <END> } return false; }</code><technical_language>I if performance if exchange conditions? If file is a log file, sense calculate dates</technical_language>

Target:
public boolean accept(File dir, String name) { if (name.endsWith(".log") && new Date().getTime() - dir.lastModified() < MAX_TIME_AGENT_LOG_RETRIEVAL) { return true; } return false; }
Source:
<code>public void onRestoreInstanceState(Bundle savedInstanceStateBundle) { <START> if (mHasStableIds) { <END> if (savedInstanceStateBundle == null) { return; } if (!savedInstanceStateBundle.containsKey(STABLE_ID_MAP)) { return; } mStableIdMap = (HashMap<Long, Boolean>) savedInstanceStateBundle.getSerializable(STABLE_ID_MAP); Log.d(TAG, mStableIdMap.toString()); int i = 0; while (i < mItemList.size()) { if (mItemList.get(i) instanceof ParentObject) { ParentObject parentObject = (ParentObject) mItemList.get(i); if (mStableIdMap.containsKey(parentObject.getStableId())) { parentObject.setExpanded(mStableIdMap.get(parentObject.getStableId())); if (parentObject.isExpanded()) { i++; mItemList.add(i, parentObject.getChildObject()); } } else { parentObject.setExpanded(false); } } i++; } notifyDataSetChanged(); } }</code><technical_language>I strongly prefer inverting kinds of tests bail early, instead of wrapping entire method. E.g.: if (!mHasStableIds) { return; } a thing, rid of level of nesting reduces conditional context for reader</technical_language>

Target:
public void onRestoreInstanceState(Bundle savedInstanceStateBundle) { if (!mHasStableIds) { return; } if (savedInstanceStateBundle == null) { return; } if (!savedInstanceStateBundle.containsKey(STABLE_ID_MAP)) { return; } mStableIdMap = (HashMap<Long, Boolean>) savedInstanceStateBundle.getSerializable(STABLE_ID_MAP); Log.d(TAG, mStableIdMap.toString()); int i = 0; while (i < mItemList.size()) { if (mItemList.get(i) instanceof ParentObject) { ParentObject parentObject = (ParentObject) mItemList.get(i); if (mStableIdMap.containsKey(parentObject.getStableId())) { parentObject.setExpanded(mStableIdMap.get(parentObject.getStableId())); if (parentObject.isExpanded()) { i++; mItemList.add(i, parentObject.getChildObject()); } } else { parentObject.setExpanded(false); } } i++; } notifyDataSetChanged(); }
Source:
<code>public void transform(StructuredRecord in, Emitter<StructuredRecord> emitter) throws Exception { List<Schema.Field> fields = in.getSchema().getFields(); String[] records = String.valueOf(in.get(config.fieldToSplit)).split(config.delimiter); for (String record : records) { StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); for (Schema.Field field : fields) { String name = field.getName(); if (outSchema.getField(name) != null && !name.equals(config.fieldToSplit)) { builder.set(name, in.get(name)); <START> } <END> } builder.set(config.outputField, record.trim()); emitter.emit(builder.build()); } }</code><technical_language>move loop out of outer loop dont set fields for split. able reuse builder</technical_language>

Target:
public void transform(StructuredRecord in, Emitter<StructuredRecord> emitter) throws Exception { List<Schema.Field> fields = in.getSchema().getFields(); Object valueToSplit = in.get(config.fieldToSplit); if (valueToSplit != null) { String[] records = String.valueOf(valueToSplit).split(config.delimiter); for (String record : records) { StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); for (Schema.Field field : fields) { String name = field.getName(); if (outSchema.getField(name) != null && !name.equals(config.fieldToSplit)) { builder.set(name, in.get(name)); } } builder.set(config.outputField, record.trim()); emitter.emit(builder.build()); } } }
Source:
<code>public void setUpSessionDataContainer() { MockitoAnnotations.initMocks(this); if (Config.getConfigUtils() == null) { Config.setConfigUtils(mock(IConfigUtilsInterface.class)); } <START> when(Config.getConfigUtils().getValue(ConfigValues.CoCoCommandLifeInMinutes, ConfigCommon.defaultConfigurationVersion)).thenReturn(300); <END> }</code><technical_language>pls formatter</technical_language>

Target:
public void setUpSessionDataContainer() { MockitoAnnotations.initMocks(this); }
Source:
<code>private void initializeAnnouncer() { if (announcer == null) { final Announcer announcer = new Announcer(getCuratorFramework(), Execs.singleThreaded("Announcer-%s")); lifecycle.addManagedInstance(announcer); final ZkDataSegmentAnnouncerConfig config = getConfigFactory().build(ZkDataSegmentAnnouncerConfig.class); final String announcerType = config.getAnnouncerType(); final DataSegmentAnnouncer dataSegmentAnnouncer; <START> if ("curator".equalsIgnoreCase(announcerType)) { <END> dataSegmentAnnouncer = new CuratorDataSegmentAnnouncer( getDruidServerMetadata(), getZkPaths(), announcer, getJsonMapper() ); } else if ("batch".equalsIgnoreCase(announcerType)) { dataSegmentAnnouncer = new BatchingCuratorDataSegmentAnnouncer( getDruidServerMetadata(), config, announcer, getJsonMapper() ); } else if ("multiple".equalsIgnoreCase(announcerType)) { dataSegmentAnnouncer = new MultipleDataSegmentAnnouncerDataSegmentAnnouncer( Arrays.<AbstractDataSegmentAnnouncer>asList( new BatchingCuratorDataSegmentAnnouncer( getDruidServerMetadata(), config, announcer, getJsonMapper() ), new CuratorDataSegmentAnnouncer( getDruidServerMetadata(), getZkPaths(), announcer, getJsonMapper() ) ) ); } else { throw new ISE("Unknown announcer type [%s]", announcerType); } setAnnouncer(dataSegmentAnnouncer); lifecycle.addManagedInstance(getAnnouncer(), Lifecycle.Stage.LAST); } }</code><technical_language>methods. continue support method of publishing stuff. So, "multiple" else. call "multiple" "legacy" "compatibility" intended away</technical_language>

Target:
private void initializeAnnouncer() { if (announcer == null) { final Announcer announcer = new Announcer(getCuratorFramework(), Execs.singleThreaded("Announcer-%s")); lifecycle.addManagedInstance(announcer); final ZkDataSegmentAnnouncerConfig config = getConfigFactory().build(ZkDataSegmentAnnouncerConfig.class); final String announcerType = config.getAnnouncerType(); final DataSegmentAnnouncer dataSegmentAnnouncer; if ("batch".equalsIgnoreCase(announcerType)) { dataSegmentAnnouncer = new BatchDataSegmentAnnouncer( getDruidServerMetadata(), config, announcer, getJsonMapper() ); } else if ("legacy".equalsIgnoreCase(announcerType)) { dataSegmentAnnouncer = new MultipleDataSegmentAnnouncerDataSegmentAnnouncer( Arrays.<AbstractDataSegmentAnnouncer>asList( new BatchDataSegmentAnnouncer( getDruidServerMetadata(), config, announcer, getJsonMapper() ), new SingleDataSegmentAnnouncer( getDruidServerMetadata(), getZkPaths(), announcer, getJsonMapper() ) ) ); } else { throw new ISE("Unknown announcer type [%s]", announcerType); } setAnnouncer(dataSegmentAnnouncer); lifecycle.addManagedInstance(getAnnouncer(), Lifecycle.Stage.LAST); } }
Source:
<code>public void update() throws Exception { <START> String id = "id"; <END> ServiceProviderDTO dto = new ServiceProviderDTO("id", "name", "description"); final ServiceProvider provider = new ServiceProvider(new ID(id), dto.name, dto.description); Request request = makeRequestThatContains(dto); context.checking(new Expectations() {{ oneOf(repository).update(with(matching(provider))); }}); Reply<?> reply = service.update(id, request); assertThat(reply, isOk()); }</code><technical_language>give this stored in DTO</technical_language>

Target:
public void update() throws Exception { String id = "id123"; ServiceProviderDTO dto = new ServiceProviderDTO("id", "name", "description"); final ServiceProvider provider = new ServiceProvider(new ID(id), dto.name, dto.description); Request request = makeRequestThatContains(dto); context.checking(new Expectations() {{ oneOf(repository).update(with(matching(provider))); }}); Reply<?> reply = service.update(id, request); assertThat(reply, isOk()); }
Source:
<code>private void rehash() { int newCapacity = capacity * 2; long[] newKeys = new long[newCapacity]; V[] newValues = (V[]) new Object[newCapacity]; for (int i = 0; i < keys.length; i++) { long storedKey = keys[i]; V storedValue = values[i]; if (storedValue != EmptyValue && storedValue != DeletedValue) { insertKeyValueNoLock(newKeys, newValues, storedKey, storedValue); } } keys = newKeys; values = newValues; usedBuckets = size; CAPACITY_UPDATER.lazySet(this, newCapacity); <START> resizeThreshold = (int) (capacity * MapFillFactor); <END> }</code><technical_language>resizeThreshold = (int) (newCapacity * MapFillFactor)</technical_language>

Target:
private void rehash() { int newCapacity = capacity * 2; long[] newKeys = new long[newCapacity]; V[] newValues = (V[]) new Object[newCapacity]; for (int i = 0; i < keys.length; i++) { long storedKey = keys[i]; V storedValue = values[i]; if (storedValue != EmptyValue && storedValue != DeletedValue) { insertKeyValueNoLock(newKeys, newValues, storedKey, storedValue); } } keys = newKeys; values = newValues; usedBuckets = size; CAPACITY_UPDATER.lazySet(this, newCapacity); resizeThreshold = (int) (newCapacity * MapFillFactor); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_message); YieldsApplication.setApplicationContext(getApplicationContext()); YieldsApplication.setResources(getResources()); try { YieldsClientUser.createInstance("Client user", new Id(117), "email", Bitmap.createBitmap(80, 80, Bitmap.Config.RGB_565)); YieldsApplication.setGroup(new Group("Presentation", new Id(2), new ArrayList<User>())); } catch (InstantiationException | ExecutionException | InterruptedException | IOException e) { <START> e.printStackTrace(); <END> } mUser = YieldsApplication.getUser(); mGroup = YieldsApplication.getGroup(); mMessages = new ArrayList<>(); mImage = null; mSendImage = false; mAdapter = new ListAdapterMessages(YieldsApplication.getApplicationContext(), R.layout.messagelayout, mMessages); ListView listView = (ListView) findViewById(R.id.messageScrollLayout); listView.setAdapter(mAdapter); mInputField = (EditText) findViewById(R.id.inputMessageField); if(mUser == null || mGroup == null) { showErrorToast("Couldn't get group informations."); TextView groupName = (TextView) findViewById(R.id.groupName); groupName.setText("Unknown group"); }else { setHeaderBar(); try { retrieveGroupMessages(); } catch (IOException e) { showErrorToast("Couldn't retrieve messages."); } } }</code><technical_language>I avoid printing stack traces app crash... setup error activity handle error transparent</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_message); YieldsApplication.setApplicationContext(getApplicationContext()); YieldsApplication.setResources(getResources()); try { Bitmap image1 = Bitmap.createBitmap(80, 80, Bitmap.Config.RGB_565); YieldsApplication.setUser(new MockClientUser("Mock User", new Id(117), "Mock Email", image1)); YieldsApplication.setGroup(createFakeGroup()); } catch (NodeException e) { e.printStackTrace(); } mUser = YieldsApplication.getUser(); mGroup = YieldsApplication.getGroup(); mMessages = new ArrayList<>(); mImage = null; mSendImage = false; mAdapter = new ListAdapterMessages(YieldsApplication.getApplicationContext(), R.layout.messagelayout, mMessages); mMessageScrollLayout = (ListView) findViewById(R.id.messageScrollLayout); mMessageScrollLayout.setAdapter(mAdapter); mInputField = (EditText) findViewById(R.id.inputMessageField); if(mUser == null || mGroup == null) { showErrorToast("Couldn't get group informations."); TextView groupName = (TextView) findViewById(R.id.groupName); groupName.setText("Unknown group"); }else { setHeaderBar(); try { new RetrieveMessageTask().execute().get(); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } } }
Source:
<code>protected void persist(String mountPath, List<ReplicaTokenInfo> tokenInfoList) throws IOException { File temp = new File(mountPath, replicaTokenFileName + ".tmp"); File actual = new File(mountPath, replicaTokenFileName); try (FileOutputStream fileStream = new FileOutputStream(temp)) { replicaTokenSerde.serializeTokens(tokenInfoList, fileStream); temp.renameTo(actual); logger.debug("Completed writing replica tokens to file {}", actual.getAbsolutePath()); } catch (IOException e) { logger.error("IO error while persisting tokens to disk {}", temp.getAbsoluteFile()); <START> if (!storageManager.isDiskAvailableAtMountPath(mountPath)) { <END> mountPathsToSkip.add(mountPath); } throw e; } }</code><technical_language>need add a new method StorageManager check mount path. This class partitionGroupedByMountPath map find partition/replica for mount path. call StoreManager.checkLocalPartitionStatus() avoid adding replication -> store dependency</technical_language>

Target:
protected void persist(String mountPath, List<ReplicaTokenInfo> tokenInfoList) throws IOException { File temp = new File(mountPath, replicaTokenFileName + ".tmp"); File actual = new File(mountPath, replicaTokenFileName); try (FileOutputStream fileStream = new FileOutputStream(temp)) { replicaTokenSerde.serializeTokens(tokenInfoList, fileStream); temp.renameTo(actual); logger.debug("Completed writing replica tokens to file {}", actual.getAbsolutePath()); } catch (IOException e) { logger.error("IO error while persisting tokens to disk {}", temp.getAbsoluteFile()); PartitionInfo partitionInfo = partitionGroupedByMountPath.get(mountPath).iterator().next(); if (storeManager.checkLocalPartitionStatus(partitionInfo.getPartitionId(), partitionInfo.getLocalReplicaId()) == ServerErrorCode.Disk_Unavailable) { mountPathsToSkip.add(mountPath); } throw e; } }
Source:
<code>protected String toString(Operator operator) { <START> if (Operator.STARTSWITH.equals(operator)) return LIKE; <END> return operator.toString(); }</code><technical_language>I recommend adding {}</technical_language>

Target:
protected String toString(Operator operator) { if (Operator.STARTSWITH.equals(operator)) { return LIKE; } return operator.toString(); }
Source:
<code>private static void computeVersion(ServletContext context) { Properties props = new Properties(); try (InputStream is = Jenkins.class.getResourceAsStream("jenkins-version.properties")) { if(is!=null) props.load(is); } catch (IOException e) { e.printStackTrace(); } String ver = props.getProperty("version"); if(ver==null) ver = UNCOMPUTED_VERSION; if(Main.isDevelopmentMode && "${build.version}".equals(ver)) { try { File dir = new File(".").getAbsoluteFile(); while(dir != null) { File pom = new File(dir, "pom.xml"); if (pom.exists() && "pom".equals(XMLUtils.getValue("/project/artifactId", pom))) { pom = pom.getCanonicalFile(); LOGGER.info("Reading version from: " + pom.getAbsolutePath()); ver = XMLUtils.getValue("/project/version", pom); break; } dir = dir.getParentFile(); } LOGGER.info("Jenkins is in dev mode, using version: " + ver); } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to read Jenkins version: " + e.getMessage(), e); } } VERSION = ver; context.setAttribute("version",ver); VERSION_HASH = Util.getDigestOf(ver).substring(0, 8); SESSION_HASH = Util.getDigestOf(ver+System.currentTimeMillis()).substring(0, 8); if(ver.equals(UNCOMPUTED_VERSION) || SystemProperties.getBoolean("hudson.script.noCache")) RESOURCE_PATH = ""; else RESOURCE_PATH = "static/"+SESSION_HASH; <START> VIEW_RESOURCE_PATH = "/resources/"+ SESSION_HASH; <END> }</code><technical_language>changed then</technical_language>

Target:
private static void computeVersion(ServletContext context) { Properties props = new Properties(); try (InputStream is = Jenkins.class.getResourceAsStream("jenkins-version.properties")) { if(is!=null) props.load(is); } catch (IOException e) { e.printStackTrace(); } String ver = props.getProperty("version"); if(ver==null) ver = UNCOMPUTED_VERSION; if(Main.isDevelopmentMode && "${build.version}".equals(ver)) { try { File dir = new File(".").getAbsoluteFile(); while(dir != null) { File pom = new File(dir, "pom.xml"); if (pom.exists() && "pom".equals(XMLUtils.getValue("/project/artifactId", pom))) { pom = pom.getCanonicalFile(); LOGGER.info("Reading version from: " + pom.getAbsolutePath()); ver = XMLUtils.getValue("/project/version", pom); break; } dir = dir.getParentFile(); } LOGGER.info("Jenkins is in dev mode, using version: " + ver); } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to read Jenkins version: " + e.getMessage(), e); } } VERSION = ver; context.setAttribute("version",ver); VERSION_HASH = Util.getDigestOf(ver).substring(0, 8); SESSION_HASH = Util.getDigestOf(ver+System.currentTimeMillis()).substring(0, 8); if(ver.equals(UNCOMPUTED_VERSION) || SystemProperties.getBoolean("hudson.script.noCache")) RESOURCE_PATH = ""; else RESOURCE_PATH = "/static/"+SESSION_HASH; VIEW_RESOURCE_PATH = "/resources/"+ SESSION_HASH; }
Source:
<code>public Pair<VM, FullEntityOvfData> readVmFromOvf(String ovf) throws OvfReaderException { VM vm = new VM(); ArrayList<VmNetworkInterface> interfaces = new ArrayList<>(); FullEntityOvfData fullEntityOvfData = new FullEntityOvfData(vm); ovfManager.importVm(ovf, vm, fullEntityOvfData); vm.setImages((ArrayList) fullEntityOvfData.getDiskImages()); vm.setInterfaces(interfaces); Map<Guid, List<DiskImage>> images = ImagesHandler .getImagesLeaf(fullEntityOvfData.getDiskImages()); <START> for (Map.Entry<Guid, List<DiskImage>> entry : images.entrySet()) { <END> List<DiskImage> list = entry.getValue(); vm.getDiskMap().put(entry.getKey(), list.get(list.size() - 1)); } for (LunDisk lunDisk : fullEntityOvfData.getLunDisks()) { vm.getDiskMap().put(lunDisk.getId(), lunDisk); } return new Pair<>(vm, fullEntityOvfData); }</code><technical_language>suggestion: Map.forEach((k, v) -> { ... })</technical_language>

Target:
public Pair<VM, FullEntityOvfData> readVmFromOvf(String ovf) throws OvfReaderException { VM vm = new VM(); FullEntityOvfData fullEntityOvfData = new FullEntityOvfData(vm); ovfManager.importVm(ovf, vm, fullEntityOvfData); vm.setImages((ArrayList) fullEntityOvfData.getDiskImages()); vm.setInterfaces(fullEntityOvfData.getInterfaces()); Map<Guid, List<DiskImage>> images = ImagesHandler .getImagesLeaf(fullEntityOvfData.getDiskImages()); for (Map.Entry<Guid, List<DiskImage>> entry : images.entrySet()) { List<DiskImage> list = entry.getValue(); vm.getDiskMap().put(entry.getKey(), list.get(list.size() - 1)); } for (LunDisk lunDisk : fullEntityOvfData.getLunDisks()) { vm.getDiskMap().put(lunDisk.getId(), lunDisk); } return new Pair<>(vm, fullEntityOvfData); }
Source:
<code>private static String getURLEncoded(String url) { try { return URLEncoder.encode(url, Charsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { <START> return null; <END> } }</code><technical_language>throw IllegalStateException() is a handle this return null. _IF_ UTF_8 disappears for some reason stack trace exception easier find debug NPE in caller</technical_language>

Target:
private static String getURLEncoded(String url) { try { return URLEncoder.encode(url, Charsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException( "Failed to use UTF-8 encoding charset", e); } }
Source:
<code>public void saveMappings() throws PMException, ProjectDeletedException, IncompatibleTypeException { try { for (IAUTMainPO aut : m_objectMappings.keySet()) { if (aut != null) { EditSupport editSupport = new EditSupport(aut, null); editSupport.reinitializeEditSupport(); editSupport.lockWorkVersion(); IAUTMainPO workVersion = (IAUTMainPO) editSupport.getWorkVersion(); IObjectMappingPO objMap = workVersion.getObjMap(); Map<IComponentIdentifier, String> autObjectMapping = m_objectMappings.get(aut); if (autObjectMapping != null) { for (IComponentIdentifier ci : autObjectMapping.keySet()) { objMap.addObjectMappingAssoziation( autObjectMapping.get(ci), ci); } } editSupport.saveWorkVersion(); DataEventDispatcher.getInstance().fireDataChangedListener( objMap, DataState.StructureModified, UpdateState.all); <START> DataEventDispatcher.getInstance().fireProjectStateChanged( <END> ProjectState.revise_project); } } } catch (PersistenceException e) { PersistenceManager.handleDBExceptionForMasterSession(null, e); } }</code><technical_language>Retrieve singleton once</technical_language>

Target:
public void saveMappings() throws PMException, ProjectDeletedException, IncompatibleTypeException { try { for (IAUTMainPO aut : m_objectMappings.keySet()) { if (aut != null) { EditSupport editSupport = new EditSupport(aut, null); editSupport.reinitializeEditSupport(); editSupport.lockWorkVersion(); IAUTMainPO workVersion = (IAUTMainPO) editSupport.getWorkVersion(); IObjectMappingPO objMap = workVersion.getObjMap(); Map<IComponentIdentifier, String> autObjectMapping = m_objectMappings.get(aut); if (autObjectMapping != null) { for (IComponentIdentifier ci : autObjectMapping.keySet()) { objMap.addObjectMappingAssoziation( autObjectMapping.get(ci), ci); } } editSupport.saveWorkVersion(); DataEventDispatcher.getInstance().fireDataChangedListener( objMap, DataState.StructureModified, UpdateState.all); } } } catch (PersistenceException e) { PersistenceManager.handleDBExceptionForMasterSession(null, e); } }
Source:
<code>public void setEventList(List<ITimeEvent> eventList) { if (eventList != null) { super.setEventList(eventList.stream().map(timeEvent -> isValidEvent(timeEvent) ? timeEvent : <START> null).collect(Collectors.toList())); <END> } }</code><technical_language>This guarantee list is mutable, is required addEvent(). inconsistency setZoomedEventList() is overridden. Although, leaning check in this class..</technical_language>

Target:
public void setEventList(List<ITimeEvent> eventList) { sanitizeList(eventList, super::setEventList); }
Source:
<code>public void close() throws IOException { <START> if (!isComplete() && wsChannel.isOpen()) { <END> throw new IOException("Closed before all bytes where read"); } closed = true; ChannelListeners.invokeChannelListener(this, closeSetter.get()); }</code><technical_language>need mark underlying channel broken here, frames read</technical_language>

Target:
public void close() throws IOException { if (!isComplete() && wsChannel.isOpen()) { wsChannel.markBroken(); throw WebSocketMessages.MESSAGES.closedBeforeAllBytesWereRead(); } closed = true; ChannelListeners.invokeChannelListener(this, closeSetter.get()); }