auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private CosmosClientException extractCosmosClientExceptionIfAny(Throwable t) { if (t == null) { return null; } if (t instanceof CosmosClientException) { return (CosmosClientException) t; } <START> return extractCosmosClientExceptionIfAny(t.getCause()); <END> }</code><technical_language>Recursion avoided of obvious reasons. I this easily converted a while loop</technical_language>

Target:
private CosmosClientException extractCosmosClientExceptionIfAny(Throwable t) { if (t == null) { return null; } while(!(t instanceof CosmosClientException)) { t = t.getCause(); } return (CosmosClientException) t; }
Source:
<code>public void testUpdatePreserveOwner() throws Exception { <START> ShareableMetacardPreIngestPlugin wpip = makePlugin(ImmutableMap.of()); <END> ShareableMetacardImpl prev = new ShareableMetacardImpl("id"); ShareableMetacardImpl next = ShareableMetacardImpl.clone(prev); prev.setOwner("prev"); assertThat(next.getOwner(), nullValue()); wpip.process(updateRequest(prev, next)); assertThat(next.getOwner(), is(prev.getOwner())); }</code><technical_language>is "id" Core.ID</technical_language>

Target:
public void testUpdatePreserveOwner() throws Exception { ShareableMetacardPreIngestPlugin plugin = makePlugin(); ShareableMetacardImpl prev = new ShareableMetacardImpl("id"); ShareableMetacardImpl next = ShareableMetacardImpl.clone(prev); prev.setTags(Collections.singleton(WorkspaceAttributes.WORKSPACE_TAG)); next.setTags(Collections.singleton(WorkspaceAttributes.WORKSPACE_TAG)); prev.setOwner("prev"); assertThat(next.getOwner(), nullValue()); plugin.process(updateRequest(prev, next)); assertThat(next.getOwner(), is(prev.getOwner())); }
Source:
<code>public void testWithChannel_duplicates() { ThingBuilder thingBuilder = ThingBuilder.create(THING_TYPE_UID, THING_UID); <START> thingBuilder.withChannel(new Channel(new ChannelUID(THING_UID, "channel1"), "")); <END> thingBuilder.withChannel(new Channel(new ChannelUID(THING_UID, "channel1"), "")); }</code><technical_language>In light of #5009: change ChannelBuilder</technical_language>

Target:
public void testWithChannel_duplicates() { ThingBuilder thingBuilder = ThingBuilder.create(THING_TYPE_UID, THING_UID); thingBuilder.withChannel(ChannelBuilder.create(new ChannelUID(THING_UID, "channel1"), "").build()); thingBuilder.withChannel(ChannelBuilder.create(new ChannelUID(THING_UID, "channel1"), "").build()); }
Source:
<code>private boolean isValidProcessProperty() { if (this.processProperty.isValid()) { return true; } else { List<String> param = new ArrayList<String>(); param.add(processProperty.getName()); <START> String value = Helper.getTranslation("propertyNotValid", param); <END> Helper.setFehlerMeldung(value); Helper.setFehlerMeldung("Property " + this.processProperty.getName() + " is not valid"); return false; } }</code><technical_language>String = Helper.getTranslation("propertyNotValid", Arrays.asList(new String[]{ processProperty.getName() }));</technical_language>

Target:
private boolean isValidProcessProperty() { if (this.processProperty.isValid()) { return true; } else { String value = Helper.getTranslation("propertyNotValid", Arrays.asList(new String[] {processProperty.getName() })); Helper.setFehlerMeldung(value); Helper.setFehlerMeldung("Property " + this.processProperty.getName() + " is not valid"); return false; } }
Source:
<code>@Override public UnderFileSystem create(String path, UnderFileSystemConfiguration conf) { <START> Preconditions.checkNotNull(path, "path is null"); <END> if (checkB2Credentials(conf)) { try { return B2UnderFileSystem.createInstance(new AlluxioURI(path), conf); } catch (ServiceException e) { throw new RuntimeException(e); } } String err = "B2 Credentials not available, cannot create B2 Under File System."; throw new RuntimeException(new IOException(err)); }</code><technical_language>Please remove this empty line</technical_language>

Target:
public UnderFileSystem create(String path, UnderFileSystemConfiguration conf) { Preconditions.checkNotNull(path, "path is null"); checkB2Credentials(conf); try { return B2UnderFileSystem.createInstance(new AlluxioURI(path), conf); } catch (ServiceException e) { throw new RuntimeException(e); } }
Source:
<code>public void testGetSecret() throws IOException { respondWith(SECRET_JSON); Secret secret = osv3().barbican().secrets().get(secretId); assertNotNull(secret); assertNotNull(secret.getName()); <START> assertEquals(secret.getExpiration().toString(), expiration); <END> assertTrue(!secret.getContentTypes().isEmpty()); assertEquals(secret.getContentTypes().get("default"), content_type); }</code><technical_language>Compare assertEquals(secret.getExpiration(), expiration); expiration is a Date object</technical_language>

Target:
public void testGetSecret() throws IOException { respondWith(SECRET_JSON); Secret secret = osv3().barbican().secrets().get(secretId); assertNotNull(secret); assertNotNull(secret.getName()); assertEquals(secret.getExpiration(), expiration); assertTrue(!secret.getContentTypes().isEmpty()); assertEquals(secret.getContentTypes().get("default"), content_type); }
Source:
<code><START> public ComparableJsonNode(JsonNode delegate) { <END> this.delegate = delegate; }</code><technical_language>do wrap unconditionally, is isValueNode() in other place</technical_language>

Target:
ComparableJsonNode(JsonNode delegate) { this.delegate = delegate; }
Source:
<code>public byte[] toBytes() { byte[] offsetBytes = offset != null ? offset.toBytes() : ZERO_LENGTH_ARRAY; byte[] sessionIdBytes = sessionId != null ? sessionId.toString().getBytes() : ZERO_LENGTH_ARRAY; byte[] incarnationIdBytes = incarnationId != null ? incarnationId.toString().getBytes() : ZERO_LENGTH_ARRAY; byte[] storeKeyBytes = storeKey != null ? storeKey.toBytes() : ZERO_LENGTH_ARRAY; int size = VERSION_SIZE + TYPE_SIZE + INCARNATION_ID_LENGTH_SIZE + incarnationIdBytes.length + SESSION_ID_LENGTH_SIZE + sessionIdBytes.length + offsetBytes.length + storeKeyBytes.length <START> + INCLUSIVE_BYTE_SIZE; <END> byte[] buf = new byte[size]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort(VERSION_2); bufWrap.putShort((short) type.ordinal()); bufWrap.putInt(incarnationIdBytes.length); bufWrap.put(incarnationIdBytes); bufWrap.putInt(sessionIdBytes.length); bufWrap.put(sessionIdBytes); bufWrap.put(offsetBytes); bufWrap.put(storeKeyBytes); bufWrap.put(getInclusive() ? (byte) 1 : (byte) 0); return buf; }</code><technical_language>add this if is required</technical_language>

