id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
16,701
super(supportedMediaType); } protected AbstractGenericHttpMessageConverter(MediaType... supportedMediaTypes) { super(supportedMediaTypes); } <BUG>@Override public boolean canWrite(Class<?> contextClass, MediaType mediaType) { return canWrite(null, contextClass, mediaType); }</BUG> public final void write(final T t, final Type type, MediaType contentType, HttpOutputMessage outputMessage)
public boolean canRead(Type type, Class<?> contextClass, MediaType mediaType) { return canRead(contextClass, mediaType); public boolean canWrite(Type type, Class<?> contextClass, MediaType mediaType) { return canWrite(contextClass, mediaType);
16,702
import java.awt.image.*; import javax.swing.ImageIcon; import javax.swing.JLabel; public class ImageJ extends Frame implements ActionListener, MouseListener, KeyListener, WindowListener, ItemListener, Runnable { <BUG>public static final String VERSION = "1.51e"; public static final String BUILD = ""; </BUG> public static Color backgroundColor = new Color(237,237,237);
public static final String VERSION = "1.51f"; public static final String BUILD = "1";
16,703
this.delayedReferences = new HashMap<String, List<String>>(); this.delayedBundles = new LinkedList<Bundle>(); importProviders = new LinkedHashMap<String, ImportProvider>(); importProviders.put(EXT_JCR_XML, null); importProviders.put(EXT_JSON, JsonReader.PROVIDER); <BUG>importProviders.put(EXT_XJSON, XJsonReader.PROVIDER); importProviders.put(EXT_XML, XmlReader.PROVIDER);</BUG> } public void dispose() { this.delayedReferences = null;
importProviders.put(EXT_XJSON, JsonReader.PROVIDER); importProviders.put(EXT_XML, XmlReader.PROVIDER);
16,704
package org.apache.sling.jcr.resource.internal.loader; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; <BUG>import java.io.InputStream; import java.util.Iterator; </BUG> import javax.jcr.PropertyType; import org.apache.sling.commons.json.JSONArray;
import java.util.HashSet; import java.util.Set;
16,705
value = null; } } else { property.setValue(String.valueOf(value)); } <BUG>property.setType((type != null) ? type : this.getType(value)); return property;</BUG> } protected String getType(Object object) { if (object instanceof Double || object instanceof Float) {
property.setType(getType(value)); return property;
16,706
package fr.inria.astor.core.validation.validators; import java.util.HashMap; import java.util.Map; <BUG>import fr.inria.astor.core.entities.ProgramVariantValidationResult; public class CompoundValidationResult extends ProgramVariantValidationResult { protected Map<String,ProgramVariantValidationResult> validations = new HashMap<>(); </BUG> public CompoundValidationResult() {
import fr.inria.astor.core.entities.TestCaseVariantValidationResult; public class CompoundValidationResult implements TestCaseVariantValidationResult { protected Map<String,TestCaseVariantValidationResult> validations = new HashMap<>();
16,707
public void setRegressionExecuted(boolean regressionExecuted) { } @Override public int getPassingTestCases() { int count = 0; <BUG>for (ProgramVariantValidationResult pv : this.validations.values()) { </BUG> count+= pv.getPassingTestCases(); } return count;
for (TestCaseVariantValidationResult pv : this.validations.values()) {
16,708
protected MutationSupporter mutatorSupporter = null; protected ProjectRepairFacade projectFacade = null; protected Date dateInitEvolution = new Date(); protected FaultLocalizationStrategy faultLocalization = null; protected int generationsExecuted = 0; <BUG>protected SolutionVariantSortCriterion patchSortCriterion = null; public AstorCoreEngine(MutationSupporter mutatorExecutor, ProjectRepairFacade projFacade) throws JSAPException {</BUG> this.mutatorSupporter = mutatorExecutor; this.projectFacade = projFacade; this.currentStat = Stats.getCurrentStats();
protected FitnessFunction fitnessFunction = null; public AstorCoreEngine(MutationSupporter mutatorExecutor, ProjectRepairFacade projFacade) throws JSAPException {
16,709
protected abstract void applyPreviousMutationOperationToSpoonElement(OperatorInstance operation) throws IllegalAccessException; protected abstract void applyNewMutationOperationToSpoonElement(OperatorInstance operation) throws IllegalAccessException; protected boolean validateInstance(ProgramVariant variant) { <BUG>ProgramVariantValidationResult validationResult; if ((validationResult = programValidator.validate(variant, projectFacade)) != null) { double fitness = this.populationControler.getFitnessValue(variant, validationResult); variant.setFitness(fitness); boolean wasSuc = validationResult.wasSuccessful(); </BUG> variant.setIsSolution(wasSuc);
boolean wasSuc = validationResult.isSuccessful();
16,710
ConfigurationProperties.setProperty("forceExecuteRegression", Boolean.TRUE.toString()); boolean validInstance = validateInstance(originalVariant); if (validInstance) { throw new IllegalStateException("The application under repair has not failling test cases"); } <BUG>double fitness = originalVariant.getFitness(); log.debug("The original fitness is : "+fitness);</BUG> for (ProgramVariant initvariant : variants) { initvariant.setFitness(fitness); }
double fitness = this.fitnessFunction.calculateFitnessValue(originalVariant); originalVariant.setFitness(fitness); log.debug("The original fitness is : "+fitness);
16,711
protected CompilationResult compilationResult = null; protected boolean isSolution = false; protected int lastGenAnalyzed = 0; protected Date bornDate = new Date(); protected List<CtClass> modifiedClasses = new ArrayList<CtClass>(); <BUG>ProgramVariantValidationResult validationResult = null; public ProgramVariant(){</BUG> modificationPoints = new ArrayList<ModificationPoint>(); operations = new HashMap<Integer,List<OperatorInstance>>(); }
public ProgramVariant(){
16,712
solutionVariant.getOperations().put(generationsExecuted, Arrays.asList(pointOperation)); applyNewMutationOperationToSpoonElement(pointOperation); boolean solution = processCreatedVariant(solutionVariant, generationsExecuted); if (solution) { this.solutions.add(solutionVariant); <BUG>if (ConfigurationProperties.getPropertyBool("stopfirst")) System.out.println(" modpoint analyzed "+modifPointsAnalyzed + ", operators "+operatorExecuted); }</BUG> undoOperationToSpoonElement(pointOperation);
if (ConfigurationProperties.getPropertyBool("stopfirst")){ log.debug(" modpoint analyzed "+modifPointsAnalyzed + ", operators "+operatorExecuted); return; } }
16,713
+((this.getManualTestValidation() != null)?"\nmanual_regression: "+(getManualTestValidation()):"") +((getEvoValidation() != null)?"\nevo_regression: "+ (getEvoValidation()):"") ; } @Override <BUG>public boolean wasSuccessful() { return (getValidation("failing") == null || getValidation("failing").wasSuccessful()) </BUG> ;
[DELETED]
16,714
import ml.puredark.hviewer.ui.activities.BaseActivity; import ml.puredark.hviewer.ui.dataproviders.ListDataProvider; import ml.puredark.hviewer.ui.fragments.SettingFragment; import ml.puredark.hviewer.ui.listeners.OnItemLongClickListener; import ml.puredark.hviewer.utils.SharedPreferencesUtil; <BUG>import static android.webkit.WebSettings.LOAD_CACHE_ELSE_NETWORK; public class PictureViewerAdapter extends RecyclerView.Adapter<PictureViewerAdapter.PictureViewerViewHolder> {</BUG> private BaseActivity activity; private Site site; private ListDataProvider mProvider;
import static ml.puredark.hviewer.R.id.container; public class PictureViewerAdapter extends RecyclerView.Adapter<PictureViewerAdapter.PictureViewerViewHolder> {
16,715
final PictureViewHolder viewHolder = new PictureViewHolder(view); if (pictures != null && position < pictures.size()) { final Picture picture = pictures.get(getPicturePostion(position)); if (picture.pic != null) { loadImage(container.getContext(), picture, viewHolder); <BUG>} else if (site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE) && site.extraRule != null && site.extraRule.pictureUrl != null) { getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureUrl, site.extraRule.pictureHighRes);</BUG> } else if (site.picUrlSelector != null) { getPictureUrl(container.getContext(), viewHolder, picture, site, site.picUrlSelector, null); } else {
} else if (site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE) && site.extraRule != null) { if(site.extraRule.pictureRule != null && site.extraRule.pictureRule.url != null) getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureRule.url, site.extraRule.pictureRule.highRes); else if(site.extraRule.pictureUrl != null) getPictureUrl(container.getContext(), viewHolder, picture, site, site.extraRule.pictureUrl, site.extraRule.pictureHighRes);
16,716
import java.util.regex.Pattern; import butterknife.BindView; import butterknife.ButterKnife; import ml.puredark.hviewer.R; import ml.puredark.hviewer.beans.Category; <BUG>import ml.puredark.hviewer.beans.CommentRule; import ml.puredark.hviewer.beans.Rule;</BUG> import ml.puredark.hviewer.beans.Selector; import ml.puredark.hviewer.beans.Site; import ml.puredark.hviewer.ui.adapters.CategoryInputAdapter;
import ml.puredark.hviewer.beans.PictureRule; import ml.puredark.hviewer.beans.Rule;
16,717
inputGalleryRulePictureUrlReplacement.setText(site.galleryRule.pictureUrl.replacement); } if (site.galleryRule.pictureHighRes != null) { inputGalleryRulePictureHighResSelector.setText(joinSelector(site.galleryRule.pictureHighRes)); inputGalleryRulePictureHighResRegex.setText(site.galleryRule.pictureHighRes.regex); <BUG>inputGalleryRulePictureHighResReplacement.setText(site.galleryRule.pictureHighRes.replacement); }</BUG> if (site.galleryRule.commentRule != null) { if (site.galleryRule.commentRule.item != null) { inputGalleryRuleCommentItemSelector.setText(joinSelector(site.galleryRule.commentRule.item));
[DELETED]
16,718
inputExtraRuleCommentDatetimeReplacement.setText(site.extraRule.commentDatetime.replacement); } if (site.extraRule.commentContent != null) { inputExtraRuleCommentContentSelector.setText(joinSelector(site.extraRule.commentContent)); inputExtraRuleCommentContentRegex.setText(site.extraRule.commentContent.regex); <BUG>inputExtraRuleCommentContentReplacement.setText(site.extraRule.commentContent.replacement); }</BUG> } } }
[DELETED]
16,719
lastSite.galleryRule.cover = loadSelector(inputGalleryRuleCoverSelector, inputGalleryRuleCoverRegex, inputGalleryRuleCoverReplacement); lastSite.galleryRule.category = loadSelector(inputGalleryRuleCategorySelector, inputGalleryRuleCategoryRegex, inputGalleryRuleCategoryReplacement); lastSite.galleryRule.datetime = loadSelector(inputGalleryRuleDatetimeSelector, inputGalleryRuleDatetimeRegex, inputGalleryRuleDatetimeReplacement); lastSite.galleryRule.rating = loadSelector(inputGalleryRuleRatingSelector, inputGalleryRuleRatingRegex, inputGalleryRuleRatingReplacement); lastSite.galleryRule.description = loadSelector(inputGalleryRuleDescriptionSelector, inputGalleryRuleDescriptionRegex, inputGalleryRuleDescriptionReplacement); <BUG>lastSite.galleryRule.tags = loadSelector(inputGalleryRuleTagsSelector, inputGalleryRuleTagsRegex, inputGalleryRuleTagsReplacement); lastSite.galleryRule.pictureThumbnail = loadSelector(inputGalleryRulePictureThumbnailSelector, inputGalleryRulePictureThumbnailRegex, inputGalleryRulePictureThumbnailReplacement); lastSite.galleryRule.pictureUrl = loadSelector(inputGalleryRulePictureUrlSelector, inputGalleryRulePictureUrlRegex, inputGalleryRulePictureUrlReplacement); lastSite.galleryRule.pictureHighRes = loadSelector(inputGalleryRulePictureHighResSelector, inputGalleryRulePictureHighResRegex, inputGalleryRulePictureHighResReplacement); lastSite.galleryRule.commentRule = new CommentRule(); lastSite.galleryRule.commentRule.item = loadSelector(inputGalleryRuleCommentItemSelector, inputGalleryRuleCommentItemRegex, inputGalleryRuleCommentItemReplacement);</BUG> lastSite.galleryRule.commentRule.avatar = loadSelector(inputGalleryRuleCommentAvatarSelector, inputGalleryRuleCommentAvatarRegex, inputGalleryRuleCommentAvatarReplacement);
lastSite.galleryRule.pictureRule = (lastSite.galleryRule.pictureRule == null) ? new PictureRule() : lastSite.galleryRule.pictureRule; lastSite.galleryRule.pictureRule.thumbnail = loadSelector(inputGalleryRulePictureThumbnailSelector, inputGalleryRulePictureThumbnailRegex, inputGalleryRulePictureThumbnailReplacement); lastSite.galleryRule.pictureRule.url = loadSelector(inputGalleryRulePictureUrlSelector, inputGalleryRulePictureUrlRegex, inputGalleryRulePictureUrlReplacement); lastSite.galleryRule.pictureRule.highRes = loadSelector(inputGalleryRulePictureHighResSelector, inputGalleryRulePictureHighResRegex, inputGalleryRulePictureHighResReplacement); lastSite.galleryRule.commentRule = (lastSite.galleryRule.commentRule == null) ? new CommentRule() : lastSite.galleryRule.commentRule; lastSite.galleryRule.commentRule.item = loadSelector(inputGalleryRuleCommentItemSelector, inputGalleryRuleCommentItemRegex, inputGalleryRuleCommentItemReplacement);
16,720
lastSite.extraRule.cover = loadSelector(inputExtraRuleCoverSelector, inputExtraRuleCoverRegex, inputExtraRuleCoverReplacement); lastSite.extraRule.category = loadSelector(inputExtraRuleCategorySelector, inputExtraRuleCategoryRegex, inputExtraRuleCategoryReplacement); lastSite.extraRule.datetime = loadSelector(inputExtraRuleDatetimeSelector, inputExtraRuleDatetimeRegex, inputExtraRuleDatetimeReplacement); lastSite.extraRule.rating = loadSelector(inputExtraRuleRatingSelector, inputExtraRuleRatingRegex, inputExtraRuleRatingReplacement); lastSite.extraRule.description = loadSelector(inputExtraRuleDescriptionSelector, inputExtraRuleDescriptionRegex, inputExtraRuleDescriptionReplacement); <BUG>lastSite.extraRule.tags = loadSelector(inputExtraRuleTagsSelector, inputExtraRuleTagsRegex, inputExtraRuleTagsReplacement); lastSite.extraRule.pictureThumbnail = loadSelector(inputExtraRulePictureThumbnailSelector, inputExtraRulePictureThumbnailRegex, inputExtraRulePictureThumbnailReplacement); lastSite.extraRule.pictureUrl = loadSelector(inputExtraRulePictureUrlSelector, inputExtraRulePictureUrlRegex, inputExtraRulePictureUrlReplacement); lastSite.extraRule.pictureHighRes = loadSelector(inputExtraRulePictureHighResSelector, inputExtraRulePictureHighResRegex, inputExtraRulePictureHighResReplacement); lastSite.extraRule.commentRule = new CommentRule(); lastSite.extraRule.commentRule.item = loadSelector(inputExtraRuleCommentItemSelector, inputExtraRuleCommentItemRegex, inputExtraRuleCommentItemReplacement);</BUG> lastSite.extraRule.commentRule.avatar = loadSelector(inputExtraRuleCommentAvatarSelector, inputExtraRuleCommentAvatarRegex, inputExtraRuleCommentAvatarReplacement);
lastSite.extraRule.pictureRule = (lastSite.extraRule.pictureRule == null) ? new PictureRule() : lastSite.extraRule.pictureRule; lastSite.extraRule.pictureRule.thumbnail = loadSelector(inputExtraRulePictureThumbnailSelector, inputExtraRulePictureThumbnailRegex, inputExtraRulePictureThumbnailReplacement); lastSite.extraRule.pictureRule.url = loadSelector(inputExtraRulePictureUrlSelector, inputExtraRulePictureUrlRegex, inputExtraRulePictureUrlReplacement); lastSite.extraRule.pictureRule.highRes = loadSelector(inputExtraRulePictureHighResSelector, inputExtraRulePictureHighResRegex, inputExtraRulePictureHighResReplacement); lastSite.extraRule.commentRule = (lastSite.extraRule.commentRule == null) ? new CommentRule() : lastSite.extraRule.commentRule; lastSite.extraRule.commentRule.item = loadSelector(inputExtraRuleCommentItemSelector, inputExtraRuleCommentItemRegex, inputExtraRuleCommentItemReplacement);
16,721
notifyItemChanged(position); if (mItemClickListener != null) mItemClickListener.onItemClick(v, position); } }); <BUG>if (tag.selected) label.getChildAt(0).setBackgroundResource(R.color.colorPrimary); else label.getChildAt(0).setBackgroundResource(R.color.dimgray);</BUG> }
[DELETED]
16,722
loadPicture(picture, task, null, true); } else if (!TextUtils.isEmpty(picture.pic) && !highRes) { picture.retries = 0; loadPicture(picture, task, null, false); } else if (task.collection.site.hasFlag(Site.FLAG_SINGLE_PAGE_BIG_PICTURE) <BUG>&& task.collection.site.extraRule != null && task.collection.site.extraRule.pictureUrl != null) { </BUG> getPictureUrl(picture, task, task.collection.site.extraRule.pictureUrl, task.collection.site.extraRule.pictureHighRes);
&& task.collection.site.extraRule != null) { if(task.collection.site.extraRule.pictureRule != null && task.collection.site.extraRule.pictureRule.url != null) getPictureUrl(picture, task, task.collection.site.extraRule.pictureRule.url, task.collection.site.extraRule.pictureRule.highRes); else if(task.collection.site.extraRule.pictureUrl != null)
16,723
if (Picture.hasPicPosfix(picture.url)) { picture.pic = picture.url; loadPicture(picture, task, null, false); } else if (task.collection.site.hasFlag(Site.FLAG_JS_NEEDED_ALL)) { <BUG>new Handler(Looper.getMainLooper()).post(()->{ </BUG> WebView webView = new WebView(HViewerApplication.mContext); WebSettings mWebSettings = webView.getSettings(); mWebSettings.setJavaScriptEnabled(true);
new Handler(Looper.getMainLooper()).post(() -> {
16,724
} } @NotNull PsiElement[] findCommentsContainingIdentifier(@NotNull String identifier, @NotNull SearchScope searchScope); boolean processCommentsContainingIdentifier(@NotNull String identifier, @NotNull SearchScope searchScope, @NotNull Processor<PsiElement> processor); @NotNull PsiFile[] findFilesWithPlainTextWords(@NotNull String word); <BUG>void processUsagesInNonJavaFiles(@NotNull String qName, @NotNull PsiNonJavaFileReferenceProcessor processor, @NotNull GlobalSearchScope searchScope); void processUsagesInNonJavaFiles(@Nullable PsiElement originalElement, </BUG> @NotNull String qName, @NotNull PsiNonJavaFileReferenceProcessor processor,
public static PsiSearchHelper getInstance(Project project) { return ServiceManager.getService(project, PsiSearchHelper.class); boolean processUsagesInNonJavaFiles(@NotNull String qName,
16,725
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.search.ThrowSearchUtil"); private ThrowSearchUtil() { } public static class Root { final PsiElement myElement; <BUG>final PsiType myType; final boolean isExact; public Root(final PsiElement root, final PsiType type, final boolean exact) {</BUG> myElement = root; myType = type;
final PsiType myType; final boolean isExact; public Root(final PsiElement root, final PsiType type, final boolean exact) {
16,726
return Messages.showOkCancelDialog(psiElement.getProject(), FindBundle.message("find.parameter.usages.in.overriding.methods.prompt", parameter.getName()), FindBundle.message("find.parameter.usages.in.overriding.methods.title"), CommonBundle.getYesButtonText(), CommonBundle.getNoButtonText(), Messages.getQuestionIcon()) == 0; <BUG>} private static PsiElement[] getParameterElementsToSearch(final PsiParameter parameter) { </BUG> final PsiMethod method = (PsiMethod)parameter.getDeclarationScope(); PsiMethod[] overrides = OverridingMethodsSearch.search(method, true).toArray(PsiMethod.EMPTY_ARRAY);
@NotNull private static PsiElement[] getParameterElementsToSearch(@NotNull PsiParameter parameter) {
16,727
} }); return result; } @Override <BUG>public void processElementUsages(@NotNull final PsiElement element, @NotNull final Processor<UsageInfo> processor, @NotNull final FindUsagesOptions options) { if (options instanceof JavaVariableFindUsagesOptions) {</BUG> final JavaVariableFindUsagesOptions varOptions = (JavaVariableFindUsagesOptions) options; if (varOptions.isReadAccess || varOptions.isWriteAccess){ if (varOptions.isReadAccess && varOptions.isWriteAccess){
if (ThrowSearchUtil.isSearchable(element)) { return new FindThrowUsagesDialog(element, getProject(), myFactory.getFindThrowOptions(), toShowInNewTab, mustOpenInNewTab, isSingleFile, this);
16,728
</BUG> } } if (element instanceof PomTarget) { <BUG>addAliasingUsages((PomTarget)element, processor, options); </BUG> } final Boolean isSearchable = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() { @Override public Boolean compute() {
return psiMethod.hasModifierProperty(PsiModifier.ABSTRACT); }); final JavaMethodFindUsagesOptions methodOptions = (JavaMethodFindUsagesOptions)options; if (isAbstract && methodOptions.isImplementingMethods || methodOptions.isOverridingMethods) { if (!processOverridingMethods(psiMethod, processor, methodOptions)) return false; if (!addAliasingUsages((PomTarget)element, processor, options)) return false;
16,729
PsiDirectory[] dirs = aPackage.getDirectories(); for (PsiDirectory dir : dirs) { addClassesInDirectory(dir, includeSubpackages, array); } } <BUG>private static void addClassesInDirectory(final PsiDirectory dir, final boolean includeSubdirs, final ArrayList<PsiClass> array) { ApplicationManager.getApplication().runReadAction(new Runnable() {</BUG> @Override public void run() { PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(dir);
private static void addClassesInDirectory(@NotNull final PsiDirectory dir, final boolean includeSubdirs, @NotNull final List<PsiClass> array) { ApplicationManager.getApplication().runReadAction(new Runnable() {
16,730
return (PsiClass)parent; } } return null; } <BUG>private static void addInheritors(final PsiClass aClass, final Processor<UsageInfo> results, final JavaClassFindUsagesOptions options) { ClassInheritorsSearch.search(aClass, options.searchScope, options.isCheckDeepInheritance).forEach(new PsiElementProcessorAdapter<PsiClass>( </BUG> new PsiElementProcessor<PsiClass>() { @Override
private static boolean addInheritors(@NotNull PsiClass aClass, @NotNull final Processor<UsageInfo> processor, @NotNull final JavaClassFindUsagesOptions options) { return ClassInheritorsSearch.search(aClass, options.searchScope, options.isCheckDeepInheritance).forEach(new PsiElementProcessorAdapter<PsiClass>(
16,731
ClassInheritorsSearch.search(anInterface, options.searchScope, options.isCheckDeepInheritance).forEach(new PsiElementProcessorAdapter<PsiClass>( </BUG> new PsiElementProcessor<PsiClass>() { @Override <BUG>public boolean execute(@NotNull PsiClass inheritor) { if (inheritor.isInterface()) { addResult(results, inheritor, options); } return true;</BUG> }
return (PsiClass)parent; return null; private static boolean addInheritors(@NotNull PsiClass aClass, @NotNull final Processor<UsageInfo> processor, @NotNull final JavaClassFindUsagesOptions options) { return ClassInheritorsSearch.search(aClass, options.searchScope, options.isCheckDeepInheritance).forEach(new PsiElementProcessorAdapter<PsiClass>( public boolean execute(@NotNull PsiClass element) { return addResult(processor, element, options);
16,732
} return true;</BUG> } })); } <BUG>private static void addImplementingClasses(PsiClass anInterface, final Processor<UsageInfo> results, final JavaClassFindUsagesOptions options) { ClassInheritorsSearch.search(anInterface, options.searchScope, options.isCheckDeepInheritance).forEach(new PsiElementProcessorAdapter<PsiClass>( </BUG> new PsiElementProcessor<PsiClass>() { @Override
return null;
16,733
mSearchBar = (SearchBar) ViewUtils.$$(view, R.id.search_bar); mFabLayout = (FabLayout) ViewUtils.$$(view, R.id.fab_layout); Context context = getContext2(); AssertUtils.assertNotNull(context); Resources resources = context.getResources(); <BUG>int paddingTopSB = resources.getDimensionPixelOffset(R.dimen.list_padding_top_search_bar); </BUG> mHelper = new FavoritesHelper(); mHelper.setEmptyString(resources.getString(R.string.gallery_list_empty_hit)); contentLayout.setHelper(mHelper);
int paddingTopSB = resources.getDimensionPixelOffset(R.dimen.gallery_padding_top_search_bar);
16,734
switch (type) { default: case GalleryAdapter.TYPE_LIST: { int columnWidth = mResources.getDimensionPixelOffset(R.dimen.gallery_list_column_width); mLayoutManager.setColumnSize(columnWidth); <BUG>mLayoutManager.setStrategy(AutoGridLayoutManager.STRATEGY_MIN_SIZE); </BUG> if (null != mGirdDecoration) { recyclerView.removeItemDecoration(mGirdDecoration); }
mLayoutManager.setStrategy(AutoStaggeredGridLayoutManager.STRATEGY_MIN_SIZE);
16,735
</BUG> if (null != mGirdDecoration) { recyclerView.removeItemDecoration(mGirdDecoration); } if (null == mListDecoration) { <BUG>int interval = mResources.getDimensionPixelOffset(R.dimen.list_content_interval); int paddingH = mResources.getDimensionPixelOffset(R.dimen.list_content_margin_h); int paddingV = mResources.getDimensionPixelOffset(R.dimen.list_content_margin_v); </BUG> mListDecoration = new MarginItemDecoration(interval, paddingH, paddingV, paddingH, paddingV);
switch (type) { default: case GalleryAdapter.TYPE_LIST: { int columnWidth = mResources.getDimensionPixelOffset(R.dimen.gallery_list_column_width); mLayoutManager.setColumnSize(columnWidth); mLayoutManager.setStrategy(AutoStaggeredGridLayoutManager.STRATEGY_MIN_SIZE); int interval = mResources.getDimensionPixelOffset(R.dimen.gallery_list_interval); int paddingH = mResources.getDimensionPixelOffset(R.dimen.gallery_list_margin_h); int paddingV = mResources.getDimensionPixelOffset(R.dimen.gallery_list_margin_v);
16,736
break; } case GalleryAdapter.TYPE_GRID: { int columnWidth = mResources.getDimensionPixelOffset(Settings.getThumbSizeResId()); mLayoutManager.setColumnSize(columnWidth); <BUG>mLayoutManager.setStrategy(AutoGridLayoutManager.STRATEGY_SUITABLE_SIZE); </BUG> if (null != mListDecoration) { recyclerView.removeItemDecoration(mListDecoration); }
mLayoutManager.setStrategy(AutoStaggeredGridLayoutManager.STRATEGY_SUITABLE_SIZE);
16,737
import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AlertDialog; <BUG>import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater;</BUG> import android.view.MenuItem; import android.view.View;
import android.support.v7.widget.StaggeredGridLayoutManager; import android.view.LayoutInflater;
16,738
import com.h6ah4i.android.widget.advrecyclerview.swipeable.action.SwipeResultActionRemoveItem; import com.h6ah4i.android.widget.advrecyclerview.touchguard.RecyclerViewTouchActionGuardManager; import com.h6ah4i.android.widget.advrecyclerview.utils.AbstractSwipeableItemViewHolder; import com.hippo.easyrecyclerview.EasyRecyclerView; import com.hippo.easyrecyclerview.FastScroller; <BUG>import com.hippo.easyrecyclerview.HandlerDrawable; import com.hippo.ehviewer.EhDB;</BUG> import com.hippo.ehviewer.R; import com.hippo.ehviewer.client.EhCacheKeyFactory; import com.hippo.ehviewer.client.EhUtils;
import com.hippo.easyrecyclerview.MarginItemDecoration; import com.hippo.ehviewer.EhDB;
16,739
import com.hippo.scene.Announcer; import com.hippo.scene.SceneFragment; import com.hippo.util.ApiHelper; import com.hippo.util.DrawableManager; import com.hippo.view.ViewTransition; <BUG>import com.hippo.widget.LoadImageView; import com.hippo.yorozuya.AssertUtils;</BUG> import com.hippo.yorozuya.ResourcesUtils; import com.hippo.yorozuya.ViewUtils; import de.greenrobot.dao.query.LazyList;
import com.hippo.widget.recyclerview.AutoStaggeredGridLayoutManager; import com.hippo.yorozuya.AssertUtils;
16,740
mAdapter = swipeManager.createWrappedAdapter(mAdapter); mRecyclerView.setAdapter(mAdapter); final GeneralItemAnimator animator = new SwipeDismissItemAnimator(); animator.setSupportsChangeAnimations(false); mRecyclerView.setItemAnimator(animator); <BUG>LinearLayoutManager layoutManager = new LinearLayoutManager(context); mRecyclerView.setLayoutManager(layoutManager);</BUG> mRecyclerView.setSelector(RippleSalon.generateRippleDrawable(false)); mRecyclerView.setDrawSelectorOnTop(true); mRecyclerView.hasFixedSize();
AutoStaggeredGridLayoutManager layoutManager = new AutoStaggeredGridLayoutManager( 0, StaggeredGridLayoutManager.VERTICAL); layoutManager.setColumnSize(resources.getDimensionPixelOffset(R.dimen.gallery_list_column_width)); layoutManager.setStrategy(AutoStaggeredGridLayoutManager.STRATEGY_MIN_SIZE); mRecyclerView.setLayoutManager(layoutManager);
16,741
mRecyclerView.setSelector(RippleSalon.generateRippleDrawable(false)); mRecyclerView.setDrawSelectorOnTop(true); mRecyclerView.hasFixedSize(); mRecyclerView.setClipToPadding(false); mRecyclerView.setOnItemClickListener(this); <BUG>mRecyclerView.setOnItemLongClickListener(this); int paddingH = resources.getDimensionPixelOffset(R.dimen.list_content_margin_h); int paddingV = resources.getDimensionPixelOffset(R.dimen.list_content_margin_v); mRecyclerView.setPadding(paddingV, paddingH, paddingV, paddingH); guardManager.attachRecyclerView(mRecyclerView);</BUG> swipeManager.attachRecyclerView(mRecyclerView);
int interval = resources.getDimensionPixelOffset(R.dimen.gallery_list_interval); int paddingH = resources.getDimensionPixelOffset(R.dimen.gallery_list_margin_h); int paddingV = resources.getDimensionPixelOffset(R.dimen.gallery_list_margin_v); MarginItemDecoration decoration = new MarginItemDecoration(interval, paddingH, paddingV, paddingH, paddingV); mRecyclerView.addItemDecoration(decoration); decoration.applyPaddings(mRecyclerView); guardManager.attachRecyclerView(mRecyclerView);
16,742
RefreshLayout refreshLayout = contentLayout.getRefreshLayout(); mSearchLayout = (SearchLayout) ViewUtils.$$(mainLayout, R.id.search_layout); mSearchBar = (SearchBar) ViewUtils.$$(mainLayout, R.id.search_bar); mFabLayout = (FabLayout) ViewUtils.$$(mainLayout, R.id.fab_layout); mSearchFab = ViewUtils.$$(mainLayout, R.id.search_fab); <BUG>int paddingTopSB = resources.getDimensionPixelOffset(R.dimen.list_padding_top_search_bar); int paddingBottomFab = resources.getDimensionPixelOffset(R.dimen.list_padding_bottom_fab); </BUG> mViewTransition = new ViewTransition(contentLayout, mSearchLayout);
int paddingTopSB = resources.getDimensionPixelOffset(R.dimen.gallery_padding_top_search_bar); int paddingBottomFab = resources.getDimensionPixelOffset(R.dimen.gallery_padding_bottom_fab);
16,743
mEditText = (EditText) ViewUtils.$$(mEditPanel, R.id.edit_text); mFab = (FloatingActionButton) ViewUtils.$$(view, R.id.fab); Context context = getContext2(); AssertUtils.assertNotNull(context); Resources resources = context.getResources(); <BUG>int paddingBottomFab = resources.getDimensionPixelOffset(R.dimen.list_padding_bottom_fab); </BUG> Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_weird_face); drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); tip.setCompoundDrawables(null, drawable, null, null);
int paddingBottomFab = resources.getDimensionPixelOffset(R.dimen.gallery_padding_bottom_fab);
16,744
import com.github.amlcurran.showcaseview.targets.PointTarget; import com.github.amlcurran.showcaseview.targets.ViewTarget; import com.hippo.app.CheckBoxDialogBuilder; import com.hippo.easyrecyclerview.EasyRecyclerView; import com.hippo.easyrecyclerview.FastScroller; <BUG>import com.hippo.easyrecyclerview.HandlerDrawable; import com.hippo.ehviewer.EhApplication;</BUG> import com.hippo.ehviewer.EhDB; import com.hippo.ehviewer.R; import com.hippo.ehviewer.Settings;
import com.hippo.easyrecyclerview.MarginItemDecoration; import com.hippo.ehviewer.EhApplication;
16,745
import com.hippo.unifile.UniFile; import com.hippo.util.ApiHelper; import com.hippo.util.DrawableManager; import com.hippo.view.ViewTransition; import com.hippo.widget.FabLayout; <BUG>import com.hippo.widget.LoadImageView; import com.hippo.yorozuya.AssertUtils;</BUG> import com.hippo.yorozuya.FileUtils; import com.hippo.yorozuya.LongList; import com.hippo.yorozuya.ObjectUtils;
import com.hippo.widget.recyclerview.AutoStaggeredGridLayoutManager; import com.hippo.yorozuya.AssertUtils;
16,746
FastScroller fastScroller = (FastScroller) ViewUtils.$$(content, R.id.fast_scroller); mFabLayout = (FabLayout) ViewUtils.$$(view, R.id.fab_layout); TextView tip = (TextView) ViewUtils.$$(view, R.id.tip); mViewTransition = new ViewTransition(content, tip); Context context = getContext2(); <BUG>AssertUtils.assertNotNull(content); Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_download);</BUG> drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); tip.setCompoundDrawables(null, drawable, null, null); mAdapter = new DownloadAdapter();
Resources resources = context.getResources(); Drawable drawable = DrawableManager.getDrawable(context, R.drawable.big_download);
16,747
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); tip.setCompoundDrawables(null, drawable, null, null); mAdapter = new DownloadAdapter(); mAdapter.setHasStableIds(true); mRecyclerView.setAdapter(mAdapter); <BUG>mLayoutManager = new LinearLayoutManager(context); mRecyclerView.setLayoutManager(mLayoutManager);</BUG> mRecyclerView.setSelector(RippleSalon.generateRippleDrawable(false)); mRecyclerView.setDrawSelectorOnTop(true); mRecyclerView.hasFixedSize();
mLayoutManager = new AutoStaggeredGridLayoutManager(0, StaggeredGridLayoutManager.VERTICAL); mLayoutManager.setColumnSize(resources.getDimensionPixelOffset(R.dimen.gallery_list_column_width)); mLayoutManager.setStrategy(AutoStaggeredGridLayoutManager.STRATEGY_MIN_SIZE); mRecyclerView.setLayoutManager(mLayoutManager);
16,748
mRecyclerView.setChoiceMode(EasyRecyclerView.CHOICE_MODE_MULTIPLE_CUSTOM); mRecyclerView.setCustomCheckedListener(new DownloadChoiceListener()); RecyclerView.ItemAnimator itemAnimator = mRecyclerView.getItemAnimator(); if (itemAnimator instanceof SimpleItemAnimator) { ((SimpleItemAnimator) itemAnimator).setSupportsChangeAnimations(false); <BUG>} int paddingH = context.getResources().getDimensionPixelOffset(R.dimen.list_content_margin_h); int paddingV = context.getResources().getDimensionPixelOffset(R.dimen.list_content_margin_v); mRecyclerView.setPadding(paddingV, paddingH, paddingV, paddingH); if (mInitPosition >= 0) {</BUG> mRecyclerView.scrollToPosition(mInitPosition);
int interval = resources.getDimensionPixelOffset(R.dimen.gallery_list_interval); int paddingH = resources.getDimensionPixelOffset(R.dimen.gallery_list_margin_h); int paddingV = resources.getDimensionPixelOffset(R.dimen.gallery_list_margin_v); MarginItemDecoration decoration = new MarginItemDecoration(interval, paddingH, paddingV, paddingH, paddingV); mRecyclerView.addItemDecoration(decoration); decoration.applyPaddings(mRecyclerView); if (mInitPosition >= 0) {
16,749
MainActivity activity = getActivity2(); if (null == activity || !Settings.getGuideDownloadThumb() || null == mLayoutManager || null == mRecyclerView) { guideDownloadLabels(); return; } <BUG>int position = mLayoutManager.findFirstCompletelyVisibleItemPosition(); </BUG> if (position < 0) { guideDownloadLabels(); return;
[DELETED]
16,750
mAdapter = new SearchAdapter(); setLayoutManager(mLayoutManager); setAdapter(mAdapter); setHasFixedSize(true); setClipToPadding(false); <BUG>int paddingH = resources.getDimensionPixelOffset(R.dimen.list_content_margin_h); int paddingV = resources.getDimensionPixelOffset(R.dimen.list_content_margin_v); </BUG> setPadding(paddingV, paddingH, paddingV, paddingH);
int paddingH = resources.getDimensionPixelOffset(R.dimen.gallery_list_margin_h); int paddingV = resources.getDimensionPixelOffset(R.dimen.gallery_list_margin_v);
16,751
@InjectView(R.id.text_main1) private TextView textView1; @InjectView(R.id.text_main2) private TextView textView2; @InjectView(R.id.text_main3) private TextView textView3; @InjectView(R.id.text_main4) private TextView textView4; @InjectView(R.id.text_main5) private TextView textView5; <BUG>@InjectView(R.id.text_main6) private TextView textView6; @InjectView(R.id.text_main7) private TextView textView7; @InjectView(R.id.text_main8) private TextView textView8; @InjectView(R.id.text_main9) private TextView textView9; @InjectView(R.id.text_main10) private TextView textView10;</BUG> @InjectExtra(PARAM_BYTE) private byte byteField;
[DELETED]
16,752
package me.xiaopan.easy.android.sample; <BUG>import java.util.ArrayList; import me.xiaopan.android.easy.activity.EasyFragmentActivity; import me.xiaopan.android.easy.inject.InjectView; import android.os.Bundle;</BUG> import android.view.View;
import java.util.HashSet; import java.util.Set; import me.xiaopan.android.easy.util.PreferenceUtils; import android.os.Bundle;
16,753
import com.gh4a.utils.UiUtils; import com.gh4a.widget.SwipeRefreshLayout; import fr.castorflex.android.smoothprogressbar.SmoothProgressBar; public abstract class LoadingFragmentBase extends ProgressFragment implements LoaderCallbacks.ParentCallback, SwipeRefreshLayout.ChildScrollDelegate { <BUG>private SmoothProgressBar mProgress; public LoadingFragmentBase() {</BUG> } @Override public BaseActivity getBaseActivity() {
private int[] mProgressColors = new int[2]; public LoadingFragmentBase() {
16,754
import com.gh4a.widget.ColorDrawable; import com.gh4a.widget.SwipeRefreshLayout; import com.nineoldandroids.animation.Animator; import com.nineoldandroids.animation.AnimatorSet; import com.nineoldandroids.animation.ArgbEvaluator; <BUG>import com.nineoldandroids.animation.ObjectAnimator; import java.util.ArrayList;</BUG> import java.util.List; import fr.castorflex.android.smoothprogressbar.SmoothProgressBar; public abstract class BaseActivity extends AppCompatActivity implements
import com.nineoldandroids.animation.ValueAnimator; import java.util.ArrayList;
16,755
private NavigationView mRightDrawer; private View mLeftDrawerTitle; private View mRightDrawerTitle; private ActivityCompat.OnRequestPermissionsResultCallback mPendingPermissionCb; private final List<ColorDrawable> mHeaderDrawables = new ArrayList<>(); <BUG>private final List<ColorDrawable> mStatusBarDrawables = new ArrayList<>(); @Override</BUG> protected void onCreate(Bundle savedInstanceState) { setTheme(Gh4Application.THEME); super.onCreate(savedInstanceState);
private final int[] mProgressColors = new int[2]; @Override
16,756
int primaryDarkColor = UiUtils.resolveColor(this, R.attr.colorPrimaryDark); ColorDrawable d = ColorDrawable.create(primaryDarkColor); mDrawerLayout.setStatusBarBackground(d); mStatusBarDrawables.add(d); } <BUG>private ObjectAnimator createColorTransition(ColorDrawable drawable, int colorAttrId) { final ObjectAnimator animation = ObjectAnimator.ofInt(drawable, "color", drawable.getColor(), UiUtils.resolveColor(this, colorAttrId)); animation.setEvaluator(new ArgbEvaluator());</BUG> return animation;
[DELETED]
16,757
private void ensureContent() { if (mContentContainer != null && mProgress != null) { return; } mProgress = (SmoothProgressBar) findViewById(R.id.progress); <BUG>mProgress.setSmoothProgressDrawableColors(new int[] { UiUtils.resolveColor(this, R.attr.colorPrimary), UiUtils.resolveColor(this, R.attr.colorPrimaryDark) }); mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.coordinator_layout);</BUG> mContentContainer = (ViewGroup) findViewById(R.id.content_container);
mProgressColors[0] = UiUtils.resolveColor(this, R.attr.colorPrimary); mProgressColors[1] = UiUtils.resolveColor(this, R.attr.colorPrimaryDark); mProgress.setSmoothProgressDrawableColors(mProgressColors); mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.coordinator_layout);
16,758
import com.gh4a.widget.DividerItemDecoration; import com.gh4a.widget.SwipeRefreshLayout; import fr.castorflex.android.smoothprogressbar.SmoothProgressBar; public abstract class LoadingListFragmentBase extends ProgressFragment implements LoaderCallbacks.ParentCallback, SwipeRefreshLayout.ChildScrollDelegate { <BUG>private RecyclerView mRecyclerView; public interface OnRecyclerViewCreatedListener {</BUG> void onRecyclerViewCreated(Fragment fragment, RecyclerView recyclerView); } public LoadingListFragmentBase() {
private SmoothProgressBar mProgress; private int[] mProgressColors = new int[2]; public interface OnRecyclerViewCreatedListener {
16,759
mRecyclerView.addItemDecoration(new DividerItemDecoration(view.getContext())); } if (getActivity() instanceof OnRecyclerViewCreatedListener) { ((OnRecyclerViewCreatedListener) getActivity()).onRecyclerViewCreated(this, mRecyclerView); } <BUG>SmoothProgressBar progress = (SmoothProgressBar) view.findViewById(R.id.progress); progress.setSmoothProgressDrawableColors(new int[]{ UiUtils.resolveColor(view.getContext(), R.attr.colorPrimary), UiUtils.resolveColor(view.getContext(), R.attr.colorPrimaryDark) }); }</BUG> @Override
mProgress = (SmoothProgressBar) view.findViewById(R.id.progress); mProgressColors[0] = UiUtils.resolveColor(mProgress.getContext(), R.attr.colorPrimary); mProgressColors[1] = UiUtils.resolveColor(mProgress.getContext(), R.attr.colorPrimaryDark); mProgress.setSmoothProgressDrawableColors(mProgressColors);
16,760
import java.io.File; import java.net.SocketException; import javax.net.ssl.SSLException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; <BUG>import static org.junit.Assert.fail; import org.junit.Test;</BUG> import org.apache.catalina.Context; import org.apache.catalina.connector.Connector; import org.apache.catalina.startup.Tomcat;
import org.junit.Assume; import org.junit.Test;
16,761
public class TestCustomSsl extends TomcatBaseTest { @Test public void testCustomSslImplementation() throws Exception { TesterSupport.configureClientSsl(); Tomcat tomcat = getTomcatInstance(); <BUG>Connector connector = tomcat.getConnector(); if (connector.getProtocolHandlerClassName().contains("Apr")) { return; }</BUG> connector.setProperty("sslImplementationName",
Assume.assumeFalse("This test is only for JSSE based SSL connectors", connector.getProtocolHandlerClassName().contains("Apr"));
16,762
throws Exception { if (!TesterSupport.RFC_5746_SUPPORTED) { System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); } <BUG>Tomcat tomcat = getTomcatInstance(); if (!TesterSupport.isRenegotiationSupported(getTomcatInstance())) { return; }</BUG> TesterSupport.configureClientCertContext(tomcat);
Assume.assumeTrue("SSL renegotiation have to be supported", TesterSupport.isRenegotiationSupported(getTomcatInstance()));
16,763
package org.apache.tomcat.util.net; import java.util.Arrays; <BUG>import static org.junit.Assert.assertEquals; import org.junit.Test;</BUG> import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; import org.apache.tomcat.util.buf.ByteChunk;
import org.junit.Assume; import org.junit.Test;
16,764
import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest; import org.apache.tomcat.util.buf.ByteChunk; public class TestClientCert extends TomcatBaseTest { @Test <BUG>public void testClientCertGet() throws Exception { if (!TesterSupport.isRenegotiationSupported(getTomcatInstance())) { return; }</BUG> ByteChunk res =
Assume.assumeTrue("SSL renegotiation have to be supported", TesterSupport.isRenegotiationSupported(getTomcatInstance()));
16,765
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; <BUG>import org.junit.Assert; import org.junit.Test;</BUG> import org.apache.catalina.Context; import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.TomcatBaseTest;
import org.junit.Assume; import org.junit.Test;
16,766
GrStatementOwner block = (GrStatementOwner) realContainer; varDecl = (GrVariableDeclaration) block.addStatementBefore(varDecl, (GrStatement) anchorElement); } } else { <BUG>GrStatement tempStatement = ((GrStatement) anchorElement); boolean inThenIfBranch = realContainer instanceof GrIfStatement &&</BUG> anchorElement.equals(((GrIfStatement) realContainer).getThenBranch()); String refId = varDecl.getVariables()[0].getName(); GrBlockStatement newBody; if (tempStatement.equals(selectedExpr)) {
GrStatement tempStatement = anchorElement; boolean inThenIfBranch = realContainer instanceof GrIfStatement &&
16,767
private GrVariable replaceOnlyExpression(@NotNull GrExpression expr, GrExpression selectedExpr, @NotNull PsiElement context, @NotNull GrVariableDeclaration definition) throws IncorrectOperationException { if (context.equals(expr.getParent()) && <BUG>!GroovyRefactoringUtil.isLoopOrForkStatement(context)) { definition = (GrVariableDeclaration) expr.replaceWithStatement(definition); if (expr.equals(selectedExpr)) {</BUG> refreshPositionMarker(definition); }
!(context instanceof GrLoopStatement) && !(context instanceof GrClosableBlock)) { definition = expr.replaceWithStatement(definition); if (expr.equals(selectedExpr)) {
16,768
public void testLoop3() throws Throwable { doTest(); } public void testLoop4() throws Throwable { doTest(); } public void testLoop5() throws Throwable { doTest(); } public void testLoop6() throws Throwable { doTest(); } public void testLoop7() throws Throwable { doTest(); } <BUG>public void testLoop8() throws Throwable { doTest(); } protected static final String ALL_MARKER = "<all>";</BUG> protected boolean replaceAllOccurences = false; private String processFile(String fileText) throws IncorrectOperationException, InvalidDataException, IOException { String result = "";
public void testDuplicatesInsideIf() throws Throwable { doTest(); } public void testFromGString() throws Throwable { doTest(); } protected static final String ALL_MARKER = "<all>";
16,769
import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.markup.RangeHighlighter; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; <BUG>import com.intellij.psi.*; import com.intellij.psi.impl.source.tree.LeafPsiElement; import com.intellij.psi.codeStyle.JavaCodeStyleManager;</BUG> import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
16,770
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrOpenBlock; import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrBreakStatement; import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrContinueStatement; import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrReturnStatement; import org.jetbrains.plugins.groovy.lang.psi.api.statements.clauses.GrCaseSection; <BUG>import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.*; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrCallExpression;</BUG> import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrMethodCallExpression; import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter; import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrString; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrCallExpression;
16,771
!isLoopOrForkStatement(parent)) { parent = parent.getParent();</BUG> } <BUG>return parent; } public static boolean isLoopOrForkStatement(PsiElement elem) { return elem instanceof GrForStatement || elem instanceof GrWhileStatement || elem instanceof GrIfStatement;</BUG> }
}); private static final String[] finalModifiers = new String[]{PsiModifier.FINAL};
16,772
return operand; } public static boolean isAppropriateContainerForIntroduceVariable(PsiElement tempContainer) { return tempContainer instanceof GrOpenBlock || tempContainer instanceof GrClosableBlock || <BUG>tempContainer instanceof GroovyFileBase || tempContainer instanceof GrCaseSection || isLoopOrForkStatement(tempContainer);</BUG> } @Nullable
tempContainer instanceof GrCaseSection || tempContainer instanceof GrLoopStatement;
16,773
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\""))); }
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
16,774
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, sum, fib)); }
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
16,775
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task<String> task2 = Task.ofType(String.class).named("Baz", 40) .in(() -> task1)</BUG> .ins(() -> singletonList(task1))
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
16,776
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField + " causes an outer reference");</BUG> serialize(task); } @Test
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
16,777
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.evaluate(des).consume(val);
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
16,778
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
16,779
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
16,780
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);
16,781
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() -> n);
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
16,782
import android.text.TextUtils; import com.waz.api.Self; import com.waz.api.UsernameValidation; import com.waz.api.Usernames; import com.waz.api.ValidatedUsernames; <BUG>import com.waz.zclient.WireApplication; </BUG> import com.waz.zclient.core.api.scala.ModelObserver; import com.waz.zclient.utils.StringUtils; import java.util.ArrayList;
import com.waz.zclient.ZApplication;
16,783
public class UsernamesController implements IUsernamesController { private static final int USERNAME_MAX_LENGTH = 21; private static final int NORMAL_ATTEMPTS = 30; private static final int RANDOM_ATTEMPTS = 20; private static final int MAX_RANDOM_TRAILLING_NUMBER = 1000; <BUG>private WireApplication application = null; </BUG> private Random randomGenerator; private Set<UsernamesControllerObserver> usernamesControllerObservers = Collections.newSetFromMap( new WeakHashMap<UsernamesControllerObserver, Boolean>());
private ZApplication application = null;
16,784
protected int getBaseTheme() { return R.style.Theme_Dark; } @Override public void onBaseActivityStart() { <BUG>persistInviteToken(); new BackendPicker(getApplicationContext()).withBackend(this, new Callback<Void>() {</BUG> @Override public void callback(Void aVoid) { LaunchActivity.super.onBaseActivityStart();
injectJava(GlobalTrackingController.class).appLaunched(getIntent()); new BackendPicker(getApplicationContext()).withBackend(this, new Callback<Void>() {
16,785
package com.waz.zclient; import com.facebook.stetho.Stetho; <BUG>public class StethoApplication extends WireApplication { </BUG> @Override public void onCreate() { super.onCreate();
public class StethoApplication extends ZApplication {
16,786
import com.spotify.sdk.android.authentication.AuthenticationResponse; import com.spotify.sdk.android.player.Config; import com.waz.api.KindOfSpotifyAccount; import com.waz.api.Spotify; import com.waz.api.ZMessagingApi; <BUG>import com.waz.zclient.WireApplication; </BUG> import com.waz.zclient.controllers.userpreferences.IUserPreferencesController; import com.waz.zclient.core.stores.IStoreFactory; import com.waz.zclient.core.stores.api.IZMessagingApiStore;
import com.waz.zclient.ZApplication;
16,787
package com.waz.zclient.pages; import android.app.Activity; import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; import com.waz.zclient.ServiceContainer; <BUG>import com.waz.zclient.WireApplication; </BUG> import com.waz.zclient.controllers.IControllerFactory; import com.waz.zclient.core.stores.IStoreFactory; public class BaseDialogFragment<T> extends DialogFragment implements ServiceContainer {
import com.waz.zclient.ZApplication;
16,788
Fragment fragment = getParentFragment(); if (fragment != null) { container = (T) fragment; } else { container = (T) activity; <BUG>} } @Override</BUG> public final void onDetach() { onPreDetach();
onPostAttach(activity); protected void onPostAttach(Activity activity) { } @Override
16,789
protected int getBaseTheme() { return getControllerFactory().getThemeController().getTheme(); } @Override public void onBaseActivityStart() { <BUG>((WireApplication) getApplication()).ensureInitialized(); getControllerFactory().setActivity(this);</BUG> if (!started) { started = true;
((ZApplication) getApplication()).ensureInitialized(); super.onBaseActivityStart(); getControllerFactory().setActivity(this);
16,790
import android.support.v7.preference.XpPreferenceFragment; import android.text.TextUtils; import android.view.View; import com.waz.zclient.BaseScalaActivity; import com.waz.zclient.ServiceContainer; <BUG>import com.waz.zclient.WireApplication; </BUG> import com.waz.zclient.controllers.IControllerFactory; import com.waz.zclient.controllers.userpreferences.UserPreferencesController; import com.waz.zclient.core.controllers.tracking.events.Event;
import com.waz.zclient.ZApplication;
16,791
Fragment fragment = getParentFragment(); if (fragment != null) { container = (T) fragment; } else { container = (T) activity; <BUG>} } @Override</BUG> @CallSuper public void onCreatePreferences2(Bundle savedInstanceState, String rootKey) {
onPostAttach(activity); protected void onPostAttach(Activity activity) { } @Override
16,792
setDivider(null); } @Override public void onStop() { preferenceManager.getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this); <BUG>super.onStop(); </BUG> } @Override public final void onDetach() {
super.onStart();
16,793
showDialog(activity, callback); } else { callback.callback(null); } } <BUG>public boolean hasBackendConfig() { return getBackendConfig() != null; }</BUG> private void showDialog(Activity activity, final Callback<Void> callback) { AlertDialog.Builder builder = new AlertDialog.Builder(activity);
public void withBackend(final Callback<Void> callback) { BackendConfig be = getBackendConfig(); if (be != null) { ZMessaging.useBackend(be);
16,794
}); builder.setCancelable(false); builder.create().show(); } private boolean shouldShowBackendPicker() { <BUG>return BuildConfig.SHOW_BACKEND_PICKER && !PreferenceManager.getDefaultSharedPreferences(context).contains(CUSTOM_BACKEND_PREFERENCE); </BUG> }
if (!BuildConfig.SHOW_BACKEND_PICKER) { return false; return !PreferenceManager.getDefaultSharedPreferences(context).contains(CUSTOM_BACKEND_PREFERENCE);
16,795
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class PatchUtils {
import java.text.DateFormat; import java.util.Date; import java.util.List;
16,796
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
16,797
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
16,798
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
[DELETED]
16,799
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); <BUG>writer.writeAttribute(Attribute.PATH.name, path.toString()); if(type != ModificationType.REMOVE) {</BUG> writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
16,800
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
import org.jboss.logging.annotations.Cause; import java.io.IOException;