auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void writeMetacardToZip(ZipOutputStream zipOutputStream, Metacard metacard) { try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream)) { ZipEntry zipEntry = new ZipEntry(METACARD_PATH + metacard.getId()); zipOutputStream.putNextEntry(zipEntry); objectOutputStream.writeObject(new MetacardImpl(metacard)); <START> InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); <END> IOUtils.copy(inputStream, zipOutputStream); inputStream.close(); } catch (IOException e) { LOGGER.debug("Failed to add metacard with id {}.", metacard.getId(), e); } }</code><technical_language>I this call byteArrayOutputStream.toByteArray() blow memory. I recommend guava's [FileBackedOutputStream](<LINK_0>, calling .toByteSource().openStream(). private void writeMetacardToZip(ZipOutputStream zipOutputStream, Metacard metacard) { InputStream inputStream = null; try (FileBackedOutputStream fileBackedOutputStream = new FileBackedOutputStream(THRESHOLD); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileBackedOutputStream)) { ZipEntry zipEntry = new ZipEntry(METACARD_PATH + metacard.getId()); zipOutputStream.putNextEntry(zipEntry); objectOutputStream.writeObject(new MetacardImpl(metacard)); inputStream = fileBackedOutputStream.asByteSource().openStream(); IOUtils.copy(inputStream, zipOutputStream); } catch (IOException e) { LOGGER.debug("Failed add metacard id {}.", metacard.getId(), e); } finally { try { inputStream.close(); } catch (IOException | NullPointerException ignore) { } } }</technical_language>

Target:
private void writeMetacardToZip(ZipOutputStream zipOutputStream, Metacard metacard) { InputStream inputStream = null; try (FileBackedOutputStream fileBackedOutputStream = new FileBackedOutputStream(BUFFER_SIZE); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileBackedOutputStream)) { ZipEntry zipEntry = new ZipEntry(METACARD_PATH + metacard.getId()); zipOutputStream.putNextEntry(zipEntry); objectOutputStream.writeObject(new MetacardImpl(metacard)); inputStream = fileBackedOutputStream.asByteSource().openStream(); IOUtils.copy(inputStream, zipOutputStream); } catch (IOException e) { LOGGER.debug("Failed to add metacard with id {}.", metacard.getId(), e); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException e) { LOGGER.debug("Failed to close input stream", e); } } }
Source:
<code>public void test() { <START> JavaCheckVerifier.verify("src/test/files/checks/serialization/BlindSerialVersionUidCheck.java", new BlindSerialVersionUidCheck()); <END> }</code><technical_language>miss test semantic, method verifyNoIssueWithoutSemantic</technical_language>

Target:
public void test() { String fixtureFileName = "src/test/files/checks/serialization/BlindSerialVersionUidCheck.java"; BlindSerialVersionUidCheck check = new BlindSerialVersionUidCheck(); JavaCheckVerifier.verify(fixtureFileName, check); JavaCheckVerifier.verifyNoIssueWithoutSemantic(fixtureFileName, check); }
Source:
<code>public void testCreateNewUserVariableAndDeletion() { String userVariableName = "testVariable1"; String secondUserVariableName = "testVariable2"; onBrickAtPosition(0).checkShowsText(R.string.brick_when_started); onBrickAtPosition(1).checkShowsText(R.string.brick_set_variable); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner) .performNewVariableInitial(userVariableName); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner) .performNewVariable(secondUserVariableName); onBrickAtPosition(1).onFormulaTextField(R.id.brick_set_variable_edit_text) .perform(click()); <START> deleteItemWithTextFromFormulaEditorDataList(userVariableName, BrickTestUtils.UserVariableUsage.IN_USE); <END> pressBack(); onView(withText(userVariableName)) .check(doesNotExist()); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).onChildView(withText(userVariableName)) .check(doesNotExist()); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).onChildView(withText(secondUserVariableName)) .check(matches(isDisplayed())); }</code><technical_language>a formulaEditorWrapper this stuff..</technical_language>

Target:
public void testCreateNewUserVariableAndDeletion() { String userVariableName = "testVariable1"; String secondUserVariableName = "testVariable2"; onBrickAtPosition(0) .checkShowsText(R.string.brick_when_started); onBrickAtPosition(1) .checkShowsText(R.string.brick_set_variable); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner) .performNewVariableInitial(userVariableName); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner) .performNewVariable(secondUserVariableName); onBrickAtPosition(1).onFormulaTextField(R.id.brick_set_variable_edit_text) .perform(click()); onFormulaEditor() .performOpenDataFragment(); onDataList().onVariableAtPosition(0) .performDelete(); onDataList() .performClose(); pressBack(); onView(withText(userVariableName)) .check(doesNotExist()); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).onChildView(withText(userVariableName)) .check(doesNotExist()); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).onChildView(withText(secondUserVariableName)) .check(matches(isDisplayed())); }
Source:
<code>public V getIfPresent(K key) { V value = cache.get(key); if (value == null) { <START> missCount.incrementAndGet(); <END> } else { hitCount.getAndIncrement(); } return value; }</code><technical_language>For readability sake, increments atomic method call</technical_language>

Target:
public V getIfPresent(K key) { V value = cache.get(key); if (value == null) { missCount.getAndIncrement(); } else { hitCount.getAndIncrement(); } return value; }
Source:
<code>public void handleMessage(Message message) throws Fault { String method = (String) message.get(Message.HTTP_REQUEST_METHOD); String query = (String) message.get(Message.QUERY_STRING); if (!"GET".equals(method) || StringUtils.isEmpty(query)) { return; } String baseUri = (String) message.get(Message.REQUEST_URL); String ctx = (String) message.get(Message.PATH_INFO); Map<String, String> map = UrlUtils.parseQueryString(query); if (isRecognizedQuery( map, baseUri, ctx, message.getExchange().getEndpoint().getEndpointInfo())) { Document doc = getDocument(message, baseUri, map, ctx); <START> if (map.containsKey("wsdl") && doc != null) { <END> doc = addPolicyToWSDL(doc, loader.getPolicy()); doc = configureAddress(doc); } Endpoint e = message.getExchange().get(Endpoint.class); Message mout = new MessageImpl(); mout.setExchange(message.getExchange()); mout = e.getBinding().createMessage(mout); mout.setInterceptorChain( OutgoingChainInterceptor.getOutInterceptorChain(message.getExchange())); message.getExchange().setOutMessage(mout); mout.put(WSDLGetInterceptor.DOCUMENT_HOLDER, doc); mout.put(Message.CONTENT_TYPE, "text/xml"); cleanUpOutInterceptors(mout); mout.getInterceptorChain().add(WSDLGetOutInterceptor.INSTANCE); message.getExchange().put("transform.skip", Boolean.TRUE); message .getInterceptorChain() .doInterceptStartingAt(message, OutgoingChainInterceptor.class.getName()); } }</code><technical_language>reverse 2 conditions bother hashing map if doc null start</technical_language>

