auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean onOptionsItemSelected(MenuItem item) { boolean retval = true; switch (item.getItemId()) { case R.id.action_create_dir: { CreateFolderDialogFragment dialog = CreateFolderDialogFragment.newInstance(getCurrentDir()); dialog.show(getSupportFragmentManager(), "createdirdialog"); break; } case R.id.action_sync_account: { startSynchronization(); break; } case R.id.action_upload: { showDialog(DIALOG_CHOOSE_UPLOAD_SOURCE); break; } case R.id.action_settings: { Intent settingsIntent = new Intent(this, Preferences.class); startActivity(settingsIntent); break; } case android.R.id.home: { FileFragment second = getSecondFragment(); OCFile currentDir = getCurrentDir(); if((currentDir != null && currentDir.getParentId() != 0) || (second != null && second.getFile() != null)) { onBackPressed(); } break; } case R.id.action_sort: { SharedPreferences appPreferences = PreferenceManager .getDefaultSharedPreferences(getApplicationContext()); Integer sortOrder = appPreferences .getInt("sortOrder", 0); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.actionbar_sort_title) .setSingleChoiceItems(R.array.actionbar_sortby, sortOrder , new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { switch (which){ case 0: sortByName(true); break; case 1: sortByDate(false); break; } dialog.dismiss(); } }); builder.create().show(); break; } default: retval = super.onOptionsItemSelected(item); } return retval; }

Target:
public boolean onOptionsItemSelected(MenuItem item) { boolean retval = true; switch (item.getItemId()) { case R.id.action_create_dir: { CreateFolderDialogFragment dialog = CreateFolderDialogFragment.newInstance(getCurrentDir()); dialog.show(getSupportFragmentManager(), "createdirdialog"); break; } case R.id.action_sync_account: { startSynchronization(); break; } case R.id.action_upload: { showDialog(DIALOG_CHOOSE_UPLOAD_SOURCE); break; } case R.id.action_settings: { Intent settingsIntent = new Intent(this, Preferences.class); startActivity(settingsIntent); break; } case android.R.id.home: { FileFragment second = getSecondFragment(); OCFile currentDir = getCurrentDir(); if((currentDir != null && currentDir.getParentId() != 0) || (second != null && second.getFile() != null)) { onBackPressed(); } break; } case R.id.action_sort: { SharedPreferences appPreferences = PreferenceManager .getDefaultSharedPreferences(this); Integer sortOrder = appPreferences .getInt("sortOrder", FileListListAdapter.SORT_NAME); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.actionbar_sort_title) .setSingleChoiceItems(R.array.actionbar_sortby, sortOrder , new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { switch (which){ case 0: sortByName(true); break; case 1: sortByDate(false); break; } dialog.dismiss(); } }); builder.create().show(); break; } default: retval = super.onOptionsItemSelected(item); } return retval; }
Source:
public boolean processRow(ExportRow rd) throws ExportDecoderBase.RestartBlockException { try { if (haplist.isEmpty()) { connect(haplist); } if (haplist.isEmpty()) { m_logger.rateLimitedLog(120, Level.ERROR, null, "Failed to connect to export socket endpoint %s, some servers may be down.", host); throw new RestartBlockException(true); } if (m_logger.isDebugEnabled()) { m_logger.warn(m_source.tableName + ":P" + m_source.partitionId + " sending seqNum: " + rd.values[2]); } String decoded = m_decoder.decode(rd.generation, rd.tableName, rd.types, rd.names,null, rd.values).concat("\n"); byte b[] = decoded.getBytes(); ByteBuffer buf = ByteBuffer.allocate(b.length); buf.put(b); buf.flip(); for (OutputStream hap : haplist.values()) { hap.write(buf.array()); hap.flush(); } } catch (Exception e) { m_logger.error(e.getLocalizedMessage()); haplist.clear(); throw new RestartBlockException(true); } return true; }

Target:
public boolean processRow(ExportRow rd) throws ExportDecoderBase.RestartBlockException { try { if (haplist.isEmpty()) { connect(haplist); } if (haplist.isEmpty()) { m_logger.rateLimitedLog(120, Level.ERROR, null, "Failed to connect to export socket endpoint %s, some servers may be down.", host); throw new RestartBlockException(true); } if (m_logger.isDebugEnabled()) { m_logger.debug(m_source.tableName + ":P" + m_source.partitionId + " sending seqNum: " + rd.values[2]); } String decoded = m_decoder.decode(rd.generation, rd.tableName, rd.types, rd.names,null, rd.values).concat("\n"); byte b[] = decoded.getBytes(); ByteBuffer buf = ByteBuffer.allocate(b.length); buf.put(b); buf.flip(); for (OutputStream hap : haplist.values()) { hap.write(buf.array()); hap.flush(); } } catch (Exception e) { m_logger.error(e.getLocalizedMessage()); haplist.clear(); throw new RestartBlockException(true); } return true; }
Source:
private boolean checkInstanceLocation(Location instanceLocation, Shell shell, IEclipseContext context) { if (Boolean.FALSE.equals(context.get(IWorkbench.PERSIST_STATE))) { return true; } if (instanceLocation == null) { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceMandatoryTitle, WorkbenchSWTMessages.IDEApplication_workspaceMandatoryMessage); return false; } if (instanceLocation.isSet()) { if (!checkValidWorkspace(shell, instanceLocation.getURL())) { return false; } try { if (instanceLocation.lock()) { writeWorkspaceVersion(); return true; } File workspaceDirectory = new File(instanceLocation.getURL() .getFile()); if (workspaceDirectory.exists()) { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotLockTitle, WorkbenchSWTMessages.IDEApplication_workspaceCannotLockMessage); } else { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetTitle, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetMessage); } } catch (IOException e) { Logger logger = new WorkbenchLogger(PLUGIN_ID); logger.error(e); MessageDialog.openError(shell, WorkbenchSWTMessages.InternalError, e.getMessage()); } return false; } return false; }