Target:
public byte[] toBytes() { byte[] offsetBytes = offset != null ? offset.toBytes() : ZERO_LENGTH_ARRAY; byte[] sessionIdBytes = sessionId != null ? sessionId.toString().getBytes() : ZERO_LENGTH_ARRAY; byte[] incarnationIdBytes = incarnationId != null ? incarnationId.toString().getBytes() : ZERO_LENGTH_ARRAY; byte[] storeKeyBytes = storeKey != null ? storeKey.toBytes() : ZERO_LENGTH_ARRAY; int size = VERSION_SIZE + TYPE_SIZE; if (type != Type.Uninitialized) { size += INCARNATION_ID_LENGTH_SIZE + incarnationIdBytes.length + SESSION_ID_LENGTH_SIZE + sessionIdBytes.length + offsetBytes.length; if (type == Type.JournalBased) { size += INCLUSIVE_BYTE_SIZE; } else if (type == Type.IndexBased) { size += storeKeyBytes.length; } } byte[] buf = new byte[size]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort(VERSION_2); bufWrap.putShort((short) type.ordinal()); if (type != Type.Uninitialized) { bufWrap.putInt(incarnationIdBytes.length); bufWrap.put(incarnationIdBytes); bufWrap.putInt(sessionIdBytes.length); bufWrap.put(sessionIdBytes); bufWrap.put(offsetBytes); if (type == Type.JournalBased) { bufWrap.put(getInclusive() ? (byte) 1 : (byte) 0); } else if (type == Type.IndexBased) { bufWrap.put(storeKeyBytes); } } return buf; }
Source:
<code>public String getPeerUserAgent() { Set<String> clientCapabilities = currentRequest == null ? null : currentRequest.getClientCapabilities(); if (currentRequest == null) { return userAgent; } <START> return UserAgent.getAgent(clientCapabilities, userAgent); <END> }</code><technical_language>This means inline clientCapabilities: return UserAgent.getAgent(currentRequest.getClientCapabilities(), userAgent);</technical_language>

Target:
public String getPeerUserAgent() { if (currentRequest == null) { return userAgent; } return UserAgent.getAgent(currentRequest.getClientCapabilities(), userAgent); }
Source:
<code><START> public UUID traceRequestCreate(@Nonnull TraceRequest traceRequest) <END> throws StateAccessException, SerializationException { if (traceRequest.getId() == null) { traceRequest.setId(UUID.randomUUID()); } switch (traceRequest.getDeviceType()) { case ROUTER: if (routersGet(traceRequest.getDeviceId()) == null) { throw new StateAccessException( "Router " + traceRequest.getDeviceId() + " does not exist"); } break; case BRIDGE: if (bridgesGet(traceRequest.getDeviceId()) == null) { throw new StateAccessException( "Bridge " + traceRequest.getDeviceId() + " does not exist"); } break; case PORT: if (portsGet(traceRequest.getDeviceId()) == null) { throw new StateAccessException( "Port " + traceRequest.getDeviceId() + " does not exist"); } } UUID id = traceRequest.getId(); TraceRequestZkManager.TraceRequestConfig config = Converter.toTraceRequestConfig(traceRequest); zkManager.multi(traceReqZkManager.prepareCreate(id, config)); return id; }</code><technical_language>referential integrity, I checks (the device deleted right executed). Also, deleting a device leak trace requests exist for device. implement backreferences devices trace request - ZOOM supports this</technical_language>

Target:
public UUID traceRequestCreate(@Nonnull TraceRequest traceRequest) throws StateAccessException, SerializationException { if (traceRequest.getId() == null) { traceRequest.setId(UUID.randomUUID()); } if (!checkTraceRequestDeviceExists(traceRequest)) { throw new StateAccessException( "Device " + traceRequest.getDeviceId() + " of type " + traceRequest.getDeviceType() + " does not exist"); } UUID id = traceRequest.getId(); TraceRequestZkManager.TraceRequestConfig config = Converter.toTraceRequestConfig(traceRequest); zkManager.multi(traceReqZkManager.prepareCreate(id, config)); if (!checkTraceRequestDeviceExists(traceRequest)) { traceRequestDelete(traceRequest.getId()); throw new StateAccessException( "Device " + traceRequest.getDeviceId() + " deleted"); } return id; }
Source:
<code>public void logoutWipe() { List<Survey> surveys = Survey.getAllSurveys(); for (Survey survey : surveys) { survey.delete(); } <START> ICredentialsRepository credentialsLocalDataSource = new CredentialsLocalDataSource(); <END> credentialsLocalDataSource.saveOrganisationCredentials(null); }</code><technical_language>@manuelplazaspalacio this class is for wipe db, move clean ereferrals credentials AuthenticationLocalDataSourceStrategy normal credentials for more readable code? instead of save null credentials if create a clearCredentials method in AuthenticationLocalDataSource for more readable code</technical_language>

Target:
public void logoutWipe() { List<Survey> surveys = Survey.getAllSurveys(); for (Survey survey : surveys) { survey.delete(); } }
Source:
<code>private String token(final String home, final String code) throws IOException { <START> final String uri = new Href( <END> String.format( "%s/login/oauth/access_token", this.getUrl("<LINK_0>") ) ).with("client_id", this.app) .with("redirect_uri", home) .with("client_secret", this.key) .with("code", code) .toString(); return new JdkRequest(uri) .method("POST") .header("Accept", "application/xml") .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml().xpath("/OAuth/access_token/text()").get(0); }</code><technical_language>@dmzaytsev here, I this design. do originally suggested in #42</technical_language>

