auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void stepExecutionWithCredentialsAndQueueItemAuthenticator() throws Exception { assumeNotWindows(); r.getInstance().setSecurityRealm(r.createDummySecurityRealm()); MockAuthorizationStrategy auth = new MockAuthorizationStrategy() .grant(Jenkins.READ).everywhere().to("alice") .grant(Computer.BUILD).everywhere().to("alice") <START> .grant(Item.CONFIGURE).everywhere().to("alice"); <END> r.getInstance().setAuthorizationStrategy(auth); IdCredentials registryCredentials = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, "registryCreds", null, "me", "pass"); CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), registryCredentials); WorkflowJob p = r.createProject(WorkflowJob.class, "prj"); p.setDefinition(new CpsFlowDefinition( "node {\n" + " mockDockerLoginWithEcho {\n" + " withDockerRegistry(url: 'https://my-reg:1234', credentialsId: 'registryCreds') {\n" + " echo 'config would be set up to connect to https://my-reg:1234'\n" + " }\n" + " }\n" + "}", true)); QueueItemAuthenticatorConfiguration.get().getAuthenticators().replace(new MockQueueItemAuthenticator( Collections.singletonMap(p.getName(), User.getById("alice", true).impersonate()))); WorkflowRun b; try (ACLContext as = ACL.as(User.getById("alice", false))) { b = r.buildAndAssertSuccess(p); } r.assertLogContains("docker login -u me -p pass https://my-reg:1234", b); r.assertLogContains("config would be set up to connect to https://my-reg:1234", b); }</code><technical_language>I guess for purposes of this test FullControlOnceLoggedInAuthorizationStrategy .grant(Jenkins.ADMINISTER).everywhere().toAuthenticated() ACL checks part of test, I misunderstanding nature of problem</technical_language>

Target:
public void stepExecutionWithCredentialsAndQueueItemAuthenticator() throws Exception { assumeNotWindows(); r.getInstance().setSecurityRealm(r.createDummySecurityRealm()); MockAuthorizationStrategy auth = new MockAuthorizationStrategy() .grant(Jenkins.READ).everywhere().to("alice") .grant(Computer.BUILD).everywhere().to("alice") .grant(Item.CONFIGURE).everywhere().to("alice"); r.getInstance().setAuthorizationStrategy(auth); IdCredentials registryCredentials = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, "registryCreds", null, "me", "pass"); CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), registryCredentials); WorkflowJob p = r.createProject(WorkflowJob.class, "prj"); p.setDefinition(new CpsFlowDefinition( "node {\n" + " mockDockerLoginWithEcho {\n" + " withDockerRegistry(url: 'https://my-reg:1234', credentialsId: 'registryCreds') {\n" + " }\n" + " }\n" + "}", true)); QueueItemAuthenticatorConfiguration.get().getAuthenticators().replace(new MockQueueItemAuthenticator( Collections.singletonMap(p.getName(), User.getById("alice", true).impersonate()))); WorkflowRun b; try (ACLContext as = ACL.as(User.getById("alice", false))) { b = r.buildAndAssertSuccess(p); } r.assertLogContains("docker login -u me -p pass https://my-reg:1234", b); }
Source:
<code>public DeviceFingerprintComponent deviceFingerprintUserAgentComponent() { final UserAgent properties = casProperties.getAuthn().getMfa().getTrusted().getDeviceFingerprint().getUserAgent(); if (properties.isEnabled()) { final UserAgentDeviceFingerprintComponent component = new UserAgentDeviceFingerprintComponent(); component.setOrder(properties.getOrder()); return component; } else { <START> return DeviceFingerprintComponent.noOp(); <END> } }</code><technical_language>(Also note else clauses redundant)</technical_language>

Target:
public DeviceFingerprintComponentExtractor deviceFingerprintUserAgentComponent() { final UserAgent properties = casProperties.getAuthn().getMfa().getTrusted().getDeviceFingerprint().getUserAgent(); if (properties.isEnabled()) { final UserAgentDeviceFingerprintComponentExtractor component = new UserAgentDeviceFingerprintComponentExtractor(); component.setOrder(properties.getOrder()); return component; } LOGGER.info("User-Agent is not being included when creating MFA Trusted Device Fingerprints"); return DeviceFingerprintComponentExtractor.noOp(); }
Source:
<code>public void createChannel() throws Exception { final Account current = gd.getAccountService().getCurrent(); channel = gd.getNotificationService().createChannel(current, new ChannelConfiguration( <START> new EmailConfiguration(current.getEmail()), <END> new Meta("test channel"))); assertThat(channel, is(notNullValue())); }</code><technical_language>sth removeChannel in @After method</technical_language>

Target:
public void createChannel() throws Exception { final Account current = gd.getAccountService().getCurrent(); channel = gd.getNotificationService().createChannel(current, new Channel( new EmailConfiguration(current.getEmail()), "test channel")); assertThat(channel, is(notNullValue())); }
Source:
<code>public void testGeneration() { GameRegistry.registerWorldGenerator(this, 0); try { CubeGeneratorsRegistry.computeSortedGeneratorList(); } catch (Throwable e) { <START> fail("CubeGeneratorsRegistry failed on attempt to extract fields"); <END> } CubeGeneratorsRegistry.generateWorld(null, null, null); if (!testPassed) { fail("CubeGeneratorsRegistry failed to generate list"); } }</code><technical_language>reason catch explicitly call fail(), fail exception is thrown</technical_language>

Target:
public void testGeneration() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { ICubicWorldGenerator generator = mock(ICubicWorldGenerator.class); GameRegistry.registerWorldGenerator(generator, 0); CubeGeneratorsRegistry.computeSortedGeneratorList(); CubeGeneratorsRegistry.generateWorld(null, null, null); verify(generator).generate(null, null, null); }
Source:
<code>private void performTransactionFailover(String key, int breakNodeIdx, int initiatingNodeIdx) throws IgniteCheckedException { IgniteTransactions ts = grid(initiatingNodeIdx).transactions(); IgniteCache<String, Integer> cache = jcache(initiatingNodeIdx); <START> Transaction tx = ts.txStart(transactionConcurrency, transactionIsolation); <END> cache.put(key, 1); tx.suspend(); G.stop(ignite(breakNodeIdx).name(), true); Assert.assertNull(ts.tx()); IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(new Callable<Boolean>() { @Override public Boolean call() throws Exception { Assert.assertNull(ts.tx()); Assert.assertEquals(TransactionState.SUSPENDED, tx.state()); tx.resume(); Assert.assertEquals(TransactionState.ACTIVE, tx.state()); tx.commit(); return true; } }); fut.get(); }</code><technical_language>'ts' means timestamp Please rename "transactions"</technical_language>

