id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
39,601
package com.Da_Technomancer.crossroads.API; import com.Da_Technomancer.crossroads.API.DefaultStorageHelper.DefaultStorage; import com.Da_Technomancer.crossroads.API.heat.DefaultHeatHandler; import com.Da_Technomancer.crossroads.API.heat.IHeatHandler; import com.Da_Technomancer.crossroads.API.magic.DefaultMagicHandler; <BUG>import com.Da_Technomancer.crossroads.API.magic.IMagicHandler; import com.Da_Technomancer.crossroads.API.rotary.DefaultRotaryHandler; import com.Da_Technomancer.crossroads.API.rotary.IRotaryHandler; </BUG> import net.minecraftforge.common.capabilities.Capability;
import com.Da_Technomancer.crossroads.API.rotary.DefaultAxleHandler; import com.Da_Technomancer.crossroads.API.rotary.DefaultCogHandler; import com.Da_Technomancer.crossroads.API.rotary.IAxleHandler; import com.Da_Technomancer.crossroads.API.rotary.ICogHandler;
39,602
import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityManager; public class Capabilities{ @CapabilityInject(IHeatHandler.class) <BUG>public static Capability<IHeatHandler> HEAT_HANDLER_CAPABILITY = null; @CapabilityInject(IRotaryHandler.class) public static Capability<IRotaryHandler> ROTARY_HANDLER_CAPABILITY = null; </BUG> @CapabilityInject(IMagicHandler.class)
@CapabilityInject(IAxleHandler.class) public static Capability<IAxleHandler> AXLE_HANDLER_CAPABILITY = null; @CapabilityInject(ICogHandler.class) public static Capability<ICogHandler> COG_HANDLER_CAPABILITY = null;
39,603
Metrics.SKIPPED_TESTS, Metrics.TEST_EXECUTION_TIME} ); } @Override <BUG>protected void display(FlowPanel header, Resource resource) { HorizontalPanel panel = new HorizontalPanel();</BUG> header.add(panel); Measure measure = resource.getMeasure(Metrics.TEST_SUCCESS_DENSITY); if (measure == null) {
Dictionary l10n = Dictionary.getDictionary("l10n"); HorizontalPanel panel = new HorizontalPanel();
39,604
package org.sonar.plugins.core.testdetailsviewer.client; import com.google.gwt.gen2.table.override.client.FlexTable; <BUG>import com.google.gwt.gen2.table.override.client.FlexTable.FlexCellFormatter; import com.google.gwt.user.client.DOM;</BUG> import com.google.gwt.user.client.ui.*; import com.google.gwt.xml.client.Document; import com.google.gwt.xml.client.Element;
import com.google.gwt.i18n.client.Dictionary; import com.google.gwt.user.client.DOM;
39,605
System.out.println(change); } } }; @Override <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { return (child) -> {
protected Callback<VChild, Void> copyIntoCallback()
39,606
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
39,607
VEVENT ("VEVENT", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_END, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, PropertyType.EXCEPTION_DATE_TIMES, <BUG>PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,</BUG> PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS, PropertyType.SUMMARY, PropertyType.TIME_TRANSPARENCY, PropertyType.UNIQUE_IDENTIFIER,
PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,
39,608
VTODO ("VTODO", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_COMPLETED, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_DUE, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, <BUG>PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,</BUG> PropertyType.PERCENT_COMPLETE, PropertyType.PRIORITY, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS,
PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,
39,609
throw new RuntimeException("not implemented"); } }, DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, <BUG>PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,</BUG> PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class) {
PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,
39,610
throw new RuntimeException("not implemented"); } }, VALARM ("VALARM", Arrays.asList(PropertyType.ACTION, PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.DESCRIPTION, <BUG>PropertyType.DURATION, PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.REPEAT_COUNT, PropertyType.SUMMARY, PropertyType.TRIGGER),</BUG> VAlarm.class) { @Override
DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM, PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class)
39,611
private ContentLineStrategy contentLineGenerator; protected void setContentLineGenerator(ContentLineStrategy contentLineGenerator) { this.contentLineGenerator = contentLineGenerator; } <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { throw new RuntimeException("Can't copy children. copyChildCallback isn't overridden in subclass." + this.getClass()); };
protected Callback<VChild, Void> copyIntoCallback()
39,612
import jfxtras.labs.icalendarfx.properties.calendar.Version; import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty; public enum CalendarProperty { CALENDAR_SCALE ("CALSCALE", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), CalendarScale.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), CalendarScale.class)
39,613
CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); } }, METHOD ("METHOD", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Method.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
39,614
} list.add(new NonStandardProperty((NonStandardProperty) child)); } }, PRODUCT_IDENTIFIER ("PRODID", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), ProductIdentifier.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
public void copyChild(VChild child, VCalendar destination) CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); METHOD ("METHOD", Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
39,615
ProductIdentifier productIdentifier = (ProductIdentifier) child; destination.setProductIdentifier(productIdentifier); } }, VERSION ("VERSION", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Version.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Version.class)
39,616
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
39,617
commandLine.add("-Xmx" + compilerSettings.MAXIMUM_HEAP_SIZE + "m"); CompilerUtil.addLocaleOptions(commandLine, false); commandLine.add("-classpath"); commandLine.add(PATH_TO_COMPILER_JAR); commandLine.add(getCompilerClass()); <BUG>addCommandLineOptions(commandLine, chunk, outputPath, compilerSettings, useTempFile); </BUG> } public void addCommandLineOptions(@NonNls final ArrayList<String> commandLine, final ModuleChunk chunk,
addCommandLineOptions(commandLine, chunk, outputPath, compilerSettings, useTempFile, true);
39,618
} public void addCommandLineOptions(@NonNls final ArrayList<String> commandLine, final ModuleChunk chunk, final String outputPath, final EclipseCompilerSettings compilerSettings, <BUG>final boolean useTempFile) throws IOException { final ProjectJdk jdk = chunk.getJdk();</BUG> final String versionString = jdk.getVersionString(); if (versionString == null || "".equals(versionString)) { throw new IllegalArgumentException(CompilerBundle.message("javac.error.unknown.jdk.version", jdk.getName()));
final boolean useTempFile, boolean quoteBootClasspath) throws IOException { final ProjectJdk jdk = chunk.getJdk();
39,619
commandLine.add("1.3"); } final String bootCp = chunk.getCompilationBootClasspath(); final String classPath = chunk.getCompilationClasspath(); commandLine.add("-bootclasspath"); <BUG>commandLine.add(CompilerUtil.quotePath(bootCp)); </BUG> commandLine.add("-classpath"); commandLine.add(classPath); commandLine.add("-d");
commandLine.add(quoteBootClasspath ? CompilerUtil.quotePath(bootCp) : bootCp);
39,620
private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.impl.javaCompiler.eclipse.EclipseCompilerDriver"); private String[] sourceFilePaths; private Map compilerOptions; private final BlockingQueue<CompilationResult> myCompilationResults = new LinkedBlockingQueue<CompilationResult>(); private FileSystem classPath; <BUG>public static void main(String[] args) throws Exception { IEclipseCompilerDriver d = new EclipseCompilerDriver(); d.parseCommandLineAndCompile(args); }</BUG> private void parseCommandLine(String[] args) throws InvalidInputException {
[DELETED]
39,621
public String toString() { return path; } } class NewParam { <BUG>private String key, description, exampleValue; </BUG> private boolean required = false; private String[] possibleValues = null; private NewParam(String key) {
private String key, description, exampleValue, defaultValue;
39,622
return key; } } @Immutable class Param { <BUG>private final String key, description, exampleValue; </BUG> private final boolean required; private final String[] possibleValues; public Param(NewParam newParam) {
private final String key, description, exampleValue, defaultValue;
39,623
private final boolean required; private final String[] possibleValues; public Param(NewParam newParam) { this.key = newParam.key; this.description = newParam.description; <BUG>this.exampleValue = newParam.exampleValue; this.required = newParam.required;</BUG> this.possibleValues = (newParam.possibleValues == null ? new String[0] : newParam.possibleValues); } public String key() {
this.defaultValue = newParam.defaultValue; this.required = newParam.required;
39,624
public boolean isRequired() { return required; } public String[] possibleValues() { return possibleValues; <BUG>} @Override</BUG> public String toString() { return key; }
@CheckForNull public String defaultValue() { return defaultValue; @Override
39,625
assertThat(action.params()).hasSize(2); assertThat(action.param("key").key()).isEqualTo("key"); assertThat(action.param("key").description()).isEqualTo("Key of the new rule"); assertThat(action.param("key").toString()).isEqualTo("key"); assertThat(action.param("severity").key()).isEqualTo("severity"); <BUG>assertThat(action.param("severity").description()).isNull(); }</BUG> @Test public void fail_if_duplicated_action_parameters() { try {
assertThat(action.param("severity").defaultValue()).isEqualTo("MAJOR"); }
39,626
errors.add(Message.of("Bad request reason #" + count)); } throw BadRequestException.of(errors); } }); <BUG>newController.createAction("fail_with_multiple_i18n_messages") .setHandler(new RequestHandler() {</BUG> @Override public void handle(Request request, Response response) { List<BadRequestException.Message> errors = Lists.newArrayList();
.createParam("count", "Number of error messages to generate") .setHandler(new RequestHandler() {
39,627
import org.picocontainer.Startable; import org.slf4j.LoggerFactory; import org.sonar.api.ServerComponent; import org.sonar.api.i18n.I18n; import org.sonar.api.server.ws.Request; <BUG>import org.sonar.api.server.ws.WebService; import org.sonar.api.utils.text.JsonWriter;</BUG> import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.BadRequestException.Message; import org.sonar.server.exceptions.ServerException;
import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.utils.text.JsonWriter;
39,628
public void execute(InternalRequest request, ServletResponse response, String controllerPath, String actionKey) { try { WebService.Action action = getAction(controllerPath, actionKey); request.setAction(action); <BUG>verifyRequest(action, request); action.handler().handle(request, response); </BUG> } catch (IllegalArgumentException e) { sendError(400, e.getMessage(), response);
InternalRequest wrapped = wrapWithDefaults(action, request); action.handler().handle(wrapped, response);
39,629
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
39,630
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
39,631
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != null) { c.moveToFirst(); }
MemoEntry.COLUMN_ORDER + " ASC", null);
39,632
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
39,633
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode { </BUG> private List<MemoEntity> memoList;
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
39,634
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) { this.mActivity = activity;</BUG> this.topicId = topicId; this.memoList = memoList;
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
39,635
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
39,636
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;
39,637
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 PatchUtils {
import java.text.DateFormat; import java.util.Date; import java.util.List;
39,638
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;
39,639
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"), MISC_FILES("misc-files"),
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
39,640
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_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
[DELETED]
39,641
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, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
39,642
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> import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
import org.jboss.logging.annotations.Cause; import java.io.IOException;
39,643
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 maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
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
39,644
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 IndexColorModel if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = 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++) {
39,645
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++) {
39,646
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 maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
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
39,647
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 += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
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++) {
39,648
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 maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
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
39,649
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 += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
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++) {
39,650
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 maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
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
39,651
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 += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
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++) {
39,652
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 maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
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
39,653
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 += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
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++) {
39,654
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 maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
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
39,655
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 += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
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++) {
39,656
@SideOnly(Side.CLIENT) public class GuiSeedAnalyzer extends GuiContainer { public static final ResourceLocation texture = new ResourceLocation(Reference.MOD_ID, "textures/gui/GuiSeedAnalyzer.png"); public TileEntitySeedAnalyzer seedAnalyzer; private boolean journalOpen; <BUG>private GuiJournal guiJournal; </BUG> public GuiSeedAnalyzer(InventoryPlayer inventory, TileEntitySeedAnalyzer seedAnalyzer) { super(new ContainerSeedAnalyzer(inventory, seedAnalyzer)); this.seedAnalyzer = seedAnalyzer;
private AgriGuiWrapper guiJournal;
39,657
return; } ItemStack journal = seedAnalyzer.getStackInSlot(ContainerSeedAnalyzer.journalSlotId); if(journal != null) { journalOpen = true; <BUG>guiJournal = new GuiJournal(journal); </BUG> guiJournal.setWorldAndResolution(this.mc, this.width, this.height); } }
guiJournal = new AgriGuiWrapper(new GuiJournal(journal));
39,658
public int ap; public AsyncChunkWriteActionListener l; public void run() { try { if(Arrays.equals(this.hash, k)) <BUG>this.hl = new InsertRecord(false,0); </BUG> else if (Main.chunkStoreLocal) this.hl = HCServiceProxy.writeChunk(this.hash, this.chunk); else
this.hl = new InsertRecord(false,1);
39,659
if (closed) { this.failed = true; return; } mp.iterInit(); <BUG>SparseDataChunk ck = mp.nextValue(false); while (ck != null) {</BUG> if (closed) { this.failed = true; return;
[DELETED]
39,660
private transient ThreadPoolExecutor executor = new ThreadPoolExecutor( Main.writeThreads + 1, Main.writeThreads + 1, 10, TimeUnit.SECONDS, worksQueue, new ProcessPriorityThreadFactory(Thread.MIN_PRIORITY), executionHandler); private static EventBus eventBus = new EventBus(); <BUG>public SyncFS() throws IOException { this.init();</BUG> } public SyncFS(String now) throws IOException { fEvt = SDFSEvent
.fdiskInfoEvent("Starting Cloud Storage Conistancy Check for " + Main.volume.getName() ); this.init();
39,661
import com.google.common.cache.RemovalListener; import com.google.common.cache.RemovalNotification; public class DedupFileStore { private static boolean closing = false; private static OpenFileMonitor openFileMonitor = null; <BUG>private static ConcurrentHashMap<String, DedupFile> openFile = new ConcurrentHashMap<String, DedupFile>(); </BUG> private static LoadingCache<ByteLongArrayWrapper, AtomicLong> keyLookup = CacheBuilder.newBuilder() .maximumSize(1_000_000).concurrencyLevel(Main.writeThreads) .removalListener(new RemovalListener<ByteLongArrayWrapper, AtomicLong>() {
private static ConcurrentHashMap<String, SparseDedupFile> openFile = new ConcurrentHashMap<String, SparseDedupFile>();
39,662
} finally { getDFLock.unlock(); } } public static boolean addRef(byte[] entry, long val) throws IOException { <BUG>if (val == 0) return true;</BUG> try { if(!Main.refCount || Arrays.equals(entry, WritableCacheBuffer.bk)) return true;
if (val == 1 || val == 0)
39,663
} } finally { } } public static boolean removeRef(byte[] entry, long val) throws IOException { <BUG>if (val == 0) return true;</BUG> try { if(!Main.refCount || Arrays.equals(entry, WritableCacheBuffer.bk)) return true;
public static boolean addRef(byte[] entry, long val) throws IOException { if (val == 1 || val == 0)
39,664
long handleGen = 0; public static void registerListener(Object obj) { eventBus.register(obj); } public SDFSFileSystem(String mountedVolume, String mountPoint) { <BUG>SDFSLogger.getLog().info( "mounting " + mountedVolume + " to " + mountPoint); </BUG> this.mountedVolume = mountedVolume; if (!this.mountedVolume.endsWith("/"))
SDFSLogger.getLog().info("mounting " + mountedVolume + " to " + mountPoint);
39,665
try { MetaDataDedupFile mf = MetaFileStore.getMF(f); mf.setMode(mode); } catch (Exception e) { SDFSLogger.getLog().warn("access denied for " + path, e); <BUG>throw new FuseException("access denied for " + path) .initErrno(Errno.EACCES);</BUG> } finally { }
File f = resolvePath(path); int ftype = this.getFtype(path); if (ftype == FuseFtypeConstants.TYPE_SYMLINK || ftype == FuseFtypeConstants.TYPE_DIR) { Path p = Paths.get(f.getPath()); Files.setAttribute(p, "unix:mode", Integer.valueOf(mode), LinkOption.NOFOLLOW_LINKS); } catch (IOException e) { throw new FuseException("access denied for " + path).initErrno(Errno.EACCES); path = null;
39,666
MetaDataDedupFile mf = MetaFileStore.getMF(f); mf.setOwner_id(uid); mf.setGroup_id(gid); } catch (Exception e) { SDFSLogger.getLog().warn("access denied for " + path, e); <BUG>throw new FuseException("access denied for " + path) .initErrno(Errno.EACCES);</BUG> } finally { }
mf.setMode(mode); throw new FuseException("access denied for " + path).initErrno(Errno.EACCES);
39,667
ch = this.dedupChannels.get(handleNo); } else { this.dedupChannels.put(handleNo, ch); } } catch (Exception e) { <BUG>} finally { SDFSLogger.getLog().debug( "number of channels is " + this.dedupChannels.size());</BUG> }
[DELETED]
39,668
SDFSLogger.getLog().debug( "number of channels is " + this.dedupChannels.size());</BUG> } } catch (Exception e) { <BUG>SDFSLogger.getLog().error("unable to open file" + f.getPath(), e); throw new FuseException("unable to open file " + path) .initErrno(Errno.EINVAL);</BUG> }
ch = this.dedupChannels.get(handleNo); } else { this.dedupChannels.put(handleNo, ch); } finally { SDFSLogger.getLog().debug("number of channels is " + this.dedupChannels.size());
39,669
DedupFileChannel ch = this.getFileChannel(path, (Long) fh, -1); try { ch.force(true); } catch (Exception e) { SDFSLogger.getLog().error("unable to sync file [" + path + "]", e); <BUG>throw new FuseException("unable to sync file") .initErrno(Errno.EACCES);</BUG> } finally { }
throw new FuseException("unable to sync file").initErrno(Errno.EACCES);
39,670
+ ch.getDedupFile().getGUID());</BUG> ch.force(true); } } catch (Exception e) { SDFSLogger.getLog().error("unable to sync file [" + path + "]", e); <BUG>throw new FuseException("unable to sync file") .initErrno(Errno.EACCES);</BUG> } finally { }
if (Main.volume.isOffLine()) throw new FuseException("volume offline").initErrno(Errno.ENAVAIL); try { DedupFileChannel ch = this.getFileChannel(path, (Long) fh, -1); if (Main.safeSync) { if (SDFSLogger.isDebug()) SDFSLogger.getLog().debug("sync " + path + " df=" + ch.getDedupFile().getGUID()); throw new FuseException("unable to sync file").initErrno(Errno.EACCES);
39,671
} finally { } return 0; } @Override <BUG>public int getattr(String path, FuseGetattrSetter getattrSetter) throws FuseException {</BUG> try { int ftype = this.getFtype(path);
public int getattr(String path, FuseGetattrSetter getattrSetter) throws FuseException {
39,672
} int atime = 0; int ctime = 0; int mtime = 0; long fileLength = 0; <BUG>attrs = Files.readAttributes(p, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);</BUG> fileLength = attrs.size(); mtime = (int) (attrs.lastModifiedTime().toMillis() / 1000L);
attrs = Files.readAttributes(p, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
39,673
LinkOption.NOFOLLOW_LINKS);</BUG> fileLength = attrs.size(); mtime = (int) (attrs.lastModifiedTime().toMillis() / 1000L); atime = (int) (attrs.lastAccessTime().toMillis() / 1000L); ctime = (int) (attrs.creationTime().toMillis() / 1000L); <BUG>getattrSetter.set(p.hashCode(), mode, 1, uid, gid, 0, fileLength, (fileLength * NAME_LENGTH + BLOCK_SIZE - 1) / BLOCK_SIZE, atime, mtime, ctime);</BUG> } catch (Exception e) {
} int atime = 0; int ctime = 0; int mtime = 0; long fileLength = 0; attrs = Files.readAttributes(p, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); getattrSetter.set(p.hashCode(), mode, 1, uid, gid, 0, fileLength, (fileLength * NAME_LENGTH + BLOCK_SIZE - 1) / BLOCK_SIZE, atime, mtime, ctime);
39,674
int mode = (Integer) Files.getAttribute(p, "unix:mode"); MetaDataDedupFile mf = MetaFileStore.getFolder(f); int atime = (int) (mf.getLastAccessed() / 1000L); int mtime = (int) (mf.lastModified() / 1000L); int ctime = (int) (0 / 1000L); <BUG>long fileLength = f.length(); getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength * NAME_LENGTH, (fileLength * NAME_LENGTH + BLOCK_SIZE - 1) / BLOCK_SIZE, atime, mtime, ctime);</BUG> } else {
getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength * NAME_LENGTH, (fileLength * NAME_LENGTH + BLOCK_SIZE - 1) / BLOCK_SIZE, atime, mtime, ctime);
39,675
int gid = mf.getGroup_id(); int mode = mf.getMode(); int atime = (int) (mf.getLastAccessed() / 1000L); int ctime = (int) (0 / 1000L); int mtime = (int) (mf.lastModified() / 1000L); <BUG>long fileLength = mf.length(); long actualBytes = (mf.getIOMonitor() .getActualBytesWritten() * 2) / 1024; if (actualBytes == 0 && mf.getIOMonitor().getActualBytesWritten() > 0) actualBytes = (Main.CHUNK_LENGTH * 2) / 1024; getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength, actualBytes, atime,</BUG> mtime, ctime);
long actualBytes = (mf.getIOMonitor().getActualBytesWritten() * 2) / 1024; if (actualBytes == 0 && mf.getIOMonitor().getActualBytesWritten() > 0) getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength, actualBytes, atime,
39,676
actualBytes = (Main.CHUNK_LENGTH * 2) / 1024; getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength, actualBytes, atime,</BUG> mtime, ctime); } <BUG>} catch (Exception e) { SDFSLogger.getLog().error( "unable to parse attributes " + path + " at physical path " + f.getPath(), e);</BUG> throw new FuseException().initErrno(Errno.EACCES);
getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength, actualBytes, atime, SDFSLogger.getLog().error("unable to parse attributes " + path + " at physical path " + f.getPath(),
39,677
dirFiller.add("..", "..".hashCode(), FuseFtypeConstants.TYPE_DIR);</BUG> for (int i = 0; i < mfs.length; i++) { File _mf = mfs[i]; <BUG>dirFiller.add(_mf.getName(), _mf.hashCode(), this.getFtype(_mf));</BUG> } } catch (Exception e) { SDFSLogger.getLog().error("unable to read path " + path, e);
try { File f = null; try { f = resolvePath(path); File[] mfs = f.listFiles(); dirFiller.add(".", ".".hashCode(), FuseFtypeConstants.TYPE_DIR); dirFiller.add("..", "..".hashCode(), FuseFtypeConstants.TYPE_DIR); dirFiller.add(_mf.getName(), _mf.hashCode(), this.getFtype(_mf));
39,678
SDFSLogger.getLog().error("unable to read path " + path, e); throw new FuseException().initErrno(Errno.EACCES); } finally { f = null; } <BUG>} finally { }</BUG> return 0; } @Override
} catch (FuseException e) { throw e; } catch (Exception e) { SDFSLogger.getLog().error(path, e);
39,679
@Override public int mkdir(String path, int mode) throws FuseException { try { File f = new File(this.mountedVolume + path); if (Main.volume.isOffLine()) <BUG>throw new FuseException("volume offline") .initErrno(Errno.ENAVAIL);</BUG> if (Main.volume.isFull()) throw new FuseException("Volume Full").initErrno(Errno.ENOSPC);
public int link(String from, String to) throws FuseException { throw new FuseException("error hard linking is not supported").initErrno(Errno.ENOSYS); } throw new FuseException("volume offline").initErrno(Errno.ENAVAIL);
39,680
@Override public int mknod(String path, int mode, int rdev) throws FuseException { try { File f = new File(this.mountedVolume + path); if (Main.volume.isOffLine()) <BUG>throw new FuseException("volume offline") .initErrno(Errno.ENAVAIL); if (Main.volume.isFull()) throw new FuseException("Volume Full").initErrno(Errno.ENOSPC); if (f.exists()) {</BUG> f = null;
public int link(String from, String to) throws FuseException { throw new FuseException("error hard linking is not supported").initErrno(Errno.ENOSYS); } public int mkdir(String path, int mode) throws FuseException { throw new FuseException("volume offline").initErrno(Errno.ENAVAIL);
39,681
read = 0; } catch (DataArchivedException e) { throw new FuseException("File Archived").initErrno(Errno.ENODATA); } catch (Exception e) { SDFSLogger.getLog().error("unable to read file " + path, e); <BUG>throw new FuseException("error reading " + path) .initErrno(Errno.ENODATA); } finally {</BUG> }
throw new FuseException("error reading " + path).initErrno(Errno.ENODATA);
39,682
public int readlink(String path, CharBuffer link) throws FuseException { Path p = Paths.get(this.mountedVolume + path); try { String lpath = Files.readSymbolicLink(p).toString(); if (lpath.startsWith(this.mountedVolume)) <BUG>lpath = this.mountPoint + lpath.substring(this.mountedVolume.length()); </BUG> link.put(lpath); } catch (Exception e) {
lpath = this.mountPoint + lpath.substring(this.mountedVolume.length());
39,683
+ lpath.substring(this.mountedVolume.length()); </BUG> link.put(lpath); } catch (Exception e) { SDFSLogger.getLog().error("error getting linking " + path, e); <BUG>throw new FuseException("error getting linking " + path) .initErrno(Errno.EACCES);</BUG> } finally { p = null;
public int readlink(String path, CharBuffer link) throws FuseException { Path p = Paths.get(this.mountedVolume + path); try { String lpath = Files.readSymbolicLink(p).toString(); if (lpath.startsWith(this.mountedVolume)) lpath = this.mountPoint + lpath.substring(this.mountedVolume.length()); throw new FuseException("error getting linking " + path).initErrno(Errno.EACCES);
39,684
boolean del = MetaFileStore.removeMetaFile(f.getPath()); if (del)</BUG> return 0; else { <BUG>if (SDFSLogger.isDebug()) SDFSLogger.getLog().debug( "unable to delete folder " + f.getPath()); throw new FuseException() .initErrno(Errno.ENOTEMPTY);</BUG> }
} else { File f = resolvePath(path); if (f.getName().equals(".") || f.getName().equals("..")) try { if (MetaFileStore.removeMetaFile(f.getPath(), false, false)) SDFSLogger.getLog().debug("unable to delete folder " + f.getPath()); throw new FuseException().initErrno(Errno.ENOTEMPTY);
39,685
.initErrno(Errno.ENOTEMPTY);</BUG> } <BUG>} catch (FuseException e) { throw e; } catch (Exception e) { SDFSLogger.getLog().debug( "unable to delete folder " + f.getPath()); </BUG> throw new FuseException().initErrno(Errno.EACCES);
} else { File f = resolvePath(path); if (f.getName().equals(".") || f.getName().equals("..")) return 0; else { try { if (MetaFileStore.removeMetaFile(f.getPath(), false, false)) return 0; else { if (SDFSLogger.isDebug()) SDFSLogger.getLog().debug("unable to delete folder " + f.getPath()); throw new FuseException().initErrno(Errno.ENOTEMPTY);
39,686
if (from.startsWith(this.mountPoint)) { from = from.substring(mountPoint.length()); this.resolvePath(from); src = new File(mountedVolume + from); } else if (!Main.allowExternalSymlinks) { <BUG>SDFSLogger.getLog().error( "external symlinks are not allowed " + from + " to " + to);</BUG> throw new FuseException().initErrno(Errno.EACCES);
SDFSLogger.getLog().error("external symlinks are not allowed " + from + " to " + to);
39,687
} Path srcP = Paths.get(src.getPath()); Path dstP = Paths.get(dst.getPath()); try { Files.createSymbolicLink(dstP, srcP); <BUG>eventBus.post(new MFileWritten(MetaFileStore.getMF(dst .getPath()))); } catch (IOException e) { SDFSLogger.getLog().error( "error linking " + from + " to " + to, e);</BUG> throw new FuseException().initErrno(Errno.EACCES);
return 0;
39,688
SDFSLogger.getLog().debug("removing " + path); if (!Main.safeClose) { try { this.getFileChannel(path, -1).getDedupFile().forceClose(); } catch (IOException e) { <BUG>SDFSLogger.getLog() .error("unable to close file " + path, e); </BUG> } }
SDFSLogger.getLog().error("unable to close file " + path, e);
39,689
} else { File f = this.resolvePath(path); try { if (MetaFileStore.removeMetaFile(f.getPath())) { return 0; <BUG>} else { SDFSLogger.getLog().warn( "unable to delete folder " + f.getPath());</BUG> throw new FuseException().initErrno(Errno.ENOSYS); }
SDFSLogger.getLog().warn("unable to delete file " + f.getPath());
39,690
} catch (Exception e) { SDFSLogger.getLog().error("unable to file file " + path, e); throw new FuseException().initErrno(Errno.EACCES); } } <BUG>} finally { }</BUG> } @Override public int utime(String path, int atime, int mtime) throws FuseException {
} catch (FuseException e) { throw e; SDFSLogger.getLog().error(path, e);
39,691
} finally { } return 0; } @Override <BUG>public int write(String path, long fh, boolean isWritepage, ByteBuffer buf, long offset) throws FuseException {</BUG> if (Main.volume.isOffLine()) throw new FuseException("volume offline").initErrno(Errno.ENAVAIL);
public int write(String path, long fh, boolean isWritepage, ByteBuffer buf, long offset) throws FuseException {
39,692
ch.writeFile(buf, buf.capacity(), 0, offset, true); } catch (Exception e) { SDFSLogger.getLog().error("unable to write to file" + path, e); throw new FuseException().initErrno(Errno.EACCES); } <BUG>} finally { }</BUG> return 0; } private File resolvePath(String path) throws FuseException {
} catch (FuseException e) { throw e; SDFSLogger.getLog().debug(path, e);
39,693
view.read(name, dst); } } } catch (java.nio.file.FileSystemException e) { if (SDFSLogger.isDebug()) <BUG>SDFSLogger.getLog() .debug("error getting exattr for " + path, e); </BUG> throw new FuseException().initErrno(Errno.ENODATA); } catch (Exception e) {
SDFSLogger.getLog().debug("error getting exattr for " + path, e);
39,694
public int getxattr(String path, String name, ByteBuffer dst, int position) throws FuseException, BufferOverflowException { this.resolvePath(path); try { int ftype = this.getFtype(path); <BUG>if (ftype != FuseFtypeConstants.TYPE_SYMLINK) { if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse"))</BUG> dst.put(sdfsCmds.getAttr(name, path).getBytes());
if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse"))
39,695
|| name.startsWith("user.dse"))</BUG> dst.put(sdfsCmds.getAttr(name, path).getBytes()); else { File f = this.resolvePath(path); Path _p = f.toPath(); <BUG>UserDefinedFileAttributeView view = Files .getFileAttributeView(_p,</BUG> UserDefinedFileAttributeView.class); view.read(name, dst);
public int getxattr(String path, String name, ByteBuffer dst, int position) throws FuseException, BufferOverflowException { try { int ftype = this.getFtype(path); if (ftype != FuseFtypeConstants.TYPE_SYMLINK) { if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse")) UserDefinedFileAttributeView view = Files.getFileAttributeView(_p,
39,696
view.read(name, dst); } } } catch (java.nio.file.FileSystemException e) { if (SDFSLogger.isDebug()) <BUG>SDFSLogger.getLog() .debug("error getting exattr for " + path, e); </BUG> throw new FuseException().initErrno(Errno.ENODATA); } catch (FuseException e) {
SDFSLogger.getLog().debug("error getting exattr for " + path, e);
39,697
} finally { } return 0; } @Override <BUG>public int setxattr(String path, String name, ByteBuffer value, int flags, int position) throws FuseException {</BUG> this.resolvePath(path); try {
public int setxattr(String path, String name, ByteBuffer value, int flags, int position) throws FuseException {
39,698
this.resolvePath(path); try { byte valB[] = new byte[value.capacity()]; value.get(valB); String valStr = new String(valB); <BUG>if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse")) {</BUG> sdfsCmds.runCMD(path, name, valStr); } else {
if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse")) {
39,699
|| name.startsWith("user.dse")) {</BUG> sdfsCmds.runCMD(path, name, valStr); } else { File f = this.resolvePath(path); Path _path = f.toPath(); <BUG>UserDefinedFileAttributeView view = Files.getFileAttributeView( _path, UserDefinedFileAttributeView.class); view.write(name, value);</BUG> MetaDataDedupFile mf = MetaFileStore.getMF(f);
try { byte valB[] = new byte[value.capacity()]; value.get(valB); String valStr = new String(valB); if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse")) { UserDefinedFileAttributeView view = Files.getFileAttributeView(_path, view.write(name, value);
39,700
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.List; <BUG>import java.util.Optional; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandDelete extends FCCommandBase { private static final FlagMapper MAPPER = map -> key -> value -> { map.put(key, value);
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;