Target:
private String token(final String home, final String code) throws IOException { final String uri = new Href(this.github) .path("login/oauth/access_token") .toString(); return new JdkRequest(uri) .method("POST") .header("Accept", "application/xml") .body() .formParam("client_id", this.app) .formParam("redirect_uri", home) .formParam("client_secret", this.key) .formParam("code", code) .back() .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml().xpath("/OAuth/access_token/text()").get(0); }
Source:
<code>static Stream<String> moduleDirectoryNames() throws IOException { String startOfModuleLine = "include '"; <START> return Files.readAllLines(Paths.get("../settings.gradle")).stream() <END> .filter(line -> line.startsWith(startOfModuleLine)) .map(line -> line.substring(startOfModuleLine.length(), line.length() - 1)) .filter(name -> !name.equals("junit-platform-console-standalone")) .filter(name -> name.startsWith("junit-")); }</code><technical_language>I this line shortened return Files.walk(Paths.get("../settings.gradle"), 1), other advantage of reading entire file memory once</technical_language>

Target:
static Stream<String> moduleDirectoryNames() throws IOException { String startOfModuleLine = "include '"; return Files.lines(Paths.get("../settings.gradle")) .filter(line -> line.startsWith(startOfModuleLine)) .map(line -> line.substring(startOfModuleLine.length(), line.length() - 1)) .filter(name -> !name.equals("junit-platform-console-standalone")) .filter(name -> name.startsWith("junit-")); }
Source:
<code>public long getTLSCertFilesRefreshDurationSeconds() { <START> return getLong(TLS_CERT_FILES_REFRESH_DURATION_SECONDS, 300); <END> }</code><technical_language>disabled default</technical_language>

Target:
public long getTLSCertFilesRefreshDurationSeconds() { return getLong(TLS_CERT_FILES_REFRESH_DURATION_SECONDS, 0); }
Source:
<code>public void testControlBulkOperationsEnabled() { ListTable extendedPagedTable = mock(ListTable.class); HasWidgets rightActionsToolbar = mock(HasWidgets.class); boolean enabled = false; <START> final Button mockButton = GWT.create(Button.class); <END> ArrayList a = new ArrayList(); a.add(mockButton); when(rightActionsToolbar.spliterator()) .thenReturn(Spliterators.spliteratorUnknownSize(a.iterator(), 0)); when(extendedPagedTable.getRightActionsToolbar()).thenReturn(rightActionsToolbar); when(extendedPagedTable.hasSelectedItems()).thenReturn(enabled); getView().controlBulkOperations(extendedPagedTable); verify(mockButton).setEnabled(enabled); }</code><technical_language>mock instead of GWT.create</technical_language>

Target:
public void testControlBulkOperationsEnabled() { when(extendedPagedTable.hasSelectedItems()).thenReturn(true); getView().controlBulkOperations(extendedPagedTable); verify(mockButton).setEnabled(true); }
Source:
<code>private void fixCompositeInputNaming(JsonObject graph, List<List<JsonObject>> startsEndsAndOperators, JsonObject opDefinition) { <START> for(int i = 0; i < startsEndsAndOperators.get(0).size(); i++){ <END> JsonObject start = startsEndsAndOperators.get(0).get(i); if(start.has("config") && (hasAny(object(start, "config"), compOperatorStarts))) continue; String outputPortName = GsonUtilities.jstring(start.get("outputs").getAsJsonArray().get(0).getAsJsonObject(), "name"); for(JsonObject downstream : GraphUtilities.getDownstream(start, graph)){ JsonArray inputs = array(downstream, "inputs"); for(JsonElement inputObj : inputs){ JsonObject input = inputObj.getAsJsonObject(); JsonArray connections = array(input, "connections"); for(int j = 0; j < connections.size(); j++){ if(connections.get(j).getAsString().equals(outputPortName)){ connections.set(j, GsonUtilities.array(opDefinition, "inputNames").get(j)); } } } } } }</code><technical_language>Kind of confusing style loops consistent</technical_language>

Target:
private void fixCompositeInputNaming(JsonObject graph, List<List<JsonObject>> startsEndsAndOperators, JsonObject opDefinition) { for(int i = 0; i < startsEndsAndOperators.get(0).size(); i++){ JsonObject start = startsEndsAndOperators.get(0).get(i); if(start.has("config") && (hasAny(object(start, "config"), compOperatorStarts))) continue; String outputPortName = GsonUtilities.jstring(start.get("outputs").getAsJsonArray().get(0).getAsJsonObject(), "name"); for(JsonObject downstream : GraphUtilities.getDownstream(start, graph)){ JsonArray inputs = array(downstream, "inputs"); for(JsonElement inputObj : inputs){ JsonObject input = inputObj.getAsJsonObject(); JsonArray connections = array(input, "connections"); for(int j = 0; j < connections.size(); j++){ if(connections.get(j).getAsString().equals(outputPortName)){ connections.set(j, GsonUtilities.array(opDefinition, "inputNames").get(i)); } } } } } }
Source:
<code>public Binder<BindJpa, Object> build(BindJpa annotation) { return (q, parameter, bind, arg) -> { final String prefix; if (BindJpa.DEFAULT.equals(bind.value())) { prefix = ""; } else { prefix = bind.value() + "."; } try { JpaClass<?> jpaClass = JpaClass.get(arg.getClass()); for (JpaMember member : jpaClass.members()) { q.dynamicBind(member.getType(), prefix + member.getColumnName(), member.read(arg)); } } catch (Exception e) { <START> throw new IllegalStateException( <END> "unable to bind bean properties", e); } }; }</code><technical_language>this wrap subclasses of RuntimeException? end wrapping e.g. DbiException friends</technical_language>