Target:
public void handleMessage(Message message) throws Fault { String method = (String) message.get(Message.HTTP_REQUEST_METHOD); String query = (String) message.get(Message.QUERY_STRING); if (!"GET".equals(method) || StringUtils.isEmpty(query)) { return; } String baseUri = (String) message.get(Message.REQUEST_URL); String ctx = (String) message.get(Message.PATH_INFO); Map<String, String> map = UrlUtils.parseQueryString(query); if (isRecognizedQuery( map, baseUri, ctx, message.getExchange().getEndpoint().getEndpointInfo())) { Document doc = getDocument(message, baseUri, map, ctx); if (doc != null && map.containsKey("wsdl")) { doc = addPolicyToWSDL(doc, loader.getPolicy()); doc = configureAddress(doc); } Endpoint e = message.getExchange().get(Endpoint.class); Message mout = new MessageImpl(); mout.setExchange(message.getExchange()); mout = e.getBinding().createMessage(mout); mout.setInterceptorChain( OutgoingChainInterceptor.getOutInterceptorChain(message.getExchange())); message.getExchange().setOutMessage(mout); mout.put(WSDLGetInterceptor.DOCUMENT_HOLDER, doc); mout.put(Message.CONTENT_TYPE, "text/xml"); cleanUpOutInterceptors(mout); mout.getInterceptorChain().add(WSDLGetOutInterceptor.INSTANCE); message.getExchange().put("transform.skip", Boolean.TRUE); message .getInterceptorChain() .doInterceptStartingAt(message, OutgoingChainInterceptor.class.getName()); } }
Source:
<code>public void addSpanSubstitutionNullSpanType() { thrown.expect(NullPointerException.class); thrown.expectMessage("Must provide a spanType for substitution"); <START> builder.addSubstitution((SpanType) null, <END> "bold"); }</code><technical_language>need for type cast</technical_language>

Target:
public void addSpanSubstitutionNullSpanType() { thrown.expect(NullPointerException.class); thrown.expectMessage("Must provide a spanType"); builder.addSubstitution((SpanType) null, "bold"); }
Source:
<code>public double calculateAUC() { double auc = 0.0; double aup; Point pointA; Point pointB = points.get(0); for (int i = 1; i < points.size(); i++) { pointA = pointB; pointB = points.get(i); if (pointB.x != pointA.x) { if (pointB.y == pointA.y) { aup = pointA.y * (pointB.x - pointA.x); } else { <START> aup = pointB.y * (pointB.x - pointA.x); <END> aup += 0.5 * (pointA.y - pointB.y) * (pointB.x - pointA.x); } auc += aup; } } return auc; }</code><technical_language>Doesnt aup = pointA.y * (pointB.x - pointA.x) |It calculate rectangle. pointB.y calculate upper rectangle. i wronng here, please correct :) ![pointexa](<LINK_0></technical_language>

Target:
public double calculateAUC() { double auc = 0.0; double aup; Point pointA; Point pointB = points.get(0); for (int i = 1; i < points.size(); i++) { pointA = pointB; pointB = points.get(i); if (pointB.x != pointA.x) { if (pointB.y == pointA.y) { aup = pointA.y * (pointB.x - pointA.x); } else { aup = pointA.y * (pointB.x - pointA.x); aup += 0.5 * (pointB.y - pointA.y) * (pointB.x - pointA.x); } auc += aup; } } return auc; }
Source:
<code>private void createNormalConnector() { Map<String, String> props = new HashMap<>(); <START> props.put(CONNECTOR_CLASS_CONFIG, MonitorableSinkConnector.class.getName()); <END> props.put(TASKS_MAX_CONFIG, "1"); props.put(TOPICS_CONFIG, "normal-topic"); log.info("Creating normal connector"); try { connect.configureConnector(NORMAL_CONNECTOR_NAME, props); } catch (RuntimeException e) { log.info("Failed to create connector", e); throw e; } }</code><technical_language>create source connectors produce data? flow of records this connector</technical_language>

Target:
private void createNormalConnector() { connect.kafka().createTopic(TEST_TOPIC, 3); normalConnectorHandle = RuntimeHandles.get().connectorHandle(NORMAL_CONNECTOR_NAME); normalConnectorHandle.expectedRecords(NUM_RECORDS_PRODUCED); normalConnectorHandle.expectedCommits(NUM_RECORDS_PRODUCED); Map<String, String> props = new HashMap<>(); props.put(CONNECTOR_CLASS_CONFIG, MonitorableSourceConnector.class.getName()); props.put(TASKS_MAX_CONFIG, "1"); props.put(MonitorableSourceConnector.TOPIC_CONFIG, TEST_TOPIC); log.info("Creating normal connector"); try { connect.configureConnector(NORMAL_CONNECTOR_NAME, props); } catch (RuntimeException e) { log.info("Failed to create connector", e); throw e; } }
Source:
<code>public Necromentia(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); this.getSpellAbility().addEffect( <START> new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NONBASIC_LAND_NAME).setText("Choose a card name other than a basic land card name") <END> ); this.getSpellAbility().addEffect(new NecromentiaEffect()); this.getSpellAbility().addTarget(new TargetOpponent()); }</code><technical_language>Wrong setting. NOT_BASIC_LAND_NAME. need custom text here. Wrong/custom text is smell of wrong effect/ability implementation. showCardInfo() unit test view card's auto-generated text</technical_language>

