id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
14,601
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (partSize < 5 * 1024 * 1024) {
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP); awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES))); awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT))); maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS)); partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE)); partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
14,602
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE); </BUG> if (purgeExistingMultipart) {
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
14,603
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backupFile; private boolean closed;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
14,604
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) != null) {
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
14,605
import org.drools.workbench.screens.guided.dtable.client.editor.menu.RadarMenuBuilder; import org.drools.workbench.screens.guided.dtable.client.editor.menu.ViewMenuBuilder; import org.drools.workbench.screens.guided.dtable.client.type.GuidedDTableResourceType; import org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableModellerView; import org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView; <BUG>import org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent; import org.drools.workbench.screens.guided.dtable.service.GuidedDecisionTableEditorService; import org.jboss.errai.common.client.api.Caller; import org.jboss.errai.ioc.client.container.SyncBeanManager;</BUG> import org.uberfire.backend.vfs.ObservablePath;
import org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent; import org.jboss.errai.common.client.api.RemoteCallback; import org.jboss.errai.ioc.client.container.SyncBeanManager;
14,606
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSystem {</BUG> private URI uri; private Path workingDir; private AmazonS3Client s3;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
14,607
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(ACCESS_KEY, null); String secretKey = conf.get(SECRET_KEY, null); </BUG> String userInfo = name.getUserInfo();
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
14,608
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
new BasicAWSCredentialsProvider(accessKey, secretKey), new AnonymousAWSCredentialsProvider()
14,609
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (partSize < 5 * 1024 * 1024) {
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP); awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES))); awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT))); maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS)); partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE)); partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
14,610
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE); </BUG> if (purgeExistingMultipart) {
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
14,611
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backupFile; private boolean closed;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
14,612
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) != null) {
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
14,613
} catch (JSONException ex) { logger.warn("Unable to process received message: " + payload, ex); //$NON-NLS-1$ return; } } <BUG>Set<String> topics = messageListeners.keySet(); for (String registeredTopic : topics) { String scrubbedTopic = registeredTopic.replaceAll("/#", ".*").replaceAll("#", ".*").replaceAll("\\\\+", ".+"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ boolean matches = false;</BUG> try {
logger.warn("ASDF topics set size: " + topics.size()); logger.warn("ASDF registeredTopic: " + registeredTopic); logger.warn("ASDF scrubbedTopic: " + scrubbedTopic); boolean matches = false;
14,614
messageListeners.put(topic, topicListeners); } topicListeners.add(messageListener); } public void stopReceiving(String topic, IMessageListener messageListener) { <BUG>if (logger.isDebugEnabled()) { logger.debug("Removed listener for messaging topic " + topic + " " + messageListener); //$NON-NLS-1$ //$NON-NLS-2$ }</BUG> Set<IMessageListener> topicListeners = messageListeners.get(topic);
logger.warn("Removed listener for messaging topic " + topic + " " + messageListener); //$NON-NLS-1$ //$NON-NLS-2$
14,615
import org.jitsi.impl.neomedia.device.*; import org.jitsi.service.resources.*; import org.osgi.framework.*; public class AudioDeviceConfigurationListener extends AbstractDeviceConfigurationListener <BUG>{ public AudioDeviceConfigurationListener(</BUG> ConfigurationForm configurationForm) { super(configurationForm);
private CaptureDeviceInfo captureDevice = null; private CaptureDeviceInfo playbackDevice = null; private CaptureDeviceInfo notificationDevice = null; public AudioDeviceConfigurationListener(
14,616
ResourceManagementService resources = NeomediaActivator.getResources(); notificationService.fireNotification( popUpEvent, title, <BUG>device.getName() + "\r\n" </BUG> + resources.getI18NString( "impl.media.configform"
body + "\r\n\r\n"
14,617
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
14,618
} @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);
14,619
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);
14,620
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(
14,621
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 {
14,622
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;
14,623
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) {
14,624
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;
14,625
public static void summarizeSortedMethodStatistics(final String path) { if (writer == null) initializeWriter(); writer// .col("Project", path)// <BUG>.col("Commands", statementsCoverage())// </BUG> .col("Expressions", expressionsCoverage())// .col("methodsCovered", fMethods())// .col("methodsTouched", touched())//
.col("Statements", statementsCoverage())//
14,626
public class SpartAnalyzer extends InteractiveSpartanizer { public SpartAnalyzer() { addNanoPatterns(); } private SpartAnalyzer addNanoPatterns() { <BUG>addMethodPatterns();// add(CatchClause.class, //</BUG> new SuppressException(), // null)// .add(CastExpression.class, //
addRejected(); add(CatchClause.class, //
14,627
new RemoveRedundantSwitchCases(), // new SwitchCaseLocalSort(), // null); return this; } <BUG>@SuppressWarnings("unused") private SpartAnalyzer addRejected() { add(CatchClause.class, //</BUG> new ReturnOnException(), // R.I.P new PercolateException(), // R.I.P null)//
public SpartAnalyzer addRejected() { add(CatchClause.class, //
14,628
public static yieldAncestors<MethodDeclaration> untilContainingMethod() { return new ByNodeClass<>(MethodDeclaration.class); } public static yieldAncestors<AbstractTypeDeclaration> untilContainingType() { return new ByNodeClass<>(AbstractTypeDeclaration.class); <BUG>} @SuppressWarnings({ "unchecked", "rawtypes" }) //</BUG> public static <N extends ASTNode> yieldAncestors untilNode(final N... ¢) { return new ByNodeInstances<>(as.list(¢)); }
public static yieldAncestors<Block> untilContainingBlock() { return new ByNodeClass<>(Block.class); @SuppressWarnings({ "unchecked", "rawtypes" }) //
14,629
package il.org.spartan.spartanizer.research.nanos.common; import static il.org.spartan.lisp.*; import java.util.*; import org.eclipse.jdt.core.dom.*; import org.eclipse.jdt.core.dom.rewrite.*; <BUG>import org.eclipse.text.edits.*; import il.org.spartan.spartanizer.dispatch.*;</BUG> import il.org.spartan.spartanizer.engine.*; import il.org.spartan.spartanizer.research.*; import il.org.spartan.spartanizer.tipping.*;
import il.org.spartan.spartanizer.ast.navigate.*; import il.org.spartan.spartanizer.dispatch.*;
14,630
return "Evaluate expression, if null- replace with default value"; } @Override public String technicalName() { return "IfX₁IsNullX₁ElseX₂"; } <BUG>@Override public String example() { return tippers.firstPattern(); } @Override public String symbolycReplacement() { return tippers.firstReplacement(); }</BUG> @Override public NanoPatternTipper.Category category() {
[DELETED]
14,631
@Override public boolean preVisit2(final ASTNode ¢) { if (iz.name(¢) && enviroment.containsKey(¢ + "")) $.set($.get().replaceFirst((¢ + "").replace("$", "\\$"), enviroment.get(¢ + "").replace("\\", "\\\\").replace("$", "\\$") + "")); return true; } <BUG>}); return extractStatementIfOne(ast($.get()));</BUG> } @SuppressWarnings("boxing") public ASTNode[] getMatchedNodes(final Block b) { final Pair<Integer, Integer> idxs = getBlockMatching(wrapStatementIfOne(pattern()), b);
} catch (@SuppressWarnings("unused") NullPointerException __) { throw new RuntimeException("Cannot parse [" + replacement + "]"); return extractStatementIfOne(ast($.get()));
14,632
import il.org.spartan.spartanizer.research.analyses.*; import il.org.spartan.spartanizer.research.util.*; import il.org.spartan.spartanizer.utils.*; import il.org.spartan.tables.*; public class Table_RawNanoStatistics extends FolderASTVisitor { <BUG>private static final SpartAnalyzer spartanalyzer = new SpartAnalyzer(); </BUG> private static Table pWriter; private static final NanoPatternsStatistics npStatistics = new NanoPatternsStatistics(); static {
private static final SpartAnalyzer spartanalyzer = new SpartAnalyzer().addRejected();
14,633
package com.opencms.core; import java.io.*; import java.net.*; import java.util.*; import java.util.zip.*; <BUG>import com.opencms.file.*; public class CmsClassLoader extends ClassLoader implements I_CmsLogChannels {</BUG> private static final boolean C_DEBUG = false; static private int generationCounter = 0; private int generation;
import java.lang.reflect.*; public class CmsClassLoader extends ClassLoader implements I_CmsLogChannels {
14,634
private static final boolean C_DEBUG = false; static private int generationCounter = 0; private int generation; private static Hashtable cache; private Vector repository; <BUG>private CmsObject m_cms; public static void clearCache() { if(A_OpenCms.isLogging()) { </BUG> A_OpenCms.log(C_OPENCMS_INFO, "[CmsClassLoader] clearing class instance cache.");
private Object m_cms; private Class m_cmsObjectClass; private Class m_cmsFileClass; private Method m_readFile; private Method m_getContent; if(C_DEBUG && A_OpenCms.isLogging()) {
14,635
} if (cache != null){ cache.clear(); } } <BUG>void init(CmsObject cms, Vector classRepository) throws IllegalArgumentException { if(classRepository == null) {</BUG> classRepository = new Vector(); }
public void init(Object cms, Vector classRepository) throws IllegalArgumentException { m_cms = cms; if(classRepository == null) {
14,636
JavaFileObject bindingSource = JavaFileObjects.forSourceString("test/Test_ViewBinding", "" + "// Generated code from Butter Knife. Do not modify!\n" + "package test;\n" + "import android.content.Context;\n" + "import android.content.res.Resources;\n" <BUG>+ "import android.graphics.BitmapFactory;\n" + "import android.view.View;\n"</BUG> + "import butterknife.Unbinder;\n" + "import java.lang.Deprecated;\n" + "import java.lang.IllegalStateException;\n"
+ "import android.support.annotation.UiThread;\n" + "import android.view.View;\n"
14,637
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,638
); JavaFileObject bindingSource = JavaFileObjects.forSourceString("test/Test_ViewBinding", "" + "// Generated code from Butter Knife. Do not modify!\n" + "package test;\n" + "import android.content.Context;\n" <BUG>+ "import android.content.res.Resources;\n" + "import android.view.View;\n"</BUG> + "import butterknife.Unbinder;\n" + "import butterknife.internal.Utils;\n" + "import java.lang.Deprecated;\n"
+ "import android.support.annotation.UiThread;\n" + "import android.view.View;\n"
14,639
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,640
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,641
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,642
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,643
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,644
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,645
); JavaFileObject bindingSource = JavaFileObjects.forSourceString("test/Test_ViewBinding", "" + "// Generated code from Butter Knife. Do not modify!\n" + "package test;\n" + "import android.content.Context;\n" <BUG>+ "import android.content.res.Resources;\n" + "import android.view.View;\n"</BUG> + "import butterknife.Unbinder;\n" + "import butterknife.internal.Utils;\n" + "import java.lang.Deprecated;\n"
+ "import android.support.annotation.UiThread;\n" + "import android.view.View;\n"
14,646
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,647
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,648
); JavaFileObject bindingSource = JavaFileObjects.forSourceString("test/Test_ViewBinding", "" + "// Generated code from Butter Knife. Do not modify!\n" + "package test;\n" + "import android.content.Context;\n" <BUG>+ "import android.content.res.Resources;\n" + "import android.view.View;\n"</BUG> + "import butterknife.Unbinder;\n" + "import java.lang.Deprecated;\n" + "import java.lang.IllegalStateException;\n"
+ "import android.support.annotation.UiThread;\n" + "import android.view.View;\n"
14,649
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,650
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,651
final class BindingClass { private static final ClassName UTILS = ClassName.get("butterknife.internal", "Utils"); private static final ClassName VIEW = ClassName.get("android.view", "View"); private static final ClassName CONTEXT = ClassName.get("android.content", "Context"); private static final ClassName RESOURCES = ClassName.get("android.content.res", "Resources"); <BUG>private static final ClassName THEME = RESOURCES.nestedClass("Theme"); private static final ClassName UNBINDER = ClassName.get("butterknife", "Unbinder");</BUG> private static final ClassName BITMAP_FACTORY = ClassName.get("android.graphics", "BitmapFactory"); private final Map<Id, ViewBindings> viewIdMap = new LinkedHashMap<>();
private static final ClassName UI_THREAD = ClassName.get("android.support.annotation", "UiThread"); private static final ClassName UNBINDER = ClassName.get("butterknife", "Unbinder");
14,652
private MethodSpec createBindingViewDelegateConstructor(TypeName targetType) { return MethodSpec.constructorBuilder() .addJavadoc("@deprecated Use {@link #$T($T, $T)} for direct creation.\n " + "Only present for runtime invocation through {@code ButterKnife.bind()}.\n", bindingClassName, targetType, CONTEXT) <BUG>.addAnnotation(Deprecated.class) .addModifiers(PUBLIC)</BUG> .addParameter(targetType, "target") .addParameter(VIEW, "source") .addStatement(("this(target, source.getContext())"))
.addAnnotation(UI_THREAD) .addModifiers(PUBLIC)
14,653
.addParameter(VIEW, "source") .addStatement(("this(target, source.getContext())")) .build(); } private MethodSpec createBindingConstructor(TypeName targetType) { <BUG>MethodSpec.Builder constructor = MethodSpec.constructorBuilder() .addModifiers(PUBLIC);</BUG> if (hasMethodBindings()) { constructor.addParameter(targetType, "target", FINAL); } else {
.addAnnotation(UI_THREAD) .addModifiers(PUBLIC);
14,654
); JavaFileObject bindingSource = JavaFileObjects.forSourceString("test/Test_ViewBinding", "" + "// Generated code from Butter Knife. Do not modify!\n" + "package test;\n" + "import android.content.Context;\n" <BUG>+ "import android.content.res.Resources;\n" + "import android.view.View;\n"</BUG> + "import butterknife.Unbinder;\n" + "import java.lang.Deprecated;\n" + "import java.lang.IllegalStateException;\n"
+ "import android.support.annotation.UiThread;\n" + "import android.view.View;\n"
14,655
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,656
); JavaFileObject bindingSource = JavaFileObjects.forSourceString("test/Test_ViewBinding", "" + "// Generated code from Butter Knife. Do not modify!\n" + "package test;\n" + "import android.content.Context;\n" <BUG>+ "import android.content.res.Resources;\n" + "import android.view.View;\n"</BUG> + "import butterknife.Unbinder;\n" + "import butterknife.internal.Utils;\n" + "import java.lang.Deprecated;\n"
+ "import android.support.annotation.UiThread;\n" + "import android.view.View;\n"
14,657
+ " if (this.target == null) throw new IllegalStateException(\"Bindings already cleared.\");\n" + " this.target = null;\n" + " }\n" + "}" ); <BUG>assertAbout(javaSource()).that(source) .processedWith(new ButterKnifeProcessor())</BUG> .compilesWithoutWarnings() .and() .generatesSources(bindingSource);
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
14,658
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
14,659
} @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);
14,660
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);
14,661
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(
14,662
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 {
14,663
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;
14,664
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) {
14,665
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;
14,666
System.out.println(change); } } }; @Override <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { return (child) -> {
protected Callback<VChild, Void> copyIntoCallback()
14,667
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
14,668
VEVENT ("VEVENT", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_END, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, PropertyType.EXCEPTION_DATE_TIMES, <BUG>PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,</BUG> PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS, PropertyType.SUMMARY, PropertyType.TIME_TRANSPARENCY, PropertyType.UNIQUE_IDENTIFIER,
PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,
14,669
VTODO ("VTODO", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_COMPLETED, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_DUE, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, <BUG>PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,</BUG> PropertyType.PERCENT_COMPLETE, PropertyType.PRIORITY, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS,
PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,
14,670
throw new RuntimeException("not implemented"); } }, DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, <BUG>PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,</BUG> PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class) {
PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,
14,671
throw new RuntimeException("not implemented"); } }, VALARM ("VALARM", Arrays.asList(PropertyType.ACTION, PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.DESCRIPTION, <BUG>PropertyType.DURATION, PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.REPEAT_COUNT, PropertyType.SUMMARY, PropertyType.TRIGGER),</BUG> VAlarm.class) { @Override
DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM, PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class)
14,672
private ContentLineStrategy contentLineGenerator; protected void setContentLineGenerator(ContentLineStrategy contentLineGenerator) { this.contentLineGenerator = contentLineGenerator; } <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { throw new RuntimeException("Can't copy children. copyChildCallback isn't overridden in subclass." + this.getClass()); };
protected Callback<VChild, Void> copyIntoCallback()
14,673
import jfxtras.labs.icalendarfx.properties.calendar.Version; import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty; public enum CalendarProperty { CALENDAR_SCALE ("CALSCALE", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), CalendarScale.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), CalendarScale.class)
14,674
CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); } }, METHOD ("METHOD", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Method.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
14,675
} list.add(new NonStandardProperty((NonStandardProperty) child)); } }, PRODUCT_IDENTIFIER ("PRODID", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), ProductIdentifier.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
public void copyChild(VChild child, VCalendar destination) CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); METHOD ("METHOD", Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
14,676
ProductIdentifier productIdentifier = (ProductIdentifier) child; destination.setProductIdentifier(productIdentifier); } }, VERSION ("VERSION", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Version.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Version.class)
14,677
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
14,678
ClassNode resultType = getResultType(lType, op, rType, expression); if (resultType == null) { addStaticTypeError("tbd...", expression); resultType = lType; } <BUG>storeType(expression, resultType); if (isAssignment(op)) { typeCheckAssignment(expression, leftExpression, lType, rightExpression, resultType);</BUG> storeType(leftExpression, resultType); if (leftExpression instanceof VariableExpression && rightExpression instanceof ClosureExpression) {
boolean isEmptyDeclaration = expression instanceof DeclarationExpression && rightExpression instanceof EmptyExpression; if (!isEmptyDeclaration) storeType(expression, resultType); if (!isEmptyDeclaration && isAssignment(op)) { typeCheckAssignment(expression, leftExpression, lType, rightExpression, resultType);
14,679
public static final int[] fromSparseString(String s) { return toIntArray(s.split(",")); } public static final int[] toIntArray(Instance x, int L) { int y[] = new int[L]; <BUG>for(int j = 0; j < L; j++) { y[j] = (int)Math.round(x.value(j)); }</BUG> return y; }
if(x.isMissing(j)){ y[j] = -1; } else{
14,680
CHEVRON_RIGHT ("chevron-right", "png", false, false), CHEVRON_LEFT ("chevron-left", "png", false, false), SEARCH ("search", "png", false, false), CONTROL_SLIDER_BALL ("control-sliderball", "png", false, false), CONTROL_CHECK_ON ("control-check-on", "png", false, false), <BUG>CONTROL_CHECK_OFF ("control-check-off", "png", false, false), ALPHA_MAP ("alpha", "png", false, false);</BUG> private static final byte IMG_PNG = 1, IMG_JPG = 2;
USER ("user", "user%d", "png", false, false), ALPHA_MAP ("alpha", "png", false, false);
14,681
GameImage(String filename, String type, boolean beatmapSkinnable, boolean preload) { this.filename = filename; this.type = getType(type); this.beatmapSkinnable = beatmapSkinnable; this.preload = preload; <BUG>} public boolean isBeatmapSkinnable() { return beatmapSkinnable; }</BUG> public boolean isPreload() { return preload; } public Image getImage() { setDefaultImage();
GameImage(String filename, String filenameFormat, String type, boolean beatmapSkinnable, boolean preload) { this(filename, type, beatmapSkinnable, preload); this.filenameFormat = filenameFormat; public boolean isBeatmapSkinnable() { return beatmapSkinnable; }
14,682
g.drawRect(0, yPos, rectWidth, rectHeight); g.setLineWidth(oldLineWidth); data.drawSymbolString(rankString, rectWidth, yPos, 1.0f, alpha * 0.2f, true); white.a = blue.a = alpha * 0.75f; if (playerName != null) <BUG>Fonts.MEDIUMBOLD.drawString(xPaddingLeft, yPos + yPadding, playerName, white); Fonts.DEFAULT.drawString(</BUG> xPaddingLeft, yPos + rectHeight - Fonts.DEFAULT.getLineHeight() - yPadding, scoreString, white ); Fonts.DEFAULT.drawString(
Fonts.MEDIUM.drawString(xPaddingLeft, yPos + yPadding, playerName, white);
14,683
int objectCount = hit300 + hit100 + hit50 + miss; if (objectCount > 0) percent = (hit300 * 300 + hit100 * 100 + hit50 * 50) / (objectCount * 300f) * 100f; return percent; } <BUG>private float getScorePercent() { </BUG> return getScorePercent( hitResultCount[HIT_300], hitResultCount[HIT_100], hitResultCount[HIT_50], hitResultCount[HIT_MISS]
public float getScorePercent() {
14,684
sd.score = slidingScore ? scoreDisplay : score; sd.combo = comboMax; sd.perfect = (comboMax == fullObjectCount); sd.mods = GameMod.getModState(); sd.replayString = (replay == null) ? null : replay.getReplayFilename(); <BUG>sd.playerName = null; // TODO return sd;</BUG> } public Replay getReplay(ReplayFrame[] frames, Beatmap beatmap) { if (replay != null && frames == null)
sd.playerName = GameMod.AUTO.isActive() ? UserList.AUTO_USER_NAME : UserList.get().getCurrentUser().getName(); return sd;
14,685
return null; replay = new Replay(); replay.mode = Beatmap.MODE_OSU; replay.version = Updater.get().getBuildDate(); replay.beatmapHash = (beatmap == null) ? "" : beatmap.md5Hash; <BUG>replay.playerName = ""; // TODO replay.replayHash = Long.toString(System.currentTimeMillis()); // TODO</BUG> replay.hit300 = (short) hitResultCount[HIT_300]; replay.hit100 = (short) hitResultCount[HIT_100]; replay.hit50 = (short) hitResultCount[HIT_50];
replay.playerName = UserList.get().getCurrentUser().getName(); replay.replayHash = Long.toString(System.currentTimeMillis()); // TODO
14,686
import itdelatrisu.opsu.downloads.Download; import itdelatrisu.opsu.downloads.DownloadNode; import itdelatrisu.opsu.replay.PlaybackSpeed; import itdelatrisu.opsu.ui.Colors; import itdelatrisu.opsu.ui.Fonts; <BUG>import itdelatrisu.opsu.ui.UI; import java.awt.image.BufferedImage;</BUG> import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.File;
import itdelatrisu.opsu.user.UserButton; import itdelatrisu.opsu.user.UserList; import java.awt.image.BufferedImage;
14,687
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]
14,688
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);
14,689
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());
14,690
.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);
14,691
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());
14,692
} } 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);
14,693
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();
14,694
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());
14,695
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());
14,696
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());
14,697
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());
14,698
tagsLink.setHref(tagsUri); tagsLink.setRel(Relations.TAGS); pageSummary.getLinks().add(tagsLink); } } <BUG>String syntaxesUri = UriBuilder.fromUri(baseUri).path(SyntaxesResource.class).build().toString(); Link syntaxesLink = objectFactory.createLink();</BUG> syntaxesLink.setHref(syntaxesUri); syntaxesLink.setRel(Relations.SYNTAXES); pageSummary.getLinks().add(syntaxesLink);
String syntaxesUri = uri(baseUri, SyntaxesResource.class); Link syntaxesLink = objectFactory.createLink();
14,699
} return historySummary; } private static void fillAttachment(Attachment attachment, ObjectFactory objectFactory, URI baseUri, <BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, Boolean withPrettyNames) {</BUG> Document doc = xwikiAttachment.getDocument(); attachment.setId(String.format("%s@%s", doc.getPrefixedFullName(), xwikiAttachment.getFilename()));
com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, {
14,700
Calendar calendar = Calendar.getInstance(); calendar.setTime(xwikiAttachment.getDate()); attachment.setDate(calendar); attachment.setXwikiRelativeUrl(xwikiRelativeUrl); attachment.setXwikiAbsoluteUrl(xwikiAbsoluteUrl); <BUG>String pageUri = UriBuilder.fromUri(baseUri).path(PageResource.class).build(doc.getWiki(), doc.getSpace(), doc.getName()) .toString();</BUG> Link pageLink = objectFactory.createLink();
String pageUri = uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());