auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected int rwAnyNode(IASTNode node, int indirection) { final IASTNode parent= node.getParent(); if (parent instanceof ICASTFieldDesignator) { return WRITE; } else if (parent instanceof IASTIdExpression) { IASTNode grandparent = parent.getParent(); if (grandparent instanceof IASTArraySubscriptExpression) { return super.rwAnyNode(parent, 1); } else if (grandparent instanceof IASTUnaryExpression <START> && ((CASTUnaryExpression) grandparent).getOperator() == IASTUnaryExpression.op_star) { <END> return WRITE; } } return super.rwAnyNode(node, indirection); }</code><technical_language>IASTUnaryExpression instead of CASTUnaryExpression</technical_language>

Target:
protected int rwAnyNode(IASTNode node, int indirection) { final IASTNode parent= node.getParent(); if (parent instanceof ICASTFieldDesignator) { return WRITE; } return super.rwAnyNode(node, indirection); }
Source:
<code>protected boolean createDaemonThreads() { <START> return false; <END> }</code><technical_language>I suppose this true</technical_language>

Target:
protected boolean createDaemonThreads() { return true; }
Source:
<code>private void processInParallel(final List<ISourceModule> modules, int buildType, IBuildState state, final IScriptProject project, final IProgressMonitor monitor) { final Queue<ISourceModule> queue = new ArrayBlockingQueue<ISourceModule>( modules.size(), true, modules); int maxThreads = Math.min(modules.size() / 2, Runtime.getRuntime().availableProcessors()); List<Job> jobs = new ArrayList<Job>(maxThreads); try { for (int i = 0; i < maxThreads; i++) { Job job = new BuildModulesJob(queue, buildType, state); job.schedule(); jobs.add(job); } int lastNumberOfScannedFiles = 0; for (Job job : jobs) { while (!job.join(100, null)) { if (monitor.isCanceled()) { job.cancel(); <START> continue; <END> } int numberOfScannedFiles = modules.size() - queue.size(); monitor.subTask(NLS.bind( Messages.ValidatorBuilder_buildModuleSubTask, (int) ((numberOfScannedFiles * 100f) / modules.size()), project.getElementName())); int steps = numberOfScannedFiles - lastNumberOfScannedFiles; monitor.worked(steps); lastNumberOfScannedFiles += steps; } } } catch (OperationCanceledException e) { DLTKCore.error(e); } catch (InterruptedException e) { DLTKCore.error(e); } }</code><technical_language>cancel jobs break outer loop</technical_language>

Target:
private void processInParallel(final List<ISourceModule> modules, int buildType, IBuildState state, final IScriptProject project, final IProgressMonitor monitor) { final Queue<ISourceModule> queue = new ArrayBlockingQueue<ISourceModule>( modules.size(), true, modules); int maxThreads = Math.min(modules.size() / 2, Runtime.getRuntime().availableProcessors()); List<Job> jobs = new ArrayList<Job>(maxThreads); try { for (int i = 0; i < maxThreads; i++) { Job job = new BuildModulesJob(queue, buildType, state); job.schedule(); jobs.add(job); } int lastNumberOfScannedFiles = 0; for (Job job : jobs) { while (!job.join(100, null)) { if (monitor.isCanceled()) { for (Job tmpJob : jobs) { tmpJob.cancel(); } continue; } int numberOfScannedFiles = modules.size() - queue.size(); monitor.subTask(NLS.bind( Messages.ValidatorBuilder_buildModuleSubTask, (int) ((numberOfScannedFiles * 100f) / modules.size()), project.getElementName())); int steps = numberOfScannedFiles - lastNumberOfScannedFiles; monitor.worked(steps); lastNumberOfScannedFiles += steps; } } } catch (OperationCanceledException e) { DLTKCore.error(e); } catch (InterruptedException e) { DLTKCore.error(e); } }
Source:
<code>public void checkErrorMarkersInEditor() { <START> projectExplorer.openItemByPath(String.format("%s/%s", PROJECT_NAME, PATH_TO_POM_FILE)); <END> editor.waitActive(); editor.waitAllMarkersInvisibility(ERROR); editor.typeTextIntoEditor("q"); editor.goToPosition(1, 1); editor.waitMarkerInPosition(ERROR, 1); editor.typeTextIntoEditor(DELETE.toString()); editor.waitMarkerInvisibility(ERROR, 1); projectExplorer.openItemByPath(String.format("%s/%s", PROJECT_NAME, PATH_TO_JAVA_FILE)); editor.waitActive(); editor.waitAllMarkersInvisibility(ERROR); editor.setCursorToLine(12); editor.typeTextIntoEditor("q"); editor.goToPosition(12, 1); editor.waitMarkerInPosition(ERROR, 12); editor.typeTextIntoEditor(DELETE.toString()); editor.waitMarkerInvisibility(ERROR, 12); projectExplorer.openItemByPath(String.format("%s/%s", PROJECT_NAME, PATH_TO_TS_FILE)); editor.waitActive(); editor.typeTextIntoEditor("q"); editor.waitMarkerInPosition(ERROR, 1); }</code><technical_language>Constant</technical_language>

Target:
public void checkErrorMarkersInEditor() { projectExplorer.openItemByPath(PATH_TO_POM_FILE); editor.waitActive(); editor.waitAllMarkersInvisibility(ERROR); editor.typeTextIntoEditor("q"); editor.goToPosition(1, 1); editor.waitMarkerInPosition(ERROR, 1); editor.typeTextIntoEditor(DELETE.toString()); editor.waitMarkerInvisibility(ERROR, 1); projectExplorer.openItemByPath(PATH_TO_JAVA_FILE); editor.waitActive(); editor.waitAllMarkersInvisibility(ERROR); editor.setCursorToLine(12); editor.typeTextIntoEditor("q"); editor.goToPosition(12, 1); editor.waitMarkerInPosition(ERROR, 12); editor.typeTextIntoEditor(DELETE.toString()); editor.waitMarkerInvisibility(ERROR, 12); projectExplorer.openItemByPath(PATH_TO_TS_FILE); editor.waitActive(); editor.typeTextIntoEditor("q"); editor.waitMarkerInPosition(ERROR, 1); }
Source:
<code>protected void addItemFactory(ItemFactory itemFactory) { for (String itemTypeName : itemFactory.getSupportedItemTypes()) { Item item = itemFactory.createItem(itemTypeName, "tmp"); if (item != null) { acceptedCommandTypeMap.put(itemTypeName, item.getAcceptedCommandTypes()); <START> acceptedStateTypeMap.put(itemTypeName, item.getAcceptedDataTypes()); <END> } else { logger.error("Item factory suggested it can create items of type but returned null", itemFactory, itemTypeName); } } }</code><technical_language>Hm, cardinality "at one". code in remove item factory removes item type name respective maps. So, logic in removed acts a item type name exists in item factory only. If item factories item type name, exists in map is removed if item factory is removed. A simple solution maintain a collection injected item factories rebuild maps time a factory is added removed</technical_language>