Target:
private boolean checkInstanceLocation(Location instanceLocation, Shell shell, IEclipseContext context) { if (instanceLocation == null && Boolean.FALSE.equals(context.get(IWorkbench.PERSIST_STATE))) { return true; } if (instanceLocation == null) { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceMandatoryTitle, WorkbenchSWTMessages.IDEApplication_workspaceMandatoryMessage); return false; } if (instanceLocation.isSet()) { if (!checkValidWorkspace(shell, instanceLocation.getURL())) { return false; } try { if (instanceLocation.lock()) { writeWorkspaceVersion(); return true; } File workspaceDirectory = new File(instanceLocation.getURL() .getFile()); if (workspaceDirectory.exists()) { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotLockTitle, WorkbenchSWTMessages.IDEApplication_workspaceCannotLockMessage); } else { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetTitle, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetMessage); } } catch (IOException e) { Logger logger = new WorkbenchLogger(PLUGIN_ID); logger.error(e); MessageDialog.openError(shell, WorkbenchSWTMessages.InternalError, e.getMessage()); } return false; } return false; }
Source:
@Override public void init(StreamGraph graph, Config config) { MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", (k, m) -> (PageViewEvent) m); OutputStream<String, PageViewCount, PageViewCount> pageViewEventPerMemberStream = graph .getOutputStream("pageViewEventPerMemberStream", m -> m.memberId, m -> m); Supplier<Integer> initialValue = () -> 0; pageViewEvents .window(Windows.<PageViewEvent, String, Integer>keyedTumblingWindow(m -> m.memberId, Duration.ofSeconds(10), initialValue, (m, c) -> c + 1) .setEarlyTrigger(Triggers.repeat(Triggers.count(5))) .setAccumulationMode(AccumulationMode.DISCARDING)) .map(PageViewCount::new) .sendTo(pageViewEventPerMemberStream); }

Target:
@Override public void init(StreamGraph graph, Config config) { MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", (k, m) -> (PageViewEvent) m); OutputStream<String, PageViewCount, PageViewCount> pageViewEventPerMemberStream = graph .getOutputStream("pageViewEventPerMemberStream", m -> m.memberId, m -> m); Supplier<Integer> initialValue = () -> 0; FoldLeftFunction<PageViewEvent, Integer> foldLeftFn = (m, c) -> c + 1; pageViewEvents .window(Windows.keyedTumblingWindow(m -> m.memberId, Duration.ofSeconds(10), initialValue, foldLeftFn) .setEarlyTrigger(Triggers.repeat(Triggers.count(5))) .setAccumulationMode(AccumulationMode.DISCARDING)) .map(PageViewCount::new) .sendTo(pageViewEventPerMemberStream); }
Source:
public Response createIssue( @FormParam("title") String title, @FormParam("description") String description, @FormParam("assignee") String assigneeNetID, @FormParam("labels") List<Long> labels) throws IOException{ Issue issue = new Issue(); issue.setTitle(title); issue.setDescription(description); issue.setOpen(true); User assignee = users.findByNetId(assigneeNetID); checkCollaborator(assignee); issue.setAssignee(assignee); issue.setRepository(getRepositoryEntity()); issue.getLabels().clear(); issue.getLabels().addAll(getRepositoryEntity().getLabels().stream().filter( x -> labels.contains(x.getLabelId())) .collect(Collectors.toSet())); issueBackend.createIssue(getRepositoryApi(getRepositoryEntity()), issue); return redirect(issue.getURI().toString()); }

Target:
public Response createIssue( @FormParam("title") String title, @FormParam("description") String description, @FormParam("assignee") String assigneeNetID, @FormParam("labels") List<Long> labels) throws IOException{ Issue issue = new Issue(); issue.setTitle(title); issue.setDescription(description); issue.setOpen(true); if (!Strings.isNullOrEmpty(assigneeNetID)) { User assignee = users.findByNetId(assigneeNetID); checkCollaborator(assignee); issue.setAssignee(assignee); } else { issue.setAssignee(null); } issue.setRepository(getRepositoryEntity()); issue.setLabels(getRepositoryEntity().getLabels().stream().filter( x -> labels.contains(x.getLabelId())) .collect(Collectors.toSet())); issueBackend.createIssue(getRepositoryApi(getRepositoryEntity()), issue); return redirect(issue.getURI().toString()); }
Source:
public void test_tokens() { TestPythonCheck check = new TestPythonCheck() { private List<Token> ignoreList; @Override public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> { ignoreList = new ArrayList<>(); }); context.registerSyntaxNodeConsumer(Tree.Kind.TOKEN, ctx -> { PyToken pyToken = (PyToken) ctx.syntaxNode(); if (ignoreList.contains(pyToken.token())) { return; } ignoreList.add(pyToken.token()); for (Trivia trivia : pyToken.trivia()) { if (trivia.isComment()) { ctx.addIssue(new PyTokenImpl(trivia.getToken()), MESSAGE); } } }); } }; List<PreciseIssue> issues = scanFileForIssues(FILE, check); assertThat(issues).hasSize(1); assertThat(issues.get(0).primaryLocation().startLine()).isEqualTo(5); assertThat(issues.get(0).primaryLocation().endLine()).isEqualTo(5); }

Target:
public void test_tokens() { TestPythonCheck check = new TestPythonCheck() { @Override public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.TOKEN, ctx -> { Token pyToken = (Token) ctx.syntaxNode(); if (pyToken.value().equals("def")) { ctx.addIssue(pyToken, MESSAGE); } }); } }; List<PreciseIssue> issues = scanFileForIssues(FILE, check); assertThat(issues).hasSize(2); assertThat(issues.get(0).primaryLocation().startLine()).isEqualTo(1); assertThat(issues.get(1).primaryLocation().startLine()).isEqualTo(7); }
Source:
public void getParameterName_NewAnnotation() throws NoSuchMethodException { String actualResult = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_6, FIRST_INDEX); assertEquals(SECOND_NAME_PARAM_ANNOTATION, actualResult); }