Target:
public Binder<BindJpa, Object> build(BindJpa annotation) { return (q, parameter, bind, arg) -> { final String prefix; if (BindJpa.DEFAULT.equals(bind.value())) { prefix = ""; } else { prefix = bind.value() + "."; } JpaClass<?> jpaClass = JpaClass.get(arg.getClass()); for (JpaMember member : jpaClass.members()) { q.dynamicBind(member.getType(), prefix + member.getColumnName(), readMember(arg, member)); } }; }
Source:
<code>protected void configure() { bind(BlobStore.class).to(LocalBlobStore.class); install(new BlobStoreObjectModule()); <START> if (System.getProperty("os.name", "").toLowerCase().contains("windows")) <END> bind(ConsistencyModel.class).toInstance(ConsistencyModel.EVENTUAL); else bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT); bind(LocalStorageStrategy.class).to(FilesystemStorageStrategyImpl.class); bind(BlobUtils.class).to(FileSystemBlobUtilsImpl.class); bind(FilesystemBlobKeyValidator.class).to(FilesystemBlobKeyValidatorImpl.class); bind(FilesystemContainerNameValidator.class).to(FilesystemContainerNameValidatorImpl.class); bind(BlobRequestSigner.class).to(LocalBlobRequestSigner.class); }</code><technical_language>[filesystem's TestUtils](<LINK_0> Or, still, move method [core TestUtils class](<LINK_1></technical_language>

Target:
protected void configure() { bind(BlobStore.class).to(LocalBlobStore.class); install(new BlobStoreObjectModule()); if (isWindows()) { bind(ConsistencyModel.class).toInstance(ConsistencyModel.EVENTUAL); } else { bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT); } bind(LocalStorageStrategy.class).to(FilesystemStorageStrategyImpl.class); bind(BlobUtils.class).to(FileSystemBlobUtilsImpl.class); bind(FilesystemBlobKeyValidator.class).to(FilesystemBlobKeyValidatorImpl.class); bind(FilesystemContainerNameValidator.class).to(FilesystemContainerNameValidatorImpl.class); bind(BlobRequestSigner.class).to(LocalBlobRequestSigner.class); }
Source:
<code>public void trace(String format, Object arg) { if (isTraceEnabled()) { <START> log(TRACE_INT, org.slf4j.helpers.MessageFormatter.format(format, arg).getMessage(), arg); <END> } }</code><technical_language>need pass args now? If pass null for arg avoid varargs array allocation</technical_language>

Target:
public void trace(String format, Object arg) { if (isTraceEnabled()) { log(TRACE_INT, org.slf4j.helpers.MessageFormatter.format(format, arg)); } }
Source:
<code>private void showMultiListPageConfirmToggleDialog(@NonNull final ReadingListPage page) { if <START> (getContext() <END> == null) { return; } AlertDialog dialog = new AlertDialog.Builder(getContext()) .setTitle(R.string.reading_list_confirm_remove_article_from_offline_title) .setMessage(getConfirmToggleOfflineMessage(page)) .setPositiveButton(R.string.reading_list_confirm_remove_article_from_offline, new ConfirmRemoveFromOfflineListener(page)) .setNegativeButton(android.R.string.cancel, null) .create(); dialog.show(); TextView text = (TextView) dialog.findViewById(android.R.id.message); text.setLineSpacing(0, 1.3f); }</code><technical_language>This method indirectly require getActivity() != null ConfirmRemoveFromOfflineListener.onClick() calling toggleOffline()</technical_language>

Target:
private void showMultiListPageConfirmToggleDialog(@NonNull final ReadingListPage page) { if (getActivity() == null) { return; } AlertDialog dialog = new AlertDialog.Builder(getContext()) .setTitle(R.string.reading_list_confirm_remove_article_from_offline_title) .setMessage(getConfirmToggleOfflineMessage(page)) .setPositiveButton(R.string.reading_list_confirm_remove_article_from_offline, new ConfirmRemoveFromOfflineListener(page)) .setNegativeButton(android.R.string.cancel, null) .create(); dialog.show(); TextView text = (TextView) dialog.findViewById(android.R.id.message); text.setLineSpacing(0, 1.3f); }
Source:
<code>public Resource<SVG> decode(InputStream source, int width, int height) throws IOException { try { SVG svg = SVG.getFromInputStream(source); return new SvgResource(svg); } catch (SVGParseException ex) { <START> if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD) { <END> throw new IOException(ex.toString()); } throw new IOException("Cannot load SVG from stream", ex); } }</code><technical_language>typical do app work older versions is set minSdkVersion level (9 in this case, for gingerbread+)</technical_language>

Target:
public Resource<SVG> decode(InputStream source, int width, int height) throws IOException { try { SVG svg = SVG.getFromInputStream(source); return new SvgResource(svg); } catch (SVGParseException ex) { throw new IOException("Cannot load SVG from stream", ex); } }
Source:
<code>public static List<ApiImplementor> getAllImplementors() { List<ApiImplementor> imps = new ArrayList<>(); ApiImplementor api; api = new AntiCsrfAPI(null); api.addApiOptions(new AntiCsrfParam()); imps.add(api); imps.add(new PassiveScanAPI(null)); imps.add(new SearchAPI(null)); api = new AutoUpdateAPI(null); api.addApiOptions(new OptionsParamCheckForUpdates()); imps.add(api); api = new SpiderAPI(null); api.addApiOptions(new SpiderParam()); imps.add(api); api = new CoreAPI(); api.addApiOptions(new ConnectionParam()); imps.add(api); imps.add(new ParamsAPI(null)); api = new ActiveScanAPI(null); api.addApiOptions(new ScannerParam()); imps.add(api); imps.add(new ContextAPI()); imps.add(new HttpSessionsAPI(null)); imps.add(new BreakAPI(null)); imps.add(new AuthenticationAPI(null)); imps.add(new AuthorizationAPI()); imps.add(new SessionManagementAPI(null)); imps.add(new UsersAPI(null)); imps.add(new ForcedUserAPI(null)); imps.add(new ScriptAPI(null)); <START> imps.add(new StatsAPI()); <END> return imps; }</code><technical_language>add StatsParam StatsAPI before, include options. purpose</technical_language>

Target:
public static List<ApiImplementor> getAllImplementors() { List<ApiImplementor> imps = new ArrayList<>(); ApiImplementor api; api = new AntiCsrfAPI(null); api.addApiOptions(new AntiCsrfParam()); imps.add(api); imps.add(new PassiveScanAPI(null)); imps.add(new SearchAPI(null)); api = new AutoUpdateAPI(null); api.addApiOptions(new OptionsParamCheckForUpdates()); imps.add(api); api = new SpiderAPI(null); api.addApiOptions(new SpiderParam()); imps.add(api); api = new CoreAPI(); api.addApiOptions(new ConnectionParam()); imps.add(api); imps.add(new ParamsAPI(null)); api = new ActiveScanAPI(null); api.addApiOptions(new ScannerParam()); imps.add(api); imps.add(new ContextAPI()); imps.add(new HttpSessionsAPI(null)); imps.add(new BreakAPI(null)); imps.add(new AuthenticationAPI(null)); imps.add(new AuthorizationAPI()); imps.add(new SessionManagementAPI(null)); imps.add(new UsersAPI(null)); imps.add(new ForcedUserAPI(null)); imps.add(new ScriptAPI(null)); api = new StatsAPI(null); api.addApiOptions(new StatsParam()); imps.add(api); return imps; }
Source:
<code>private ProjectSelectedPositions(ConnectorSession session, DriverYieldSignal yieldSignal, LocalMemoryContext memoryContext, Page page, SelectedPositions selectedPositions) { <START> checkArgument(!selectedPositions.isEmpty(), "selectedPositions should not be empty"); <END> this.session = session; this.yieldSignal = yieldSignal; this.page = page; this.memoryContext = memoryContext; this.selectedPositions = selectedPositions; this.previouslyComputedResults = new Block[projections.size()]; }</code><technical_language>selectedPositions is empty</technical_language>

