auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public PageResult<Installation> findInstallationsByVariant(String variantID, Integer page, Integer pageSize) { CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery<Installation> query = builder.createQuery(Installation.class); <START> Root<Installation> v = query.from(Installation.class); <END> final Join join = v.join("variant"); final Predicate[] predicates = new Predicate[]{builder.equal(join.get("variantID"), variantID)}; query.where(predicates); List<Installation> result = entityManager.createQuery(query) .setFirstResult(page * pageSize).setMaxResults(pageSize).getResultList(); CriteriaQuery<Long> countQuery = builder.createQuery(Long.class); final Join<Object, Object> join1 = countQuery.from(Installation.class).join("variant"); countQuery.where(new Predicate[]{builder.equal(join1.get("variantID"), variantID)}); final Long count = entityManager.createQuery(countQuery.select(builder.count(join1))).getSingleResult(); return new PageResult<Installation>(result, count); }</code><technical_language>Join/Predicate others final, I others (e.g. Root, Criteria*) final</technical_language>

Target:
public PageResult<Installation> findInstallationsByVariant(String variantID, Integer page, Integer pageSize) { return findInstallationsByVariantForDeveloper(variantID, null, page, pageSize); }
Source:
<code>Builder setFilterSpec(@NonNull FilterSpec filter) { filterSpec = <START> filter; <END> return this; }</code><technical_language>requireNonNull</technical_language>