Target:
public void getParameterName_NewAnnotation() throws NoSuchMethodException { String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_6, FIRST_INDEX); assertEquals(SECOND_NAME_PARAM_ANNOTATION, actualRes); }
Source:
private void updateCommitButtons() { final IndexDiffData indexDiff = doReload(currentRepository); boolean indexDiffAvailable = indexDiffAvailable(indexDiff); boolean noConflicts = noConflicts(indexDiff); boolean hasErrorsOrWarnings = hasErrorsOrWarnings(); boolean commitEnabled = commitEnabled(indexDiffAvailable, noConflicts, hasErrorsOrWarnings); boolean commitAndPushEnabled = commitAndPushEnabled(commitEnabled); commitButton.setEnabled(commitEnabled); commitAndPushButton.setEnabled(commitAndPushEnabled); }

Target:
private void updateCommitButtons() { IndexDiffData indexDiff; if (cacheEntry != null) { indexDiff = cacheEntry.getIndexDiff(); } else { indexDiff = doReload(currentRepository); } boolean indexDiffAvailable = indexDiffAvailable(indexDiff); boolean noConflicts = noConflicts(indexDiff); boolean hasErrorsOrWarnings = hasErrorsOrWarnings(); boolean commitEnabled = commitEnabled(indexDiffAvailable, noConflicts, hasErrorsOrWarnings); boolean commitAndPushEnabled = commitAndPushEnabled(commitEnabled); commitButton.setEnabled(commitEnabled); commitAndPushButton.setEnabled(commitAndPushEnabled); }
Source:
private void listenToSetDnsConfigurationCheckboxChanges() { Event<EventArgs> entityChangedEvent = setDnsConfiguration.getEntityChangedEvent(); entityChangedEvent.clearListeners(); entityChangedEvent.addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { nameServerModelListModel.setIsChangeable(setDnsConfiguration.getEntity()); } }); }

Target:
private void listenToSetDnsConfigurationCheckboxChanges() { Event<EventArgs> entityChangedEvent = shouldSetDnsConfiguration.getEntityChangedEvent(); entityChangedEvent.addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { nameServerModelListModel.setIsChangeable(shouldSetDnsConfiguration.getEntity()); } }); }
Source:
@Test void testSortCalcWhenCastLeadingToMonotonic() { final String sql = "select deptno from sales.emp order by cast(deptno as float) desc"; Query.create(sql) .addRule(ProjectToCalcRule.INSTANCE) .addRule(EnumerableRules.ENUMERABLE_CALC_RULE) .removeRule(EnumerableRules.ENUMERABLE_SORT_RULE) .removeRule(EnumerableRules.ENUMERABLE_PROJECT_RULE) .check(); }

Target:
@Test void testSortCalcWhenCastLeadingToMonotonic() { final String sql = "select cast(deptno as float) from sales.emp order by deptno desc"; Query.create(sql) .addRule(ProjectToCalcRule.INSTANCE) .addRule(EnumerableRules.ENUMERABLE_CALC_RULE) .removeRule(EnumerableRules.ENUMERABLE_SORT_RULE) .removeRule(EnumerableRules.ENUMERABLE_PROJECT_RULE) .check(); }
Source:
private Properties streamsConfiguration() { final String safeTestName = safeUniqueTestName(getClass(), testName); final Properties config = new Properties(); config.put(StreamsConfig.TOPOLOGY_OPTIMIZATION, StreamsConfig.OPTIMIZE); config.put(StreamsConfig.APPLICATION_ID_CONFIG, "app-" + safeTestName); config.put(StreamsConfig.APPLICATION_SERVER_CONFIG, "localhost:" + (++port)); config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, cluster.bootstrapServers()); config.put(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory().getPath()); config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.Integer().getClass()); config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.Integer().getClass()); config.put(StreamsConfig.NUM_STANDBY_REPLICAS_CONFIG, 1); config.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 100); config.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 200); config.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, 1000); config.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 100); config.put(StreamsConfig.NUM_STREAM_THREADS_CONFIG, 2); return config; }

Target:
private Properties streamsConfiguration() { final String safeTestName = safeUniqueTestName(getClass(), testName); final Properties config = new Properties(); config.put(StreamsConfig.TOPOLOGY_OPTIMIZATION, StreamsConfig.OPTIMIZE); config.put(StreamsConfig.APPLICATION_ID_CONFIG, "app-" + safeTestName); config.put(StreamsConfig.APPLICATION_SERVER_CONFIG, "localhost:" + (++port)); config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, cluster.bootstrapServers()); config.put(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory().getPath()); config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.Integer().getClass()); config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.Integer().getClass()); config.put(StreamsConfig.NUM_STANDBY_REPLICAS_CONFIG, 1); config.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 100); config.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 200); config.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, 1000); config.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 100); return config; }
Source:
public Timer setDelay(long delay, TimeUnit timeUnit) { if (delay < 0) { throw new IllegalArgumentException("Delay must be greater than zero"); } long millis = timeUnit.toMillis(delay); int factor = ConfigurationFactory.get().getTestTimeoutFactor(); if (factor == 100) { this.delay = millis; } else { long numerator = millis * factor; if (numerator % 100 == 0) { this.delay = numerator / 100; } else { this.delay = (numerator / 100) + 1; } } return this; }

Target:
public Timer setDelay(long delay, TimeUnit timeUnit) { if (delay <= 0) { throw new IllegalArgumentException("Delay must be greater than zero"); } this.delay = (timeUnit.toMillis(delay) * ConfigurationFactory.get().getTestTimeoutFactor() -1) / 100 + 1; return this; }
Source:
public static File writeToTempFile(InputStream is, String prefix, String suffix) { File tmpWarFile; try { tmpWarFile = File.createTempFile(prefix, suffix); } catch (IOException e) { throw Throwables.propagate(e); } tmpWarFile.deleteOnExit(); OutputStream out = null; try { if (is == null) throw new NullPointerException(); out = new FileOutputStream(tmpWarFile); ByteStreams.copy(is, out); } catch (IOException e) { throw Throwables.propagate(e); } finally { Closeables.closeQuietly(is); Closeables.closeQuietly(out); } return tmpWarFile; }