Target:
public Necromentia(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); this.getSpellAbility().addEffect( new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NOT_BASIC_LAND_NAME) ); this.getSpellAbility().addEffect(new NecromentiaEffect()); this.getSpellAbility().addTarget(new TargetOpponent()); }
Source:
<code>public Field(InputField inputField, String label, boolean embeded, int layout) { <START> this(inputField, label, embeded, DynamicForm.LAYOUT_VERTICAL, ""); <END> }</code><technical_language>this is wrong</technical_language>

Target:
public Field(InputField inputField, String label, boolean embeded, int layout) { this(inputField, label, embeded, layout, ""); }
Source:
<code>protected Message merge(Message storedMessage, Message newMessage) { <START> List<Field> fields = new ArrayList(storedMessage.getFields()); <END> newMessage.getFields().forEach(field -> { if (!containsField(fields, field) && !containsField(new ArrayList<>(storedMessage.getFields()), field)) { fields.add(field); } }); Set<Field> reorderedFields = reorderFields(fields); return new Message(storedMessage.getName(), reorderedFields); }</code><technical_language>Please add diamond operator avoid raw types compiler warning</technical_language>

Target:
protected Message merge(Message storedMessage, Message newMessage) { List<Field> fields = new ArrayList<>(storedMessage.getFields()); newMessage.getFields().forEach(field -> { if (!containsField(fields, field) && !containsField(new ArrayList<>(storedMessage.getFields()), field)) { fields.add(field); } }); Set<Field> reorderedFields = reorderFields(fields); return new Message(storedMessage.getName(), reorderedFields); }
Source:
<code>public LookupExtractor get() { final Lock readLock = startStopSync.readLock(); try { readLock.lockInterruptibly(); } catch (InterruptedException e) { throw Throwables.propagate(e); } try { if (entry == null) { throw new ISE("Factory [%s] not started", extractorID); } <START> CacheScheduler.CacheState cacheState = entry.getCacheState(); <END> if (cacheState == CacheScheduler.NoCache.CACHE_NOT_INITIALIZED) { throw new ISE("%s not yet initialized cache, extractorID = %s", entry, extractorID); } if (cacheState == CacheScheduler.NoCache.ENTRY_CLOSED) { throw new ISE("%s disposed, extractorID = %s", entry, extractorID); } CacheScheduler.VersionedCache versionedCache = (CacheScheduler.VersionedCache) cacheState; Map<String, String> map = versionedCache.getCache(); final byte[] v = StringUtils.toUtf8(versionedCache.getVersion()); final byte[] id = StringUtils.toUtf8(extractorID); return new MapLookupExtractor(map, isInjective()) { @Override public byte[] getCacheKey() { return ByteBuffer .allocate(CLASS_CACHE_KEY.length + id.length + 1 + v.length + 1 + 1) .put(CLASS_CACHE_KEY) .put(id).put((byte) 0xFF) .put(v).put((byte) 0xFF) .put(isOneToOne() ? (byte) 1 : (byte) 0) .array(); } }; } finally { readLock.unlock(); } }</code><technical_language>Suggest final</technical_language>

Target:
public LookupExtractor get() { final Lock readLock = startStopSync.readLock(); try { readLock.lockInterruptibly(); } catch (InterruptedException e) { throw Throwables.propagate(e); } try { if (entry == null) { throw new ISE("Factory [%s] not started", extractorID); } final CacheScheduler.CacheState cacheState = entry.getCacheState(); if (cacheState instanceof CacheScheduler.NoCache) { final String noCacheReason = ((CacheScheduler.NoCache) cacheState).name(); throw new ISE("%s: %s, extractorID = %s", entry, noCacheReason, extractorID); } CacheScheduler.VersionedCache versionedCache = (CacheScheduler.VersionedCache) cacheState; Map<String, String> map = versionedCache.getCache(); final byte[] v = StringUtils.toUtf8(versionedCache.getVersion()); final byte[] id = StringUtils.toUtf8(extractorID); return new MapLookupExtractor(map, isInjective()) { @Override public byte[] getCacheKey() { return ByteBuffer .allocate(CLASS_CACHE_KEY.length + id.length + 1 + v.length + 1 + 1) .put(CLASS_CACHE_KEY) .put(id).put((byte) 0xFF) .put(v).put((byte) 0xFF) .put(isOneToOne() ? (byte) 1 : (byte) 0) .array(); } }; } finally { readLock.unlock(); } }
Source:
<code>public SeleniumWDateFieldWebElement(final WebElement element, final WebDriver driver) { super(element, driver); final String tagName = element.getTagName(); <START> if (!tagName.equals(TOP_LEVEL_TAG)) { <END> throw new IllegalArgumentException("Element is not the expected wrapper. tag=[" + tagName + "]."); } }</code><technical_language>WDateField is input element a div wrapper? safer limit in some other - a check outer element's class attribute wc-datefield. I pretty a WDateField in a readOnly state is wrapped in a time element a WPartialDateField in read-only state is wrapped in a span element (the div for editable WDateField is necessary of need for a calendar in polyfill). this fail if get component in a read-only state other input extensions do allow read-only components</technical_language>

Target:
public SeleniumWDateFieldWebElement(final WebElement element, final WebDriver driver) { super(element, driver); final String tagName = element.getTagName(); String elementClass = element.getAttribute("class"); if (!tagName.equals(TOP_STANDARD_LEVEL_TAG) && !tagName.equals(TOP_READONLY_LEVEL_TAG)) { throw new IllegalArgumentException("Element is not the expected wrapper. tag=[" + tagName + "]."); } else if (!elementClass.contains("wc-datefield")) { throw new IllegalArgumentException("Element is not the expected ctyle class. class=[" + elementClass + "]."); } }
Source:
<code>protected void execLoad() throws ProcessingException { getResultTableField().getTable().setDefaultIconId(getContentAssistField().getBrowseIconId()); getActiveStateRadioButtonGroup().setVisible(getContentAssistField().isActiveFilterEnabled()); <START> getActiveStateRadioButtonGroup().setValue((TriState) getContentAssistField().getActiveFilter()); <END> getNewButton().setEnabled(getContentAssistField().getBrowseNewText() != null); getNewButton().setLabel(getContentAssistField().getBrowseNewText()); }</code><technical_language>remove unnecessary cast</technical_language>