Target:
private void performTransactionFailover(String key, int breakNodeIdx, int initiatingNodeIdx) throws IgniteCheckedException { final IgniteTransactions transactions = grid(initiatingNodeIdx).transactions(); IgniteCache<String, Integer> cache = jcache(initiatingNodeIdx); final Transaction tx = transactions.txStart(TransactionConcurrency.OPTIMISTIC, transactionIsolation); cache.put(key, 1); tx.suspend(); G.stop(ignite(breakNodeIdx).name(), true); assertNull(transactions.tx()); IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(new Callable<Boolean>() { @Override public Boolean call() throws Exception { assertNull(transactions.tx()); assertEquals(TransactionState.SUSPENDED, tx.state()); tx.resume(); assertEquals(TransactionState.ACTIVE, tx.state()); tx.commit(); return true; } }); fut.get(); }
Source:
<code>public String configList(File workingDirectory, List<String> extraArgs) throws IOException, InterruptedException { List<String> args = new ArrayList<>(); for (String arg : extraArgs) { <START> if (!"--verbose".equals(arg)) { <END> args.add(arg); } } return runCommand(workingDirectory, new String[]{"c", "ls", "--json"}, args); }</code><technical_language>Please consideration other verbose variations: Info: -d, --loglevel info Verbose: -dd, --loglevel verbose Silly: -ddd, --loglevel silly</technical_language>

Target:
public String configList(File workingDirectory, List<String> extraArgs) throws IOException, InterruptedException { List<String> args = new ArrayList<>(extraArgs); args.add("-s"); return runCommand(workingDirectory, new String[]{"c", "ls", "--json"}, args); }
Source:
<code>public PojoInnerJoin(int num, Class<?> outClass, String... keys) { super(outClass,keys); <START> <END> }</code><technical_language>Ctor line 38 (i.e. ctor) call new ctor of super</technical_language>

Target:
public PojoInnerJoin(int num, Class<?> outClass, String... keys) { this.outClass = outClass; if (keys.length % 2 != 0) { throw new IllegalArgumentException("Wrong number of keys."); } this.leftKeys = new String[keys.length / 2]; this.rightKeys = new String[keys.length / 2]; for (int i = 0,j = 0; i < keys.length; i = i + 2, j++) { this.leftKeys[j] = keys[i]; this.rightKeys[j] = keys[i + 1]; } }
Source:
<code>public String toString() { <START> return "catalog: " + catName + "database:" + dbName + ", table:" + tblName + ", column:" + <END> colName; }</code><technical_language>Missing comma, - ", database"</technical_language>

Target:
public String toString() { return "catalog: " + catName + ", database:" + dbName + ", table:" + tblName + ", column:" + colName; }
Source:
<code>List<Definitions> getOtherDMNDiagramsDefinitions(final Metadata metadata) { final List<Path> diagramPaths = pathsHelper.getDMNModelsPaths(getProject(metadata)); <START> <END> return diagramPaths .stream() .filter(path -> !Objects.equals(metadata.getPath(), path)) .map(path -> loadPath(path).map(this::toInputStreamReader).map(marshaller::unmarshal).orElse(null)) .filter(Objects::nonNull) .collect(Collectors.toList()); }</code><technical_language>Do close InputStreamReader now</technical_language>

Target:
List<Definitions> getOtherDMNDiagramsDefinitions(final Metadata metadata) { final List<Path> diagramPaths = pathsHelper.getDMNModelsPaths(getProject(metadata)); return diagramPaths .stream() .filter(path -> !Objects.equals(metadata.getPath(), path)) .map(path -> loadPath(path).orElse(null)) .filter(Objects::nonNull) .map(this::toDefinitions) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
<code>public boolean intersects(Vector3f position, float radius) { <START> for (int i = 0; i < 6; i++) { <END> if (planes[i].getA() * position.x + planes[i].getB() * position.y + planes[i].getC() * position.z + planes[i].getD() <= -radius) { return false; } } return true; }</code><technical_language>deprecated method redirect new get rid of duplication: return intersects(JomlUtil.from(position), radius);</technical_language>

Target:
public boolean intersects(Vector3f position, float radius) { return intersects(JomlUtil.from(position), radius); }
Source:
<code>public void testClearMigratingToVds() throws Exception { Guid vmId = new Guid("77296e00-0cad-4e5a-9299-008a7b6f4356"); VmDynamic vmDynamic = dao.get(vmId); assertNotNull("migrating_to_vds field should not be null before we clear it", vmDynamic.getMigratingToVds()); dao.clearMigratingToVds(vmId); vmDynamic = dao.get(vmId); <START> assertNull("migrating_to_vds field should not be null after we clear it", <END> vmDynamic.getMigratingToVds()); }</code><technical_language>null? is question</technical_language>

Target:
public void testClearMigratingToVds() throws Exception { Guid vmId = new Guid("77296e00-0cad-4e5a-9299-008a7b6f4356"); VmDynamic vmDynamic = dao.get(vmId); assertNotNull("migrating_to_vds field should not be null before we clear it", vmDynamic.getMigratingToVds()); dao.clearMigratingToVds(vmId); vmDynamic = dao.get(vmId); assertNull("migrating_to_vds field should be null after we clear it", vmDynamic.getMigratingToVds()); }
Source:
<code>public static void clearTemporaryAttachmentsCache(Context context){ File cacheDir = context.getCacheDir(); File tempAttachmentsDirectory = new File(cacheDir.getPath() + "/tempAttachments/"); if(tempAttachmentsDirectory.exists()){ try { FileUtils.cleanDirectory(tempAttachmentsDirectory); } catch (IOException e) { <START> e.printStackTrace(); <END> } } }</code><technical_language>Unhandled error case. Again, code for temporary file storage. that</technical_language>

Target:
public static void clearTemporaryAttachmentsCache(Context context) { File cacheDir = context.getCacheDir(); File tempAttachmentsDirectory = new File(cacheDir.getPath() + RESIZED_ATTACHMENTS_TEMPORARY_DIRECTORY); if (tempAttachmentsDirectory.exists()) { try { FileUtils.cleanDirectory(tempAttachmentsDirectory); } catch (IOException e) { Timber.e(e, "Error occurred while cleaning temporary directory for resized attachments"); } } }
Source:
<code>public void close() throws Exception { for (ErrorReporter reporter : reporters) { <START> reporter.close(); <END> } }</code><technical_language>exception caused reporter break this loop. exception throw reporters closed</technical_language>

Target:
public void close() { ConnectException e = null; for (ErrorReporter reporter : reporters) { try { reporter.close(); } catch (Throwable t) { e = e != null ? e : new ConnectException("Failed to close all reporters"); e.addSuppressed(t); } } if (e != null) { throw e; } }
Source:
<code>public String putIfAbsent(String key, String value) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(value, "'value' must not be null."); Object result = this.properties.putIfAbsent(key, value); if (result != null) { <START> Assert.isInstanceOf(String.class, "This metadata store can only operate on String values"); <END> } return (String) result; }</code><technical_language>??? Assert.isInstanceOf(String.class, result, "This metadata store operate String values"); ? shuld similar assert added get remove</technical_language>