Target:
public static File writeToTempFile(InputStream is, String prefix, String suffix) { if (is == null) throw new NullPointerException("Input stream required to create temp file for "+prefix+"*"+suffix); File tempFile; try { tempFile = File.createTempFile(prefix, suffix); } catch (IOException e) { throw Throwables.propagate(e); } tempFile.deleteOnExit(); OutputStream out = null; try { out = new FileOutputStream(tempFile); ByteStreams.copy(is, out); } catch (IOException e) { throw Throwables.propagate(e); } finally { Closeables.closeQuietly(is); Closeables.closeQuietly(out); } return tempFile; }
Source:
public static <V extends View<GenericData.Record>> V load(URI uri) { return Datasets.<GenericData.Record, V>load(uri, GenericData.Record.class); }

Target:
public static <V extends View<GenericRecord>> V load(URI uri) { return Datasets.<GenericRecord, V>load(uri, GenericRecord.class); }
Source:
private Diff findMasterEquivalence(Diff diff, boolean mergeRightToLeft) { Diff masterDiff; final List<Diff> equivalentDiffs = diff.getEquivalence().getDifferences(); final Optional<Diff> firstConflicting = Iterables.tryFind(equivalentDiffs, hasConflict(ConflictKind.REAL)); if (diff instanceof ReferenceChange) { final ReferenceChange referenceChange = (ReferenceChange)diff; masterDiff = getMasterEquivalenceForReferenceChange(referenceChange, mergeRightToLeft); } else if (diff instanceof FeatureMapChange) { final FeatureMapChange featureMapChange = (FeatureMapChange)diff; masterDiff = getMasterEquivalenceForFeatureMapChange(featureMapChange, mergeRightToLeft); } else { masterDiff = null; } if (!hasRealConflict(masterDiff)) { if (hasRealConflict(diff)) { masterDiff = null; } else if (firstConflicting.isPresent()) { masterDiff = firstConflicting.get(); } } return masterDiff; }

Target:
private Diff findMasterEquivalence(Diff diff, boolean mergeRightToLeft) { final List<Diff> equivalentDiffs = diff.getEquivalence().getDifferences(); final Optional<Diff> firstConflicting = Iterables.tryFind(equivalentDiffs, hasConflict(ConflictKind.REAL)); final Diff idealMasterDiff; if (diff instanceof ReferenceChange) { final ReferenceChange referenceChange = (ReferenceChange)diff; idealMasterDiff = getMasterEquivalenceForReferenceChange(referenceChange, mergeRightToLeft); } else if (diff instanceof FeatureMapChange) { final FeatureMapChange featureMapChange = (FeatureMapChange)diff; idealMasterDiff = getMasterEquivalenceForFeatureMapChange(featureMapChange, mergeRightToLeft); } else { idealMasterDiff = null; } final Diff masterDiff; if (firstConflicting.isPresent() && !hasRealConflict(idealMasterDiff)) { if (hasRealConflict(diff)) { masterDiff = null; } else { masterDiff = firstConflicting.get(); } } else { masterDiff = idealMasterDiff; } return masterDiff; }
Source:
public void setTechOfficer(Person p) { setTechOfficer(Objects.requireNonNull(p), false); }

Target:
public void setTechOfficer(Person p) { setTechOfficer(p, false); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle(R.string.announcement_title); setApplyPrevTransitionOnRestart(true); bundle = getIntent().getBundleExtra(Router.EXTRA_BUNDLE); offlineBar = findViewById(R.id.offline_bar); if (!(NetworkUtil.isConnected(this))) { AppConstants.offline_flag = true; invalidateOptionsMenu(); if(offlineBar!=null){ offlineBar.setVisibility(View.VISIBLE); } } try{ EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) bundle .getSerializable(Router.EXTRA_ENROLLMENT); if ( courseData != null ) { activityTitle = courseData.getCourse().getName(); try{ environment.getSegment().screenViewsTracking(courseData.getCourse().getName()); }catch(Exception e){ logger.error(e); } } else { boolean handleFromNotification = handleIntentFromNotification(); if (!handleFromNotification) { environment.getRouter().showMyCourses(this); finish(); } } }catch(Exception ex){ environment.getRouter().showMyCourses(this); finish(); logger.error(ex); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setApplyPrevTransitionOnRestart(true); bundle = getIntent().getBundleExtra(Router.EXTRA_BUNDLE); offlineBar = findViewById(R.id.offline_bar); if (!(NetworkUtil.isConnected(this))) { AppConstants.offline_flag = true; invalidateOptionsMenu(); if(offlineBar!=null){ offlineBar.setVisibility(View.VISIBLE); } } try{ EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) bundle .getSerializable(Router.EXTRA_ENROLLMENT); if ( courseData != null ) { activityTitle = courseData.getCourse().getName(); try{ environment.getSegment().screenViewsTracking(courseData.getCourse().getName()); }catch(Exception e){ logger.error(e); } } else { boolean handleFromNotification = handleIntentFromNotification(); if (!handleFromNotification) { environment.getRouter().showMyCourses(this); finish(); } } }catch(Exception ex){ environment.getRouter().showMyCourses(this); finish(); logger.error(ex); } }
Source:
public void removeCron(String id) { try { quartzSched.deleteJob(new JobKey(id, "note")); } catch (SchedulerException e) { logger.error("Can't remove quertz " + id, e); } Note notebook = getNote(id); Map<String, Object> config = notebook.getConfig(); config.put("cron", null); }

Target:
public void removeCron(String id) { try { quartzSched.deleteJob(new JobKey(id, "note")); } catch (SchedulerException e) { logger.error("Can't remove quertz " + id, e); } }
Source:
public static void invokeFor(Object target, Message eventMessage, EventContext context) { checkNotNull(target); checkNotNull(eventMessage); checkNotNull(context); try { final EventSubscriberMethod method = getMethod(target.getClass(), eventMessage); method.invoke(target, eventMessage, context); } catch (RuntimeException e) { log().error("Exception handling event. Event message: {}, context: {}, cause: {}", eventMessage, context, e.getCause()); } }