Target:
protected void addItemFactory(ItemFactory itemFactory) { itemFactories.add(itemFactory); calculateAcceptedTypes(); }
Source:
<code>protected Optional<Fix> implicitToStringFix(ExpressionTree tree, VisitorState state) { <START> return Optional.empty(); <END> }</code><technical_language>if right enough of time, do for convenience. need automatically apply it</technical_language>

Target:
protected Optional<Fix> implicitToStringFix(ExpressionTree tree, VisitorState state) { return Optional.of(SuggestedFix.postfixWith(tree, ".get()")); }
Source:
<code>private static String getLibraryResourcePath(@NonNull String libraryName) { String path = LIBS_RES_PATH; final String osName = System.getProperty("os.name"); if (osName.contains("Linux")) { path += "/linux"; } else if (osName.contains("Mac")) { path += "/osx"; } else { path += "/" + osName; } String archName = System.getProperty("os.arch"); archName = archName.replaceAll("\\W", ""); archName = archName.replace("-", "_"); if (osName.contains("Windows")) { archName = "x86_64"; <START> } <END> path += '/' + archName; path += '/' + System.mapLibraryName(libraryName); return path; }</code><technical_language>Changed : String archName = null; if (osName.contains("Windows")) { archName = "x86_64"; } else { archName = System.getProperty("os.arch"); archName = archName.replaceAll("\\W", ""); archName = archName.replace("-", "_"); }</technical_language>

Target:
private static String getLibraryResourcePath(@NonNull String libraryName) { String path = LIBS_RES_PATH; final String osName = System.getProperty("os.name"); if (osName.contains("Linux")) { path += "/linux"; } else if (osName.contains("Mac")) { path += "/osx"; } else { path += "/" + osName; } String archName = null; if (osName.contains("Windows")) { archName = "x86_64"; } else { archName = System.getProperty("os.arch"); archName = archName.replaceAll("\\W", ""); archName = archName.replace("-", "_"); } path += '/' + archName; path += '/' + System.mapLibraryName(libraryName); return path; }
Source:
<code>private void logoutUserClick() { <START> viewModel.onLogoutClick(); <END> viewModel.getLogoutSuccess().observe(this, this::logoutSuccess); viewModel.getLogoutError().observe(this, this::logoutError); }</code><technical_language>register observers trigger action? - in this case I guess issue, I harm do anyways, it</technical_language>

Target:
private void logoutUserClick() { viewModel.getLogoutSuccess().observe(this, this::logoutSuccess); viewModel.getLogoutError().observe(this, this::logoutError); viewModel.onLogoutClick(); }
Source:
<code>private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) { StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size()); streamEvent.setType(ComplexEvent.Type.RESET); StateEvent stateEvent = stateEventPool.borrowEvent(); <START> if (eventType == MetaStreamEvent.EventType.AGGREGATE) { <END> stateEvent.addEvent(1, streamEvent); } else { stateEvent.addEvent(0, streamEvent); } stateEvent.setType(ComplexEvent.Type.RESET); ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>(true); complexEventChunk.add(stateEvent); return complexEventChunk; }</code><technical_language>this happen</technical_language>

Target:
private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) { StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size()); streamEvent.setType(ComplexEvent.Type.RESET); StateEvent stateEvent = stateEventPool.borrowEvent(); stateEvent.addEvent(0, streamEvent); stateEvent.setType(ComplexEvent.Type.RESET); ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>(true); complexEventChunk.add(stateEvent); return complexEventChunk; }
Source:
<code>public static String getModelFileWithGAV(ReleaseId releaseId) { <START> ReleaseIdImpl releaseIdImpl = (ReleaseIdImpl) releaseId; <END> return Paths.get(MODEL_FILE_DIRECTORY, releaseIdImpl.getGroupId(), releaseIdImpl.getArtifactId(), releaseIdImpl.getVersion(), MODEL_FILE_NAME).toString(); }</code><technical_language>I I need this cast. group artifact IDs accessible interface level. version is accessible, I add here: this is for multimodule project compilaton afaik modules GA version in project</technical_language>

Target:
public static String getModelFileWithGAV(ReleaseId releaseId) { return Paths.get(MODEL_FILE_DIRECTORY, releaseId.getGroupId(), releaseId.getArtifactId(), MODEL_FILE_NAME).toString(); }
Source:
<code>public static Map<String, Serializable> mapOfBase64StringToSerializable(Map<String, String> input) throws IOException, ClassNotFoundException { if (input == null) { return null; } HashMap<String, Serializable> answer = new HashMap<>(input.size()); for (Map.Entry<String, String> entry : input.entrySet()) { answer.put(entry.getKey(), base64StringToSerializable(entry.getValue())); } <START> return answer; <END> }</code><technical_language>replace this by: java return input.entrySet().stream.collect(Collectors.toMap(entry -> entry.getKey(), entry-> base64StringToSerializable(entry.getValue())));</technical_language>

Target:
public static Map<String, Serializable> mapOfBase64StringToSerializable(Map<String, String> input) { if (input == null) { return null; } HashMap<String, Serializable> answer = new HashMap<>(input.size()); input.forEach((key, value) -> { answer.put(key, base64StringToSerializable(value)); }); return answer; }
Source:
<code>public void close() throws SQLException { if (isClosed) { return; } try { clearMetrics(); try { if (traceScope != null) { traceScope.close(); } closeStatements(); if(childConnections != null) { <START> SQLCloseables.closeAllQuietly(childConnections); <END> } } finally { services.removeConnection(this); } } finally { isClosed = true; if(isInternalConnection()){ GLOBAL_OPEN_INTERNAL_PHOENIX_CONNECTIONS.decrement(); } else { GLOBAL_OPEN_PHOENIX_CONNECTIONS.decrement(); } } }</code><technical_language>This is guaranteed happen 1 thread a time I suppose? is care thread-safety of closeAllQuietly</technical_language>

