auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object[][] provideScenarios() { try { List<Object[]> scenarios = new ArrayList<Object[]>(); List<CucumberFeature> features = getFeatures(); for (CucumberFeature feature : features) { List<PickleEvent> pickles = runtime.compileFeature(feature); for (PickleEvent pickle : pickles) { <START> scenarios.add(new Object[]{new PickleEventWrapper(pickle), new CucumberFeatureWrapperImpl(feature)}); <END> } } return scenarios.toArray(new Object[][]{}); } catch (CucumberException e) { return new Object[][]{new Object[]{new CucumberExceptionWrapper(e)}}; } }</code><technical_language>is runtime.matchesFilters(pickle) select pickles run</technical_language>

Target:
public Object[][] provideScenarios() { try { List<Object[]> scenarios = new ArrayList<Object[]>(); List<CucumberFeature> features = getFeatures(); for (CucumberFeature feature : features) { List<PickleEvent> pickles = runtime.compileFeature(feature); for (PickleEvent pickle : pickles) { if (runtime.matchesFilters(pickle)) { scenarios.add(new Object[]{new PickleEventWrapper(pickle), new CucumberFeatureWrapperImpl(feature)}); } } } return scenarios.toArray(new Object[][]{}); } catch (CucumberException e) { return new Object[][]{new Object[]{new CucumberExceptionWrapper(e)}}; } }
Source:
<code>public static byte[] unescape(byte[] in) { int escapeCount = 0; for (int i = 0; i < in.length; i++) { if (in[i] == 0x01) { escapeCount++; i++; } } if (escapeCount == 0) return in; byte ret[] = new byte[in.length - escapeCount]; int index = 0; for (int i = 0; i < in.length; i++) { if (in[i] == 0x01) { i++; <START> if (i >= in.length) { <END> return in; } ret[index++] = (byte) (in[i] - 1); } else { ret[index++] = in[i]; } } return ret; }</code><technical_language>This throw exception. This code is unescaping expects a character 0x01</technical_language>

Target:
public static byte[] unescape(byte[] in) { int escapeCount = 0; for (int i = 0; i < in.length; i++) { if (in[i] == 0x01) { escapeCount++; i++; } } if (escapeCount == 0) return in; byte[] ret = new byte[in.length - escapeCount]; int index = 0; for (int i = 0; i < in.length; i++) { if (in[i] == 0x01) { i++; if (i >= in.length) { throw new IllegalArgumentException("Bad bytes when attempting to unescape. Expected " + "more bytes after last byte " + String.format("x%02x", in[in.length - 1])); } ret[index++] = (byte) (in[i] - 1); } else { ret[index++] = in[i]; } } return ret; }
Source:
<code>public StoreKeyConverter getStoreKeyConverter() { <START> return new MockStoreKeyConverter(); <END> }</code><technical_language>problem is setConversionMap() call is factory. new MockStoreKeyConverter instances created</technical_language>

Target:
public MockStoreKeyConverter getStoreKeyConverter() { return new MockStoreKeyConverter(new HashMap<>(conversionMap)); }
Source:
<code>public String extractAuthCodeFromAuthResponse(@NonNull String redirectURLwithParams) throws OAuthException { <START> checkNotNull(redirectURLwithParams, "redirectURLwithParams must not be null"); <END> try { URL redirectURLObject = new URL(redirectURLwithParams); UrlEncoded urlEncoded = new UrlEncoded(redirectURLObject.getQuery()); String stateFromRedirectURL = urlEncoded.getValue(STATE, 0); if (stateFromRedirectURL == null) { if (persistedParams.state == null) { return urlEncoded.getValue(CODE, 0); } throw new OAuthException(String.format("state from redirectURL is incorrect. Expected: %s Found: %s", persistedParams.state, stateFromRedirectURL)); } else { if (stateFromRedirectURL.equals(persistedParams.state)) { return urlEncoded.getValue(CODE, 0); } throw new OAuthException(String.format("state from redirectURL is incorrect. Expected: %s Found: %s", persistedParams.state, stateFromRedirectURL)); } } catch (MalformedURLException e) { throw new OAuthException("Redirect URL is malformed", e); } }</code><technical_language>@NonNull added, checkNotNull(..) precondition is required</technical_language>

Target:
public String extractAuthCodeFromAuthResponse(@NonNull String redirectURLwithParams) throws OAuthException { try { URL redirectURLObject = new URL(redirectURLwithParams); UrlEncoded urlEncoded = new UrlEncoded(redirectURLObject.getQuery()); String stateFromRedirectURL = urlEncoded.getValue(STATE, 0); if (stateFromRedirectURL == null) { if (persistedParams.state == null) { return urlEncoded.getValue(CODE, 0); } throw new OAuthException(String.format("state from redirectURL is incorrect. Expected: %s Found: %s", persistedParams.state, stateFromRedirectURL)); } else { if (stateFromRedirectURL.equals(persistedParams.state)) { return urlEncoded.getValue(CODE, 0); } throw new OAuthException(String.format("state from redirectURL is incorrect. Expected: %s Found: %s", persistedParams.state, stateFromRedirectURL)); } } catch (MalformedURLException e) { throw new OAuthException("Redirect URL is malformed", e); } }
Source:
<code>public JdbcComputePushdown( FunctionMetadataManager functionMetadataManager, StandardFunctionResolution functionResolution, DeterminismEvaluator determinismEvaluator, ExpressionOptimizer expressionOptimizer, String identifierQuote, Set<Class<?>> functionTranslators) { <START> this.expressionOptimizer = requireNonNull(expressionOptimizer); <END> this.jdbcFilterToSqlTranslator = new JdbcFilterToSqlTranslator( requireNonNull(functionMetadataManager), buildFunctionTranslator(requireNonNull(functionTranslators)), requireNonNull(identifierQuote)); this.logicalRowExpressions = new LogicalRowExpressions( requireNonNull(determinismEvaluator), requireNonNull(functionResolution), requireNonNull(functionMetadataManager)); }</code><technical_language>a list of requireNonNull checks error messages assign requireNonNull if reused multiple times. java requireNonNull(functionMetadataManager, "functionMetadataManager is null"); requireNonNull(...); requireNonNull(...); ... this.jdbcFilterToSqlTranslator = new JdbcFilterToSqlTranslator(functionMetadataManager, buildFunctionTranslator(functionTranslators), identifierQuote); this.logicalRowExpressions = new LogicalRowExpressions(...); java this.functionMetadataManager = requireNonNull(functionMetadataManager, "functionMetadataManager is null");</technical_language>

