id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
36,001
PsiClass containingClass = PsiTreeUtil.getParentOfType(psiBlock, PsiClass.class); if (containingClass != null && PsiUtil.isLocalOrAnonymousClass(containingClass)) { final PsiElement parent = containingClass.getParent(); final PsiCodeBlock block = DfaPsiUtil.getTopmostBlockInSameClass(parent); if ((parent instanceof Psi...
final RunnerResult result = analyzeMethod(block, visitor); final Collection<DfaMemoryState> closureStates = myNestedClosures.get(block);
36,002
if (instruction instanceof BranchingInstruction) { if (!instruction.setMemoryStateProcessed(instructionState.getMemoryState().createCopy())) { LOG.debug("Too complex because too many different possible states"); return RunnerResult.TOO_COMPLEX; // Too complex :( } <BUG>} if (LOG.isDebugEnabled()) { LOG.debug(instructio...
DfaInstructionState[] after = acceptInstruction(visitor, instructionState);
36,003
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
36,004
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_()...
sink.lineBreak(); sink.section1_();
36,005
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
36,006
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
36,007
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); s...
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
36,008
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
36,009
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
36,010
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
36,011
package japicmp.filter; <BUG>import javassist.CtField; import java.util.List;</BUG> public class AnnotationFieldFilter extends AnnotationFilterBase implements FieldFilter { public AnnotationFieldFilter(String filterString) { super(filterString.substring(1));
import javassist.CtClass; import javassist.NotFoundException; import java.util.List;
36,012
package japicmp.cmp; <BUG>import japicmp.filter.*; import japicmp.model.JApiClass; import japicmp.util.CtClassBuilder;</BUG> import japicmp.util.CtFieldBuilder; import japicmp.util.CtMethodBuilder;
import japicmp.model.JApiChangeStatus; import japicmp.model.JApiField; import japicmp.model.JApiMethod; import japicmp.util.CtClassBuilder;
36,013
Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.tab_qibla, container, false); final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass); qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_...
sOrientationListener = new android.hardware.SensorListener() {
36,014
return getDataChampion(region, id, null, null, (ChampData) null); } public net.rithms.riot.api.endpoints.static_data.dto.ChampionList getDataChampionList(Region region, String locale, String version, boolean dataById, ChampData... champData) throws RiotApiException { Objects.requireNonNull(region); <BUG>return StaticDa...
ApiMethod method = new GetDataChampionList(getConfig(), region, locale, version, dataById, champData); return endpointManager.callMethodAndReturnDto(method);
36,015
return getDataSummonerSpell(region, id, null, null, (SpellData) null); } public SummonerSpellList getDataSummonerSpellList(Region region, String locale, String version, boolean dataById, SpellData... spellData) throws RiotApiException { Objects.requireNonNull(region); <BUG>return StaticDataApi.getDataSummonerSpellList(...
ApiMethod method = new GetDataSummonerSpellList(getConfig(), region, locale, version, dataById, spellData); return endpointManager.callMethodAndReturnDto(method);
36,016
public SummonerSpellList getDataSummonerSpellList(Region region) throws RiotApiException { Objects.requireNonNull(region); return getDataSummonerSpellList(region, null, null, false, (SpellData) null); } public List<String> getDataVersions(Region region) throws RiotApiException { <BUG>return StaticDataApi.getDataVersion...
ApiMethod method = new GetDataVersions(getConfig(), region); return endpointManager.callMethodAndReturnDto(method);
36,017
import org.apache.log4j.Logger; class NitroError { static final int NS_RESOURCE_EXISTS = 273; static final int NS_RESOURCE_NOT_EXISTS=258; static final int NS_NO_SERIVCE = 344; <BUG>static final int NS_OPERATION_NOT_PERMITTED = 257; }</BUG> public class NetscalerResource implements ServerResource { private String _name...
static final int NS_INTERFACE_ALREADY_BOUND_TO_VLAN = 2080; }
36,018
ipVlanBinding.set_id(vlanTag); ipVlanBinding.set_ipaddress(vlanSelfIp); ipVlanBinding.set_netmask(vlanNetmask); apiCallResult = vlan_nsip_binding.add(_netscalerService, ipVlanBinding); if (apiCallResult.errorcode != 0) { <BUG>throw new ExecutionException("Failed to bind vlan with tag:" + vlanTag + " to the subnet due t...
throw new ExecutionException("Failed to bind VLAN with tag:" + vlanTag + " to the subnet due to " + apiCallResult.message); } catch (nitro_exception e) { throw new ExecutionException("Failed to bind VLAN with tage:"+ vlanTag + " to the subnet due to " + e.getMessage()); try { vlan_interface_binding vlanBinding = new vl...
36,019
import java.io.IOException; import java.io.InputStream; <BUG>import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList;</BUG> import java.util.concurrent.TimeUnit; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response;
import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; import java.util.ArrayList;
36,020
return null; } } public static void writeStringAsFile(Context context, final String fileContents) { try { <BUG>FileWriter out = new FileWriter(new File(BasePath.getBasePath(context), "email.txt")); out.write(fileContents);</BUG> out.close(); } catch (IOException e) { }
} catch (Exception e) { e.printStackTrace(); FileOutputStream fileOutputStream = new FileOutputStream(BasePath.getBasePath(context) + "/email.txt"); OutputStreamWriter out = new OutputStreamWriter(fileOutputStream, StandardCharsets.UTF_8); out.write(fileContents);
36,021
package com.sigmobile.dawebmail.network; import android.content.Context; import android.util.Log; import com.sigmobile.dawebmail.utils.BasePath; import java.io.ByteArrayInputStream; <BUG>import java.io.InputStream; import java.util.Properties;</BUG> import javax.mail.Multipart; import javax.mail.Part; import javax.mail...
import java.nio.charset.StandardCharsets; import java.util.Properties;
36,022
public MailParser() { } public void newMailParser(Context context, int contentID, String emailContentBytes) { try { Session s = Session.getDefaultInstance(new Properties()); <BUG>InputStream is = new ByteArrayInputStream(emailContentBytes.getBytes()); </BUG> MimeMessage message = new MimeMessage(s, is); String contentT...
InputStream is = new ByteArrayInputStream(emailContentBytes.getBytes(StandardCharsets.UTF_8));
36,023
for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } try { <BUG>if (selenium.isElementPresent("//a[@id='addPage']")) { break;</BUG> } } catch (Exception e) {
if (selenium.isElementPresent( "//script[contains(@src,'/aui/aui-editable/aui-editable-min.js')]")) { break;
36,024
RuntimeVariables.replace("Kaleo Forms Test Page")); selenium.waitForPageToLoad("30000"); loadRequiredJavaScriptModules(); assertEquals(RuntimeVariables.replace("Ticket Process"), selenium.getText( <BUG>"//div[@id='workflowMyRolesTasksPanel']/div[2]/div/div/div/table/tbody/tr[3]/td[2]")); Thread.sleep(5000);</BUG> selen...
"//div[@id='workflowMyRolesTasksPanel']//tr[3]/td[2]")); Thread.sleep(5000);
36,025
RuntimeVariables.replace("More")); for (int second = 0;; second++) { if (second >= 90) { fail("timeout"); } <BUG>try { if (selenium.isElementPresent("//div[@title='Kaleo Forms']/p/a")) { </BUG> break; }
[DELETED]
36,026
import javafx.scene.Scene; import java.time.LocalTime; import java.util.Locale; import java.util.Random; public class Demo extends Application { <BUG>private static final Random RND = new Random(); private BarChartItem barChartItem1;</BUG> private BarChartItem barChartItem2; private BarChartItem barChartItem3;...
private static final double TILE_WIDTH = 125; private static final double TILE_HEIGHT = 125; private BarChartItem barChartItem1;
36,027
leaderBoardItem1 = new LeaderBoardItem("Gerrit", 47); leaderBoardItem2 = new LeaderBoardItem("Sandra", 43); leaderBoardItem3 = new LeaderBoardItem("Lilli", 12); leaderBoardItem4 = new LeaderBoardItem("Anton", 8); percentageTile = TileBuilder.create() <BUG>.skinType(SkinType.PERCENTAGE) .title("Percentage Tile")</BUG> ....
.prefSize(TILE_WIDTH, TILE_HEIGHT) .title("Percentage Tile")
36,028
.unit("\u0025") .description("Test") .maxValue(60) .build(); clockTile = TileBuilder.create() <BUG>.skinType(SkinType.CLOCK) .title("Clock Tile")</BUG> .text("Whatever text") .dateVisible(true) .locale(Locale.US)
.prefSize(TILE_WIDTH, TILE_HEIGHT) .title("Clock Tile")
36,029
.dateVisible(true) .locale(Locale.US) .running(true) .build(); gaugeTile = TileBuilder.create() <BUG>.skinType(SkinType.GAUGE) .title("Gauge Tile")</BUG> .unit("V") .threshold(75) .build();
.prefSize(TILE_WIDTH, TILE_HEIGHT) .title("Gauge Tile")
36,030
.text("Whatever text") .referenceValue(6.7) .value(8.2) .build(); timerControlTile = TileBuilder.create() <BUG>.skinType(SkinType.TIMER_CONTROL) .title("TimerControl Tile")</BUG> .text("Whatever text") .secondsVisible(true) .dateVisible(true)
.prefSize(TILE_WIDTH, TILE_HEIGHT) .title("TimerControl Tile")
36,031
.dateVisible(true) .timeSections(timeSection) .running(true) .build(); numberTile = TileBuilder.create() <BUG>.skinType(SkinType.NUMBER) .title("Number Tile")</BUG> .text("Whatever text") .value(13) .unit("mb")
.prefSize(TILE_WIDTH, TILE_HEIGHT) .title("Number Tile")
36,032
.unit("mb") .description("Test") .textVisible(true) .build(); textTile = TileBuilder.create() <BUG>.skinType(SkinType.TEXT) .title("Text Tile")</BUG> .text("Whatever text") .description("May the force be with you\n...always") .textVisible(true)
.prefSize(TILE_WIDTH, TILE_HEIGHT) .title("Text Tile")
36,033
.title("WorldMap Tile") .text("Whatever text") .textVisible(false) .build(); weatherTile = TileBuilder.create() <BUG>.skinType(SkinType.WEATHER) .title("YOUR CITY NAME")</BUG> .text("Whatever text") .darkSky(darkSky) .build();
.prefSize(TILE_WIDTH, TILE_HEIGHT) .title("YOUR CITY NAME")
36,034
.duration(LocalTime.of(1, 22)) .description("Average reply time") .textVisible(true) .build(); barChartTile = TileBuilder.create() <BUG>.skinType(SkinType.BAR_CHART) .title("BarChart Tile")</BUG> .text("Whatever text") .barChartItems(barChartItem1, barChartItem2, barChartItem3, barChartItem4) .decimals(0)
.prefSize(TILE_WIDTH, TILE_HEIGHT) .title("BarChart Tile")
36,035
pane.setAlignment(Pos.CENTER); pane.setHgap(5); pane.setVgap(5);</BUG> pane.setCenterShape(true); pane.setPadding(new Insets(5)); <BUG>pane.setPrefSize(921, 616); </BUG> pane.setBackground(new Background(new BackgroundFill(Color.web("#101214"), CornerRadii.EMPTY, Insets.EMPTY))); Scene scene = new Scene(pane); stage.se...
pane.setPrefSize(915, 395);
36,036
} public SpriteBatch (int size, int buffers) { this(size, buffers, null); } public SpriteBatch (int size, int buffers, ShaderProgram defaultShader) { <BUG>if (size > 5460) { throw new GdxRuntimeException("Can't have more than 5460 sprites per batch"); }</BUG> this.buffers = new Mesh[buffers];
public SpriteBatch (int size) { this(size, null); public SpriteBatch (int size, ShaderProgram defaultShader) { this(size, 1, defaultShader); if (size > 5460) throw new IllegalArgumentException("Can't have more than 5460 sprites per batch: " + size);
36,037
shader.begin(); } else { Gdx.gl.glEnable(GL10.GL_TEXTURE_2D); } setupMatrices(); <BUG>idx = 0; lastTexture = null;</BUG> drawing = true; } public void end () {
[DELETED]
36,038
idx += copyCount; count -= copyCount; while (count > 0) { offset += copyCount; renderMesh(); <BUG>copyCount = Math.min(vertices.length, count); </BUG> System.arraycopy(spriteVertices, offset, vertices, 0, copyCount); idx += copyCount; count -= copyCount;
copyCount = Math.min(verticesLength, count);
36,039
x4 += worldOriginX; y4 += worldOriginY; final float u = region.u; final float v = region.v2; final float u2 = region.u2; <BUG>final float v2 = region.v; vertices[idx++] = x1;</BUG> vertices[idx++] = y1; vertices[idx++] = color; vertices[idx++] = u;
int idx = this.idx; vertices[idx++] = x1;
36,040
v2 = region.v; u3 = region.u2; v3 = region.v2; u4 = region.u; v4 = region.v2; <BUG>} vertices[idx++] = x1;</BUG> vertices[idx++] = y1; vertices[idx++] = color; vertices[idx++] = u1;
int idx = this.idx; vertices[idx++] = x1;
36,041
vertices[idx++] = v3; vertices[idx++] = x4; vertices[idx++] = y4; vertices[idx++] = color; vertices[idx++] = u4; <BUG>vertices[idx++] = v4; }</BUG> public void flush () { renderMesh(); }
this.idx = idx;
36,042
throw new UserException("NaN LOD value assigned. Clustering with this few variants and these annotations is unsafe. Please consider raising the number of variants used to train the negative model (via --percentBadVariants 0.05, for example) or lowering the maximum number of Gaussians to use in the model (via --maxGauss...
datum.lod = ( evaluateContrastively ? ( Double.isInfinite(datum.lod) ? // positive model said negative infinity ( MIN_ACCEPTABLE_LOD_SCORE + GenomeAnalysisEngine.getRandomGenerator().nextDouble() * MIN_ACCEPTABLE_LOD_SCORE ) // Negative infinity lod values are possible when covariates are extremely far away from their ...
36,043
import org.mule.extension.annotations.Configurations; import org.mule.extension.annotations.Operations; import org.mule.extension.annotations.Parameter; import org.mule.extension.annotations.capability.Xml; import org.mule.extension.introspection.DataType; <BUG>import org.mule.extension.introspection.declaration.Descri...
import org.mule.extension.introspection.declaration.fluent.Declaration;
36,044
import static org.mule.module.extension.internal.util.IntrospectionUtils.getParameterFields; import static org.mule.module.extension.internal.util.IntrospectionUtils.getParameterGroupFields; import static org.mule.module.extension.internal.util.MuleExtensionUtils.getDefaultValue; import static org.mule.util.Preconditio...
import org.mule.extension.annotations.Extensible; import org.mule.extension.annotations.Extension;
36,045
package com.contentful.java.cma; public final class Constants { private Constants() { throw new UnsupportedOperationException(); } <BUG>public static final String ENDPOINT_CMA = "https://api.contentful.com"; </BUG> @SuppressWarnings("UnusedDeclaration") public enum CMAFieldType { Array,
public static final String ENDPOINT_CMA = "https://api.contentful.com/";
36,046
final ModuleContentTypes modContentTypes; final ModuleEntries modEntries; final ModuleSpaces modSpaces; final PropertiesReader propertiesReader; Executor callbackExecutor; <BUG>private CMAClient(Builder builder) { if (builder.accessToken == null) { </BUG> throw new IllegalArgumentException("No access token was set.");...
private CMAClient(Builder cmaBuilder) { if (cmaBuilder.accessToken == null) {
36,047
import com.contentful.java.cma.RxExtensions.ActionError; import com.contentful.java.cma.RxExtensions.ActionSuccess; import com.contentful.java.cma.RxExtensions.DefFunc; import com.contentful.java.cma.model.CMAResource; import java.util.concurrent.Executor; <BUG>import retrofit.RestAdapter; </BUG> import rx.Observable; ...
import retrofit2.Retrofit;
36,048
import rx.Observable; import rx.schedulers.Schedulers; abstract class AbsModule<T> { final T service; final Executor callbackExecutor; <BUG>AbsModule(RestAdapter restAdapter, Executor callbackExecutor) { this.service = createService(restAdapter); </BUG> this.callbackExecutor = callbackExecutor;
AbsModule(Retrofit retrofit, Executor callbackExecutor) { this.service = createService(retrofit);
36,049
this.service = createService(restAdapter); </BUG> this.callbackExecutor = callbackExecutor; } <BUG>protected abstract T createService(RestAdapter restAdapter); </BUG> void assertNotNull(Object object, String param) { if (object == null) { throw new IllegalArgumentException(String.format(
import rx.Observable; import rx.schedulers.Schedulers; abstract class AbsModule<T> { final T service; final Executor callbackExecutor; AbsModule(Retrofit retrofit, Executor callbackExecutor) { this.service = createService(retrofit); protected abstract T createService(Retrofit retrofit);
36,050
{ return new RefactoringStatus(); } @Override public Change perform(IProgressMonitor progress) throws CoreException <BUG>{ sigil.getBundle().getBundleInfo().removeImport(oldImport); sigil.getBundle().getBundleInfo().addImport(newImport); sigil.save(progress);</BUG> return new ImportPackageChange(sigil, newImport, oldIm...
private final ISigilProjectModel sigil; private final IPackageImport oldImport; private final IPackageImport newImport; public ImportPackageChange(ISigilProjectModel sigil, IPackageImport oldImport, IPackageImport newImport) this.sigil = sigil; this.oldImport = oldImport; this.newImport = newImport;
36,051
{ return new RefactoringStatus(); } @Override public Change perform(IProgressMonitor progress) throws CoreException <BUG>{ sigil.getBundle().getBundleInfo().removeChild(oldExport); sigil.getBundle().getBundleInfo().addExport(newExport); sigil.save(progress);</BUG> return new ExportPackageChange(sigil, newExport, oldExp...
private final ISigilProjectModel sigil; private final IPackageExport oldExport; private final IPackageExport newExport; public ExportPackageChange(ISigilProjectModel sigil, IPackageExport oldExport, IPackageExport newExport) this.sigil = sigil; this.oldExport = oldExport; this.newExport = newExport;
36,052
package org.apache.felix.sigil.ui.eclipse.refactor; import java.util.Collection; import java.util.LinkedList; import java.util.List; import org.apache.felix.sigil.eclipse.SigilCore; <BUG>import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel; import org.apache.felix.sigil.model.IModelElement;</BUG> impo...
import org.apache.felix.sigil.eclipse.model.util.ModelHelper; import org.apache.felix.sigil.model.IModelElement;
36,053
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
36,054
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
36,055
EditorCell_Collection result = jetbrains.mps.nodeEditor.cells.EditorCell_Collection.createIndent2(editorContext, node); result.setBig(true); result.getStyle().putAll(StyleRegistry.getInstance().getStyle("LINE_COMMENT"), 1); result.addEditorCell(createCommentConstantCell(editorContext, node, true)); result.addEditorCell...
result.setCellId("main_comment_collection"); return result;
36,056
} private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) { EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false); StyleImpl style = new StyleImpl(); style.set(left ? StyleAttributes.PUNCTUATIO...
cell.setCellId(left ? "left_comment_constant" : "right_comment_constant"); return cell;
36,057
import org.jetbrains.annotations.NotNull; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.openapi.editor.selection.Selection; import jetbrains.mps.openapi.editor.selection.SingularSelection; <BUG>import jetbrains.mps.opena...
import jetbrains.mps.openapi.editor.cells.EditorCell_Label; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
36,058
import jetbrains.mps.editor.runtime.cells.AbstractCellAction; import org.jetbrains.mps.openapi.model.SNode; import org.jetbrains.annotations.NotNull; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; <BUG>import jetbrains.mps.openapi.editor.cell...
import jetbrains.mps.openapi.editor.cells.EditorCell_Label; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
36,059
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 ...
import java.text.DateFormat; import java.util.Date; import java.util.List;
36,060
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;
36,061
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"), MIS...
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
36,062
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_VE...
[DELETED]
36,063
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, bytesToHex...
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
36,064
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> impor...
import org.jboss.logging.annotations.Cause; import java.io.IOException;
36,065
package mage.player.ai; <BUG>import java.util.LinkedList; import java.util.UUID;</BUG> import mage.Constants.AbilityType; import mage.Constants.PhaseStep; import mage.Constants.RangeOfInfluence;
import java.util.List; import java.util.UUID;
36,066
if (!getNextAction(game)) { currentScore = GameStateEvaluator.evaluate(playerId, game); Game sim = createSimulation(game); SimulationNode.resetCount(); root = new SimulationNode(null, sim, playerId); <BUG>logger.debug("simulating pre combat actions -----------------------------------------------------------------------...
if (!isTestMode) else addActions(root, new FilterAbility(), Integer.MIN_VALUE, Integer.MAX_VALUE); if (root.children.size() > 0) {
36,067
if (!getNextAction(game)) { currentScore = GameStateEvaluator.evaluate(playerId, game); Game sim = createSimulation(game); SimulationNode.resetCount(); root = new SimulationNode(null, sim, playerId); <BUG>logger.debug("simulating post combat actions ----------------------------------------------------------------------...
logger.debug("simulating pre combat actions -----------------------------------------------------------------------------------------"); if (!isTestMode) else addActions(root, new FilterAbility(), Integer.MIN_VALUE, Integer.MAX_VALUE); if (root.children.size() > 0) {
36,068
import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; <BUG>import mage.abilities.Ability; import mage.abilities.TriggeredAbility;</BUG> import mage.abilities.common.PassAbility; import mage.abilities.costs.mana.GenericManaCost; i...
import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbility;
36,069
currentScore = GameStateEvaluator.evaluate(playerId, game); if (!getNextAction(game)) { Game sim = createSimulation(game); SimulationNode.resetCount(); root = new SimulationNode(null, sim, playerId); <BUG>logger.debug("simulating actions"); addActionsTimed(new FilterAbility()); if (root.children.size() > 0) {</BUG> roo...
if (!isTestMode) else addActions(root, new FilterAbility(), Integer.MIN_VALUE, Integer.MAX_VALUE); if (root.children.size() > 0) {
36,070
sim.getPlayer(currentPlayer.getId()).pass(); sim.getPlayerList().getNext(); } SimulationNode newNode = new SimulationNode(node, sim, action, currentPlayer.getId()); if (logger.isDebugEnabled()) <BUG>logger.debug(indent(node.depth) + "simulating -- node #:" + SimulationNode.getCount() + " actions:" + action); </BUG> sim...
logger.debug(indent(newNode.depth) + "simulating -- node #:" + SimulationNode.getCount() + " actions:" + action);
36,071
import java.util.regex.*; import net.java.sip.communicator.service.contactsource.*; import net.java.sip.communicator.service.protocol.*; public abstract class AsyncContactQuery<T extends ContactSourceService> extends AbstractContactQuery<T> <BUG>{ protected final Pattern query; private final List<SourceContact> queryRe...
private String phoneNumberQuery; private boolean queryIsConvertedToPhoneNumber; private final List<SourceContact> queryResults
36,072
private static native long kABPhoneProperty(); private static native long kABYahooInstantProperty(); private boolean matches(int property, String value) { return <BUG>query.matcher(value).find() || ((kABPhoneProperty == property) && query .matcher(normalizePhoneNumber(value)) .find());</BUG> }
|| ((kABPhoneProperty == property) && phoneNumberMatches(value));
36,073
package net.java.sip.communicator.plugin.addrbook; import net.java.sip.communicator.service.protocol.*; <BUG>import com.google.i18n.phonenumbers.*; public class PhoneNumberI18nServiceImpl</BUG> implements PhoneNumberI18nService { public String normalize(String phoneNumber)
import java.util.*; import com.google.i18n.phonenumbers.Phonenumber.*; public class PhoneNumberI18nServiceImpl
36,074
if ((MAPI_MAILUSER == objType) && (mapiMessageCount != 0)) return false; int propIndex = 0; boolean matches = false; for (Object prop : props) <BUG>{ if ((prop instanceof String) && (query.matcher((String) prop).find() || (isPhoneNumber(propIndex) && query .matcher( normalizePhoneNumber( (String) prop)) .find())))</BUG...
if ((prop instanceof String) && matches(propIndex, (String) prop))
36,075
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
36,076
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
36,077
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
36,078
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
36,079
oldGroupIds[i] = group.getGroupId(); } } MembershipPolicyException membershipPolicyException = null; for (long groupId : groupIds) { <BUG>if ((oldGroupIds == null) || !ArrayUtil.contains(oldGroupIds, groupId)) { Group group = groupPersistence.findByPrimaryKey(groupId);</BUG> GroupPermissionUtil.check(
if ((oldGroupIds != null) && continue; Group group = groupPersistence.findByPrimaryKey(groupId);
36,080
oldRoleIds[i] = role.getRoleId(); } } MembershipPolicyException membershipPolicyException = null; for (long roleId : roleIds) { <BUG>if ((oldRoleIds == null) || !ArrayUtil.contains(oldRoleIds, roleId)) { RolePermissionUtil.check(</BUG> permissionChecker, roleId, ActionKeys.ASSIGN_MEMBERS);
if ((oldRoleIds != null) && continue; RolePermissionUtil.check(
36,081
corr.start(); } if (channel != null) { Vector tmp_mbrs = channel.getView() != null ? channel.getView().getMembers() : null; setMembers(tmp_mbrs); <BUG>} prot_adapter.resume(); } public void stop() { prot_adapter.pause();</BUG> if (corr != null) {
if (null != prot_adapter) { //null if called from the constructor that uses PullPushAdapter
36,082
package org.zalando.planb.provider; import com.codahale.metrics.MetricRegistry; import com.google.common.base.Joiner; import com.nimbusds.jose.*; import com.nimbusds.jose.jwk.JWK; <BUG>import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired;</BUG> import org.springframework.http.MediaType...
import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired;
36,083
@JsonProperty("scopes") private Set<String> scopes; @JsonProperty("redirect") private String redirect; @JsonProperty("consent_needed") <BUG>private boolean isConsentNeeded; </BUG> @JsonIgnore private String responseType; @JsonIgnore
private boolean consentNeeded;
36,084
import com.google.common.collect.ImmutableSet; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.zalando.planb.provider.RestException; <BUG>import org.zalando.planb.provider.realms.UpstreamRealmProperties; import org.zalando.planb.provider.realms.UpstreamTokenResponse; import org.zalando...
[DELETED]
36,085
import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.boot.test.WebIntegrationTest; import org.springframework.test.context.ActiveProfiles; import org.zalando.planb.provider.AbstractSpringTest; import org.zalando.planb.provider.Main; <BUG>import org.zalando.planb.provider.realm...
[DELETED]
36,086
assertThat(ex.getResponseBodyAsString()).contains("Redirect URI mismatch"); } } @Test public void authorizeWrongRedirectUri() { <BUG>cassandraConsentService.store("testuser", "/services", "testauthcode", ImmutableSet.of("uid", "ascope")); MultiValueMap<String, Object> requestParameters = new LinkedMultiValueMap<>();</B...
consentService.store("testuser", "/services", "testauthcode", ImmutableSet.of("uid", "ascope")); MultiValueMap<String, Object> requestParameters = new LinkedMultiValueMap<>();
36,087
assertThat(ex.getResponseBodyAsString()).contains("Invalid authorization code: redirect_uri mismatch"); } } @Test public void authorizeWrongClient() { <BUG>cassandraConsentService.store("testuser", "/services", "testauthcode", ImmutableSet.of("uid", "ascope")); MultiValueMap<String, Object> requestParameters = new Link...
consentService.store("testuser", "/services", "testauthcode", ImmutableSet.of("uid", "ascope")); MultiValueMap<String, Object> requestParameters = new LinkedMultiValueMap<>();
36,088
List<NameValuePair> nameValuePairs = URLEncodedUtils.parse(uri, "UTF-8"); return nameValuePairs.stream() .collect(groupingBy(NameValuePair::getName, reducing("", NameValuePair::getValue, (x, y) -> y))); } @Test <BUG>public void authorizeWrongCredentials() { MultiValueMap<String, Object> requestParameters = new LinkedM...
public void authorizeWrongUserCredentialsAsJson() { MultiValueMap<String, Object> requestParameters = new LinkedMultiValueMap<>();
36,089
package org.zalando.planb.provider; import com.google.common.collect.ImmutableMap; import com.netflix.hystrix.exception.HystrixRuntimeException; <BUG>import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller;</BUG> import or...
import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus;
36,090
<BUG>package org.zalando.planb.provider; import static java.lang.String.format; import static org.slf4j.LoggerFactory.getLogger; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.zalando.planb.provider.OIDCController.getRealmName; import static org.zalando.planb.provider.OIDC...
import com.google.common.collect.ImmutableSet; import com.nimbusds.jose.JOSEException;
36,091
private static final String PARAM_RESPONSE_TYPE_TOKEN = "token"; private static final String PARAM_STATE = "state"; private static final String PARAM_TOKEN_TYPE = "token_type"; private static final String PARAM_TOKEN_TYPE_BEARER = "Bearer"; private static final String PARAM_USERNAME = "username"; <BUG>static final Set<...
private static final Set<String> SUPPORTED_RESPONSE_TYPES = ImmutableSet.of(PARAM_RESPONSE_TYPE_CODE, PARAM_RESPONSE_TYPE_TOKEN);
36,092
private JWTIssuer jwtIssuer; @Autowired private CassandraAuthorizationCodeService cassandraAuthorizationCodeService; @Autowired private ConsentService consentService; <BUG>@RequestMapping String showAuthorizationForm(@RequestParam(value = PARAM_REALM) final Optional<String> realmNameParam,</BUG> @RequestParam(value = P...
@RequestMapping(method = RequestMethod.GET) String showAuthorizationForm(@RequestParam(value = PARAM_REALM) final Optional<String> realmNameParam,
36,093
@RequestParam(value = PARAM_CLIENT_ID) final String clientId, @RequestParam(value = PARAM_SCOPE) final Optional<String> scope, @RequestParam(value = PARAM_REDIRECT_URI) final Optional<URI> redirectUriParam, @RequestParam(value = PARAM_STATE) final Optional<String> state, @RequestParam(value = PARAM_ERROR) final Optiona...
checkReponseType(responseType);
36,094
consentService.store(username, userRealm.getName(), clientId, finalScopes); consentedScopes = Optional.of(finalScopes); break; case PARAM_DECISION_DENY: break; <BUG>default : consentedScopes = Optional.of(consentService.getConsentedScopes(username, userRealm.getName(),</BUG> clientId)); break; }
default: consentedScopes = Optional.of(consentService.getConsentedScopes(username, userRealm.getName(),
36,095
private URI generateTokenResponseURI(final UserRealm userRealm, final Optional<String> state, final String clientId, final Set<String> finalScopes, final Map<String, String> claims, final URI redirectUri) throws URISyntaxException, JOSEException { final String rawJWT = jwtIssuer.issueAccessToken(userRealm, clientId, fi...
.addParameter(PARAM_EXPIRES_IN, String.valueOf(JWTIssuer.EXPIRATION_TIME.getSeconds()))
36,096
String.valueOf(JWTIssuer.EXPIRATION_TIME.getSeconds())) </BUG> .addParameter(PARAM_SCOPE, ScopeProperties.join(finalScopes)) .addParameter(PARAM_STATE, state.orElse(EMPTY_STRING)).build(); } <BUG>private URI generateLoginFormURI(final String realmName, final String responseType, final Optional<String> state, final Str...
private URI generateTokenResponseURI(final UserRealm userRealm, final Optional<String> state, final String clientId, final Set<String> finalScopes, final Map<String, String> claims, final URI redirectUri) throws URISyntaxException, JOSEException { final String rawJWT = jwtIssuer.issueAccessToken(userRealm, clientId, fi...
36,097
package com.paypal.svcs.types.ap; import com.paypal.svcs.types.common.RequestEnvelope; import java.io.UnsupportedEncodingException; import com.paypal.core.NVPUtil; <BUG>public class PreapprovalDetailsRequest{ private RequestEnvelope requestEnvelope;</BUG> private String preapprovalKey; private Boolean getBillingAddress...
private static final String nameSpace="com.paypal.svcs.types.ap"; private static final String preferredPrefix=""; private RequestEnvelope requestEnvelope;
36,098
import com.paypal.svcs.types.common.AccountIdentifier; import java.util.List; import java.util.ArrayList; import java.io.UnsupportedEncodingException; import com.paypal.core.NVPUtil; <BUG>public class GetUserLimitsRequest{ private RequestEnvelope requestEnvelope;</BUG> private AccountIdentifier user; private String cou...
private static final String nameSpace="com.paypal.svcs.types.ap"; private static final String preferredPrefix=""; private RequestEnvelope requestEnvelope;
36,099
import com.paypal.svcs.types.common.RequestEnvelope; import com.paypal.svcs.types.common.ClientDetailsType; import com.paypal.svcs.types.common.DayOfWeek; import java.io.UnsupportedEncodingException; import com.paypal.core.NVPUtil; <BUG>public class PreapprovalRequest{ private RequestEnvelope requestEnvelope;</BUG> pri...
private static final String nameSpace="com.paypal.svcs.types.ap"; private static final String preferredPrefix=""; private RequestEnvelope requestEnvelope;
36,100
private String ipnNotificationUrl; private String senderEmail; private String startingDate; private String pinType; private String feesPayer; <BUG>private Boolean displayMaxTotalAmount; public PreapprovalRequest (RequestEnvelope requestEnvelope, String cancelUrl, String currencyCode, String returnUrl, String startingDa...
private Boolean requireInstantFundingSource; public PreapprovalRequest (RequestEnvelope requestEnvelope, String cancelUrl, String currencyCode, String returnUrl, String startingDate){