Target:
public String putIfAbsent(String key, String value) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(value, "'value' must not be null."); Object oldValue = this.properties.putIfAbsent(key, value); if (oldValue != null) { Assert.isInstanceOf(String.class, oldValue, "Invalid type in the store"); } return (String) oldValue; }
Source:
<code>public static String readDefaultMenuValueFromClasspath() { <START> return new Scanner(MenuUtils.class.getResourceAsStream("/molgenis_ui.json")) <END> .useDelimiter("\\A") .next(); }</code><technical_language>please describe this magic constant in docs</technical_language>

Target:
public static String readDefaultMenuValueFromClasspath() { return new Scanner(MenuUtils.class.getResourceAsStream(DEFAULT_MENU_RESOURCE_NAME)) .useDelimiter(START_OF_STRING) .next(); }
Source:
<code>public static void registerClipboardFormat(ClipboardFormat format) { checkNotNull(format); for (String key : format.getAliases()) { <START> aliasMap.put(key.toLowerCase(Locale.ENGLISH), format); <END> } registeredFormats.add(format); }</code><technical_language>this registered formats absolute priority, potentially making earlier registered formats inaccessible if aliases overlap..</technical_language>

Target:
public static void registerClipboardFormat(ClipboardFormat format) { checkNotNull(format); for (String key : format.getAliases()) { String lowKey = key.toLowerCase(Locale.ENGLISH); ClipboardFormat old = aliasMap.put(lowKey, format); if (old != null) { aliasMap.put(lowKey, old); WorldEdit.logger.warning(format.getClass().getName() + " cannot override existing alias '" + lowKey + "' used by " + old.getClass().getName()); } } for (String ext : format.getFileExtensions()) { String lowExt = ext.toLowerCase(Locale.ENGLISH); fileExtensionMap.put(lowExt, format); } registeredFormats.add(format); }
Source:
<code>private IStatus saveImpl(Writer bw, IProgressMonitor monitor) { ExportToTextRequest request = new ExportToTextRequest(bw, filter); trace.sendRequest(request); int currentIndex = 0; while (!request.isCompleted()) { if (monitor.isCanceled()) { request.cancel(); return Status.CANCEL_STATUS; } <START> int index = (int) (request.getNbRead() * 100 / trace.getNbEvents()); <END> if (index > currentIndex) { int progress = index - currentIndex; monitor.worked(progress); currentIndex = index; } try { Thread.sleep(100); } catch (InterruptedException e) { } } if (request.isFailed()) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination), request.getIOException()); return status; } return Status.OK_STATUS; }</code><technical_language>a constant for 100, re-use beginning of run()</technical_language>

Target:
private IStatus saveImpl(Writer bw, IProgressMonitor monitor) { ExportToTextRequest request = new ExportToTextRequest(bw, fFilter, fTable); fTrace.sendRequest(request); int currentIndex = 0; while (!request.isCompleted()) { if (monitor.isCanceled()) { request.cancel(); return Status.CANCEL_STATUS; } int index = (int) (request.getNbRead() * TOTAL_WORK / fTrace.getNbEvents()); if (index > currentIndex) { int progress = index - currentIndex; monitor.worked(progress); currentIndex = index; } try { Thread.sleep(SLEEPING_INTERVAL); } catch (InterruptedException e) { } } if (request.isFailed()) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination), request.getIOException()); return status; } return Status.OK_STATUS; }
Source:
<code><START> protected TupleBatch fetchNextReady() throws DbException, IOException { <END> final Operator child = getChild(); if (child.eos()) { return getResultBatch(); } TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { int rowHash = HashUtils.hashSubRow(tb, gfields, row); IntArrayList hashMatches = groupKeyMap.get(rowHash); if (hashMatches == null) { hashMatches = newKey(rowHash); newGroup(tb, row, hashMatches); continue; } boolean found = false; for (int i = 0; i < hashMatches.size(); i++) { int value = hashMatches.get(i); if (TupleUtils.tupleEquals(tb, gfields, row, groupKeys, grpRange, value)) { addBitSet(row, value); updateGroup(tb, row, aggStates.get(value)); found = true; break; } } if (!found) { newGroup(tb, row, hashMatches); } Preconditions.checkState(groupKeys.numTuples() == aggStates.size()); } updateGroups(tb); tb = child.nextReady(); } if (child.eos()) { return getResultBatch(); } return null; }</code><technical_language>this IOException</technical_language>