Target:
protected void execLoad() throws ProcessingException { getResultTableField().getTable().setDefaultIconId(getContentAssistField().getBrowseIconId()); getActiveStateRadioButtonGroup().setVisible(getContentAssistField().isActiveFilterEnabled()); getActiveStateRadioButtonGroup().setValue(getContentAssistField().getActiveFilter()); getNewButton().setEnabled(getContentAssistField().getBrowseNewText() != null); getNewButton().setLabel(getContentAssistField().getBrowseNewText()); }
Source:
<code>private void validateInput(final String input, int maxLength) { checkNotNull(input); checkState(input.length() <= maxLength, String.format("input must be <= %d chars", maxLength)); <START> checkState(Iterables.any(FORBIDDEN_PREFIX, new Predicate<String>() { <END> @Override public boolean apply(@Nullable String input) { return input.startsWith(input); } }), "Cannot starts with " + Iterables.toString(FORBIDDEN_PREFIX)); }</code><technical_language>Negate condition, failing if is correct</technical_language>

Target:
private void validateInput(final String input, int maxLength) { checkNotNull(input); checkState(input.length() <= maxLength, String.format("input must be <= %d chars", maxLength)); checkState(!Iterables.any(FORBIDDEN_PREFIX, new Predicate<String>() { @Override public boolean apply(@Nullable String input) { return input.startsWith(input); } }), "Cannot starts with " + Iterables.toString(FORBIDDEN_PREFIX)); }
Source:
<code>public boolean waitForYellowStatus(String[] indexNames, int timeoutSecond) { boolean ret = true; String timeout = timeoutSecond + "s"; log.debug("Waiting for cluster yellow health status, indexes: " + Arrays.toString(indexNames)); String errorMessage = null; try { ClusterHealthResponse response = client.admin() .cluster() .prepareHealth(indexNames) .setTimeout(timeout) .setWaitForYellowStatus() .get(); if (response.isTimedOut()) { ret = false; errorMessage = "ES Cluster health status not Yellow after " + timeout + " give up: " <START> + response; <END> } else { if ((indexNames.length > 0) && response.getStatus() != ClusterHealthStatus.GREEN) { log.warn("Es Cluster ready but not GREEN: " + response); } else { log.info("ES Cluster ready: " + response); } } } catch (NoNodeAvailableException e) { errorMessage = "Failed to connect to elasticsearch, check addressList and clusterName: " + e.getMessage(); } if (errorMessage != null) { log.error(errorMessage); throw new RuntimeException(errorMessage); } return ret; }</code><technical_language>Please this kind of C idiom in Java initialize default return values / errors start of method. do: String errorMessage = "ES Cluster health status Yellow " + timeout + " give up: " + response; log.error(errorMessage); throw new RuntimeException(errorMessage); NuxeoException instead of RuntimeException. want log error. exception logged bubbles caller</technical_language>