Target:
Builder setFilterSpec(@NonNull FilterSpec filter) { filterSpec = requireNonNull(filter); return this; }
Source:
<code>public void setUp() throws Exception { this.conf = new TajoConf(); util = new TajoTestingCluster(); catalog = util.startCatalogCluster().getCatalog(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf.setVar(TajoConf.ConfVars.WORKER_TEMPORAL_DIR, testDir.toString()); Schema schema = new Schema(); schema.addColumn("managerid", Type.INT4); schema.addColumn("empid", Type.INT4); schema.addColumn("deptname", Type.TEXT); TableMeta employeeMeta = CatalogUtil.newTableMeta("CSV"); Path employeePath = new Path(testDir, "employee.csv"); Appender appender = ((FileTablespace) TablespaceManager.getLocalFs()) .getAppender(employeeMeta, schema, employeePath); appender.enableStats(); appender.init(); VTuple tuple = new VTuple(schema.size()); for (int i = 0; i < numTuple; i++) { tuple.put(new Datum[] { DatumFactory.createInt4(rnd.nextInt(50)), DatumFactory.createInt4(rnd.nextInt(100)), DatumFactory.createText("dept_" + i), }); appender.addTuple(tuple); } appender.flush(); appender.close(); <START> if (LOG.isDebugEnabled()) { <END> LOG.debug(appender.getStats().getNumRows() + " rows (" + (appender.getStats().getNumBytes() / 1048576) + " MB)"); } employee = new TableDesc("default.employee", schema, employeeMeta, employeePath.toUri()); catalog.createTable(employee); analyzer = new SQLAnalyzer(); planner = new LogicalPlanner(catalog, TablespaceManager.getInstance()); }</code><technical_language>This if-condition branch necessary</technical_language>

Target:
public void setUp() throws Exception { this.conf = new TajoConf(); util = new TajoTestingCluster(); catalog = util.startCatalogCluster().getCatalog(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf.setVar(TajoConf.ConfVars.WORKER_TEMPORAL_DIR, testDir.toString()); Schema schema = new Schema(); schema.addColumn("managerid", Type.INT4); schema.addColumn("empid", Type.INT4); schema.addColumn("deptname", Type.TEXT); TableMeta employeeMeta = CatalogUtil.newTableMeta("CSV"); Path employeePath = new Path(testDir, "employee.csv"); Appender appender = ((FileTablespace) TablespaceManager.getLocalFs()) .getAppender(employeeMeta, schema, employeePath); appender.enableStats(); appender.init(); VTuple tuple = new VTuple(schema.size()); for (int i = 0; i < numTuple; i++) { tuple.put(new Datum[] { DatumFactory.createInt4(rnd.nextInt(50)), DatumFactory.createInt4(rnd.nextInt(100)), DatumFactory.createText("dept_" + i), }); appender.addTuple(tuple); } appender.flush(); appender.close(); employee = new TableDesc("default.employee", schema, employeeMeta, employeePath.toUri()); catalog.createTable(employee); analyzer = new SQLAnalyzer(); planner = new LogicalPlanner(catalog, TablespaceManager.getInstance()); }
Source:
<code>public boolean modifyHSM(VeluxBridge bridge, boolean enableService) { logger.trace("modifyHSM({}) called.", enableService); ModifyHouseStatusMonitor bcp = bridge.bridgeAPI().modifyHouseStatusMonitor(); bcp.serviceActivation(enableService); <START> if ((bridge.bridgeCommunicate(bcp)) && (bcp.isCommunicationSuccessful())) { <END> logger.debug("modifyHSM() finished successfully."); return true; } else { logger.trace("modifyHSM() finished with failure."); return false; } }</code><technical_language>redundant parentheses</technical_language>

Target:
public boolean modifyHSM(VeluxBridge bridge, boolean enableService) { logger.trace("modifyHSM({}) called.", enableService); ModifyHouseStatusMonitor bcp = bridge.bridgeAPI().modifyHouseStatusMonitor(); bcp.serviceActivation(enableService); if (bridge.bridgeCommunicate(bcp) && bcp.isCommunicationSuccessful()) { logger.debug("modifyHSM() finished successfully."); return true; } else { logger.trace("modifyHSM() finished with failure."); return false; } }
Source:
<code>public Stream<DocumentWriteOperation> splitWriteOperations(InputStream input) throws Exception { if (input == null) { throw new IllegalArgumentException("Input cannot be null"); <START> } <END> return splitWriteOperations(input, null); }</code><technical_language>check in called overload, this method skip check lines 119 - 121 concern applies some overloads in other splitters</technical_language>

Target:
public Stream<DocumentWriteOperation> splitWriteOperations(InputStream input) throws Exception { return splitWriteOperations(input, null); }
Source:
<code>public void run(final ActionContext context) throws Exception { Connection connection = new Connection(config.host); try { connection.connect(); String password = Strings.isNullOrEmpty(config.password) ? null : config.password; if (!connection.authenticateWithPublicKey(config.user, new File(config.privateKeyFile), password)) { throw new IOException(String.format("SSH authentication error when connecting to %s@%s on port %d", config.user, config.host, config.port)); } LOG.debug("Connection established with the host {}", config.host); Session session = connection.openSession(); session.execCommand(config.command); InputStream stdout = new StreamGobbler(session.getStdout()); BufferedReader outBuffer = new BufferedReader(new InputStreamReader(stdout, Charsets.UTF_8)); InputStream stderr = new StreamGobbler(session.getStderr()); BufferedReader errBuffer = new BufferedReader(new InputStreamReader(stderr, Charsets.UTF_8)); String out = CharStreams.toString(outBuffer); String err = CharStreams.toString(errBuffer); <START> LOG.debug("Output: {}", out); <END> if (err.length() > 0) { LOG.error("Errors: {}", err); } Integer exitCode = session.getExitStatus(); if (exitCode != null && exitCode != 0) { throw new IOException(String.format("Error: command %s running on hostname %s finished with exit code: %d", config.command, config.host, exitCode)); } if (config.output != null) { out = out.endsWith("\n") ? out.substring(0, out.length() - 1) : out; context.getArguments().set(config.output, out); } } finally { connection.close(); } }</code><technical_language>for stdout</technical_language>

Target:
public void run(final ActionContext context) throws Exception { Connection connection = new Connection(config.host); try { connection.connect(); String password = Strings.isNullOrEmpty(config.password) ? null : config.password; if (!connection.authenticateWithPublicKey(config.user, new File(config.privateKeyFile), password)) { throw new IOException(String.format("SSH authentication error when connecting to %s@%s on port %d", config.user, config.host, config.port)); } LOG.debug("Connection established with the host {}", config.host); Session session = connection.openSession(); session.execCommand(config.command); InputStream stdout = new StreamGobbler(session.getStdout()); BufferedReader outBuffer = new BufferedReader(new InputStreamReader(stdout, Charsets.UTF_8)); InputStream stderr = new StreamGobbler(session.getStderr()); BufferedReader errBuffer = new BufferedReader(new InputStreamReader(stderr, Charsets.UTF_8)); String out = CharStreams.toString(outBuffer); String err = CharStreams.toString(errBuffer); if (out.length() > 0) { LOG.debug("Stdout: {}", out); } if (err.length() > 0) { LOG.error("Stderr: {}", err); } Integer exitCode = session.getExitStatus(); if (exitCode != null && exitCode != 0) { throw new IOException(String.format("Error: command %s running on hostname %s finished with exit code: %d", config.command, config.host, exitCode)); } if (config.output != null) { out = out.endsWith("\n") ? out.substring(0, out.length() - 1) : out; context.getArguments().set(config.output, out); } } finally { connection.close(); } }
Source:
<code>protected void onEndTransaction(boolean callerIsSyncAdapter) { super.onEndTransaction(callerIsSyncAdapter); Intent providerChangedIntent = new Intent(Intent.ACTION_PROVIDER_CHANGED, TaskContract.getContentUri(mAuthority)); <START> if (mChanged) <END> { updateNotifications(); } if (Build.VERSION.SDK_INT >= 26) { providerChangedIntent.setPackage(getContext().getPackageName()); } getContext().sendBroadcast(providerChangedIntent); if (Boolean.TRUE.equals(mStaleListCreated.get())) { Intent visbilityRequest = new Intent("org.dmfs.tasks.action.STALE_LIST_BROADCAST").setPackage(getContext().getPackageName()); getContext().sendBroadcast(visbilityRequest); } }</code><technical_language>mChanged reset false somewhere</technical_language>

Target:
protected void onEndTransaction(boolean callerIsSyncAdapter) { super.onEndTransaction(callerIsSyncAdapter); Intent providerChangedIntent = new Intent(Intent.ACTION_PROVIDER_CHANGED, TaskContract.getContentUri(mAuthority)); if (mChanged) { updateNotifications(); mChanged = false; } if (Build.VERSION.SDK_INT >= 26) { providerChangedIntent.setPackage(getContext().getPackageName()); } getContext().sendBroadcast(providerChangedIntent); if (Boolean.TRUE.equals(mStaleListCreated.get())) { Intent visbilityRequest = new Intent("org.dmfs.tasks.action.STALE_LIST_BROADCAST").setPackage(getContext().getPackageName()); getContext().sendBroadcast(visbilityRequest); } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { context = this; ButterKnife.setDebug(true); fragmentManager = getSupportFragmentManager(); setTheme(R.style.AppTheme_NoActionBar_MainTheme); super.onCreate(savedInstanceState); SharedPreferencesUtil.putInt(ConstantStrings.SESSION_MAP_ID, -1); isTwoPane = drawerLayout == null; <START> Utils.twoPane = isTwoPane; <END> setSupportActionBar(toolbar); setUpNavDrawer(); setUpCustomTab(); setupEvent(); completeHandler = DownloadCompleteHandler.with(context); if(!SharedPreferencesUtil.getBoolean(ConstantStrings.IS_DOWNLOAD_DONE, false)) { if(Utils.isBaseUrlEmpty()) { downloadFromAssets(); } else { downloadData(); } } else { completeHandler.hide(); } if (savedInstanceState == null) { currentMenuItemId = R.id.nav_home; } else { currentMenuItemId = savedInstanceState.getInt(STATE_FRAGMENT); } if (getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_HOME) == null && getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_REST) == null) { doMenuAction(currentMenuItemId); } }</code><technical_language>In java, property accessors</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { context = this; ButterKnife.setDebug(true); fragmentManager = getSupportFragmentManager(); setTheme(R.style.AppTheme_NoActionBar_MainTheme); super.onCreate(savedInstanceState); SharedPreferencesUtil.putInt(ConstantStrings.SESSION_MAP_ID, -1); isTwoPane = drawerLayout == null; Utils.setTwoPane(isTwoPane); setSupportActionBar(toolbar); setUpNavDrawer(); setUpCustomTab(); setupEvent(); completeHandler = DownloadCompleteHandler.with(context); if(!SharedPreferencesUtil.getBoolean(ConstantStrings.IS_DOWNLOAD_DONE, false)) { if(Utils.isBaseUrlEmpty()) { downloadFromAssets(); } else { downloadData(); } } else { completeHandler.hide(); } if (savedInstanceState == null) { currentMenuItemId = R.id.nav_home; } else { currentMenuItemId = savedInstanceState.getInt(STATE_FRAGMENT); } if (getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_HOME) == null && getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_REST) == null) { doMenuAction(currentMenuItemId); } }
Source:
<code>public TxnContext txn(@Nonnull final String namespace, IsolationLevel isolationLevel) { <START> return new TxnContext( <END> this.runtime.getObjectsView(), this.runtime.getTableRegistry(), namespace, isolationLevel, false); }</code><technical_language>Need add @Deprecated this api</technical_language>

