id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
42,001
private static final String AUTH0_US_CDN_URL = "https://cdn.auth0.com"; private static final String DOT_AUTH0_DOT_COM = ".auth0.com"; private final String clientId; private final HttpUrl domainUrl; private final HttpUrl configurationUrl; <BUG>private Telemetry telemetry; public Auth0(@NonNull Context context) {</BUG> this(getResourceFromContext(context, "com_auth0_client_id"), getResourceFromContext(context, "com_auth0_domain")); } public Auth0(@NonNull String clientId, @NonNull String domain) {
private boolean oidcConformant; public Auth0(@NonNull Context context) {
42,002
import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.when; public class Auth0Test { @Rule <BUG>public ExpectedException expectedException = ExpectedException.none(); private static final String CLIENT_ID = "CLIENT_ID";</BUG> private static final String DOMAIN = "samples.auth0.com"; private static final String CONFIG_DOMAIN_CUSTOM = "config.mydomain.com"; private static final String EU_DOMAIN = "samples.eu.auth0.com";
@Mock public Context context; private static final String CLIENT_ID = "CLIENT_ID";
42,003
private static final String HEADER_AUTHORIZATION = "Authorization"; private final Auth0 auth0; private final OkHttpClient client; private final HttpLoggingInterceptor logInterceptor; private final Gson gson; <BUG>private final com.auth0.android.request.internal.RequestFactory factory; private final ErrorBuilder<AuthenticationException> authErrorBuilder; private boolean oidcConformant;</BUG> public AuthenticationAPIClient(@NonNull Auth0 auth0) { this(auth0, new RequestFactory(), new OkHttpClient(), GsonProvider.buildGson());
private final RequestFactory factory;
42,004
} @Test public void shouldSignUpUserWithoutUsernameSync() throws Exception { mockAPI.willReturnSuccessfulSignUp() .willReturnSuccessfulLogin() <BUG>.willReturnTokenInfo(); client.setOIDCConformant(false); final Credentials credentials = client</BUG> .signUp(SUPPORT_AUTH0_COM, PASSWORD, MY_CONNECTION)
public void shouldLoginWithUserAndPasswordSync() throws Exception { mockAPI.willReturnSuccessfulLogin(); final Credentials credentials = client .login(SUPPORT_AUTH0_COM, "voidpassword", MY_CONNECTION)
42,005
versioning = true; EntityWrapper<ObjectInfo> dbObject = db.recast(ObjectInfo.class); ObjectInfo searchObjectInfo = new ObjectInfo(bucketName, objectKey); searchObjectInfo.setVersionId(request.getVersionId()); searchObjectInfo.setDeleted(false); <BUG>if(request.getVersionId() == null) searchObjectInfo.setLast(true); List<ObjectInfo> objectInfos = dbObject.query(searchObjectInfo);</BUG> if (objectInfos.size() > 0) {
if(request.getVersionId() == null) { } List<ObjectInfo> objectInfos = dbObject.query(searchObjectInfo);
42,006
ObjectInfo destinationObjectInfo = null; String destinationObjectName; ObjectInfo destSearchObjectInfo = new ObjectInfo( destinationBucket, destinationKey); if(foundDestinationBucketInfo.isVersioningEnabled()) { <BUG>if(sourceVersionId != null) destinationVersionId = sourceVersionId; else</BUG> destinationVersionId = UUID.randomUUID().toString().replaceAll("-", ""); } else {
[DELETED]
42,007
JFlexMojo mojo = newMojo("single-file-test"); mojo.execute(); File produced = getExpectedOutputFile(mojo); assertTrue("produced file is a file: " + produced, produced.isFile()); long size = produced.length(); <BUG>boolean correctSize = (size > 26624) && (size < 30696); assertTrue("size of produced file between 26k and 30k. Actual is " </BUG> + size, correctSize);
boolean correctSize = (size > 26624) && (size < 36696); assertTrue("size of produced file between 26k and 36k. Actual is "
42,008
private void epsilonFill() { for (int i = 0; i < numStates; i++) { epsilon[i] = closure(i); } } <BUG>private StateSet DFAEdge(StateSet start, char input) { </BUG> tempStateSet.clear(); states.reset(start); while ( states.hasMoreElements() )
private StateSet DFAEdge(StateSet start, int input) {
42,009
StateSet tempStateSet = NFA.tempStateSet; StateSetEnumerator states = NFA.states; newState = new StateSet(numStates); while ( currentDFAState <= numDFAStates ) { currentState = dfaList.get(currentDFAState); <BUG>for (char input = 0; input < numInput; input++) { </BUG> tempStateSet.clear(); states.reset(currentState); while ( states.hasMoreElements() )
for (int input = 0; input < numInput; input++) {
42,010
result.append(l); } result.append("]"); } result.append(" "+i+Out.NL); <BUG>for (char input = 0; input < numInput; input++) { </BUG> if ( table[i][input] != null && table[i][input].containsElements() ) result.append(" with ").append((int) input).append(" in ") .append(table[i][input]).append(Out.NL);
for (int input = 0; input < numInput; input++) {
42,011
if (caseless) { IntCharSet set = new IntCharSet(letters.charAt(i)); IntCharSet caselessSet = set.getCaseless(scanner.getUnicodeProperties());</BUG> for (Interval interval : caselessSet.getIntervals()) { <BUG>for (int ch = interval.start ; ch <= interval.end ; ++ch) { addTransition(i + start, classes.getClassCode(ch), i + start + 1); </BUG> } }
IntCharSet set = new IntCharSet(ch); IntCharSet caselessSet = set.getCaseless(scanner.getUnicodeProperties()); for (int elem = interval.start ; elem <= interval.end ; ++elem) { addTransition(i + start, classes.getClassCode(elem), i + start + 1);
42,012
if (Options.DEBUG) Out.debug("pos DFA start state is :"+Out.NL+dfaStates+Out.NL+Out.NL+"ordered :"+Out.NL+dfaList); currentDFAState = 0; while ( currentDFAState <= numDFAStates ) { currentState = dfaList.get(currentDFAState); <BUG>for (char input = 0; input < numInput; input++) { </BUG> newState = DFAEdge(currentState, input); if ( newState.containsElements() ) { Integer nextDFAState = dfaStates.get(newState);
for (int input = 0; input < numInput; input++) {
42,013
System.out.println("Error: non disjoint char classes "+i+" and "+j); System.out.println("class "+i+": "+x); System.out.println("class "+j+": "+y); } } <BUG>for (char c = 0; c < maxChar; c++) { </BUG> getClassCode(c); if (c % 100 == 0) System.out.print("."); }
for (int c = 0; c < maxChar; c++) {
42,014
isFinal = new boolean [statesNeeded]; entryState = new int [numEntryStates]; numStates = 0; this.numLexStates = numLexStates; for (int i = 0; i < statesNeeded; i++) { <BUG>for (char j = 0; j < numInput; j++) </BUG> table [i][j] = NO_TARGET; } }
for (int j = 0; j < numInput; j++)
42,015
result.append(l); } result.append("] "); } result.append(i+":"+Out.NL); <BUG>for (char j=0; j < numInput; j++) { </BUG> if ( table[i][j] >= 0 ) result.append(" with ").append((int) j).append(" in ").append(table[i][j]).append(Out.NL); }
for (int j=0; j < numInput; j++) {
42,016
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString()); <BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName); }</BUG> public void init() { try { LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName); customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName); }
42,017
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> {
42,018
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);
42,019
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;
42,020
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]
42,021
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]
42,022
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);
42,023
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);
42,024
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]
42,025
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)
42,026
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(() -> {
42,027
package org.apache.cxf.rt.security.saml.xacml; import java.security.Principal; import java.util.List; import org.apache.cxf.message.Message; import org.opensaml.xacml.ctx.RequestType; <BUG>@Deprecated</BUG> public interface XACMLRequestBuilder { RequestType createRequest(Principal principal, List<String> roles, Message message) throws Exception; @Deprecated List<String> getResources(Message message); @Deprecated String getResource(Message message); }
[DELETED]
42,028
import org.searchisko.api.cache.IndexNamesCache; import org.searchisko.api.model.QuerySettings; import org.searchisko.api.model.SortByValue; import org.searchisko.api.model.TimeoutConfiguration; import org.searchisko.api.rest.exception.NotAuthorizedException; <BUG>import org.searchisko.api.rest.search.SemiParsedFacetConfig; import org.searchisko.api.service.ProviderService.ProviderContentTypeInfo; import static org.searchisko.api.rest.search.ConfigParseUtil.parseFacetType;</BUG> @Named @ApplicationScoped
import org.searchisko.api.security.Role; import org.searchisko.api.util.SearchUtils; import static org.searchisko.api.rest.search.ConfigParseUtil.parseFacetType;
42,029
import org.searchisko.api.service.ProviderService.ProviderContentTypeInfo; import static org.searchisko.api.rest.search.ConfigParseUtil.parseFacetType;</BUG> @Named @ApplicationScoped @Singleton <BUG>public class SearchService { @Inject</BUG> protected SearchClientService searchClientService; @Inject protected StatsClientService statsClientService;
import org.searchisko.api.util.SearchUtils; import static org.searchisko.api.rest.search.ConfigParseUtil.parseFacetType; public static final String CFGNAME_FIELD_VISIBLE_FOR_ROLES = "field_visible_for_roles";
42,030
mockConfig.put(ConfigService.CFGNAME_SEARCH_RESPONSE_FIELDS, "aa"); Mockito.when(tested.configService.get(ConfigService.CFGNAME_SEARCH_RESPONSE_FIELDS)).thenReturn(mockConfig); QuerySettings querySettings = new QuerySettings(); tested.setSearchRequestFields(querySettings, srbMock); Mockito.verify(tested.configService).get(ConfigService.CFGNAME_SEARCH_RESPONSE_FIELDS); <BUG>Mockito.verify(srbMock).addField("aa"); </BUG> Mockito.verifyNoMoreInteractions(srbMock); Mockito.verifyNoMoreInteractions(tested.configService); }
Mockito.verify(srbMock).addFields(new String[] { "aa" });
42,031
import org.onosproject.net.flow.instructions.Instructions; import org.onosproject.net.intent.FlowRuleIntent; import org.onosproject.net.intent.Intent; import org.onosproject.net.intent.IntentCompiler; import org.onosproject.net.intent.IntentExtensionService; <BUG>import org.onosproject.net.intent.OpticalOduIntent; import org.onosproject.net.optical.OduCltPort;</BUG> import org.onosproject.net.optical.OtuPort; import org.onosproject.net.resource.Resource; import org.onosproject.net.resource.ResourceService;
import org.onosproject.net.intent.PathIntent; import org.onosproject.net.optical.OduCltPort;
42,032
List<FlowRule> rules = new LinkedList<>(); rules = createRules(intent, intent.getSrc(), intent.getDst(), path, slotsMap, false); if (intent.isBidirectional()) { rules.addAll(createRules(intent, intent.getDst(), intent.getSrc(), path, slotsMap, true)); } <BUG>return Collections.singletonList(new FlowRuleIntent(appId, intent.key(), rules, ImmutableSet.copyOf(path.links()))); }</BUG> throw new OpticalIntentCompilationException("Unable to find suitable lightpath for intent " + intent);
[DELETED]
42,033
.selector(selector) .treatment(treatment) .ingressPoint(ingressPoint) .egressPoints(egressPoints) .constraints(constraints) <BUG>.priority(priority()) .build();</BUG> service.submit(intent); print("Single point to multipoint intent submitted:\n%s", intent.toString()); }
.resourceGroup(resourceGroup()) .build();
42,034
import org.onosproject.net.intent.IntentCompiler; import org.onosproject.net.intent.IntentExtensionService; import org.onosproject.net.intent.IntentId; import org.onosproject.net.intent.IntentService; import org.onosproject.net.intent.OpticalCircuitIntent; <BUG>import org.onosproject.net.intent.OpticalConnectivityIntent; import org.onosproject.net.optical.OchPort;</BUG> import org.onosproject.net.optical.OduCltPort; import org.onosproject.net.intent.IntentSetMultimap; import org.onosproject.net.resource.ResourceAllocation;
import org.onosproject.net.intent.PathIntent; import org.onosproject.net.optical.OchPort;
42,035
connectivityIntent = OpticalConnectivityIntent.builder() .appId(appId) .src(srcCP) .dst(dstCP) .signalType(ochPorts.getLeft().signalType()) <BUG>.bidirectional(intent.isBidirectional()) .build();</BUG> if (!supportsMultiplexing) { required = resources; } else {
.resourceGroup(intent.resourceGroup()) .build();
42,036
rules.add(connectPorts(lowerIntent.getDst(), higherIntent.getDst(), higherIntent.priority(), slots)); if (higherIntent.isBidirectional()) { rules.add(connectPorts(lowerIntent.getSrc(), higherIntent.getSrc(), higherIntent.priority(), slots)); rules.add(connectPorts(higherIntent.getDst(), lowerIntent.getDst(), higherIntent.priority(), slots)); } <BUG>return new FlowRuleIntent(appId, higherIntent.key(), rules, higherIntent.resources()); }</BUG> private OpticalConnectivityIntent findOpticalConnectivityIntent(ConnectPoint src, ConnectPoint dst, CltSignalType signalType,
return new FlowRuleIntent(appId, higherIntent.key(), rules, higherIntent.resources(), PathIntent.ProtectionType.PRIMARY, higherIntent.resourceGroup());
42,037
import com.google.common.annotations.Beta; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import org.onosproject.core.ApplicationId; import org.onosproject.net.Link; <BUG>import org.onosproject.net.NetworkResource; import org.onosproject.net.flow.DefaultTrafficSelector;</BUG> import org.onosproject.net.flow.DefaultTrafficTreatment; import org.onosproject.net.flow.TrafficSelector; import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.ResourceGroup; import org.onosproject.net.flow.DefaultTrafficSelector;
42,038
import static com.google.common.base.Preconditions.checkNotNull; @Beta public abstract class ConnectivityIntent extends Intent { private final TrafficSelector selector; private final TrafficTreatment treatment; <BUG>private final List<Constraint> constraints; protected ConnectivityIntent(ApplicationId appId,</BUG> Key key, Collection<NetworkResource> resources, TrafficSelector selector,
@Deprecated protected ConnectivityIntent(ApplicationId appId,
42,039
import org.onosproject.net.flow.instructions.Instructions; import org.onosproject.net.intent.FlowRuleIntent; import org.onosproject.net.intent.Intent; import org.onosproject.net.intent.IntentCompiler; import org.onosproject.net.intent.IntentExtensionService; <BUG>import org.onosproject.net.intent.OpticalPathIntent; import org.slf4j.Logger;</BUG> import org.slf4j.LoggerFactory; import java.util.Collections; import java.util.LinkedList;
import org.onosproject.net.intent.PathIntent; import org.slf4j.Logger;
42,040
.selector(selector) .treatment(treatment) .ingressPoint(ingress) .egressPoint(egress) .constraints(constraints) <BUG>.priority(priority()) .build();</BUG> service.submit(intent); print("Point to point intent submitted:\n%s", intent.toString()); }
.resourceGroup(resourceGroup()) .build();
42,041
.src(parentIntent.getSrc()) .dst(parentIntent.getDst()) .path(path) .lambda(lambda) .signalType(signalType) <BUG>.bidirectional(parentIntent.isBidirectional()) .build();</BUG> } private void allocateResources(Intent intent, List<Resource> resources) { List<ResourceAllocation> allocations = resourceService.allocate(intent.id(), resources);
.resourceGroup(parentIntent.resourceGroup()) .build();
42,042
.one(oneId) .two(twoId) .selector(selector) .treatment(treatment) .constraints(constraints) <BUG>.priority(priority()) .build();</BUG> service.submit(intent); print("Host to Host intent submitted:\n%s", intent.toString()); }
.resourceGroup(resourceGroup()) .build();
42,043
import org.onlab.util.Bandwidth; import org.onosproject.cli.AbstractShellCommand; import org.onosproject.core.ApplicationId; import org.onosproject.core.CoreService; import org.onosproject.net.EncapsulationType; <BUG>import org.onosproject.net.PortNumber; import org.onosproject.net.flow.DefaultTrafficSelector;</BUG> import org.onosproject.net.flow.DefaultTrafficTreatment; import org.onosproject.net.flow.TrafficSelector; import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.ResourceGroup; import org.onosproject.net.flow.DefaultTrafficSelector;
42,044
@Option(name = "-e", aliases = "--encapsulation", description = "Encapsulation type", required = false, multiValued = false) private String encapsulationString = null; @Option(name = "--hashed", description = "Hashed path selection", required = false, multiValued = false) <BUG>private boolean hashedPathSelection = false; protected TrafficSelector buildTrafficSelector() {</BUG> IpPrefix srcIpPrefix = null; IpPrefix dstIpPrefix = null; TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder();
@Option(name = "-r", aliases = "--resourceGroup", description = "Resource Group Id", private String resourceGroupId = null; protected TrafficSelector buildTrafficSelector() {
42,045
.selector(selector) .treatment(treatment) .ingressPoints(ingressPoints) .egressPoint(egress) .constraints(constraints) <BUG>.priority(priority()) .build();</BUG> service.submit(intent); print("Multipoint to single point intent submitted:\n%s", intent.toString()); }
.resourceGroup(resourceGroup()) .build();
42,046
import com.microsoft.alm.plugin.idea.tfvc.core.TFSVcs; import com.microsoft.alm.plugin.idea.tfvc.core.revision.TFSContentRevision; import com.microsoft.alm.plugin.idea.tfvc.core.tfs.TfsFileUtil; import com.microsoft.alm.plugin.idea.tfvc.core.tfs.VersionControlPath; import com.microsoft.alm.plugin.idea.tfvc.ui.resolve.ConflictsTableModel; <BUG>import com.microsoft.alm.plugin.idea.tfvc.ui.resolve.ContentTriplet; import com.microsoft.alm.plugin.idea.tfvc.ui.resolve.ResolveConflictsModel;</BUG> import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Test;
import com.microsoft.alm.plugin.idea.tfvc.ui.resolve.NameMergerResolution; import com.microsoft.alm.plugin.idea.tfvc.ui.resolve.ResolveConflictsModel;
42,047
helper = new ResolveConflictHelper(mockProject, mockUpdatedFiles, updateRoots); } @Test public void testMerge_Rename_TakeTheirs() throws Exception { renameTest(((RenameConflict) CONFLICT_RENAME).getServerPath()); <BUG>verify(helper).resolveConflictWithProgress(CONFLICT_RENAME.getLocalPath(), ((RenameConflict) CONFLICT_RENAME).getServerPath(), ResolveConflictsCommand.AutoResolveType.TakeTheirs, mockServerContext, mockResolveConflictsModel, true); </BUG> } @Test public void testMerge_Rename_KeepYours() throws Exception {
verify(helper).resolveConflictWithProgress(Matchers.eq(CONFLICT_RENAME.getLocalPath()), Matchers.eq(((RenameConflict) CONFLICT_RENAME).getServerPath()), Matchers.eq(ResolveConflictsCommand.AutoResolveType.TakeTheirs), Matchers.eq(mockServerContext), Matchers.eq(mockResolveConflictsModel), Matchers.eq(true), any(NameMergerResolution.class));
42,048
when(VcsUtil.getVirtualFileWithRefresh(any(File.class))).thenReturn(mockVirtualFile); when(mockContentMerger.mergeContent(any(ContentTriplet.class), eq(mockProject), eq(mockVirtualFile), isNull(VcsRevisionNumber.class))).thenReturn(true); helper.acceptMerge(CONFLICT_CONTEXT, mockResolveConflictsModel); verify(helper).populateThreeWayDiffWithProgress(CONFLICT_CONTEXT, new File(CONFLICT_CONTEXT.getLocalPath()), mockLocalPath, mockServerContext); verify(mockContentMerger).mergeContent(any(ContentTriplet.class), eq(mockProject), eq(mockVirtualFile), isNull(VcsRevisionNumber.class)); <BUG>verify(helper).resolveConflictWithProgress(CONFLICT_CONTEXT.getLocalPath(), ResolveConflictsCommand.AutoResolveType.KeepYours, mockServerContext, mockResolveConflictsModel, true); verify(helper, never()).processBothConflicts(any(Conflict.class), any(ServerContext.class), any(ResolveConflictsModel.class), any(File.class), any(ContentTriplet.class)); verify(helper, never()).processRenameConflict(any(Conflict.class), any(ServerContext.class), any(ResolveConflictsModel.class)); </BUG> }
verify(helper).resolveConflictWithProgress(Matchers.eq(CONFLICT_CONTEXT.getLocalPath()), Matchers.eq(ResolveConflictsCommand.AutoResolveType.KeepYours), Matchers.eq(mockServerContext), Matchers.eq(mockResolveConflictsModel), Matchers.eq(true), any(NameMergerResolution.class)); verify(helper, never()).processBothConflicts(any(Conflict.class), any(ServerContext.class), any(ResolveConflictsModel.class), any(File.class), any(ContentTriplet.class), any(NameMergerResolution.class)); verify(helper, never()).processRenameConflict(any(Conflict.class), any(ServerContext.class), any(ResolveConflictsModel.class), any(NameMergerResolution.class));
42,049
when(mockLocalPath.getPath()).thenReturn(CONFLICT_BOTH.getLocalPath()); FilePath mockServerPath = mock(FilePath.class); when(mockServerPath.getPath()).thenReturn(((RenameConflict) CONFLICT_BOTH).getServerPath()); VirtualFile mockVirtualFile = mock(VirtualFile.class); when(VcsUtil.getVirtualFileWithRefresh(any(File.class))).thenReturn(mockVirtualFile); <BUG>when(mockNameMerger.mergeName((RenameConflict) CONFLICT_BOTH, mockProject)).thenReturn(selectedName); when(VersionControlPath.getFilePath(eq(((RenameConflict) CONFLICT_BOTH).getServerPath()), anyBoolean())).thenReturn(mockServerPath);</BUG> when(VersionControlPath.getFilePath(CONFLICT_BOTH.getLocalPath(), false)).thenReturn(mockLocalPath); when(mockContentMerger.mergeContent(any(ContentTriplet.class), eq(mockProject), eq(mockVirtualFile), isNull(VcsRevisionNumber.class))).thenReturn(true); helper.acceptMerge(CONFLICT_BOTH, mockResolveConflictsModel);
when(mockNameMerger.mergeName(anyString(), anyString(), Matchers.eq(mockProject))).thenReturn(selectedName); when(VersionControlPath.getFilePath(eq(((RenameConflict) CONFLICT_BOTH).getServerPath()), anyBoolean())).thenReturn(mockServerPath);
42,050
verify(mockFileGroup).add(((RenameConflict) CONFLICT_BOTH).getServerPath(), TFSVcs.getKey(), null); } @Test(expected = VcsException.class) public void testResolveConflict_Exception() throws Exception { when(CommandUtils.resolveConflictsByPath(mockServerContext, Arrays.asList(CONFLICT_BOTH.getLocalPath()), ResolveConflictsCommand.AutoResolveType.KeepYours)).thenThrow(new RuntimeException("Test Error")); <BUG>helper.resolveConflict(CONFLICT_BOTH.getLocalPath(), CONFLICT_BOTH.getLocalPath(), ResolveConflictsCommand.AutoResolveType.KeepYours, mockServerContext, mockResolveConflictsModel, true); </BUG> } @Test public void testPopulateThreeWayDiff_ContentsChangeOnly() throws Exception {
helper.resolveConflict(CONFLICT_BOTH.getLocalPath(), CONFLICT_BOTH.getLocalPath(), ResolveConflictsCommand.AutoResolveType.KeepYours, mockServerContext, mockResolveConflictsModel, true, null);
42,051
import com.microsoft.alm.plugin.idea.common.utils.IdeaHelper; import com.microsoft.alm.plugin.idea.tfvc.core.TFSVcs; import com.microsoft.alm.plugin.idea.tfvc.core.revision.TFSContentRevision; import com.microsoft.alm.plugin.idea.tfvc.core.tfs.TfsFileUtil; import com.microsoft.alm.plugin.idea.tfvc.core.tfs.VersionControlPath; <BUG>import com.microsoft.alm.plugin.idea.tfvc.ui.resolve.ContentTriplet; import com.microsoft.alm.plugin.idea.tfvc.ui.resolve.ResolveConflictsModel;</BUG> import org.apache.commons.lang.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
import com.microsoft.alm.plugin.idea.tfvc.ui.resolve.NameMergerResolution; import com.microsoft.alm.plugin.idea.tfvc.ui.resolve.ResolveConflictsModel;
42,052
if (isMergeConflict(conflict, null)) { final String workingFolder = localPath.isDirectory() ? localPath.getPath() : localPath.getParentPath().getPath(); final MergeConflict mergeConflict = (MergeConflict) conflict; <BUG>final VersionSpec baseVersion = CommandUtils.getBaseVersion( context, workingFolder, mergeConflict.getOldPath(), mergeConflict.getServerPath()); original = TFSContentRevision.createRenameRevision(project, context, localPath, SystemHelper.toInt(baseVersion.getValue(), 1), originalChange.getDate(), mergeConflict.getOldPath()).getContent(); </BUG> serverChanges = TFSContentRevision.createRenameRevision(project, context, localPath,
final String sourcePath = mergeConflict.getMapping().getFromServerItem(); final String targetPath = mergeConflict.getMapping().getToServerItem(); final VersionSpec baseVersion = CommandUtils.getBaseVersion(context, workingFolder, sourcePath, targetPath); SystemHelper.toInt(baseVersion.getValue(), 1), originalChange.getDate(), sourcePath).getContent();
42,053
original = TFSContentRevision.createRenameRevision(project, context, localPath, SystemHelper.toInt(baseVersion.getValue(), 1), originalChange.getDate(), mergeConflict.getOldPath()).getContent(); </BUG> serverChanges = TFSContentRevision.createRenameRevision(project, context, localPath, <BUG>getMergeFromVersion(mergeConflict), originalChange.getDate(), mergeConflict.getOldPath()).getContent(); </BUG> myLocalChanges = CurrentContentRevision.create(localPath).getContent(); } else { if (originalChange != null) { final int version = Integer.parseInt(originalChange.getVersion());
SystemHelper.toInt(baseVersion.getValue(), 1), originalChange.getDate(), sourcePath).getContent(); getMergeFromVersion(mergeConflict), originalChange.getDate(), sourcePath).getContent();
42,054
package com.microsoft.alm.plugin.external.models; public class MergeConflict extends RenameConflict { private final MergeMapping mapping; public MergeConflict(final String localPath, final MergeMapping mapping) { <BUG>super(localPath, mapping.getToServerItem(), mapping.getFromServerItem(), ConflictType.MERGE); </BUG> this.mapping = mapping; } public MergeMapping getMapping() {
super(localPath, mapping.getFromServerItem(), mapping.getToServerItem(), ConflictType.MERGE);
42,055
import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.openapi.vfs.newvfs.RefreshQueue; import com.intellij.ui.GuiUtils; import com.intellij.util.io.ReadOnlyAttributeUtil; import com.microsoft.alm.common.utils.ArgumentHelper; <BUG>import com.microsoft.alm.plugin.idea.tfvc.exceptions.TfsException; import org.jetbrains.annotations.NotNull;</BUG> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.BufferedInputStream;
import org.apache.commons.lang.StringUtils; import org.jetbrains.annotations.NotNull;
42,056
import java.util.List; public class TfsFileUtil { public static final Logger logger = LoggerFactory.getLogger(TfsFileUtil.class); public interface ContentWriter { void write(OutputStream outputStream) throws TfsException; <BUG>} public static List<FilePath> getFilePaths(@NotNull final VirtualFile[] files) {</BUG> return getFilePaths(Arrays.asList(files)); } public static List<FilePath> getFilePaths(@NotNull final Collection<VirtualFile> files) {
public static boolean isServerItem(final String itemPath) { return StringUtils.startsWithIgnoreCase(itemPath, "$/"); public static List<FilePath> getFilePaths(@NotNull final VirtualFile[] files) {
42,057
import java.sql.SQLException; import java.sql.Statement; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; <BUG>import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set;</BUG> import java.util.concurrent.locks.Lock;
import java.util.HashMap; import java.util.Map; import java.util.Set;
42,058
if (msgin != null) { try { msgin.close(); } catch (IOException e) { } <BUG>} } } protected void updateSourceSequence(SourceSequence seq) </BUG> throws SQLException {
releaseResources(stmt, null); protected void storeMessage(Identifier sid, RMMessage msg, boolean outbound) throws IOException, SQLException { storeMessage(connection, sid, msg, outbound); protected void updateSourceSequence(Connection con, SourceSequence seq)
42,059
} catch (SQLException ex) { if (!isTableExistsError(ex)) { throw ex; } else { LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists."); <BUG>verifyTable(SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS); </BUG> } } finally { stmt.close();
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
42,060
} catch (SQLException ex) { if (!isTableExistsError(ex)) { throw ex; } else { LOG.fine("Table CXF_RM_DEST_SEQUENCES already exists."); <BUG>verifyTable(DEST_SEQUENCES_TABLE_NAME, DEST_SEQUENCES_TABLE_COLS); </BUG> } } finally { stmt.close();
LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists."); verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
42,061
} } finally { stmt.close(); } for (String tableName : new String[] {OUTBOUND_MSGS_TABLE_NAME, INBOUND_MSGS_TABLE_NAME}) { <BUG>stmt = connection.createStatement(); try {</BUG> stmt.executeUpdate(MessageFormat.format(CREATE_MESSAGES_TABLE_STMT, tableName)); } catch (SQLException ex) { if (!isTableExistsError(ex)) {
stmt = con.createStatement(); try { stmt.executeUpdate(CREATE_DEST_SEQUENCES_TABLE_STMT);
42,062
throw ex; } else { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Table " + tableName + " already exists."); } <BUG>verifyTable(tableName, MESSAGES_TABLE_COLS); </BUG> } } finally { stmt.close();
LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists."); verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
42,063
if (newCols.size() > 0) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Table " + tableName + " needs additional columns"); } for (String[] newCol : newCols) { <BUG>Statement st = connection.createStatement(); try {</BUG> st.executeUpdate(MessageFormat.format(ALTER_TABLE_STMT_STR, tableName, newCol[0], newCol[1])); if (LOG.isLoggable(Level.FINE)) {
Statement st = con.createStatement(); try {
42,064
if (nextReconnectAttempt < System.currentTimeMillis()) { nextReconnectAttempt = System.currentTimeMillis() + reconnectDelay; reconnectDelay = reconnectDelay * useExponentialBackOff; } } <BUG>} public static void deleteDatabaseFiles() {</BUG> deleteDatabaseFiles(DEFAULT_DATABASE_NAME, true); } public static void deleteDatabaseFiles(String dbName, boolean now) {
public static void deleteDatabaseFiles() {
42,065
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(mainCell); <BUG>result.addEditorCell(createCommentConstantCell(editorContext, node, false)); return result;</BUG> } private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) { EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false);
result.setCellId("main_comment_collection"); return result;
42,066
} 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.PUNCTUATION_RIGHT : StyleAttributes.PUNCTUATION_LEFT, 0, true); <BUG>cell.getStyle().putAll(style, 0); return cell;</BUG> } @Override public EditorCell createInspectedCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node) {
cell.setCellId(left ? "left_comment_constant" : "right_comment_constant"); return cell;
42,067
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.openapi.editor.cells.EditorCell; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG> import org.jetbrains.mps.util.Condition; import jetbrains.mps.editor.runtime.selection.SelectionUtil; import jetbrains.mps.openapi.editor.selection.SelectionManager;
import jetbrains.mps.openapi.editor.cells.EditorCell_Label; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
42,068
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.cells.EditorCell; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG> import org.jetbrains.mps.util.Condition; import jetbrains.mps.editor.runtime.selection.SelectionUtil; import jetbrains.mps.openapi.editor.selection.SelectionManager;
import jetbrains.mps.openapi.editor.cells.EditorCell_Label; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
42,069
Debug.checkNull("mysql_connection", this.mysql_connection); return this.mysql_connection; } @Override public String toString () { <BUG>return "MySQLConnection[" + this.dataSource.getUrl() + " : " + this.dataSource.getURL() + "]"; }</BUG> @Override protected void finalize () throws Throwable { super.finalize();
return "MySQLConnection[" + this.mySQL.getUrl() + "]";
42,070
package com.jfixby.cmns.adopted.gdx.log; import com.badlogic.gdx.Application; import com.badlogic.gdx.Gdx; import com.jfixby.cmns.api.collections.EditableCollection; <BUG>import com.jfixby.cmns.api.collections.Map; import com.jfixby.cmns.api.log.LoggerComponent;</BUG> import com.jfixby.cmns.api.util.JUtils; public class GdxLogger implements LoggerComponent { public GdxLogger () {
import com.jfixby.cmns.api.err.Err; import com.jfixby.cmns.api.log.LoggerComponent;
42,071
package com.jfixby.red.collections; <BUG>import com.jfixby.cmns.api.java.IntValue; import com.jfixby.cmns.api.math.FloatMath;</BUG> public class RedHistogrammValue { private RedHistogramm master; public RedHistogrammValue (RedHistogramm redHistogramm) {
import com.jfixby.cmns.api.java.Int; import com.jfixby.cmns.api.math.FloatMath;
42,072
public static final String PackageName = "app.version.package_name"; } public static final String VERSION_FILE_NAME = "version.json"; private static final long serialVersionUID = 6662721574596241247L; public String packageName; <BUG>public int major = -1; public int minor = -1; public VERSION_STAGE stage = null; public int build = -1; </BUG> public int versionCode = -1;
public String major = ""; public String minor = ""; public String build = "";
42,073
<BUG>package com.jfixby.cmns.db.mysql; import com.jfixby.cmns.api.debug.Debug;</BUG> import com.jfixby.cmns.api.log.L; import com.jfixby.cmns.db.api.DBComponent; import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
import java.sql.Connection; import java.sql.SQLException; import com.jfixby.cmns.api.debug.Debug;
42,074
} public MySQLTable getTable (final String name) { return new MySQLTable(this, name); } public MySQLConnection obtainConnection () { <BUG>final MySQLConnection connection = new MySQLConnection(this.dataSource); connection.open();</BUG> return connection; } public void releaseConnection (final MySQLConnection connection) {
public String getDBName () { return this.dbName; final MySQLConnection connection = new MySQLConnection(this); connection.open();
42,075
package net.spy.memcached.ops; import java.io.IOException; <BUG>public final class OperationException extends IOException { private final OperationErrorType type;</BUG> public OperationException() { super(); type=OperationErrorType.GENERAL;
private static final long serialVersionUID = 2457625388445818437L; private final OperationErrorType type;
42,076
super.setUp(); mc.asyncBopDelete(key, 0, 100, ElementFlagFilter.DO_NOT_FILTER, 0, true); } public void testAfterSuccess() throws Exception { CollectionFuture<Boolean> future; <BUG>OperationStatus status; future = (CollectionFuture<Boolean>) mc.asyncBopInsert(key, 0, null, "hello", new CollectionAttributes());</BUG> Boolean success = future.get(1000, TimeUnit.MILLISECONDS); status = future.getOperationStatus();
future = mc.asyncBopInsert(key, 0, null, "hello", new CollectionAttributes());
42,077
assertEquals("CREATED_STORED", status.getMessage()); } public void testAfterFailure() throws Exception { CollectionFuture<Map<Long, Element<Object>>> future; OperationStatus status; <BUG>future = (CollectionFuture<Map<Long, Element<Object>>>) mc.asyncBopGet( key, 0, ElementFlagFilter.DO_NOT_FILTER, false, false); Map<Long, Element<Object>> result = future.get(1000, TimeUnit.MILLISECONDS);</BUG> status = future.getOperationStatus();
future = mc.asyncBopGet(key, 0, ElementFlagFilter.DO_NOT_FILTER, false, false); Map<Long, Element<Object>> result = future.get(1000, TimeUnit.MILLISECONDS);
42,078
assertFalse(status.isSuccess()); assertEquals("NOT_FOUND", status.getMessage()); } public void testTimeout() throws Exception { CollectionFuture<Boolean> future; <BUG>OperationStatus status; future = (CollectionFuture<Boolean>) mc.asyncBopInsert(key, 0, null, "hello", new CollectionAttributes());</BUG> try { future.get(1, TimeUnit.NANOSECONDS);
future = mc.asyncBopInsert(key, 0, null, "hello", new CollectionAttributes());
42,079
import java.util.Collection; import java.util.Collections; import java.util.concurrent.TimeoutException; import net.spy.memcached.MemcachedNode; import net.spy.memcached.ops.Operation; <BUG>public class CheckedOperationTimeoutException extends TimeoutException { private final Collection<Operation> operations;</BUG> public CheckedOperationTimeoutException(String message, Operation op) { this(message, Collections.singleton(op)); }
private static final long serialVersionUID = 5187393339735774489L; private final Collection<Operation> operations;
42,080
future.cancel(true); e.printStackTrace(); Assert.fail(e.getMessage()); } } <BUG>public void testInvalidArgumentException() { try {</BUG> CollectionAttributes attr = new CollectionAttributes(); mc.delete(KEY_LIST.get(0)).get(); mc.delete(KEY_LIST.get(1)).get();
ArrayList<String> testKeyList = new ArrayList<String>(); testKeyList.add(KEY_LIST.get(0)); testKeyList.add(KEY_LIST.get(1)); try {
42,081
mc.asyncBopSortMergeGet(new ArrayList<String>(), 10, 0, ElementFlagFilter.DO_NOT_FILTER, -1, 10); fail("This should be an exception"); } catch (Exception e) { assertEquals("Key list is empty.", e.getMessage()); } <BUG>try { mc.asyncBopSortMergeGet(new ArrayList<String>() { { add(KEY_LIST.get(0)); add(KEY_LIST.get(1)); } }, 10, 0, ElementFlagFilter.DO_NOT_FILTER, -1, 10);</BUG> fail("This should be an exception");
[DELETED]
42,082
}, 10, 0, ElementFlagFilter.DO_NOT_FILTER, -1, 10);</BUG> fail("This should be an exception"); } catch (Exception e) { assertEquals("Offset must be 0 or positive integer.", e.getMessage()); } <BUG>try { mc.asyncBopSortMergeGet(new ArrayList<String>() { { add(KEY_LIST.get(0)); add(KEY_LIST.get(1)); } }, 10, 0, ElementFlagFilter.DO_NOT_FILTER, 0, 0);</BUG> fail("This should be an exception");
mc.asyncBopSortMergeGet(new ArrayList<String>(), 10, 0, ElementFlagFilter.DO_NOT_FILTER, -1, 10); assertEquals("Key list is empty.", e.getMessage()); mc.asyncBopSortMergeGet(testKeyList, 10, 0, ElementFlagFilter.DO_NOT_FILTER, -1, 10); mc.asyncBopSortMergeGet(testKeyList, 10, 0, ElementFlagFilter.DO_NOT_FILTER, 0, 0);
42,083
private final String key2 = "ByteArrayBKeySMGetIrregularEflagTest2" + (Math.abs(new Random().nextInt(99)) + 100); private final byte[] eFlag = { 1 }; private final Object value = "valvalvalvalvalvalvalvalvalval"; public void testGetAll_1() { <BUG>SMGetMode smgetMode = SMGetMode.UNIQUE; try {</BUG> mc.delete(key1).get(); mc.delete(key2).get(); mc.asyncBopInsert(key1, new byte[] { 0 }, eFlag, value + "0",
ArrayList<String> testKeyList = new ArrayList<String>(); testKeyList.add(key1); testKeyList.add(key2); try {
42,084
mc.asyncBopInsert(key2, new byte[] { 5 }, null, value + "1", new CollectionAttributes()).get(); mc.asyncBopInsert(key2, new byte[] { 4 }, eFlag, value + "2", new CollectionAttributes()).get(); List<SMGetElement<Object>> list = mc.asyncBopSortMergeGet( <BUG>new ArrayList<String>() { { add(key1); add(key2); } }, new byte[] { 0 }, new byte[] { 10 }, </BUG> ElementFlagFilter.DO_NOT_FILTER, 0, 10).get();
testKeyList, new byte[] { 0 }, new byte[] { 10 },
42,085
mc.asyncBopInsert(key2, new byte[] { 5 }, null, value + "1", new CollectionAttributes()).get(); mc.asyncBopInsert(key2, new byte[] { 4 }, eFlag, value + "2", new CollectionAttributes()).get(); List<SMGetElement<Object>> list = mc.asyncBopSortMergeGet( <BUG>new ArrayList<String>() { { add(key1); add(key2); } }, new byte[] { 0 }, new byte[] { 10 }, </BUG> ElementFlagFilter.DO_NOT_FILTER, 10, smgetMode).get();
testKeyList, new byte[] { 0 }, new byte[] { 10 }, ElementFlagFilter.DO_NOT_FILTER, 0, 10).get();
42,086
mc.delete(invalidKey).get(); mc.delete(kvKey).get(); CollectionAttributes attrs = new CollectionAttributes(); attrs.setReadable(false); for (long i = 0; i < 100; i++) { <BUG>mc.asyncBopInsert(key, (long)i, null, "val", attrs).get(); }</BUG> mc.set(kvKey, 0, "value").get(); CollectionFuture<Map<Integer, Element<Object>>> f = null; Map<Integer, Element<Object>> result = null;
mc.asyncBopInsert(key, i, null, "val", attrs).get(); }
42,087
"a" }; protected void setUp() { try { super.setUp(); mc.delete(key); <BUG>} catch (Exception e) { </BUG> } } public void testBopIncrDecr_Basic() throws Exception {
} catch (Exception ignored) {
42,088
assertTrue(response2.toString() == "NOT_FOUND_ELEMENT"); } public void testBopIncrDecr_StringError() throws Exception { addToBTree(key, items9); try { <BUG>CollectionFuture<Long> future3 = mc.asyncBopIncr(key, 9L, (int) 2); Long result3 = future3.get(1000, TimeUnit.MILLISECONDS);</BUG> CollectionResponse response3 = future3.getOperationStatus() .getResponse(); System.out.println(response3.toString());
CollectionFuture<Long> future3 = mc.asyncBopIncr(key, 9L, 2); Long result3 = future3.get(1000, TimeUnit.MILLISECONDS);
42,089
package com.projecttango.examples.java.augmentedreality; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoConfig; <BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoEvent;</BUG> import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
42,090
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { <BUG>try { connectTango();</BUG> setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
TangoSupport.initialize(); connectTango();
42,091
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics); mCameraPoseTimestamp = lastFramePose.timestamp;</BUG> } else { <BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); }</BUG> } } } @Override
mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; Log.w(TAG, "Can't get device pose at time: " +
42,092
import org.rajawali3d.materials.Material; import org.rajawali3d.materials.methods.DiffuseMethod; import org.rajawali3d.materials.textures.ATexture; import org.rajawali3d.materials.textures.StreamingTexture; import org.rajawali3d.materials.textures.Texture; <BUG>import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.vector.Vector3;</BUG> import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
42,093
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics); getCurrentCamera().setRotation(cameraPose.getOrientation()); getCurrentCamera().setPosition(cameraPose.getPosition()); }</BUG> public int getTextureId() {
public void updateRenderCameraPose(TangoPoseData cameraPose) { float[] rotation = cameraPose.getRotationAsFloats(); float[] translation = cameraPose.getTranslationAsFloats(); Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]); getCurrentCamera().setRotation(quaternion.conjugate()); getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
42,094
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; <BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoConfig;</BUG> import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
42,095
else if (t == ANY_CYPHER_OPTION) { r = AnyCypherOption(b, 0); } else if (t == ANY_FUNCTION_INVOCATION) { r = AnyFunctionInvocation(b, 0); <BUG>} else if (t == BULK_IMPORT_QUERY) {</BUG> r = BulkImportQuery(b, 0); } else if (t == CALL) {
else if (t == ARRAY) { r = Array(b, 0); else if (t == BULK_IMPORT_QUERY) {
42,096
if (!r) r = MapLiteral(b, l + 1); if (!r) r = MapProjection(b, l + 1); if (!r) r = CountStar(b, l + 1); if (!r) r = ListComprehension(b, l + 1); if (!r) r = PatternComprehension(b, l + 1); <BUG>if (!r) r = Expression1_12(b, l + 1); if (!r) r = FilterFunctionInvocation(b, l + 1);</BUG> if (!r) r = ExtractFunctionInvocation(b, l + 1); if (!r) r = ReduceFunctionInvocation(b, l + 1); if (!r) r = AllFunctionInvocation(b, l + 1);
if (!r) r = Array(b, l + 1); if (!r) r = FilterFunctionInvocation(b, l + 1);
42,097
.setDescription(RandomStringUtils.randomAlphanumeric(255)) .setTextValue(RandomStringUtils.randomAlphanumeric(255)) .setUserLogin(RandomStringUtils.randomAlphanumeric(255)) .setValue(RandomUtils.nextDouble()) .setMetricId(RandomUtils.nextInt()) <BUG>.setComponentId(RandomUtils.nextInt())</BUG> .setComponentUuid(RandomStringUtils.randomAlphanumeric(50)) .setCreatedAt(System2.INSTANCE.now()) .setUpdatedAt(System2.INSTANCE.now()); } }
[DELETED]
42,098
import org.sonar.api.batch.BatchSide; import org.sonar.api.server.ServerSide; @BatchSide @ServerSide public class DatabaseVersion { <BUG>public static final int LAST_VERSION = 922; </BUG> public static final List<String> TABLES = ImmutableList.of( "action_plans", "active_dashboards",
public static final int LAST_VERSION = 923;
42,099
purgeMapper.deleteResourceUserRoles(partResourceIds); } session.commit(); profiler.stop(); profiler.start("deleteResourceManualMeasures (manual_measures)"); <BUG>for (List<Long> partResourceIds : componentIdPartitions) { purgeMapper.deleteResourceManualMeasures(partResourceIds); </BUG> } session.commit();
[DELETED]
42,100
@Test public void delete_in_db_when_admin_on_project() throws Exception { ComponentDto project = ComponentTesting.newProjectDto("project-uuid"); dbClient.componentDao().insert(dbSession, project); userSessionRule.login("login").addProjectUuidPermissions(UserRole.ADMIN, "project-uuid"); <BUG>long id = insertCustomMeasure(newCustomMeasureDto().setComponentId(project.getId())); </BUG> newRequest().setParam(PARAM_ID, String.valueOf(id)).execute(); assertThat(dbClient.customMeasureDao().selectNullableById(dbSession, id)).isNull(); }
public void delete_in_db() throws Exception { long id = insertCustomMeasure(newCustomMeasureDto()); long anotherId = insertCustomMeasure(newCustomMeasureDto()); WsTester.Result response = newRequest().setParam(PARAM_ID, String.valueOf(id)).execute(); assertThat(dbClient.customMeasureDao().selectNullableById(dbSession, anotherId)).isNotNull(); response.assertNoContent();