Target:
protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); if (child.eos()) { return getResultBatch(); } TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { int rowHash = HashUtils.hashSubRow(tb, gfields, row); IntArrayList hashMatches = groupKeyMap.get(rowHash); if (hashMatches == null) { hashMatches = newKey(rowHash); newGroup(tb, row, hashMatches); continue; } boolean found = false; for (int i = 0; i < hashMatches.size(); i++) { int value = hashMatches.get(i); if (TupleUtils.tupleEquals(tb, gfields, row, groupKeys, grpRange, value)) { addBitSet(row, value); updateGroup(tb, row, aggStates.get(value)); found = true; break; } } if (!found) { newGroup(tb, row, hashMatches); } Preconditions.checkState(groupKeys.numTuples() == aggStates.size()); } updateGroups(tb); tb = child.nextReady(); } if (child.eos()) { return getResultBatch(); } return null; }
Source:
<code>public IClientRouter addClient(IClient client) { client.setRouter(this); try { client.getHandledTypes() .forEach(x -> { handlerMap.put(x, client); log.trace("Registered to handle messages of type {}", client, x); }); <START> } catch (Exception ex) { } <END> if (!client.getHandledCases().isEmpty()) { client.getHandledCases() .forEach(x -> { responseHandlerMap.put(x, client); log.trace("Registered to handle protobuf messages of type {}", client, x); }); } if (!client.getHandledErrors().isEmpty()) { client.getHandledErrors() .forEach(x -> { errorHandlerMap.put(x, client); log.trace("Registered to handle server error of type {}", client, x); }); } clientList.add(client); return this; }</code><technical_language>instead catching exceptions ignore unsupported operation log it? Also, this issue pushed in new BaseServer changes</technical_language>

Target:
public IClientRouter addClient(IClient client) { client.setRouter(this); try { client.getHandledTypes() .forEach(x -> { handlerMap.put(x, client); log.trace("Registered to handle messages of type {}", client, x); }); } catch (UnsupportedOperationException ex) { log.error("No registered CorfuMsg handler for client {}", client, ex); } if (!client.getHandledCases().isEmpty()) { client.getHandledCases() .forEach(x -> { responseHandlerMap.put(x, client); log.trace("Registered to handle protobuf messages of type {}", client, x); }); } if (!client.getHandledErrors().isEmpty()) { client.getHandledErrors() .forEach(x -> { errorHandlerMap.put(x, client); log.trace("Registered to handle server error of type {}", client, x); }); } clientList.add(client); return this; }
Source:
<code>public void copyToDirectByteBufferFromReadPageCursorMustCheckBounds() throws Exception { configureStandardPageCache(); <START> ByteBuffer buffer = ByteBuffer.allocate( filePageSize ); <END> File file = file( "a" ); generateFileWithRecords( file, recordsPerFilePage, recordSize ); try ( PagedFile pf = pageCache.map( file, filePageSize ); PageCursor cursor = pf.io( 0, PF_SHARED_READ_LOCK ) ) { assertTrue( cursor.next() ); verifyCopyToBufferBounds( cursor, buffer ); } }</code><technical_language>No, tests explicitly copying to/from _direct_ byte buffers</technical_language>

Target:
public void copyToDirectByteBufferFromReadPageCursorMustCheckBounds() throws Exception { configureStandardPageCache(); ByteBuffer buffer = ByteBuffer.allocateDirect( filePageSize ); File file = file( "a" ); generateFileWithRecords( file, recordsPerFilePage, recordSize ); try ( PagedFile pf = pageCache.map( file, filePageSize ); PageCursor cursor = pf.io( 0, PF_SHARED_READ_LOCK ) ) { assertTrue( cursor.next() ); verifyCopyToBufferBounds( cursor, buffer ); } }
Source:
<code>private void load(Properties props) { <START> enabled = props.get(ENABLED) != null ? Boolean.parseBoolean((String) props.get(ENABLED)) : true; <END> context.put(ExtensionProperties.CONFIGURATION, props); context.put(ExtensionProperties.NAME, props.getProperty(NAME)); context.put(ExtensionProperties.PROVIDES, props.getProperty(PROVIDES)); }</code><technical_language>put strings..</technical_language>

Target:
private void load(Properties props) { enabled = props.get(ENABLED) != null ? Boolean.parseBoolean(props.getProperty(ENABLED)) : true; context.put(ExtensionProperties.CONFIGURATION, props); context.put(ExtensionProperties.NAME, props.getProperty(NAME)); context.put(ExtensionProperties.PROVIDES, props.getProperty(PROVIDES)); }
Source:
<code>protected void appendRespondant() { try { logic.addStudentRespondant(getUserEmailForCourse(), feedbackSessionName, courseId); } catch (InvalidParametersException | EntityDoesNotExistException e) { <START> Assumption.fail("Fail to append student respondant"); <END> } }</code><technical_language>drastic do Assumption.fail here. submission is saved, right? log severe level admin email, instead of Assumption.fail</technical_language>

Target:
protected void appendRespondant() { try { logic.addStudentRespondant(getUserEmailForCourse(), feedbackSessionName, courseId); } catch (InvalidParametersException | EntityDoesNotExistException e) { log.severe("Fail to append student respondant"); } }
Source:
<code>public void shouldParsePayIQConfirmationSegment() { String routingResponse = "{\"booking\":" + "{\"confirmation\":{\"status\":{\"title\":\"1min ticket\",\"subtitle\":\"Valid from Friday, 14 October, 23:01\"}," + "\"purchase\":{\"price\":0.009999999776482582,\"currency\":\"EUR\",\"productName\":\"1min ticket\"," + "\"productType\":\"pt_pub\",\"id\":\"5801398e87d4abf77d7a70bd\"}," + "\"actions\":[{\"title\":\"Show Ticket\",\"type\":\"QRCODE\"," + "\"externalURL\":\"qrcode:4f9550149c8912c040090000:5801398e87d4abf77d7a70bd:1min ticket:20161014200117:20161014200217:null:iqt\"," + "\"isDestructive\":false}]}," + "\"title\":\"1min ticket\"," + "\"url\":\"<LINK_0>\"}," + <START> "\"endTime\":1476475680,\"segmentTemplateHashCode\":-620371530,\"serviceDirection\":\"Lentoasema\",\"serviceName\":\"Lentoasema-Satama\",\"serviceNumber\":\"1\",\"serviceTripID\":\"14_260472\",\"startTime\":1476475560,\"stops\":2,\"ticketWebsiteURL\":\"<LINK_1>\"}"; <END> TripSegment segment =bookingGson().fromJson(routingResponse, TripSegment.class); assertThat(segment.getBooking()).isNotNull(); assertThat(segment.getBooking().getConfirmation()).isNotNull(); }</code><technical_language>Pls put a separate JSON file. Format JSON. In order read JSON string, use: java IOUtils.toString( getClass().getResourceAsStream(path), Charset.defaultCharset() );</technical_language>