Target:
public TxnContext txn(@Nonnull final String namespace, IsolationLevel isolationLevel) { return new TxnContext( this.runtime.getObjectsView(), this.runtime.getTableRegistry(), namespace, isolationLevel); }
Source:
<code>private FeedbackSessionsForm buildBasicForm(List<CourseAttributes> courses, String courseIdForNewSession, Map<String, InstructorAttributes> instructors, FeedbackSessionAttributes newFeedbackSession, String feedbackSessionType, String feedbackSessionNameForSessionList, List<String> courseIds, FeedbackSessionsAdditionalSettingsFormSegment additionalSettings) { List<ElementTag> courseIdOptions = getCourseIdOptions(courses, courseIdForNewSession, instructors, newFeedbackSession); boolean isSubmitButtonDisabled = courseIdOptions.isEmpty(); if (courseIdOptions.isEmpty()) { if (courses.isEmpty()) addPlaceholder(courseIdOptions, Const.StatusMessages.INSTRUCTOR_NO_ACTIVE_COURSES); else { addPlaceholder(courseIdOptions, Const.StatusMessages.INSTRUCTOR_NO_MODIFY_COURSES_SESSION_PERMISSION); <START> } <END> } return FeedbackSessionsForm.getFormForNewFs( newFeedbackSession, getFeedbackSessionTypeOptions(feedbackSessionType), courseIdForNewSession, courseIds, courseIdOptions, instructors, additionalSettings, isSubmitButtonDisabled); }</code><technical_language>parts duplicated, extract a method for this</technical_language>

Target:
private FeedbackSessionsForm buildBasicForm(List<CourseAttributes> courses, String courseIdForNewSession, Map<String, InstructorAttributes> instructors, FeedbackSessionAttributes newFeedbackSession, String feedbackSessionType, String feedbackSessionNameForSessionList, List<String> courseIds, FeedbackSessionsAdditionalSettingsFormSegment additionalSettings) { List<ElementTag> courseIdOptions = getCourseIdOptions(courses, courseIdForNewSession, instructors, newFeedbackSession); boolean isSubmitButtonDisabled = courseIdOptions.isEmpty(); addPlaceholderIfEmpty(courseIdOptions, determinePlaceholderMessage(!courses.isEmpty())); return FeedbackSessionsForm.getFormForNewFs( newFeedbackSession, getFeedbackSessionTypeOptions(feedbackSessionType), courseIdForNewSession, courseIds, courseIdOptions, instructors, additionalSettings, isSubmitButtonDisabled); }
Source:
<code>public void testServiceCheckWarning() throws Exception { SimpleTestJavaApp testApp = new SimpleTestJavaApp(); testApp.populateHashMap(400); registerMBean(testApp, "org.datadog.jmxfetch.test:type=ServiceCheckTest"); initApplication("too_many_metrics.yaml"); run(); LinkedList<HashMap<String, Object>> serviceChecks = getServiceChecks(); LinkedList<HashMap<String, Object>> metrics = getMetrics(); assertTrue(metrics.size() >= 350 ); assertEquals(1, serviceChecks.size()); HashMap<String, Object> sc = serviceChecks.getFirst(); assertNotNull(sc.get("name")); assertNotNull(sc.get("status")); assertNotNull(sc.get("message")); assertNotNull(sc.get("tags")); String scName = (String) (sc.get("name")); String scStatus = (String) (sc.get("status")); String[] scTags = (String[]) (sc.get("tags")); assertEquals(Reporter.formatServiceCheckPrefix("too_many_metrics"), scName); assertEquals(Status.STATUS_OK, scStatus); assertEquals(scTags.length, 3); <START> assertTrue(Arrays.asList(scTags).contains("instance:jmx_test_instance")); <END> }</code><technical_language>tests of 2 extra tags</technical_language>

Target:
public void testServiceCheckWarning() throws Exception { SimpleTestJavaApp testApp = new SimpleTestJavaApp(); testApp.populateHashMap(400); registerMBean(testApp, "org.datadog.jmxfetch.test:type=ServiceCheckTest"); initApplication("too_many_metrics.yaml"); run(); LinkedList<HashMap<String, Object>> serviceChecks = getServiceChecks(); LinkedList<HashMap<String, Object>> metrics = getMetrics(); assertTrue(metrics.size() >= 350 ); assertEquals(1, serviceChecks.size()); HashMap<String, Object> sc = serviceChecks.getFirst(); assertNotNull(sc.get("name")); assertNotNull(sc.get("status")); assertNotNull(sc.get("message")); assertNotNull(sc.get("tags")); String scName = (String) (sc.get("name")); String scStatus = (String) (sc.get("status")); String[] scTags = (String[]) (sc.get("tags")); assertEquals(Reporter.formatServiceCheckPrefix("too_many_metrics"), scName); assertEquals(Status.STATUS_OK, scStatus); assertEquals(scTags.length, 3); assertTrue(Arrays.asList(scTags).contains("instance:jmx_test_instance")); assertTrue(Arrays.asList(scTags).contains("env:stage")); assertTrue(Arrays.asList(scTags).contains("newTag:test")); }
Source:
<code>private static void doJsonQuery(Prologue prologue, QueryExecution queryExecution, ResultsFormat outputFormat) { <START> JsonArray results = queryExecution.execJson();; <END> JSON.write(System.out, results); }</code><technical_language>Double ;. Nit-pick, harmelss (unless some "end" statements return, break, etc, I think?)</technical_language>