Target:
public JdbcComputePushdown( FunctionMetadataManager functionMetadataManager, StandardFunctionResolution functionResolution, DeterminismEvaluator determinismEvaluator, ExpressionOptimizer expressionOptimizer, String identifierQuote, Set<Class<?>> functionTranslators) { requireNonNull(functionMetadataManager, "functionMetadataManager is null"); requireNonNull(identifierQuote, "identifierQuote is null"); requireNonNull(functionTranslators, "functionTranslators is null"); requireNonNull(determinismEvaluator, "determinismEvaluator is null"); requireNonNull(functionResolution, "functionResolution is null"); this.expressionOptimizer = requireNonNull(expressionOptimizer, "expressionOptimizer is null"); this.jdbcFilterToSqlTranslator = new JdbcFilterToSqlTranslator( functionMetadataManager, buildFunctionTranslator(functionTranslators), identifierQuote); this.logicalRowExpressions = new LogicalRowExpressions( determinismEvaluator, functionResolution, functionMetadataManager); }
Source:
<code>protected Result check() throws Exception { counter = counter + 1; try { hazelcastConnection.getHazelcast().getMap("health_check").put(uuid, counter); <START> int toCheck = (int) hazelcastConnection.getHazelcast().getMap("health_check").get(uuid); <END> return toCheck == counter ? Result.healthy("UUID=" + uuid + " - OK") : Result.unhealthy("UUID=" + uuid + " Something is wrong: health_check count is not updating"); } catch (Exception e) { return Result.healthy("UUID=" + uuid + " - Error: " + e.getMessage()); } }</code><technical_language>move health_check a constant</technical_language>

Target:
protected Result check() throws Exception { counter = counter + 1; try { hazelcastConnection.getHazelcast().getMap(HEALTHCHECK_MAP).put(uuid, counter); int toCheck = (int) hazelcastConnection.getHazelcast().getMap(HEALTHCHECK_MAP).get(uuid); return toCheck == counter ? Result.healthy("UUID:" + uuid + ", counter: " + counter + " - OK") : Result.unhealthy("UUID:" + uuid + ", counter: " + counter + " Something is wrong: healthCheck count is not updating"); } catch (Exception e) { return Result.healthy("UUID:" + uuid + " - Error: " + e.getMessage()); } }
Source:
<code>public RequestIdPolicy(RequestIdPolicyOptions requestIdPolicyOptions) { <START> this.requestIdPolicyOptions = Objects.requireNonNull(requestIdPolicyOptions, <END> "'retryPolicyOptions' cannot be null."); }</code><technical_language>Null check is necessary no-args constructor sets requestIdPolicyOptions null anyway</technical_language>

Target:
public RequestIdPolicy(RequestIdPolicyOptions requestIdPolicyOptions) { this.requestIdPolicyOptions = requestIdPolicyOptions; }
Source:
<code>public boolean isBootCompleted() throws DeviceNotAvailableException { return <START> getProp(SYSPROP_SYS_BOOT_COMPLETED) == "1" <END> && getProp(SYSPROP_DEV_BOOTCOMPLETE) == "1"; }</code><technical_language>equals()</technical_language>

Target:
public boolean isBootCompleted() throws DeviceNotAvailableException { return getProp(SYSPROP_SYS_BOOT_COMPLETED).equals("1") && getProp(SYSPROP_DEV_BOOTCOMPLETE).equals("1"); }
Source:
<code>public List<GlusterServerService> getByClusterIdAndServiceType(Guid clusterId, ServiceType serviceType) { MapSqlParameterSource paramSource = getCustomMapSqlParameterSource(); paramSource.addValue("cluster_id", clusterId); <START> paramSource.addValue("servive_type", serviceType); <END> return getCallsHandler().executeReadList("GetGlusterServerServicesByClusterIdAndServiceType", serviceRowMapper, paramSource); }</code><technical_language>Typo here. service_type</technical_language>

Target:
public List<GlusterServerService> getByClusterIdAndServiceType(Guid clusterId, ServiceType serviceType) { MapSqlParameterSource paramSource = getCustomMapSqlParameterSource(); paramSource.addValue("cluster_id", clusterId); paramSource.addValue("service_type", EnumUtils.nameOrNull(serviceType)); return getCallsHandler().executeReadList("GetGlusterServerServicesByClusterIdAndServiceType", serviceRowMapper, paramSource); }
Source:
<code>public ExpressionTransformer(Schema schema) { _timeColumn = schema.getTimeColumnName(); for (FieldSpec fieldSpec : schema.getAllFieldSpecs()) { <START> ExpressionEvaluator expressionEvaluator = ExpressionEvaluatorFactory.getExpressionEvaluator(fieldSpec); <END> if (expressionEvaluator != null) { _expressionEvaluators.put(fieldSpec.getName(), expressionEvaluator); } } }</code><technical_language>Skip virtual columns</technical_language>