Target:
private ProjectSelectedPositions(ConnectorSession session, DriverYieldSignal yieldSignal, LocalMemoryContext memoryContext, Page page, SelectedPositions selectedPositions) { checkArgument(!selectedPositions.isEmpty(), "selectedPositions is empty"); this.session = session; this.yieldSignal = yieldSignal; this.page = page; this.memoryContext = memoryContext; this.selectedPositions = selectedPositions; this.previouslyComputedResults = new Block[projections.size()]; }
Source:
<code><START> public synchronized void reloadFile() throws IOException <END> { System.err.println("Reload " + filename); reader.close(); File file = new File(filename); FileInputStream in = new FileInputStream(file); reader = new BufferedReader(new InputStreamReader(in)); }</code><technical_language>errors caught else? Is a reason exceptions printed instead of thrown previously</technical_language>

Target:
public synchronized void reloadFile() { try (Reader r = reader) { System.err.println("Reload " + filename); reader = new BufferedReader(new FileReader(filename)); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>public <A extends Annotation> ExpressionResult checkPermission(Class<A> annotationClass, PersistentResource resource, ChangeSpec changeSpec) { Supplier<Expression> expressionSupplier = () -> { if (SharePermission.class == annotationClass) { if (requestScope.getDictionary().isShareable(resource.getResourceClass())) { return expressionBuilder.buildAnyFieldExpressions(resource, ReadPermission.class, changeSpec); } else { <START> ForbiddenAccessException e = new ForbiddenAccessException("Missing SharePermission for " <END> + resource.getResourceClass().getName()); log.trace("{}", e.getLoggedMessage()); throw e; } } return expressionBuilder.buildAnyFieldExpressions(resource, annotationClass, changeSpec); }; Function<Expression, ExpressionResult> expressionExecutor = (expression) -> { if ((((RequestScope) resource.getRequestScope()).isMutatingMultipleEntities() || annotationClass == UpdatePermission.class) && requestScope.getNewPersistentResources().contains(resource)) { return executeUserChecksDeferInline(annotationClass, expression); } return executeExpressions(expression, annotationClass, Expression.EvaluationMode.INLINE_CHECKS_ONLY); }; return checkPermissions( resource.getResourceClass(), annotationClass, Optional.empty(), expressionSupplier, expressionExecutor); }</code><technical_language>expressionSupplier builds expression - execute it. Inline this code, this build expression explicitly denies permission. - executing expression throw exception</technical_language>

Target:
public <A extends Annotation> ExpressionResult checkPermission(Class<A> annotationClass, PersistentResource resource, ChangeSpec changeSpec) { Supplier<Expression> expressionSupplier = () -> { if (SharePermission.class == annotationClass) { if (requestScope.getDictionary().isShareable(resource.getResourceClass())) { return expressionBuilder.buildAnyFieldExpressions(resource, ReadPermission.class, changeSpec); } else { return expressionBuilder.FAIL_EXPRESSION; } } return expressionBuilder.buildAnyFieldExpressions(resource, annotationClass, changeSpec); }; Function<Expression, ExpressionResult> expressionExecutor = (expression) -> { if ((((RequestScope) resource.getRequestScope()).isMutatingMultipleEntities() || annotationClass == UpdatePermission.class) && requestScope.getNewPersistentResources().contains(resource)) { return executeUserChecksDeferInline(annotationClass, expression); } return executeExpressions(expression, annotationClass, Expression.EvaluationMode.INLINE_CHECKS_ONLY); }; return checkPermissions( resource.getResourceClass(), annotationClass, Optional.empty(), expressionSupplier, expressionExecutor); }
Source:
<code>public Response diagnoseInstance( String applicationName, String instancePath ) { <START> final Application application = this.manager.findApplicationByName( applicationName ); <END> if (application == null) { return Response .status( Status.BAD_REQUEST ) .entity( "No application with name " + applicationName ) .build(); } final Instance instance = InstanceHelpers.findInstanceByPath( application, instancePath ); if (instance == null) { return Response .status( Status.BAD_REQUEST ) .entity( "No instance with path " + instancePath + " in application " + applicationName ) .build(); } return Response.status( Status.OK ).entity( instance ).build(); }</code><technical_language>methods, return statement. This is more convenient for debug limiting number of breakpoints</technical_language>

Target:
public Response diagnoseInstance( String applicationName, String instancePath ) { final Response response; final Application application = this.manager.findApplicationByName( applicationName ); if (application != null) { final Instance instance = InstanceHelpers.findInstanceByPath( application, instancePath ); if (instance != null) { response = Response.status( Status.OK ).entity( instance ).build(); } else { response = Response .status( Status.BAD_REQUEST ) .entity( "No instance with path " + instancePath + " in application " + applicationName ) .build(); } } else { response = Response .status( Status.BAD_REQUEST ) .entity( "No application with name " + applicationName ) .build(); } return response; }
Source:
<code>public void testVisitPropertyIsGreaterThanOrEqualTo() throws Exception { getRootFilterNode("comparison-binary-ops", "PropertyIsGreaterThanOrEqualTo.xml") .accept(visitor); <START> assertLeafNode(visitor.getResult(), ">=", "depth", "100"); <END> }</code><technical_language>depth 100 constants</technical_language>

Target:
public void testVisitPropertyIsGreaterThanOrEqualTo() throws Exception { getRootFilterNode("comparison-binary-ops", "PropertyIsGreaterThanOrEqualTo.xml") .accept(visitor); assertLeafNode(visitor.getResult(), ">=", DEPTH_PROP, DEPTH_VAL); }
Source:
<code>private String parseDest() throws IOException, InvalidEdgeFormatException { StringBuilder dest = new StringBuilder(ID_LENGTH_GUESS); int point = eatSpaces(br.read()); boolean destParsed = false; char next; <START> parseLoop: while (point != -1) { <END> next = (char) point; switch (next) { case '\n': case '\r': break parseLoop; case ' ': destParsed = true; point = eatSpaces(br.read()); break; default: if (destParsed) { throw new InvalidEdgeFormatException("Found extra node"); } dest.append(next); point = br.read(); } } if (dest.length() == 0) { throw new InvalidEdgeFormatException("Missing destination node"); } return dest.toString(); }</code><technical_language><LINK_0> (I hate labels, especially necessary :p)</technical_language>

Target:
private String parseDest() throws IOException, InvalidEdgeFormatException { StringBuilder dest = new StringBuilder(ID_LENGTH_GUESS); boolean destParsed = false; char next; while (currentChar != -1) { next = (char) currentChar; switch (next) { case '\n': case '\r': currentChar = -1; break; case ' ': destParsed = true; eatSpaces(); break; default: if (destParsed) { throw new InvalidEdgeFormatException("Found extra node"); } dest.append(next); currentChar = br.read(); } } if (dest.length() == 0) { throw new InvalidEdgeFormatException("Missing destination node"); } return dest.toString(); }
Source:
<code>public static boolean canExecutePartially(List<? extends BusinessEntityWithStatus<?, ?>> entities, Class type, VdcActionType action) { if (_matrix.containsKey(type)) { for (BusinessEntityWithStatus<?, ?> a : entities) { if (a.getClass() == type && (!_matrix.get(type).containsKey(a.getStatus()) || !_matrix.get(type).get(a.getStatus()).contains(action))) { return true; } } } <START> return false; <END> }</code><technical_language>if type is in _matrix return true, false</technical_language>

Target:
public static boolean canExecutePartially(List<? extends BusinessEntityWithStatus<?, ?>> entities, Class type, VdcActionType action) { if (_matrix.containsKey(type)) { for (BusinessEntityWithStatus<?, ?> a : entities) { if (a.getClass() == type && (!_matrix.get(type).containsKey(a.getStatus()) || !_matrix.get(type).get(a.getStatus()).contains(action))) { return true; } } } else { return true; } return false; }
Source:
<code>public void shutdown() throws InterruptedException { stopRebalancingTimer(); while (_eventThread.isAlive()) { _eventThread.interrupt(); <START> _eventThread.join(1000); <END> } }</code><technical_language>change this a constant variable</technical_language>

Target:
public void shutdown() throws InterruptedException { stopRebalancingTimer(); while (_eventThread.isAlive()) { _eventThread.interrupt(); _eventThread.join(EVENT_THREAD_JOIN_TIMEOUT); } }
Source:
<code>private void initInternalAPI() { <START> if (this.internalAPI == null && this.internalAPIUrls != null) { <END> for (String lookupURL : this.internalAPIUrls) { try { this.internalAPI = PAActiveObject.lookupActive(SynchronizationInternal.class, lookupURL); return; } catch (Exception e) { logger.warn("Could not lookup Synchronization service at " + lookupURL, e); } } throw new IllegalStateException("Could not locate the Synchronization service at " + Arrays.toString(internalAPIUrls)); } }</code><technical_language>this block synchronised avoid 2 calls creating 2 times object</technical_language>

Target:
private synchronized void initInternalAPI() { if (this.internalAPI == null && this.internalAPIUrls != null) { for (String lookupURL : this.internalAPIUrls) { try { this.internalAPI = PAActiveObject.lookupActive(SynchronizationInternal.class, lookupURL); return; } catch (Exception e) { logger.warn("Could not lookup Synchronization service at " + lookupURL, e); } } throw new IllegalStateException("Could not locate the Synchronization service at " + Arrays.toString(internalAPIUrls)); } }
Source:
<code>public void setUp() throws Exception { <START> r.jenkins.getDescriptorByType(GlobalDefaultFlowDurabilityLevel.DescriptorImpl.class).setDurabilityHint(FlowDurabilityHint.PERFORMANCE_OPTIMIZED); <END> deletePods(cloud.connect(), getLabels(cloud, this, name), false); assertNotNull(createJobThenScheduleRun()); UsernamePasswordCredentialsImpl creds = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, "id", "some credentials", "username", "password"); SystemCredentialsProvider.getInstance().getCredentials().add(creds); }</code><technical_language>set this a per-WorkflowJob basis</technical_language>

Target:
public void setUp() throws Exception { deletePods(cloud.connect(), getLabels(cloud, this, name), false); assertNotNull(createJobThenScheduleRun()); UsernamePasswordCredentialsImpl creds = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, "id", "some credentials", "username", "password"); SystemCredentialsProvider.getInstance().getCredentials().add(creds); }
Source:
<code>public NotificationDto process(File runDirectory, TimeZone tz) throws Exception { Path runPath = runDirectory.toPath().toAbsolutePath(); ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JavaTimeModule()) <START> .setDateFormat(new ISO8601DateFormat()); <END> Process process = new ProcessBuilder("runscanner-illumina", runDirectory.getAbsolutePath()).directory(runDirectory).start(); IlluminaNotificationDto dto = mapper.readValue(process.getInputStream(), IlluminaNotificationDto.class); dto.setSequencerFolderPath(runPath); if (process.waitFor() != 0) { throw new IOException("Illumina run processor did not exit cleanly: " + runDirectory.getAbsolutePath()); } return dto; }</code><technical_language>Mapper options standardized RunProcessors</technical_language>