Target:
private static void doJsonQuery(Prologue prologue, QueryExecution queryExecution, ResultsFormat outputFormat) { JsonArray results = queryExecution.execJson(); JSON.write(System.out, results); }
Source:
<code>List<Double> calculateHitProbabilities(final RollData rollData) { if (rollData.totalRolls == 0) { return List.of(); } final List<Integer> dicePowersList = new ArrayList<>(rollData.rollsByDicePower.keySet()); Collections.sort(dicePowersList); final int maxPower = dicePowersList.get(dicePowersList.size() - 1); final int[] dicePowers = new int[dicePowersList.size()]; final Map<Integer, double[]> calculatedProbabilityCache = this.calculatedProbabilityCache.computeIfAbsent( rollData.maxDiceSides, key -> new HashMap<>(rollData.maxDiceSides * rollData.totalRolls)); final int[] diceAvailableGroupedByPower = new int[maxPower + 1]; for (int dicePowerIndex = 0; dicePowerIndex < dicePowersList.size(); dicePowerIndex++) { final int dicePower = dicePowersList.get(dicePowerIndex); dicePowers[dicePowerIndex] = dicePower; diceAvailableGroupedByPower[dicePower] = rollData.rollsByDicePower.get(dicePower); } final double[] probabilities = new double[rollData.totalRolls + 1]; calculateHitProbabilitiesWorker( 0, dicePowersList.size() - 1, <START> probabilities, <END> 1.0, rollData.maxDiceSides, dicePowers, diceAvailableGroupedByPower, calculatedProbabilityCache); final List<Double> probabilitiesList = new ArrayList<>(); for (final double probability : probabilities) { probabilitiesList.add(probability); } return probabilitiesList; }</code><technical_language>final int[] dicePowers = dicePowersList.toArray(new int[0]); convert a List array. arraylist implementation copying array slightly faster iterating</technical_language>

Target:
List<Double> calculateHitProbabilities(final RollData rollData) { if (rollData.totalRolls == 0) { return List.of(); } final List<Integer> dicePowersList = new ArrayList<>(rollData.rollsByDicePower.keySet()); Collections.sort(dicePowersList); final int maxPower = dicePowersList.get(dicePowersList.size() - 1); final int[] dicePowers = new int[dicePowersList.size()]; final Map<Integer, double[]> calculatedProbabilityCache = this.calculatedProbabilityCache.computeIfAbsent( rollData.maxDiceSides, key -> new HashMap<>(rollData.maxDiceSides * rollData.totalRolls)); final int[] diceAvailableGroupedByPower = new int[maxPower + 1]; for (int dicePowerIndex = 0; dicePowerIndex < dicePowersList.size(); dicePowerIndex++) { final int dicePower = dicePowersList.get(dicePowerIndex); dicePowers[dicePowerIndex] = dicePower; diceAvailableGroupedByPower[dicePower] = rollData.rollsByDicePower.get(dicePower); } final double[] probabilities = new double[rollData.totalRolls + 1]; calculateHitProbabilitiesWorker( 0, dicePowersList.size() - 1, probabilities, 1.0, rollData.maxDiceSides, dicePowers, diceAvailableGroupedByPower, calculatedProbabilityCache); return Arrays.stream(probabilities).boxed().collect(Collectors.toList()); }
Source:
<code>public void writeToParcel(Parcel dest, int flags) { dest.writeString(mTag); dest.writeInt(mDrawerIconResId); dest.writeInt(mTitleResId); dest.writeInt(mDescriptionResId); dest.writeInt(mDefaultIconResId); dest.writeInt(mLogoResId); dest.writeInt(mSpecialEventTheme); dest.writeInt(mDrawerId); <START> dest.writeInt(mGreetingsResId); <END> dest.writeInt(mGreetingsTitleResId); dest.writeLong(mStartDateInMillis.getMillis()); dest.writeLong(mEndDateInMillis.getMillis()); }</code><technical_language>missing in Parcelable constructor</technical_language>

Target:
public void writeToParcel(Parcel dest, int flags) { dest.writeString(mTag); dest.writeInt(mDrawerIconResId); dest.writeInt(mTitleResId); dest.writeInt(mDescriptionResId); dest.writeInt(mDefaultIconResId); dest.writeInt(mLogoResId); dest.writeInt(mSpecialEventTheme); dest.writeInt(mDrawerId); dest.writeInt(mGreetingsResId); dest.writeInt(mGreetingsTitleResId); dest.writeLong(mStartDate.getMillis()); dest.writeLong(mEndDateIn.getMillis()); }
Source:
<code>public void testParametersAreSetForRevisedNodeSourceRequest() throws IOException { when(this.catalogObjectAction.isRevised()).thenReturn(true); HttpPost httpPost = this.catalogRequestBuilder.buildCatalogRequest("http://localhost:8080/catalog"); String string = getMultipartEntityString(httpPost); checkThatRequestContainsRegularParameters(string); assertThat("Request contains the " + CatalogConstants.KIND_PARAM + " parameter whereas it shouldn't", !string.contains(CatalogConstants.KIND_PARAM)); <START> assertThat("Request contains the " + CatalogConstants.OBJECT_CONTENT_TYPE_PARAM + " parameter whereas it shouldn't", !string.contains(CatalogConstants.OBJECT_CONTENT_TYPE_PARAM)); <END> }</code><technical_language>I sure, predicate 'not()' instead of '!'</technical_language>

Target:
public void testParametersAreSetForRevisedNodeSourceRequest() throws IOException { when(this.catalogObjectAction.isRevised()).thenReturn(true); HttpPost httpPost = this.catalogRequestBuilder.buildCatalogRequest("http://localhost:8080/catalog"); String entityStringContent = getMultipartEntityString(httpPost); checkThatRequestContainsRegularParameters(entityStringContent); assertThat("Request contains the " + CatalogConstants.KIND_PARAM + " parameter whereas it shouldn't", CoreMatchers.not(entityStringContent.contains(CatalogConstants.KIND_PARAM))); assertThat("Request contains the " + CatalogConstants.OBJECT_CONTENT_TYPE_PARAM + " parameter whereas it shouldn't", CoreMatchers.not(entityStringContent.contains(CatalogConstants.OBJECT_CONTENT_TYPE_PARAM))); }
Source:
<code>protected void serviceInit(Configuration conf) throws Exception { super.serviceInit(conf); LOG.debug("Creating plugin dispatch queue with size {}", qsize); blockingQueue = new ArrayBlockingQueue<>(qsize); RejectedExecutionHandler handler = new RejectedExecutionHandler() { @Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { try { blockingQueue.remove(); executor.submit(r); } catch (NoSuchElementException ex) { } } }; <START> executorService = new ThreadPoolExecutor(1, NUM_MAX_THREADS, 60L, TimeUnit.SECONDS, <END> blockingQueue, new NameableThreadFactory("PluginExecutor-"), handler); }</code><technical_language>I default behavior simple for developer. This currently means plugin writer worry thread safety. a single thread executor. provide a more advanced version of plugin single thread executor on</technical_language>

