id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
5,401
nativ.setRequestNative(nativeReader.readNativeRequest(new CharArrayReader( </BUG> par.getTextCharacters(), par.getTextOffset(), par.getTextLength()))); <BUG>} else { nativ.setRequestNative(nativeReader.readNativeRequest(par)); }</BUG> } break;
return nativ; protected void readNativeField(JsonParser par, Native.Builder nativ, String fieldName) throws IOException { switch (fieldName) { case "request": if (par.getCurrentToken() == JsonToken.VALUE_STRING) { nativ.setRequestNative(factory().newNativeReader().readNativeRequest(new CharArrayReader( } else { // Object nativ.setRequestNative(factory().newNativeReader().readNativeRequest(par));
5,402
bid.setAdid(par.getText()); break; case "nurl": bid.setNurl(par.getText()); break; <BUG>case "adm": { if(par.getCurrentToken() == JsonToken.START_OBJECT) { bid.setAdmNative(factory().newNativeReader().readNativeResponse(par)); } else if (par.getCurrentToken() == JsonToken.VALUE_STRING) { String valueString = par.getText();</BUG> if (valueString.startsWith("{")) {
case "adm": String valueString = par.getText();
5,403
if (valueString.startsWith("{")) { bid.setAdmNative(factory().newNativeReader().readNativeResponse(valueString)); } else { bid.setAdm(valueString); } <BUG>} }</BUG> break; case "adomain": for (startArray(par); endArray(par); par.nextToken()) {
} else { // Object bid.setAdmNative(factory().newNativeReader().readNativeResponse(par));
5,404
if(factory().isForceNativeAsObject()) { gen.writeFieldName("request"); nativeWriter().writeNativeRequest(nativ.getRequestNative(), gen);</BUG> } else { <BUG>String nativeString = factory().newNativeWriter().writeNativeRequest(nativ.getRequestNative()); gen.writeStringField("request", nativeString); }</BUG> } break;
writeExtensions(nativ, gen); gen.writeEndObject(); protected void writeNativeFields(Native nativ, JsonGenerator gen) throws IOException { switch (nativ.getRequestOneofCase()) { case REQUEST_NATIVE: if (factory().isForceNativeAsObject()) { nativeWriter().writeNativeRequest(nativ.getRequestNative(), gen); gen.writeString(nativeWriter().writeNativeRequest(nativ.getRequestNative()));
5,405
} switch (bid.getAdmOneofCase()) { case ADM: gen.writeStringField("adm", bid.getAdm()); break; <BUG>case ADM_NATIVE: { if(factory().isForceNativeAsObject()) { gen.writeFieldName("adm"); nativeWriter().writeNativeResponse(bid.getAdmNative(), gen);</BUG> } else {
gen.writeEndArray();
5,406
} protected MyOpenRtbJsonFactory(MyOpenRtbJsonFactory config) { super(config); } public static MyOpenRtbJsonFactory create() { <BUG>return new MyOpenRtbJsonFactory(null, false, true, null, null); </BUG> } @Override public OpenRtbJsonReader newReader() { return new MyOpenRtbJsonReader(new MyOpenRtbJsonFactory(this));
return new MyOpenRtbJsonFactory(null, false, true, false, null, null);
5,407
ctx.addDeploymentProcessor(Phase.DEPENDENCIES, Phase.DEPENDENCIES_WAR_MODULE, new WarClassloadingDependencyProcessor()); ctx.addDeploymentProcessor(Phase.POST_MODULE, Phase.POST_MODULE_ANNOTATION_WAR, new WarAnnotationDeploymentProcessor()); ctx.addDeploymentProcessor(Phase.INSTALL, Phase.INSTALL_SERVLET_INIT_DEPLOYMENT, new ServletContainerInitializerDeploymentProcessor()); ctx.addDeploymentProcessor(Phase.INSTALL, Phase.INSTALL_WAR_METADATA, new WarMetaDataProcessor()); ctx.addDeploymentProcessor(Phase.INSTALL, Phase.INSTALL_WAR_DEPLOYMENT, new WarDeploymentProcessor(defaultHost)); <BUG>} updateContext.getSubModel().get(CommonAttributes.CONTAINER_CONFIG).set(config); resultHandler.handleResultComplete(compensatingOperation);</BUG> return Cancellable.NULL;
[DELETED]
5,408
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != null) { c.moveToFirst(); }
MemoEntry.COLUMN_ORDER + " ASC", null);
5,409
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
5,410
import mage.MageInt; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; <BUG>import mage.game.permanent.token.Token; </BUG> public class LuminousAngel extends CardImpl<LuminousAngel> { public LuminousAngel(UUID ownerId) { super(ownerId, 15, "Luminous Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}{W}");
import mage.game.permanent.token.SpiritWhiteToken;
5,411
this.subtype.add("Angel"); this.color.setWhite(true); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); <BUG>this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new SpiritToken(), 1), Constants.TargetController.YOU, true)); </BUG> } public LuminousAngel(final LuminousAngel card) { super(card);
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken(), 1), Constants.TargetController.YOU, true));
5,412
import mage.abilities.effects.common.AttachEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility;</BUG> import mage.cards.CardImpl; <BUG>import mage.game.Game; import mage.game.permanent.Permanent;</BUG> import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; public class NimbusWings extends CardImpl<NimbusWings> { public NimbusWings (UUID ownerId) {
import mage.abilities.effects.common.continious.BoostEnchantedEffect; import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
5,413
this.expansionSetCode = "ZEN"; this.subtype.add("Aura"); this.color.setWhite(true); TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); <BUG>this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NimbusWingsEffect()));</BUG> }
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); SimpleStaticAbility ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Duration.WhileOnBattlefield)); ability.addEffect(new GainAbilityAttachedEffect(new AttacksEachTurnStaticAbility(), AttachmentType.AURA));
5,414
package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterCard; public class FilterNonlandCard extends FilterCard<FilterNonlandCard> { public FilterNonlandCard() { <BUG>this("non-land card"); }</BUG> public FilterNonlandCard(String name) { super(name); this.notCardTypeList.add(CardType.LAND);
this("nonland card"); }
5,415
Card card = player.getHand().get(target.getFirstTarget(), game); if (card != null) { return player.discard(card, source, game); } } <BUG>} }</BUG> return false; } @Override
return true;
5,416
public class SpectralProcession extends CardImpl<SpectralProcession> { public SpectralProcession(UUID ownerId) { super(ownerId, 23, "Spectral Procession", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2/W}{2/W}{2/W}"); this.expansionSetCode = "SHM"; this.color.setWhite(true); <BUG>this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritToken(), 3)); </BUG> } public SpectralProcession(final SpectralProcession card) { super(card);
this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritWhiteToken(), 3));
5,417
byte[] VALUE = token("value"); byte[] REDIRECT = token("redirect"); byte[] FORWARD = token("forward"); String WADL = "wadl:"; String WADL_URI = "http://wadl.dev.java.net/2009/02"; <BUG>String XHTML_URL = "http://www.w3.org/1999/xhtml"; String ANN_MISSING = "Annotation %% or %% missing.";</BUG> String ANN_BODYVAR = "More than one body request variable specified."; String ANN_TWICE = "Annotation %% is specified twice."; String INV_TEMPLATE = "Invalid path template: \"%\".";
String IGNORE = ".ignore"; String INIT = ".init"; String ANN_MISSING = "Annotation %% or %% missing.";
5,418
protected void run(final HTTPContext http) throws Exception { if(http.req.getPathInfo() == null) { http.redirect("/"); return; } <BUG>final RestXqModules rxm = RestXqModules.get(); RestXqFunction func = rxm.find(http, null);</BUG> if(func == null) throw HTTPCode.NO_XQUERY.get(); try { func.process(http, null);
if(http.path().equals("/" + INIT)) { rxm.init(); RestXqFunction func = rxm.find(http, null);
5,419
ONEOP(SC_BAD_REQUEST, "Only one operation can be specified."), UNKNOWN_PARAM_X(SC_BAD_REQUEST, "Unknown parameter: '%'."), MULTIPLE_CONTEXT_X(SC_BAD_REQUEST, "Multiple context values specified."), NOT_FOUND_X(SC_NOT_FOUND, "%"), NO_PATH(SC_NOT_FOUND, "No path specified."), <BUG>NO_XQUERY(SC_NOT_FOUND, "No function found that matches the request."), NOT_IMPLEMENTED_X(SC_NOT_IMPLEMENTED, "Method not supported: %.");</BUG> final int code; final String desc; HTTPCode(final int code, final String desc) {
NO_RESTXQ(SC_NOT_FOUND, "RESTXQ directory not found."), NOT_IMPLEMENTED_X(SC_NOT_IMPLEMENTED, "Method not supported: %.");
5,420
public static final NumberOption LOGMSGMAXLEN = new NumberOption("LOGMSGMAXLEN", 1000); public static final Comment C_HTTP = new Comment("HTTP Services"); public static final StringOption WEBPATH = new StringOption("WEBPATH", HOME + (USERHOME ? NAME + "Web" : "webapp")); public static final StringOption RESTPATH = new StringOption("RESTPATH", ""); <BUG>public static final StringOption RESTXQPATH = new StringOption("RESTXQPATH", ""); public static final BooleanOption HTTPLOCAL = new BooleanOption("HTTPLOCAL", false);</BUG> public static final NumberOption STOPPORT = new NumberOption("STOPPORT", 8985); public static final EnumOption<AuthMethod> AUTHMETHOD = new EnumOption<>("AUTHMETHOD", AuthMethod.BASIC);
public static final BooleanOption CACHERESTXQ = new BooleanOption("CACHERESTXQ", false); public static final BooleanOption HTTPLOCAL = new BooleanOption("HTTPLOCAL", false);
5,421
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
5,422
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
5,423
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != null) { c.moveToFirst(); }
MemoEntry.COLUMN_ORDER + " ASC", null);
5,424
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
5,425
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode { </BUG> private List<MemoEntity> memoList;
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
5,426
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) { this.mActivity = activity;</BUG> this.topicId = topicId; this.memoList = memoList;
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
5,427
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
5,428
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;
5,429
@Override public String toString() { return "desc"; } }; <BUG>public static final SortOrder DEFAULT = DESC; private static final SortOrder PROTOTYPE = DEFAULT; </BUG> @Override public SortOrder readFrom(StreamInput in) throws IOException {
return "asc"; }, DESC { private static final SortOrder PROTOTYPE = ASC;
5,430
GeoDistance geoDistance = GeoDistance.DEFAULT; boolean reverse = false; MultiValueMode sortMode = null; NestedInnerQueryParseSupport nestedHelper = null; final boolean indexCreatedBeforeV2_0 = context.indexShard().getIndexSettings().getIndexVersionCreated().before(Version.V_2_0_0); <BUG>boolean coerce = false; boolean ignoreMalformed = false; XContentParser.Token token;</BUG> String currentName = parser.currentName(); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
boolean coerce = GeoDistanceSortBuilder.DEFAULT_COERCE; boolean ignoreMalformed = GeoDistanceSortBuilder.DEFAULT_IGNORE_MALFORMED; XContentParser.Token token;
5,431
String currentName = parser.currentName(); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { currentName = parser.currentName(); } else if (token == XContentParser.Token.START_ARRAY) { <BUG>parseGeoPoints(parser, geoPoints); </BUG> fieldName = currentName; } else if (token == XContentParser.Token.START_OBJECT) { if ("nested_filter".equals(currentName) || "nestedFilter".equals(currentName)) {
GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
5,432
package org.elasticsearch.search.sort; <BUG>import org.elasticsearch.script.Script; public class SortBuilders {</BUG> public static ScoreSortBuilder scoreSort() { return new ScoreSortBuilder(); }
import org.elasticsearch.common.geo.GeoPoint; import java.util.Arrays; public class SortBuilders {
5,433
public GeoDistanceSortBuilder ignoreMalformed(boolean ignoreMalformed) { this.ignoreMalformed = ignoreMalformed; return this; }</BUG> @Override <BUG>public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject("_geo_distance"); if (geohashes.size() == 0 && points.size() == 0) { throw new ElasticsearchParseException("No points provided for _geo_distance sort."); }</BUG> builder.startArray(fieldName);
if (coerce == false) { } } public boolean ignoreMalformed() { return this.ignoreMalformed; } builder.startObject(NAME);
5,434
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> a[i][j] = operator.applyAsBoolean(a[i][j]); }
public boolean[] row(final int rowIndex) { N.checkArgument(rowIndex >= 0 && rowIndex < n, "Invalid row Index: %s", rowIndex); return a[rowIndex];
5,435
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j]); }
public boolean get(final int i, final int j) { return a[i][j];
5,436
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j], c[i][j]); }
return new BooleanMatrix(c);
5,437
} public AsyncExecutor(int maxConcurrentThreadNumber, long keepAliveTime, TimeUnit unit) { this.maxConcurrentThreadNumber = maxConcurrentThreadNumber; this.keepAliveTime = keepAliveTime; this.unit = unit; <BUG>} public AsyncExecutor(final ExecutorService executorService) { this(8, 300, TimeUnit.SECONDS); this.executorService = executorService;</BUG> Runtime.getRuntime().addShutdownHook(new Thread() {
[DELETED]
5,438
results.add(execute(cmd)); } return results; } public <T> CompletableFuture<T> execute(final Callable<T> command) { <BUG>final CompletableFuture<T> future = new CompletableFuture<T>(this, command); getExecutorService().execute(future);</BUG> return future; } public <T> List<CompletableFuture<T>> execute(final Callable<T>... commands) {
final CompletableFuture<T> future = new CompletableFuture<>(this, command); getExecutorService().execute(future);
5,439
p.sendMessage("Item has no Metadata"); } else { ItemMeta meta = item.getItemMeta(); if (meta.hasDisplayName()) { try { <BUG>p.sendMessage("DisplayName ID: " + ItemManager.decodeId(meta.getDisplayName())); } catch (Exception ex) {</BUG> p.sendMessage("DisplayName contains no valid ID."); } } else {
int id = ItemManager.decodeId(meta.getDisplayName()); if (id == -1) { throw new Exception(); p.sendMessage("DisplayName ID: " + id); } catch (Exception ex) {
5,440
} else { p.sendMessage("Item has no displayName"); } if (meta.hasLore() && meta.getLore().size() > 0) { try { <BUG>p.sendMessage("Lore ID: " + ItemManager.decodeId(meta.getLore().get(0))); } catch (Exception ex) {</BUG> p.sendMessage("DisplayName contains no valid ID."); }
ItemMeta meta = item.getItemMeta(); if (meta.hasDisplayName()) { int id = ItemManager.decodeId(meta.getDisplayName()); if (id == -1) { throw new Exception(); p.sendMessage("DisplayName ID: " + id); } catch (Exception ex) {
5,441
public static boolean isOldRPGItem(ItemStack item) { if (item == null) return false; if (!item.hasItemMeta()) return false; String name = item.getItemMeta().getDisplayName(); try { <BUG>ItemManager.decodeId(name); return true;</BUG> } catch (Exception ex) { return false;
int id = ItemManager.decodeId(name); if (id == -1) {
5,442
package com.eucalyptus.component; import java.net.InetAddress; import java.util.List; import java.util.NavigableSet; <BUG>import java.util.NoSuchElementException; import java.util.concurrent.ConcurrentMap;</BUG> import java.util.concurrent.atomic.AtomicReference; import org.apache.log4j.Logger; import com.eucalyptus.bootstrap.Bootstrap;
import java.util.TreeSet; import java.util.concurrent.ConcurrentMap;
5,443
import com.eucalyptus.util.FullName; import com.eucalyptus.util.HasName; import com.eucalyptus.util.Internets; import com.eucalyptus.util.fsm.Automata; import com.eucalyptus.util.fsm.StateMachine; <BUG>import com.eucalyptus.util.fsm.TransitionException; import com.google.common.base.Joiner; import com.google.common.base.Predicate; import com.google.common.collect.ArrayListMultimap;</BUG> import com.google.common.collect.Iterables;
import com.google.common.base.Function; import com.google.common.base.Functions; import com.google.common.base.Predicates; import com.google.common.collect.ArrayListMultimap;
5,444
EventRecord.here( Bootstrap.class, EventType.BOOTSTRAPPER_MARK_DISABLED, "stage:" + stage.toString( ), this.component.getComponentId( ).name( ), bootstrapper.getClass( ).getName( ), "component=" + this.component.getComponentId( ).name( ) ).exhaust( ); this.bootstrappers.remove( stage, bootstrapper ); this.disabledBootstrappers.put( stage, bootstrapper ); } <BUG>private boolean doTransition( EventType transition, CheckedFunction<Bootstrapper, Boolean> checkedFunction ) { String name = transition.name( ).replaceAll( ".*_", "" ).toLowerCase( ); this.updateBootstrapDependencies( );</BUG> for ( Stage s : Bootstrap.Stage.values( ) ) { for ( Bootstrapper b : Lists.newArrayList( this.bootstrappers.get( s ) ) ) {
private boolean doTransition( EventType transition, Function<Bootstrapper, Boolean> checkedFunction ) { return doTransition( transition, checkedFunction, Functions.forPredicate( ( Predicate ) Predicates.alwaysTrue( ) ) ); private boolean doTransition( EventType transition, Function<Bootstrapper, Boolean> checkedFunction, Function<Bootstrapper, Boolean> rollbackFunction ) { List<Bootstrapper> rollbackBootstrappers = Lists.newArrayList( ); this.updateBootstrapDependencies( );
5,445
JavaPluginConvention javaConvention = new JavaPluginConvention(project, customValues); Convention convention = project.getConvention(); convention.getPlugins().put("java", javaConvention); configureConfigurations(project); configureUploadRules(project); <BUG>project.createTask(INIT); ((ConventionTask) project.createTask(GUtil.map("type", Clean.class), CLEAN)).</BUG> conventionMapping(GUtil.map( "dir", new ConventionValue() { public Object getValue(Convention convention, IConventionAware conventionAwareObject) {
project.createTask(INIT).setDescription("The first task of the Java plugin tasks to be excuted. Does nothing if not customized."); ((ConventionTask) project.createTask(GUtil.map("type", Clean.class), CLEAN)).
5,446
conventionMapping(GUtil.map( "dir", new ConventionValue() { public Object getValue(Convention convention, IConventionAware conventionAwareObject) { return project.getBuildDir(); } <BUG>})); configureJavaDoc(project);</BUG> configureResources(project); configureCompile(project); configureTest(project);
})).setDescription("Deletes the build directory."); configureJavaDoc(project);
5,447
configureEclipseWtpModule(project); } private void configureTestCompile(Project project) { configureTestCompile((Compile) project.createTask(GUtil.map("type", Compile.class), TEST_COMPILE), (Compile) project.task(COMPILE), DefaultConventionsToPropertiesMapping.TEST_COMPILE, <BUG>project.getConfigurations()); }</BUG> private void configureCompile(final Project project) { project.addTaskLifecycleListener(Compile.class, new TaskLifecycleListener<Compile>() { public void taskAdded(Compile compile) {
project.getConfigurations()).setDescription("Compiles the Java test source code.");
5,448
compile.setConfiguration(project.getConfigurations().get(COMPILE)); compile.conventionMapping(DefaultConventionsToPropertiesMapping.COMPILE); addDependsOnProjectDependencies(compile, COMPILE); } }); <BUG>project.createTask(GUtil.map("type", Compile.class), COMPILE); }</BUG> private void configureResources(Project project) { project.addTaskLifecycleListener(Resources.class, new TaskLifecycleListener<Resources>() { public void taskAdded(Resources resources) {
project.createTask(GUtil.map("type", Compile.class), COMPILE).setDescription("Compiles the Java source code.");
5,449
public void taskAdded(Resources resources) { resources.dependsOn(INIT); resources.conventionMapping(DefaultConventionsToPropertiesMapping.RESOURCES); } }); <BUG>project.createTask(GUtil.map("type", Resources.class), RESOURCES); }</BUG> private void configureJavaDoc(final Project project) { project.addTaskLifecycleListener(Javadoc.class, new TaskLifecycleListener<Javadoc>() {
project.createTask(GUtil.map("type", Resources.class), RESOURCES).setDescription( "Process and copy the resources into the binary directory of the compiled sources.");
5,450
eclipseWtpModule.conventionMapping(GUtil.map( "srcDirs", new ConventionValue() { public Object getValue(Convention convention, IConventionAware conventionAwareObject) { return GUtil.addLists(java(convention).getSrcDirs(), java(convention).getResourceDirs()); } <BUG>})); }</BUG> private EclipseClasspath configureEclipseClasspath(Project project) { EclipseClasspath eclipseClasspath = (EclipseClasspath) project.createTask(GUtil.map("type", EclipseClasspath.class), ECLIPSE_CP); eclipseClasspath.conventionMapping(GUtil.map(
eclipseWtpModule.setDescription("Generates the Eclipse Wtp files.");
5,451
final Upload upload = (Upload) project.createTask(GUtil.map("type", Upload.class), name); PublishInstruction publishInstruction = new PublishInstruction(); publishInstruction.setIvyFileParentDir(project.getBuildDir()); upload.setConfiguration(configuration); upload.setPublishInstruction(publishInstruction); <BUG>upload.dependsOn(configuration.getBuildArtifacts()); return upload;</BUG> } private void configureLibs(Project project, final JavaPluginConvention javaConvention) { Bundle libsBundle = (Bundle) project.createTask(GUtil.map("type", Bundle.class, "dependsOn", TEST), LIBS);
upload.setDescription(String.format("Uploads all artifacts belonging to the %s configuration", configuration.getName())); return upload;
5,452
jar.conventionMapping(WrapUtil.<String, ConventionValue>toMap("resourceCollections", new ConventionValue() { public Object getValue(Convention convention, IConventionAware conventionAwareObject) { return WrapUtil.toList(new FileSet(javaConvention.getClassesDir())); } <BUG>})); project.getConfigurations().get(Dependency.MASTER_CONFIGURATION).addArtifact(new ArchivePublishArtifact(jar));</BUG> } private void configureDists(Project project, JavaPluginConvention javaPluginConvention) { Bundle distsBundle = (Bundle) project.createTask(GUtil.map("type", Bundle.class, "dependsOn", LIBS), DISTS);
jar.setDescription("Generates a jar archive with all the compiled classes."); project.getConfigurations().get(Dependency.MASTER_CONFIGURATION).addArtifact(new ArchivePublishArtifact(jar));
5,453
new Object[unmanagedClasspathFromTestCompile.size()])); } }); } }); <BUG>project.createTask(GUtil.map("type", Test.class), TEST); </BUG> } void configureConfigurations(Project project) { project.setProperty("status", "integration");
project.createTask(GUtil.map("type", Test.class), TEST).setDescription("Runs the tests.");
5,454
static final String GROOVY = "groovy"; public void apply(Project project, PluginRegistry pluginRegistry, Map<String, ?> customValues) { JavaPlugin javaPlugin = pluginRegistry.apply(JavaPlugin.class, project, customValues); GroovyPluginConvention groovyPluginConvention = new GroovyPluginConvention(project, customValues); project.getConvention().getPlugins().put("groovy", groovyPluginConvention); <BUG>Configuration groovyConfiguration = project.getConfigurations().add(GROOVY).setVisible(false).setTransitive(false); configureCompile(project);</BUG> configureTestCompile(javaPlugin, project); configureJavadoc(project);
Configuration groovyConfiguration = project.getConfigurations().add(GROOVY).setVisible(false).setTransitive(false). setDescription("The groovy libraries to be used for this Groovy project."); configureCompile(project);
5,455
return groovy(convention).getGroovydocDir(); } })); } }); <BUG>project.createTask(GUtil.map("type", Groovydoc.class), GROOVYDOC); }</BUG> private void configureJavadoc(Project project) { TaskLifecycleListener<Javadoc> taskListener = new TaskLifecycleListener<Javadoc>() { public void taskAdded(Javadoc javadoc) {
project.createTask(GUtil.map("type", Groovydoc.class), GROOVYDOC).setDescription("Generates the groovydoc for the source code.");
5,456
GroovyCompile testCompile = (GroovyCompile) javaPlugin.configureTestCompile( (Compile) project.createTask(GUtil.map("type", GroovyCompile.class, "overwrite", true), TEST_COMPILE), (Compile) project.task(COMPILE), DefaultConventionsToPropertiesMapping.TEST_COMPILE, project.getConfigurations()); <BUG>testCompile.setGroovyClasspath(project.getConfigurations().get("groovy")); testCompile.conventionMapping(GUtil.map(</BUG> "groovySourceDirs", new ConventionValue() { public Object getValue(Convention convention, IConventionAware conventionAwareObject) { return groovy(convention).getGroovyTestSrcDirs();
testCompile.setDescription("Compiles the Java and Groovy test source code."); testCompile.conventionMapping(GUtil.map(
5,457
return groovy(convention).getGroovySrcDirs(); } })); } }); <BUG>project.createTask(GUtil.map("type", GroovyCompile.class, "overwrite", true), COMPILE); }</BUG> private GroovyPluginConvention groovy(Convention convention) { return convention.getPlugin(GroovyPluginConvention.class);
project.createTask(GUtil.map("type", GroovyCompile.class, "overwrite", true), COMPILE).setDescription( "Compiles the Java and Groovy source code.");
5,458
return ((War) project.task("archive_war")).getArchivePath(); } }); } private void configureJettyStop(Project project, final JettyPluginConvention jettyConvention) { <BUG>JettyStop jettyStop = (JettyStop) project.createTask(GUtil.map("type", JettyStop.class), JETTY_STOP); jettyStop.getConventionMapping().put("stopPort", new ConventionValue() {</BUG> public Object getValue(Convention convention, IConventionAware conventionAwareObject) { return jettyConvention.getStopPort(); }
jettyStop.setDescription("Stops Jetty."); jettyStop.getConventionMapping().put("stopPort", new ConventionValue() {
5,459
return jettyConvention.getStopKey(); } }); } private void configureJettyRun(final Project project, final JettyPluginConvention jettyConvention) { <BUG>JettyRun jettyRun = (JettyRun) project.createTask(GUtil.map("type", JettyRun.class), JETTY_RUN); jettyRun.dependsOn(JavaPlugin.TEST_COMPILE);</BUG> configureAbstractJettyTask(project, jettyConvention, jettyRun); jettyRun.setConfiguration(JavaPlugin.RUNTIME); jettyRun.setTestConfiguration(JavaPlugin.TEST_RUNTIME);
jettyRun.setDescription("Uses your files as and where they are and deploys them to Jetty."); jettyRun.dependsOn(JavaPlugin.TEST_COMPILE);
5,460
public static final String PROVIDED_RUNTIME = "providedRuntime"; public static final String ECLIPSE_WTP = "eclipseWtp"; public void apply(Project project, PluginRegistry pluginRegistry, Map<String, ?> customValues) { pluginRegistry.apply(JavaPlugin.class, project, customValues); project.task(project.getArchivesTaskBaseName() + "_jar").setEnabled(false); <BUG>War war = ((Bundle) project.task("libs")).war(); project.getConfigurations().get(Dependency.MASTER_CONFIGURATION).addArtifact(new ArchivePublishArtifact(war));</BUG> configureConfigurations(project.getConfigurations()); configureEclipse(project, war); }
war.setDescription("Generates a war archive with all the compiled classes, the web-app content and the libraries."); project.getConfigurations().get(Dependency.MASTER_CONFIGURATION).addArtifact(new ArchivePublishArtifact(war));
5,461
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
5,462
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
5,463
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != null) { c.moveToFirst(); }
MemoEntry.COLUMN_ORDER + " ASC", null);
5,464
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
5,465
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode { </BUG> private List<MemoEntity> memoList;
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
5,466
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) { this.mActivity = activity;</BUG> this.topicId = topicId; this.memoList = memoList;
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
5,467
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
5,468
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;
5,469
import com.intellij.openapi.vcs.impl.CurrentRevisionProvider; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.tmatesoft.svn.core.SVNException; <BUG>import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc.SVNWCClient;</BUG> import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException;
import org.tmatesoft.svn.core.wc.SVNStatus; import org.tmatesoft.svn.core.wc.SVNWCClient;
5,470
myVcs = vcs; myRevision = revision; myUseBaseRevision = useBaseRevision; myFile = file; } <BUG>public static SvnContentRevision createBaseRevision(@NotNull SvnVcs vcs, @NotNull final FilePath file, final SVNRevision revision) { if (file.getFileType().isBinary()) {</BUG> return new SvnBinaryContentRevision(vcs, file, revision, true); }
public static SvnContentRevision createBaseRevision(@NotNull SvnVcs vcs, @NotNull final FilePath file, final SVNStatus status) { SVNRevision revision = status.getRevision().isValid() ? status.getRevision() : status.getCommittedRevision(); return createBaseRevision(vcs, file, revision); public static SvnContentRevision createBaseRevision(SvnVcs vcs, FilePath file, SVNRevision revision) { if (file.getFileType().isBinary()) {
5,471
else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_CONFLICTED) || SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_MODIFIED) || SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_REPLACED) || propStatus == SVNStatusType.STATUS_MODIFIED || propStatus == SVNStatusType.STATUS_CONFLICTED) { <BUG>myChangelistBuilder.processChangeInList(createChange(SvnContentRevision.createBaseRevision(myVcs, filePath, status.getRevision()), CurrentContentRevision.create(filePath), fStatus, status), changeListNameFromStatus(status), SvnVcs.getKey());</BUG> checkSwitched(filePath, myChangelistBuilder, status, fStatus); } else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_DELETED)) {
myChangelistBuilder.processChangeInList(createChange(SvnContentRevision.createBaseRevision(myVcs, filePath, status), CurrentContentRevision.create(filePath), fStatus, status), changeListNameFromStatus(status), SvnVcs.getKey());
5,472
return -1; } int result = compare(this.serviceName, o.serviceName); if (result == 0) { result = compare(this.subServiceName, o.subServiceName); <BUG>if (result == 0) { result = compare(this.userName, o.userName); }</BUG> } return result;
[DELETED]
5,473
if (uri.getPort() > 0) { this.port = uri.getPort(); } } public JHttpEndpoint(Protocol protocol, String hostname, int port) { <BUG>Objects.nonNull(protocol); </BUG> this.protocol = protocol; if (org.springframework.util.StringUtils.isEmpty(hostname)) { throw new IllegalArgumentException(format("hostname must non-empty. Provided value: %s", hostname));
Objects.requireNonNull(protocol);
5,474
JTestDefinition jTestDefinition = JTestDefinition .builder(Id.of("exampleJaggerTestDefinition"), new ExampleEndpointsProvider()) .withComment("no comments") .withQueryProvider(new ExampleQueriesProvider()) .withValidators(singletonList(NotNullResponseValidator.class)) <BUG>.build(); JLoadProfile jLoadProfileRps = JLoadProfileRps .of(RequestsPerSecond.of(10), MaxLoadThreads.of(10), WarmUpTimeInSeconds.of(10));</BUG> JTerminationCriteria jTerminationCriteria = JTerminationCriteriaIterations.of(IterationsNumber.of(1000), MaxDurationInSeconds.of(20)); JLoadTest jLoadTest = JLoadTest
JLoadProfile jLoadProfileRps = JLoadProfileRps.builder(RequestsPerSecond.of(10)).withMaxLoadThreads(10).withWarmUpTimeInSeconds(10).build();
5,475
JTestDefinition description = JTestDefinition .builder(Id.of("myFirstJaggerTestDefinition"), new ExampleEndpointsProvider()) .withComment("no comments") .withQueryProvider(new ExampleQueriesProvider()) .withValidators(singletonList(NotNullResponseValidator.class)) <BUG>.build(); JLoadProfile load = JLoadProfileRps .of(RequestsPerSecond.of(10), MaxLoadThreads.of(10), WarmUpTimeInSeconds.of(10)); JLoadProfile load2 = JLoadProfileRps .of(RequestsPerSecond.of(20), MaxLoadThreads.of(20), WarmUpTimeInSeconds.of(20));</BUG> JTerminationCriteria termination = JTerminationCriteriaIterations
JLoadProfile load = JLoadProfileRps.builder(RequestsPerSecond.of(10)).withMaxLoadThreads(10).withWarmUpTimeInSeconds(10).build(); JLoadProfile load2 = JLoadProfileRps.builder(RequestsPerSecond.of(20)).withMaxLoadThreads(20).withWarmUpTimeInSeconds(20).build();
5,476
<BUG>package com.griddynamics.jagger; import static java.util.Collections.singletonList; import com.griddynamics.jagger.engine.e1.collector.NotNullResponseValidator;</BUG> import com.griddynamics.jagger.user.test.configurations.JLoadScenario; import com.griddynamics.jagger.user.test.configurations.JLoadTest;
package ${package};
5,477
static final int DEFAULT_TICK_INTERVAL = 1000; private final List<JLoadProfileUsers> userGroups; private int delayBetweenInvocationsInSeconds; private int tickInterval; private Builder(JLoadProfileUsers userGroup) { <BUG>Objects.nonNull(userGroup); </BUG> this.userGroups = singletonList(userGroup); this.tickInterval = DEFAULT_TICK_INTERVAL; }
Objects.requireNonNull(userGroup);
5,478
</BUG> this.userGroups = singletonList(userGroup); this.tickInterval = DEFAULT_TICK_INTERVAL; } public Builder(JLoadProfileUsers userGroup, JLoadProfileUsers... userGroups) { <BUG>Objects.nonNull(userGroup); </BUG> ArrayList<JLoadProfileUsers> groups = new ArrayList<>(); groups.add(userGroup); Collections.addAll(groups, userGroups);
static final int DEFAULT_TICK_INTERVAL = 1000; private final List<JLoadProfileUsers> userGroups; private int delayBetweenInvocationsInSeconds; private int tickInterval; private Builder(JLoadProfileUsers userGroup) { Objects.requireNonNull(userGroup); Objects.requireNonNull(userGroup);
5,479
context.setCurrentType(Boolean.TYPE); return result; } catch (NullPointerException e) { e.printStackTrace(); throw new UnsupportedCompilationException("evaluation resulted in null expression."); <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException)t; else throw new RuntimeException(t);</BUG> }
} catch (Throwable t) throw OgnlOps.castToRuntime(t);
5,480
context.setCurrentType(Boolean.TYPE); return result; } catch (NullPointerException e) { e.printStackTrace(); throw new UnsupportedCompilationException("evaluation resulted in null expression."); <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException)t; else throw new RuntimeException(t);</BUG> }
} catch (Throwable t) throw OgnlOps.castToRuntime(t);
5,481
result = pa.getSourceAccessor(context, context.getCurrentObject(), srcString); _getterClass = context.getCurrentType(); } } } <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException)t; else throw new RuntimeException(t);</BUG> }
} catch (Throwable t) throw OgnlOps.castToRuntime(t);
5,482
} _getterClass = context.getCurrentType(); } } } <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException)t; else throw new RuntimeException(t);</BUG> }
} catch (Throwable t) throw OgnlOps.castToRuntime(t); if (m != null) _getterClass = m.getReturnType(); context.setCurrentType(m.getReturnType()); context.setCurrentAccessor(OgnlRuntime.getCompiler().getSuperOrInterfaceClass(m, m.getDeclaringClass()));
5,483
result += ")"; context.setCurrentObject(target); context.setCurrentType(Object.class); } catch (NullPointerException e) { throw new UnsupportedCompilationException("evaluation resulted in null expression."); <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException)t; else throw new RuntimeException(t);</BUG> }
} catch (Throwable t) throw OgnlOps.castToRuntime(t);
5,484
result += "if(" + first + "){"; result += second; result += "; } "; context.setCurrentObject(target); context.setCurrentType(Object.class); <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException)t; else throw new RuntimeException(t);</BUG> }
} catch (Throwable t) throw OgnlOps.castToRuntime(t);
5,485
result += " : "; result += (mismatched ? " ($w) " : "") + second; result += ")"; context.setCurrentObject(target); context.setCurrentType(Boolean.TYPE); <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException) t; else throw new RuntimeException(t);</BUG> }
} catch (Throwable t) throw OgnlOps.castToRuntime(t);
5,486
result += first; result += " : "; result += second; context.setCurrentObject(target); context.setCurrentType(Boolean.TYPE); <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException) t; else throw new RuntimeException(t);</BUG> }
} catch (Throwable t) throw OgnlOps.castToRuntime(t);
5,487
} if (prevCast != null) { context.put(ExpressionCompiler.PRE_CAST, prevCast); } } <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException)t; else throw new RuntimeException(t);</BUG> }
result += parmString; } catch (Throwable t) throw OgnlOps.castToRuntime(t);
5,488
} else result += value; context.put("_currentChain", result); } } <BUG>} catch (Throwable t) { if (UnsupportedCompilationException.class.isInstance(t)) throw (UnsupportedCompilationException)t; else throw new RuntimeException(t);</BUG> }
} catch (Throwable t) throw OgnlOps.castToRuntime(t);
5,489
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); }
5,490
import java.net.URI; import java.util.Calendar; import java.util.Date; import java.util.Formatter; import java.util.List; <BUG>import javax.ws.rs.core.UriBuilder; import org.apache.commons.httpclient.URIException; import org.apache.commons.httpclient.util.URIUtil;</BUG> import org.suigeneris.jrcs.rcs.Version; import org.xwiki.rest.Relations;
[DELETED]
5,491
if (home != null) { space.setHome(home.getPrefixedFullName()); space.setXwikiRelativeUrl(home.getURL("view")); space.setXwikiAbsoluteUrl(home.getExternalURL("view")); } <BUG>String pagesUri = UriBuilder.fromUri(baseUri).path(PagesResource.class).build(wikiName, spaceName).toString(); </BUG> Link pagesLink = objectFactory.createLink(); pagesLink.setHref(pagesUri); pagesLink.setRel(Relations.PAGES);
String pagesUri = uri(baseUri, PagesResource.class, wikiName, spaceName);
5,492
Link pagesLink = objectFactory.createLink(); pagesLink.setHref(pagesUri); pagesLink.setRel(Relations.PAGES); space.getLinks().add(pagesLink); if (home != null) { <BUG>String homeUri = UriBuilder.fromUri(baseUri).path(PageResource.class).build(wikiName, spaceName, home.getName()) .toString();</BUG> Link homeLink = objectFactory.createLink();
String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());
5,493
.toString();</BUG> Link homeLink = objectFactory.createLink(); homeLink.setHref(homeUri); homeLink.setRel(Relations.HOME); space.getLinks().add(homeLink); <BUG>} String searchUri = UriBuilder.fromUri(baseUri).path(SpaceSearchResource.class).build(wikiName, spaceName).toString();</BUG> Link searchLink = objectFactory.createLink(); searchLink.setHref(searchUri);
Link pagesLink = objectFactory.createLink(); pagesLink.setHref(pagesUri); pagesLink.setRel(Relations.PAGES); space.getLinks().add(pagesLink); if (home != null) { String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName()); String searchUri = uri(baseUri, SpaceSearchResource.class, wikiName, spaceName);
5,494
if (!languages.isEmpty()) { if (!doc.getDefaultLanguage().equals("")) { translations.setDefault(doc.getDefaultLanguage()); Translation translation = objectFactory.createTranslation(); translation.setLanguage(doc.getDefaultLanguage()); <BUG>String pageTranslationUri = UriBuilder.fromUri(baseUri).path(PageResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG> Link pageTranslationLink = objectFactory.createLink(); pageTranslationLink.setHref(pageTranslationUri);
uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
5,495
} } for (String language : languages) { Translation translation = objectFactory.createTranslation(); translation.setLanguage(language); <BUG>String pageTranslationUri = UriBuilder.fromUri(baseUri).path(PageTranslationResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString();</BUG> Link pageTranslationLink = objectFactory.createLink(); pageTranslationLink.setHref(pageTranslationUri);
uri(baseUri, PageTranslationResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), language);
5,496
Link pageTranslationLink = objectFactory.createLink(); pageTranslationLink.setHref(pageTranslationUri); pageTranslationLink.setRel(Relations.PAGE); translation.getLinks().add(pageTranslationLink); String historyUri = <BUG>UriBuilder.fromUri(baseUri).path(PageTranslationHistoryResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString(); Link historyLink = objectFactory.createLink();</BUG> historyLink.setHref(historyUri); historyLink.setRel(Relations.HISTORY);
uri(baseUri, PageTranslationHistoryResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), language); Link historyLink = objectFactory.createLink();
5,497
pageSummary.setParent(doc.getParent()); if (parent != null && !parent.isNew()) { pageSummary.setParentId(parent.getPrefixedFullName()); } else { pageSummary.setParentId(""); <BUG>} String spaceUri = UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG> Link spaceLink = objectFactory.createLink(); spaceLink.setHref(spaceUri);
String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace());
5,498
UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG> Link spaceLink = objectFactory.createLink(); spaceLink.setHref(spaceUri); spaceLink.setRel(Relations.SPACE); pageSummary.getLinks().add(spaceLink); <BUG>if (parent != null) { String parentUri = UriBuilder.fromUri(baseUri).path(PageResource.class) .build(parent.getWiki(), parent.getSpace(), parent.getName()).toString();</BUG> Link parentLink = objectFactory.createLink();
pageSummary.setParent(doc.getParent()); if (parent != null && !parent.isNew()) { pageSummary.setParentId(parent.getPrefixedFullName()); } else { pageSummary.setParentId(""); } String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace()); String parentUri = uri(baseUri, PageResource.class, parent.getWiki(), parent.getSpace(), parent.getName());
5,499
Link historyLink = objectFactory.createLink(); historyLink.setHref(historyUri); historyLink.setRel(Relations.HISTORY); pageSummary.getLinks().add(historyLink); if (!doc.getChildren().isEmpty()) { <BUG>String pageChildrenUri = UriBuilder.fromUri(baseUri).path(PageChildrenResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG> Link pageChildrenLink = objectFactory.createLink(); pageChildrenLink.setHref(pageChildrenUri);
uri(baseUri, PageChildrenResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
5,500
objectsLink.setRel(Relations.OBJECTS); pageSummary.getLinks().add(objectsLink); } com.xpn.xwiki.api.Object tagsObject = doc.getObject("XWiki.TagClass", 0); if (tagsObject != null) { <BUG>if (tagsObject.getProperty("tags") != null) { String tagsUri = UriBuilder.fromUri(baseUri).path(PageTagsResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG> Link tagsLink = objectFactory.createLink();
String tagsUri = uri(baseUri, PageTagsResource.class, doc.getWiki(), doc.getSpace(), doc.getName());