Target:
public static void invokeFor(Object target, Message eventMessage, EventContext context) { checkNotNull(target); checkNotNull(eventMessage); checkNotNull(context); final EventSubscriberMethod method = getMethod(target.getClass(), eventMessage); method.invoke(target, eventMessage, context); }
Source:
private PutStatus silentPut(final K key, final V value) throws StoreAccessException { try { PutOperation<K, V> operation = new PutOperation<K, V>(key, value, timeSource.getTimeMillis()); ByteBuffer payload = codec.encode(operation); Chain chain = storeProxy.getAndAppend(key.hashCode(), payload); ResolvedChain<K, V> resolvedChain = resolver.resolve(chain, key, timeSource.getTimeMillis()); if(resolvedChain.getResolvedResult(key) == null) { return PutStatus.PUT; } else { return PutStatus.UPDATE; } } catch (RuntimeException re) { handleRuntimeException(re); return null; } }

Target:
private PutStatus silentPut(final K key, final V value) throws StoreAccessException { try { PutOperation<K, V> operation = new PutOperation<K, V>(key, value, timeSource.getTimeMillis()); ByteBuffer payload = codec.encode(operation); Chain chain = storeProxy.getAndAppend(key.hashCode(), payload); ResolvedChain<K, V> resolvedChain = resolver.resolve(chain, key, timeSource.getTimeMillis()); if(resolvedChain.getResolvedResult(key) == null) { return PutStatus.PUT; } else { return PutStatus.UPDATE; } } catch (RuntimeException re) { handleRuntimeException(re); return PutStatus.NOOP; } }
Source:
protected void processCommunication(String tenantId, TraceCompletionInformation item, Communication c, CommunicationDetails cd) { long targetFragmentBaseDuration = c.getBaseDuration() + cd.getLatency(); long durationWithTargetFragment = targetFragmentBaseDuration + cd.getTargetFragmentDuration(); if (durationWithTargetFragment > item.getCompletionTime().getDuration()) { item.getCompletionTime().setDuration(durationWithTargetFragment); } if (!cd.getProperties().isEmpty()) { item.getCompletionTime().getProperties().addAll(cd.getProperties()); } for (int j = 0; j < cd.getOutbound().size(); j++) { CommunicationDetails.Outbound ob = cd.getOutbound().get(j); Communication newc = new Communication(); newc.setIds(ob.getLinkIds()); newc.setMultipleConsumers(ob.isMultiConsumer()); newc.setBaseDuration(targetFragmentBaseDuration + ob.getProducerOffset()); long baseTimeStamp = TimeUnit.MICROSECONDS.toMillis(ob.isMultiConsumer() ? cd.getTimestamp() : TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis())); newc.setExpire(baseTimeStamp + Communication.DEFAULT_EXPIRY_WINDOW_MILLIS); if (log.isLoggable(Level.FINEST)) { log.finest("Completion info " + item + ": new communication = " + newc); } item.getCommunications().add(newc); } }

Target:
protected void processCommunication(String tenantId, TraceCompletionInformation item, Communication c, CommunicationDetails cd) { long targetFragmentBaseDuration = c.getBaseDuration() + cd.getLatency(); long durationWithTargetFragment = targetFragmentBaseDuration + cd.getTargetFragmentDuration(); if (durationWithTargetFragment > item.getCompletionTime().getDuration()) { item.getCompletionTime().setDuration(durationWithTargetFragment); } if (!cd.getProperties().isEmpty()) { item.getCompletionTime().getProperties().addAll(cd.getProperties()); } for (int j = 0; j < cd.getOutbound().size(); j++) { CommunicationDetails.Outbound ob = cd.getOutbound().get(j); Communication newc = new Communication(); newc.setIds(ob.getLinkIds()); newc.setMultipleConsumers(ob.isMultiConsumer()); newc.setBaseDuration(targetFragmentBaseDuration + ob.getProducerOffset()); long baseTimeStamp = ob.isMultiConsumer() ? TimeUnit.MICROSECONDS.toMillis(cd.getTimestamp()) : System.currentTimeMillis(); newc.setExpire(baseTimeStamp + Communication.DEFAULT_EXPIRY_WINDOW_MILLIS); if (log.isLoggable(Level.FINEST)) { log.finest("Completion info " + item + ": new communication = " + newc); } item.getCommunications().add(newc); } }
Source:
private Region3i getBuildingExtents(BuildingType buildingType, Region3i region) { Prefab buildingPrefab; switch (buildingType) { case Diner: buildingPrefab = prefabManager.getPrefab("MasterOfOreon:inn"); break; default: buildingPrefab = prefabManager.getPrefab("MasterOfOreon:storage"); } SpawnBlockRegionsComponent blockRegionsComponent = buildingPrefab.getComponent(SpawnBlockRegionsComponent.class); List<SpawnBlockRegionsComponent.RegionToFill> regionsToFill = blockRegionsComponent.regionsToFill; int minX = Integer.MAX_VALUE; int maxX = Integer.MIN_VALUE; int minZ = Integer.MAX_VALUE; int maxZ = Integer.MIN_VALUE; for (SpawnBlockRegionsComponent.RegionToFill regionToFill : regionsToFill) { minX = Math.min(minX, regionToFill.region.minX()); maxX = Math.max(maxX, regionToFill.region.maxX()); minZ = Math.min(minZ, regionToFill.region.minZ()); maxZ = Math.max(maxZ, regionToFill.region.maxZ()); } Vector3f center = region.center(); Vector3f extents = new Vector3f((maxX - minX) / 2, 0, (maxZ - minZ) / 2); return Region3i.createFromCenterExtents(center, extents); }

