auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ProcessingDirective process(final DivolteEvent event) { if (!event.corruptEvent || keepCorrupted) { final boolean duplicate = memory.isProbableDuplicate(event.partyCookie.value, event.sessionCookie.value, event.eventId); event.exchange.putAttachment(DUPLICATE_EVENT_KEY, duplicate); if (!duplicate || keepDuplicates) { final GenericRecord avroRecord = mapper.newRecordFromExchange(event); try { final AvroRecordBuffer avroBuffer = AvroRecordBuffer.fromRecord( event.partyCookie, event.sessionCookie, event.requestStartTime, event.clientUtcOffset, avroRecord); listener.incomingRequest(event, avroBuffer, avroRecord); doProcess(avroBuffer); <START> } catch (final RuntimeException e) { <END> logger.warn(invalid, "Error processing event from party in session {}: {}", event, event.partyCookie, event.sessionCookie, avroRecord, e); } } } return CONTINUE; }</code><technical_language>listener call doProcess of try-catch block, if guarding mapping errors here</technical_language>

Target:
public ProcessingDirective process(final DivolteEvent event) { if (!event.corruptEvent || keepCorrupted) { final boolean duplicate = memory.isProbableDuplicate(event.partyCookie.value, event.sessionCookie.value, event.eventId); event.exchange.putAttachment(DUPLICATE_EVENT_KEY, duplicate); if (!duplicate || keepDuplicates) { final GenericRecord avroRecord = mapper.newRecordFromExchange(event); try { final AvroRecordBuffer avroBuffer = AvroRecordBuffer.fromRecord( event.partyCookie, event.sessionCookie, event.requestStartTime, event.clientUtcOffset, avroRecord); } catch (final RuntimeException e) { logger.warn(invalid, "Error processing event from party in session {}: {}", event, event.partyCookie, event.sessionCookie, avroRecord, e); } listener.incomingRequest(event, avroBuffer, avroRecord); doProcess(avroBuffer); } } return CONTINUE; }
Source:
<code>Collection<MemberImpl> resolve(Map<MemberImpl, Set<MemberImpl>> disconnections) { Set<MemberImpl> members = new HashSet<>(); disconnections.forEach((k, v) -> { members.add(k); members.addAll(v); }); Graph<MemberImpl> connectivityGraph = buildConnectionGraph(members, disconnections); BronKerboschCliqueFinder<MemberImpl> cliqueFinder = createCliqueFinder(connectivityGraph); Collection<Set<MemberImpl>> maxCliques = cliqueFinder.computeMaxCliques(); if (cliqueFinder.isTimeLimitReached()) { <START> throw new IllegalStateException("Partial disconnection resolution algorithm timed out! disconnectivity map: " <END> + disconnections); } else if (maxCliques.isEmpty()) { throw new IllegalStateException("Partial disconnection resolution algorithm returned no result! " + "disconnectivity map: " + disconnections); } Collection<MemberImpl> membersToRemove = new HashSet<>(members); membersToRemove.removeAll(maxCliques.iterator().next()); return membersToRemove; }</code><technical_language>Is this illegal state: IllegalStateException ? TimeoutException better.</technical_language>

Target:
Collection<MemberImpl> resolve(Map<MemberImpl, Set<MemberImpl>> disconnections) throws TimeoutException { Set<MemberImpl> members = new HashSet<>(); disconnections.forEach((k, v) -> { members.add(k); members.addAll(v); }); Graph<MemberImpl> connectivityGraph = buildConnectionGraph(members, disconnections); BronKerboschCliqueFinder<MemberImpl> cliqueFinder = createCliqueFinder(connectivityGraph); Collection<Set<MemberImpl>> maxCliques = cliqueFinder.computeMaxCliques(); if (cliqueFinder.isTimeLimitReached()) { throw new TimeoutException("Partial disconnection resolution algorithm timed out! disconnectivity map: " + disconnections); } else if (maxCliques.isEmpty()) { throw new IllegalStateException("Partial disconnection resolution algorithm returned no result! " + "disconnectivity map: " + disconnections); } Collection<MemberImpl> membersToRemove = new HashSet<>(members); membersToRemove.removeAll(maxCliques.iterator().next()); return membersToRemove; }
Source:
<code>private List<String> sliceSegsForGpt(String segments) { String specialSegment = "ph3uhzc41"; String[] segs = segments.split(","); if (segs.length > MAX_SEGS_NUMBER_GPT) { if (segments.contains(specialSegment) && !Arrays.asList(segs).subList(0, MAX_SEGS_NUMBER_GPT).contains(specialSegment)) { <START> List<String> slicedSegs = new LinkedList<>(Arrays.asList(Arrays.copyOfRange( <END> segs, 0, MAX_SEGS_NUMBER_GPT - 1))); slicedSegs.add(0, specialSegment); return slicedSegs; } else { return Arrays.asList(Arrays.copyOfRange(segs, 0, MAX_SEGS_NUMBER_GPT)); } } return Arrays.asList(segs); }</code><technical_language>LinkedList</technical_language>

Target:
private List<String> sliceSegsForGpt(String segments) { String specialSegment = "ph3uhzc41"; String[] segs = segments.split(","); if (segs.length > MAX_SEGS_NUMBER_GPT) { List<String> slicedSegs = Arrays.asList(segs).subList(0, MAX_SEGS_NUMBER_GPT); if (segments.contains(specialSegment) && !slicedSegs.contains(specialSegment)) { slicedSegs = new LinkedList<>(Arrays.asList(segs).subList(0, MAX_SEGS_NUMBER_GPT - 1)); slicedSegs.add(0, specialSegment); } return slicedSegs; } return Arrays.asList(segs); }
Source:
<code>public ListenableFuture<Iterable<LabelMeta>> findLabels(final String query) { NGramGenerator ngrams = new NGramGenerator(query); <START> List<ResultSetFuture> resultSets = fetchLabelIds(ngrams); <END> return transform( successfulAsList(resultSets), new AsyncFunction<List<ResultSet>, Iterable<LabelMeta>>() { @Override public ListenableFuture<Iterable<LabelMeta>> apply(final List<ResultSet> resultSets) { return transform(fetchLabelMetas(resultSets), new Function<Iterable<LabelMeta>, Iterable<LabelMeta>>() { @Override public Iterable<LabelMeta> apply(final Iterable<LabelMeta> input) { return input; } }); } }); }</code><technical_language>final</technical_language>