Target:
public void shouldParsePayIQConfirmationSegment() throws IOException { String routingResponse = IOUtils.toString(getClass().getResourceAsStream("/booking-payiq.json")); TripSegment segment = bookingGson().fromJson(routingResponse, TripSegment.class); assertThat(segment.getBooking()).isNotNull(); assertThat(segment.getBooking().getConfirmation()).isNotNull(); }
Source:
<code>private void writeRepositoryState( SubscribedRepository repository, List<String> subscribeSpecs) throws IOException { for (Map.Entry<String, Ref> ref : repository.getPubSubRefs().entrySet()) { String refName = ref.getKey(); for (String spec : subscribeSpecs) { <START> if ((RefSpec.isWildcard(spec) && refName.startsWith( <END> spec.substring(0, spec.length() - 1))) || refName.equals(spec)) write("have " + ref.getValue().getLeaf().getObjectId().getName() + " " + refName); } } }</code><technical_language>i i change this more readable: if (RefSpec.isWildcard(spec) && !refName.startsWith( spec.substring(0, spec.length() - 1)) { continue; } else if (!refName.equals(spec)) { continue; } String objId = ref.getValue().getLeaf().getObjectId().getName(); write("have " + objId + " " + refName);</technical_language>

Target:
private void writeRepositoryState( SubscribedRepository repository, List<String> subscribeSpecs) throws IOException { for (Map.Entry<String, Ref> ref : repository.getPubSubRefs().entrySet()) { String refName = ref.getKey(); for (String spec : subscribeSpecs) { if (RefSpec.isWildcard(spec) && !refName.startsWith( spec.substring(0, spec.length() - 1))) continue; else if (!refName.equals(spec)) continue; String objId = ref.getValue().getLeaf().getObjectId().getName(); write("have " + objId + " " + refName); } } }
Source:
<code>public static double estimateScanSelectivity(Optimizable innerTable, OptimizablePredicateList predList, JoinPredicateType predicateType) throws StandardException { double selectivity = 1d; if (innerTable == null) { return selectivity; } for (int i = 0; i < predList.size(); i++) { Predicate p = (Predicate) predList.getOptPredicate(i); if (!p.isJoinPredicate()) continue; <START> <END> if (predicateType == JoinPredicateType.HASH_SEARCH || predicateType == JoinPredicateType.MERGE_SEARCH) { ValueNode valueNode = p.getAndNode().getLeftOperand(); if (valueNode instanceof BinaryRelationalOperatorNode) { BinaryRelationalOperatorNode bron = (BinaryRelationalOperatorNode) valueNode; if (bron.getOperator() != RelationalOperator.EQUALS_RELOP) { continue; } if (predicateType == JoinPredicateType.MERGE_SEARCH) { if (p.getIndexPosition() < 0) { continue; } else { if (!(bron.getLeftOperand() instanceof ColumnReference) || !(bron.getRightOperand() instanceof ColumnReference)) continue; } } } else continue; } selectivity *= p.scanSelectivity(innerTable); } return selectivity; }</code><technical_language>This block in estimateJoinSelectivity() equal, chance extracted auxiliary function</technical_language>

Target:
public static double estimateScanSelectivity(Optimizable innerTable, OptimizablePredicateList predList, JoinPredicateType predicateType) throws StandardException { double selectivity = 1d; if (innerTable == null) { return selectivity; } for (int i = 0; i < predList.size(); i++) { Predicate p = (Predicate) predList.getOptPredicate(i); if (!isTheRightJoinPredicate(p, predicateType)) continue; selectivity *= p.scanSelectivity(innerTable); } return selectivity; }
Source:
<code>public ExecRow call(ExecRow execRow) throws Exception { if (!initialized) { op = (SpliceOperation) getOperation(); initialized = true; } this.operationContext.recordRead(); op.setCurrentRow(execRow); this.operationContext.recordProduced(); <START> if(!op.isForUpdate()) { <END> execRow.setKey(null); } return execRow; }</code><technical_language>I this is case, for</technical_language>

Target:
public ExecRow call(ExecRow execRow) throws Exception { if (!initialized) { op = getOperation(); initialized = true; } this.operationContext.recordRead(); op.setCurrentRow(execRow); op.setCurrentRowLocation(execRow == null ? null : new HBaseRowLocation(execRow.getKey())); this.operationContext.recordProduced(); if(execRow != null) { if (!op.isForUpdate()) { execRow.setKey(null); execRow.setBaseRowCols(null); } else { ExecRow baseRow = locatorFunction.apply(operationContext); op.setCurrentBaseRowLocation(baseRow); execRow.setBaseRowCols(baseRow.getRowArray()); } } return execRow; }
Source:
<code>public void shouldBeOverdueWhenDueYesterday() throws Exception { Configuration config = new Configuration(); config.setValue("40"); config.setReferencePoint("end"); config.setAction("add"); Appraisal appraisal = new Appraisal(); DateTime endDate = new DateTime(); appraisal.setEndDate(endDate.plusDays(-41).toDate()); assert EvalsUtil.isOverdue(appraisal, config); <START> assert EvalsUtil.isDue(appraisal, config) < 0; <END> }</code><technical_language>Instead of testing for < 0, test for -1 code is behaving properly overdue code incorrectly calculating other -1</technical_language>

Target:
public void shouldBeOverdueWhenDueYesterday() throws Exception { Configuration config = new Configuration(); config.setValue("40"); config.setReferencePoint("end"); config.setAction("add"); Appraisal appraisal = new Appraisal(); DateTime endDate = new DateTime(); appraisal.setEndDate(endDate.plusDays(-41).toDate()); assert EvalsUtil.isOverdue(appraisal, config); assert EvalsUtil.isDue(appraisal, config) == -1; }
Source:
<code><START> public void getSourceTest() throws CandybeanException { <END> iface.go("<LINK_0>"); WebDriverElement searchBox = iface.getWebDriverElement(new Hook(Strategy.ID, "gbqfq")); Assert.assertEquals(searchBox.getCssValue("display"), "block"); }</code><technical_language>Ummm, this a duplicate of getCssValueTest() method above</technical_language>

Target:
public void getSourceTest() throws CandybeanException { iface.go("<LINK_0>"); WebDriverElement searchBox = iface.getWebDriverElement(new Hook(Strategy.ID, "lga")); String found = searchBox.getSource(); String expected = "id=\"hplogo\""; Assert.assertTrue("Src did not contain " + expected + "\nFound source:\n" + found, found.contains("id=\"hplogo\"")); }
Source:
<code>private Iterable<Ref> getSortedRefs() throws Exception { List<Ref> all = db.getRefDatabase().getRefsByPrefix(ALL); <START> if (all instanceof RefMap <END> || (all instanceof SortedMap && ((SortedMap) all).comparator() == null)) { return all; } return RefComparator.sort(all); }</code><technical_language>Thanks. Marking resolved</technical_language>

Target:
private Iterable<Ref> getSortedRefs() throws Exception { List<Ref> all = db.getRefDatabase().getRefsByPrefix(ALL); return RefComparator.sort(all); }
Source:
<code><START> public Collection<Action> getActions() { <END> return Collections.unmodifiableCollection(configuration.getActions()); }</code><technical_language>do need this</technical_language>

Target:
protected Collection<Action> getActions() { return Collections.unmodifiableCollection(configuration.getActions()); }
Source:
<code>private static HTableFactory getDefaultHTableFactory() { <START> return new HTableFactory.HTableFactoryImpl(); <END> }</code><technical_language>I this a singleton. Otherwise, good. Please tests pass pull in. run tests a "mvn package". Thanks</technical_language>

Target:
private static HTableFactory getDefaultHTableFactory() { return DEFAULT; }
Source:
<code>public synchronized void process(WatchedEvent event) { log.debug("event {}", event.getPath(), event.getType(), event.getState()); watchingParent = false; if (event.getState() == KeeperState.Expired && lock != null) { lostLock(LockLossReason.SESSION_EXPIRED); } else { try { zooKeeper.getStatus(path, this); watchingParent = true; } catch (KeeperException.ConnectionLossException ex) { log.warn("lost connection to zookeeper"); } catch (Exception ex) { if (lock != null || asyncLock != null) { lockWatcher.unableToMonitorLockNode(ex); <START> log.error("Error resetting watch on ZooLock " + lock + " " + event, ex); <END> } } } }</code><technical_language>This is a log message if lock == null; logs asyncLock info in case. about: suggestion log.error("Error resetting watch ZooLock {}", lock != null ? lock : asyncLock, event, ex);</technical_language>

Target:
public synchronized void process(WatchedEvent event) { log.debug("event {}", event.getPath(), event.getType(), event.getState()); watchingParent = false; if (event.getState() == KeeperState.Expired && lock != null) { lostLock(LockLossReason.SESSION_EXPIRED); } else { try { zooKeeper.getStatus(path, this); watchingParent = true; } catch (KeeperException.ConnectionLossException ex) { log.warn("lost connection to zookeeper"); } catch (Exception ex) { if (lock != null || asyncLock != null) { lockWatcher.unableToMonitorLockNode(ex); log.error("Error resetting watch on ZooLock {}", lock != null ? lock : asyncLock, event, ex); } } } }
Source:
<code>private PlanNodeCostEstimate calculateJoinCost(PlanNode probe, PlanNode build, boolean replicated) { if (replicated) { PlanNodeCostEstimate replicateCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), REPLICATE, REMOTE); PlanNodeCostEstimate localRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), REPARTITION, LOCAL); return replicateCost.add(localRepartitionCost); } else { PlanNodeCostEstimate probeCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(probe), REPARTITION, REMOTE); PlanNodeCostEstimate buildRemoteRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), REPARTITION, REMOTE); PlanNodeCostEstimate buildLocalRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( <START> numberOfNodes, <END> getStats(build), REPARTITION, LOCAL); return probeCost .add(buildRemoteRepartitionCost) .add(buildLocalRepartitionCost); } }</code><technical_language>redundant else block</technical_language>