Target:
public void close() throws SQLException { if (isClosed) { return; } try { clearMetrics(); try { if (traceScope != null) { traceScope.close(); } closeStatements(); synchronized (queueCreationLock) { if (childConnections != null) { SQLCloseables.closeAllQuietly(childConnections); } } } finally { services.removeConnection(this); } } finally { isClosed = true; if(isInternalConnection()){ GLOBAL_OPEN_INTERNAL_PHOENIX_CONNECTIONS.decrement(); } else { GLOBAL_OPEN_PHOENIX_CONNECTIONS.decrement(); } } }
Source:
<code>public void testLogEntrySyncWithTrim() throws Exception { final int RX_MESSAGES_LIMIT = 2; final int TRIM_RATIO = NUM_KEYS_LARGE - 20; setupEnv(); <START> log.info("Have setutEnv Done"); <END> openStreams(srcCorfuTables, srcDataRuntime, 1); openStreams(dstCorfuTables, dstDataRuntime, 1); generateTXData(srcCorfuTables, srcDataForVerification, NUM_KEYS_LARGE, srcDataRuntime, 0); expectedSinkReceivedMessages = RX_MESSAGES_LIMIT; LogReplicationFSM fsm = startLogEntrySync(srcCorfuTables.keySet(), WAIT.ON_SINK_RECEIVE, false); System.out.println("****** Trim log, will trigger a full snapshot sync"); Token toke = ckStreamsAndTrim(srcDataRuntime, srcCorfuTables); while (srcDataRuntime.getAddressSpaceView().getTrimMark().getSequence() < toke.getSequence()) { } System.out.println("****** Wait till IN_SNAPSHOT_SYNC"); checkStateChange(fsm, LogReplicationStateType.IN_SNAPSHOT_SYNC, true); System.out.println("Block untill full snapshot transfer complete"); checkStateChange(fsm, LogReplicationStateType.IN_LOG_ENTRY_SYNC, true); verifyData(dstCorfuTables, dstDataForVerification); cleanEnv(); }</code><technical_language>required</technical_language>

Target:
public void testLogEntrySyncWithTrim() throws Exception { final int RX_MESSAGES_LIMIT = 2; final int TRIM_RATIO = NUM_KEYS_LARGE - 20; setupEnv(); log.trace("Have setutEnv Done"); openStreams(srcCorfuTables, srcDataRuntime, 1); openStreams(dstCorfuTables, dstDataRuntime, 1); generateTXData(srcCorfuTables, srcDataForVerification, NUM_KEYS_LARGE, srcDataRuntime, 0); expectedSinkReceivedMessages = RX_MESSAGES_LIMIT; LogReplicationFSM fsm = startLogEntrySync(srcCorfuTables.keySet(), WAIT.ON_SINK_RECEIVE, false); System.out.println("****** Trim log, will trigger a full snapshot sync"); Token toke = ckStreamsAndTrim(srcDataRuntime, srcCorfuTables); while (srcDataRuntime.getAddressSpaceView().getTrimMark().getSequence() < toke.getSequence()) { } System.out.println("****** Wait till IN_SNAPSHOT_SYNC"); checkStateChange(fsm, LogReplicationStateType.IN_SNAPSHOT_SYNC, true); System.out.println("Block untill full snapshot transfer complete"); checkStateChange(fsm, LogReplicationStateType.IN_LOG_ENTRY_SYNC, true); verifyData(dstCorfuTables, dstDataForVerification); cleanEnv(); }
Source:
<code>public void testEnDecrypt() throws NoSuchAlgorithmException, IOException, NoSuchProviderException { <START> final KeyGenerator keygen = KeyGenerator.getInstance("AES", "BC"); <END> keygen.init(256); final SecretKey key = keygen.generateKey(); final byte[] keyBytes = key.getEncoded(); final File temp = File.createTempFile("secret", "key"); Files.write(temp.toPath(), keyBytes, StandardOpenOption.APPEND); final EncryptionService encryptionService = new EncryptionService(temp.getPath()); Assert.assertEquals("testje", new String(encryptionService.decrypt(encryptionService.encrypt("testje".getBytes())))); }</code><technical_language>AES BC constants. occur more once</technical_language>

Target:
public void testEnDecrypt() throws NoSuchAlgorithmException, IOException, NoSuchProviderException { final KeyGenerator keygen = KeyGenerator.getInstance(AES, BC); keygen.init(256); final SecretKey key = keygen.generateKey(); final byte[] keyBytes = key.getEncoded(); final File temp = File.createTempFile(SECRET, KEY2); Files.write(temp.toPath(), keyBytes, StandardOpenOption.APPEND); final EncryptionService encryptionService = new TestableEncService(temp.getPath()); Assert.assertEquals(TESTJE, new String(encryptionService.decrypt(encryptionService.encrypt(TESTJE.getBytes())))); }
Source:
<code>public void getDependencies_strictTraceId() { List<Span> mixedTrace = asList( <START> Span.builder().traceIdHigh(1L).traceId(1L).id(1L).name("get") <END> .addAnnotation(Annotation.create(TODAY * 1000, SERVER_RECV, WEB_ENDPOINT)) .addAnnotation(Annotation.create((TODAY + 350) * 1000, SERVER_SEND, WEB_ENDPOINT)) .build(), Span.builder().traceId(1L).parentId(1L).id(2L).name("get") .addAnnotation(Annotation.create((TODAY + 100) * 1000, SERVER_RECV, APP_ENDPOINT)) .addAnnotation(Annotation.create((TODAY + 250) * 1000, SERVER_SEND, APP_ENDPOINT)) .build(), Span.builder().traceIdHigh(1L).traceId(1L).parentId(1L).id(2L).name("get") .addAnnotation(Annotation.create((TODAY + 50) * 1000, CLIENT_SEND, WEB_ENDPOINT)) .addAnnotation(Annotation.create((TODAY + 300) * 1000, CLIENT_RECV, WEB_ENDPOINT)) .build() ); processDependencies(mixedTrace); assertThat(store().getDependencies(TODAY + 1000L, null)).containsOnly( DependencyLink.create("web", "app", 1) ); }</code><technical_language>OPT: extracting traceId in a constant, emphasize trace is supposed considered</technical_language>