Target:
public NotificationDto process(File runDirectory, TimeZone tz) throws IOException { Path runPath = runDirectory.toPath().toAbsolutePath(); Process process = new ProcessBuilder("runscanner-illumina", runDirectory.getAbsolutePath()).directory(runDirectory).start(); IlluminaNotificationDto dto = createObjectMapper().readValue(process.getInputStream(), IlluminaNotificationDto.class); dto.setSequencerFolderPath(runPath); try { if (process.waitFor() != 0) { throw new IOException("Illumina run processor did not exit cleanly: " + runDirectory.getAbsolutePath()); } } catch (InterruptedException e) { throw new IOException(e); } File rtaLogDir = new File(runDirectory, "/Data/RTALogs"); boolean failed = rtaLogDir.exists() ? Arrays.stream(rtaLogDir.listFiles(file -> file.getName().endsWith("Log.txt") || file.getName().endsWith("Log_00.txt"))) .anyMatch(file -> { try (Scanner scanner = new Scanner(file)) { return scanner.findWithinHorizon(FAILED_MESSAGE, 0) != null; } catch (FileNotFoundException e) { log.error("RTA file vanished before reading", e); return false; } }) : false; if (failed) { dto.setHealthType(HealthType.Failed); } return dto; }
Source:
<code>private void updateGuiding(final TargetEnvironment env) { toggleAgsGuiElements(); final Option<ObsContext> ctx = getObsContext(env); _w.guidingControls.update(ctx); final ISPObsComponent node = getContextTargetObsComp(); <START> TargetSelection.getTargetForNode(env, node).foreach(target -> _w.detailEditor.gfe().edit(ctx, target, node)); <END> }</code><technical_language>GuidingFeedbackEditor. I guess writing out hurt</technical_language>