Target:
public ListenableFuture<Iterable<LabelMeta>> findLabels(final String query) { final NGramGenerator ngrams = new NGramGenerator(query); final List<ResultSetFuture> resultSets = fetchLabelIds(ngrams); return transform( successfulAsList(resultSets), new AsyncFunction<List<ResultSet>, Iterable<LabelMeta>>() { @Override public ListenableFuture<Iterable<LabelMeta>> apply(final List<ResultSet> resultSets) { return transform(fetchLabelMetas(resultSets), new Function<Iterable<LabelMeta>, Iterable<LabelMeta>>() { @Override public Iterable<LabelMeta> apply(final Iterable<LabelMeta> input) { return input; } }); } }); }
Source:
<code>protected HeaderCacheElement refreshCredentialsWithRetry(@Nullable BackOff backoff) { try { LOG.info("Refreshing the OAuth token"); AccessToken newToken = credentials.refreshAccessToken(); if (newToken == null) { LOG.info("Refreshed the OAuth token"); return new HeaderCacheElement(new IOException("Could not load the token for credentials: " + credentials)); } else { return new HeaderCacheElement(newToken); } } catch (IOException exception) { if (backoff == null) { backoff = retryOptions.createBackoff(); } try { RetryState retryState = getRetryState(backoff); if (retryState == RetryState.PerformRetry) { <START> LOG.warn("Unexpected IOExcetpion during Credential refreshing. Retrying", exception); <END> return refreshCredentialsWithRetry(backoff); } else { return new HeaderCacheElement(exception); } } catch (IOException e) { LOG.warn("Got an exception while trying to run backoff.nextBackOffMillis()", e); return new HeaderCacheElement(exception); } } catch (Exception e) { LOG.warn("Got an unexpected generic exception while trying to refresh credentials.", e); return new HeaderCacheElement(new IOException("Could not read headers", e)); } }</code><technical_language>fix message a bit</technical_language>

Target:
protected HeaderCacheElement refreshCredentialsWithRetry(@Nullable BackOff backoff) { try { LOG.info("Refreshing the OAuth token"); AccessToken newToken = credentials.refreshAccessToken(); if (newToken == null) { LOG.info("Refreshed the OAuth token"); return new HeaderCacheElement(new IOException("Could not load the token for credentials: " + credentials)); } else { return new HeaderCacheElement(newToken); } } catch (IOException exception) { LOG.warn("Got an unexpected IOException when refreshing google credentials.", exception); if (backoff == null) { backoff = retryOptions.createBackoff(); } try { RetryState retryState = getRetryState(backoff); if (retryState == RetryState.PerformRetry) { return refreshCredentialsWithRetry(backoff); } else { return new HeaderCacheElement(exception); } } catch (IOException e) { LOG.warn("Got an exception while trying to run backoff.nextBackOffMillis()", e); return new HeaderCacheElement(exception); } } catch (Exception e) { LOG.warn("Got an unexpected exception while trying to refresh google credentials.", e); return new HeaderCacheElement(new IOException("Could not read headers", e)); } }
Source:
<code>public Pagination<Payment> searchPayments(final String searchKey, final Long offset, final Long limit, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context) { <START> return paymentProcessor.searchPayments(searchKey, offset, limit, withPluginInfo, properties, context, internalCallContextFactory.createInternalTenantContext(context)); <END> }</code><technical_language>here: new flag withAttempts is passed (used) paymentProcessor#getAccountPayments</technical_language>

Target:
public Pagination<Payment> searchPayments(final String searchKey, final Long offset, final Long limit, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context) { return paymentProcessor.searchPayments(searchKey, offset, limit, withPluginInfo, withAttempts, properties, context, internalCallContextFactory.createInternalTenantContext(context)); }
Source:
<code>public ResponseEntity<?> createWorkflowInstance( @RequestBody @ApiParam(value = "Submitted workflow instance information", required = true) CreateWorkflowInstanceRequest req) { WorkflowInstance instance = createWorkflowConverter.convert(req); try { long id = workflowInstances.insertWorkflowInstance(instance); instance = workflowInstances.getWorkflowInstance(id, EnumSet.of(WorkflowInstanceInclude.CURRENT_STATE_VARIABLES), null); return created(URI.create(String.valueOf(id))).body(createWorkflowConverter.convert(instance)); } catch (IllegalArgumentException e) { <START> return status(BAD_REQUEST).body(e.getMessage()); <END> } }</code><technical_language>promise produce json output. Plain string is valid json</technical_language>

Target:
public ResponseEntity<?> createWorkflowInstance( @RequestBody @ApiParam(value = "Submitted workflow instance information", required = true) CreateWorkflowInstanceRequest req) { WorkflowInstance instance = createWorkflowConverter.convert(req); try { long id = workflowInstances.insertWorkflowInstance(instance); instance = workflowInstances.getWorkflowInstance(id, EnumSet.of(WorkflowInstanceInclude.CURRENT_STATE_VARIABLES), null); return created(URI.create(String.valueOf(id))).body(createWorkflowConverter.convert(instance)); } catch (IllegalArgumentException e) { return status(BAD_REQUEST).body(new ErrorResponse((e.getMessage()))); } }
Source:
<code>public TokenEntry(String image, String tokenSrcID, int beginLine) { setImage(image); this.tokenSrcID = tokenSrcID; this.beginLine = beginLine; <START> this.beginColumn = -1; <END> this.endColumn = -1; this.index = TOKEN_COUNT.get().getAndIncrement(); }</code><technical_language>Please call other constructor this(image, tokenSrcID, beginLine, -1, -1). way, need duplicate logic..</technical_language>