Target:
public boolean waitForYellowStatus(String[] indexNames, int timeoutSecond) { String timeout = timeoutSecond + "s"; log.debug("Waiting for cluster yellow health status, indexes: " + Arrays.toString(indexNames)); try { ClusterHealthResponse response = client.admin() .cluster() .prepareHealth(indexNames) .setTimeout(timeout) .setWaitForYellowStatus() .get(); if (response.isTimedOut()) { throw new NuxeoException("Elasticsearch Cluster health status not Yellow after " + timeout + " give up: " + response); } if (response.getStatus() != ClusterHealthStatus.GREEN) { log.warn("Elasticsearch Cluster ready but not GREEN: " + response); return false; } log.info("Elasticsearch Cluster ready: " + response); } catch (NoNodeAvailableException e) { throw new NuxeoException("Failed to connect to elasticsearch, check addressList and clusterName: " + e.getMessage()); } return true; }
Source:
<code>public void testInitMissingMaster() throws Exception { selectProject(PROJ1); clickInit(); fillDialog(MASTER_BRANCH_MISSING); bot.waitUntil(shellIsActive(UIText.InitDialog_masterBranchIsMissing)); bot.button("Yes").click(); bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs")); GitFlowRepository gitFlowRepository = new GitFlowRepository(repository); GitFlowConfig config = gitFlowRepository.getConfig(); assertEquals(DEVELOP_BRANCH, repository.getBranch()); assertEquals(MASTER_BRANCH_MISSING, config.getMaster()); assertEquals(FEATURE_BRANCH_PREFIX, config.getFeaturePrefix()); assertEquals(RELEASE_BRANCH_PREFIX, config.getReleasePrefix()); assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix()); assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix()); <START> assertNotNull(repository.exactRef(Constants.R_HEADS + DEVELOP_BRANCH)); <END> }</code><technical_language>unrelated change</technical_language>

Target:
public void testInitMissingMaster() throws Exception { selectProject(PROJ1); clickInit(); fillDialog(MASTER_BRANCH_MISSING); bot.waitUntil(shellIsActive(UIText.InitDialog_masterBranchIsMissing)); bot.button("Yes").click(); bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs")); GitFlowRepository gitFlowRepository = new GitFlowRepository(repository); GitFlowConfig config = gitFlowRepository.getConfig(); assertEquals(DEVELOP_BRANCH, repository.getBranch()); assertEquals(MASTER_BRANCH_MISSING, config.getMaster()); assertEquals(FEATURE_BRANCH_PREFIX, config.getFeaturePrefix()); assertEquals(RELEASE_BRANCH_PREFIX, config.getReleasePrefix()); assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix()); assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix()); assertNotNull(repository.getRef(Constants.R_HEADS + DEVELOP_BRANCH)); }
Source:
<code>public Token<OzoneTokenIdentifier> getDelegationToken(String renewer) throws IOException { <START> if (!securityEnabled || renewer == null) { <END> return null; } else { Token<OzoneTokenIdentifier> token = ozoneClient.getObjectStore().getDelegationToken(new Text(renewer)); token.setKind(OzoneTokenIdentifier.KIND_NAME); return token; } }</code><technical_language>issuing token if renewer is passed legit case</technical_language>

Target:
public Token<OzoneTokenIdentifier> getDelegationToken(String renewer) throws IOException { if (!securityEnabled) { return null; } Token<OzoneTokenIdentifier> token = ozoneClient.getObjectStore() .getDelegationToken(renewer == null ? null : new Text(renewer)); token.setKind(OzoneTokenIdentifier.KIND_NAME); return token; }
Source:
<code>public static void deleteDir(File file) throws IOException { if (file.isFile()) { if (!file.delete()) throw new IOException("Fail to delete File(" + file.getAbsolutePath() + ")"); return; } File[] children = file.listFiles(); for (File <START> children1 : <END> children) { deleteDir(children1); } if (!file.delete()) throw new IOException("Fail to delete Dir(" + file.getAbsolutePath() + ")"); return; }</code><technical_language>child</technical_language>

Target:
public static void deleteDir(File file) throws IOException { if (file.isFile()) { if (!file.delete()) throw new IOException("Fail to delete File(" + file.getAbsolutePath() + ")"); return; } File[] children = file.listFiles(); for (File child : children) { deleteDir(child); } if (!file.delete()) throw new IOException("Fail to delete Dir(" + file.getAbsolutePath() + ")"); return; }
Source:
<code>public Observable<ResultSet> updateStatusToFinished(Date timeSlice, UUID jobId) { <START> return session.executeAndFetch(findByIdAndSlice.bind(timeSlice, jobId)).flatMap( <END> (_jobId) -> session.execute(updateStatus.bind((byte) 1, timeSlice, jobId)) .doOnError(t -> logger.warnf("There was an error updating the status to finished for %s in time " + "slice [%s]", jobId, timeSlice.getTime())) ); }</code><technical_language>I consider adding some logging in here. expectation is a row for timeSlice jobId. a minimum, I log a warning row exist. question is, if else done</technical_language>

Target:
public Observable<ResultSet> updateStatusToFinished(Date timeSlice, UUID jobId) { return session.executeAndFetch(findByIdAndSlice.bind(timeSlice, jobId)) .isEmpty() .flatMap(empty -> { if (empty) { logger.warnf("Attempt to update status of non-exist job with id %s", jobId); return Observable.empty(); } else { return session.execute(updateStatus.bind((byte) 1, timeSlice, jobId)) .doOnError(t -> logger .warnf("There was an error updating the status to finished for %s in time " + "slice [%s]", jobId, timeSlice.getTime())); } }); }
Source:
<code>public Verification withAudience(String... audience) { <START> requireClaim(PublicClaims.AUDIENCE, audience); <END> return this; }</code><technical_language>this instead suggestion requireClaim(PublicClaims.AUDIENCE, audience == null ? null : Arrays.asList(audience));</technical_language>

Target:
public Verification withAudience(String... audience) { requireClaim(PublicClaims.AUDIENCE, audience == null ? null : Arrays.asList(audience)); return this; }
Source:
<code>public ReportInfoFragment newReportInfoFragment(@NonNull Trip trip) { Bundle args = new Bundle(); <START> args.putParcelable(Trip.Companion.getPARCEL_KEY(), trip); <END> return attachArguments(ReportInfoFragment.newInstance(), args); }</code><technical_language>For of these, update Trip.PARCEL_KEY field add @JvmStatic annotation, continue reference (i.e. Trip.PARCEL_KEY instead of Trip.Companion.getPARCEL_KEY()). This walks this some more: <LINK_0></technical_language>

Target:
public ReportInfoFragment newReportInfoFragment(@NonNull Trip trip) { Bundle args = new Bundle(); args.putParcelable(Trip.PARCEL_KEY, trip); return attachArguments(ReportInfoFragment.newInstance(), args); }
Source:
<code>private void getSCMSignedCert(OzoneConfiguration config) { try { PKCS10CertificationRequest csr = getCSR(config); SCMSecurityProtocol secureScmClient = HddsUtils.getScmSecurityClient(config, HddsUtils.getScmAddressForSecurityProtocol(config)); String pemEncodedCert = secureScmClient.getDataNodeCertificate( datanodeDetails.getProtoBufMessage(), getEncodedString(csr)); dnCertClient.storeCertificate(pemEncodedCert, true, false); datanodeDetails.setCertSerialId(getX509Certificate(pemEncodedCert). getSerialNumber().toString()); persistDatanodeDetails(datanodeDetails); <START> String pemEncodedRootCert = secureScmClient.getCACertificate(); <END> dnCertClient.storeCertificate(pemEncodedRootCert, true, true); } catch (IOException | CertificateException e) { LOG.error("Error while storing SCM signed certificate.", e); throw new RuntimeException(e); } }</code><technical_language>get CA certificate based DN certificate signed CA? container a signer certificate id</technical_language>

Target:
private void getSCMSignedCert(OzoneConfiguration config) { try { PKCS10CertificationRequest csr = getCSR(config); SCMSecurityProtocol secureScmClient = HddsUtils.getScmSecurityClient(config, HddsUtils.getScmAddressForSecurityProtocol(config)); String pemEncodedCert = secureScmClient.getDataNodeCertificate( datanodeDetails.getProtoBufMessage(), getEncodedString(csr)); dnCertClient.storeCertificate(pemEncodedCert, true); datanodeDetails.setCertSerialId(getX509Certificate(pemEncodedCert). getSerialNumber().toString()); persistDatanodeDetails(datanodeDetails); String pemEncodedRootCert = secureScmClient.getCACertificate(); dnCertClient.storeCertificate(pemEncodedRootCert, true, true); } catch (IOException | CertificateException e) { LOG.error("Error while storing SCM signed certificate.", e); throw new RuntimeException(e); } }
Source:
<code>private void setScrollListener() { gridView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { <START> view.setFastScrollEnabled(scrollState!=SCROLL_STATE_IDLE); <END> } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (hasMoreImages && !isLoading && (firstVisibleItem + visibleItemCount + 1 >= totalItemCount)) { isLoading = true; fetchMoreImages(); } if (!hasMoreImages){ progressBar.setVisibility(GONE); } } }); }</code><technical_language>formatting needs correcting, spaces operators</technical_language>