Target:
private void updateGuiding(final TargetEnvironment env) { toggleAgsGuiElements(); final Option<ObsContext> ctx = getObsContext(env); _w.guidingControls.update(ctx); final ISPObsComponent node = getContextTargetObsComp(); TargetSelection.getTargetForNode(env, node).foreach(target -> _w.detailEditor.guidingFeedbackEditor().edit(ctx, target, node)); }
Source:
<code>private static String getCertificateSHA1Fingerprint() { PackageManager pm = app.getPackageManager(); String packageName = app.getPackageName(); int flags = PackageManager.GET_SIGNATURES; PackageInfo packageInfo = null; try { packageInfo = pm.getPackageInfo(packageName, flags); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } Signature[] signatures = packageInfo.signatures; byte[] cert = signatures[0].toByteArray(); InputStream input = new ByteArrayInputStream(cert); CertificateFactory cf = null; <START> try { <END> cf = CertificateFactory.getInstance("X509"); } catch (CertificateException e) { e.printStackTrace(); } X509Certificate c = null; try { c = (X509Certificate) cf.generateCertificate(input); } catch (CertificateException e) { e.printStackTrace(); } String hexString = null; try { MessageDigest md = MessageDigest.getInstance("SHA1"); byte[] publicKey = md.digest(c.getEncoded()); hexString = byte2HexFormatted(publicKey); } catch (NoSuchAlgorithmException e1) { e1.printStackTrace(); } catch (CertificateEncodingException e) { e.printStackTrace(); } return hexString; }</code><technical_language>Is a reason shorten lines this? Java X509Certificate c = null; try { cf = CertificateFactory.getInstance("X509"); c = (X509Certificate) cf.generateCertificate(input); } catch (CertificateException e) { e.printStackTrace(); }</technical_language>

Target:
private static String getCertificateSHA1Fingerprint() { PackageManager pm = app.getPackageManager(); String packageName = app.getPackageName(); int flags = PackageManager.GET_SIGNATURES; PackageInfo packageInfo = null; try { packageInfo = pm.getPackageInfo(packageName, flags); } catch (PackageManager.NameNotFoundException ex) { ErrorActivity.reportError(app, ex, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "Could not find package info", R.string.app_ui_crash)); } Signature[] signatures = packageInfo.signatures; byte[] cert = signatures[0].toByteArray(); InputStream input = new ByteArrayInputStream(cert); CertificateFactory cf = null; X509Certificate c = null; try { cf = CertificateFactory.getInstance("X509"); c = (X509Certificate) cf.generateCertificate(input); } catch (CertificateException ex) { ErrorActivity.reportError(app, ex, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "Certificate error", R.string.app_ui_crash)); } String hexString = null; try { MessageDigest md = MessageDigest.getInstance("SHA1"); byte[] publicKey = md.digest(c.getEncoded()); hexString = byte2HexFormatted(publicKey); } catch (NoSuchAlgorithmException ex1) { ErrorActivity.reportError(app, ex1, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "Could not retrieve SHA1 key", R.string.app_ui_crash)); } catch (CertificateEncodingException ex2) { ErrorActivity.reportError(app, ex2, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "Could not retrieve SHA1 key", R.string.app_ui_crash)); } return hexString; }
Source:
<code>public static AbstractMap.SimpleImmutableEntry<String, Object> pair(String key, Object value) { <START> return new AbstractMap.SimpleImmutableEntry<>(key, value); <END> }</code><technical_language>If need immutable key pairs, org.apache.commons.lang3.tuple package ImmutablePair, reduce verbosity. java ImmutablePair<Integer, String> pair = new ImmutablePair<>(2, "Two"); Integer key = pair.getKey(); String = pair.getValue();</technical_language>

Target:
public static Map.Entry<String, Object> pair(String key, Object value) { return new AbstractMap.SimpleImmutableEntry<>(key, value); }
Source:
<code><START> protected void endSuccessfully() { <END> try { if (getParameters().isHotPlugLease() && !runVdsCommand(VDSCommandType.HotPlugLease, new LeaseVDSParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStorageDomainId())).getSucceeded()) { setVmId(getParameters().getVmId()); auditLog(this, AuditLogType.HOT_PLUG_LEASE_FAILED); setSucceeded(false); return; } } catch (EngineException e) { log.error("Failure in hot plugging a lease to VM {}, message: {}", getParameters().getVmId(), e.getMessage()); auditLog(this, AuditLogType.HOT_PLUG_LEASE_FAILED); return; } setSucceeded(true); }</code><technical_language>endSuccessfully in VmLeaseCommandBase</technical_language>

Target:
protected void endSuccessfully() { if (getParameters().isHotPlugLease()) { boolean hotPlugSucceeded = false; try { hotPlugSucceeded = runVdsCommand(VDSCommandType.HotPlugLease, new LeaseVDSParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStorageDomainId())).getSucceeded(); } catch (EngineException e) { log.error("Failure in hot plugging a lease to VM {}, message: {}", getParameters().getVmId(), e.getMessage()); } if (!hotPlugSucceeded) { auditLog(this, AuditLogType.HOT_PLUG_LEASE_FAILED); setSucceeded(false); return; } } setSucceeded(true); }
Source:
<code>public synchronized void tryInitialize() { <START> if (isInitialized()) { <END> log.warn("Tried to initialize Transaction Managers, but was already initialized"); return; } TransactionTables.createTables(keyValueService); Set<Schema> allSchemas = ImmutableSet.<Schema>builder() .add(SweepSchema.INSTANCE.getLatestSchema()) .addAll(schemas) .build(); for (Schema schema : allSchemas) { Schemas.createTablesAndIndexes(schema, keyValueService); } LoggingArgs.hydrate(keyValueService.getMetadataForTables()); isInitialized = true; }</code><technical_language>this logic is duplicated in a places.. this moved interface</technical_language>