Target:
protected void serviceInit(Configuration conf) throws Exception { super.serviceInit(conf); LOG.debug("Creating plugin dispatch queue with size {}", qsize); blockingQueue = new ArrayBlockingQueue<>(qsize); RejectedExecutionHandler rejectionHandler = new RejectedExecutionHandler() { @Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { try { blockingQueue.remove(); executor.submit(r); } catch (NoSuchElementException ex) { } } }; executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, blockingQueue, new NameableThreadFactory("PluginExecutorThread"), rejectionHandler); }
Source:
<code>public LoggedUserDto getLoggedUserInfo() { LoggedUserDto loggedUserDto=new LoggedUserDto(); List<String> roles = new ArrayList<>(); String userLogin = SecurityContextHolder.getContext().getAuthentication().getName(); if (userLogin!="anonymousUser"){ for (Role role:userService.findByLogin(userLogin).getRoles()){ roles.add(role.getName()); } <START> loggedUserDto.setLogin(SecurityContextHolder.getContext().getAuthentication().getName()); <END> } loggedUserDto.setRoles(roles); return loggedUserDto; }</code><technical_language>Duplicate code method in utils name SecurityContextHolder</technical_language>

Target:
public LoggedUserDto getLoggedUserInfo() { LoggedUserDto loggedUserDto=new LoggedUserDto(); List<String> roles = new ArrayList<>(); String userLogin = getUserLogin(); if (!userLogin.equals(Constants.UNKNOWN_USER)){ for (Role role:userService.findByLogin(userLogin).getRoles()){ roles.add(role.getName()); } loggedUserDto.setLogin(userLogin); } loggedUserDto.setRoles(roles); return loggedUserDto; }
Source:
<code>private void createMenu() { popupMenu = new JBPopupMenu(); popupMenu.setForeground(FOREGROUND_COLOR); <START> popupMenu.setBackground(BACKGROUND_COLOR); <END> menuItemPrefix = "Follow "; ISarosSession currentSession = session; FollowModeManager currentFollowModeManager = followModeManager; if (currentSession == null || currentFollowModeManager == null) { return; } for (User user : currentSession.getRemoteUsers()) { JMenuItem menuItem = createItemForUser(user); popupMenu.add(menuItem); } popupMenu.addSeparator(); JMenuItem leaveItem = new JMenuItem("Leave follow mode"); leaveItem.setForeground(FOREGROUND_COLOR); leaveItem.setBackground(BACKGROUND_COLOR); leaveItem.addActionListener(e -> followModeAction.execute(null)); leaveItem.setEnabled(currentFollowModeManager.getFollowedUser() != null); popupMenu.add(leaveItem); }</code><technical_language>Is this necessary for a JBPopupMenu</technical_language>

Target:
private void createMenu() { popupMenu = new JBPopupMenu(); popupMenu.setForeground(FOREGROUND_COLOR); popupMenu.setBackground(BACKGROUND_COLOR); menuItemPrefix = "Follow "; ISarosSession currentSession = session; FollowModeManager currentFollowModeManager = followModeManager; if (currentSession == null || currentFollowModeManager == null) { return; } for (User user : currentSession.getRemoteUsers()) { JMenuItem menuItem = createItemForUser(user); popupMenu.add(menuItem); } popupMenu.addSeparator(); JMenuItem leaveItem = new JBMenuItem("Leave follow mode"); leaveItem.setForeground(FOREGROUND_COLOR); leaveItem.setBackground(BACKGROUND_COLOR); leaveItem.addActionListener(e -> followModeAction.execute(null)); leaveItem.setEnabled(currentFollowModeManager.getFollowedUser() != null); popupMenu.add(leaveItem); }
Source:
<code>public void testKieSessionsPoolInMultithreadEnv() throws InterruptedException, ExecutionException { KieContainerSessionsPool pool = getKieContainer().newKieSessionsPool( 4 ); final int THREAD_NR = 10; <START> final ExecutorService executor = Executors.newFixedThreadPool(THREAD_NR, r -> { <END> final Thread t = new Thread(r); t.setDaemon(true); return t; }); final CompletionService<Boolean> ecs = new ExecutorCompletionService<>(executor); for (int i = 0; i < THREAD_NR; i++) { ecs.submit(() -> { try { KieSession ksession = pool.newKieSession(); checkKieSession( ksession ); ksession.dispose(); try { ksession.insert( "test2" ); fail("it shouldn't be possible to operate on a disposed session even if created from a pool"); } catch (Exception e) { } return true; } catch (final Exception e) { return false; } }); } boolean success = true; for (int i = 0; i < THREAD_NR; i++) { success = ecs.take().get() && success; } assertTrue( success ); pool.shutdown(); try { pool.newKieSession(); fail("after pool shutdown it shouldn't be possible to get sessions from it"); } catch (Exception e) { } }</code><technical_language>Please shutdown executor in a finally block</technical_language>

Target:
public void testKieSessionsPoolInMultithreadEnv() throws InterruptedException, ExecutionException { KieContainerSessionsPool pool = getKieContainer().newKieSessionsPool( 4 ); final int THREAD_NR = 10; ExecutorService executor = Executors.newFixedThreadPool(THREAD_NR, r -> { final Thread t = new Thread(r); t.setDaemon(true); return t; }); try { CompletionService<Boolean> ecs = new ExecutorCompletionService<>( executor ); for (int i = 0; i < THREAD_NR; i++) { ecs.submit( () -> { try { KieSession ksession = pool.newKieSession(); try { checkKieSession( ksession ); } finally { ksession.dispose(); } try { ksession.insert( "test2" ); fail( "it shouldn't be possible to operate on a disposed session even if created from a pool" ); } catch (IllegalStateException e) { } return true; } catch (final Exception e) { return false; } } ); } boolean success = true; for (int i = 0; i < THREAD_NR; i++) { success = ecs.take().get() && success; } assertTrue( success ); } finally { executor.shutdown(); } pool.shutdown(); try { pool.newKieSession(); fail("after pool shutdown it shouldn't be possible to get sessions from it"); } catch (IllegalStateException e) { } }
Source:
<code>private void scheduleExpiredLockReaper() { <START> reaperExecutor.scheduleAtFixedRate(() -> heldLocks.removeExpired(), <END> 0, LeaseExpirationTimer.LEASE_TIMEOUT_MILLIS / 2, TimeUnit.MILLISECONDS); }</code><technical_language>If this task throws, reaper get scheduled</technical_language>

