id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
35,901
return new Message().setMessage(message); } public static Message fromList(List<String> message) { return new Message().setMessage(message); } <BUG>public static String applyReplacements(String message, Object... replacements) { return Message.fromString(message).replacements(replacements).doReplacements().getSingleRaw...
[DELETED]
35,902
private List<String> get(Limit limit) { if(limit.reached()) { return new ArrayList<>(); } doReplacements(limit); <BUG>return message; }</BUG> public List<String> getRaw() { return message; }
public String getSingle() { doReplacements(); return StringUtils.join(message, "");
35,903
limit.notified = true; AreaShop.error("Reached replacement limit, probably has replacements loops, problematic message key: "+limit.message.key+", first characters of the message: "+Utils.getMessageStart(limit.message, 100)); } break; } <BUG>replaceArgumentVariables(limit); replaceLanguageVariables(limit); shouldReplac...
if(doLanguageReplacements) { shouldReplace = !message.equals(original);
35,904
context.setAuthCache(authCache); ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpclient, context); ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build(); client.register(JacksonJaxbJsonProvider.class); client.register(JacksonObjectMapperProvider.class); <BUG>client.register(Req...
client.register(RestRequestFilter.class); client.register(RestResponseFilter.class);
35,905
import org.hawkular.alerts.api.model.condition.Condition; import org.hawkular.inventory.api.model.CanonicalPath; import org.hawkular.inventory.api.model.Tenant; import org.hawkular.inventory.json.DetypedPathDeserializer; import org.hawkular.inventory.json.InventoryJacksonConfig; <BUG>import org.hawkular.inventory.json....
import org.hawkular.inventory.json.mixins.model.CanonicalPathMixin;
35,906
package org.sonar.server.rule.index; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import org.apache.commons.lang.builder.ReflectionToStringBuilder; import org.sonar.api.rule.RuleKey; <BUG>import org.sonar.api.rule.RuleStatus; import org.sonar.api.server.debt.DebtRemediationFuncti...
import org.sonar.api.server.debt.DebtCharacteristic; import org.sonar.api.server.debt.DebtRemediationFunction;
35,907
return defaultDebtSubCharacteristicKey(); } } @Override @CheckForNull <BUG>public DebtRemediationFunction debtRemediationFunction() { final String function = getNullableField(RuleNormalizer.RuleField.DEBT_FUNCTION_TYPE.field());</BUG> if (function == null || function.isEmpty()) { return defaultDebtRemediationFunction()...
if (DebtCharacteristic.NONE.equals(getNullableField(RuleNormalizer.RuleField.SUB_CHARACTERISTIC.field()))) { return null; final String function = getNullableField(RuleNormalizer.RuleField.DEBT_FUNCTION_TYPE.field());
35,908
return (String) getNullableField(RuleNormalizer.RuleField.DEBT_FUNCTION_OFFSET.field()); } }; } } <BUG>@Override public DebtRemediationFunction defaultDebtRemediationFunction() {</BUG> final String function = getNullableField(RuleNormalizer.RuleField.DEFAULT_DEBT_FUNCTION_TYPE.field()); if (function == null || function...
@CheckForNull public DebtRemediationFunction defaultDebtRemediationFunction() {
35,909
package org.sonar.api.server.debt; import javax.annotation.CheckForNull; <BUG>public interface DebtCharacteristic { String key();</BUG> String name(); @CheckForNull Integer order();
static String NONE = "NONE"; String key();
35,910
assertThat(rule.getDefaultSubCharacteristicId()).isNotNull(); assertThat(rule.getDefaultRemediationFunction()).isNotNull(); assertThat(rule.getDefaultRemediationCoefficient()).isNotNull(); assertThat(rule.getDefaultRemediationOffset()).isNotNull(); Rule indexedRule = tester.get(RuleIndex.class).getByKey(RULE_KEY); <BUG...
assertThat(indexedRule.debtCharacteristicKey()).isEqualTo("NONE"); assertThat(indexedRule.debtSubCharacteristicKey()).isEqualTo("NONE"); assertThat(indexedRule.debtRemediationFunction()).isNull(); assertThat(indexedRule.debtOverloaded()).isTrue();
35,911
addIndexStringField("templateKey", RuleNormalizer.RuleField.TEMPLATE_KEY.field()); addIndexArrayField("tags", RuleNormalizer.RuleField.TAGS.field()); addIndexArrayField("sysTags", RuleNormalizer.RuleField.SYSTEM_TAGS.field()); addField("defaultDebtChar", new IndexStringField("defaultDebtChar", RuleNormalizer.RuleField....
addField("debtChar", new IndexStringField("debtChar", RuleNormalizer.RuleField.CHARACTERISTIC.field(), addField("debtChar", new IndexStringField("debtSubChar", RuleNormalizer.RuleField.SUB_CHARACTERISTIC.field(), addField("debtRemFn", new IndexStringField("debtRemFnType", RuleNormalizer.RuleField.DEBT_FUNCTION_TYPE.fie...
35,912
addIndexStringField("effortToFixDescription", RuleNormalizer.RuleField.FIX_DESCRIPTION.field()); addIndexStringField("mdNote", RuleNormalizer.RuleField.NOTE.field()); addField("htmlNote", new HtmlNoteField(macroInterpreter)); addIndexStringField("noteLogin", RuleNormalizer.RuleField.NOTE_LOGIN.field()); addIndexStringF...
addField("debtCharName", new CharacteristicNameField()); addField("debtSubCharName", new SubCharacteristicNameField()); addField("debtOverloaded", new OverriddenField()); addField("params", new ParamsField());
35,913
import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; import org.elasticsearch.action.WriteConsistencyLevel; import org.elasticsearch.action.support.replication.ReplicationType; import org.elasticsearch.action.update.UpdateRequest; <BUG>import org.sonar.api.rule.RuleKey; import org.sona...
import org.sonar.api.server.debt.DebtCharacteristic; import org.sonar.core.persistence.DbSession;
35,914
import org.sonar.server.search.IndexDefinition; import org.sonar.server.search.IndexField; import org.sonar.server.search.Indexable; import org.sonar.server.search.es.ListUpdate; import java.lang.reflect.Field; <BUG>import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; i...
import java.util.*;
35,915
update.put(RuleField.DEFAULT_SUB_CHARACTERISTIC.field(), subCharacteristic.getKey()); } } if (rule.getSubCharacteristicId() != null) { if (rule.getSubCharacteristicId() == -1) { <BUG>update.put(RuleField.CHARACTERISTIC.field(), ""); update.put(RuleField.SUB_CHARACTERISTIC.field(), ""); </BUG> } else {
update.put(RuleField.CHARACTERISTIC.field(), DebtCharacteristic.NONE); update.put(RuleField.SUB_CHARACTERISTIC.field(), DebtCharacteristic.NONE);
35,916
import de.vanita5.twittnuker.receiver.NotificationReceiver; import de.vanita5.twittnuker.service.LengthyOperationsService; import de.vanita5.twittnuker.util.ActivityTracker; import de.vanita5.twittnuker.util.AsyncTwitterWrapper; import de.vanita5.twittnuker.util.DataStoreFunctionsKt; <BUG>import de.vanita5.twittnuker.u...
import de.vanita5.twittnuker.util.DebugLog; import de.vanita5.twittnuker.util.ImagePreloader;
35,917
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
35,918
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getExcepti...
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
35,919
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
35,920
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.form...
if (deleteImage) { Utils.deleteMedia(context, imageUri);
35,921
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, S...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
35,922
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.for...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
35,923
import de.vanita5.twittnuker.annotation.CustomTabType; import de.vanita5.twittnuker.library.MicroBlog; import de.vanita5.twittnuker.library.MicroBlogException; import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus; import de.vanita5.twittnuker.library.twitter.model.Status; <BUG>import de.vanita5.twittnuker...
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
35,924
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
35,925
import java.util.List; import java.util.Map.Entry; import javax.inject.Singleton; import okhttp3.Dns; @Singleton <BUG>public class TwidereDns implements Constants, Dns { </BUG> private static final String RESOLVER_LOGTAG = "TwittnukerDns"; private final SharedPreferences mHostMapping; private final SharedPreferencesWra...
public class TwidereDns implements Dns, Constants {
35,926
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
35,927
package org.codehaus.groovy.tools; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; <BUG>import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.OptionBuilder;</BUG> import org.apache.commons.cli.Options; import org.apache.commons.cli.PosixParser; import ...
import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.OptionBuilder;
35,928
configuration.setJointCompilationOptions(compilerOptions); } String[] filenames = cli.getArgs(); if( filenames.length == 0 ) { <BUG>displayHelp(); </BUG> return; } int errors = checkFiles( filenames );
displayHelp(options);
35,929
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.TangoC...
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
35,930
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();
35,931
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: " +
35,932
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....
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
35,933
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.t...
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()...
35,934
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.tangos...
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
35,935
package de.mpc.pia.intermediate.compiler; import java.util.HashMap; import java.util.HashSet; import java.util.Map; <BUG>import java.util.Set; import org.apache.log4j.Logger;</BUG> import de.mpc.pia.intermediate.Accession; import de.mpc.pia.intermediate.Group; import de.mpc.pia.intermediate.Peptide;
import java.util.Collection; import java.util.TreeMap; import org.apache.log4j.Logger;
35,936
import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.Locale; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; <BUG>public class Modification { private Character residue;</BUG> private Double mass; private String descriptio...
public class Modification implements Serializable { private static final long serialVersionUID = -4903764803663298714L; private Character residue;
35,937
import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import szewek.mcflux.U; import szewek.mcflux.util.IX; import javax.annotation.Nonnull; <BUG>import java.util.Arrays; public class BuiltShapedRecipe implements IRecipe {</BUG> private final IX[][] shapeCode; private final int width, heigh...
import static net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE; public class BuiltShapedRecipe implements IRecipe {
35,938
companyId, newRepositoryId, fileName); if (newFileNameDir.exists()) { throw new DuplicateFileException(fileName); } File parentFile = fileNameDir.getParentFile(); <BUG>fileNameDir.renameTo(newFileNameDir); deleteEmptyAncestors(companyId, repositoryId, parentFile);</BUG> } public void updateFile(
boolean renamed = fileNameDir.renameTo(newFileNameDir); if (!renamed) { throw new SystemException( "File name directory was not renamed from " + fileNameDir.getPath() + " to " + newFileNameDir.getPath()); deleteEmptyAncestors(companyId, repositoryId, parentFile);
35,939
companyId, repositoryId, newFileName); if (newFileNameDir.exists()) { throw new DuplicateFileException(newFileName); } File parentFile = fileNameDir.getParentFile(); <BUG>fileNameDir.renameTo(newFileNameDir); deleteEmptyAncestors(companyId, repositoryId, parentFile);</BUG> } @Override
boolean renamed = fileNameDir.renameTo(newFileNameDir); if (!renamed) { throw new SystemException( "File name directory was not renamed from " + fileNameDir.getPath() + " to " + newFileNameDir.getPath()); deleteEmptyAncestors(companyId, repositoryId, parentFile);
35,940
package com.liferay.portlet.documentlibrary.store; <BUG>import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.util.CharPool;</BUG> import com.liferay.portal.kernel.util.FileUtil; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool;...
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.CharPool;
35,941
} @Override public void updateFile( long companyId, long repositoryId, String fileName, String newFileName) <BUG>throws PortalException { super.updateFile(companyId, repositoryId, fileName, newFileName);</BUG> File newFileNameDir = getFileNameDir( companyId, repositoryId, newFileName); String[] fileNameVersions = FileU...
return fileNames.toArray(new String[fileNames.size()]); throws PortalException, SystemException { super.updateFile(companyId, repositoryId, fileName, newFileName);
35,942
buildPath(sb, fileNameFragment); File repositoryDir = getRepositoryDir(companyId, repositoryId); File fileNameDir = new File( repositoryDir + StringPool.SLASH + sb.toString() + StringPool.SLASH + fileNameFragment + ext); <BUG>File parentDir = fileNameDir.getParentFile(); if (!parentDir.exists()) { parentDir.mkdirs();...
File parentFile = fileNameDir.getParentFile(); if (!parentFile.exists()) { parentFile.mkdirs();
35,943
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args...
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
35,944
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, s...
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
35,945
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task...
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
35,946
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField +...
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
35,947
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.e...
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
35,948
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
35,949
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
35,950
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);
35,951
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() ...
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
35,952
this.idx = idx; this.parent = parent; } @Override public void run() { <BUG>emit(); } void emit() {</BUG> if (once.compareAndSet(false, true)) { parent.emit(idx, value, this);
[DELETED]
35,953
source.subscribe(observer); } else { Scheduler.Worker w = scheduler.createWorker(); source.subscribe(new ObserveOnObserver<T>(observer, w, delayError, bufferSize)); } <BUG>} static class Padding0 extends AtomicInteger { private static final long serialVersionUID = 3172843496016154809L; volatile long p01, p02, p03, p04,...
static final class ObserveOnObserver<T> extends BasicIntQueueDisposable<T> implements Observer<T>, Runnable {
35,954
for (;;) { if (checkTerminated(done, q.isEmpty(), a)) { return; } for (;;) { <BUG>boolean d = done; T v = q.poll(); boolean empty = v == null;</BUG> if (checkTerminated(d, empty, a)) { return;
[DELETED]
35,955
public final <U, V> Observable<V> flatMapIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper, BiFunction<? super T, ? super U, ? extends V> resultSelector) { return flatMap(ObservableInternalHelper.flatMapIntoIterable(mapper), resultSelector, false, bufferSize(), bufferSize()); } @SchedulerSuppor...
[DELETED]
35,956
import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl; import org.apache.sling.jcr.resource.internal.helper.MapEntries; import org.apache.sling.jcr.resource.internal.helper.Mapping; import org.apache.sling.performance.annotation.Performan...
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
35,957
@PerformanceTestSuite public ParameterizedTestList testPerformance() throws Exception { Helper helper = new Helper(); ParameterizedTestList testCenter = new ParameterizedTestList(); testCenter.setTestSuiteTitle("jcr.resource-2.0.10"); <BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper)); ...
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyV...
35,958
package org.apache.sling.performance; <BUG>import static org.mockito.Mockito.*; import javax.jcr.NamespaceRegistry;</BUG> import javax.jcr.Session; import junitx.util.PrivateAccessor;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.mock; import javax.jcr.NamespaceRegistry;
35,959
import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl; import org.apache.sling.jcr.resource.internal.helper.MapEntries; import org.apache.sling.jcr.resource.internal.helper.Mapping; import org.apache.sling.performance.annotation.Performan...
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
35,960
import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.jcr.api.SlingRepository; import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BU...
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
35,961
@PerformanceTestSuite public ParameterizedTestList testPerformance() throws Exception { Helper helper = new Helper(); ParameterizedTestList testCenter = new ParameterizedTestList(); testCenter.setTestSuiteTitle("jcr.resource-2.2.0"); <BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper)); t...
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyV...
35,962
import fr.openwide.core.basicapp.web.application.common.validator.EmailUnicityValidator; import fr.openwide.core.basicapp.web.application.common.validator.UserPasswordValidator; import fr.openwide.core.basicapp.web.application.common.validator.UsernamePatternValidator; import fr.openwide.core.basicapp.web.application.c...
import fr.openwide.core.wicket.more.condition.Condition; import fr.openwide.core.wicket.more.markup.html.basic.EnclosureContainer;
35,963
import org.apache.wicket.model.IModel; import org.apache.wicket.model.ResourceModel; import fr.openwide.core.basicapp.core.util.binding.Bindings; import fr.openwide.core.jpa.more.business.generic.model.GenericListItem; import fr.openwide.core.wicket.more.condition.Condition; <BUG>import fr.openwide.core.wicket.more.mar...
[DELETED]
35,964
.add( label .setLabel(new ResourceModel("business.listItem.label")) .setRequired(true), enabled <BUG>.setLabel(new ResourceModel("business.listItem.enabled")) .add(new EnclosureBehavior(ComponentBooleanProperty.ENABLE) .condition(disableableCondition))</BUG> ) );
.add(disableableCondition.thenEnable())
35,965
public boolean applies() { User displayedUser = getModelObject(); User currentUser = BasicApplicationSession.get().getUser(); return !displayedUser.equals(currentUser) && displayedUser.isActive(); } <BUG>}) ),</BUG> new Label("userName", BindingModel.of(userModel, Bindings.user().userName())), new BooleanIcon("active",...
.thenShowInternal()
35,966
package fr.openwide.core.wicket.more.jqplot.component; import static com.google.common.base.Preconditions.checkNotNull; import java.util.Collection; import java.util.Collections; import java.util.Locale; <BUG>import java.util.Map; import org.apache.wicket.Component;</BUG> import org.apache.wicket.behavior.Behavior; imp...
import nl.topicus.wqplot.components.JQPlot; import nl.topicus.wqplot.options.PlotOptions; import nl.topicus.wqplot.options.PlotSeries; import nl.topicus.wqplot.options.PlotTick; import org.apache.wicket.Component;
35,967
import fr.openwide.core.basicapp.core.business.common.model.PostalCode; import fr.openwide.core.basicapp.core.business.referencedata.model.City; import fr.openwide.core.basicapp.core.util.binding.Bindings; import fr.openwide.core.basicapp.web.application.referencedata.validator.CityUnicityFormValidator; import fr.openw...
[DELETED]
35,968
.setRequired(true), postalCode .setLabel(new ResourceModel("business.postalCode")) .setRequired(true), enabled <BUG>.setLabel(new ResourceModel("business.listItem.enabled")) .add(new EnclosureBehavior(ComponentBooleanProperty.ENABLE) .condition(disableableCondition))</BUG> ) .add(new CityUnicityFormValidator(getModel()...
.add(disableableCondition.thenEnable())
35,969
import fr.openwide.core.basicapp.web.application.referencedata.page.ReferenceDataPage; import fr.openwide.core.jpa.security.service.IAuthenticationService; import fr.openwide.core.spring.property.service.IPropertyService; import fr.openwide.core.wicket.behavior.ClassAttributeAppender; import fr.openwide.core.wicket.mar...
import fr.openwide.core.wicket.more.condition.Condition; import fr.openwide.core.wicket.more.markup.html.basic.EnclosureContainer;
35,970
NavigationMenuItem navItem = item.getModelObject(); AbstractLink navLink = navItem.linkHidingIfInvalid("navLink"); navLink.add(new ClassAttributeAppender(navItem.getCssClassesModel())); navLink.add( new Label("label", navItem.getLabelModel()), <BUG>new EnclosureContainer("icon").model(navItem.getIconClassesModel()) </B...
new EnclosureContainer("icon").condition(Condition.modelNotNull(navItem.getIconClassesModel()))
35,971
import fr.openwide.core.wicket.more.link.descriptor.IPageLinkDescriptor; import fr.openwide.core.wicket.more.link.descriptor.builder.LinkDescriptorBuilder; import fr.openwide.core.wicket.more.link.descriptor.mapper.ITwoParameterLinkDescriptorMapper; import fr.openwide.core.wicket.more.link.descriptor.parameter.CommonPa...
import fr.openwide.core.wicket.more.condition.Condition; import fr.openwide.core.wicket.more.model.BindingModel;
35,972
) .link("backToSourcePage").hideIfInvalid(); add( backToSourcePage, typeDescriptor.administrationTypeDescriptor().portfolio().link("backToList") <BUG>.add(new PlaceholderBehavior().component(backToSourcePage)) );</BUG> } @Override protected void onDetach() {
.add(Condition.componentVisible(backToSourcePage).thenHide())
35,973
import fr.openwide.core.basicapp.core.business.user.model.UserGroup; import fr.openwide.core.basicapp.core.util.binding.Bindings; import fr.openwide.core.basicapp.web.application.administration.component.UserGroupDescriptionPanel; import fr.openwide.core.basicapp.web.application.administration.component.UserGroupMember...
import fr.openwide.core.wicket.more.condition.Condition; import fr.openwide.core.wicket.more.link.descriptor.IPageLinkDescriptor;
35,974
private final IHistoryComponentFactory historyComponentFactory; public HistoryDifferenceListPanel(String id, IModel<List<HistoryDifference>> model, IHistoryComponentFactory historyComponentFactory) { super(id, model); this.historyComponentFactory = historyComponentFactory; <BUG>add(new EnclosureBehavior(ComponentBoolea...
add(Condition.collectionModelNotEmpty(getModel()).thenShowInternal()); }
35,975
import org.apache.wicket.Component; import org.apache.wicket.model.IModel; import org.apache.wicket.model.ResourceModel; import fr.openwide.core.basicapp.core.business.user.model.User; import fr.openwide.core.wicket.markup.html.basic.CoreLabel; <BUG>import fr.openwide.core.wicket.markup.html.panel.GenericPanel; import ...
import fr.openwide.core.wicket.more.condition.Condition;
35,976
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args...
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
35,977
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, s...
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
35,978
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task...
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
35,979
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField +...
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
35,980
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.e...
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
35,981
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
35,982
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
35,983
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);
35,984
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() ...
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
35,985
return myState; } @Override public void loadState(State state) { myState = state; <BUG>if (myState.TAB_STATES.get(MAIN_LOG_ID) == null) { myState.TAB_STATES.put(MAIN_LOG_ID, myDeprecatedProperties.getState()); }</BUG> }
myState.TAB_STATES.putIfAbsent(MAIN_LOG_ID, myDeprecatedProperties.getState());
35,986
myState.TAB_STATES.put(MAIN_LOG_ID, myDeprecatedProperties.getState()); }</BUG> } public VcsLogUiProperties createProperties(@NotNull final String id) { <BUG>if (myState.TAB_STATES.get(id) == null) { myState.TAB_STATES.put(id, new VcsLogUiPropertiesImpl.State()); }</BUG> return new VcsLogUiPropertiesImpl() {
return myState; @Override public void loadState(State state) { myState = state; myState.TAB_STATES.putIfAbsent(MAIN_LOG_ID, myDeprecatedProperties.getState()); myState.TAB_STATES.putIfAbsent(id, new VcsLogUiPropertiesImpl.State());
35,987
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.TangoC...
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
35,988
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();
35,989
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: " +
35,990
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....
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
35,991
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.t...
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()...
35,992
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.tangos...
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
35,993
if (m_collector == null || !m_collector.hasIpAddrTable() || !m_collector.hasIfTable()) return; String ipAddr = ipIf.getIpAddress(); log().debug("Creating SNMP info for interface "+ipAddr); InetAddress inetAddr = ipIf.getInetAddress(); int ifIndex = m_collector.getIfIndex(inetAddr); <BUG>if (ifIndex == -1) return; OnmsS...
OnmsSnmpInterface snmpIf = m_node.getSnmpInterfaceWithIfIndex(ifIndex); if (snmpIf == null) { snmpIf.setIfAlias(m_collector.getIfAlias(ifIndex));
35,994
snmpIf.setIfType(getIfType(ifIndex)); snmpIf.setNetMask(getNetMask(ifIndex)); snmpIf.setIfAdminStatus(getAdminStatus(ifIndex)); snmpIf.setIfDescr(m_collector.getIfDescr(ifIndex)); snmpIf.setIfSpeed(m_collector.getIfSpeed(ifIndex)); <BUG>snmpIf.setPhysAddr(m_collector.getPhysAddr(ifIndex)); ipIf.setSnmpInterface(snmpIf)...
if (ipIf.getIsSnmpPrimary() == CollectionType.PRIMARY) { snmpIf.setIpAddress(ipAddr); ipIf.setSnmpInterface(snmpIf);
35,995
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceFo...
customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName); customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName); }
35,996
final Ref<? extends PyType> yieldTypeRef = getYieldStatementType(context); if (yieldTypeRef != null) { return yieldTypeRef.get(); } return getReturnStatementType(context); <BUG>} else if (isAsync()) { return createCoroutineType(null);</BUG> } return null;
[DELETED]
35,997
if (isGeneratedStub() && !visitor.myHasReturns) { if (PyNames.INIT.equals(getName())) { return PyNoneType.INSTANCE; } return null; <BUG>} final PyType returnType = visitor.result(); if (isAsync()) { return createCoroutineType(returnType); } return returnType;</BUG> }
return visitor.result();
35,998
import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiUtil; import com.intellij.util.ArrayUtil; import com.intellij.util.ArrayUtilRt; import com.intellij.util.IncorrectOperationException; <BUG>import com.intellij.util.SmartList; import org.jdom.Element;</BUG> import org.jetbrains.annotations.Contrac...
import com.intellij.util.containers.MultiMap; import org.jdom.Element;
35,999
final StandardInstructionVisitor visitor = new DataFlowInstructionVisitor(dfaRunner); final RunnerResult rc = dfaRunner.analyzeMethod(scope, visitor, IGNORE_ASSERT_STATEMENTS); </BUG> if (rc == RunnerResult.OK) { <BUG>createDescription(dfaRunner, holder, visitor); }</BUG> else if (rc == RunnerResult.TOO_COMPLEX) { if (...
final RunnerResult rc = dfaRunner.analyzeMethod(scope, visitor, IGNORE_ASSERT_STATEMENTS, initialStates); MultiMap<PsiElement,DfaMemoryState> nestedClosures = dfaRunner.getNestedClosures(); for (PsiElement closure : nestedClosures.keySet()) { analyzeDfaWithNestedClosures(closure, holder, dfaRunner, nestedClosures.get(c...
36,000
import com.intellij.openapi.util.Key; import com.intellij.openapi.util.Pair; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiUtil; <BUG>import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull;</BUG> import org.jetbrains.annotations.Nullable; import java.u...
import com.intellij.util.containers.MultiMap; import org.jetbrains.annotations.NotNull;