Target:
private PlanNodeCostEstimate calculateJoinCost(PlanNode probe, PlanNode build, boolean replicated) { if (replicated) { PlanNodeCostEstimate replicateCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), build.getOutputSymbols(), REPLICATE, REMOTE); PlanNodeCostEstimate localRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), build.getOutputSymbols(), REPARTITION, LOCAL); return replicateCost.add(localRepartitionCost); } else { PlanNodeCostEstimate probeCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(probe), probe.getOutputSymbols(), REPARTITION, REMOTE); PlanNodeCostEstimate buildRemoteRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), build.getOutputSymbols(), REPARTITION, REMOTE); PlanNodeCostEstimate buildLocalRepartitionCost = CostCalculatorUsingExchanges.calculateExchangeCost( numberOfNodes, getStats(build), build.getOutputSymbols(), REPARTITION, LOCAL); return probeCost .add(buildRemoteRepartitionCost) .add(buildLocalRepartitionCost); } }
Source:
<code>protected void cacheForever(final HttpServletResponse rsp) { final long now = System.currentTimeMillis(); <START> rsp.setHeader("Cache-Control", "public, max-age=31536000"); <END> rsp.setDateHeader("Expires", now + 31536000000L); rsp.setDateHeader("Date", now); }</code><technical_language>above; reason do max-age= here</technical_language>

Target:
protected void cacheForever(final HttpServletResponse rsp) { final long now = System.currentTimeMillis(); rsp.setDateHeader(HDR_DATE, now); rsp.setDateHeader(HDR_EXPIRES, now + 31536000000L); rsp.setHeader(HDR_CACHE_CONTROL, "public, max-age=31536000"); }
Source:
<code>public void init() { subscribeTo(PythonGrammar.FUNCDEF); cognitiveComplexity.init(); <START> astWalker = new AstWalker(cognitiveComplexity); <END> }</code><technical_language>@vilchik-elena com.sonar.sslr.impl.ast.AstWalker is part of public API of SSLR. However, another "secondary" visitors</technical_language>