Target:
public TokenEntry(String image, String tokenSrcID, int beginLine) { this(image, tokenSrcID, beginLine, -1, -1); }
Source:
<code>private void assertGetStudiesAll(String url) { ResponseEntity<QueryResponse<QueryResult<VariantStudy>>> response = restTemplate.exchange( url, HttpMethod.GET, null, new ParameterizedTypeReference<QueryResponse<QueryResult<VariantStudy>>>() {}); assertEquals(HttpStatus.OK, response.getStatusCode()); QueryResponse<QueryResult<VariantStudy>> queryResponse = response.getBody(); assertEquals(1, queryResponse.getResponse().size()); List<VariantStudy> results = queryResponse.getResponse().get(0).getResult(); <START> assertTrue(results.size() >= 1); <END> assertVariantStudiesAreNotEmpty(results); }</code><technical_language>3 studies. change this results.size() == 3</technical_language>

Target:
private void assertGetStudiesAll(String url) { ResponseEntity<QueryResponse<QueryResult<VariantStudy>>> response = restTemplate.exchange( url, HttpMethod.GET, null, new ParameterizedTypeReference<QueryResponse<QueryResult<VariantStudy>>>() {}); assertEquals(HttpStatus.OK, response.getStatusCode()); QueryResponse<QueryResult<VariantStudy>> queryResponse = response.getBody(); assertEquals(1, queryResponse.getResponse().size()); List<VariantStudy> results = queryResponse.getResponse().get(0).getResult(); assertEquals(3, results.size()); assertVariantStudiesAreNotEmpty(results); }
Source:
<code>public void streamAllEvents() throws IOException, InterruptedException { List<ServerSentEvent<String>> events = getServerSentEvents(ACTUATOR_STREAM_CIRCUITBREAKER_EVENTS); CircuitBreakerEventsEndpointResponse circuitBreakerEventsBefore = circuitBreakerEvents(ACTUATOR_CIRCUITBREAKEREVENTS); try { dummyService.doSomething(true); } catch (IOException ex) { } Thread.sleep(1000); dummyService.doSomething(false); CircuitBreakerEventsEndpointResponse circuitBreakerEventsAfter = circuitBreakerEvents(ACTUATOR_CIRCUITBREAKEREVENTS); <START> assert (circuitBreakerEventsBefore.getCircuitBreakerEvents().size() < circuitBreakerEventsAfter.getCircuitBreakerEvents().size()); <END> Thread.sleep(1000); assert (events.size() == 2); }</code><technical_language>Please AssertJ</technical_language>

Target:
public void streamAllEvents() throws IOException, InterruptedException { List<ServerSentEvent<String>> events = getServerSentEvents(ACTUATOR_STREAM_CIRCUITBREAKER_EVENTS); CircuitBreakerEventsEndpointResponse circuitBreakerEventsBefore = circuitBreakerEvents(ACTUATOR_CIRCUITBREAKEREVENTS); publishEvents(); CircuitBreakerEventsEndpointResponse circuitBreakerEventsAfter = circuitBreakerEvents(ACTUATOR_CIRCUITBREAKEREVENTS); assertThat (circuitBreakerEventsBefore.getCircuitBreakerEvents().size()).isLessThan(circuitBreakerEventsAfter.getCircuitBreakerEvents().size()); Thread.sleep(1000); assertThat (events.size()).isEqualTo(2); }
Source:
<code>protected void onInitialize() { super.onInitialize(); add(new WebMarkupContainer("pin").add( <START> new AttributeAppender("style", "background-color: rgba(" + color.getRed() + ", " + color.getGreen() <END> + ", " + color.getBlue() + ", " + color.getAlpha() + ");"))); }</code><technical_language>RGBA is is needed consider ints for this. I user/fan of Google AppEngine java.awt able this there</technical_language>

Target:
protected void onInitialize() { super.onInitialize(); add(new WebMarkupContainer("pin") .add(new AttributeAppender("style", getBackgroundColorModel()))); }
Source:
<code>protected boolean executeAnalysis(final IProgressMonitor monitor) throws TmfAnalysisException { Object workerObj = getParameter(PARAM_WORKER); if (workerObj == null) { return false; } if (!(workerObj instanceof IGraphWorker)) { throw new IllegalStateException("Worker parameter must be an IGraphWorker"); } IGraphWorker worker = (IGraphWorker) workerObj; TmfGraphBuilderModule graphModule = fGraphModule; graphModule.schedule(); <START> SubMonitor subMonitor = SubMonitor.convert(monitor, 3); <END> subMonitor.setTaskName(NLS.bind(Messages.CriticalPathModule_waitingForGraph, graphModule.getName())); if (!graphModule.waitForCompletion(subMonitor)) { Activator.getInstance().logInfo("Critical path execution: graph building was cancelled. Results may not be accurate."); return false; } subMonitor.worked(1); TmfGraph graph = graphModule.getGraph(); if (graph == null) { throw new TmfAnalysisException("Critical Path analysis: graph " + graphModule.getName() + " is null"); } TmfVertex head = graph.getHead(worker); if (head == null) { fCriticalPath = new TmfGraph(); return true; } subMonitor.worked(1); ICriticalPathAlgorithm cp = getAlgorithm(graph); try { fCriticalPath = cp.compute(head, null); return true; } catch (CriticalPathAlgorithmException e) { Activator.getInstance().logError(NonNullUtils.nullToEmptyString(e.getMessage()), e); } subMonitor.done(); return false; }</code><technical_language>This is progress user sees Progress view is opened. progress in status bar this monitor remains 0% trace is fully processed. if graph builder module get a reference this monitor (could a split of 1 unit of work, receiver convert amount of work wants) report progress it</technical_language>

