id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
23,001
import com.rackspace.papi.commons.util.http.CommonHttpHeader; import com.rackspace.papi.commons.util.http.HttpStatusCode; import com.rackspace.papi.commons.util.servlet.filter.ApplicationContextAwareFilter; import com.rackspace.papi.commons.util.servlet.http.HttpServletHelper; import com.rackspace.papi.commons.util.ser...
import com.rackspace.papi.commons.util.thread.DestroyableThreadWrapper; import com.rackspace.papi.filter.resource.PowerFilterChainReclaimer; import com.rackspace.papi.filter.resource.PowerFilterChainGarbageCollector; import com.rackspace.papi.model.PowerProxy;
23,002
import javax.servlet.ServletResponse; public class PowerFilter extends ApplicationContextAwareFilter { private static final Logger LOG = LoggerFactory.getLogger(PowerFilter.class); private final EventListener<ApplicationDeploymentEvent, String> applicationDeploymentListener; private final UpdateListener<PowerProxy> sys...
private PowerFilterChainBuilder powerFilterChainBuilder; private PowerFilterChainGarbageCollector filterChainGarbageCollector; private DestroyableThreadWrapper filterChainGarbageCollectorThread; private List<FilterContext> filterChain;
23,003
applicationDeploymentListener = new EventListener<ApplicationDeploymentEvent, String>() { @Override public void onEvent(Event<ApplicationDeploymentEvent, String> e) { LOG.info("Application collection has been modified. Application that changed: " + e.payload()); if (currentSystemModel != null) { <BUG>final List<FilterC...
final List<FilterContext> newFilterChain = new FilterContextInitializer(filterConfig).buildFilterContexts(papiContext.classLoader(), currentSystemModel); updateFilterChainBuilder(newFilterChain);
23,004
final byte[] expectedBytes = new byte[16]; for (int i = 0; i < expectedBytes.length; i++) { expectedBytes[i] = 1; } final UUID uuid = UUIDHelper.bytesToUUID(expectedBytes); <BUG>System.out.println(uuid.toString());</BUG> final byte[] actualBytes = UUIDHelper.stringToUUIDBytes(uuid.toString()); assertTrue(new ByteArrayC...
[DELETED]
23,005
new InetSocketAddress(InetAddress.getLocalHost(), 2103), new InetSocketAddress(InetAddress.getLocalHost(), 2104)}); final String myKey = "mykey"; final int finishTotal = 9700, sleep1 = 1000, <BUG>sleep2 = 100000, sleep3 = 200000, sleep4 = 100250; </BUG> total = 0;
sleep2 = 2000, sleep3 = 1200, sleep4 = 3000;
23,006
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.FilterConfig; import java.util.Collection; public class FilterContextManagerImpl implements FilterContextManager { <BUG>private static final Logger LOG = LoggerFactory.getLogger(PowerFilterChainBuilder.class); </BUG> private final FilterConfi...
private static final Logger LOG = LoggerFactory.getLogger(FilterContextInitializer.class);
23,007
package com.easytoolsoft.easyreport.web.controller.common; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping(value = "/error") <BUG>public class ErrorController extends AbstractController { @RequestMapping(value = {"/404"})</BUG>...
public class ErrorController { @RequestMapping(value = {"/404"})
23,008
private static final String DATASET_CAPACITY_TABLE = "dataset_capacity"; private static final String DATASET_TAG_TABLE = "dataset_tag"; private static final String DATASET_CASE_SENSITIVE_TABLE = "dataset_case_sensitivity"; private static final String DATASET_REFERENCE_TABLE = "dataset_reference"; private static final S...
private static final String DATASET_SECURITY_TABLE = "dataset_security_info";
23,009
throw new IllegalArgumentException( "Dataset deployment info update fail, " + "Json missing necessary fields: " + root.toString()); </BUG> } <BUG>final Object[] idUrn = findIdAndUrn(idNode, urnNode); final Integer datasetId = (Integer) idUrn[0];</BUG> final String urn = (String) idUrn[1]; ObjectMapper om = new ObjectMa...
"Dataset deployment info update error, missing necessary fields: " + root.toString()); final Object[] idUrn = findDataset(root); if (idUrn[0] == null || idUrn[1] == null) { throw new IllegalArgumentException("Cannot identify dataset from id/uri/urn: " + root.toString()); final Integer datasetId = (Integer) idUrn[0];
23,010
rec.setModifiedTime(System.currentTimeMillis() / 1000); if (datasetId == 0) { DatasetRecord record = new DatasetRecord(); record.setUrn(urn); record.setSourceCreatedTime("" + rec.getCreateTime() / 1000); <BUG>record.setSchema(rec.getOriginalSchema()); record.setSchemaType(rec.getFormat()); </BUG> record.setFields((Str...
record.setSchema(rec.getOriginalSchema().getText()); record.setSchemaType(rec.getOriginalSchema().getFormat());
23,011
datasetId = Integer.valueOf(DatasetDao.getDatasetByUrn(urn).get("id").toString()); rec.setDatasetId(datasetId); } else { DICT_DATASET_WRITER.execute(UPDATE_DICT_DATASET_WITH_SCHEMA_CHANGE, <BUG>new Object[]{rec.getOriginalSchema(), rec.getFormat(), StringUtil.objectToJsonString(rec.getFieldSchema()), "API", System.curr...
new Object[]{rec.getOriginalSchema().getText(), rec.getOriginalSchema().getFormat(), StringUtil.objectToJsonString(rec.getFieldSchema()), "API", System.currentTimeMillis() / 1000, datasetId});
23,012
case "deploymentInfo": try { DatasetInfoDao.updateDatasetDeployment(rootNode); } catch (Exception ex) { Logger.debug("Metadata change exception: deployment ", ex); <BUG>} break; case "caseSensitivity": try { DatasetInfoDao.updateDatasetCaseSensitivity(rootNode); } catch (Exception ex) { Logger.debug("Metadata change ex...
[DELETED]
23,013
public ReportElement getBase() { return base; } @Override public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException { <BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pag...
PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
23,014
public PdfTextStyle(String config) { Assert.hasText(config); String[] split = config.split(","); Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000"); fontSize = Integer.parseInt(split[0]); <BUG>font = resolveStandard14Name(split[1]); color = new Color(Integer.valueOf(split[2].substring(1),...
font = getFont(split[1]); color = new Color(Integer.valueOf(split[2].substring(1), 16));
23,015
package cc.catalysts.boot.report.pdf.elements; import cc.catalysts.boot.report.pdf.config.PdfTextStyle; import cc.catalysts.boot.report.pdf.utils.ReportAlignType; import org.apache.pdfbox.pdmodel.PDPageContentStream; <BUG>import org.apache.pdfbox.pdmodel.font.PDFont; import org.slf4j.Logger;</BUG> import org.slf4j.Logg...
import org.apache.pdfbox.pdmodel.font.PDType1Font; import org.apache.pdfbox.util.Matrix; import org.slf4j.Logger;
23,016
addTextSimple(stream, textConfig, textX, nextLineY, ""); return nextLineY; } try { <BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText); </BUG> float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]); if (!underline) { addTextSimple(stream, ...
String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
23,017
public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { try { stream.setFont(textConfig.getFont(), textConfig.getFontSize()); stream.setNonStrokingColor(textConfig.getColor()); stream.beginText(); <BUG>stream.newLineAtOffset(textX, textY); stream.sh...
stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY)); stream.showText(text);
23,018
public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { addTextSimple(stream, textConfig, textX, textY, text); try { float lineOffset = textConfig.getFontSize() / 8F; stream.setStrokingColor(textConfig.getColor()); <BUG>stream.setLineWidth...
stream.moveTo(textX, textY - lineOffset); stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
23,019
list.add(text.length()); return list; } public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) { String endPart = ""; <BUG>String shortenedText = text; List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); ...
List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {
23,020
package cc.catalysts.boot.report.pdf.elements; import org.apache.pdfbox.pdmodel.PDDocument; <BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream; import java.io.IOException;</BUG> import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList;
import org.apache.pdfbox.pdmodel.PDPageContentStream; import java.io.IOException;
23,021
import com.orientechnologies.orient.core.index.hashindex.local.cache.ODiskCache; import com.orientechnologies.orient.core.storage.OCluster; import com.orientechnologies.orient.core.storage.OPhysicalPosition; import com.orientechnologies.orient.core.storage.OStorageEmbedded; import com.orientechnologies.orient.core.vers...
public abstract class OStorageLocalAbstract extends OStorageEmbedded implements OFreezableStorage {
23,022
public abstract String getStoragePath(); protected abstract OPhysicalPosition updateRecord(OCluster cluster, ORecordId rid, byte[] recordContent, ORecordVersion recordVersion, byte recordType); protected abstract OPhysicalPosition createRecord(ODataLocal dataSegment, OCluster cluster, byte[] recordContent, byte recordT...
[DELETED]
23,023
import com.orientechnologies.orient.core.metadata.schema.OClass; import com.orientechnologies.orient.core.metadata.security.ODatabaseSecurityResources; import com.orientechnologies.orient.core.metadata.security.ORole; import com.orientechnologies.orient.core.record.ORecordInternal; import com.orientechnologies.orient.c...
import com.orientechnologies.orient.core.storage.impl.local.OFreezableStorage; import com.orientechnologies.orient.core.storage.impl.local.OStorageLocalAbstract;
23,024
Orient.instance().getProfiler() .stopChrono("db." + getName() + ".freeze", "Time to freeze the database", startTime, "db.*.freeze"); } @Override public void freeze() { <BUG>if (!(getStorage() instanceof OStorageLocalAbstract)) { </BUG> OLogManager.instance().error(this, "We can not freeze non local storage. " + "If you...
if (!(getStorage() instanceof OFreezableStorage)) {
23,025
User user = null; try{ user = userDirectoryService.getUser(userId); } catch (UserNotDefinedException e) { e.printStackTrace(); <BUG>} MembershipItem memberItem = MembershipItem.getInstance();</BUG> memberItem.setType(MembershipItem.TYPE_USER); memberItem.setName(user.getSortName()); memberItem.setUser(user);
if(user != null) MembershipItem memberItem = MembershipItem.getInstance();
23,026
User user = null; try{ user = userDirectoryService.getUser(userId); } catch (UserNotDefinedException e) { e.printStackTrace(); <BUG>} MembershipItem memberItem = MembershipItem.getInstance();</BUG> memberItem.setType(MembershipItem.TYPE_USER); memberItem.setName(user.getSortName()); memberItem.setUser(user);
if(user != null) MembershipItem memberItem = MembershipItem.getInstance();
23,027
import com.liferay.portal.PortletIdException; import com.liferay.portal.RemoteExportException; import com.liferay.portal.RemoteOptionsException; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; <BUG>import com.liferay.portal.kernel.json.JSONArray; i...
import com.liferay.portal.kernel.json.JSONException; import com.liferay.portal.kernel.json.JSONFactoryUtil;
23,028
remoteGroupId, remotePrivateLayout); } } protected void setRecentLayoutBranchId( PortalPreferences portalPreferences, long layoutSetBranchId, long plid, <BUG>long layoutBranchId) { portalPreferences.setValue( Staging.class.getName(), getRecentLayoutBranchIdKey(layoutSetBranchId, plid), String.valueOf(layoutBranchId)); ...
[DELETED]
23,029
package org.sleuthkit.autopsy.modules.stix; <BUG>import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.List;</BUG> import java.util.logging.Level;
import java.io.BufferedWriter; import java.io.FileWriter; import java.util.Arrays; import java.util.List;
23,030
import java.util.Map; import java.util.List;</BUG> import java.util.logging.Level; <BUG>import java.io.BufferedWriter; import java.io.FileWriter; import java.util.Arrays;</BUG> import javax.swing.JPanel; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller;
[DELETED]
23,031
saveToObjectMap(o); } } } } <BUG>private void processIndicators(STIXPackage stix) throws TskCoreException { </BUG> if (stix.getIndicators() != null) { List<IndicatorBaseType> s = stix.getIndicators().getIndicators(); for (IndicatorBaseType t : s) {
private void processIndicators(STIXPackage stix, BufferedWriter output) throws TskCoreException {
23,032
Indicator ind = (Indicator) t; if (ind.getObservable() != null) { if (ind.getObservable().getObject() != null) { ObservableResult result = evaluateSingleObservable(ind.getObservable(), ""); if (result.isTrue() || reportAllResults) { <BUG>writeResultsToFile(ind, result.getDescription(), result.isTrue()); </BUG> } if (re...
writeResultsToFile(ind, result.getDescription(), result.isTrue(), output);
23,033
saveResultsAsArtifacts(ind, result); } } else if (ind.getObservable().getObservableComposition() != null) { ObservableResult result = evaluateObservableComposition(ind.getObservable().getObservableComposition(), " "); if (result.isTrue() || reportAllResults) { <BUG>writeResultsToFile(ind, result.getDescription(), resul...
writeResultsToFile(ind, result.getDescription(), result.isTrue(), output);
23,034
MessageNotifyUtil.MessageType.INFO); break; } } } <BUG>private void writeResultsToFile(Indicator ind, String resultStr, boolean found) { </BUG> if (output != null) { try { if (found) {
private void writeResultsToFile(Indicator ind, String resultStr, boolean found, BufferedWriter output) {
23,035
} catch (IOException ex) { logger.log(Level.SEVERE, String.format("Error writing to STIX report file %s", reportPath), ex); //NON-NLS } } } <BUG>private void printFileHeader(String a_fileName) { </BUG> if (output != null) { try { char[] chars = new char[a_fileName.length() + 8];
private void printFileHeader(String a_fileName, BufferedWriter output) {
23,036
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding max...
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
23,037
final int lineStride = dst.getScanlineStride(); final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final byte[][] data = dst.getByteDataArrays(); final float[] warpData = new float[2 * dstWidth]; <BUG>int lineOffset = 0; if (ctable == null) { // source does not have IndexColor...
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
23,038
pixelOffset += pixelStride; } // COLS LOOP } // ROWS LOOP } } else {// source has IndexColorModel <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
} else if (caseB) { for (int h = 0; h < dstHeight; h++) {
23,039
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding max...
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
23,040
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final short[][] data = dst.getShortDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += l...
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
23,041
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding max...
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
23,042
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final short[][] data = dst.getShortDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += l...
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
23,043
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding max...
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
23,044
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final int[][] data = dst.getIntDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineS...
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
23,045
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding max...
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
23,046
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final float[][] data = dst.getFloatDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += l...
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
23,047
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding max...
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
23,048
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final double[][] data = dst.getDoubleDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset +=...
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
23,049
onBeginRender(); if (log.isDebugEnabled()) { log.debug("Begin render " + this); } <BUG>RuntimeException renderException = null; try { final RequestCycle cycle = getRequestCycle(); final Response originalResponse = cycle.getResponse(); if (!isVisible()) {</BUG> cycle.setResponse(NullResponse.getInstance());
[DELETED]
23,050
catch (RuntimeException e) { renderException = e; throw e; } <BUG>finally {</BUG> if (log.isDebugEnabled()) { log.debug("End render " + this);
if (isVisible)
23,051
"Exception thrown while cleaning up from the following exception which was thrown during rendering: " + Strings.toString(renderException), e); } else { <BUG>throw e; }</BUG> } } }
[DELETED]
23,052
package org.jenkinsci.plugins.mesos; import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; <BUG>import com.google.common.annotations.VisibleForTesting; import hudson.model.Computer;</BUG> import hudson.model.Node; import hudson.util.Secret; import java.lang.Math;
import edu.umd.cs.findbugs.annotations.NonNull; import hudson.model.Computer;
23,053
finishedTasks = Collections.newSetFromMap(new ConcurrentHashMap<TaskID, Boolean>()); } public synchronized void init() { running = true; String targetUser = mesosCloud.getSlavesUser(); <BUG>String webUrl = Jenkins.getInstance().getRootUrl(); </BUG> if (webUrl == null) webUrl = System.getenv("JENKINS_URL"); StandardUser...
String webUrl = getJenkins().getRootUrl();
23,054
SUPERVISOR_LOCK.unlock(); } } }).start(); } <BUG>public synchronized void stop() { SUPERVISOR_LOCK.lock();</BUG> if (driver != null) { LOGGER.info("Stopping Mesos driver."); driver.stop();
try { SUPERVISOR_LOCK.lock();
23,055
LOGGER.info("Stopping Mesos driver."); driver.stop(); } else { LOGGER.warning("Unable to stop Mesos driver: driver is null."); } <BUG>running = false; SUPERVISOR_LOCK.unlock(); }</BUG> public synchronized boolean isRunning() { return running;
} finally {
23,056
private String getJnlpUrl(String slaveName) { return joinPaths(joinPaths(joinPaths(jenkinsMaster, "computer"), slaveName), "slave-agent.jnlp"); } private String getJnlpSecret(String slaveName) { String jnlpSecret = ""; <BUG>if(Jenkins.getInstance().isUseSecurity()) { </BUG> jnlpSecret = String.format(JNLP_SECRET_FORMAT...
if(getJenkins().isUseSecurity()) {
23,057
LOGGER.info("Launching task " + taskId.getValue() + " with URI " + joinPaths(jenkinsMaster, SLAVE_JAR_URI_SUFFIX)); if (isExistingTask(taskId)) { refuseOffer(offer); return; <BUG>} for (final Computer computer : Jenkins.getInstance().getComputers()) { </BUG> if (!MesosComputer.class.isInstance(computer)) { LOGGER.finer...
Jenkins jenkins = getJenkins(); for (final Computer computer : jenkins.getComputers()) {
23,058
if (!MesosComputer.class.isInstance(computer)) { LOGGER.finer("Not a mesos computer, skipping"); continue; } MesosComputer mesosComputer = (MesosComputer) computer; <BUG>if (mesosComputer == null) { LOGGER.fine("The mesos computer is null, skipping"); continue; }</BUG> MesosSlave mesosSlave = mesosComputer.getNode();
[DELETED]
23,059
return mesosCloud; } protected void setMesosCloud(MesosCloud mesosCloud) { this.mesosCloud = mesosCloud; } <BUG>private class Result { </BUG> private final Mesos.SlaveResult result; private final Mesos.JenkinsSlave slave; private Result(Mesos.SlaveResult result, Mesos.JenkinsSlave slave) {
private static class Result {
23,060
this.result = result; this.slave = slave; } } @VisibleForTesting <BUG>class Request { </BUG> private final Mesos.SlaveRequest request; private final Mesos.SlaveResult result; public Request(Mesos.SlaveRequest request, Mesos.SlaveResult result) {
static class Request {
23,061
import java.util.logging.Level; import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; <BUG>import com.google.common.util.concurrent.MoreExecutors; imp...
import edu.umd.cs.findbugs.annotations.NonNull; import hudson.ExtensionList; import hudson.model.AsyncPeriodicWork;
23,062
logger.log(Level.INFO, "Marked " + comp.getName() + " for deletion"); ListenableFuture<?> f = executor.submit(new Runnable() { public void run() { logger.log(Level.INFO, "Deleting pending node " + comp.getName()); try { <BUG>comp.getNode().terminate(); } catch (RuntimeException e) {</BUG> logger.log(Level.WARNING, "Fai...
MesosSlave node = comp.getNode(); if (node != null) { node.terminate(); } catch (RuntimeException e) {
23,063
import com.cloudbees.plugins.credentials.common.StandardListBoxModel; import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; import com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials; import com.cloudbees.plugins.credentials.domains.DomainRequirement; import com.cloudbees...
import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension;
23,064
private static String staticMaster; private static final Logger LOGGER = Logger.getLogger(MesosCloud.class.getName()); private static volatile boolean nativeLibraryLoaded = false; @Initializer(after=InitMilestone.JOB_LOADED) public static void init() { <BUG>Jenkins jenkins = Jenkins.getInstance(); </BUG> List<Node> sla...
Jenkins jenkins = getJenkins();
23,065
if (credentialsId == null) { return null; } else { List<DomainRequirement> domainRequirements = (master == null) ? Collections.<DomainRequirement>emptyList() : URIRequirementBuilder.fromUri(master.trim()).build(); <BUG>Jenkins jenkins = Jenkins.getInstance(); </BUG> return CredentialsMatchers.firstOrNull(CredentialsPro...
Jenkins jenkins = getJenkins();
23,066
case (XmlPullParser.END_TAG): currentTag.pop(); break; case (XmlPullParser.TEXT): if (currentTag.peek().equals(tagname)) { <BUG>return xpp.getText(); </BUG> } break; }
return xpp.getText().trim();
23,067
return resp; } public ComputerDetails getComputerDetails() throws MalformedURLException, IOException, XmlPullParserException { ComputerDetails details = new ComputerDetails(); String serverInfo = getServerInfo(); <BUG>details.name = getXmlString(serverInfo, "hostname").trim(); details.uuid = UUID.fromString(getXmlStrin...
details.name = getXmlString(serverInfo, "hostname"); details.uuid = UUID.fromString(getXmlString(serverInfo, "uniqueid")); details.macAddress = getXmlString(serverInfo, "mac"); String localIpStr = getXmlString(serverInfo, "LocalIP");
23,068
import java.util.*; public class SPEA2Breeder extends SimpleBreeder { public void setup(final EvolutionState state, final Parameter base) { <BUG>super.setup(state, base); if (sequentialBreeding) // uh oh, haven't tested with this</BUG> state.output.fatal("SPEA2Breeder does not support sequential evaluation.", base.push...
for (int i = 0; i < state.population.subpops.length; i++) if (reduceBy[i] != 0) state.output.fatal("SPEA2Breeder does not support population reduction.", base.push(P_REDUCE_BY).push(""+i), null); if (sequentialBreeding) // uh oh, haven't tested with this
23,069
extraBehavior=TRUNCATE; // duh else if (extra.equalsIgnoreCase(V_FILL)) extraBehavior=FILL; else if (extra.equalsIgnoreCase(V_WRAP)) extraBehavior=WRAP; <BUG>else state.output.fatal("Subpouplation given a bad " + P_EXTRA_BEHAVIOR + ": " + extra, </BUG> base.push(P_EXTRA_BEHAVIOR),def.push(P_EXTRA_BEHAVIOR)); } }
else state.output.fatal("Subpopulation given a bad " + P_EXTRA_BEHAVIOR + ": " + extra,
23,070
public final void printSubpopulation(final EvolutionState state, final int log, final int verbosity) { printSubpopulation(state, log); <BUG>} public void printSubpopulationForHumans(final EvolutionState state,</BUG> final int log) { state.output.println(NUM_INDIVIDUALS_PREAMBLE + individuals.length, log);
boolean warned = false; public void printSubpopulationForHumans(final EvolutionState state,
23,071
state.output.println(NUM_INDIVIDUALS_PREAMBLE + individuals.length, log); for(int i = 0 ; i < individuals.length; i++) { state.output.println(INDIVIDUAL_INDEX_PREAMBLE + Code.encode(i), log); if (individuals[i] != null) <BUG>individuals[i].printIndividualForHumans(state, log); else state.output.warnOnce("Null individua...
else if (!warned) warned = true; // we do this rather than relying on warnOnce because it is much faster in a tight loop
23,072
{ public static final String P_ELITE = "elite"; public static final String P_ELITE_FRAC = "elite-fraction"; public static final String P_REEVALUATE_ELITES = "reevaluate-elites"; public static final String P_SEQUENTIAL_BREEDING = "sequential"; <BUG>public static final String P_CLONE_PIPELINE_AND_POPULATION = "clone-pipe...
public static final String P_REDUCE_BY = "reduce-by"; public static final String P_MINIMUM_SIZE = "minimum-size"; public int[] reduceBy; public int[] minimumSize; public double[] eliteFrac;
23,073
int size = state.parameters.getInt(p,null,1); // if size is wrong, we'll let Population complain about it -- for us, we'll just make 0-sized arrays and drop out. eliteFrac = new double[size]; elite = new int[size]; for(int i = 0; i < size; i++) eliteFrac[i] = elite[i] = NOT_SET; <BUG>reevaluateElites = new boolean[siz...
reduceBy = new int[size]; // all zero minimumSize = new int[size]; minimumSize[i] = 2; sequentialBreeding = state.parameters.getBoolean(base.push(P_SEQUENTIAL_BREEDING), null, false);
23,074
int numThreads = 0; for(int x = 0; x < state.population.subpops.length; x++) numThreads = Math.max(numThreads, state.population.subpops[x].individuals.length); numThreads = Math.min(numThreads, state.breedthreads); if (numThreads < state.breedthreads) <BUG>state.output.warnOnce("Largest subpopulation size (" + numThrea...
state.output.warnOnce("Largest subpopulation size (" + numThreads +") is smaller than number of breedthreads (" + state.breedthreads + "), so fewer breedthreads will be created.");
23,075
public static final String P_REPLACEMENT_PROBABILITY = "replacement-probability"; public boolean generationBoundary; public int generationSize; public long evaluations; public double replacementProbability; <BUG>public int[] individualCount; HashMap[] individualHash;</BUG> int whichSubpop; protected boolean firstTime; ...
HashMap[] individualHash;
23,076
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class ...
import java.text.DateFormat; import java.util.Date; import java.util.List;
23,077
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
23,078
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MIS...
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
23,079
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VE...
[DELETED]
23,080
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); <BUG>writer.writeAttribute(Attribute.PATH.name, path.toString()); if(type != ModificationType.REMOVE) {</BUG> writer.writeAttribute(Attribute.HASH.name, bytesToHex...
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
23,081
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> impor...
import org.jboss.logging.annotations.Cause; import java.io.IOException;
23,082
package mage.player.ai; <BUG>import java.util.LinkedList; import java.util.UUID;</BUG> import mage.Constants.AbilityType; import mage.Constants.PhaseStep; import mage.Constants.RangeOfInfluence;
import java.util.List; import java.util.UUID;
23,083
if (!getNextAction(game)) { currentScore = GameStateEvaluator.evaluate(playerId, game); Game sim = createSimulation(game); SimulationNode.resetCount(); root = new SimulationNode(null, sim, playerId); <BUG>logger.debug("simulating pre combat actions -----------------------------------------------------------------------...
if (!isTestMode) else addActions(root, new FilterAbility(), Integer.MIN_VALUE, Integer.MAX_VALUE); if (root.children.size() > 0) {
23,084
if (!getNextAction(game)) { currentScore = GameStateEvaluator.evaluate(playerId, game); Game sim = createSimulation(game); SimulationNode.resetCount(); root = new SimulationNode(null, sim, playerId); <BUG>logger.debug("simulating post combat actions ----------------------------------------------------------------------...
logger.debug("simulating pre combat actions -----------------------------------------------------------------------------------------"); if (!isTestMode) else addActions(root, new FilterAbility(), Integer.MIN_VALUE, Integer.MAX_VALUE); if (root.children.size() > 0) {
23,085
import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; <BUG>import mage.abilities.Ability; import mage.abilities.TriggeredAbility;</BUG> import mage.abilities.common.PassAbility; import mage.abilities.costs.mana.GenericManaCost; i...
import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbility;
23,086
currentScore = GameStateEvaluator.evaluate(playerId, game); if (!getNextAction(game)) { Game sim = createSimulation(game); SimulationNode.resetCount(); root = new SimulationNode(null, sim, playerId); <BUG>logger.debug("simulating actions"); addActionsTimed(new FilterAbility()); if (root.children.size() > 0) {</BUG> roo...
if (!isTestMode) else addActions(root, new FilterAbility(), Integer.MIN_VALUE, Integer.MAX_VALUE); if (root.children.size() > 0) {
23,087
sim.getPlayer(currentPlayer.getId()).pass(); sim.getPlayerList().getNext(); } SimulationNode newNode = new SimulationNode(node, sim, action, currentPlayer.getId()); if (logger.isDebugEnabled()) <BUG>logger.debug(indent(node.depth) + "simulating -- node #:" + SimulationNode.getCount() + " actions:" + action); </BUG> sim...
logger.debug(indent(newNode.depth) + "simulating -- node #:" + SimulationNode.getCount() + " actions:" + action);
23,088
private volatile IndexProvider localIndexProvider; private final int machineId; private volatile MasterServer masterServer; private final AtomicBoolean reevaluatingMyself = new AtomicBoolean(); private ScheduledExecutorService updatePuller; <BUG>private volatile Machine cachedMaster = Machine.NO_MACHINE; private volati...
[DELETED]
23,089
System.out.println( "looked up master " + master ); master = broker.getMasterReally(); <BUG>} boolean iAmCurrentlyMaster = masterServer != null; boolean restarted = false; if ( cachedMaster.getMachineId() != master.other().getMachineId() ) {</BUG> if ( master.other().getMachineId() == machineId ) { if ( this.localGraph...
[DELETED]
23,090
if ( this.localGraph == null || !iAmCurrentlyMaster ) { internalShutdown(); startAsMaster(); restarted = true; <BUG>} }</BUG> else { if ( this.localGraph == null || iAmCurrentlyMaster )
broker.rebindMaster();
23,091
startAsSlave(); tryToEnsureIAmNotABrokenMachine( master ); restarted = true; } } <BUG>} if ( masterServer != null ) { broker.rebindMaster(); }</BUG> if ( restarted )
[DELETED]
23,092
this.localGraph.registerKernelEventHandler( handler ); } this.localDataSourceManager = localGraph.getConfig().getTxModule().getXaDataSourceManager(); } <BUG>cachedMaster = master.other(); started = true;</BUG> } finally {
[DELETED]
23,093
connectedSlaveChannels.remove( channel ); } } public void shutdown() { <BUG>deadConnectionsPoller.shutdown(); channelGroup.close().awaitUninterruptibly();</BUG> } private boolean channelIsClosed( Channel channel ) {
System.out.println( "Master server shutdown, closing all channels" ); channelGroup.close().awaitUninterruptibly();
23,094
rest("/cart/").description("Personal Shopping Cart Service") .produces(MediaType.APPLICATION_JSON_VALUE) .options("/{cartId}") .route().id("getCartOptionsRoute").end().endRest() .options("/checkout/{cartId}") <BUG>.route().id("checkoutCartOptionsRoute").end().endRest() .options("/{cartId}/{itemId}/{quantity}")</BUG> .r...
.options("/{cartId}/{tmpId}") .route().id("cartSetOptionsRoute").end().endRest() .options("/{cartId}/{itemId}/{quantity}")
23,095
chart.addYAxisLabels(AxisLabelsFactory.newAxisLabels(labels)); chart.addXAxisLabels(AxisLabelsFactory.newNumericRangeAxisLabels(0, max)); chart.setBarWidth(BarChart.AUTO_RESIZE); chart.setSize(600, 500); chart.setHorizontal(true); <BUG>chart.setTitle("Total Evaluations by User"); showChartImg(resp, chart.toURLString())...
chart.setDataEncoding(DataEncoding.TEXT); return chart; }
23,096
checkEvaluationsEqual(eval4, foundissueProto.getEvaluations(0)); checkEvaluationsEqual(eval5, foundissueProto.getEvaluations(1)); } public void testGetRecentEvaluationsNoneFound() throws Exception { DbIssue issue = createDbIssue("fad", persistenceHelper); <BUG>DbEvaluation eval1 = createEvaluation(issue, "someone", 100...
[DELETED]
23,097
public int read() throws IOException { return inputStream.read(); } }); } <BUG>} protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {</BUG> DbUser user; Query query = getPersistenceManager().newQuery("select from " + persistenceHelper.getDbUserClass().getName() + " where openid == :myopenid")...
@SuppressWarnings({"unchecked"}) protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {
23,098
eval.setComment("my comment"); eval.setDesignation("MUST_FIX"); eval.setIssue(issue); eval.setWhen(when); eval.setWho(user.createKeyObject()); <BUG>eval.setEmail(who); return eval;</BUG> } protected PersistenceManager getPersistenceManager() { return testHelper.getPersistenceManager();
issue.addEvaluation(eval); return eval;
23,099
return links; } @JsonIgnore @Override public String getImageId() { <BUG>Image image = getImage(); return (image != null) ? image.getId() : null; }</BUG> @SuppressWarnings("rawtypes") @Override
if(image instanceof Map) { Map<String, String> map = (Map<String, String>) image; return map.get("id"); return getImage().getId();
23,100
import org.openstack4j.common.Buildable;</BUG> import org.openstack4j.model.ModelEntity; import org.openstack4j.model.image.v2.builder.TaskBuilder; <BUG>import java.util.Date; import java.util.Map; public interface Task extends ModelEntity, Buildable<TaskBuilder> {</BUG> public enum TaskStatus { PENDING, PROCESSING, SU...
package org.openstack4j.model.image.v2; import org.openstack4j.common.Buildable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; public interface Task extends ModelEntity, Buildable<TaskBuilder> {