Target:
public void init() { subscribeTo( PythonGrammar.IF_STMT, PythonKeyword.ELIF, PythonKeyword.ELSE, PythonGrammar.WHILE_STMT, PythonGrammar.FOR_STMT, PythonGrammar.EXCEPT_CLAUSE, PythonGrammar.AND_TEST, PythonGrammar.OR_TEST, PythonGrammar.TEST, PythonGrammar.FUNCDEF, PythonGrammar.SUITE); }
Source:
<code>private boolean connectFileStorageServers(StorageType storageType, List<StorageServerConnections> connections) { Map<StorageDomainType, List<StorageServerConnections>> connByType = connections.stream() .collect(Collectors.groupingBy(c -> storageDomainDao.getAllByConnectionId(Guid.createGuidFromString( c.getId())).get(0) .getStorageDomainType())); boolean connectSucceeded = <START> connectStorageServer(storageType, <END> connByType.get(StorageDomainType.Data), true); connectStorageServerIgnoreFailure(storageType, connByType.get(StorageDomainType.ISO), StorageDomainType.ISO); connectStorageServerIgnoreFailure(storageType, connByType.get(StorageDomainType.ImportExport), StorageDomainType.ImportExport); return connectSucceeded; }</code><technical_language>if exception is thrown here, ISO ExportImport connect. I this call move end of method</technical_language>

Target:
private boolean connectFileStorageServers(StorageType storageType, List<StorageServerConnections> connections) { Map<StorageDomainType, List<StorageServerConnections>> connByType = connections.stream() .collect(Collectors.groupingBy(c -> storageDomainDao.getAllByConnectionId(Guid.createGuidFromString( c.getId())).get(0) .getStorageDomainType())); boolean connectSucceeded = connectStorageServer(storageType, connByType.get(StorageDomainType.Master), true); connectSucceeded &= connectStorageServer(storageType, connByType.get(StorageDomainType.Data), true); connectStorageServerIgnoreFailure(storageType, connByType.get(StorageDomainType.ISO), StorageDomainType.ISO); connectStorageServerIgnoreFailure(storageType, connByType.get(StorageDomainType.ImportExport), StorageDomainType.ImportExport); return connectSucceeded; }
Source:
<code>public void close() throws IOException { boolean done = isDone(); <START> baseYielder.close(); <END> if (done) { executor.execute(runnable); } }</code><technical_language>Behavior is if baseYielder.close() throws exception - runnable longer execute. Is intentional</technical_language>

Target:
public void close() throws IOException { boolean done = isDone(); Throwable thrown = null; try { baseYielder.close(); } catch (Throwable t) { thrown = t; throw t; } finally { if (done) { if (thrown != null) { try { executor.execute(runnable); } catch (Throwable t) { thrown.addSuppressed(t); } } else { executor.execute(runnable); } } } }
Source:
<code>public void testWriteReadStatisticsAllNulls() throws Exception { File testFile = new File("target/test/TestParquetFileWriter/testParquetFile").getAbsoluteFile(); testFile.delete(); writeSchema = "message example {\n" + "required binary content;\n" + "}"; Path path = new Path(testFile.toURI()); MessageType schema = MessageTypeParser.parseMessageType(writeSchema); Configuration configuration = new Configuration(); GroupWriteSupport.setSchema(schema, configuration); ParquetWriter<Group> writer = new ParquetWriter<Group>(path, configuration, new GroupWriteSupport()); Group r1 = new SimpleGroup(schema); writer.write(r1); writer.close(); ParquetMetadata readFooter = ParquetFileReader.readFooter(configuration, path); for (BlockMetaData block : readFooter.getBlocks()) { for (ColumnChunkMetaData col : block.getColumns()) { <START> col.getPath(); <END> } } { assertEquals(1, (readFooter.getBlocks().get(0).getColumns().get(0).getStatistics().getNumNulls())); } }</code><technical_language>this loop for if do is call getPath() ignore return value</technical_language>

Target:
public void testWriteReadStatisticsAllNulls() throws Exception { File testFile = new File("target/test/TestParquetFileWriter/testParquetFile").getAbsoluteFile(); testFile.delete(); writeSchema = "message example {\n" + "required binary content;\n" + "}"; Path path = new Path(testFile.toURI()); MessageType schema = MessageTypeParser.parseMessageType(writeSchema); Configuration configuration = new Configuration(); GroupWriteSupport.setSchema(schema, configuration); ParquetWriter<Group> writer = new ParquetWriter<Group>(path, configuration, new GroupWriteSupport()); Group r1 = new SimpleGroup(schema); writer.write(r1); writer.close(); ParquetMetadata readFooter = ParquetFileReader.readFooter(configuration, path); assertTrue((readFooter.getBlocks().get(0).getColumns().get(0).getStatistics().isEmpty()) == false); assertEquals(1, (readFooter.getBlocks().get(0).getColumns().get(0).getStatistics().getNumNulls())); }
Source:
<code>public void displayAvatarImage(String uri, ImageView imageView) { int prefSize = (int) (20 * Resources.getSystem().getDisplayMetrics().density); <START> Glide.with(context) <END> .load(uri) .listener(null) .override(prefSize, prefSize) .dontTransform() .error(R.drawable.ic_error) .into(imageView); }</code><technical_language>delete</technical_language>