Target:
private Region3i getBuildingExtents(BuildingType buildingType, Region3i region) { Prefab buildingPrefab; switch (buildingType) { case Diner: buildingPrefab = prefabManager.getPrefab(Constants.DINER_PREFAB); break; default: buildingPrefab = prefabManager.getPrefab(Constants.STORAGE_PREFAB); } SpawnBlockRegionsComponent blockRegionsComponent = buildingPrefab.getComponent(SpawnBlockRegionsComponent.class); List<SpawnBlockRegionsComponent.RegionToFill> regionsToFill = blockRegionsComponent.regionsToFill; int minX = Integer.MAX_VALUE; int maxX = Integer.MIN_VALUE; int minZ = Integer.MAX_VALUE; int maxZ = Integer.MIN_VALUE; for (SpawnBlockRegionsComponent.RegionToFill regionToFill : regionsToFill) { minX = Math.min(minX, regionToFill.region.minX()); maxX = Math.max(maxX, regionToFill.region.maxX()); minZ = Math.min(minZ, regionToFill.region.minZ()); maxZ = Math.max(maxZ, regionToFill.region.maxZ()); } Vector3f center = region.center(); Vector3f extents = new Vector3f((maxX - minX) / 2, 0, (maxZ - minZ) / 2); return Region3i.createFromCenterExtents(center, extents); }
Source:
private Map<String, String> defaultAtlasConfMap() { Map<String, String> confMap = new HashMap<>(); confMap.put("hive.in.test", "true"); confMap.put("hive.repl.include.atlas.metadata", "true"); confMap.put("hive.repl.atlas.endpoint", "http://localhost:21000/atlas"); confMap.put("hive.repl.atlas.replicatedto", replicatedDbName); confMap.put("hive.repl.source.cluster.name", "cluster0"); confMap.put("hive.repl.target.cluster.name", "cluster1"); return confMap; }

Target:
private Map<String, String> defaultAtlasConfMap() { Map<String, String> confMap = new HashMap<>(); confMap.put(HiveConf.ConfVars.HIVE_IN_TEST.varname, "true"); confMap.put(HiveConf.ConfVars.REPL_INCLUDE_ATLAS_METADATA.varname, "true"); confMap.put(HiveConf.ConfVars.REPL_ATLAS_ENDPOINT.varname, "http://localhost:21000/atlas"); confMap.put(HiveConf.ConfVars.REPL_ATLAS_REPLICATED_TO_DB.varname, replicatedDbName); confMap.put(HiveConf.ConfVars.REPL_SOURCE_CLUSTER_NAME.varname, "cluster0"); confMap.put(HiveConf.ConfVars.REPL_TARGET_CLUSTER_NAME.varname, "cluster1"); return confMap; }
Source:
public int writeMessage(ByteBuffer message) throws IOException { if (!message.hasRemaining()) { return 0; } CompositeByteBuf outbuf = Unpooled.compositeBuffer(); ByteBuf msg = Unpooled.wrappedBuffer(message); final int needed = CipherExecutor.framesFor(msg.readableBytes()); for (int have = 0; have < needed; ++have) { final int slicesz = Math.min(CipherExecutor.FRAME_SIZE, msg.readableBytes()); ByteBuf clear = msg.readSlice(slicesz).writerIndex(slicesz); ByteBuf encr = m_ce.allocator().ioBuffer(packetBufferSize()).writerIndex(packetBufferSize()); ByteBuffer src = clear.nioBuffer(); ByteBuffer dst = encr.nioBuffer(); try { m_encrypter.tlswrap(src, dst); } catch (TLSException e) { outbuf.release(); encr.release(); throw new IOException("failed to encrypt tls frame", e); } assert !src.hasRemaining() : "encryption wrap did not consume the whole source buffer"; encr.writerIndex(dst.limit()); outbuf.addComponent(true, encr); } int bytesWritten = 0; try { while (outbuf.isReadable()) { bytesWritten += outbuf.readBytes(m_socketChannel, outbuf.readableBytes()); } } catch (IOException e) { outbuf.release(); throw e; } outbuf.release(); message.position(message.position() + msg.readerIndex()); return bytesWritten; }

Target:
public int writeMessage(ByteBuffer message) throws IOException { if (!message.hasRemaining()) { return 0; } CompositeByteBuf outbuf = Unpooled.compositeBuffer(); ByteBuf msg = Unpooled.wrappedBuffer(message); final int needed = CipherExecutor.framesFor(msg.readableBytes()); for (int have = 0; have < needed; ++have) { final int slicesz = Math.min(CipherExecutor.FRAME_SIZE, msg.readableBytes()); ByteBuf clear = msg.readSlice(slicesz).writerIndex(slicesz); ByteBuf encr = m_ce.allocator().ioBuffer(packetBufferSize()).writerIndex(packetBufferSize()); ByteBuffer src = clear.nioBuffer(); ByteBuffer dst = encr.nioBuffer(); try { m_encrypter.tlswrap(src, dst); } catch (TLSException e) { outbuf.release(); encr.release(); throw new IOException("failed to encrypt tls frame", e); } assert !src.hasRemaining() : "encryption wrap did not consume the whole source buffer"; encr.writerIndex(dst.limit()); outbuf.addComponent(true, encr); } int bytesWritten = 0; try { while (outbuf.isReadable()) { bytesWritten += outbuf.readBytes(m_socketChannel, outbuf.readableBytes()); } } catch (IOException e) { throw e; } finally { outbuf.release(); } message.position(message.position() + msg.readerIndex()); return bytesWritten; }
Source:
protected Map<String, Object> addSection(ParameterParser params, SessionState state) { String message; Map<String, Object> results = new HashMap<String, Object>(); try { String addSectionHTML = params.getString("addSectionHTML"); int locationId = params.getInt("locationId"); CitationCollection collection = getCitationCollection(state, false); CitationCollectionOrder citationCollectionOrder = new CitationCollectionOrder(collection.getId(), locationId, "heading1", addSectionHTML); getCitationService().save(citationCollectionOrder); message = "Resource updated"; } catch (Exception e){ message = e.getMessage(); logger.warn("Exception in addSection() " + e); } if(message != null && ! message.trim().equals("")) { results.put("message", message); } return results; }