Target:
protected boolean executeAnalysis(final IProgressMonitor monitor) throws TmfAnalysisException { Object workerObj = getParameter(PARAM_WORKER); if (workerObj == null) { return false; } if (!(workerObj instanceof IGraphWorker)) { throw new IllegalStateException("Worker parameter must be an IGraphWorker"); } IGraphWorker worker = (IGraphWorker) workerObj; TmfGraphBuilderModule graphModule = fGraphModule; graphModule.schedule(); SubMonitor subMonitor = SubMonitor.convert(monitor, 10); subMonitor.setTaskName(NLS.bind(Messages.CriticalPathModule_waitingForGraph, graphModule.getName())); if (!graphModule.waitForCompletion(subMonitor)) { Activator.getInstance().logInfo("Critical path execution: graph building was cancelled. Results may not be accurate."); return false; } subMonitor.worked(8); TmfGraph graph = graphModule.getGraph(); if (graph == null) { throw new TmfAnalysisException("Critical Path analysis: graph " + graphModule.getName() + " is null"); } TmfVertex head = graph.getHead(worker); if (head == null) { fCriticalPath = new TmfGraph(); return true; } subMonitor.worked(1); ICriticalPathAlgorithm cp = getAlgorithm(graph); try { fCriticalPath = cp.compute(head, null); return true; } catch (CriticalPathAlgorithmException e) { Activator.getInstance().logError(NonNullUtils.nullToEmptyString(e.getMessage()), e); } subMonitor.done(); return false; }
Source:
<code>private void refreshGeoRepSessionStatus(final VDSGroup cluster, List<GlusterGeoRepSession> geoRepSessions) { List<Callable<GlusterGeoRepSession>> geoRepSessionCalls = new ArrayList<>(); for (final GlusterGeoRepSession geoRepSession: geoRepSessions) { geoRepSessionCalls.add(new Callable<GlusterGeoRepSession>() { @Override public GlusterGeoRepSession call() throws Exception { geoRepSession.setSessionDetails((ArrayList) getSessionDetailFromCLI(cluster, geoRepSession)); return geoRepSession; } }); } <START> <END> List<GlusterGeoRepSession> updatedSessions = ThreadPoolUtil.invokeAll(geoRepSessionCalls); if (updatedSessions == null) { return; } for (GlusterGeoRepSession updatedSession : updatedSessions) { if (updatedSession.getSessionDetails() == null) { log.info("Geo-replication session details not updated for session '{}' as there was error returning data from VDS", updatedSession.getSessionKey()); continue; } try (EngineLock lock = acquireGeoRepSessionLock(updatedSession.getId())) { GlusterVolumeEntity masterVolume = getVolumeDao().getById(updatedSession.getMasterVolumeId()); updateGeoRepStatus(masterVolume, updatedSession); getGeoRepDao().updateSession(updatedSession); updateSessionDetailsInDB(updatedSession); } } }</code><technical_language>I updatedSessions list geoRepSessions</technical_language>

Target:
private void refreshGeoRepSessionStatus(final VDSGroup cluster, List<GlusterGeoRepSession> geoRepSessions) { if (geoRepSessions == null || geoRepSessions.isEmpty()) { return; } List<Callable<GlusterGeoRepSession>> geoRepSessionCalls = new ArrayList<>(); for (final GlusterGeoRepSession geoRepSession: geoRepSessions) { geoRepSessionCalls.add(new Callable<GlusterGeoRepSession>() { @Override public GlusterGeoRepSession call() throws Exception { geoRepSession.setSessionDetails((ArrayList) getSessionDetailFromCLI(cluster, geoRepSession)); return geoRepSession; } }); } List<GlusterGeoRepSession> updatedSessions = ThreadPoolUtil.invokeAll(geoRepSessionCalls); for (GlusterGeoRepSession updatedSession : updatedSessions) { if (updatedSession.getSessionDetails() == null) { log.info("Geo-replication session details not updated for session '{}' as there was error returning data from VDS", updatedSession.getSessionKey()); continue; } try (EngineLock lock = acquireGeoRepSessionLock(updatedSession.getId())) { GlusterVolumeEntity masterVolume = getVolumeDao().getById(updatedSession.getMasterVolumeId()); updateGeoRepStatus(masterVolume, updatedSession); getGeoRepDao().updateSession(updatedSession); updateSessionDetailsInDB(updatedSession); } } }
Source:
<code><START> public void setHostAndPort(final HostAndPort hostAndPort) { <END> jedisSocketFactory.setHost(hostAndPort.getHost()); jedisSocketFactory.setPort(hostAndPort.getPort()); }</code><technical_language>This synchronized for reliablity is AtomicReference</technical_language>

Target:
public void setHostAndPort(final HostAndPort hostAndPort) { JedisSocketFactory newFactory = jedisSocketFactory.get().copy(); newFactory.setHost(hostAndPort.getHost()); newFactory.setPort(hostAndPort.getPort()); jedisSocketFactory.set(newFactory); }
Source:
<code>PrimitiveConverter(Class <T> clazz, Function<String, T> toValue) { <START> this.clazz = clazz; <END> this.toValue = toValue; }</code><technical_language>suggestion this.clazz = Objects.requireNonNull(clazz);</technical_language>

Target:
PrimitiveConverter(Class <T> clazz, Function<String, T> toValue) { this.clazz = Objects.requireNonNull(clazz); this.toValue = toValue; }
Source:
<code>public void getAllReviewsForExpertMustReturnEmptyListIfNoReviewsHaveBeenSubmitted() { Integer expertId = 1; DiseaseGroup diseaseGroup = createDiseaseGroup(); List<DiseaseOccurrenceReview> reviews = diseaseOccurrenceReviewDao.getByExpertIdAndDiseaseGroupId(expertId, diseaseGroup.getId()); assertThat(reviews).isEmpty(); <START> assertThat(reviews).hasSize(0); <END> assertThat(reviews).isNotNull(); }</code><technical_language>This line removed I (does previous line)</technical_language>

Target:
public void getAllReviewsForExpertMustReturnEmptyListIfNoReviewsHaveBeenSubmitted() { Integer expertId = 1; DiseaseGroup diseaseGroup = createDiseaseGroup(); List<DiseaseOccurrenceReview> reviews = diseaseOccurrenceReviewDao.getByExpertIdAndDiseaseGroupId(expertId, diseaseGroup.getId()); assertThat(reviews).isNotNull(); assertThat(reviews).isEmpty(); }
Source:
<code><START> public QueryDefinition replaceQuery(KieServerConnectionInfo connectionInfo, QueryDefinition queryDefinition) { <END> Client client = ClientBuilder.newClient(); WebTarget target = requestForQueryDefinition(connectionInfo, queryDefinition.getName(), client); return target.request() .accept(MEDIA_TYPE) .put(Entity.entity(queryDefinition, MEDIA_TYPE), QueryDefinition.class); }</code><technical_language>need a client.close() end of this method</technical_language>