Target:
public ExpressionTransformer(Schema schema) { for (FieldSpec fieldSpec : schema.getAllFieldSpecs()) { if (!fieldSpec.isVirtualColumn()) { ExpressionEvaluator expressionEvaluator = ExpressionEvaluatorFactory.getExpressionEvaluator(fieldSpec); if (expressionEvaluator != null) { _expressionEvaluators.put(fieldSpec.getName(), expressionEvaluator); } } } }
Source:
<code>int readRemote(long position, byte[] b, int offset, int length) throws IOException { if (position < 0) { throw new IllegalArgumentException("attempting to read from negative offset"); } if (position >= contentLength) { return -1; } if (b == null) { throw new IllegalArgumentException("null byte array passed in to read() method"); } if (offset >= b.length) { throw new IllegalArgumentException("offset greater than length of array"); } if (length < 0) { throw new IllegalArgumentException("requested read length is less than zero"); } if (length > (b.length - offset)) { throw new IllegalArgumentException("requested read length is more than will fit after requested offset in buffer"); } final AbfsRestOperation op; AbfsPerfTracker tracker = client.getAbfsPerfTracker(); try (AbfsPerfInfo perfInfo = new AbfsPerfInfo(tracker, "readRemote", "read")) { op = client.read(path, position, b, offset, length, tolerateOobAppends <START> ? "*" : eTag, this.authzStatus); <END> this.authzStatus = op.getAuthorizationStatus(); perfInfo.registerResult(op.getResult()).registerSuccess(true); } catch (AzureBlobFileSystemException ex) { if (ex instanceof AbfsRestOperationException) { AbfsRestOperationException ere = (AbfsRestOperationException) ex; if (ere.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { throw new FileNotFoundException(ere.getMessage()); } } throw new IOException(ex); } long bytesRead = op.getResult().getBytesReceived(); if (bytesRead > Integer.MAX_VALUE) { throw new IOException("Unexpected Content-Length"); } return (int) bytesRead; }</code><technical_language>need this</technical_language>

Target:
int readRemote(long position, byte[] b, int offset, int length) throws IOException { if (position < 0) { throw new IllegalArgumentException("attempting to read from negative offset"); } if (position >= contentLength) { return -1; } if (b == null) { throw new IllegalArgumentException("null byte array passed in to read() method"); } if (offset >= b.length) { throw new IllegalArgumentException("offset greater than length of array"); } if (length < 0) { throw new IllegalArgumentException("requested read length is less than zero"); } if (length > (b.length - offset)) { throw new IllegalArgumentException("requested read length is more than will fit after requested offset in buffer"); } final AbfsRestOperation op; AbfsPerfTracker tracker = client.getAbfsPerfTracker(); try (AbfsPerfInfo perfInfo = new AbfsPerfInfo(tracker, "readRemote", "read")) { op = client.read(path, position, b, offset, length, tolerateOobAppends ? "*" : eTag); perfInfo.registerResult(op.getResult()).registerSuccess(true); } catch (AzureBlobFileSystemException ex) { if (ex instanceof AbfsRestOperationException) { AbfsRestOperationException ere = (AbfsRestOperationException) ex; if (ere.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { throw new FileNotFoundException(ere.getMessage()); } } throw new IOException(ex); } long bytesRead = op.getResult().getBytesReceived(); if (bytesRead > Integer.MAX_VALUE) { throw new IOException("Unexpected Content-Length"); } return (int) bytesRead; }
Source:
<code>protected void executeCommand() { if ((_oldStoragePool.getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED) && (getStoragePool().getQuotaEnforcementType() != QuotaEnforcmentTypeEnum.DISABLED)) { QuotaHelper.getInstance().setDefaultQuotaAsRegularQuota(_oldStoragePool); } storage_pool storagePool = getStoragePool(); getStoragePoolDAO().updatePartial(storagePool); updateStoragePoolFormatType(); if (storagePool.getstatus() != StoragePoolStatus.Up) { setSucceeded(true); return; } String spName = storagePool.getname(); Guid spId = storagePool.getId(); <START> VDSBrokerFrontend resourceManager = Backend.getInstance() <END> .getResourceManager(); if (!StringHelper.EqOp(_oldStoragePool.getname(), spName)) { SetStoragePoolDescriptionVDSCommandParameters parameters = new SetStoragePoolDescriptionVDSCommandParameters(spId, spName); resourceManager.RunVdsCommand( VDSCommandType.SetStoragePoolDescription, parameters); } setSucceeded(true); }</code><technical_language>spId resourceManager 'if' statement, move this out? moved this passed params updateStoragePoolFormatType (which them) I understood</technical_language>

Target:
protected void executeCommand() { if ((_oldStoragePool.getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED) && (getStoragePool().getQuotaEnforcementType() != QuotaEnforcmentTypeEnum.DISABLED)) { QuotaHelper.getInstance().setDefaultQuotaAsRegularQuota(_oldStoragePool); } storage_pool storagePool = getStoragePool(); getStoragePoolDAO().updatePartial(storagePool); updateStoragePoolFormatType(); if (storagePool.getstatus() != StoragePoolStatus.Up) { setSucceeded(true); return; } String spName = storagePool.getname(); if (!StringHelper.EqOp(_oldStoragePool.getname(), spName)) { Guid spId = storagePool.getId(); VDSBrokerFrontend resourceManager = Backend.getInstance() .getResourceManager(); SetStoragePoolDescriptionVDSCommandParameters parameters = new SetStoragePoolDescriptionVDSCommandParameters(spId, spName); resourceManager.RunVdsCommand( VDSCommandType.SetStoragePoolDescription, parameters); } setSucceeded(true); }
Source:
<code>private static ArrayList<String> parseJson(Response resp, String languageCodeTo) { ArrayList<String> res = new ArrayList<String>(); List<Tuc> tucs = resp.getTuc(); if (tucs == null) { return res; } for (Tuc tuc : tucs) { if (tuc == null) { continue; } List<Meaning> meanings = tuc.getMeanings(); if (meanings != null) { for (Meaning meaning : meanings) { if (meaning == null) { continue; } if (meaning.getLanguage() == null) { continue; } <START> if (languageCodeTo.contains(meaning.getLanguage())) { <END> String unescappedString = HtmlUtil.unescape(meaning.getText()); res.add(unescappedString); } } } Phrase phrase = tuc.getPhrase(); if (phrase != null) { if (phrase.getLanguageCode() == null) { continue; } if (phrase.getLanguageCode().contentEquals(languageCodeTo)) { String unescappedString = HtmlUtil.unescape(phrase.getText()); res.add(unescappedString); } } } return res; }</code><technical_language>I this fail in a number of cases: - If is a language code "NG" match "ENG", is a language. - Swedish? two-letter language code for is SV three-letter is SWE. If need do this matching, I need a table of ISO 639-1 ISO 639-2 (or ISO 639-3) language code mappings languages. I Locale provide this functionality already</technical_language>

Target:
private static ArrayList<String> parseJson(Response resp, String languageCodeTo) { ArrayList<String> res = new ArrayList<String>(); List<Tuc> tucs = resp.getTuc(); if (tucs == null) { return res; } String desiredLang = LanguagesListerGlosbe .requestToResponseLangCode(languageCodeTo); for (Tuc tuc : tucs) { if (tuc == null) { continue; } List<Meaning> meanings = tuc.getMeanings(); if (meanings != null) { for (Meaning meaning : meanings) { if (meaning == null) { continue; } if (meaning.getLanguage() == null) { continue; } if (meaning.getLanguage().contentEquals(desiredLang)) { String unescappedString = HtmlUtil.unescape(meaning .getText()); res.add(unescappedString); } } } Phrase phrase = tuc.getPhrase(); if (phrase != null) { if (phrase.getLanguage() == null) { continue; } if (phrase.getLanguage().contentEquals(desiredLang)) { String unescappedString = HtmlUtil.unescape(phrase .getText()); res.add(unescappedString); } } } return res; }
Source:
<code>public BuildIndexScheduleTask(RegionCoprocessorEnvironment env) { this.env = env; <START> this.rebuildIndexBatchSize = env.getConfiguration().getLong( <END> QueryServices.INDEX_FAILURE_HANDLING_REBUILD_BATCH_SIZE_ATTRIB, HConstants.LATEST_TIMESTAMP); }</code><technical_language>configuration is confusing similar number of mutations a timestamp. INDEX_FAILURE_HANDLING_REBUILD_PERIOD</technical_language>

Target:
public BuildIndexScheduleTask(RegionCoprocessorEnvironment env) { this.env = env; this.rebuildIndexBatchSize = env.getConfiguration().getLong( QueryServices.INDEX_FAILURE_HANDLING_REBUILD_PERIOD, HConstants.LATEST_TIMESTAMP); this.configuredBatches = env.getConfiguration().getLong( QueryServices.INDEX_FAILURE_HANDLING_REBUILD_NUMBER_OF_BATCHES_PER_TABLE, configuredBatches); }
Source:
<code>private boolean sendGETRequest(String servicePath, HashMap<String, String> params, String loginSecret, SEHTTPResponseHandler handler) { HashMap<String, String> headers = headers(); String url = servicePath; if (!loginSecret.isEmpty()){ headers = loginSecretHeaders(loginSecret); } if (params != null) { url = url.concat(SETools.paramsToString(params)); } <START> Log.v("tag", "url " + url); <END> return SERestClient.get(url, handler, headers); }</code><technical_language>log</technical_language>

Target:
private boolean sendGETRequest(String servicePath, HashMap<String, String> params, String loginSecret, SEHTTPResponseHandler handler) { HashMap<String, String> headers = headers(); String url = servicePath; if (!loginSecret.isEmpty()){ headers = loginSecretHeaders(loginSecret); } if (params != null) { url = url.concat(SETools.paramsToString(params)); } return SERestClient.get(url, handler, headers); }
Source:
<code>private synchronized void refreshPool() { blacklist.checkAndUpdate(cassandra.getPools()); if (config.autoRefreshNodes()) { setServersInPoolTo(cassandra.refreshTokenRangesAndGetServers()); } else { <START> setServersInPoolTo(config.servers().thrift()); <END> } cassandra.debugLogStateOfPool(); }</code><technical_language>another usage kinda awkward, I imagine this is code effect</technical_language>

Target:
private synchronized void refreshPool() { blacklist.checkAndUpdate(cassandra.getPools()); if (config.autoRefreshNodes()) { setServersInPoolTo(cassandra.refreshTokenRangesAndGetServers()); } else { config.servers().visit((thrift, cql) -> { setServersInPoolTo(thrift); return null; }); } cassandra.debugLogStateOfPool(); }
Source:
<code>public static void unzip(File zipFile, File destFolder) throws IOException { ZipInputStream zis = null; try { zis = new ZipInputStream(new FileInputStream(zipFile)); ZipEntry entry = zis.getNextEntry(); if (entry == null) { throw new <START> IOException(MessageFormat.format("File ''{0}'' has no entries", <END> zipFile)); } do { if (!entry.isDirectory()) { final File file = new File(destFolder, entry.getName()); Files.createParentDirs(file); Files.asByteSink(file, FileWriteMode.APPEND).writeFrom(zis); } } while ((entry = zis.getNextEntry()) != null); } finally { Closeables.close(zis, true); } }</code><technical_language>''{0}'' is empty a ZIP file</technical_language>

Target:
public static void unzip(File zipFile, File destFolder) throws IOException { ZipInputStream zis = null; try { zis = new ZipInputStream(new FileInputStream(zipFile)); ZipEntry entry = zis.getNextEntry(); if (entry == null) { throw new IOException(MessageFormat.format("''{0}'' is empty or not a ZIP file.", zipFile)); } do { if (!entry.isDirectory()) { final File file = new File(destFolder, entry.getName()); Files.createParentDirs(file); Files.asByteSink(file, FileWriteMode.APPEND).writeFrom(zis); } } while ((entry = zis.getNextEntry()) != null); } finally { Closeables.close(zis, true); } }
Source:
<code>public Indexed<Comparable> getDimValueLookup(String dimension) { final Column column = input.getColumn(dimension); if (column == null) { return null; } final DictionaryEncodedColumn dict = column.getDictionaryEncoding(); if (dict == null) { return null; } List values = Lists.newArrayList(new Indexed<Comparable>() { @Override public Class<? extends Comparable> getClazz() { return Comparable.class; } @Override public int size() { return dict.getCardinality(); } @Override public Comparable get(int index) { return dict.lookupName(index); } @Override public int indexOf(Comparable value) { return dict.lookupId(value); } @Override public Iterator<Comparable> iterator() { return IndexedIterable.create(this).iterator(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("dict", dict); } }); int count = 0; for (Object val : values) { if (val == null) { count++; } } if (count > 1) { <START> throw new ISE("God save me!!"); <END> } return new Indexed<Comparable>() { @Override public Class<? extends Comparable> getClazz() { return Comparable.class; } @Override public int size() { return dict.getCardinality(); } @Override public Comparable get(int index) { return dict.lookupName(index); } @Override public int indexOf(Comparable value) { return dict.lookupId(value); } @Override public Iterator<Comparable> iterator() { return IndexedIterable.create(this).iterator(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("dict", dict); } }; }</code><technical_language>this means</technical_language>

Target:
public Indexed<Comparable> getDimValueLookup(String dimension) { final Column column = input.getColumn(dimension); if (column == null) { return null; } final DictionaryEncodedColumn dict = column.getDictionaryEncoding(); if (dict == null) { return null; } return new Indexed<Comparable>() { @Override public Class<? extends Comparable> getClazz() { return Comparable.class; } @Override public int size() { return dict.getCardinality(); } @Override public Comparable get(int index) { return dict.lookupName(index); } @Override public int indexOf(Comparable value) { return dict.lookupId(value); } @Override public Iterator<Comparable> iterator() { return IndexedIterable.create(this).iterator(); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("dict", dict); } }; }
Source:
<code>public static void die(Throwable th, boolean usage, String name, Command command) { String errorMsg = th.getClass().getSimpleName(); String errorDetails = th.getMessage(); if (errorDetails != null && !errorDetails.isEmpty()) { errorMsg += ": " + errorDetails; <START> } <END> die(errorMsg, usage, name, command); }</code><technical_language>I th.toString() produces result</technical_language>

Target:
public static void die(Throwable th, boolean usage, String name, Command command) { die(th.toString(), usage, name, command); }
Source:
<code>public void VEMediaTests_003_uploadImageWithCustomFileName() { String testFileUploadName = "TestFile"; String testFullFileName = testFileUploadName + ".png"; ImageLicense testImageLicense = ImageLicense.CCBYSA; base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); VisualEditorPageObject ve = base.openNewArticleEditModeVisual(wikiURL); VisualEditorAddMediaDialog mediaDialog = (VisualEditorAddMediaDialog) ve.openDialogFromMenu(InsertDialog.MEDIA); ve = mediaDialog.uploadImage(PageContent.file2Png, testFileUploadName, testImageLicense); VisualEditorSaveChangesDialog save = ve.clickPublishButton(); ArticlePageObject article = save.savePage(); article.verifyVEPublishComplete(); FilePagePageObject filePage = base.openFilePage(wikiURL, testFullFileName); filePage.verifyImageLicense(testImageLicense); filePage.selectHistoryTab(); filePage.verifyArticleName(URLsContent.fileNameSpace + testFullFileName); DeletePageObject deletePage = filePage.deleteVersion(1); <START> WikiBasePageObject base = deletePage.submitDeletion(); <END> base.logOut(wikiURL); }</code><technical_language>wondering if deleteVersion(1) submitDeletion() method output expected. Please consider verifying if methods give expected results</technical_language>

Target:
public void VEMediaTests_003_uploadImageWithCustomFileName() { String testFileUploadName = "TestFile"; testFullFileName = testFileUploadName + ".png"; testImageLicense = ImageLicense.CCBYSA; base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); VisualEditorPageObject ve = base.openNewArticleEditModeVisual(wikiURL); VisualEditorAddMediaDialog mediaDialog = (VisualEditorAddMediaDialog) ve.openDialogFromMenu(InsertDialog.MEDIA); ve = mediaDialog.uploadImage(PageContent.file2Png, testFileUploadName, testImageLicense); VisualEditorSaveChangesDialog save = ve.clickPublishButton(); ArticlePageObject article = save.savePage(); article.verifyVEPublishComplete(); }
Source:
<code>public void acceptsInstanceMethodReferences() throws Exception { this.validateCheckstyle( <START> "Main.java", true, <END> Matchers.containsString(CheckstyleValidatorTest.NO_VIOLATIONS) ); }</code><technical_language>@prahladyeri true next line</technical_language>

Target:
public void acceptsInstanceMethodReferences() throws Exception { this.validateCheckstyle( "InstanceMethodRef.java", true, Matchers.containsString(CheckstyleValidatorTest.NO_VIOLATIONS) ); }
Source:
<code>private Path getConfigTemplatePath() { URI fileUri; URL fileUrl = getClass() .getResource("/org/eclipse/che/selenium/dashboard/expectedWorkspaceConfTemplate.txt"); try { fileUri = fileUrl.toURI(); } catch (URISyntaxException ex) { <START> LOG.info("Parsed url: has wrong syntax and can't be converted to URI", fileUrl); <END> throw new RuntimeException(ex.getLocalizedMessage(), ex); } return Paths.get(fileUri); }</code><technical_language>"Parsed url: wrong syntax converted URI" is error message, need log if pass a parameter of RuntimeException() constructor</technical_language>

Target:
private Path getConfigTemplatePath() throws URISyntaxException { URL fileUrl = getClass() .getResource("/org/eclipse/che/selenium/dashboard/expectedWorkspaceConfTemplate.txt"); return Paths.get(fileUrl.toURI()); }
Source:
<code>private void maybeShowLocalhostRunningInfo() { <START> maybeTriggerDisplayHandler("bitcoinLocalhostNode", displayLocalhostHandler, localBitcoinNode.isUsable().get()); <END> }</code><technical_language>usage of Optional checking isPresent()</technical_language>

Target:
private void maybeShowLocalhostRunningInfo() { maybeTriggerDisplayHandler("bitcoinLocalhostNode", displayLocalhostHandler, localBitcoinNode.shouldBeUsed()); }
Source:
<code>public synchronized void handleRunningExperiment(String experimentID) { boolean exit = false; BenchFlowExperimentState experimentState; RunningState runningState; try { experimentState = experimentModelDAO.getExperimentState(experimentID); runningState = experimentModelDAO.getRunningState(experimentID); while (!exit) { BenchFlowExperimentState prevExperimentState = experimentState; RunningState prevRunningState = runningState; try { experimentState = handleExperimentState(experimentID); } catch (BenchFlowExperimentIDDoesNotExistException e) { e.printStackTrace(); break; } runningState = experimentModelDAO.getRunningState(experimentID); logger.info("handleRunningExperiment: prevExperimentState == " + prevExperimentState); logger.info("handleRunningExperiment: runningState == " + runningState); if (prevExperimentState == TERMINATED) { exit = true; <START> } <END> else if (runningState == RunningState.HANDLE_TRIAL_RESULT || runningState == RunningState.TERMINATING && prevRunningState == RunningState.HANDLE_TRIAL_RESULT) { exit = true; } } } catch (BenchFlowExperimentIDDoesNotExistException e) { e.printStackTrace(); } }</code><technical_language>experimentState TERMINATED is a leaf state. do in <LINK_0></technical_language>

Target:
public synchronized void handleRunningExperiment(String experimentID) { BenchFlowExperimentState experimentState; BenchFlowExperimentState prevExperimentState; RunningState runningState; RunningState prevRunningState; try { experimentState = experimentModelDAO.getExperimentState(experimentID); runningState = experimentModelDAO.getRunningState(experimentID); logger.info("handleRunningExperiment: experimentState == " + experimentState); logger.info("handleRunningExperiment: runningState == " + runningState); while (true) { prevExperimentState = experimentState; prevRunningState = runningState; try { handleExperimentState(experimentID); } catch (BenchFlowExperimentIDDoesNotExistException e) { e.printStackTrace(); break; } experimentState = experimentModelDAO.getExperimentState(experimentID); runningState = experimentModelDAO.getRunningState(experimentID); logger.info("handleRunningExperiment: (while) experimentState == " + experimentState); logger.info("handleRunningExperiment: (while) runningState == " + runningState); logger.info("handleRunningExperiment: (while) prevRunningState == " + prevRunningState); if (prevExperimentState == TERMINATED) { break; } if (runningState == RunningState.HANDLE_TRIAL_RESULT) { break; } } } catch (BenchFlowExperimentIDDoesNotExistException e) { e.printStackTrace(); } }
Source:
<code>public FormValidation doCheckUpstreamProjectName( @AncestorInPath Job<?,?> project, @QueryParameter String upstreamProjectName ) { upstreamProjectName = StringUtils.trim(upstreamProjectName); if (StringUtils.isBlank(upstreamProjectName)) { return FormValidation.error(Messages.DownstreamBuildSelector_UpstreamProjectName_Required()); } if (containsVariable(upstreamProjectName)) { return FormValidation.ok(); } Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { return FormValidation.ok(); } AbstractProject<?,?> upstreamRoot; if(project != null && project instanceof AbstractProject) { upstreamRoot = ((AbstractProject) project).getRootProject(); } else { <START> upstreamRoot = null; <END> } AbstractProject<?,?> upstreamProject = jenkins.getItem( upstreamProjectName, upstreamRoot, AbstractProject.class ); if (upstreamProject == null || !upstreamProject.hasPermission(Item.READ)) { return FormValidation.error(Messages.DownstreamBuildSelector_UpstreamProjectName_NotFound()); } return FormValidation.ok(); }</code><technical_language>No, want set project. (getRootProject defaults returning this.)</technical_language>

Target:
public FormValidation doCheckUpstreamProjectName( @AncestorInPath Job<?,?> project, @QueryParameter String upstreamProjectName ) { upstreamProjectName = StringUtils.trim(upstreamProjectName); if (StringUtils.isBlank(upstreamProjectName)) { return FormValidation.error(Messages.DownstreamBuildSelector_UpstreamProjectName_Required()); } if (containsVariable(upstreamProjectName)) { return FormValidation.ok(); } Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { return FormValidation.ok(); } if (project == null) { return FormValidation.ok(Messages.CopyArtifact_AncestorIsNull()); } Job<?,?> upstreamRoot = (project instanceof AbstractProject) ? ((AbstractProject<?,?>) project).getRootProject() : project; Job<?,?> upstreamProject = jenkins.getItem( upstreamProjectName, upstreamRoot, Job.class ); if (upstreamProject == null || !upstreamProject.hasPermission(Item.READ)) { return FormValidation.error(Messages.DownstreamBuildSelector_UpstreamProjectName_NotFound()); } return FormValidation.ok(); }
Source:
<code>public void edit(String path, String putAfterString, String toBeInserted) throws IOException { paths.add(path); String currentFile = Util.getFileNameFromPath(path); files.add(currentFile); FileUtils.deleteQuietly(new File(currentFile)); FileUtils.deleteQuietly(new File("."+currentFile+".crc")); FileUtils.deleteQuietly(new File(currentFile+".bck")); FileUtils.deleteQuietly(new File("tmp")); Path file = new Path(path); if(fs.exists(file)){ fs.copyToLocalFile(file, new Path(currentFile)); FileUtils.copyFile(new File(currentFile), new File(currentFile + ".bck")); BufferedWriter bufwriter = new BufferedWriter(new FileWriter ("tmp")); BufferedReader br = new BufferedReader(new FileReader(currentFile)); String line ; boolean isInserted = false ; while( (line = br.readLine()) != null) { bufwriter.write(line); bufwriter.write('\n'); if(line.contains(putAfterString) && !isInserted) { bufwriter.write(toBeInserted); isInserted = true ; } } br.close(); bufwriter.close(); FileUtils.deleteQuietly(new File(currentFile)); FileUtils.copyFile(new File("tmp"), new File(currentFile)); FileUtils.deleteQuietly(new File("tmp")); fs.delete(file,false); File crcFile = new File("."+currentFile+".crc"); if(crcFile.exists()) crcFile.delete(); fs.copyFromLocalFile(new Path(currentFile),file); } else { <START> System.out.println("Nothing to do, " + currentFile + " does not exists"); <END> } }</code><technical_language>Please logger instead of system out</technical_language>

Target:
public void edit(String path, String putAfterString, String toBeInserted) throws IOException { paths.add(path); String currentFile = Util.getFileNameFromPath(path); files.add(currentFile); FileUtils.deleteQuietly(new File(currentFile)); FileUtils.deleteQuietly(new File("."+currentFile+".crc")); FileUtils.deleteQuietly(new File(currentFile+".bck")); FileUtils.deleteQuietly(new File("tmp")); Path file = new Path(path); if(fs.exists(file)){ fs.copyToLocalFile(file, new Path(currentFile)); FileUtils.copyFile(new File(currentFile), new File(currentFile + ".bck")); BufferedWriter bufwriter = new BufferedWriter(new FileWriter ("tmp")); BufferedReader br = new BufferedReader(new FileReader(currentFile)); String line ; boolean isInserted = false ; while( (line = br.readLine()) != null) { bufwriter.write(line); bufwriter.write('\n'); if(line.contains(putAfterString) && !isInserted) { bufwriter.write(toBeInserted); isInserted = true ; } } br.close(); bufwriter.close(); FileUtils.deleteQuietly(new File(currentFile)); FileUtils.copyFile(new File("tmp"), new File(currentFile)); FileUtils.deleteQuietly(new File("tmp")); fs.delete(file,false); File crcFile = new File("."+currentFile+".crc"); if(crcFile.exists()) crcFile.delete(); fs.copyFromLocalFile(new Path(currentFile),file); } else { logger.info("Nothing to do, " + currentFile + " does not exists"); } }
Source:
<code>public Single<List<Optional<java.io.File>>> downloadAllFilesInDriveFolder(@NonNull final RemoteBackupMetadata remoteBackupMetadata, @NonNull final java.io.File downloadLocation) { Preconditions.checkNotNull(remoteBackupMetadata); Preconditions.checkNotNull(downloadLocation); return mDriveStreamsManager.getFilesInFolder(remoteBackupMetadata.getId().getId()) .flatMap(fileList -> { List<Optional<java.io.File>> javaFileList = new ArrayList<>(); for (File file : fileList.getFiles()) { String filename = file.getId() + "__" + file.getOriginalFilename(); <START> Optional<java.io.File> single = mDriveStreamsManager.download(file.getId(), new java.io.File(downloadLocation, filename)).blockingGet(); <END> if (single.isPresent()) { javaFileList.add(Optional.of(single.get())); } } return Single.just(javaFileList); }); }</code><technical_language>name this file optionalFile instead of single (to separate Rx Single)</technical_language>

Target:
public Single<List<java.io.File>> downloadAllFilesInDriveFolder(@NonNull final RemoteBackupMetadata remoteBackupMetadata, @NonNull final java.io.File downloadLocation) { Preconditions.checkNotNull(remoteBackupMetadata); Preconditions.checkNotNull(downloadLocation); return mDriveStreamsManager.getFilesInFolder(remoteBackupMetadata.getId().getId()) .flatMap(fileList -> { List<java.io.File> javaFileList = new ArrayList<>(); for (File file : fileList.getFiles()) { String filename = file.getId() + "__" + file.getOriginalFilename(); Optional<java.io.File> optional = mDriveStreamsManager.download(file.getId(), new java.io.File(downloadLocation, filename)).blockingGet(); if (optional.isPresent()) { javaFileList.add(optional.get()); } } return Single.just(javaFileList); }); }
Source:
<code>public void execute(IProgressMonitor m) throws CoreException { if (pullResult != null) throw new CoreException(new Status(IStatus.ERROR, Activator .getPluginId(), CoreText.OperationAlreadyExecuted)); IProgressMonitor monitor; if (m == null) monitor = new NullProgressMonitor(); else monitor = m; IWorkspaceRunnable action = new IWorkspaceRunnable() { public void run(IProgressMonitor mymonitor) throws CoreException { PullCommand pull = new Git(repository).pull(); try { pull.setProgressMonitor(new EclipseGitProgressTransformer( mymonitor)); pull.setTimeout(timeout); pullResult = pull.call(); } catch (GitAPIException e) { throw new CoreException(Activator.error(e.getMessage(), e)); <START> } catch (JGitInternalException e) { <END> Throwable cause = e.getCause() != null ? e.getCause() : e; throw new CoreException(Activator.error(cause.getMessage(), cause)); } } }; ResourcesPlugin.getWorkspace().run(action, monitor); }</code><technical_language>1) getCause return null? 2) drop exeption message cause' message</technical_language>