Target:
protected Map<String, Object> addSection(ParameterParser params, SessionState state) { String message; Map<String, Object> results = new HashMap<String, Object>(); try { String addSectionHTML = params.getString("addSectionHTML"); String cleanAddSectionHTML = getFormattedText().processFormattedText(addSectionHTML, new StringBuilder(), true, true); int locationId = params.getInt("locationId"); CitationCollection collection = getCitationCollection(state, false); CitationCollectionOrder citationCollectionOrder = new CitationCollectionOrder(collection.getId(), locationId, CitationCollectionOrder.SectionType.HEADING1, cleanAddSectionHTML); getCitationService().save(citationCollectionOrder); message = rb.getString("resource.updated"); } catch (Exception e){ message = e.getMessage(); logger.warn("Exception in addSection() " + e); } if(message != null && ! message.trim().equals("")) { results.put("message", message); } return results; }
Source:
protected void runInternal() { final List<Data> keyValueSequence = this.loadingSequence; if (keyValueSequence == null || keyValueSequence.isEmpty()) { return; } for (int i = 0; i < keyValueSequence.size();) { final Data key = keyValueSequence.get(i++); final Data value = keyValueSequence.get(i++); if (includesExpirationTime) { long expirationTime = (long) mapServiceContext.toObject(keyValueSequence.get(i++)); final Object object = mapServiceContext.toObject(value); recordStore.putFromLoadBackup(key, object, expirationTime); } else { final Object object = mapServiceContext.toObject(value); recordStore.putFromLoadBackup(key, object); } if (!recordStore.existInMemory(key)) { continue; } publishLoadAsWanUpdate(key, value); } }

Target:
protected void runInternal() { final List<Data> keyValueSequence = this.loadingSequence; if (keyValueSequence == null || keyValueSequence.isEmpty()) { return; } for (int i = 0; i < keyValueSequence.size();) { final Data key = keyValueSequence.get(i++); final Data value = keyValueSequence.get(i++); final Object object = mapServiceContext.toObject(value); if (includesExpirationTime) { long expirationTime = (long) mapServiceContext.toObject(keyValueSequence.get(i++)); recordStore.putFromLoadBackup(key, object, expirationTime); } else { recordStore.putFromLoadBackup(key, object); } if (!recordStore.existInMemory(key)) { continue; } publishLoadAsWanUpdate(key, value); } }
Source:
private boolean isManagementNetworkChanged(){ List<NetworkAttachment> newAttachments = getParameters().getNetworkAttachments(); List<NetworkAttachment> existingAttachments = this.existingAttachments; String mgmtNetworkName = managementNetworkUtil.getManagementNetwork(getVds().getVdsGroupId()).getName(); for (HostNetwork network : getNetworksToConfigure()) { if (mgmtNetworkName.equals(network.getNetworkName())){ return true; } } for (Bond bond : getParameters().getBonds()) { VdsNetworkInterface bondNic = existingNicsBusinessEntityMap.get(bond.getId()); if (bondNic != null && mgmtNetworkName.equals(bondNic.getNetworkName())) { return true; } } return false; }

Target:
private boolean isManagementNetworkChanged(){ List<NetworkAttachment> newAttachments = getParameters().getNetworkAttachments(); List<NetworkAttachment> existingAttachments = this.existingAttachments; String mgmtNetworkName = managementNetworkUtil.getManagementNetwork(getVds().getVdsGroupId()).getName(); for (HostNetwork network : getNetworksToConfigure()) { if (mgmtNetworkName.equals(network.getNetworkName())){ return true; } } for (Bond bond : getParameters().getBonds()) { VdsNetworkInterface bondNic = getExistingNicsBusinessEntityMap().get(bond.getId()); if (bondNic != null && mgmtNetworkName.equals(bondNic.getNetworkName())) { return true; } } return false; }
Source:
private void disableCrossReferencerResolve(Resource resource) { disableCrossReferencerResolve((Notifier) resource); EList<EObject> contents = resource.getContents(); if (contents.size() > 0 && contents.get(0) != null) { disableCrossReferencerResolve(contents.get(0)); } }

Target:
private void disableCrossReferencerResolve(Resource resource) { disableCrossReferencerResolveOnNotifer(resource); EList<EObject> contents = resource.getContents(); if (contents.size() > 0 && contents.get(0) != null) { disableCrossReferencerResolveOnNotifer(contents.get(0)); } }
Source:
public Fragment getItem(int i) { switch (i) { case DETAILS_TAB_POS: PatientDetailsFragment patientDetailsFragment = PatientDetailsFragment.newInstance(); new PatientDashboardDetailsPresenter(mPatientId, patientDetailsFragment); return patientDetailsFragment; case DETAILS_TAB_ALLERGY: PatientAllergyFragment patientAllergyFragment = PatientAllergyFragment.newInstance(); new PatientDashboardAllergyPresenter(mPatientId, patientAllergyFragment); return patientAllergyFragment; case DIAGNOSIS_TAB_POS: PatientDiagnosisFragment patientDiagnosisFragment = PatientDiagnosisFragment.newInstance(); new PatientDashboardDiagnosisPresenter(mPatientId, patientDiagnosisFragment); return patientDiagnosisFragment; case VISITS_TAB_POS: PatientVisitsFragment patientVisitsFragment = PatientVisitsFragment.newInstance(); new PatientDashboardVisitsPresenter(mPatientId, patientVisitsFragment); return patientVisitsFragment; case VITALS_TAB_POS: PatientVitalsFragment patientVitalsFragment = PatientVitalsFragment.newInstance(); new PatientDashboardVitalsPresenter(mPatientId, patientVitalsFragment); return patientVitalsFragment; case CHARTS_TAB_POS: PatientChartsFragment patientChartsFragment = PatientChartsFragment.newInstance(); new PatientDashboardChartsPresenter(mPatientId, patientChartsFragment); return patientChartsFragment; default: return null; } }