Target:
private void scheduleExpiredLockReaper() { reaperExecutor.scheduleAtFixedRate(() -> { try { heldLocks.removeExpired(); } catch (Throwable t) { log.warn("Error while removing expired lock requests. Trying again on next iteration.", t); } }, 0, LeaseExpirationTimer.LEASE_TIMEOUT_MILLIS / 2, TimeUnit.MILLISECONDS); }
Source:
<code>public void judgmentReindexingJob() throws Exception { <START> <END> JobExecution jobExecution = jobLauncher.run(judgmentReindexingJob, new JobParameters()); JobExecutionAssertUtils.assertJobExecution(jobExecution, 0, ALL_JUDGMENTS_COUNT); solrJudgmentsServer.commit(); assertAllMarkedAsIndexed(); assertAllInIndex(ALL_JUDGMENTS_COUNT); }</code><technical_language>given/ execute/ assert</technical_language>

Target:
public void judgmentReindexingJob() throws Exception { JobExecution jobExecution = jobLauncher.run(judgmentReindexingJob, new JobParameters()); solrJudgmentsServer.commit(); JobExecutionAssertUtils.assertJobExecution(jobExecution, 0, ALL_JUDGMENTS_COUNT); assertAllMarkedAsIndexed(); assertAllInIndex(ALL_JUDGMENTS_COUNT); }
Source:
<code>public FieldLayout getRows(final ContentType contentType) { try { fixFields(fields, contentType.id()); final String rowsString = MAPPER.writeValueAsString(fields); return new FieldLayout(contentType, new JsonFieldTransformer(rowsString).asList()); <START> } catch (IOException e) { <END> throw new DotRuntimeException(e); } }</code><technical_language>Log error useful information here</technical_language>

Target:
public FieldLayout getRows(final ContentType contentType) { try { fixFields(fields, contentType.id()); final String rowsString = MAPPER.writeValueAsString(fields); return new FieldLayout(contentType, new JsonFieldTransformer(rowsString).asList()); } catch (IOException e) { Logger.error(MoveFieldsForm.class, String.format("Error moving fields to Content Type %s: %s", contentType.name(), e.getMessage())); throw new DotRuntimeException(e); } }
Source:
<code>public boolean execute(ArenaMaster am, CommandSender sender, String... args) { if (!Commands.isPlayer(sender)) { am.getGlobalMessenger().tell(sender, Msg.MISC_NOT_FROM_CONSOLE); return true; } Player p = Commands.unwrap(sender); Arena arena = am.getArenaWithPlayer(p); if (arena == null) { am.getGlobalMessenger().tell(p, Msg.NOT_IN_LOBBY); return true; <START> } else if (arena.inArena(p)) { <END> arena.getMessenger().tell(p, Msg.JOIN_ALREADY_PLAYING); return true; } else if (!arena.inLobby(p)) { arena.getMessenger().tell(p, Msg.NOT_IN_LOBBY); return true; } if (arena.getArenaPlayer(p).getArenaClass() != null) { arena.getMessenger().tell(p, Msg.LOBBY_PLAYER_READY); arena.playerReady(p); } else { arena.getMessenger().tell(p, Msg.LOBBY_PICK_CLASS); } return true; }</code><technical_language>I is a call inArena(), inSpec(). I of (the !inLobby() call is a perfectly good catch-all here). I I remove this branch branch catch cases</technical_language>

Target:
public boolean execute(ArenaMaster am, CommandSender sender, String... args) { if (!Commands.isPlayer(sender)) { am.getGlobalMessenger().tell(sender, Msg.MISC_NOT_FROM_CONSOLE); return true; } Player p = Commands.unwrap(sender); Arena arena = am.getArenaWithPlayer(p); if (arena == null) { am.getGlobalMessenger().tell(p, Msg.NOT_IN_LOBBY); } else if (!arena.inLobby(p)) { arena.getMessenger().tell(p, Msg.NOT_IN_LOBBY); } else if (arena.getArenaPlayer(p).getArenaClass() != null) { arena.getMessenger().tell(p, Msg.LOBBY_PLAYER_READY); arena.playerReady(p); } else { arena.getMessenger().tell(p, Msg.LOBBY_PICK_CLASS); } return true; }
Source:
<code>public void populateClan(ChatChannelUser chatChannelUser) { <START> if (chatChannelUser.isDisplayed()) { if (chatChannelUser.getClan().isEmpty()) { chatChannelUser.getPlayer().ifPresent(player -> { if (player.getClan() != null) { clanService.getClanByTag(player.getClan()) .thenAccept(optionalClan -> Platform.runLater(() -> { if (optionalClan.isPresent()) { chatChannelUser.setClan(optionalClan.get()); } else { chatChannelUser.setClan(null); } }) ); } else { chatChannelUser.setClan(null); } }); } } else { chatChannelUser.setClan(null); <END> } }</code><technical_language>refactor this is readable anymore. extracted methods. nesting</technical_language>

Target:
public void populateClan(ChatChannelUser chatChannelUser) { if (chatChannelUser.isDisplayed()) { if (!chatChannelUser.getClan().isEmpty()) { return; } chatChannelUser.getPlayer().ifPresent(player -> { if (player.getClan() != null) { clanService.getClanByTag(player.getClan()) .thenAccept(optionalClan -> Platform.runLater(() -> { Clan clan = optionalClan.orElse(null); chatChannelUser.setClan(clan); }) ); } else { chatChannelUser.setClan(null); } }); } else { chatChannelUser.setClan(null); } }
Source:
<code>public void checkTriggers(final Calendar cal) { <START> for (ComputedFolder<?> p : Jenkins.getInstance().getAllItems(ComputedFolder.class)) { <END> for (Trigger<?> t : p.getTriggers().values()) { LOGGER.log(Level.FINE, "cron checking {0}", p.getName()); CronTabList tabs; try { tabs = (CronTabList) this.tabsField.get(t); } catch (IllegalAccessException e) { continue; } if (tabs.check(cal)) { LOGGER.log(Level.CONFIG, "cron triggered {0}", p.getName()); try { t.run(); } catch (Throwable e) { LOGGER.log(Level.WARNING, t.getClass().getName() + ".run() failed for " + p.getName(), e); } } } } }</code><technical_language>allItems save sorting list</technical_language>

