id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
45,501
import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; <BUG>import java.util.stream.Collectors; import javax.ejb.EJB;</BUG> import javax.ejb.Local; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute;
import javax.annotation.PostConstruct; import javax.ejb.EJB;
45,502
import org.hawkular.alerts.api.model.trigger.Trigger; import org.hawkular.alerts.api.services.ActionsService; import org.hawkular.alerts.api.services.AlertsCriteria; import org.hawkular.alerts.api.services.AlertsService; import org.hawkular.alerts.api.services.DefinitionsService; <BUG>import org.hawkular.alerts.api.services.EventsCriteria; import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;</BUG> import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingEvents; import org.hawkular.alerts.engine.log.MsgLogger; import org.hawkular.alerts.engine.service.AlertsEngine;
import org.hawkular.alerts.api.services.PropertiesService; import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;
45,503
import com.datastax.driver.core.Session; import com.google.common.util.concurrent.Futures; @Local(AlertsService.class) @Stateless @TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED) <BUG>public class CassAlertsServiceImpl implements AlertsService { private final MsgLogger msgLog = MsgLogger.LOGGER; private final Logger log = Logger.getLogger(CassAlertsServiceImpl.class); @EJB</BUG> AlertsEngine alertsEngine;
private static final String CRITERIA_NO_QUERY_SIZE = "hawkular-alerts.criteria-no-query-size"; private static final String CRITERIA_NO_QUERY_SIZE_ENV = "CRITERIA_NO_QUERY_SIZE"; private static final String CRITERIA_NO_QUERY_SIZE_DEFAULT = "200"; private int criteriaNoQuerySize;
45,504
log.debug("Adding " + alerts.size() + " alerts"); } PreparedStatement insertAlert = CassStatement.get(session, CassStatement.INSERT_ALERT); PreparedStatement insertAlertTrigger = CassStatement.get(session, CassStatement.INSERT_ALERT_TRIGGER); PreparedStatement insertAlertCtime = CassStatement.get(session, CassStatement.INSERT_ALERT_CTIME); <BUG>PreparedStatement insertAlertStatus = CassStatement.get(session, CassStatement.INSERT_ALERT_STATUS); PreparedStatement insertAlertSeverity = CassStatement.get(session, CassStatement.INSERT_ALERT_SEVERITY);</BUG> PreparedStatement insertTag = CassStatement.get(session, CassStatement.INSERT_TAG); try { List<ResultSetFuture> futures = new ArrayList<>();
[DELETED]
45,505
futures.add(session.executeAsync(insertAlertTrigger.bind(a.getTenantId(), a.getAlertId(), a.getTriggerId()))); futures.add(session.executeAsync(insertAlertCtime.bind(a.getTenantId(), a.getAlertId(), a.getCtime()))); <BUG>futures.add(session.executeAsync(insertAlertStatus.bind(a.getTenantId(), a.getAlertId(), a.getStatus().name()))); futures.add(session.executeAsync(insertAlertSeverity.bind(a.getTenantId(), a.getAlertId(), a.getSeverity().name())));</BUG> a.getTags().entrySet().stream().forEach(tag -> {
[DELETED]
45,506
for (Row row : rsAlerts) { String payload = row.getString("payload"); Alert alert = JsonUtil.fromJson(payload, Alert.class, thin); alerts.add(alert); } <BUG>} } catch (Exception e) { msgLog.errorDatabaseException(e.getMessage()); throw e; } return preparePage(alerts, pager);</BUG> }
[DELETED]
45,507
for (Alert a : alertsToDelete) { String id = a.getAlertId(); List<ResultSetFuture> futures = new ArrayList<>(); futures.add(session.executeAsync(deleteAlert.bind(tenantId, id))); futures.add(session.executeAsync(deleteAlertCtime.bind(tenantId, a.getCtime(), id))); <BUG>futures.add(session.executeAsync(deleteAlertSeverity.bind(tenantId, a.getSeverity().name(), id))); futures.add(session.executeAsync(deleteAlertStatus.bind(tenantId, a.getStatus().name(), id)));</BUG> futures.add(session.executeAsync(deleteAlertTrigger.bind(tenantId, a.getTriggerId(), id))); a.getLifecycle().stream().forEach(l -> { futures.add(
[DELETED]
45,508
private Alert updateAlertStatus(Alert alert) throws Exception { if (alert == null || alert.getAlertId() == null || alert.getAlertId().isEmpty()) { throw new IllegalArgumentException("AlertId must be not null"); } try { <BUG>PreparedStatement deleteAlertStatus = CassStatement.get(session, CassStatement.DELETE_ALERT_STATUS); PreparedStatement insertAlertStatus = CassStatement.get(session, CassStatement.INSERT_ALERT_STATUS);</BUG> PreparedStatement insertAlertLifecycle = CassStatement.get(session,
[DELETED]
45,509
PreparedStatement insertAlertLifecycle = CassStatement.get(session, CassStatement.INSERT_ALERT_LIFECYCLE); PreparedStatement updateAlert = CassStatement.get(session, CassStatement.UPDATE_ALERT); List<ResultSetFuture> futures = new ArrayList<>(); <BUG>for (Status statusToDelete : EnumSet.complementOf(EnumSet.of(alert.getStatus()))) { futures.add(session.executeAsync(deleteAlertStatus.bind(alert.getTenantId(), statusToDelete.name(), alert.getAlertId()))); } futures.add(session.executeAsync(insertAlertStatus.bind(alert.getTenantId(), alert.getAlertId(), alert .getStatus().name())));</BUG> Alert.LifeCycle lifecycle = alert.getCurrentLifecycle();
[DELETED]
45,510
String category = null; Collection<String> categories = null; String triggerId = null; Collection<String> triggerIds = null; Map<String, String> tags = null; <BUG>boolean thin = false; public EventsCriteria() {</BUG> super(); } public Long getStartTime() {
Integer criteriaNoQuerySize = null; public EventsCriteria() {
45,511
} @Override public String toString() { return "EventsCriteria [startTime=" + startTime + ", endTime=" + endTime + ", eventId=" + eventId + ", eventIds=" + eventIds + ", category=" + category + ", categories=" + categories + ", triggerId=" <BUG>+ triggerId + ", triggerIds=" + triggerIds + ", tags=" + tags + ", thin=" + thin + "]"; }</BUG> }
public void addTag(String name, String value) { if (null == tags) { tags = new HashMap<>();
45,512
return size()+offset; } public PlaLineInt[] to_array() { return a_list.toArray(new PlaLineInt[size()]); <BUG>} @Override</BUG> public Iterator<PlaLineInt> iterator() { return a_list.iterator();
public ArrayList<PlaLineInt>to_alist() return a_list; @Override
45,513
while (Math.abs(prev_dist) < c_epsilon) { ++corners_skipped_before; int curr_no = p_start_no - corners_skipped_before; if (curr_no < 0) return null; <BUG>prev_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]); </BUG> prev_dist = translate_line.distance_signed(prev_corner); } double next_dist = translate_line.distance_signed(next_corner);
prev_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
45,514
</BUG> { return null; } <BUG>next_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]); </BUG> next_dist = translate_line.distance_signed(next_corner); } if (Signum.of(prev_dist) != Signum.of(next_dist)) {
double next_dist = translate_line.distance_signed(next_corner); while (Math.abs(next_dist) < c_epsilon) ++corners_skipped_after; int curr_no = p_start_no + 3 + corners_skipped_after; if (curr_no >= p_line_arr.size() - 2) next_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
45,515
check_ok = r_board.check_trace(shape_to_check, curr_layer, curr_net_no_arr, curr_cl_type, contact_pins); } delta_dist /= 2; if (check_ok) { <BUG>result = curr_lines[p_start_no + 2]; </BUG> if (translate_dist == max_translate_dist) break; translate_dist += delta_dist; }
result = curr_lines.get(p_start_no + 2);
45,516
translate_dist -= shorten_value; delta_dist -= shorten_value; } } if (result == null) return null; <BUG>PlaPointFloat new_prev_corner = curr_lines[p_start_no].intersection_approx(curr_lines[p_start_no + 1]); PlaPointFloat new_next_corner = curr_lines[p_start_no + 3].intersection_approx(curr_lines[p_start_no + 4]); </BUG> r_board.changed_area.join(new_prev_corner, curr_layer);
PlaPointFloat new_prev_corner = curr_lines.get(p_start_no).intersection_approx(curr_lines.get(p_start_no + 1)); PlaPointFloat new_next_corner = curr_lines.get(p_start_no + 3).intersection_approx(curr_lines.get(p_start_no + 4));
45,517
public final static String PARKING_POINT_LAT = "parking_point_lat"; //$NON-NLS-1$ public final static String PARKING_POINT_LON = "parking_point_lon"; //$NON-NLS-1$ public final static String PARKING_TYPE = "parking_type"; //$NON-NLS-1$ public final static String PARKING_TIME = "parking_limit_time"; //$//$NON-NLS-1$ public final static String PARKING_START_TIME = "parking_time"; //$//$NON-NLS-1$ <BUG>public final static String PARKING_EVENT_ADDED = "parking_event_added"; //$//$NON-NLS-1$ private OsmandApplication app;</BUG> private ParkingPositionLayer parkingLayer; private BaseMapWidget parkingPlaceControl; private final CommonPreference<Float> parkingLat;
private LatLon parkingPosition; private OsmandApplication app;
45,518
parkingLat = set.registerFloatPreference(PARKING_POINT_LAT, 0f).makeGlobal(); parkingLon = set.registerFloatPreference(PARKING_POINT_LON, 0f).makeGlobal(); parkingType = set.registerBooleanPreference(PARKING_TYPE, false).makeGlobal(); parkingEvent = set.registerBooleanPreference(PARKING_EVENT_ADDED, false).makeGlobal(); parkingTime = set.registerLongPreference(PARKING_TIME, -1).makeGlobal(); <BUG>parkingStartTime = set.registerLongPreference(PARKING_START_TIME, -1).makeGlobal(); } public LatLon getParkingPosition() { </BUG> float lat = parkingLat.get();
parkingPosition = constructParkingPosition(); public LatLon constructParkingPosition() {
45,519
scope = packageView.getMemberScope(); } return new PackageType(name, scope, NO_RECEIVER); } @Nullable <BUG>public ResolvedCallWithTrace<FunctionDescriptor> getResolvedCallForFunction( @NotNull Call call, @NotNull JetExpression callExpression,</BUG> @NotNull ResolutionContext context, @NotNull CheckValueArgumentsMode checkArguments, @NotNull boolean[] result ) {
public ResolvedCall<FunctionDescriptor> getResolvedCallForFunction( @NotNull Call call, @NotNull JetExpression callExpression,
45,520
package com.projecttango.examples.java.augmentedreality; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoConfig; <BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoEvent;</BUG> import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
45,521
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { <BUG>try { connectTango();</BUG> setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
TangoSupport.initialize(); connectTango();
45,522
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics); mCameraPoseTimestamp = lastFramePose.timestamp;</BUG> } else { <BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); }</BUG> } } } @Override
mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; Log.w(TAG, "Can't get device pose at time: " +
45,523
import org.rajawali3d.materials.Material; import org.rajawali3d.materials.methods.DiffuseMethod; import org.rajawali3d.materials.textures.ATexture; import org.rajawali3d.materials.textures.StreamingTexture; import org.rajawali3d.materials.textures.Texture; <BUG>import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.vector.Vector3;</BUG> import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
45,524
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics); getCurrentCamera().setRotation(cameraPose.getOrientation()); getCurrentCamera().setPosition(cameraPose.getPosition()); }</BUG> public int getTextureId() {
public void updateRenderCameraPose(TangoPoseData cameraPose) { float[] rotation = cameraPose.getRotationAsFloats(); float[] translation = cameraPose.getTranslationAsFloats(); Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]); getCurrentCamera().setRotation(quaternion.conjugate()); getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
45,525
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; <BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoConfig;</BUG> import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
45,526
public class RESTServer { protected final static Logger LOG = Logger.getLogger(RESTServer.class); protected final static Properties defaultProperties = new Properties(); static { defaultProperties.setProperty(OutputKeys.INDENT, "yes"); <BUG>defaultProperties.setProperty(OutputKeys.ENCODING, "UTF-8"); defaultProperties.setProperty(EXistOutputKeys.EXPAND_XINCLUDES, "yes");</BUG> defaultProperties.setProperty(EXistOutputKeys.HIGHLIGHT_MATCHES, "elements"); defaultProperties.setProperty(EXistOutputKeys.PROCESS_XSL_PI, "yes"); }
defaultProperties.setProperty(OutputKeys.MEDIA_TYPE, MimeType.XML_TYPE.getName()); defaultProperties.setProperty(EXistOutputKeys.EXPAND_XINCLUDES, "yes");
45,527
request.setCharacterEncoding(formEncoding); int howmany = 10; int start = 1; boolean wrap = true; boolean source = false; <BUG>Properties outputProperties = new Properties(); </BUG> String query = request.getParameter("_xpath"); if (query == null) query = request.getParameter("_query");
Properties outputProperties = new Properties(defaultProperties);
45,528
DocumentImpl resource = null;</BUG> XmldbURI pathUri = XmldbURI.create(path); try { resource = broker.getXMLResource(pathUri, Lock.READ_LOCK); <BUG>if (resource != null) { if (resource.getResourceType() == DocumentImpl.BINARY_FILE && "application/xquery".equals(resource.getMetadata().getMimeType())) {</BUG> Descriptor descriptor = Descriptor.getDescriptorSingleton();
LOG.debug("query = " + query); String encoding; if ((encoding = request.getParameter("_encoding")) != null) outputProperties.setProperty(OutputKeys.ENCODING, encoding); else encoding = "UTF-8"; String mimeType = outputProperties.getProperty(OutputKeys.MEDIA_TYPE); DocumentImpl resource = null; if (resource != null) { if (resource.getResourceType() == DocumentImpl.BINARY_FILE && MimeType.XQUERY_TYPE.getName().equals(resource.getMetadata().getMimeType())) {
45,529
for ( int j = 0; j < depsToWrite.length; j++ ) { IdeDependency dep = depsToWrite[j]; if ( dep.isJavaApi() ) { <BUG>String depId = dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getClassifier() + ":" + dep.getVersion(); addDependency( writer, dep ); addedDependencies.add( depId ); }</BUG> }
String depId = getDependencyId( dep ); if ( !addedDependencies.contains( depId ) )
45,530
import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Reader; <BUG>import java.io.Writer; import java.util.Iterator;</BUG> import java.util.LinkedHashSet; import java.util.List; import java.util.Set;
import java.util.ArrayList; import java.util.Iterator;
45,531
private JDDVars[] varDDRowVars; // dd vars (row/col) for each module variable private JDDVars[] varDDColVars; private JDDNode[] ddSynchVars; // individual dd vars for synchronising actions private JDDNode[] ddSchedVars; // individual dd vars for scheduling non-det. private JDDNode[] ddChoiceVars; // individual dd vars for local non-det. <BUG>private Vector<String> ddVarNames; private Vector<String> synchs; // list of action names</BUG> private JDDNode transActions; // dd for transition action labels (MDPs) private Vector<JDDNode> transPerAction; // dds for transition action labels (D/CTMCs) private int maxNumChoices = 0;
private ModelVariablesDD modelVariables; private Vector<String> synchs; // list of action names
45,532
for (i = 0; i < numVars; i++) { varDDRowVars[i] = new JDDVars(); varDDColVars[i] = new JDDVars(); } if (modelType == ModelType.MDP) { <BUG>for (i = 0; i < maxNumChoices; i++) { v = JDD.Var(ddVarsUsed++); ddChoiceVars[i] = v; ddVarNames.add("l" + i);</BUG> }
[DELETED]
45,533
ddVarNames.add("l" + i);</BUG> } } for (i = 0; i < numVars; i++) { n = varList.getRangeLogTwo(i); <BUG>for (j = 0; j < n; j++) { vr = JDD.Var(ddVarsUsed++); vc = JDD.Var(ddVarsUsed++); varDDRowVars[i].addVar(vr); varDDColVars[i].addVar(vc); ddVarNames.add(varList.getName(i) + "." + j); ddVarNames.add(varList.getName(i) + "'." + j);</BUG> }
varDDRowVars[i] = new JDDVars(); varDDColVars[i] = new JDDVars(); if (modelType == ModelType.MDP) { for (i = 0; i < maxNumChoices; i++) { ddChoiceVars[i] = modelVariables.allocateVariable("l" + i); varDDRowVars[i].addVar(modelVariables.allocateVariable(varList.getName(i) + "." + j)); varDDColVars[i].addVar(modelVariables.allocateVariable(varList.getName(i) + "'." + j));
45,534
JDDVars getAllDDRowVars(); JDDVars getAllDDColVars(); int getNumDDRowVars(); int getNumDDColVars(); int getNumDDVarsInTrans(); <BUG>Vector<String> getDDVarNames(); ODDNode getODD();</BUG> void setSynchs(List<String> synchs); void addLabelDD(String label, JDDNode labelDD); void resetTrans(JDDNode trans);
ModelVariablesDD getModelVariables(); ODDNode getODD();
45,535
private JDDNode[] varColRangeDDs; // dd giving range for each module variable (in col vars) private JDDNode[] varIdentities; // identity matrix for each module variable private JDDNode[] ddSynchVars; // individual dd vars for synchronising actions private JDDNode[] ddSchedVars; // individual dd vars for scheduling non-det. private JDDNode[] ddChoiceVars; // individual dd vars for local non-det. <BUG>private Vector<String> ddVarNames; private Vector<String> synchs; // list of action names</BUG> private JDDNode transActions; // dd for transition action labels (MDPs) private Vector<JDDNode> transPerAction; // dds for transition action labels (D/CTMCs) private int maxNumChoices = 0;
private ModelVariablesDD modelVariables; private Vector<String> synchs; // list of action names
45,536
this.stateRewardsFile = stateRewardsFile; this.modulesFile = modulesFile; modelType = modulesFile.getModelType(); varList = modulesFile.createVarList(); numVars = varList.getNumVars(); <BUG>this.numStates = numStates; if (statesFile != null) {</BUG> readStatesFromFile(); } return buildModel();
modelVariables = new ModelVariablesDD(); if (statesFile != null) {
45,537
throw new PrismException("Error detected " + e.getMessage() + "at line " + lineNum + " of transition matrix file \"" + transFile + "\""); } } private void allocateDDVars() { <BUG>JDDNode v, vr, vc; int i, j, n; int ddVarsUsed = 0; ddVarNames = new Vector<String>();</BUG> if (modelType == ModelType.MDP) {
modelVariables = new ModelVariablesDD();
45,538
for (i = 0; i < numVars; i++) { varDDRowVars[i] = new JDDVars(); varDDColVars[i] = new JDDVars(); } if (modelType == ModelType.MDP) { <BUG>for (i = 0; i < maxNumChoices; i++) { v = JDD.Var(ddVarsUsed++); ddChoiceVars[i] = v; ddVarNames.add("l" + i);</BUG> }
[DELETED]
45,539
ddVarNames.add("l" + i);</BUG> } } for (i = 0; i < numVars; i++) { n = varList.getRangeLogTwo(i); <BUG>for (j = 0; j < n; j++) { vr = JDD.Var(ddVarsUsed++); vc = JDD.Var(ddVarsUsed++); varDDRowVars[i].addVar(vr); varDDColVars[i].addVar(vc); ddVarNames.add(varList.getName(i) + "." + j); ddVarNames.add(varList.getName(i) + "'." + j);</BUG> }
varDDRowVars[i] = new JDDVars(); varDDColVars[i] = new JDDVars(); if (modelType == ModelType.MDP) { for (i = 0; i < maxNumChoices; i++) { ddChoiceVars[i] = modelVariables.allocateVariable("l" + i); varDDRowVars[i].addVar(modelVariables.allocateVariable(varList.getName(i) + "." + j)); varDDColVars[i].addVar(modelVariables.allocateVariable(varList.getName(i) + "'." + j));
45,540
newStart = JDD.And(allInit ? model.getReach() : model.getStart(), newStart); ProbModel modelProd = new ProbModel( newTrans, newStart, new JDDNode[0], new JDDNode[0], new String[0], newAllDDRowVars, newAllDDColVars, <BUG>newDDVarNames, model.getNumModules(),</BUG> model.getModuleNames(), JDDVars.copyArray(model.getModuleDDRowVars()), JDDVars.copyArray(model.getModuleDDColVars()),
newModelVariables, model.getNumModules(),
45,541
newAllDDRowVars, newAllDDColVars, model.getAllDDSchedVars().copy(), model.getAllDDSynchVars().copy(), model.getAllDDChoiceVars().copy(), model.getAllDDNondetVars().copy(), <BUG>newDDVarNames, model.getNumModules(),</BUG> model.getModuleNames(), JDDVars.copyArray(model.getModuleDDRowVars()), JDDVars.copyArray(model.getModuleDDColVars()),
newModelVariables, model.getNumModules(),
45,542
private JDDNode[] varColRangeDDs; // dd giving range for each module variable (in col vars) private JDDNode[] varIdentities; // identity matrix for each module variable private JDDNode[] ddSynchVars; // individual dd vars for synchronising actions private JDDNode[] ddSchedVars; // individual dd vars for scheduling non-det. private JDDNode[] ddChoiceVars; // individual dd vars for local non-det. <BUG>private Vector<String> ddVarNames; private Vector<String> synchs; // list of action names</BUG> private JDDNode transActions; // dd for transition action labels (MDPs) private Vector<JDDNode> transPerAction; // dds for transition action labels (D/CTMCs) private JDDNode[] labelsArray;
private ModelVariablesDD modelVariables; private Vector<String> synchs; // list of action names
45,543
for (j = 0; j < n; j++) { vr = JDD.Var(ddVarsUsed++); vc = JDD.Var(ddVarsUsed++); varDDRowVars[i].addVar(vr); varDDColVars[i].addVar(vc); <BUG>ddVarNames.add(varList.getName(i) + "." + j); ddVarNames.add(varList.getName(i) + "'." + j); </BUG> }
modelVariables.allocateVariable(varList.getName(i) + "." + j); modelVariables.allocateVariable(varList.getName(i) + "'." + j);
45,544
catch (NoSuchStructureException nsse) { structure = JournalStructureLocalServiceUtil.getStructure( companyGroup.getGroupId(), article.getStructureId()); } articleElement.addAttribute("structure-uuid", structure.getUuid()); <BUG>if (structure.getGroupId() == companyGroup.getGroupId()) { exportStructure( portletDataContext, structuresElement, structure); }</BUG> }
exportStructure(portletDataContext, structuresElement, structure);
45,545
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
45,546
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_();
sink.lineBreak(); sink.section1_();
45,547
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
45,548
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
45,549
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_();
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
45,550
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
45,551
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
45,552
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
45,553
import java.io.IOException; import net.yacy.cora.protocol.RequestHeader; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; <BUG>import de.anomic.data.YMarkTables; import de.anomic.data.UserDB; import de.anomic.search.Switchboard;</BUG> import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch;
import de.anomic.data.ymark.YMarkTables; import de.anomic.data.ymark.YMarkUtil; import de.anomic.search.Switchboard;
45,554
byte[] urlHash = null; try { if(post.containsKey(YMarkTables.BOOKMARKS_ID)) { urlHash = post.get(YMarkTables.BOOKMARKS_ID).getBytes(); } else if(post.containsKey(YMarkTables.BOOKMARK.URL.key())) { <BUG>urlHash = YMarkTables.getBookmarkId(post.get(YMarkTables.BOOKMARK.URL.key())); </BUG> } else { prop.put("result", "0"); return prop;
urlHash = YMarkUtil.getBookmarkId(post.get(YMarkTables.BOOKMARK.URL.key()));
45,555
final String bmk_user = (isAuthUser ? user.getUserName() : YMarkTables.USER_ADMIN); String root = YMarkTables.FOLDERS_ROOT; String[] foldername = null; boolean isFolder = true; boolean isBookmark = false; <BUG>boolean isMetadata = false; boolean isWordCount = false;</BUG> if (post != null){ if (post.containsKey(ROOT)) { if (post.get(ROOT).equals(SOURCE) || post.get(ROOT).equals(YMarkTables.FOLDERS_ROOT)) {
boolean isURLdb = false; boolean isCrawlStart = false; boolean isWordCount = false;
45,556
prop.put("folders_"+count+"_hasChildren", "true"); //TODO: determine if folder has children prop.put("folders_"+count+"_comma", ","); count++; } } <BUG>try { it = sb.tables.bookmarks.folders.getBookmarkIds(bmk_user, root).iterator(); while (it.hasNext()) { final String urlHash = it.next(); bmk_row = sb.tables.select(YMarkTables.TABLES.BOOKMARKS.tablename(bmk_user), urlHash.getBytes());</BUG> if(bmk_row != null) {
if(!root.isEmpty()) { bit = sb.tables.bookmarks.getBookmarksByFolder(bmk_user, root); while (bit.hasNext()) { bmk_row = bit.next();
45,557
if(bmk_row != null) { final String url = UTF8.String(bmk_row.get(YMarkTables.BOOKMARK.URL.key())); final String title = bmk_row.get(YMarkTables.BOOKMARK.TITLE.key(), YMarkTables.BOOKMARK.TITLE.deflt()); if (post.containsKey("bmtype")) { if (post.get("bmtype").equals("title")) { <BUG>prop.put("folders_"+count+"_foldername", title); } else if (post.get("bmtype").equals("href")) { prop.put("folders_"+count+"_foldername", "<a href='"+url+" 'target='_blank'>"+title+"</a>");</BUG> }
prop.putJSON("folders_"+count+"_foldername", title); prop.putJSON("folders_"+count+"_foldername", "<a href='"+url+"' target='_blank'>"+title+"</a>");
45,558
} else if (post.get("bmtype").equals("href")) { prop.put("folders_"+count+"_foldername", "<a href='"+url+" 'target='_blank'>"+title+"</a>");</BUG> } } else { <BUG>prop.put("folders_"+count+"_foldername", url); </BUG> } prop.put("folders_"+count+"_expanded", "false"); prop.put("folders_"+count+"_url", url);
prop.putJSON("folders_"+count+"_foldername", "<a href='"+url+"' target='_blank'>"+title+"</a>"); prop.putJSON("folders_"+count+"_foldername", url);
45,559
count--; prop.put("folders_"+count+"_comma", ""); count++; prop.put("folders", count); } catch (IOException e) { <BUG>Log.logException(e); } catch (RowSpaceExceededException e) {</BUG> Log.logException(e); } } else if(isBookmark) {
[DELETED]
45,560
import net.yacy.cora.document.UTF8; import net.yacy.cora.protocol.RequestHeader; import net.yacy.kelondro.blob.Tables; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; <BUG>import de.anomic.data.YMarkTables; import de.anomic.search.Switchboard;</BUG> import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch;
import de.anomic.data.ymark.YMarkTables; import de.anomic.data.ymark.YMarkUtil; import de.anomic.search.Switchboard;
45,561
sb.tables.clear(YMarkTables.TABLES.FOLDERS.tablename(bmk_user)); sb.tables.clear(YMarkTables.TABLES.TAGS.tablename(bmk_user)); } catch (IOException e) { Log.logException(e); } <BUG>if (!post.get("rebuildindex", "").isEmpty()) try { sb.tables.bookmarks.folders.rebuildIndex(bmk_user); sb.tables.bookmarks.tags.rebuildIndex(bmk_user); } catch (IOException e) { Log.logException(e); }</BUG> if (!post.get("deleterows", "").isEmpty()) {
[DELETED]
45,562
} count = 0; try { Iterator<Tables.Row> mapIterator; if (post.containsKey("folders") && !post.get("folders").isEmpty()) { <BUG>mapIterator = sb.tables.orderByPK(sb.tables.bookmarks.folders.getBookmarks(bmk_user, post.get("folders")), maxcount).iterator(); } else if(post.containsKey("tags") && !post.get("tags").isEmpty()) { mapIterator = sb.tables.orderByPK(sb.tables.bookmarks.tags.getBookmarks(bmk_user, post.get("tags")), maxcount).iterator(); } else {</BUG> mapIterator = sb.tables.orderByPK(sb.tables.iterator(table, matcher), maxcount).iterator();
} catch (IOException e) { Log.logException(e);
45,563
prop.put("showtable_list_" + count + "_columns", columns.size()); count++; } } catch (IOException e) { Log.logException(e); <BUG>} catch (RowSpaceExceededException e) { Log.logException(e);</BUG> } prop.put("showtable_list", count); prop.put("showtable_num", count);
[DELETED]
45,564
import java.io.IOException; import java.util.HashMap; import net.yacy.cora.protocol.RequestHeader; import net.yacy.kelondro.index.RowSpaceExceededException; import net.yacy.kelondro.logging.Log; <BUG>import de.anomic.data.YMarkTables; import de.anomic.data.UserDB; import de.anomic.search.Switchboard;</BUG> import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch;
import de.anomic.data.ymark.YMarkTables; import de.anomic.data.ymark.YMarkUtil; import de.anomic.search.Switchboard;
45,565
final HashMap<String,String> data = new HashMap<String,String>(); data.put(YMarkTables.BOOKMARK.URL.key(), url); data.put(YMarkTables.BOOKMARK.TITLE.key(), post.get(YMarkTables.BOOKMARK.TITLE.key(),YMarkTables.BOOKMARK.TITLE.deflt())); data.put(YMarkTables.BOOKMARK.DESC.key(), post.get(YMarkTables.BOOKMARK.DESC.key(),YMarkTables.BOOKMARK.DESC.deflt())); data.put(YMarkTables.BOOKMARK.PUBLIC.key(), post.get(YMarkTables.BOOKMARK.PUBLIC.key(),YMarkTables.BOOKMARK.PUBLIC.deflt())); <BUG>data.put(YMarkTables.BOOKMARK.TAGS.key(), YMarkTables.cleanTagsString(post.get(YMarkTables.BOOKMARK.TAGS.key(),YMarkTables.BOOKMARK.TAGS.deflt()))); data.put(YMarkTables.BOOKMARK.FOLDERS.key(), YMarkTables.cleanFoldersString(post.get(YMarkTables.BOOKMARK.FOLDERS.key(),YMarkTables.FOLDERS_UNSORTED))); </BUG> try {
data.put(YMarkTables.BOOKMARK.TAGS.key(), YMarkUtil.cleanTagsString(post.get(YMarkTables.BOOKMARK.TAGS.key(),YMarkTables.BOOKMARK.TAGS.deflt()))); data.put(YMarkTables.BOOKMARK.FOLDERS.key(), YMarkUtil.cleanFoldersString(post.get(YMarkTables.BOOKMARK.FOLDERS.key(),YMarkTables.FOLDERS_UNSORTED)));
45,566
import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.UUID; import org.bukkit.Bukkit; <BUG>import org.bukkit.Location; import org.bukkit.World;</BUG> import org.bukkit.block.Block; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player;
import org.bukkit.OfflinePlayer; import org.bukkit.World;
45,567
private World world; private String name; public YamlConfiguration hconfig; public Hotel(World world, String name){ this.world = world; <BUG>this.name = name; this.hconfig = getHotelConfig();</BUG> } public Hotel(String name){ this.name = name;
this.name = name.toLowerCase(); this.hconfig = getHotelConfig();
45,568
} public boolean isInCreationMode(UUID uuid){ </BUG> return HotelsConfigHandler.getInventoryFile(uuid).exists(); } <BUG>public void hotelSetup(String hotelName, CommandSender s){ </BUG> Player p = (Player) s; if(hotelName.contains("-")){ p.sendMessage(Mes.mes("chat.creationMode.invalidChar")); return; } if(Mes.hasPerm(p, "hotels.create")){ p.sendMessage(Mes.mes("chat.noPermission")); return; }
public static boolean isInCreationMode(UUID uuid){ public static void hotelSetup(String hotelName, CommandSender s){
45,569
Selection sel = getWorldEdit().getSelection(p); Hotel hotel = new Hotel(p.getWorld(), hotelName); if(hotel.exists()){ p.sendMessage(Mes.mes("chat.creationMode.hotelCreationFailed")); return; } if(sel==null){ p.sendMessage(Mes.mes("chat.creationMode.noSelection")); return; } int ownedHotels = HotelsAPI.getHotelsOwnedBy(p.getUniqueId()).size(); <BUG>int maxHotels = plugin.getConfig().getInt("settings.max_hotels_owned"); </BUG> if(ownedHotels>maxHotels && !Mes.hasPerm(p, "hotels.create.admin")){ p.sendMessage((Mes.mes("chat.commands.create.maxHotelsReached")).replaceAll("%max%", String.valueOf(maxHotels))); return; }
int maxHotels = HotelsConfigHandler.getconfigyml().getInt("settings.max_hotels_owned");
45,570
else{ p.sendMessage(Mes.mes("chat.creationMode.selectionInvalid")); return; } hotel.create(r, p); Bukkit.getPluginManager().callEvent(new HotelCreateEvent(hotel)); //Call HotelCreateEvent } <BUG>public void roomSetup(String hotelName,int roomNum,Player p){ </BUG> Selection sel = getWorldEdit().getSelection(p); World world = p.getWorld(); Hotel hotel = new Hotel(world, hotelName);
public static void roomSetup(String hotelName, int roomNum, Player p){
45,571
Selection sel = getWorldEdit().getSelection(p); World world = p.getWorld(); Hotel hotel = new Hotel(world, hotelName); if(!hotel.exists()){ p.sendMessage(Mes.mes("chat.creationMode.rooms.fail")); return; } Room room = new Room(hotel, roomNum); <BUG>if(room.exists()){ p.sendMessage(Mes.mes("chat.creationMode.rooms.alreadyExists")); return; } ProtectedRegion pr = hotel.getRegion();</BUG> if(sel==null){ p.sendMessage(Mes.mes("chat.creationMode.noSelection")); return; } if((sel instanceof Polygonal2DSelection) && (pr.containsAny(((Polygonal2DSelection) sel).getNativePoints()))|| ((sel instanceof CuboidSelection) && (pr.contains(sel.getNativeMinimumPoint()) && pr.contains(sel.getNativeMaximumPoint())))){
RoomCreateEvent rce = new RoomCreateEvent(room); Bukkit.getPluginManager().callEvent(rce);// Call RoomCreateEvent if(rce.isCancelled()) return; ProtectedRegion pr = hotel.getRegion();
45,572
UUID playerUUID = p.getUniqueId(); File invFile = HotelsConfigHandler.getInventoryFile(playerUUID); if(invFile.exists()) invFile.delete(); } <BUG>public void saveInventory(CommandSender s){ </BUG> Player p = ((Player) s); UUID playerUUID = p.getUniqueId(); PlayerInventory pinv = p.getInventory();
public static void saveInventory(CommandSender s){
45,573
ArrayList<Hotel> hotels = new ArrayList<Hotel>(); for(ProtectedRegion r : WorldGuardManager.getRegions(w)){ String id = r.getId(); if(id.matches("hotel-\\w+$")){ String name = id.replaceFirst("hotel-", ""); <BUG>Hotel hotel = new Hotel(w,name); </BUG> hotels.add(hotel); } }
Hotel hotel = new Hotel(w, name);
45,574
for(World w : worlds) hotels.addAll(getHotelsInWorld(w)); return hotels; } public static ArrayList<Hotel> getHotelsOwnedBy(UUID uuid){ <BUG>ArrayList<Hotel> hotels = getAllHotels(); for(Hotel hotel : hotels){ if(!hotel.isOwner(uuid)) hotels.remove(hotel); } hotels.trimToSize(); return hotels; </BUG> }
ArrayList<Hotel> owned = new ArrayList<Hotel>(); if(hotel.isOwner(uuid)) owned.add(hotel); return owned;
45,575
import org.codehaus.groovy.control.CompilationUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public final class GroovyTreeParser implements TreeParser { private static final Logger logger = LoggerFactory.getLogger(GroovyTreeParser.class); <BUG>private static final String GROOVY_DEFAULT_INTERFACE = "groovy.lang.GroovyObject"; private static final String JAVA_DEFAULT_OBJECT = "java.lang.Object"; private Map<URI, Set<SymbolInformation>> fileSymbols = Maps.newHashMap(); private Map<String, Set<SymbolInformation>> typeReferences = Maps.newHashMap();</BUG> private final Supplier<CompilationUnit> unitSupplier;
private Indexer indexer = new Indexer();
45,576
if (scriptClass != null) { sourceUnit.getAST().getStatementBlock().getVariableScope().getDeclaredVariables().values().forEach( variable -> { SymbolInformation symbol = getVariableSymbolInformation(scriptClass.getName(), sourceUri, variable); <BUG>addToValueSet(newTypeReferences, variable.getType().getName(), symbol); symbols.add(symbol); }); } newFileSymbols.put(workspaceUriSupplier.get(sourceUri), symbols);</BUG> });
newIndexer.addSymbol(sourceUnit.getSource().getURI(), symbol); if (classes.containsKey(variable.getType().getName())) { newIndexer.addReference(classes.get(variable.getType().getName()), GroovyLocations.createLocation(sourceUri, variable.getType()));
45,577
} if (typeReferences.containsKey(foundSymbol.getName())) { foundReferences.addAll(typeReferences.get(foundSymbol.getName()));</BUG> } <BUG>return foundReferences; }</BUG> @Override public Set<SymbolInformation> getFilteredSymbols(String query) { checkNotNull(query, "query must not be null"); Pattern pattern = getQueryPattern(query);
}); sourceUnit.getAST().getStatementBlock() .visit(new MethodVisitor(newIndexer, sourceUri, sourceUnit.getAST().getScriptClassDummy(), classes, Maps.newHashMap(), Optional.absent(), workspaceUriSupplier));
45,578
<BUG>package com.palantir.ls.server.api; import io.typefox.lsapi.ReferenceParams;</BUG> import io.typefox.lsapi.SymbolInformation; import java.net.URI; import java.util.Map;
import com.google.common.base.Optional; import io.typefox.lsapi.Location; import io.typefox.lsapi.Position; import io.typefox.lsapi.ReferenceParams;
45,579
import java.util.Map; import java.util.Set; public interface TreeParser { void parseAllSymbols(); Map<URI, Set<SymbolInformation>> getFileSymbols(); <BUG>Map<String, Set<SymbolInformation>> getTypeReferences(); Set<SymbolInformation> findReferences(ReferenceParams params); Set<SymbolInformation> getFilteredSymbols(String query);</BUG> }
Map<Location, Set<Location>> getReferences(); Set<Location> findReferences(ReferenceParams params); Optional<Location> gotoDefinition(URI uri, Position position); Set<SymbolInformation> getFilteredSymbols(String query);
45,580
.workspaceSymbolProvider(true) .referencesProvider(true) .completionProvider(new CompletionOptionsBuilder() .resolveProvider(false) .triggerCharacter(".") <BUG>.build()) .build();</BUG> InitializeResult result = new InitializeResultBuilder() .capabilities(capabilities) .build();
.definitionProvider(true)
45,581
package com.palantir.ls.server; import com.palantir.ls.server.api.CompilerWrapper; import com.palantir.ls.server.api.TreeParser; import com.palantir.ls.server.api.WorkspaceCompiler; <BUG>import io.typefox.lsapi.FileEvent; import io.typefox.lsapi.PublishDiagnosticsParams;</BUG> import io.typefox.lsapi.ReferenceParams; import io.typefox.lsapi.SymbolInformation; import io.typefox.lsapi.TextDocumentContentChangeEvent;
import com.google.common.base.Optional; import io.typefox.lsapi.Location; import io.typefox.lsapi.Position; import io.typefox.lsapi.PublishDiagnosticsParams;
45,582
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 {
45,583
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));
45,584
} 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()
45,585
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));
45,586
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));
45,587
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 {
45,588
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);
45,589
import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; <BUG>import android.view.ViewGroup; import com.kyletung.doubanbookmovie.R;</BUG> public class HomeFragment extends Fragment { public HomeFragment() { }
import com.kyletung.doubanbookmovie.MyApplication; import com.kyletung.doubanbookmovie.R;
45,590
} @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_home, container, false); <BUG>ViewPager viewPager = (ViewPager) view.findViewById(R.id.fragment_home_viewpager); viewPager.setOffscreenPageLimit(1); viewPager.setAdapter(new HomePagerAdapter(getFragmentManager())); TabLayout tabLayout = (TabLayout) getActivity().findViewById(R.id.fragment_tablayout); tabLayout.setupWithViewPager(viewPager);</BUG> return view;
[DELETED]
45,591
package com.kyletung.doubanbookmovie; import android.app.Application; import android.content.Context; <BUG>import android.content.SharedPreferences; import com.android.volley.RequestQueue;</BUG> import com.android.volley.toolbox.Volley; public class MyApplication extends Application { private static Context context;
import android.support.design.widget.TabLayout; import com.android.volley.RequestQueue;
45,592
import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONException; import org.mariotaku.microblog.library.MicroBlog; import org.mariotaku.microblog.library.MicroBlogException; import org.mariotaku.microblog.library.twitter.model.RateLimitStatus; <BUG>import org.mariotaku.microblog.library.twitter.model.Status; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
45,593
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
45,594
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
45,595
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
45,596
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
45,597
import org.mariotaku.twidere.receiver.NotificationReceiver; import org.mariotaku.twidere.service.LengthyOperationsService; import org.mariotaku.twidere.util.ActivityTracker; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.DataStoreFunctionsKt; <BUG>import org.mariotaku.twidere.util.DataStoreUtils; import org.mariotaku.twidere.util.ImagePreloader;</BUG> import org.mariotaku.twidere.util.InternalTwitterContentUtils; import org.mariotaku.twidere.util.JsonSerializer; import org.mariotaku.twidere.util.NotificationManagerWrapper;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
45,598
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
45,599
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
45,600
import android.content.Context; import android.content.SharedPreferences; import android.location.Location; import android.os.AsyncTask; import android.support.annotation.NonNull; <BUG>import android.util.Log; import org.mariotaku.twidere.BuildConfig; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere.util.JsonSerializer;</BUG> import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.JsonSerializer;