Target:
public Fragment getItem(int i) { switch (i) { case DETAILS_TAB_POS: PatientDetailsFragment patientDetailsFragment = PatientDetailsFragment.newInstance(); new PatientDashboardDetailsPresenter(mPatientId, patientDetailsFragment); return patientDetailsFragment; case ALLERGY_TAB_POS: PatientAllergyFragment patientAllergyFragment = PatientAllergyFragment.newInstance(); new PatientDashboardAllergyPresenter(mPatientId, patientAllergyFragment); return patientAllergyFragment; case DIAGNOSIS_TAB_POS: PatientDiagnosisFragment patientDiagnosisFragment = PatientDiagnosisFragment.newInstance(); new PatientDashboardDiagnosisPresenter(mPatientId, patientDiagnosisFragment); return patientDiagnosisFragment; case VISITS_TAB_POS: PatientVisitsFragment patientVisitsFragment = PatientVisitsFragment.newInstance(); new PatientDashboardVisitsPresenter(mPatientId, patientVisitsFragment); return patientVisitsFragment; case VITALS_TAB_POS: PatientVitalsFragment patientVitalsFragment = PatientVitalsFragment.newInstance(); new PatientDashboardVitalsPresenter(mPatientId, patientVitalsFragment); return patientVitalsFragment; case CHARTS_TAB_POS: PatientChartsFragment patientChartsFragment = PatientChartsFragment.newInstance(); new PatientDashboardChartsPresenter(mPatientId, patientChartsFragment); return patientChartsFragment; default: return null; } }
Source:
public void run() { try { Injector injector = makeInjector(); Lifecycle lifecycle = initLifecycle(injector); try { injector.getInstance(ExecutorLifecycle.class).join(); lifecycle.stop(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public void run() { try { Injector injector = makeInjector(); try { Lifecycle lifecycle = initLifecycle(injector); injector.getInstance(ExecutorLifecycle.class).join(); lifecycle.stop(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
IReportContent regenerateCache( final MasterReport report, final int yieldRate, final String key, final int acceptedPage ) throws ReportProcessingException { logger.warn( "Regenerating report data for " + key ); final IReportContent result = produceCacheablePages( report, yieldRate, key, acceptedPage ); persistContent( key, result, null ); return result; }

Target:
IReportContent regenerateCache( final MasterReport report, final int yieldRate, final String key, final int acceptedPage ) throws ReportProcessingException { logger.warn( "Regenerating report data for " + key ); final IReportContent result = produceCacheablePages( report, yieldRate, key, acceptedPage ); final IAsyncReportListener listener = ReportListenerThreadHolder.getListener(); persistContent( key, result, listener.getTotalRows() ); return result; }
Source:
CommitValidationResult(boolean validated, String why) { this.validated = validated; this.why = why; }

Target:
protected CommitValidationResult(boolean validated, String why) { this.validated = validated; this.why = why; }
Source:
public void updateProperties(String name, Consumer<Block> properties) { materialProperties.put(name, properties); blockMap.forEach((spec, id) -> { Block block = spec.toBlock(); applyMaterial(block); palette.set(id, block); }); }

Target:
public void updateProperties(String name, Consumer<Block> properties) { materialProperties.put(name, properties); blockMap.forEach((spec, id) -> { Block block = palette.get(id); applyMaterial(block); palette.set(id, block); }); }
Source:
public void runPercentiles() throws Exception { storeLongTimeSeriesSeconds(false, true); HashMap<String, String> tags = new HashMap<String, String>(0); query.setStartTime(1356998400); query.setEndTime(1357041600); query.setTimeSeries("sys.cpu.user", tags, Aggregators.p50, false); final DataPoints[] dps = query.run(); assertNotNull(dps); assertEquals("sys.cpu.user", dps[0].metricName()); assertEquals("host", dps[0].getAggregatedTags().get(0)); assertNull(dps[0].getAnnotations()); assertTrue(dps[0].getTags().isEmpty()); long v1 = 151; long v2 = 150; long ts = 1356998430000L; int counter = 0; int size = dps[0].size(); for (DataPoint dp : dps[0]) { assertEquals(ts, dp.timestamp()); ts += 15000; if (counter == 0 || counter == size - 1) { assertEquals(1, dp.longValue()); } else if (counter % 2 == 0) { assertEquals(v1, dp.longValue()); } else { assertEquals(v2, dp.longValue()); } counter++; } assertEquals(600, size); }

Target:
public void runPercentiles() throws Exception { storeLongTimeSeriesSeconds(false, true); testPercentile(Aggregators.p50, 150, 150); testPercentile(Aggregators.p75, 150, 150); testPercentile(Aggregators.p90, 150, 150); testPercentile(Aggregators.p95, 150, 150); testPercentile(Aggregators.p99, 150, 150); testPercentile(Aggregators.p999, 150, 150); testPercentile(Aggregators.ep50, 150, 150); testPercentile(Aggregators.ep75, 150, 150); testPercentile(Aggregators.ep90, 150, 150); testPercentile(Aggregators.ep95, 150, 150); testPercentile(Aggregators.ep99, 150, 150); testPercentile(Aggregators.ep999, 150, 150); }
Source:
private boolean gbyTablesEqual(MaterializedViewInfo mv) { if (m_selectStmt.hasComplexGroupby() ^ mv.getGroupbyexpressionsjson().isEmpty()) { if (m_selectStmt.hasComplexGroupby()) { return getGbyExpressions(mv).equals( m_selectStmt.groupByColumns().stream() .map(ci -> copyAsCVE(ci.m_expression).anonymize()) .collect(Collectors.toList())); } else { return m_selectStmt.groupByColumns().get(0).m_tableName .equals(mv.getDest().getMaterializer().getTypeName()); } } else return false; }

Target:
private boolean gbyTablesEqual(MaterializedViewInfo mv) { if (m_selectStmt.hasComplexGroupby() != mv.getGroupbyexpressionsjson().isEmpty()) { if (m_selectStmt.hasComplexGroupby()) { final Set<AbstractExpression> selGby = m_selectStmt.groupByColumns().stream() .map(ci -> transformExpressionRidofPVE(ci.m_expression).anonymize()) .collect(Collectors.toSet()), viewGby = new HashSet<>(getGbyExpressions(mv)); return selGby.equals(viewGby) && selGby.stream().map(MVQueryRewriter::extractTVEIndices).collect(Collectors.toSet()).equals( viewGby.stream().map(MVQueryRewriter::extractTVEIndices).collect(Collectors.toSet())); } else { return true; } } else { return false; } }
Source:
public void stop() { Log.i(TAG, "stop"); mCodec.stop(); }

Target:
public void stop() { if(mConfigured) { Log.i(TAG, "stop"); mCodec.stop(); mConfigured = false; } }