Target:
public void checkTriggers(final Calendar cal) { for (ComputedFolder<?> p : Jenkins.getInstance().allItems(ComputedFolder.class)) { for (Trigger<?> t : p.getTriggers().values()) { LOGGER.log(Level.FINE, "cron checking {0}", p.getName()); CronTabList tabs; try { tabs = (CronTabList) this.tabsField.get(t); } catch (IllegalAccessException e) { continue; } if (tabs.check(cal)) { LOGGER.log(Level.CONFIG, "cron triggered {0}", p.getName()); try { t.run(); } catch (Throwable e) { LOGGER.log(Level.WARNING, t.getClass().getName() + ".run() failed for " + p.getName(), e); } } } } }
Source:
<code>public void should_expose_warnings_on_execution_info() { final String query = String.format( "BEGIN UNLOGGED BATCH\n" + "INSERT INTO test (k, v) VALUES (1, '%s')\n" + "INSERT INTO test (k, v) VALUES (2, '%s')\n" + "APPLY BATCH", Strings.repeat("1", 2 * 1024), Strings.repeat("1", 3 * 1024)); Statement<?> st = SimpleStatement.builder(String.format(query)).build(); ResultSet result = sessionRule.session().execute(st); ExecutionInfo executionInfo = result.getExecutionInfo(); assertThat(executionInfo).isNotNull(); List<String> warnings = executionInfo.getWarnings(); assertThat(warnings).isNotEmpty(); <START> verify(appender, after(500).atLeast(1)).doAppend(loggingEventCaptor.capture()); <END> assertThat(loggingEventCaptor.getValue().getMessage()).isNotNull(); boolean testPassed = false; for (ILoggingEvent log : loggingEventCaptor.getAllValues()) { String logMessage = log.getFormattedMessage(); assertThat(logMessage) .startsWith("Query '") .contains(query.substring(0, RequestLogger.DEFAULT_REQUEST_LOGGER_MAX_QUERY_LENGTH)) .contains("' generated server side warning(s): "); if (logMessage.contains("Batch")) { assertThat(logMessage) .contains(String.format("for [%s.test] is of size", sessionRule.keyspace().asCql(true))) .contains("exceeding specified threshold"); testPassed = true; break; } } assertThat(testPassed).isTrue(); }</code><technical_language>is a reason works in way</technical_language>

Target:
public void should_expose_warnings_on_execution_info() { final String query = String.format( "BEGIN UNLOGGED BATCH\n" + "INSERT INTO test (k, v) VALUES (1, '%s')\n" + "INSERT INTO test (k, v) VALUES (2, '%s')\n" + "APPLY BATCH", Strings.repeat("1", 2 * 1024), Strings.repeat("1", 3 * 1024)); Statement<?> st = SimpleStatement.builder(query).build(); ResultSet result = sessionRule.session().execute(st); ExecutionInfo executionInfo = result.getExecutionInfo(); assertThat(executionInfo).isNotNull(); List<String> warnings = executionInfo.getWarnings(); assertThat(warnings).isNotEmpty(); verify(appender, timeout(500).atLeast(1)).doAppend(loggingEventCaptor.capture()); List<String> logMessages = loggingEventCaptor .getAllValues() .stream() .map(ILoggingEvent::getFormattedMessage) .collect(Collectors.toList()); assertThat(logMessages) .anySatisfy( logMessage -> assertThat(logMessage) .startsWith("Query '") .contains( query.substring(0, RequestLogger.DEFAULT_REQUEST_LOGGER_MAX_QUERY_LENGTH)) .contains("' generated server side warning(s): ") .contains("Batch") .contains( String.format( "for [%s.test] is of size", sessionRule.keyspace().asCql(true))) .contains("exceeding specified threshold")); }
Source:
<code>protected Item createRssItem(FeedMetadata feedMetadata, Map<String, Object> article) { Item item = new Item(); item.setTitle(Strings.isNullOrEmpty((String) article.get("title_display")) ? <START> (String) article.get("title") : (String) article.get("title_display")); <END> item.setLink(getArticleLink(feedMetadata, article)); Guid guid = new Guid(); guid.setValue((String) article.get("id")); guid.setPermaLink(false); item.setGuid(guid); item.setPubDate(getPubDate(feedMetadata, article)); List<String> authorList = (List<String>) article.get("author_display"); if (authorList != null) { item.setAuthor(AUTHOR_JOINER.join(authorList)); } item.setDescription(buildRssDescription(article)); return item; }</code><technical_language>extract places this is done a static method</technical_language>

Target:
protected Item createRssItem(FeedMetadata feedMetadata, Map<String, Object> article) { Item item = new Item(); item.setTitle(getArticleTitle(article)); item.setLink(getArticleLink(feedMetadata, article)); Guid guid = new Guid(); guid.setValue((String) article.get("id")); guid.setPermaLink(false); item.setGuid(guid); item.setPubDate(getPubDate(feedMetadata, article)); List<String> authorList = (List<String>) article.get("author_display"); if (authorList != null) { item.setAuthor(AUTHOR_JOINER.join(authorList)); } item.setDescription(buildRssDescription(article)); return item; }
Source:
<code>public void onNotification(Notification notification) { if (!(notification.getType() instanceof CoreNotificationType)) return; CoreNotificationType type = (CoreNotificationType) notification.getType(); if (type != CONSUMER_CREATED) return; TypedProperties props = notification.getProperties(); SimpleString protocolName = props.getSimpleStringProperty(ManagementHelper.HDR_PROTOCOL_NAME); if (protocolName == null || !protocolName.toString().equals(MQTTProtocolManagerFactory.MQTT_PROTOCOL_NAME)) return; int distance = props.getIntProperty(ManagementHelper.HDR_DISTANCE); if (distance > 0) { SimpleString queueName = props.getSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME); Binding binding = server.getPostOffice().getBinding(queueName); if (binding != null) { Queue queue = (Queue) binding.getBindable(); String clientId = props.getSimpleStringProperty(ManagementHelper.HDR_CLIENT_ID).toString(); Collection<Consumer> consumersSet = queue.getConsumers(); for (Consumer consumer : consumersSet) { <START> ServerConsumerImpl serverConsumer = (ServerConsumerImpl) consumer; <END> if (clientId.equals(serverConsumer.getConnectionClientID())) serverConsumer.getRemotingConnection().destroy(); } } } }</code><technical_language>Cast interface ServerConsumer, concrete class</technical_language>