Target:
public void getDependencies_strictTraceId() { long traceIdHigh = Long.MAX_VALUE; long traceId = Long.MIN_VALUE; List<Span> mixedTrace = asList( Span.builder().traceIdHigh(traceIdHigh).traceId(traceId).id(1L).name("get") .addAnnotation(Annotation.create(TODAY * 1000, SERVER_RECV, WEB_ENDPOINT)) .addAnnotation(Annotation.create((TODAY + 350) * 1000, SERVER_SEND, WEB_ENDPOINT)) .build(), Span.builder().traceId(traceId).parentId(1L).id(2L).name("get") .addAnnotation(Annotation.create((TODAY + 100) * 1000, SERVER_RECV, APP_ENDPOINT)) .addAnnotation(Annotation.create((TODAY + 250) * 1000, SERVER_SEND, APP_ENDPOINT)) .build(), Span.builder().traceIdHigh(traceIdHigh).traceId(traceId).parentId(1L).id(2L).name("get") .addAnnotation(Annotation.create((TODAY + 50) * 1000, CLIENT_SEND, WEB_ENDPOINT)) .addAnnotation(Annotation.create((TODAY + 300) * 1000, CLIENT_RECV, WEB_ENDPOINT)) .build() ); processDependencies(mixedTrace); assertThat(store().getDependencies(TODAY + 1000L, null)).containsOnly( DependencyLink.create("web", "app", 1) ); }
Source:
<code>private List<MethodCallExpr> getMethodCallExprList(BlockStmt blockStmt, int expectedSize, String scope, String method) { Stream<Statement> statementStream = getStatementStream(blockStmt, expectedSize); return statementStream .filter(Statement::isExpressionStmt) .map(expressionStmt -> ((ExpressionStmt) expressionStmt).getExpression()) .filter(expression -> expression instanceof MethodCallExpr) .map(expression -> (MethodCallExpr) expression) .filter(methodCallExpr -> <START> methodCallExpr.getScope().isPresent() && methodCallExpr.getScope().get().isNameExpr() && ((NameExpr) methodCallExpr.getScope().get()).getName().asString().equals(scope) && methodCallExpr.getName().asString().equals(method)) <END> .collect(Collectors.toList()); }</code><technical_language>please move this logic a method improve code readability? (minor note, fix indent)</technical_language>

Target:
private List<MethodCallExpr> getMethodCallExprList(BlockStmt blockStmt, int expectedSize, String scope, String method) { Stream<Statement> statementStream = getStatementStream(blockStmt, expectedSize); return statementStream .filter(Statement::isExpressionStmt) .map(expressionStmt -> ((ExpressionStmt) expressionStmt).getExpression()) .filter(expression -> expression instanceof MethodCallExpr) .map(expression -> (MethodCallExpr) expression) .filter(methodCallExpr -> evaluateMethodCallExpr(methodCallExpr, scope, method)) .collect(Collectors.toList()); }
Source:
<code>public DefaultWorkerBehaviorConfig( @JsonProperty("selectStrategy") WorkerSelectStrategy selectStrategy, @Deprecated @JsonProperty("autoScaler") AutoScaler autoScaler, @JsonProperty("autoScalers") List<AutoScaler> autoScalers ) { this.selectStrategy = selectStrategy; <START> if (autoScaler != null && autoScalers != null) { throw new IllegalArgumentException("The autoScaler and autoScalers properties are mutually exclusive"); } if (autoScaler == null && autoScalers == null) { throw new IllegalArgumentException("Either autoScaler or autoScalers property must be provided"); } <END> if (autoScaler != null) { this.autoScalers = Collections.singletonList(autoScaler); } else { if (autoScalers.size() != autoScalers.stream().map(AutoScaler::getCategory).distinct().count()) { throw new IllegalArgumentException("Each autoScaler element must have a different category"); } this.autoScalers = autoScalers; } }</code><technical_language>nit: XOR operator is usual handle this type of check. suggestion if (autoScaler == null ^ autoScalers == null) { throw new IllegalArgumentException("Either(and of) autoScaler autoScalers property provided"); }</technical_language>

Target:
public DefaultWorkerBehaviorConfig( @JsonProperty("selectStrategy") WorkerSelectStrategy selectStrategy, @Deprecated @JsonProperty("autoScaler") AutoScaler autoScaler, @JsonProperty("autoScalers") List<AutoScaler> autoScalers ) { this.selectStrategy = selectStrategy; if ((autoScaler == null) == (autoScalers == null)) { throw new IllegalArgumentException("Either(and only one of) autoScaler or autoScalers property must be provided"); } if (autoScaler != null) { this.autoScalers = Collections.singletonList(autoScaler); } else { if (autoScalers.size() != autoScalers.stream().map(AutoScaler::getCategory).distinct().count()) { throw new IllegalArgumentException("Each autoScaler element must have a different category"); } this.autoScalers = autoScalers; } }
Source:
<code>public static Announcement parseAnnouncementParams (ActionParameters params) throws JSONException, ActionParamsException { JSONObject jsonParams = params.getPayLoadJSON(); <START> Announcement Announcement = new Announcement(); <END> if (jsonParams.has(KEY_ID)) { Announcement.setId(jsonParams.getInt(KEY_ID)); } if (jsonParams.has(KEY_TITLE)) { Announcement.setTitle(jsonParams.getString(KEY_TITLE)); } if (jsonParams.has(KEY_CONTENT)) { Announcement.setContent(jsonParams.getString(KEY_CONTENT)); } if (jsonParams.has(KEY_BEGIN_DATE)) { Announcement.setBeginDate(jsonParams.getString(KEY_BEGIN_DATE)); } if (jsonParams.has(KEY_END_DATE)) { Announcement.setEndDate(jsonParams.getString(KEY_END_DATE)); } if (jsonParams.has(KEY_ACTIVE)) { Announcement.setActive(jsonParams.getBoolean(KEY_ACTIVE)); } return Announcement; }</code><technical_language>newer a good idea a variable name class name. suggestion Announcement announcement = new Announcement();</technical_language>