Target:
public synchronized void tryInitialize() { assertNotInitialized(); TransactionTables.createTables(keyValueService); Set<Schema> allSchemas = ImmutableSet.<Schema>builder() .add(SweepSchema.INSTANCE.getLatestSchema()) .addAll(schemas) .build(); for (Schema schema : allSchemas) { Schemas.createTablesAndIndexes(schema, keyValueService); } LoggingArgs.hydrate(keyValueService.getMetadataForTables()); isInitialized = true; }
Source:
<code>public boolean waitForChange(int timeoutMs) throws InterruptedException { int count = registeredPathsCount; if (count == 0) { throw new IllegalStateException(); } long limit = SystemTime.getInstance().milliseconds() + timeoutMs; while (true) { final WatchKey wk = watchService.poll(limit - SystemTime.getInstance().milliseconds(), TimeUnit.MILLISECONDS); if (wk == null) { <START> System.out.println("Timed out waiting for file changes, count: " + count); <END> return false; } if (!keys.containsKey(wk)) { throw new IllegalStateException("Unexpected event received"); } for (WatchEvent<?> event : wk.pollEvents()) { final Path changed = (Path) event.context(); System.out.println(changed); System.out.println("dir: " + keys.get(wk)); if (changed.endsWith(fileName)) { count--; break; } } wk.reset(); keys.remove(wk); if (count == 0) { break; } } return true; }</code><technical_language>want print console</technical_language>

Target:
public boolean waitForChange(int timeoutMs) throws InterruptedException { int count = registeredPathsCount; if (count == 0) { throw new IllegalStateException(); } long limit = SystemTime.getInstance().milliseconds() + timeoutMs; while (true) { final WatchKey wk = watchService.poll(limit - SystemTime.getInstance().milliseconds(), TimeUnit.MILLISECONDS); if (wk == null) { return false; } if (!keys.containsKey(wk)) { throw new IllegalStateException("Unexpected event received"); } for (WatchEvent<?> event : wk.pollEvents()) { final Path changed = (Path) event.context(); if (changed.endsWith(fileName)) { count--; break; } } wk.reset(); keys.remove(wk); if (count == 0) { break; } } return true; }
Source:
<code>public static void migrateAppWideMobileEditorPreferenceToRemote(final AccountStore accountStore, final SiteStore siteStore, final Dispatcher dispatcher) { if (AppPrefs.isUserInGutenbergRolloutGroup()) { return; } if (accountStore.getAccount().getUserId() % 100 >= (100 - GB_ROLLOUT_PERCENTAGE)) { for (SiteModel site : siteStore.getSites()) { if (TextUtils.isEmpty(site.getMobileEditor())) { <START> enableBlockEditor(dispatcher, site); <END> AnalyticsUtils.trackWithSiteDetails(Stat.EDITOR_GUTENBERG_ENABLED, site, BlockEditorEnabledSource.ON_PROGRESSIVE_ROLLOUT.asPropertyMap()); AppPrefs.setShowGutenbergInfoPopupForTheNewPosts(site.getUrl(), true); } } AppPrefs.setUserInGutenbergRolloutGroup(); } if (!AppPrefs.isDefaultAppWideEditorPreferenceSet()) { return; } final boolean oldAppWidePreferenceValue = AppPrefs.isGutenbergDefaultForNewPosts(); if (oldAppWidePreferenceValue) { dispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorForAllSitesAction( new DesignateMobileEditorForAllSitesPayload(SiteUtils.GB_EDITOR_NAME))); } else { dispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorForAllSitesAction( new DesignateMobileEditorForAllSitesPayload(SiteUtils.AZTEC_EDITOR_NAME))); } }</code><technical_language>I idea above, making logic simpler, dones't required FluxC changes. device network connectivity, action is "fired" listening for errors I guess. try device is online only</technical_language>

Target:
public static void migrateAppWideMobileEditorPreferenceToRemote(final AccountStore accountStore, final SiteStore siteStore, final Dispatcher dispatcher) { if (!FluxCUtils.isSignedInWPComOrHasWPOrgSite(accountStore, siteStore)) { return; } if (AppPrefs.isUserInGutenbergRolloutGroup()) { return; } if (accountStore.getAccount().getUserId() % 100 >= (100 - GB_ROLLOUT_PERCENTAGE)) { if (atLeastOneSiteHasAztecEnabled(siteStore)) { return; } if (!NetworkUtils.isNetworkAvailable(WordPress.getContext())) { return; } for (SiteModel site : siteStore.getSites()) { if (TextUtils.isEmpty(site.getMobileEditor())) { AppPrefs.setShowGutenbergInfoPopupForTheNewPosts(site.getUrl(), true); } } dispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorForAllSitesAction( new DesignateMobileEditorForAllSitesPayload(SiteUtils.GB_EDITOR_NAME))); AppPrefs.setUserInGutenbergRolloutGroup(); } if (!AppPrefs.isDefaultAppWideEditorPreferenceSet()) { return; } final boolean oldAppWidePreferenceValue = AppPrefs.isGutenbergDefaultForNewPosts(); if (oldAppWidePreferenceValue) { dispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorForAllSitesAction( new DesignateMobileEditorForAllSitesPayload(SiteUtils.GB_EDITOR_NAME))); } else { dispatcher.dispatch(SiteActionBuilder.newDesignateMobileEditorForAllSitesAction( new DesignateMobileEditorForAllSitesPayload(SiteUtils.AZTEC_EDITOR_NAME))); } }
Source:
<code><START> public boolean isPage200(HttpMessage msg) { <END> return parent.isPage200(msg); }</code><technical_language>enough protected</technical_language>

Target:
protected boolean isPage200(HttpMessage msg) { return isCustomPage(msg, CustomPage.Type.OK_200); }