Target:
public void displayAvatarImage(String uri, ImageView imageView) { }
Source:
<code>private <T extends GenericTimestampRecord> List<T> parsePage(byte[] data, Class<T> clazz) { PageHeader pageHeader = new PageHeader(data); List<T> records = Lists.newArrayList(); try { for (int i = 0; i < pageHeader.getNumOfRecords(); i++) { int startIdx; switch (pageHeader.getRecordType()) { case EGV_DATA: startIdx = PageHeader.HEADER_SIZE + (EGVRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new EGVRecord(Arrays.copyOfRange(data, startIdx, startIdx + EGVRecord.RECORD_SIZE)))); break; case CAL_SET: int recordLength = (pageHeader.getRevision() <= 2) ? CalRecord.RECORD_SIZE : CalRecord.RECORD_V2_SIZE; startIdx = PageHeader.HEADER_SIZE + (recordLength + 1) * i; records.add(clazz.cast(new CalRecord(Arrays.copyOfRange(data, startIdx, startIdx + recordLength)))); break; case METER_DATA: startIdx = PageHeader.HEADER_SIZE + (MeterRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new MeterRecord(Arrays.copyOfRange(data, startIdx, startIdx + MeterRecord.RECORD_SIZE)))); break; case SENSOR_DATA: startIdx = PageHeader.HEADER_SIZE + (SensorRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new SensorRecord(Arrays.copyOfRange(data, startIdx, startIdx + SensorRecord.RECORD_SIZE)))); break; default: throw new IllegalArgumentException(String.format("Unknown record type: %s", pageHeader.getRecordType().name())); } } } catch (IllegalArgumentException e) { e.printStackTrace(); } <START> return records; <END> }</code><technical_language>null checks calling this .size() checks</technical_language>

Target:
private <T extends GenericTimestampRecord> List<T> parsePage(byte[] data, Class<T> clazz) { PageHeader pageHeader = new PageHeader(data); List<T> records = new ArrayList<>(); try { for (int i = 0; i < pageHeader.getNumOfRecords(); i++) { int startIdx; switch (pageHeader.getRecordType()) { case EGV_DATA: startIdx = PageHeader.HEADER_SIZE + (EGVRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new EGVRecord(Arrays.copyOfRange(data, startIdx, startIdx + EGVRecord.RECORD_SIZE)))); break; case CAL_SET: int recordLength = (pageHeader.getRevision() <= 2) ? CalRecord.RECORD_SIZE : CalRecord.RECORD_V2_SIZE; startIdx = PageHeader.HEADER_SIZE + (recordLength + 1) * i; records.add(clazz.cast(new CalRecord(Arrays.copyOfRange(data, startIdx, startIdx + recordLength)))); break; case METER_DATA: startIdx = PageHeader.HEADER_SIZE + (MeterRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new MeterRecord(Arrays.copyOfRange(data, startIdx, startIdx + MeterRecord.RECORD_SIZE)))); break; case SENSOR_DATA: startIdx = PageHeader.HEADER_SIZE + (SensorRecord.RECORD_SIZE + 1) * i; records.add(clazz.cast(new SensorRecord(Arrays.copyOfRange(data, startIdx, startIdx + SensorRecord.RECORD_SIZE)))); break; default: throw new IllegalArgumentException(String.format("Unknown record type: %s", pageHeader.getRecordType().name())); } } } catch (IllegalArgumentException e) { e.printStackTrace(); } return records; }
Source:
<code>protected int getInsertRow(Comparator<RowItem> comparator, RowItem item) { int left = 1; int right = table.getRowCount() - 1; while (left <= right) { <START> int middle = (left + right) >>> 1; END> RowItem i = getRowItem(middle); int cmp = comparator.compare(i, item); if (cmp < 0) { left = middle + 1; } else if (cmp > 0) { right = middle - 1; } else { return -1; } } return left; }</code><technical_language>this c, is a reason do (left+right)/2</technical_language>

Target:
protected int getInsertRow(Comparator<RowItem> comparator, RowItem item) { int row = lookupRowItem(comparator, item); if (row >= table.getRowCount() || comparator.compare(item, getRowItem(row)) != 0) { return row; } return -1; }
Source:
<code>private void applyAccessibilityStyles() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); if (sharedPreferences.getBoolean("settings_accessibility_large_text", false)) { getTheme().applyStyle(R.style.FontSizeLarge, true); } if (sharedPreferences.getBoolean("settings_accessibility_high_contrast", false)) { getTheme().applyStyle(R.style.ContrastHigh, true); } if (sharedPreferences.getBoolean("settings_accessibility_element_spacing", false)) { getTheme().applyStyle(R.style.SpacingLarge, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons_high_contrast", false)) { getTheme().applyStyle(R.style.CategoryIconContrastHigh, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons", false)) { getTheme().applyStyle(R.style.CategoryIconVisible, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons_big", false)) { getTheme().applyStyle(R.style.CategoryIconSizeLarge, true); } @AccessibilitySettingsFragment.FontStyle <START> String fontStyle = sharedPreferences.getString("settings_accessibility_font_style", "regular"); <END> switch (fontStyle) { case AccessibilitySettingsFragment.SERIF: getTheme().applyStyle(R.style.FontSerif, true); break; case AccessibilitySettingsFragment.DYSLEXIC: getTheme().applyStyle(R.style.FontDyslexic, true); break; case AccessibilitySettingsFragment.SAUDI: getTheme().applyStyle(R.style.FontSaudi, true); break; case AccessibilitySettingsFragment.STC: getTheme().applyStyle(R.style.FontStc, true); break; default: break; } }</code><technical_language>AccessibilitySettingsFragment.REGULAR instead of "regular"</technical_language>

Target:
private void applyAccessibilityStyles() { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); if (sharedPreferences.getBoolean("settings_accessibility_large_text", false)) { getTheme().applyStyle(R.style.FontSizeLarge, true); } if (sharedPreferences.getBoolean("settings_accessibility_high_contrast", false)) { getTheme().applyStyle(R.style.ContrastHigh, true); } if (sharedPreferences.getBoolean("settings_accessibility_element_spacing", false)) { getTheme().applyStyle(R.style.SpacingLarge, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons_high_contrast", false)) { getTheme().applyStyle(R.style.CategoryIconContrastHigh, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons", false)) { getTheme().applyStyle(R.style.CategoryIconVisible, true); } if (sharedPreferences.getBoolean("settings_accessibility_category_icons_big", false)) { getTheme().applyStyle(R.style.CategoryIconSizeLarge, true); } @AccessibilitySettingsFragment.FontStyle String fontStyle = sharedPreferences.getString("settings_accessibility_font_style", AccessibilitySettingsFragment.REGULAR); switch (fontStyle) { case AccessibilitySettingsFragment.SERIF: getTheme().applyStyle(R.style.FontSerif, true); break; case AccessibilitySettingsFragment.DYSLEXIC: getTheme().applyStyle(R.style.FontDyslexic, true); break; default: break; } }