Target:
public QueryDefinition replaceQuery(KieServerConnectionInfo connectionInfo, QueryDefinition queryDefinition) { Client client = ClientBuilder.newClient(); WebTarget target = requestForQueryDefinition(connectionInfo, queryDefinition.getName(), client); QueryDefinition def = target.request() .accept(REQUEST_MEDIA_TYPE) .put(Entity.entity(queryDefinition, REQUEST_MEDIA_TYPE), QueryDefinition.class); client.close(); return def; }
Source:
<code>@Test public void initializerBlockInRightPlace() { TypeSpec taco = TypeSpec.classBuilder("Taco") .addField(String.class, "mFoo", Modifier.PRIVATE) .addField(String.class, "FOO", Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL) .addStaticBlock(CodeBlock.builder() .addStatement("FOO = $S", "FOO") .build()) .addMethod(MethodSpec.constructorBuilder().build()) .addMethod(MethodSpec.methodBuilder("toString") .addAnnotation(Override.class) .addModifiers(Modifier.PUBLIC) .returns(String.class) .addCode("return FOO;\n") .build()) .addInitializerBlock(CodeBlock.builder() .addStatement("mFoo = $S", "FOO") .build()) .build(); assertThat(toString(taco)).isEqualTo("" + "package com.squareup.tacos;\n" + "\n" + "import java.lang.Override;\n" + "import java.lang.String;\n" + "\n" + "class Taco {\n" + " private static final String FOO;\n\n" + " static {\n" + " FOO = \"FOO\";\n" + " }\n\n" <START> + " private String mFoo;\n\n" <END> + " {\n" + " mFoo = \"FOO\";\n" + " }\n\n" + " Taco() {\n" + " }\n\n" + " @Override\n" + " public String toString() {\n" + " return FOO;\n" + " }\n" + "}\n"); }</code><technical_language>m prefix, disgusting</technical_language>

Target:
@Test public void initializerBlockInRightPlace() { TypeSpec taco = TypeSpec.classBuilder("Taco") .addField(String.class, "foo", Modifier.PRIVATE) .addField(String.class, "FOO", Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL) .addStaticBlock(CodeBlock.builder() .addStatement("FOO = $S", "FOO") .build()) .addMethod(MethodSpec.constructorBuilder().build()) .addMethod(MethodSpec.methodBuilder("toString") .addAnnotation(Override.class) .addModifiers(Modifier.PUBLIC) .returns(String.class) .addCode("return FOO;\n") .build()) .addInitializerBlock(CodeBlock.builder() .addStatement("foo = $S", "FOO") .build()) .build(); assertThat(toString(taco)).isEqualTo("" + "package com.squareup.tacos;\n" + "\n" + "import java.lang.Override;\n" + "import java.lang.String;\n" + "\n" + "class Taco {\n" + " private static final String FOO;\n" + "\n" + " static {\n" + " FOO = \"FOO\";\n" + " }\n" + "\n" + " private String foo;\n" + "\n" + " {\n" + " foo = \"FOO\";\n" + " }\n" + "\n" + " Taco() {\n" + " }\n" + "\n" + " @Override\n" + " public String toString() {\n" + " return FOO;\n" + " }\n" + "}\n"); }
Source:
<code>void fun() { Object test = new Object[]{"1"}; <START> String[] test2 = new Object[]{"1"}; <END> Object[] test3 = new String[]{"1"}; System.out.println(((Object[])test)[0]); System.out.println(((Object[])test2)[0]); System.out.println(((String[])test3)[0]); }</code><technical_language>compile, important</technical_language>

Target:
void fun() { Object test = new Object[]{"1"}; String[] test2 = new String[]{"1"}; Object[] test3 = new String[]{"1"}; System.out.println(((Object[])test)[0]); System.out.println(((Object[])test2)[0]); System.out.println(((String[])test3)[0]); }
Source:
<code><START> CRSConstraint() { <END> }</code><technical_language>Empty constructor, public modifier</technical_language>

Target:
public CRSConstraint() { }
Source:
<code>public IBinding unmarshalBinding(ITypeMarshalBuffer buffer) throws CoreException { short firstBytes= buffer.getShort(); switch ((firstBytes & ITypeMarshalBuffer.KIND_MASK)) { case ITypeMarshalBuffer.UNKNOWN_MEMBER: return CPPUnknownMember.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.UNKNOWN_MEMBER_CLASS_INSTANCE: return CPPUnknownClassInstance.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.DEFERRED_CLASS_INSTANCE: return CPPDeferredClassInstance.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.DEFERRED_FUNCTION: return CPPDeferredFunction.unmarshal(firstBytes, buffer); case ITypeMarshalBuffer.DEPENDENT_EXPRESSION_TYPE: IType type= TypeOfDependentExpression.unmarshal(firstBytes, buffer); if (type instanceof IBinding) return (IBinding) type; <START> break; <END> } throw new CoreException(CCorePlugin.createStatus("Cannot unmarshal a binding, first bytes=" + firstBytes)); }</code><technical_language>new ProblemBinding(null, ISemanticProblem.TYPE_NOT_PERSISTED) returned here</technical_language>