Target:
public void execute(IProgressMonitor m) throws CoreException { if (pullResult != null) throw new CoreException(new Status(IStatus.ERROR, Activator .getPluginId(), CoreText.OperationAlreadyExecuted)); IProgressMonitor monitor; if (m == null) monitor = new NullProgressMonitor(); else monitor = m; IWorkspaceRunnable action = new IWorkspaceRunnable() { public void run(IProgressMonitor mymonitor) throws CoreException { PullCommand pull = new Git(repository).pull(); try { pull.setProgressMonitor(new EclipseGitProgressTransformer( mymonitor)); pull.setTimeout(timeout); pullResult = pull.call(); } catch (GitAPIException e) { throw new CoreException(Activator.error(e.getMessage(), e)); } catch (JGitInternalException e) { throw new CoreException(Activator.error(e.getMessage(), e)); } } }; ResourcesPlugin.getWorkspace().run(action, monitor); }
Source:
<code>public JavaParameters buildMavenServerParameters() { JavaParameters parameters = new JavaParameters(); parameters.setJavaExecutable(System.getProperties().getProperty("java.home") + "/bin/java"); parameters.setWorkingDirectory(System.getProperty("java.io.tmpdir")); parameters.setMainClassName(MAVEN_SERVER_MAIN); List<String> classPath = new ArrayList<>(); addDirToClasspath(classPath, new File(mavenServerPath)); String mavenHome = System.getenv("M2_HOME"); addDirToClasspath(classPath, new File(mavenHome, "lib")); File bootDir = new File(mavenHome, "boot"); File[] classworlds = bootDir.listFiles((dir, name) -> name.contains("classworlds")); if (classworlds != null) { for (File file : classworlds) { classPath.add(file.getAbsolutePath()); } } parameters.getClassPath().addAll(classPath); String vmArguments = MoreObjects.firstNonNull( <START> System.getenv("CHE_WORKSPACE_MAVEN_SERVER_JAVA_OPTIONS"), <END> MoreObjects.firstNonNull( System.getenv("CHE_WORKSPACE_MAVEN_SERVER_JAVA_OPTIONS_DEFAULT"), "-Xmx128m")); Arrays.stream(vmArguments.split(" ")) .map(String::trim) .filter(v -> !v.isEmpty()) .forEach(parameters.getVmParameters()::add); return parameters; }</code><technical_language>I injecting values DI container preferable. I understand unbound if env vars set, overcome this optional injection in Guice</technical_language>

