id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
18,801
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,802
weightVert &= (0x0F - (1 << h)); } sumArray[h] = tempSum; } if (weight == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } else { double[] tempData = bicubicInpaintingDouble(sumArray, weightVert, emptyArray);
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,803
sum = 0; } } } else if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } } if (fracx < fracdx1) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,804
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,805
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,806
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,807
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,808
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,809
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (!roiBounds.contains(x0, y0)) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,810
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,811
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataFloat[k2];
18,812
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,813
final int posyROI = (s_iy - srcRectY) * roiScanlineStride; final int baseIndex = (posx / dst_num_bands) + posyROI; if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,814
: 0); } } } if (tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,815
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,816
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,817
int x0 = src.getX() + posx / srcPixelStride; int y0 = src.getY() + posy / srcScanlineStride; if (!roiBounds.contains(x0, y0)) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,818
pixelKernel[h][z] = srcDataArrays[k2][pos + (z - 1) tmpROI += roiIter.getSample(x0 + h - 1, y0 + z - 1, 0) & 0xff; } } if (tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,819
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,820
weightVert &= (0x0F - (1 << h)); } sumArray[h] = tempSum; } if (weight == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { double[] tempData = bicubicInpaintingDouble(sumArray, weightVert, emptyArray);
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,821
sum = 0; } } } else if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } if (fracx < fracdx1) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,822
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,823
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,824
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,825
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,826
s_ix = startPts[0].x; s_iy = startPts[0].y; if (setDestinationNoData) { for (int x = dst_min_x; x < clipMinX; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } } else
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,827
final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy); final int pos = posx + posy; if (!roiBounds.contains(x0, y0)) { if (setDestinationNoData) { for (int k2 = 0; k2 < dst_num_bands; k2++) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } } } else {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,828
weight &= (0xffff - (1 << 4 * h + z)); } } } if (weight == 0 || tmpROI == 0) { <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> } else { for (int h = 0; h < KERNEL_LINE_DIM; h++) { double tempSum = 0;
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,829
dstPixelOffset += dstPixelStride; } if (setDestinationNoData && clipMinX <= clipMaxX) { for (int x = clipMaxX; x < dst_max_x; x++) { for (int k2 = 0; k2 < dst_num_bands; k2++) <BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble; </BUG> dstPixelOffset += dstPixelStride; } }
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
18,830
private static Function<WebPage, Tuple2<String, Long>> mapFunc = new Function<WebPage, Tuple2<String, Long>>() { @Override public Tuple2<String, Long> call(WebPage webPage) throws Exception { <BUG>String content = new String(webPage.getContent().array()); </BUG> return new Tuple2<>(content, 1L); } };
String content = new String(webPage.getContent().array(), Charset.defaultCharset());
18,831
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 {
18,832
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));
18,833
} 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()
18,834
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));
18,835
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));
18,836
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 {
18,837
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);
18,838
private LocalBroadcastManager mLocalBroadcastManager; private String mActiveDownloadUrlString; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <BUG>setContentView(R.layout.activity_app_details2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);</BUG> toolbar.setTitle(""); // Nice and clean toolbar setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.app_details2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
18,839
.inflate(R.layout.app_details2_screenshots, parent, false); return new ScreenShotsViewHolder(view); } else if (viewType == VIEWTYPE_WHATS_NEW) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.app_details2_whatsnew, parent, false); <BUG>return new WhatsNewViewHolder(view); } else if (viewType == VIEWTYPE_LINKS) {</BUG> View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.app_details2_links, parent, false); return new ExpandableLinearLayoutViewHolder(view);
} else if (viewType == VIEWTYPE_DONATE) { .inflate(R.layout.app_details2_donate, parent, false); return new DonateViewHolder(view); } else if (viewType == VIEWTYPE_LINKS) {
18,840
import hudson.model.Node; import hudson.slaves.Cloud; import hudson.util.FormValidation; import hudson.util.ListBoxModel; import java.text.MessageFormat; <BUG>import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID;</BUG> import java.util.logging.Level;
import java.util.*;
18,841
if(anyOfThemIsBlank(cloud, workspace)) { </BUG> return boxes; } <BUG>final DeployBoxOrderResult<List<AbstractBox>> result = new DeployBoxOrderServiceImpl(ClientCache.getClient(cloud)).updateableBoxes(workspace); for (AbstractBox box : result.getResult()) { boxes.add(box.getName(), box.getId()); } return boxes; }</BUG> public ListBoxModel doFillBoxDeploymentTypeItems(@QueryParameter String cloud, @QueryParameter String workspace, @QueryParameter String box) {
final List<AbstractWorkspace> workspaces = result.getResult(); for (AbstractWorkspace workspace : workspaces) { workspaceOptions.add(workspace.getName(), workspace.getId()); return workspaceOptions; } catch (ServiceException e) { return workspaceOptions; public ListBoxModel doFillBoxItems(@QueryParameter String cloud, @QueryParameter String workspace) { ListBoxModel boxes = DescriptorHelper.getEmptyListBoxModel(Constants.CHOOSE_BOX_MESSAGE, ""); if(DescriptorHelper.anyOfThemIsBlank(cloud, workspace)) {
18,842
ListBoxModel profiles = getEmptyListBoxModel("--Please choose policy box--", ""); if (anyOfThemIsBlank(cloud, workspace, box)) { </BUG> return profiles; } <BUG>final DeployBoxOrderResult<List<PolicyBox>> result = new DeployBoxOrderServiceImpl(ClientCache.getClient(cloud)).deploymentPolicies(workspace, box); final List<PolicyBox> policyBoxList = result.getResult(); for (PolicyBox policyBox : policyBoxList) { </BUG> profiles.add(policyBox.getName(), policyBox.getId());
boxDeploymentType.add(new ListBoxModel.Option(id,id,true)); return boxDeploymentType; } catch (ServiceException e) { return boxDeploymentType;
18,843
import org.openoffice.plugin.core.model.UnoPackage; public class JavaBuilder implements ILanguageBuilder { private Language mLanguage; public JavaBuilder(Language pLanguage) { mLanguage = pLanguage; <BUG>} public IFile createLibrary(IUnoidlProject pUnoProject) throws Exception {</BUG> IFile jarFile = ((JavaProjectHandler)mLanguage.getProjectHandler()).getJarFile(pUnoProject); JarPackageData description = new JarPackageData(); description.setGenerateManifest( true );
@Override public IFile createLibrary(IUnoidlProject pUnoProject) throws Exception {
18,844
buildDir.accept( visitor ); description.setElements( visitor.getFiles() ); IJarExportRunnable runnable = description.createJarExportRunnable( null ); runnable.run( new NullProgressMonitor() ); return jarFile; <BUG>} public void generateFromTypes(ISdk pSdk, IOOo pOoo, IProject pPrj, File pTypesFile,</BUG> File pBuildFolder, String pRootModule, IProgressMonitor pMonitor) { if (pTypesFile.exists()) { if (null != pSdk && null != pOoo) {
@Override public void generateFromTypes(ISdk pSdk, IOOo pOoo, IProject pPrj, File pTypesFile,
18,845
ISdk pSdk, IProject pPrj, File pTypesFile, File pBuildFolder, IProgressMonitor pMonitor) { StringBuffer errBuf = new StringBuffer(); try { String bflag = new String(); <BUG>if (!prefix.isEmpty()) bflag = "-B" + prefix; //$NON-NLS-1$ String cmdPattern = "javamaker -T {0}.* -nD -Gc {1} -O \"{2}\" \"{3}\" {4}"; //$NON-NLS-1$</BUG> String command = MessageFormat.format(cmdPattern, firstModule, bflag, pBuildFolder.getAbsolutePath(),
} String cmdPattern = "javamaker -T {0}.* -nD -Gc {1} -O \"{2}\" \"{3}\" {4}"; //$NON-NLS-1$
18,846
} catch (IOException e) { PluginLogger.warning( Messages.getString("Language.UnreadableOutputError")); //$NON-NLS-1$ } return errBuf.toString(); <BUG>} public String[] getBuildEnv(IUnoidlProject pUnoProject) {</BUG> IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(pUnoProject.getName()); String[] env = new String[2]; String classpath = "CLASSPATH="; //$NON-NLS-1$
@Override public String[] getBuildEnv(IUnoidlProject pUnoProject) {
18,847
String property = ""; try { final String sProviderService = "com.sun.star.configuration.ConfigurationProvider"; Object configProvider = connection.getRemoteServiceManager().createInstanceWithContext( sProviderService, connection.getComponentContext()); <BUG>XMultiServiceFactory xConfigProvider = (XMultiServiceFactory) UnoRuntime.queryInterface( com.sun.star.lang.XMultiServiceFactory.class, configProvider);</BUG> final String sReadOnlyView = "com.sun.star.configuration.ConfigurationAccess"; PropertyValue aPathArgument = new PropertyValue(); aPathArgument.Name = "nodepath";
XMultiServiceFactory xConfigProvider = UnoRuntime.queryInterface( com.sun.star.lang.XMultiServiceFactory.class, configProvider);
18,848
aPathArgument.Value = nodePath; Object[] aArguments = new Object[1]; aArguments[0] = aPathArgument; XInterface xElement = (XInterface) xConfigProvider.createInstanceWithArguments(sReadOnlyView, aArguments); XNameAccess xChildAccess = <BUG>(XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xElement); property = (String) xChildAccess.getByName(node);</BUG> } catch (Exception exception){ throw new OpenOfficeException("Could not retrieve property", exception); }
property = (String) xChildAccess.getByName(node);
18,849
GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.getTextureManager().bindTexture(textures); for (Iterator<BuffBase> iterator = buffs.iterator(); iterator.hasNext(); offset = increment) { <BUG>BuffBase buff = iterator.next(); int index = buff.getIconIndex();</BUG> xPos += (Config.isBuffBarHorizontal ? offset : 0); yPos += (Config.isBuffBarHorizontal ? 0 : offset); drawTexturedModalRect(xPos, yPos, index % ICONS_PER_ROW * ICON_SIZE,
if (!buff.getBuff().hasIcon()) { continue; } int index = buff.getIconIndex();
18,850
import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; <BUG>import zeldaswordskills.client.RenderHelperQ; import zeldaswordskills.entity.player.ZSSPlayerInfo;</BUG> import zeldaswordskills.ref.Config; import zeldaswordskills.ref.ModInfo; import cpw.mods.fml.relauncher.Side;
import zeldaswordskills.entity.ZSSEntityInfo; import zeldaswordskills.entity.buff.Buff; import zeldaswordskills.entity.player.ZSSPlayerInfo;
18,851
int width = MathHelper.clamp_int(MathHelper.floor_float((maxMana / 50) * INCREMENT), MathHelper.floor_float(INCREMENT), MAX_WIDTH); int current = MathHelper.floor_float((info.getCurrentMagic() / maxMana) * width); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_ALPHA_TEST); <BUG>GL11.glEnable(GL11.GL_BLEND); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int xPos = (Config.isMagicMeterCenteredX ? resolution.getScaledWidth() / 2 : Config.isMagicMeterLeft ? 0 : resolution.getScaledWidth()) + Config.magicMeterOffsetX;</BUG> int yPos = (Config.isMagicMeterTop ? 0 : resolution.getScaledHeight()) + Config.magicMeterOffsetY; if (Config.isMagicMeterEnabled) {
if (unlimited) { GL11.glColor4f(0.5F, 0.5F, 1.0F, 1.0F); } else { } int xPos = (Config.isMagicMeterCenteredX ? resolution.getScaledWidth() / 2 : Config.isMagicMeterLeft ? 0 : resolution.getScaledWidth()) + Config.magicMeterOffsetX;
18,852
import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.IExtendedEntityProperties; import net.minecraftforge.common.util.Constants; import org.apache.commons.lang3.ArrayUtils; <BUG>import zeldaswordskills.api.item.ArmorIndex; import zeldaswordskills.entity.player.quests.ZSSQuests;</BUG> import zeldaswordskills.handler.ZSSCombatEvents; import zeldaswordskills.item.ItemArmorBoots; import zeldaswordskills.item.ItemHeroBow;
import zeldaswordskills.entity.ZSSEntityInfo; import zeldaswordskills.entity.buff.Buff; import zeldaswordskills.entity.player.quests.ZSSQuests;
18,853
WEAKNESS_HOLY("buff.zss.weakness_holy", true, 7), WEAKNESS_MAGIC("buff.zss.weakness_magic", true, 4), WEAKNESS_SHOCK("buff.zss.weakness_shock", true, 5), WEAKNESS_STUN("buff.zss.weakness_stun", true, 6), RESIST_QUAKE("buff.zss.resist_quake", false, 11), <BUG>WEAKNESS_QUAKE("buff.zss.weakness_quake", true, 11); public final String unlocalizedName;</BUG> public final boolean isDebuff; public final boolean displayArrow;
WEAKNESS_QUAKE("buff.zss.weakness_quake", true, 11), UNLIMITED_MAGIC("buff.zss.unlimited_magic", false, false, -1, true); public final String unlocalizedName;
18,854
this.displayArrow = displayArrow; this.iconIndex = index; this.syncNonPlayerEntity = syncNonPlayerEntity; } public String getName() { <BUG>return StatCollector.translateToLocal(unlocalizedName + ".name"); }</BUG> public void onAdded(EntityLivingBase entity, int amplifier) { switch(this) { case STUN:
public boolean hasIcon() { return this.iconIndex >= 0;
18,855
import org.geogebra.common.kernel.arithmetic.NumberValue; import org.geogebra.common.kernel.geos.GeoElement;</BUG> import org.geogebra.common.kernel.geos.GeoList; import org.geogebra.desktop.main.AppD; <BUG>public class ANOVATable extends BasicStatTable implements StatTableListener { private static final long serialVersionUID = 1L;</BUG> public ANOVATable(AppD app, DataAnalysisViewD statDialog) { super(app, statDialog, false); setModel(new ANOVAStatTableModel(app, this)); this.setMinimumSize(this.getPreferredSize());
package org.geogebra.desktop.gui.view.data; import javax.swing.table.DefaultTableModel; import org.geogebra.common.gui.view.data.ANOVAStatTableModel; import org.geogebra.common.gui.view.data.ANOVAStatTableModel.AnovaStats; public class ANOVATable extends BasicStatTable { private static final long serialVersionUID = 1L;
18,856
statTable.setValueAt(daView.format(stats.getSst()), 2, 2); statTable.setValueAt(daView.format(stats.getMsbg()), 0, 3); statTable.setValueAt(daView.format(stats.getMswg()), 1, 3); statTable.setValueAt(daView.format(stats.getF()), 0, 4); statTable.setValueAt(daView.format(stats.getP()), 0, 5); <BUG>} catch (IllegalArgumentException e) { e.printStackTrace(); } catch (MathException e) { e.printStackTrace();</BUG> }
[DELETED]
18,857
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]
18,858
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);
18,859
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());
18,860
.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);
18,861
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());
18,862
} } 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);
18,863
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();
18,864
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());
18,865
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());
18,866
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());
18,867
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());
18,868
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();
18,869
} 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, {
18,870
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());
18,871
} return attachmentUri; }</BUG> public static Attachment createAttachment(ObjectFactory objectFactory, URI baseUri, <BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, Boolean withPrettyNames) {</BUG> Attachment attachment = objectFactory.createAttachment(); fillAttachment(attachment, objectFactory, baseUri, xwikiAttachment, xwikiRelativeUrl, xwikiAbsoluteUrl,
com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, {
18,872
attachmentLink.setRel(Relations.ATTACHMENT_DATA); attachment.getLinks().add(attachmentLink); return attachment; } public static Attachment createAttachmentAtVersion(ObjectFactory objectFactory, URI baseUri, <BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, Boolean withPrettyNames) {</BUG> Attachment attachment = new Attachment();
com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi, {
18,873
.build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber()).toString();</BUG> } else { <BUG>propertiesUri = UriBuilder .fromUri(baseUri) .path(ObjectPropertiesResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber()).toString();</BUG> }
fillObjectSummary(objectSummary, objectFactory, baseUri, doc, xwikiObject, xwikiApi, withPrettyNames); Link objectLink = getObjectLink(objectFactory, baseUri, doc, xwikiObject, useVersion, Relations.OBJECT); objectSummary.getLinks().add(objectLink); String propertiesUri; if (useVersion) { uri(baseUri, ObjectPropertiesAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber()); uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber());
18,874
.build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName()) .toString();</BUG> } else { <BUG>propertyUri = UriBuilder .fromUri(baseUri) .path(ObjectPropertyResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName()).toString();</BUG> }
propertiesUri = uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber());
18,875
.build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber()).toString();</BUG> } else { <BUG>objectUri = UriBuilder .fromUri(baseUri) .path(ObjectResource.class) .build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber()).toString();</BUG> }
private static Link getObjectLink(ObjectFactory objectFactory, URI baseUri, Document doc, BaseObject xwikiObject, boolean useVersion, String relation) String objectUri; if (useVersion) { uri(baseUri, ObjectAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber()); uri(baseUri, ObjectResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(), xwikiObject.getNumber());
18,876
Link propertyLink = objectFactory.createLink(); propertyLink.setHref(propertyUri); propertyLink.setRel(Relations.SELF); property.getLinks().add(propertyLink); clazz.getProperties().add(property); <BUG>} String classUri = UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toString();</BUG> Link classLink = objectFactory.createLink(); classLink.setHref(classUri);
String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName());
18,877
String classUri = UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toString();</BUG> Link classLink = objectFactory.createLink(); classLink.setHref(classUri); classLink.setRel(Relations.SELF); <BUG>clazz.getLinks().add(classLink); String propertiesUri = UriBuilder.fromUri(baseUri).path(ClassPropertiesResource.class).build(wikiName, xwikiClass.getName()) .toString();</BUG> Link propertyLink = objectFactory.createLink();
propertyLink.setHref(propertyUri); propertyLink.setRel(Relations.SELF); property.getLinks().add(propertyLink); clazz.getProperties().add(property); } String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName()); String propertiesUri = uri(baseUri, ClassPropertiesResource.class, wikiName, xwikiClass.getName());
18,878
<BUG>package org.xwiki.rest.internal; import org.apache.commons.lang3.StringUtils;</BUG> import org.xwiki.component.manager.ComponentManager; import org.xwiki.context.Execution; import org.xwiki.model.reference.EntityReferenceSerializer;
import java.net.URI; import javax.ws.rs.core.UriBuilder; import org.apache.commons.httpclient.URIException; import org.apache.commons.httpclient.util.URIUtil; import org.apache.commons.lang3.StringUtils;
18,879
return this == NORMAL || this == INVALID; } } private final Type type; private final VcsDirectoryMapping mapping; <BUG>MapInfo(@NotNull VcsDirectoryMapping mapping, boolean valid) { this(mapping, valid ? Type.NORMAL : Type.INVALID); } MapInfo(@NotNull String path, @NotNull String vcs) { this(new VcsDirectoryMapping(path, vcs), Type.UNREGISTERED); } MapInfo(@NotNull VcsDirectoryMapping mapping, @NotNull Type type) { </BUG> this.mapping = mapping;
private MapInfo(@NotNull VcsDirectoryMapping mapping, @NotNull Type type) {
18,880
addMapping(mapping); } } private void addMapping(VcsDirectoryMapping mapping) { List<MapInfo> items = new ArrayList<MapInfo>(myModel.getItems()); <BUG>items.add(new MapInfo(new VcsDirectoryMapping(mapping.getDirectory(), mapping.getVcs(), mapping.getRootSettings()), isMappingValid(mapping))); Collections.sort(items, MapInfo.COMPARATOR);</BUG> myModel.setItems(items); checkNotifyListeners(getActiveVcses());
items.add(MapInfo.registered(new VcsDirectoryMapping(mapping.getDirectory(), mapping.getVcs(), mapping.getRootSettings()), Collections.sort(items, MapInfo.COMPARATOR);
18,881
} private void addSelectedUnregisteredMappings(List<MapInfo> infos) { List<MapInfo> items = new ArrayList<MapInfo>(myModel.getItems()); for (MapInfo info : infos) { items.remove(info); <BUG>items.add(new MapInfo(new VcsDirectoryMapping(info.mapping.getDirectory(), info.mapping.getVcs(), info.mapping.getRootSettings()), isMappingValid(info.mapping))); } addOrRemoveSeparator(items); Collections.sort(items, MapInfo.COMPARATOR);</BUG> myModel.setItems(items);
private void addMapping(VcsDirectoryMapping mapping) { items.add(MapInfo.registered(new VcsDirectoryMapping(mapping.getDirectory(), mapping.getVcs(), mapping.getRootSettings()), isMappingValid(mapping))); Collections.sort(items, MapInfo.COMPARATOR);
18,882
if (!hasUnregistered && hasSeparator) { items.remove(MapInfo.SEPARATOR); } else if (hasUnregistered && !hasSeparator) { items.add(MapInfo.SEPARATOR); <BUG>} }</BUG> private void editMapping() { Collection<AbstractVcs> activeVcses = getActiveVcses(); VcsMappingConfigurationDialog dlg = new VcsMappingConfigurationDialog(myProject, VcsBundle.message("directory.mapping.remove.title"));
Collections.sort(items, MapInfo.COMPARATOR);
18,883
import com.intellij.execution.process.ProcessHandler; import jetbrains.mps.smodel.SNode; import com.intellij.execution.ExecutionException; import jetbrains.mps.execution.lib.Java_Command; import jetbrains.mps.internal.collections.runtime.IterableUtils; <BUG>import jetbrains.mps.internal.collections.runtime.Sequence; import com.intellij.openapi.application.PathManager;</BUG> import java.io.File; import java.util.List; import jetbrains.mps.internal.collections.runtime.ListSequence;
import org.apache.commons.lang.StringUtils; import com.intellij.openapi.application.PathManager;
18,884
import jetbrains.mps.generator.fileGenerator.FileGenerationUtil; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.vfs.FileSystem; import jetbrains.mps.buildlanguage.behavior.Project_Behavior; public class Ant_Command { <BUG>private String myAntLocation = Ant_Command.getDefaultAntHome(); public Ant_Command() {</BUG> } public Ant_Command setAntLocation(String antLocation) { if (antLocation != null) {
private String myOptions; public Ant_Command() {
18,885
public ProcessHandler createProcess(SNode project) throws ExecutionException { return new Ant_Command().setAntLocation(myAntLocation).createProcess(Ant_Command.getGeneratedFileName(project)); </BUG> } public ProcessHandler createProcess(String antFilePath) throws ExecutionException { <BUG>return new Java_Command().setClassPath(Ant_Command.getAntClassPath(myAntLocation)).setProgramParameter("-Djava.home=" + Java_Command.getJdkHome() + " -Dant.home=" + myAntLocation + " " + IterableUtils.join(Sequence.fromIterable(Ant_Command.getMacroValues()), " ") + " " + "-f " + antFilePath).createProcess("org.apache.tools.ant.launch.Launcher"); }</BUG> private static String getDefaultAntHome() { return PathManager.getHomePath() + File.separator + "lib" + File.separator + "ant";
return new Ant_Command().setAntLocation(myAntLocation).setOptions(myOptions).createProcess(Ant_Command.getGeneratedFileName(project)); return new Java_Command().setClassPath(Ant_Command.getAntClassPath(myAntLocation)).setProgramParameter("-Djava.home=" + Java_Command.getJdkHome() + " -Dant.home=" + myAntLocation + " " + IterableUtils.join(Sequence.fromIterable(Ant_Command.getMacroValues()), " ") + " " + ((StringUtils.isNotEmpty(myOptions) ? myOptions + " " : "" )) + "-f " + antFilePath).createProcess("org.apache.tools.ant.launch.Launcher");
18,886
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.List; <BUG>import java.util.Optional; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandDelete extends FCCommandBase { private static final FlagMapper MAPPER = map -> key -> value -> { map.put(key, value);
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
18,887
.append(Text.of(TextColors.GREEN, "Usage: ")) .append(getUsage(source)) .build()); return CommandResult.empty(); } else if (isIn(REGIONS_ALIASES, parse.args[0])) { <BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); IRegion region = FGManager.getInstance().getRegion(parse.args[1]); </BUG> boolean isWorldRegion = false; if (region == null) {
String regionName = parse.args[1]; IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
18,888
</BUG> isWorldRegion = true; } if (region == null) <BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!")); if (region instanceof GlobalWorldRegion) { </BUG> throw new CommandException(Text.of("You may not delete the global region!")); }
if (world == null) throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!")); if (world == null) throw new CommandException(Text.of("Must specify a world!")); region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null); throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!")); if (region instanceof IGlobal) {
18,889
source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region" ); return CommandResult.success(); } else if (isIn(HANDLERS_ALIASES, parse.args[0])) { if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); <BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]); if (handler == null) throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1); if (handler instanceof GlobalHandler)</BUG> throw new CommandException(Text.of("You may not delete the global handler!"));
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]); if (!handlerOpt.isPresent()) IHandler handler = handlerOpt.get(); if (handler instanceof GlobalHandler)
18,890
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
18,891
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
18,892
@Dependency(id = "foxcore") }, description = "A world protection plugin built for SpongeAPI. Requires FoxCore.", authors = {"gravityfox"}, url = "https://github.com/FoxDenStudio/FoxGuard") <BUG>public final class FoxGuardMain { public final Cause pluginCause = Cause.builder().named("plugin", this).build(); private static FoxGuardMain instanceField;</BUG> @Inject private Logger logger;
private static FoxGuardMain instanceField;
18,893
private UserStorageService userStorage; private EconomyService economyService = null; private boolean loaded = false; private FCCommandDispatcher fgDispatcher; public static FoxGuardMain instance() { <BUG>return instanceField; }</BUG> @Listener public void construct(GameConstructionEvent event) { instanceField = this;
} public static Cause getCause() { return instance().pluginCause; }
18,894
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
18,895
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.*; <BUG>import java.util.stream.Collectors; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandHere extends FCCommandBase { private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"}; private static final FlagMapper MAPPER = map -> key -> value -> {
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
18,896
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index > 0) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
18,897
private static FGStorageManager instance; private final Logger logger = FoxGuardMain.instance().getLogger();</BUG> private final Set<LoadEntry> loaded = new HashSet<>(); private final Path directory = getDirectory(); private final Map<String, Path> worldDirectories; <BUG>private FGStorageManager() { defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG> if (k instanceof IFGObject) { m.put((IFGObject) k, true); return true;
public final HashMap<IFGObject, Boolean> defaultModifiedMap; private final UserStorageService userStorageService; private final Logger logger = FoxGuardMain.instance().getLogger(); userStorageService = FoxGuardMain.instance().getUserStorage(); defaultModifiedMap = new CacheMap<>((k, m) -> {
18,898
String name = fgObject.getName(); Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fgObject.save(singleDir);
UUID owner = fgObject.getOwner(); boolean isOwned = !owner.equals(SERVER_UUID); Optional<User> userOwner = userStorageService.get(owner); String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name; if (fgObject.autoSave()) { Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
18,899
if (fgObject.autoSave()) { Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fgObject.save(singleDir);
Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
18,900
public synchronized void loadRegionLinks() { logger.info("Loading region links"); try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen(); linksMap.entrySet().forEach(entry -> { <BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey()); if (region != null) { logger.info("Loading links for region \"" + region.getName() + "\"");</BUG> String handlersString = entry.getValue();
Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey()); if (regionOpt.isPresent()) { IRegion region = regionOpt.get(); logger.info("Loading links for region \"" + region.getName() + "\"");