Target:
public IBinding unmarshalBinding(ITypeMarshalBuffer buffer) throws CoreException { short firstBytes= buffer.getShort(); switch ((firstBytes & ITypeMarshalBuffer.KIND_MASK)) { case ITypeMarshalBuffer.UNKNOWN_MEMBER: return CPPUnknownMember.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.UNKNOWN_MEMBER_CLASS_INSTANCE: return CPPUnknownClassInstance.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.DEFERRED_CLASS_INSTANCE: return CPPDeferredClassInstance.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.DEFERRED_FUNCTION: return CPPDeferredFunction.unmarshal(firstBytes, buffer); case ITypeMarshalBuffer.DEPENDENT_EXPRESSION_TYPE: IType type= TypeOfDependentExpression.unmarshal(firstBytes, buffer); if (type instanceof IBinding) return (IBinding) type; return new ProblemBinding(null, ISemanticProblem.TYPE_NOT_PERSISTED); } throw new CoreException(CCorePlugin.createStatus("Cannot unmarshal a binding, first bytes=" + firstBytes)); }
Source:
<code>public List<Folder> findSubFoldersRecursively(Host host, User user, boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { if (!permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read Host " + host.getHostname()); } List<Folder> subFolders = folderFactory.findFoldersByHost(host); <START> List<Folder> toIterateOver = new ArrayList<Folder>(subFolders); <END> for (Folder f : toIterateOver) { if (permissionAPI.doesUserHavePermission(f, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { subFolders.addAll(findSubFoldersRecursively(f, user, respectFrontEndPermissions)); } } return subFolders; }</code><technical_language>of stream</technical_language>

Target:
public List<Folder> findSubFoldersRecursively(Host host, User user, boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { if (!this.permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read Host " + host.getHostname()); } List<Folder> subFolders = folderFactory.findFoldersByHost(host); List<Folder> toIterateOver = new ArrayList<Folder>(subFolders); for (Folder subFolder : toIterateOver) { if (doesUserHavePermissions(subFolder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { subFolders.addAll(findSubFoldersRecursively(subFolder, user, respectFrontEndPermissions)); } } return subFolders; }
Source:
<code>public String toString() { <START> return "None"; <END> }</code><technical_language>This worse default implementation inherited Object</technical_language>

Target:
public String toString() { return "NoPointSensitivity"; }
Source:
<code>private void resortFreeVariables() { final List<CalculatorVariable> resortedVariables = new ArrayList<>(); String chars = ""; for (final CalculatorVariable equ : equations) { chars = chars.concat(equ.getExpression()); } <START> for (int i = 0; i<chars.length(); i++) { <END> final char ch = chars.charAt(i); if ('a' <= ch && ch <= 'z') { if (findVariable(ch, resortedVariables) != null) { continue; } CalculatorVariable thisVariable = findVariable(ch, freeVariables); if (thisVariable == null) { thisVariable = new CalculatorVariable(getContext(), new CalculatorVariable.VariableData(ch), getString(R.string.free_variable_hint), new VariableWatcher()); } resortedVariables.add(thisVariable); } } freeVariables = resortedVariables; updateGrid(freeVariables, variableGrid, equations.size()); }</code><technical_language>here, please add spaces <. no, I Codacy shows java for (int i=0 ; i<chars.length() ; i++) { spaces =</technical_language>

Target:
private void resortFreeVariables() { String equationStrings = ""; for (final CalculatorVariable equ : equations) { equationStrings = equationStrings.concat(equ.getExpression()); } freeVariables = sortVariables(freeVariables, equationStrings, new Range('a', 'z'), getString(R.string.free_variable_hint), new VariableWatcher()); updateGrid(freeVariables, variableGrid, equations.size()); }
Source:
<code>public DbUser getDirectoryUser(DbUser dbUser) { DbUser directoryUser = null; try { ExtensionProxy authzExtension = EngineExtensionsManager.getInstance().getExtensionByName(dbUser.getDomain()); Collection<ExtMap> principalRecords = AuthzUtils.findPrincipalsByIds( authzExtension, dbUser.getNamespace(), Arrays.asList(dbUser.getExternalId()), true, true); if (!principalRecords.isEmpty()) { <START> directoryUser = DirectoryUtils.mapPrincipalRecordToDbUser(dbUser.getDomain(), principalRecords.iterator().next()); <END> directoryUser.setAdmin(dbUser.isAdmin()); directoryUser.setActive(dbUser.isActive()); } } catch (Exception ex) { log.error("Error during user synchronization of extension '{}': {}", dbUser.getDomain(), ex.getMessage()); log.debug("Exception", ex); } return directoryUser == null ? dbUser : directoryUser; }</code><technical_language>this function is good for database, while present principal record flatten. I groups if can, principal record extract group names</technical_language>

Target:
public DbUser getDirectoryUser(DbUser dbUser) { DbUser directoryUser = null; try { ExtensionProxy authzExtension = EngineExtensionsManager.getInstance().getExtensionByName(dbUser.getDomain()); Collection<ExtMap> principalRecords = AuthzUtils.findPrincipalsByIds( authzExtension, dbUser.getNamespace(), Arrays.asList(dbUser.getExternalId()), true, true); if (!principalRecords.isEmpty()) { directoryUser = DirectoryUtils.mapPrincipalRecordToDbUser(dbUser.getDomain(), principalRecords.iterator().next()); directoryUser.setAdmin(dbUser.isAdmin()); directoryUser.setActive(dbUser.isActive()); } } catch (Exception ex) { log.error("Error retrieving user from directory '{}': {}", dbUser.getDomain(), ex.getMessage()); log.debug("Exception", ex); } return directoryUser == null ? dbUser : directoryUser; }
Source:
<code>private void assertValidOpenAppEvent(AppOpenEventDto request) { if (request.operatingSystemStr == null) { Require.isNull(request.appVersion, () -> InvalidDataException.extraProperty("appVersion", <START> "If the operating system is provided, the other properties must be present too")); <END> Require.that(request.appVersionCode == 0, () -> InvalidDataException.extraProperty("appVersionCode", "If the operating system is provided, the other properties must be present too")); } else { Require.isNonNull(request.appVersion, () -> InvalidDataException.missingProperty("appVersion", "If the operating system is not provided, the other properties should not be provided either")); Require.that(request.appVersionCode != 0, () -> InvalidDataException.missingProperty("appVersionCode", "If the operating system is not provided, the other properties should not be provided either")); } }</code><technical_language>I text "If operating system is provided, ..." this text in other branch of if</technical_language>

Target:
private void assertValidOpenAppEvent(AppOpenEventDto request) { if (request.operatingSystemStr == null) { Require.isNull(request.appVersion, () -> InvalidDataException.extraProperty("appVersion", "If the operating system is not provided, the other properties should not be provided either")); Require.that(request.appVersionCode == 0, () -> InvalidDataException.extraProperty("appVersionCode", "If the operating system is not provided, the other properties should not be provided either")); } else { Require.isNonNull(request.appVersion, () -> InvalidDataException.missingProperty("appVersion", "If the operating system is provided, the other properties must be present too")); Require.that(request.appVersionCode != 0, () -> InvalidDataException.missingProperty("appVersionCode", "If the operating system is provided, the other properties must be present too")); } }
Source:
<code>public List<ConfigMessage> validateTransaction(TransactionConfig config) { List<ConfigMessage> messages = new ArrayList<ConfigMessage>(); if (config.getFilter() == null || (config.getFilter().getInclusions().isEmpty() && config.getFilter().getInclusions().isEmpty())) { ConfigMessage cm = new ConfigMessage(); cm.setMessage(NO_FILTERS); messages.add(cm); } for (Processor processor : config.getProcessors()) { for (ProcessorAction action : processor.getActions()) { ProcessorActionHandler handler = ProcessorActionHandlerFactory.getHandler(action); if (handler != null) { handler.init(processor); } } } <START> return messages; <END> }</code><technical_language>This part is required - need a for handler.init method able record issues returned ConfigMessages REST serivce UI display errors. need done ProcessorIssue Issue class - some (possibly ConfigMessage itself) get errors init method</technical_language>

Target:
public List<ConfigMessage> validateTransaction(TransactionConfig config) { List<ConfigMessage> messages = new ArrayList<ConfigMessage>(); if (config.getFilter() == null || (config.getFilter().getInclusions().isEmpty() && config.getFilter().getInclusions().isEmpty())) { ConfigMessage cm = new ConfigMessage(); cm.setMessage(NO_FILTERS); messages.add(cm); } for (Processor processor : config.getProcessors()) { for (ProcessorAction action : processor.getActions()) { ProcessorActionHandler handler = ProcessorActionHandlerFactory.getHandler(action); if (handler != null) { messages.addAll(handler.init(processor)); } } } return messages; }
Source:
<code>private int executeTool(Connection conn, ConnectionQueryServices queryServices, Configuration conf) { LOGGER.info("Executing " + operation); for (Map.Entry<String, HashSet<String>> entry :tablesAndIndexes.entrySet()) { String dataTableFullName = entry.getKey(); HashSet<String> indexes = entry.getValue(); try (Admin admin = queryServices.getAdmin()) { PTable dataTable = PhoenixRuntime.getTableNoCache(conn, dataTableFullName); LOGGER.info("Executing " + operation + " for " + dataTableFullName); boolean mutable = !(dataTable.isImmutableRows()); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); <START> if (!mutable) { <END> LOGGER.info("Data table is immutable, waiting for " + (GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) + " minutes for client cache to expire"); if (!test) { Thread.sleep((GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) * 60 * 1000); } } enableTable(admin, dataTableFullName, indexes); rebuildIndexes(conn, conf, dataTableFullName); LOGGER.info("Completed " + operation + " for " + dataTableFullName); } catch (IOException | SQLException | InterruptedException e) { LOGGER.severe("Something went wrong while executing " + operation + " steps " + e); return -1; } } return 0; }</code><technical_language>Also, I a single sleep for batch of tables</technical_language>

Target:
private int executeTool(Connection conn, ConnectionQueryServices queryServices, Configuration conf) { LOGGER.info("Executing " + operation); for (Map.Entry<String, HashSet<String>> entry :tablesAndIndexes.entrySet()) { String dataTableFullName = entry.getKey(); HashSet<String> indexes = entry.getValue(); try (Admin admin = queryServices.getAdmin()) { PTable dataTable = PhoenixRuntime.getTableNoCache(conn, dataTableFullName); LOGGER.info("Executing " + operation + " of " + dataTableFullName); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); if (dataTable.isImmutableRows()) { LOGGER.info(dataTableFullName + " is an immutable table, waiting for " + (GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) + " minutes for client cache to expire"); if (!(test || dryRun || indexes.isEmpty())) { try { Thread.sleep((GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) * 60 * 1000); } catch (InterruptedException e) { LOGGER.warning("Sleep before starting index rebuild interrupted. " + e.getMessage()); } } } enableTable(admin, dataTableFullName, indexes); LOGGER.info("Completed " + operation + " of " + dataTableFullName); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while executing " + operation + " steps " + e); return -1; } } if (upgrade) { for (String dataTableFullName : tablesAndIndexes.keySet()) { rebuildIndexes(conn, conf, dataTableFullName); LOGGER.info("Started index rebuild post " + operation + " of " + dataTableFullName); } } return 0; }
Source:
<code>public boolean nextKeyValue() throws IOException, InterruptedException { if (!rows.hasNext() || (fileRowLimitMap.get(file.getName()) == 0)) { return false; } StringBuilder sb = new StringBuilder(); Row row = rows.next(); Iterator<Cell> cellIterator = row.cellIterator(); sb.append(row.getRowNum()).append(CELL_SEPERATION); sb.append(file).append(CELL_SEPERATION); sb.append(row.getSheet().getSheetName()).append(CELL_SEPERATION); int count = fileRowLimitMap.get(file.getName()); if (fileRowLimitMap.get(file.getName()) - 1 == 0 || !rows.hasNext()) { sb.append(END).append(CELL_SEPERATION); <START> <END> } else { sb.append(MID).append(CELL_SEPERATION); } fileRowLimitMap.put(file.getName(), count - 1); key = new LongWritable(rowIdx); while (cellIterator.hasNext()) { Cell cell = cellIterator.next(); String colName = CellReference.convertNumToColString(cell.getColumnIndex()); switch (cell.getCellType()) { case Cell.CELL_TYPE_STRING: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getStringCellValue()).append(CELL_SEPERATION); break; case Cell.CELL_TYPE_BOOLEAN: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getBooleanCellValue()).append(CELL_SEPERATION); break; case Cell.CELL_TYPE_NUMERIC: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getNumericCellValue()).append(CELL_SEPERATION); break; } } value = new Text(sb.toString()); rowIdx++; return true; }</code><technical_language>Remove line</technical_language>

Target:
public boolean nextKeyValue() throws IOException, InterruptedException { if (!rows.hasNext() || rowCount == 0) { return false; } StringBuilder sb = new StringBuilder(); Row row = rows.next(); Iterator<Cell> cellIterator = row.cellIterator(); sb.append(row.getRowNum()).append(CELL_SEPERATION); sb.append(file).append(CELL_SEPERATION); sb.append(row.getSheet().getSheetName()).append(CELL_SEPERATION); if (rowCount - 1 == 0 || !rows.hasNext()) { sb.append(END).append(CELL_SEPERATION); } else { sb.append(MID).append(CELL_SEPERATION); } rowCount--; key = new LongWritable(rowIdx); while (cellIterator.hasNext()) { Cell cell = cellIterator.next(); String colName = CellReference.convertNumToColString(cell.getColumnIndex()); switch (cell.getCellType()) { case Cell.CELL_TYPE_STRING: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getStringCellValue()).append(CELL_SEPERATION); break; case Cell.CELL_TYPE_BOOLEAN: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getBooleanCellValue()).append(CELL_SEPERATION); break; case Cell.CELL_TYPE_NUMERIC: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getNumericCellValue()).append(CELL_SEPERATION); break; } } value = new Text(sb.toString()); rowIdx++; return true; }
Source:
<code>private Map<String, String> getCurrentExtras(MasterConfig masterConfig, Configuration configuration, Cluster cluster) { Map<String, String> extras = new HashMap<String, String>(); extras.put(Properties.PROPERTY_CONFIG_NAME, configuration.name); extras.put(Properties.PROPERTY_CLUSTER_SIZE, String.valueOf(cluster.getSize())); extras.put(Properties.PROPERTY_CLUSTER_MAX_SIZE, String.valueOf(masterConfig.getMaxClusterSize())); extras.put(Properties.PROPERTY_PLUGIN_NAME, "__no-plugin"); extras.put(Properties.PROPERTY_GROUP_NAME, "__master"); extras.put(Properties.PROPERTY_GROUP_SIZE, "0"); for (Cluster.Group group : cluster.getGroups()) { extras.put(Properties.PROPERTY_GROUP_PREFIX + group.name + Properties.PROPERTY_SIZE_SUFFIX, String.valueOf(group.size)); } extras.put(Properties.PROPERTY_SLAVE_INDEX, "-1"); extras.put(Properties.PROPERTY_PROCESS_ID, String.valueOf(Utils.getProcessID())); <START> configuration.getSetups().forEach(setup -> <END> setup.getEnvironment().forEach((k, v) -> { extras.put(k, v.toString()); }) ); return extras; }</code><technical_language>I understand this change: envs referenced ${env.MY_VAR}</technical_language>

Target:
private Map<String, String> getCurrentExtras(MasterConfig masterConfig, Configuration configuration, Cluster cluster) { Map<String, String> extras = new HashMap<String, String>(); extras.put(Properties.PROPERTY_CONFIG_NAME, configuration.name); extras.put(Properties.PROPERTY_CLUSTER_SIZE, String.valueOf(cluster.getSize())); extras.put(Properties.PROPERTY_CLUSTER_MAX_SIZE, String.valueOf(masterConfig.getMaxClusterSize())); extras.put(Properties.PROPERTY_PLUGIN_NAME, "__no-plugin"); extras.put(Properties.PROPERTY_GROUP_NAME, "__master"); extras.put(Properties.PROPERTY_GROUP_SIZE, "0"); for (Cluster.Group group : cluster.getGroups()) { extras.put(Properties.PROPERTY_GROUP_PREFIX + group.name + Properties.PROPERTY_SIZE_SUFFIX, String.valueOf(group.size)); } extras.put(Properties.PROPERTY_SLAVE_INDEX, "-1"); extras.put(Properties.PROPERTY_PROCESS_ID, String.valueOf(Utils.getProcessID())); return extras; }
Source:
<code>private void zoomToLocation() { if (locationManager != null && !isAnimating) { isAnimating = true; Location myLoc = locationManager.getLastKnownLocation(locationManager.getBestProvider(new Criteria(), false)); if (myLoc == null) return; LatLng myLatLng = new LatLng(myLoc.getLatitude(), myLoc.getLongitude()); <START> LogHelper.d("NearbyFrag", "animateCamera:onStart"); <END> mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myLatLng, 17), new GoogleMap.CancelableCallback() { @Override public void onFinish() { LogHelper.d("NearbyFrag", "animateCamera:onFinish"); isAnimating = false; } @Override public void onCancel() { LogHelper.d("NearbyFrag", "animateCamera:onCancel"); isAnimating = false; } }); } }</code><technical_language>already-defined constant 'TAG' instead of duplicating here</technical_language>