Target:
public JavaParameters buildMavenServerParameters() { JavaParameters parameters = new JavaParameters(); parameters.setJavaExecutable(System.getProperties().getProperty("java.home") + "/bin/java"); parameters.setWorkingDirectory(System.getProperty("java.io.tmpdir")); parameters.setMainClassName(MAVEN_SERVER_MAIN); List<String> classPath = new ArrayList<>(); addDirToClasspath(classPath, new File(mavenServerPath)); String mavenHome = System.getenv("M2_HOME"); addDirToClasspath(classPath, new File(mavenHome, "lib")); File bootDir = new File(mavenHome, "boot"); File[] classworlds = bootDir.listFiles((dir, name) -> name.contains("classworlds")); if (classworlds != null) { for (File file : classworlds) { classPath.add(file.getAbsolutePath()); } } parameters.getClassPath().addAll(classPath); parameters.getVmParameters().addAll(mavenServerJavaOptionsList); return parameters; }
Source:
<code>private static Model getDefaultAcl() { final String rootAcl = System.getProperty(ROOT_ACL_PROPERTY); if (rootAcl != null && new File(rootAcl).isFile()) { LOGGER.debug("Getting Root ACL from file: {}", rootAcl); return RDFDataMgr.loadModel(rootAcl); } else { LOGGER.debug("Getting Root ACL from classpath: {}", ROOT_ACL_LOCATION); final Model model = createDefaultModel(); <START> final InputStream is = WebACRolesProvider.class.getResourceAsStream(ROOT_ACL_LOCATION); <END> RDFDataMgr.read(model, is, Lang.TTL); return model; } }</code><technical_language>try-with-resource</technical_language>