Target:
public static Announcement parseAnnouncementParams (ActionParameters params) throws JSONException, ActionParamsException { JSONObject jsonParams = params.getPayLoadJSON(); Announcement announcement = new Announcement(); if (jsonParams.has(KEY_ID)) { announcement.setId(jsonParams.getInt(KEY_ID)); } if (jsonParams.has(KEY_TITLE)) { announcement.setTitle(jsonParams.getString(KEY_TITLE)); } if (jsonParams.has(KEY_CONTENT)) { announcement.setContent(jsonParams.getString(KEY_CONTENT)); } if (jsonParams.has(KEY_BEGIN_DATE)) { announcement.setBeginDate(jsonParams.getString(KEY_BEGIN_DATE)); } if (jsonParams.has(KEY_END_DATE)) { announcement.setEndDate(jsonParams.getString(KEY_END_DATE)); } if (jsonParams.has(KEY_ACTIVE)) { announcement.setActive(jsonParams.getBoolean(KEY_ACTIVE)); } return announcement; }
Source:
<code>public void getField() { assertThat( new DynamicSchemaResolver() <START> .getField("unknown", AttributeFormat.GEOMETRY, false, Collections.EMPTY_MAP), <END> is("unknown_geo_index")); assertThat( new DynamicSchemaResolver() .getField("unknown", AttributeFormat.XML, false, Collections.EMPTY_MAP), is("unknown_xml_tpt")); assertThat( new DynamicSchemaResolver() .getField("unknown", AttributeFormat.STRING, false, Collections.EMPTY_MAP), is("unknown_txt_tokenized")); }</code><technical_language>tests for passing in a map empty</technical_language>

Target:
public void getField() { assertThat( new DynamicSchemaResolver() .getField("unknown", AttributeFormat.GEOMETRY, false, Collections.EMPTY_MAP), is("unknown_geo_index")); assertThat( new DynamicSchemaResolver() .getField("unknown", AttributeFormat.XML, false, Collections.EMPTY_MAP), is("unknown_xml_tpt")); assertThat( new DynamicSchemaResolver() .getField("unknown", AttributeFormat.STRING, false, Collections.EMPTY_MAP), is("unknown_txt_tokenized")); Map<String, Serializable> enabledFeatures = new HashMap<String, Serializable>(); enabledFeatures.put(DynamicSchemaResolver.PHONETICS_FEATURE, Boolean.TRUE); assertThat( new DynamicSchemaResolver() .getField("unknown", AttributeFormat.STRING, false, enabledFeatures), is("unknown_txt_phonetics")); enabledFeatures.put(DynamicSchemaResolver.PHONETICS_FEATURE, Boolean.FALSE); assertThat( new DynamicSchemaResolver() .getField("unknown", AttributeFormat.STRING, false, enabledFeatures), is("unknown_txt_tokenized")); }
Source:
<code>void synchronizeAllUsersDeleteWorkloadUser() { Set<String> users = Set.of(USER_CRN); <START> String deletedWorkloadUser = "workload-user"; <END> SynchronizeAllUsersRequest request = new SynchronizeAllUsersRequest(); request.setEnvironments(Set.of()); request.setUsers(users); request.setDeletedWorkloadUser(deletedWorkloadUser); Operation operation = mock(Operation.class); when(userSyncService.synchronizeUsersWithCustomPermissionCheck(any(), any(), any(), any(), any())).thenReturn(operation); SyncOperationStatus status = mock(SyncOperationStatus.class); when(operationToSyncOperationStatus.convert(operation)).thenReturn(status); assertEquals(status, ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.synchronizeAllUsers(request))); UserSyncRequestFilter userSyncFilter = new UserSyncRequestFilter(users, Set.of(), Optional.of(deletedWorkloadUser)); verify(userSyncService, times(1)).synchronizeUsersWithCustomPermissionCheck(ACCOUNT_ID, USER_CRN, Set.of(), userSyncFilter, AuthorizationResourceAction.DESCRIBE_ENVIRONMENT); }</code><technical_language>I need a test checks parameter validation ensures reject requests a deleted workload username 0 >1 crns</technical_language>

Target:
void synchronizeAllUsersDeleteWorkloadUser() { Set<String> users = Set.of(USER_CRN); String deletedWorkloadUser = "workload-user"; SynchronizeAllUsersRequest request = new SynchronizeAllUsersRequest(); request.setEnvironments(Set.of()); request.setUsers(users); request.setDeletedWorkloadUsers(Set.of(deletedWorkloadUser)); Operation operation = mock(Operation.class); when(userSyncService.synchronizeUsersWithCustomPermissionCheck(any(), any(), any(), any(), any())).thenReturn(operation); SyncOperationStatus status = mock(SyncOperationStatus.class); when(operationToSyncOperationStatus.convert(operation)).thenReturn(status); assertEquals(status, ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.synchronizeAllUsers(request))); UserSyncRequestFilter userSyncFilter = new UserSyncRequestFilter(users, Set.of(), Optional.of(deletedWorkloadUser)); verify(userSyncService, times(1)).synchronizeUsersWithCustomPermissionCheck(ACCOUNT_ID, USER_CRN, Set.of(), userSyncFilter, AuthorizationResourceAction.DESCRIBE_ENVIRONMENT); }
Source:
<code>public <T extends View> T onErrorUse(Class<T> view) { if (!hasErrors()) { return new MockResult(proxifier).use(view); } result.include("errors", getErrors()); outjector.outjectRequestMap(); <START> logger.debug("there are errors on result: {}", messages.handleErrors()); <END> return viewsFactory.instanceFor(view, messages.handleErrors()); }</code><technical_language>includes getErrors() view, logging messages.handleErrors(). Is right</technical_language>

Target:
public <T extends View> T onErrorUse(Class<T> view) { if (!hasErrors()) { return new MockResult(proxifier).use(view); } result.include("errors", getErrors()); outjector.outjectRequestMap(); logger.debug("there are errors on result: {}", getErrors()); return viewsFactory.instanceFor(view, messages.handleErrors()); }
Source:
<code>public void testHttpSensor() throws Exception { new HttpRequestSensor<String>(ConfigBag.newInstance() .configure(HttpRequestSensor.SENSOR_NAME, SENSOR_STRING.getName()) .configure(HttpRequestSensor.JSON_PATH, "$.myKey") .configure(HttpRequestSensor.SENSOR_URI, "<LINK_0>")) .apply(entity); entity.setAttribute(Attributes.SERVICE_UP, true); <START> succeedsEventually(new Runnable() { <END> public void run() { String val = entity.getAttribute(SENSOR_STRING); assertTrue(val != null); } }); String val = entity.getAttribute(SENSOR_STRING); assertEquals(val, "myValue", "val=" + val); }</code><technical_language>instead convenience EntityTestUtils.assertAttributeEqualsEventually(entity, SENSOR_STRING, "mValue")</technical_language>