Target:
public void onNotification(Notification notification) { if (!(notification.getType() instanceof CoreNotificationType)) return; CoreNotificationType type = (CoreNotificationType) notification.getType(); if (type != CoreNotificationType.SESSION_CREATED) return; TypedProperties props = notification.getProperties(); SimpleString protocolName = props.getSimpleStringProperty(ManagementHelper.HDR_PROTOCOL_NAME); if (protocolName == null || !protocolName.toString().equals(MQTTProtocolManagerFactory.MQTT_PROTOCOL_NAME)) return; int distance = props.getIntProperty(ManagementHelper.HDR_DISTANCE); if (distance > 0) { String clientId = props.getSimpleStringProperty(ManagementHelper.HDR_CLIENT_ID).toString(); MQTTConnection mqttConnection = connectedClients.get(clientId); if (mqttConnection != null) { mqttConnection.destroy(); } } }
Source:
<code>public Builder baseUrl(URL val) { <START> return baseUri(UrlFunctions.URI_FROM_STRING.apply(val.toString())); <END> }</code><technical_language>URI.create(val.toString())? Also, I forbid null passed in immediately</technical_language>

Target:
public Builder baseUrl(URL val) { return baseUri(Urls.URI_FROM_STRING.apply(val.toString())); }
Source:
<code><START> @Override public String toString () { <END> return "DataNode[" + getHostname() + ":" + getPort() + "]"; }</code><technical_language>formatting is this? @override method</technical_language>

Target:
public String toString() { return "DataNode[" + getHostname() + ":" + getPort() + "]"; }
Source:
<code>private void logStaleCheckBatchResults(StaleCheckBatchProcessResults staleCheckBatchProcessResults) { <START> LOG.info("processStaleCheckBatchFiles: =============================================="); <END> LOG.info("processStaleCheckBatchFiles: ==== Summary of Stale Check Batch ===="); LOG.info("processStaleCheckBatchFiles: =============================================="); LOG.info("processStaleCheckBatchFiles: Files loaded successfully: " + staleCheckBatchProcessResults.getNumSuccessFiles()); LOG.info("processStaleCheckBatchFiles: Files loaded with one or more failed rows: " + staleCheckBatchProcessResults.getNumPartialFiles()); if (!staleCheckBatchProcessResults.getPartialProcessingSummary().isEmpty()) { for (String failingFileName : staleCheckBatchProcessResults.getPartialProcessingSummary().keySet()) { List<String> errorsEncountered = staleCheckBatchProcessResults.getPartialProcessingSummary().get(failingFileName); LOG.error("processStaleCheckBatchFiles: Stale Check Batch input file contained "+ errorsEncountered.size() + " rows that could not be processed. (" + failingFileName + ")"); for (String dataError : errorsEncountered) { LOG.error("processStaleCheckBatchFiles: " + dataError); } } } LOG.info("processStaleCheckBatchFiles: Files with errors: " + staleCheckBatchProcessResults.getNumErrorFiles()); LOG.info("processStaleCheckBatchFiles: ====================="); LOG.info("processStaleCheckBatchFiles: ==== End Summary ===="); }</code><technical_language>function name in log messages updated</technical_language>

Target:
private void logStaleCheckBatchResults(StaleCheckBatchProcessResults staleCheckBatchProcessResults) { LOG.info("logStaleCheckBatchResults: =============================================="); LOG.info("logStaleCheckBatchResults: ==== Summary of Stale Check Batch ===="); LOG.info("logStaleCheckBatchResults: =============================================="); LOG.info("logStaleCheckBatchResults: Files loaded successfully: " + staleCheckBatchProcessResults.getNumSuccessFiles()); LOG.info("logStaleCheckBatchResults: Files loaded with one or more failed rows: " + staleCheckBatchProcessResults.getNumPartialFiles()); if (!staleCheckBatchProcessResults.getPartialProcessingSummary().isEmpty()) { for (String failingFileName : staleCheckBatchProcessResults.getPartialProcessingSummary().keySet()) { List<String> errorsEncountered = staleCheckBatchProcessResults.getPartialProcessingSummary().get(failingFileName); LOG.error("logStaleCheckBatchResults: Stale Check Batch input file contained "+ errorsEncountered.size() + " rows that could not be processed. (" + failingFileName + ")"); for (String dataError : errorsEncountered) { LOG.error("logStaleCheckBatchResults: " + dataError); } } } LOG.info("logStaleCheckBatchResults: Files with errors: " + staleCheckBatchProcessResults.getNumErrorFiles()); LOG.info("logStaleCheckBatchResults: ====================="); LOG.info("logStaleCheckBatchResults: ==== End Summary ===="); }
Source:
<code>public boolean isDeviceOnline() { <START> NetworkInfo networkInfo = getConnectivityNetwork(); <END> return networkInfo!=null && networkInfo.isConnected(); }</code><technical_language>ConnectivityManager modified this issue, please merge <LINK_0> branch this changes resolve conflicts</technical_language>

Target:
public boolean isDeviceOnline() { ConnectivityType connectivityType = getConnectivityType(); return connectivityType == ConnectivityType.MOBILE || connectivityType == ConnectivityType.WIFI; }
Source:
<code>private void revealDiskPanel(final AbstractDiskModel disk) { boolean isInVm = disk.getVm() != null; diskTypePanel.setVisible(isNewLunDiskEnabled); externalDiskPanel.setVisible(isNewLunDiskEnabled && disk.getDiskStorageType().getEntity() == DiskStorageType.LUN); <START> diskErrorPolicyEditor.setVisible(disk.getDiskStorageType().getEntity() != DiskStorageType.LUN); <END> aliasEditor.setFocus(!isInVm); }</code><technical_language>editor is bounded diskErrorPolicy entity, visibility altered model. 'AbstractDiskModel -> diskStorageType_EntityChanged()'</technical_language>

Target:
private void revealDiskPanel(final AbstractDiskModel disk) { boolean isInVm = disk.getVm() != null; diskTypePanel.setVisible(isNewLunDiskEnabled); externalDiskPanel.setVisible(isNewLunDiskEnabled && disk.getDiskStorageType().getEntity() == DiskStorageType.LUN); aliasEditor.setFocus(!isInVm); }