Target:
private void setScrollListener() { gridView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (hasMoreImages && !isLoading && (firstVisibleItem + visibleItemCount + 1 >= totalItemCount)) { isLoading = true; fetchMoreImages(); } if (!hasMoreImages){ progressBar.setVisibility(GONE); } } }); }
Source:
<code>public boolean isDeleted(ArtifactId artifact) { <START> return ((ArtifactReadable) artifact).isDeleted(); <END> }</code><technical_language>Add instanceof check</technical_language>

Target:
public boolean isDeleted(ArtifactId artifact) { return atsServer.getArtifact(artifact).isDeleted(); }
Source:
<code>public static Date toDate(String sDate) { try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.parse(sDate); } catch (ParseException e) { throw new RuntimeException(e); <START> } <END> }</code><technical_language>more readable split this commit 2 : - refactoring sanitze code - new format</technical_language>

Target:
public static Date toDate(String sDate) { return Date.from(LocalDate.parse(sDate).atStartOfDay(ZoneId.systemDefault()).toInstant()); }
Source:
<code>private GrillClientResultSetWithStats getResultsFromStatement(GrillStatement statement) { QueryStatus.Status status = statement.getStatus().getStatus(); if(status != QueryStatus.Status.SUCCESSFUL) { throw new IllegalStateException(statement.getStatus().getStatusMessage() + " cause:" + statement.getStatus().getErrorMessage()); } <START> GrillClientResultSet result = new GrillClientResultSet(statement.getResultSet(), <END> statement.getResultSetMetaData()); return new GrillClientResultSetWithStats(result, statement.getQuery()); }</code><technical_language>If remove isResultAvailable check, resultset resultset metadata null, result in some null pointer exceptions. checks reading result metadata GrillClientResultSet? add isResultAvailable flag finished query</technical_language>

Target:
private GrillClientResultSetWithStats getResultsFromStatement(GrillStatement statement) { QueryStatus.Status status = statement.getStatus().getStatus(); if(status != QueryStatus.Status.SUCCESSFUL) { throw new IllegalStateException(statement.getStatus().getStatusMessage() + " cause:" + statement.getStatus().getErrorMessage()); } GrillClientResultSet result = null; if (statement.getStatus().isResultSetAvailable()) { result = new GrillClientResultSet(statement.getResultSet(), statement.getResultSetMetaData()); } return new GrillClientResultSetWithStats(result, statement.getQuery()); }
Source:
<code>public Long getMaximumExistingDatafileIdentifier(Dataset dataset) { long zeroFiles = new Long(0); Long retVal = zeroFiles; Long testVal; List<Object> idResults; Long dsId = dataset.getId(); if (dsId != null) { try { <START> idResults = em.createNativeQuery("select o.identifier from dvobject o " <END> + "where o.owner_Id = " + dsId + "").getResultList(); } catch (NoResultException ex) { logger.fine("No files found in dataset id " + dsId + ". Returning a count of zero."); return zeroFiles; } if (idResults != null) { for (Object raw: idResults){ String identifier = (String) raw; identifier = identifier.substring(identifier.lastIndexOf("/") + 1); testVal = new Long(identifier) ; if (testVal > retVal){ retVal = testVal; } } } } return retVal; }</code><technical_language>replace this a @NamedQuery JPQL</technical_language>