Target:
public void testHttpSensor() throws Exception { HttpRequestSensor<Integer> sensor = new HttpRequestSensor<Integer>(ConfigBag.newInstance() .configure(HttpRequestSensor.SENSOR_NAME, SENSOR_STRING.getName()) .configure(HttpRequestSensor.SENSOR_TYPE, TARGET_TYPE) .configure(HttpRequestSensor.JSON_PATH, "$.myKey") .configure(HttpRequestSensor.SENSOR_URI, "<LINK_0>")); sensor.apply(entity); entity.setAttribute(Attributes.SERVICE_UP, true); EntityTestUtils.assertAttributeEqualsEventually(entity, SENSOR_STRING, SENSOR_STRING.getName()); String val = entity.getConfig(HttpRequestSensor.SENSOR_NAME); assertEquals(val, "myValue", "val=" + val); }
Source:
<code>public boolean test() { currentThreads = Thread.getAllStackTraces().keySet(); Iterator<Thread> itThread = currentThreads.iterator(); boolean threadNotFound = true; boolean hasState = false; while(threadNotFound && itThread.hasNext()){ Thread thread = itThread.next(); <START> System.out.println("*********" + thread.getName() + ":" + thread.getState()); <END> if (nameMatcher.matches(thread.getName())){ threadNotFound = false; hasState = thread.getState().equals(state); } } return hasState || (threadNotFound && returnTrueIfDoesNotExist); }</code><technical_language>please remove this line</technical_language>

Target:
public boolean test() { currentThreads = Thread.getAllStackTraces().keySet(); Iterator<Thread> itThread = currentThreads.iterator(); boolean threadNotFound = true; boolean hasState = false; while(threadNotFound && itThread.hasNext()){ Thread thread = itThread.next(); if (nameMatcher.matches(thread.getName())){ threadNotFound = false; hasState = thread.getState().equals(state); } } return hasState || (threadNotFound && returnTrueIfDoesNotExist); }
Source:
<code>public <C extends ReplicaCollection<? extends C>> C sortedByProximity(final InetAddressAndPort address, C unsortedAddresses) { assert address.equals(FBUtilities.getBroadcastAddressAndPort()); <START> for (Replica unsortedAddress : unsortedAddresses) <END> markRequested(unsortedAddress.endpoint()); return dynamicBadnessThreshold == 0 ? sortedByProximityWithScore(address, unsortedAddresses) : sortedByProximityWithBadness(address, unsortedAddresses); }</code><technical_language>need fetch endpoint map a time</technical_language>

Target:
public <C extends ReplicaCollection<? extends C>> C sortedByProximity(final InetAddressAndPort address, C unsortedAddresses) { assert address.equals(FBUtilities.getBroadcastAddressAndPort()); for (Replica replica: unsortedAddresses) { AnnotatedMeasurement measurement = samples.get(replica.endpoint()); if (measurement != null && measurement.millisSinceLastRequest.get() > 0) measurement.millisSinceLastRequest.lazySet(0); } Map<InetAddressAndPort, Double> aliasedScores = this.scores; return dynamicBadnessThreshold == 0 ? sortedByProximityWithScore(address, unsortedAddresses, aliasedScores) : sortedByProximityWithBadness(address, unsortedAddresses, aliasedScores); }
Source:
<code>public void setFromReference(Reference ref) { databaseName = getReferenceProperty(ref, "databaseName"); String ports = getReferenceProperty(ref, "portNumber"); if (ports != null) { String[] ps = ports.split(","); portNumbers = new int[ps.length]; for (int i = 0; i < ps.length; i++) { <START> portNumbers[i] = Integer.parseInt(ps[i]); <END> } } serverNames = getReferenceProperty(ref, "serverName").split(","); for (PGProperty property : PGProperty.values()) { setProperty(property, getReferenceProperty(ref, property.getName())); } }</code><technical_language>This delegate setPortNumbers(...)</technical_language>

Target:
public void setFromReference(Reference ref) { databaseName = getReferenceProperty(ref, "databaseName"); String portNumberString = getReferenceProperty(ref, "portNumber"); if (portNumberString != null) { String[] ps = portNumberString.split(","); int[] ports = new int[ps.length]; for (int i = 0; i < ps.length; i++) { try { ports[i] = Integer.parseInt(ps[i]); } catch (NumberFormatException e) { ports[i] = 0; } } setPortNumbers(ports); } else { setPortNumbers(null); } setServerNames(getReferenceProperty(ref, "serverName").split(",")); for (PGProperty property : PGProperty.values()) { setProperty(property, getReferenceProperty(ref, property.getName())); } }
Source:
<code>protected List<String> listFiles() { GetImagesListParameters queryParams = new GetImagesListParameters(asGuid(storageDomainId), ImageFileType.All); queryParams.setForceRefresh(true); List<RepoImage> files = getBackendCollection(RepoImage.class, VdcQueryType.GetImagesList, queryParams); return <START> files.stream().map(RepoImage::getRepoImageId).collect(Collectors.toCollection(LinkedList::new)); <END> }</code><technical_language>"toList()", is real need a linked list here</technical_language>