Target:
private static Model getDefaultAcl() { final String rootAcl = System.getProperty(ROOT_AUTHORIZATION_PROPERTY); final Model model = createDefaultModel(); if (rootAcl != null && new File(rootAcl).isFile()) { try { LOGGER.debug("Getting root authorization from file: {}", rootAcl); return model.read(rootAcl); } catch (final JenaException ex) { LOGGER.error("Error parsing root authorization file: {}", ex.getMessage()); } } try (final InputStream is = WebACRolesProvider.class.getResourceAsStream(ROOT_AUTHORIZATION_LOCATION)) { LOGGER.debug("Getting root authorization from classpath: {}", ROOT_AUTHORIZATION_LOCATION); return model.read(is, null, TTL.getName()); } catch (final IOException ex) { LOGGER.error("Error reading root authorization file: {}", ex.getMessage()); } catch (final JenaException ex) { LOGGER.error("Error parsing root authorization file: {}", ex.getMessage()); } return createDefaultModel(); }
Source:
<code>public void likePost(Long postId, String likerUsername) { Post post = postRepository.findOne(postId); if (post == null) { throw new PostNotFoundException(postId); } User user = userService.findUserByUsername(likerUsername).get(); if (post.isNotAlreadyLikedBy(likerUsername)) { post.addLike(user); postRepository.save(post); PostNotificationEvent event = new PostNotificationEvent(post, user, likerUsername); <START> domainEvents.raise(event); <END> } }</code><technical_language>i need i this diff :angel:</technical_language>