Target:
private void zoomToLocation() { if (locationManager != null && !isAnimating) { isAnimating = true; Location myLoc = locationManager.getLastKnownLocation(locationManager.getBestProvider(new Criteria(), false)); if (myLoc == null) return; LatLng myLatLng = new LatLng(myLoc.getLatitude(), myLoc.getLongitude()); LogHelper.d(TAG, "animateCamera:onStart"); mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myLatLng, 17), new GoogleMap.CancelableCallback() { @Override public void onFinish() { LogHelper.d(TAG, "animateCamera:onFinish"); isAnimating = false; } @Override public void onCancel() { LogHelper.d(TAG, "animateCamera:onCancel"); isAnimating = false; } }); } }
Source:
<code>public boolean isPage404(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.OK_200) || isCustomPage(msg, CustomPage.Type.ERROR_500)) { return false; } return isCustomPage(msg, CustomPage.Type.NOTFOUND_404) ? true <START> : msg.getResponseHeader().getStatusCode() == HttpStatusCode.NOT_FOUND; <END> }</code><technical_language>branch covered</technical_language>

Target:
public boolean isPage404(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.OK_200) || isCustomPage(msg, CustomPage.Type.ERROR_500)) { return false; } if (isCustomPage(msg, CustomPage.Type.NOTFOUND_404)) { return true; } return msg.getResponseHeader().getStatusCode() == HttpStatusCode.NOT_FOUND; }