Target:
protected List<String> listFiles() { GetImagesListParameters queryParams = new GetImagesListParameters(asGuid(storageDomainId), ImageFileType.All); queryParams.setForceRefresh(true); List<RepoImage> files = getBackendCollection(RepoImage.class, VdcQueryType.GetImagesList, queryParams); return files.stream().map(RepoImage::getRepoImageId).collect(Collectors.toList()); }
Source:
<code>public void show() { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( this.activity); alertDialogBuilder.setTitle(this.titleResId); String[] itemNames = new String[items.size()]; boolean[] states = new boolean[items.size()]; for (int ii = 0; ii < items.size(); ii++) { itemNames[ii] = this.formatter.format(items.get(ii)); states[ii] = false; } <START> final Set<Integer> selectedInds = new HashSet<Integer>(); <END> alertDialogBuilder .setCancelable(true) .setMultiChoiceItems(itemNames, states, new DialogInterface.OnMultiChoiceClickListener() { public void onClick(DialogInterface dialog, int which, boolean isChecked) { if (isChecked) { selectedInds.add(which); } else { selectedInds.remove(which); } } }) .setPositiveButton(this.okButtonResId, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { List<T> selectedItems = new ArrayList<T>(); for (int ind : selectedInds) { selectedItems.add(items.get(ind)); } onClickListener.onItemsClick(selectedItems); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); }</code><technical_language>is called selectedInds? name confuses me</technical_language>

Target:
public void show() { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( this.activity); alertDialogBuilder.setTitle(this.titleResId); String[] itemNames = new String[items.size()]; boolean[] states = new boolean[items.size()]; for (int ii = 0; ii < items.size(); ii++) { itemNames[ii] = this.formatter.format(items.get(ii)); states[ii] = false; } final Set<Integer> selectedIndices = new HashSet<Integer>(); alertDialogBuilder .setCancelable(true) .setMultiChoiceItems(itemNames, states, new DialogInterface.OnMultiChoiceClickListener() { public void onClick(DialogInterface dialog, int which, boolean isChecked) { if (isChecked) { selectedIndices.add(which); } else { selectedIndices.remove(which); } } }) .setPositiveButton(this.okButtonResId, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { List<T> selectedItems = new ArrayList<T>(); for (int ind : selectedIndices) { selectedItems.add(items.get(ind)); } onClickListener.onItemsClick(selectedItems); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); }
Source:
<code>public PlanWithProperties visitTopN(TopNNode node, Context context) { PlanWithProperties child; switch (node.getStep()) { <START> case SINGLE: <END> case FINAL: child = planChild(node, context.withPreferredProperties(PreferredProperties.any())); if (!child.getProperties().isSingleNode()) { child = withDerivedProperties( gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()), child.getProperties()); } break; case PARTIAL: child = planChild(node, context.withPreferredProperties(PreferredProperties.any())); break; default: throw new UnsupportedOperationException(format("Unsupported step for TopN [%s]", node.getStep())); } return rebaseAndDeriveProperties(node, child); }</code><technical_language>Do need support SINGLE? replaced reach here</technical_language>

Target:
public PlanWithProperties visitTopN(TopNNode node, Context context) { PlanWithProperties child; switch (node.getStep()) { case SINGLE: case FINAL: child = planChild(node, context.withPreferredProperties(PreferredProperties.undistributed())); if (!child.getProperties().isSingleNode()) { child = withDerivedProperties( gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()), child.getProperties()); } break; case PARTIAL: child = planChild(node, context.withPreferredProperties(PreferredProperties.any())); break; default: throw new UnsupportedOperationException(format("Unsupported step for TopN [%s]", node.getStep())); } return rebaseAndDeriveProperties(node, child); }
Source:
<code>public long getTimePeriodInSeconds(String timePeriod) { try { <START> String timeValueString = timePeriod.substring(0, timePeriod.length() - 1); <END> String timeUnitString = timePeriod.substring(timePeriod.length() - 1); Long timeValue = Long.parseLong(timeValueString); MetricReader.TimeUnit timeUnit = MetricReader.TimeUnit.fromString(timeUnitString); long timePeriodInSeconds = timeValue * timeUnit.getValue() / 1000; return timePeriodInSeconds; } catch (Exception e) { throw new IllegalArgumentException("Invalid expression for time period constant."); } }</code><technical_language>extract timePeriod.length() - 1 a variable reuse</technical_language>

Target:
public long getTimePeriodInSeconds(String timePeriod) { try { int timeUnitIndex = timePeriod.length() - 1; String timeValueString = timePeriod.substring(0, timeUnitIndex); String timeUnitString = timePeriod.substring(timeUnitIndex); Long timeValue = Long.parseLong(timeValueString); MetricReader.TimeUnit timeUnit = MetricReader.TimeUnit.fromString(timeUnitString); long timePeriodInSeconds = timeValue * timeUnit.getValue() / 1000; return timePeriodInSeconds; } catch (Exception e) { throw new IllegalArgumentException("Invalid expression for time period constant."); } }
Source:
<code>public SolrPasswordUpdateImpl( UuidGenerator uuidGenerator, ClientFactoryFactory clientFactoryFactory, EncryptionService encryptionService) { this.encryptionService = encryptionService; this.uuidGenerator = uuidGenerator; this.restClientFactoryFactory = clientFactoryFactory; properties = <START> AccessController.doPrivileged( <END> (PrivilegedAction<java.util.Properties>) System::getProperties); }</code><technical_language>accessing properties that. requires permissions for is a good exposes everything. access need. In addition, this assumes system hash table persist in system in fact, changed else System.setProperties()</technical_language>

Target:
public SolrPasswordUpdateImpl( UuidGenerator uuidGenerator, ClientFactoryFactory clientFactoryFactory, EncryptionService encryptionService) { this.encryptionService = encryptionService; this.uuidGenerator = uuidGenerator; this.restClientFactoryFactory = clientFactoryFactory; }
Source:
<code>private static LRAStatus fromString(String status) { if (status != null) { return LRAStatus.valueOf(status); } <START> return null; <END> }</code><technical_language>status null, instead throw generic exception (including NotFound if is response coordinator indicated)</technical_language>

Target:
private static LRAStatus fromString(String status) { if (status == null) { throw new IllegalArgumentException("The status parameter is null"); } return LRAStatus.valueOf(status); }
Source:
<code>static InstallState getNextInstallState(final InstallState current) { List<Function<Provider<InstallState>,InstallState>> installStateFilterChain = new ArrayList<>(); for (final InstallStateFilter setupExtension : InstallStateFilter.all()) { installStateFilterChain.add(new Function<Provider<InstallState>, InstallState>() { @Override public InstallState apply(Provider<InstallState> next) { return setupExtension.getNextInstallState(current, next); } }); } installStateFilterChain.add(new Function<Provider<InstallState>, InstallState>() { @Override public InstallState apply(Provider<InstallState> input) { if (current == null || InstallState.UNKNOWN.equals(current)) { return getDefaultInstallState(); } <START> final Map<InstallState, InstallState> states = new HashMap<InstallState, InstallState>(); <END> { states.put(InstallState.CREATE_ADMIN_USER, InstallState.INITIAL_SETUP_COMPLETED); states.put(InstallState.INITIAL_PLUGINS_INSTALLING, InstallState.CREATE_ADMIN_USER); states.put(InstallState.INITIAL_SECURITY_SETUP, InstallState.NEW); states.put(InstallState.RESTART, InstallState.RUNNING); states.put(InstallState.UPGRADE, InstallState.INITIAL_SETUP_COMPLETED); states.put(InstallState.DOWNGRADE, InstallState.INITIAL_SETUP_COMPLETED); } return states.get(current); } }); ProviderChain<InstallState> chain = new ProviderChain<>(installStateFilterChain.iterator()); return chain.get(); }</code><technical_language>this private static final in class</technical_language>