Target:
public void likePost(Long postId, String likerUsername) { Post post = postRepository.findOne(postId); if (post == null) { throw new PostNotFoundException(postId); } User user = userService.findUserByUsername(likerUsername).get(); if (post.isNotAlreadyLikedBy(likerUsername)) { post.addLike(user); postRepository.save(post); LikePostEvent likePostEvent = new LikePostEvent(post, likerUsername); domainEvents.raise(likePostEvent); } }
Source:
<code>public void init() throws Exception { <START> context = new AutomationContext("AS", "appServerInstance0002", ContextXpathConstants.SUPER_TENANT, <END> ContextXpathConstants.ADMIN); authenticatorClient = new AuthenticatorClient(context.getContextUrls().getBackEndUrl()); AutomationContext context = new AutomationContext(); h2DBURL = context.getConfigurationValue(String.format(ASIntegrationConstants.DB_URL, "H2DB")); }</code><technical_language>constants for Product group name instance names</technical_language>

Target:
public void init() throws XPathExpressionException, AxisFault { automationContext = new AutomationContext(ASIntegrationConstants.AS_PRODUCT_GROUP, ASIntegrationConstants.AS_INSTANCE_0002, ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.SUPER_ADMIN); authenticatorClient = new AuthenticatorClient(automationContext.getContextUrls().getBackEndUrl()); dataSourceBean = CarbonCommandToolsUtil.getDataSourceInformation("default"); }
Source:
<code>public void testVpnMeterednessWithNonNullUnderlyingNetwork() throws Exception { if (!supportedHardware()) { return; } <START> Network wifi = <END> ensureWifiConnected(); assertEquals(wifi, mCM.getActiveNetwork()); ArrayList<Network> underlyingNetworks = new ArrayList<>(1); underlyingNetworks.add(wifi); String allowedApps = mPackageName; startVpn( new String[] {"192.0.2.2/32", "2001:db8:1:2::ffe/128"}, new String[] {"0.0.0.0/0", "::/0"}, allowedApps, "", null, underlyingNetworks, false); assertEquals(mNetwork, mCM.getActiveNetwork()); ensureVpnTransportContains(NetworkCapabilities.TRANSPORT_WIFI); assertEquals(isNetworkMetered(wifi), isNetworkMetered(mNetwork)); assertEquals(isNetworkMetered(mNetwork), mCM.isActiveNetworkMetered()); }</code><technical_language>Nit: define final</technical_language>