Target:
public Long getMaximumExistingDatafileIdentifier(Dataset dataset) { long zeroFiles = new Long(0); Long retVal = zeroFiles; Long testVal; List<Object> idResults; Long dsId = dataset.getId(); if (dsId != null) { try { idResults = em.createNamedQuery("Dataset.findByOwnerIdentifier") .setParameter("owner_id", dsId).getResultList(); } catch (NoResultException ex) { logger.fine("No files found in dataset id " + dsId + ". Returning a count of zero."); return zeroFiles; } if (idResults != null) { for (Object raw: idResults){ String identifier = (String) raw; identifier = identifier.substring(identifier.lastIndexOf("/") + 1); testVal = new Long(identifier) ; if (testVal > retVal){ retVal = testVal; } } } } return retVal; }
Source:
<code>@Test public void noUsernameOrPassphrase() throws Exception { final String credentialsId = "creds"; final String keyContent = "the-key"; story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SSHUserPrivateKey c = new DummyPrivateKey(credentialsId, "", "", keyContent); CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition("" + "node {\n" + " withCredentials([sshUserPrivateKey(keyFileVariable: 'THEKEY', credentialsId: '" + credentialsId + "')]) {\n" + " semaphore 'basics'\n" <START> + " sh '''\n" <END> + " set +x\n" + " cat $THEKEY > key.txt" + " '''\n" + " }\n" + "}", true)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("basics/1", b); } }); story.addStep(new Statement() { @Override public void evaluate() throws Throwable { WorkflowJob p = story.j.jenkins.getItemByFullName("p", WorkflowJob.class); assertNotNull(p); WorkflowRun b = p.getBuildByNumber(1); assertNotNull(b); SemaphoreStep.success("basics/1", null); story.j.waitForCompletion(b); story.j.assertBuildStatusSuccess(b); FilePath key = story.j.jenkins.getWorkspaceFor(p).child("key.txt"); assertTrue(key.exists()); assertEquals(keyContent, key.readToString().trim()); } }); }</code><technical_language>[fails Windows](<LINK_0></technical_language>

Target:
@Test public void noUsernameOrPassphrase() throws Exception { final String credentialsId = "creds"; final String keyContent = "the-key"; story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SSHUserPrivateKey c = new DummyPrivateKey(credentialsId, "", "", keyContent); CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p"); String script; if (Functions.isWindows()) { script = " bat '''\n" + " @echo off\n" + " type \"%THEKEY%\" > key.txt" + " '''\n"; } else { script = " sh '''\n" + " cat $THEKEY > key.txt" + " '''\n"; } p.setDefinition(new CpsFlowDefinition("" + "node {\n" + " withCredentials([sshUserPrivateKey(keyFileVariable: 'THEKEY', credentialsId: '" + credentialsId + "')]) {\n" + " semaphore 'basics'\n" + script + " }\n" + "}", true)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("basics/1", b); } }); story.addStep(new Statement() { @Override public void evaluate() throws Throwable { WorkflowJob p = story.j.jenkins.getItemByFullName("p", WorkflowJob.class); assertNotNull(p); WorkflowRun b = p.getBuildByNumber(1); assertNotNull(b); SemaphoreStep.success("basics/1", null); story.j.waitForCompletion(b); story.j.assertBuildStatusSuccess(b); FilePath key = story.j.jenkins.getWorkspaceFor(p).child("key.txt"); assertTrue(key.exists()); assertEquals(keyContent, key.readToString().trim()); } }); }
Source:
<code><START> private UserTuneManager(XMPPConnection connection) throws NotLoggedInException { <END> super(connection); PepManager.getInstanceFor(connection).addPepListener(new PepListener() { @Override public void eventReceived(EntityBareJid from, EventElement event, Message message) { if (!USERTUNE_NODE.equals(event.getEvent().getNode())) { return; } final BareJid contact = from.asBareJid(); asyncButOrdered.performAsyncButOrdered(contact, new Runnable() { @Override public void run() { ItemsExtension items = (ItemsExtension) event.getExtensions().get(0); PayloadItem<?> payload = (PayloadItem) items.getItems().get(0); UserTuneElement tune = (UserTuneElement) payload.getPayload(); for (UserTuneListener listener : userTuneListeners) { listener.onUserTuneUpdated(contact, message, tune); } } }); } }); ServiceDiscoveryManager.getInstanceFor(connection).addFeature(USERTUNE_NOTIFY); pubSubManager = PubSubManager.getInstanceFor(getAuthenticatedConnectionOrThrow(), connection().getUser().asBareJid()); }</code><technical_language>nit: missing newline</technical_language>

Target:
private UserTuneManager(XMPPConnection connection) throws NotLoggedInException { super(connection); pepManager = PepManager.getInstanceFor(connection); pepManager.addPepListener(new PepListener() { @Override public void eventReceived(EntityBareJid from, EventElement event, Message message) { if (!USERTUNE_NODE.equals(event.getEvent().getNode())) { return; } final BareJid contact = from.asBareJid(); asyncButOrdered.performAsyncButOrdered(contact, () -> { ItemsExtension items = (ItemsExtension) event.getExtensions().get(0); PayloadItem<?> payload = (PayloadItem) items.getItems().get(0); UserTuneElement tune = (UserTuneElement) payload.getPayload(); for (UserTuneListener listener : userTuneListeners) { synchronized (userTuneListeners) { listener.onUserTuneUpdated(contact, message, tune); } } }); } }); if (ENABLE_USER_TUNE_NOTIFICATIONS_BY_DEFAULT) { enableUserTuneNotifications(); } }
Source:
<code><START> private void parseNext() { <END> if (eventStreamReader != null) { try { long startTime = System.currentTimeMillis(); dataBuffer.setLength(0); String line; while ((line = eventStreamReader.readLine()) != null) { int colonIndex; if (line.trim().isEmpty()) { break; } else if (line.startsWith(":")) { } else if ((colonIndex = line.indexOf(":")) != -1) { String field = line.substring(0, colonIndex); String value = line.substring(colonIndex + 1).replaceFirst(" ", EMPTY_STRING); processField(field, value); } else { processField(line.trim(), EMPTY_STRING); } } if (line == null) { endOfStreamReached = true; close(); } if (dataBuffer.length() > 0) { String data = dataBuffer.toString(); if (data.endsWith("\n")) { data = data.substring(0, data.length() - 1); } nextMessage = new StreamMessage(eventNameBuffer, lastEventId, data); } else { log.debug(eventNameBuffer.toString()); eventNameBuffer = EMPTY_STRING; nextMessage = null; } if (log.isDebugEnabled()) { log.debug("total stream message read/parse time (ms): " + (System.currentTimeMillis() - startTime)); } } catch (IOException ex) { log.error("failed to parse next stream event", ex); throw new SignalFlowException("failed to parse next stream event", ex); } } else { nextMessage = null; } }</code><technical_language>This is part I wish do Jetty's SSE client. I do in Python in sseclient library existing SSE client libraries in Python respect spec correctly, support streaming correctly</technical_language>

Target:
private void parseNext() { if (eventStreamReader != null) { try { long startTime = System.currentTimeMillis(); dataBuffer.setLength(0); String line; while ((line = eventStreamReader.readLine()) != null) { int colonIndex; if (line.trim().isEmpty()) { break; } else if (line.startsWith(":")) { } else if ((colonIndex = line.indexOf(":")) != -1) { String field = line.substring(0, colonIndex); String value = line.substring(colonIndex + 1).replaceFirst(" ", EMPTY_STRING); processField(field, value); } else { processField(line.trim(), EMPTY_STRING); } } if (line == null) { endOfStreamReached = true; close(); } if (dataBuffer.length() > 0) { String data = dataBuffer.toString(); if (data.endsWith("\n")) { data = data.substring(0, data.length() - 1); } nextMessage = new StreamMessage(eventNameBuffer, lastEventId, data); } else { log.debug(eventNameBuffer.toString()); eventNameBuffer = EMPTY_STRING; nextMessage = null; } log.debug("total stream message read/parse time (ms): {}", (System.currentTimeMillis() - startTime)); } catch (IOException ex) { log.error("failed to parse next stream event", ex); throw new SignalFlowException("failed to parse next stream event", ex); } } else { nextMessage = null; } }
Source:
<code>private ResultSet bindAndExecute(Object[] columnValues, RegularStatement statement) { try { PreparedStatement preparedStatement = session.prepare( statement ); BoundStatement boundStatement = new BoundStatement( preparedStatement ); for ( int i = 0; i < columnValues.length; i++ ) { DataType dataType = preparedStatement.getVariables().getType( i ); boundStatement.setBytesUnsafe( i, dataType.serialize( columnValues[i], protocolVersion ) ); } return session.execute( boundStatement ); } catch (DriverException e) { <START> log.failToExecuteCQL( statement.getQueryString(), e ); <END> return null; } }</code><technical_language>re-throw exception instead swallowing it. NPE raised subsequently</technical_language>

Target:
private ResultSet bindAndExecute(Object[] columnValues, RegularStatement statement) { try { PreparedStatement preparedStatement = session.prepare( statement ); BoundStatement boundStatement = new BoundStatement( preparedStatement ); for ( int i = 0; i < columnValues.length; i++ ) { DataType dataType = preparedStatement.getVariables().getType( i ); boundStatement.setBytesUnsafe( i, dataType.serialize( columnValues[i], protocolVersion ) ); } return session.execute( boundStatement ); } catch (DriverException e) { log.failToExecuteCQL( statement.getQueryString(), e ); throw e; } }
Source:
<code>private String getDestinationKey(String auxItemTag) throws IOException { if (dvObject instanceof DataFile) { if (key == null) { String baseKey = this.getDataFile().getOwner().getAuthority() + "/" + this.getDataFile().getOwner().getIdentifier(); String storageIdentifier = dvObject.getStorageIdentifier(); if (storageIdentifier == null || "".equals(storageIdentifier)) { throw new FileNotFoundException("Data Access: No local storage identifier defined for this datafile."); } if (storageIdentifier.startsWith("s3://")) { <START> bucketName = storageIdentifier.substring(storageIdentifier.indexOf(":") + 3, storageIdentifier.lastIndexOf(":")); <END> key = baseKey + "/" + storageIdentifier.substring(storageIdentifier.lastIndexOf(":") + 1); } else { throw new IOException("S3AccessIO: DataFile (storage identifier "+storageIdentifier+") does not appear to be an S3 object."); } } return key + "." + auxItemTag; } else if (dvObject instanceof Dataset) { return key + "/" + auxItemTag; } else { throw new IOException("S3AccessIO: This operation is only supported for Datasets and DataFiles."); } }</code><technical_language>If a hard +3, assume index 6</technical_language>

Target:
private String getDestinationKey(String auxItemTag) throws IOException { if (dvObject instanceof DataFile) { return getMainFileKey() + "." + auxItemTag; } else if (dvObject instanceof Dataset) { return key + "/" + auxItemTag; } else { throw new IOException("S3AccessIO: This operation is only supported for Datasets and DataFiles."); } }
Source:
<code>protected Map<String, String> resolveProperties(Map<String, String> originalProperties, Map<String, String> properties, Boolean overrideProperties) { if (properties != null) { if (!overrideProperties) { properties.putAll(originalProperties); } <START> originalProperties = properties; <END> } return originalProperties; }</code><technical_language>modify original properties. I return properties;</technical_language>

Target:
protected Map<String, String> resolveProperties(Map<String, String> originalProperties, Map<String, String> properties, Boolean overrideProperties) { if (properties != null) { if (!overrideProperties) { properties.putAll(originalProperties); } return properties; } return originalProperties; }
Source:
<code>protected void doStart() { super.doStart(); if (this.idleEventInterval > 0) { <START> this.getRequiredTaskScheduler().scheduleWithFixedDelay(() -> { <END> long now = System.currentTimeMillis(); long lastAlertAt = FileTailingMessageProducerSupport.this.lastNoMessageAlert.get(); long lastReceive = FileTailingMessageProducerSupport.this.lastReceive; if (now > lastReceive + FileTailingMessageProducerSupport.this.idleEventInterval && now > lastAlertAt + FileTailingMessageProducerSupport.this.idleEventInterval && FileTailingMessageProducerSupport.this.lastNoMessageAlert.compareAndSet(lastAlertAt, now)) { publishIdleEvent(now - lastReceive); } }, this.idleEventInterval); } }</code><technical_language>a Future property cancel(true) in doStop()</technical_language>

Target:
protected void doStart() { super.doStart(); if (this.idleEventInterval > 0) { this.idleEventScheduledFuture = getTaskScheduler().scheduleWithFixedDelay(() -> { long now = System.currentTimeMillis(); long lastAlertAt = this.lastNoMessageAlert.get(); long lastProduce = this.lastProduce; if (now > lastProduce + this.idleEventInterval && now > lastAlertAt + this.idleEventInterval && this.lastNoMessageAlert.compareAndSet(lastAlertAt, now)) { publishIdleEvent(now - lastProduce); } }, this.idleEventInterval); } }
Source:
<code>public EurekaArchaius2ClientConfig(Config config, String namespace) { this.defaultRegion = config.getString("@region", null); <START> this.config = config.getPrefixedView(DEFAULT_NAMESPACE); <END> }</code><technical_language>namespace instead of DEFAULT</technical_language>

Target:
public EurekaArchaius2ClientConfig(Config config, String namespace) { this.defaultRegion = config.getString("@region", null); this.config = config.getPrefixedView(namespace); }
Source:
<code>private WrappedServletRequest wrapGzippedRequest(HttpServletRequest request) throws IOException { try { <START> GZIPInputStream input = new GZIPInputStream(request.getInputStream(), inputBufferSize); <END> InputStream exceptionHandlingInput = new ZipExceptionHandlingInputStream(input, GZIP); return new WrappedServletRequest(request, exceptionHandlingInput); } catch (ZipException e) { throw ZipExceptionHandlingInputStream.buildBadDataException(GZIP, e); } catch (EOFException e) { throw ZipExceptionHandlingInputStream.buildPrematureEofException(GZIP, e); } }</code><technical_language>Nit: please declare input final for consistency rest of codebase</technical_language>

Target:
private WrappedServletRequest wrapGzippedRequest(HttpServletRequest request) throws IOException { try { final GZIPInputStream input = new GZIPInputStream(request.getInputStream(), inputBufferSize); return new WrappedServletRequest(request, new ZipExceptionHandlingInputStream(input, GZIP)); } catch (IOException e) { throw ZipExceptionHandlingInputStream.handleException(GZIP, e); } }