Target:
static InstallState getNextInstallState(final InstallState current) { List<Function<Provider<InstallState>,InstallState>> installStateFilterChain = new ArrayList<>(); for (final InstallStateFilter setupExtension : InstallStateFilter.all()) { installStateFilterChain.add(new Function<Provider<InstallState>, InstallState>() { @Override public InstallState apply(Provider<InstallState> next) { return setupExtension.getNextInstallState(current, next); } }); } installStateFilterChain.add(new Function<Provider<InstallState>, InstallState>() { @Override public InstallState apply(Provider<InstallState> input) { if (current == null || InstallState.UNKNOWN.equals(current)) { return getDefaultInstallState(); } final Map<InstallState, InstallState> states = new HashMap<InstallState, InstallState>(); { states.put(InstallState.CREATE_ADMIN_USER, InstallState.INITIAL_SETUP_COMPLETED); states.put(InstallState.INITIAL_PLUGINS_INSTALLING, InstallState.CREATE_ADMIN_USER); states.put(InstallState.INITIAL_SECURITY_SETUP, InstallState.NEW); states.put(InstallState.RESTART, InstallState.RUNNING); states.put(InstallState.UPGRADE, InstallState.INITIAL_SETUP_COMPLETED); states.put(InstallState.DOWNGRADE, InstallState.INITIAL_SETUP_COMPLETED); states.put(InstallState.INITIAL_SETUP_COMPLETED, InstallState.RUNNING); } return states.get(current); } }); ProviderChain<InstallState> chain = new ProviderChain<>(installStateFilterChain.iterator()); return chain.get(); }
Source:
<code>public ListenableFuture<URI> requestCodeReview(Path path, String message) throws TmcCoreException { Command<URI> requestCodeReview = getRequestCodeReviewCmd(settings, path, message); <START> return threadPool.submit(requestCodeReview); <END> }</code><technical_language>I ques inline this</technical_language>

Target:
public ListenableFuture<URI> requestCodeReview(Path path, String message) throws TmcCoreException { return threadPool.submit(getRequestCodeReviewCmd(settings, path, message)); }
Source:
<code>private String getXmlObjectValue(XMLObject xmlObject) { if (xmlObject == null) { return null; } if (xmlObject instanceof XSString) { ((XSString) xmlObject).getValue(); } <START> if (xmlObject instanceof XSAnyImpl) { <END> return ((XSAnyImpl) xmlObject).getTextContent(); } return xmlObject.toString(); }</code><technical_language>I a more types relevant XSBoolean, XSDateTime, XSInteger, XSURI</technical_language>

Target:
private Object getXmlObjectValue(XMLObject xmlObject) { if (xmlObject == null) { return null; } if (xmlObject instanceof XSAny) { return getXSAnyObjectValue((XSAny) xmlObject); } if (xmlObject instanceof XSString) { return ((XSString) xmlObject).getValue(); } if (xmlObject instanceof XSInteger) { return ((XSInteger) xmlObject).getValue(); } if (xmlObject instanceof XSURI) { return ((XSURI) xmlObject).getValue(); } if (xmlObject instanceof XSBoolean) { XSBooleanValue xsBooleanValue = ((XSBoolean) xmlObject).getValue(); return xsBooleanValue != null ? xsBooleanValue.getValue() : null; } if (xmlObject instanceof XSDateTime) { DateTime dateTime = ((XSDateTime) xmlObject).getValue(); return dateTime != null ? Instant.ofEpochMilli(dateTime.getMillis()) : null; } return null; }
Source:
<code><START> public void varStatus() { <END> System.out.println("======================================="); System.out.println("nativeHeight: " + nativeHeight); System.out.println("nativeWidth: " + nativeWidth); System.out.println("webviewHeight: " + webviewHeight); System.out.println("webviewWidth: " + webviewWidth); System.out.println("ratio (nativeWidth / appWebviewWidth): " + ratio); System.out.println("======================================="); System.out.println("taskbarNativeHeight: " + taskbarNativeHeight); System.out.println("taskbarNativeWidth: " + taskbarNativeWidth); System.out.println("taskbarWebviewHeight: " + taskbarWebviewHeight); System.out.println("taskbarWebviewWidth: " + taskbarWebviewWidth); System.out.println("======================================="); System.out.println("appNativeWidth: " + appNativeWidth); System.out.println("appNativeHeight: " + appNativeHeight); System.out.println("appWebviewHeight: " + appWebviewHeight); System.out.println("appWebviewWidth: " + appWebviewWidth); System.out.println("======================================="); System.out.println("loadedPageHeight: " + loadedPageHeight); System.out.println("loadedPageWidth: " + loadedPageWidth); System.out.println("======================================="); }</code><technical_language>Is other output method besides System.out</technical_language>

Target:
public void varStatus() { System.out.println("======================================="); System.out.println("nativeHeight: " + nativeHeight); System.out.println("nativeWidth: " + nativeWidth); System.out.println("webviewHeight: " + webviewHeight); System.out.println("webviewWidth: " + webviewWidth); System.out.println("ratio (nativeWidth / appWebviewWidth): " + ratio); System.out.println("======================================="); System.out.println("taskbarNativeHeight: " + taskbarNativeHeight); System.out.println("taskbarNativeWidth: " + taskbarNativeWidth); System.out.println("taskbarWebviewHeight: " + taskbarWebviewHeight); System.out.println("taskbarWebviewWidth: " + taskbarWebviewWidth); System.out.println("======================================="); System.out.println("appNativeWidth: " + appNativeWidth); System.out.println("appNativeHeight: " + appNativeHeight); System.out.println("appWebviewHeight: " + appWebviewHeight); System.out.println("appWebviewWidth: " + appWebviewWidth); System.out.println("======================================="); System.out.println("addressbarNativeHeight: " + addressbarNativeHeight); System.out.println("addressbarNativeWidth: " + addressbarNativeWidth); System.out.println("addressbarWebviewHeight: " + addressbarWebviewHeight); System.out.println("addressbarWebviewWidth: " + addressbarWebviewWidth); System.out.println("======================================="); System.out.println("loadedPageHeight: " + loadedPageHeight); System.out.println("loadedPageWidth: " + loadedPageWidth); System.out.println("======================================="); }