Target:
public void testVpnMeterednessWithNonNullUnderlyingNetwork() throws Exception { if (!supportedHardware()) { return; } Network wifi = getWifiNetwork(); assertEquals(wifi, mCM.getActiveNetwork()); ArrayList<Network> underlyingNetworks = new ArrayList<>(1); underlyingNetworks.add(wifi); String allowedApps = mPackageName; startVpn( new String[] {"192.0.2.2/32", "2001:db8:1:2::ffe/128"}, new String[] {"0.0.0.0/0", "::/0"}, allowedApps, "", null, underlyingNetworks, false ); assertEquals(mNetwork, mCM.getActiveNetwork()); ensureVpnTransportContains(NetworkCapabilities.TRANSPORT_WIFI); assertEquals(isNetworkMetered(wifi), isNetworkMetered(mNetwork)); assertEquals(isNetworkMetered(mNetwork), mCM.isActiveNetworkMetered()); }
Source:
<code>static LogoutResponse from(Response response) { <START> if (response.code() == 204 ) { <END> return new LogoutResponse(); } try { String serverResponse = response.body().string(); return new LogoutResponse(AuthServerResponse.createError(serverResponse, response.code())); } catch (IOException e) { ObjectServerError error = new ObjectServerError(ErrorCode.IO_EXCEPTION, e); return new LogoutResponse(error); } }</code><technical_language>response.isSuccessful() instead</technical_language>

Target:
static LogoutResponse from(Response response) { if (response.isSuccessful()) { return new LogoutResponse(); } try { String serverResponse = response.body().string(); return new LogoutResponse(AuthServerResponse.createError(serverResponse, response.code())); } catch (IOException e) { ObjectServerError error = new ObjectServerError(ErrorCode.IO_EXCEPTION, e); return new LogoutResponse(error); } }