id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
19,101 | 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++) {
|
19,102 | 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
|
19,103 | 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++) {
|
19,104 | }else if(programsSelected.size() == 1){
lytProgsPanel.setVisibility(View.VISIBLE);
lytProg2MAHAdsExtDlg.setVisibility(View.GONE);
prog1 = programsSelected.get(0);
((TextView)view.findViewById(R.id.tvProg1NameMAHAdsExtDlg)).setText(prog1.getName());
<BUG>if (prog1.getImg() != null && !prog1.getImg().trim().isEmpty()) {
((SmartImageView)view.findViewById(R.id.ivProg1ImgMAHAds)).setImageUrl(MAHAdsController.urlRootOnServer + prog1.getImg());
}
AngledLinearLayout prog1LytNewText = (AngledLinearLayout)view.findViewById(R.id.lytProg1NewText);</BUG>
if(prog1.isNewPrgram()){
| Picasso.with(view.getContext())
.load(MAHAdsController.urlRootOnServer + prog1.getImg())
.placeholder(R.drawable.img_place_holder_normal)
.error(R.drawable.img_not_found)
.into((ImageView) view.findViewById(R.id.ivProg1ImgMAHAds));
AngledLinearLayout prog1LytNewText = (AngledLinearLayout)view.findViewById(R.id.lytProg1NewText);
|
19,105 | ImageMode getImageMode();
void setNumberOfBlocksPerRow(final int numberOfBlocksPerRow);
int getNumberOfBlocksPerRow();
void setNumberOfBlocksPerColumn(final int numberOfBlocksPerColumn);
int getNumberOfBlocksPerColumn();
<BUG>void setNumberOfPixelsPerBlockHorizontal(final int numberOfPixelsPerBlockHorizontal);
int getNumberOfPixelsPerBlockHorizontal();
void setNumberOfPixelsPerBlockVertical(final int numberOfPixelsPerBlockVertical);
int getNumberOfPixelsPerBlockVertical();
void setNumberOfBitsPerPixelPerBand(final int numberOfBitsPerPixelPerBand);</BUG>
int getNumberOfBitsPerPixelPerBand();
| void setNumberOfPixelsPerBlockHorizontalRaw(final int numberOfPixelsPerBlockHorizontal);
int getNumberOfPixelsPerBlockHorizontalRaw();
long getNumberOfPixelsPerBlockHorizontal();
void setNumberOfPixelsPerBlockVerticalRaw(final int numberOfPixelsPerBlockVertical);
int getNumberOfPixelsPerBlockVerticalRaw();
long getNumberOfPixelsPerBlockVertical();
void setNumberOfBitsPerPixelPerBand(final int numberOfBitsPerPixelPerBand);
|
19,106 | assertThat(nitfImageSegmentHeader.getImageLocationRow(), is(ILOC_ROW));
assertThat(nitfImageSegmentHeader.getImageLocationColumn(), is(ILOC_COL));
assertThat(nitfImageSegmentHeader.getAttachmentLevel(), is(IALVL));
assertThat(nitfImageSegmentHeader.getImageDisplayLevel(), is(IDLVL));
assertThat(nitfImageSegmentHeader.getNumberOfBitsPerPixelPerBand(), is(NBPP));
<BUG>assertThat(nitfImageSegmentHeader.getNumberOfPixelsPerBlockHorizontal(), is(NPPBH));
assertThat(nitfImageSegmentHeader.getNumberOfPixelsPerBlockVertical(), is(NPPBV));
</BUG>
assertThat(nitfImageSegmentHeader.getNumberOfBlocksPerColumn(), is(NBPC));
| assertThat(nitfImageSegmentHeader.getNumberOfPixelsPerBlockHorizontalRaw(), is(NPPBH));
assertThat(nitfImageSegmentHeader.getNumberOfPixelsPerBlockVerticalRaw(), is(NPPBV));
|
19,107 | private final int matrixWidth;
private final int matrixHeight;
ImageBlockMatrix(final ImageSegment imageSegment, final Supplier<BufferedImage> imageSupplier) {
this.matrixWidth = (int) imageSegment.getNumberOfBlocksPerColumn();
this.matrixHeight = (int) imageSegment.getNumberOfBlocksPerRow();
<BUG>int blockWidth = imageSegment.getNumberOfPixelsPerBlockHorizontal();
int blockHeight = imageSegment.getNumberOfPixelsPerBlockVertical();
</BUG>
blocks = new ImageBlock[matrixWidth][matrixHeight];
| int blockWidth = (int) imageSegment.getNumberOfPixelsPerBlockHorizontal();
int blockHeight = (int) imageSegment.getNumberOfPixelsPerBlockVertical();
|
19,108 | checkNull(imageSegment, "imageSegment");
checkNull(targetImage, "targetImage");
checkImageMode(imageSegment);
final ImageMask imageMask = getImageMask(imageSegment);
ImageBlockMatrix matrix = new ImageBlockMatrix(imageSegment,
<BUG>() -> imageRepresentationHandler.createBufferedImage(imageSegment.getNumberOfPixelsPerBlockHorizontal(),
imageSegment.getNumberOfPixelsPerBlockVertical()));
</BUG>
matrix.forEachBlock(block -> {
| () -> imageRepresentationHandler.createBufferedImage((int) imageSegment.getNumberOfPixelsPerBlockHorizontal(),
(int) imageSegment.getNumberOfPixelsPerBlockVertical()));
|
19,109 | checkNull(imageSegment, "imageSegment");
checkNull(targetImage, "targetImage");
checkImageMode(imageSegment);
final ImageMask imageMask = getImageMask(imageSegment);
ImageBlockMatrix matrix = new ImageBlockMatrix(imageSegment, ()
<BUG>-> imageRepresentationHandler.createBufferedImage(imageSegment.getNumberOfPixelsPerBlockHorizontal(),
imageSegment.getNumberOfPixelsPerBlockVertical()));
</BUG>
for (int bandIndex = 0; bandIndex < imageSegment.getNumBands(); bandIndex++) {
| -> imageRepresentationHandler.createBufferedImage((int) imageSegment.getNumberOfPixelsPerBlockHorizontal(),
(int) imageSegment.getNumberOfPixelsPerBlockVertical()));
|
19,110 | @Override
public final BufferedImage getNextImageBlock() throws IOException {
if (mImageSegment.getActualBitsPerPixelPerBand() != 1) {
throw new IOException("Unhandled bilevel image depth:" + mImageSegment.getActualBitsPerPixelPerBand());
}
<BUG>BufferedImage img = new BufferedImage(mImageSegment.getNumberOfPixelsPerBlockHorizontal(),
mImageSegment.getNumberOfPixelsPerBlockVertical(),
</BUG>
BufferedImage.TYPE_BYTE_BINARY);
| public final void setImageSegment(final ImageSegment imageSegment, final ImageInputStream imageInputStream) throws IOException {
mImageSegment = imageSegment;
mImageData = imageInputStream;
BufferedImage img = new BufferedImage((int) mImageSegment.getNumberOfPixelsPerBlockHorizontal(),
(int) mImageSegment.getNumberOfPixelsPerBlockVertical(),
|
19,111 | processBlocks(imageSegment, (rowIndex, columnIndex) -> {
BufferedImage img = renderer.getImageBlock(rowIndex, columnIndex);
target.drawImage(img,
imageSegment.getImageLocationColumn() + columnIndex
imageSegment.getImageLocationRow()
<BUG>+ rowIndex * imageSegment.getNumberOfPixelsPerBlockVertical(),
</BUG>
null);
});
}
| + rowIndex * (int) imageSegment.getNumberOfPixelsPerBlockVertical(),
|
19,112 | return;
}
BufferedImage img = reader.read(
(columnIndex + rowIndex * imageSegment.getNumberOfBlocksPerColumn()) - maskedBlocks.get());
targetGraphic.drawImage(img,
<BUG>columnIndex * imageSegment.getNumberOfPixelsPerBlockHorizontal(),
rowIndex * imageSegment.getNumberOfPixelsPerBlockVertical(),
</BUG>
null);
| columnIndex * (int) imageSegment.getNumberOfPixelsPerBlockHorizontal(),
rowIndex * (int) imageSegment.getNumberOfPixelsPerBlockVertical(),
|
19,113 | private static final String DATASET_CAPACITY_TABLE = "dataset_capacity";
private static final String DATASET_TAG_TABLE = "dataset_tag";
private static final String DATASET_CASE_SENSITIVE_TABLE = "dataset_case_sensitivity";
private static final String DATASET_REFERENCE_TABLE = "dataset_reference";
private static final String DATASET_PARTITION_TABLE = "dataset_partition";
<BUG>private static final String DATASET_SECURITY_TABLE = "dataset_security";
</BUG>
private static final String DATASET_OWNER_TABLE = "dataset_owner";
private static final String DATASET_OWNER_UNMATCHED_TABLE = "stg_dataset_owner_unmatched";
private static final String DATASET_CONSTRAINT_TABLE = "dataset_constraint";
| private static final String DATASET_SECURITY_TABLE = "dataset_security_info";
|
19,114 | throw new IllegalArgumentException(
"Dataset deployment info update fail, " + "Json missing necessary fields: " + root.toString());
</BUG>
}
<BUG>final Object[] idUrn = findIdAndUrn(idNode, urnNode);
final Integer datasetId = (Integer) idUrn[0];</BUG>
final String urn = (String) idUrn[1];
ObjectMapper om = new ObjectMapper();
for (final JsonNode deploymentInfo : deployment) {
DatasetDeploymentRecord record = om.convertValue(deploymentInfo, DatasetDeploymentRecord.class);
| "Dataset deployment info update error, missing necessary fields: " + root.toString());
final Object[] idUrn = findDataset(root);
if (idUrn[0] == null || idUrn[1] == null) {
throw new IllegalArgumentException("Cannot identify dataset from id/uri/urn: " + root.toString());
final Integer datasetId = (Integer) idUrn[0];
|
19,115 | rec.setModifiedTime(System.currentTimeMillis() / 1000);
if (datasetId == 0) {
DatasetRecord record = new DatasetRecord();
record.setUrn(urn);
record.setSourceCreatedTime("" + rec.getCreateTime() / 1000);
<BUG>record.setSchema(rec.getOriginalSchema());
record.setSchemaType(rec.getFormat());
</BUG>
record.setFields((String) StringUtil.objectToJsonString(rec.getFieldSchema()));
| record.setSchema(rec.getOriginalSchema().getText());
record.setSchemaType(rec.getOriginalSchema().getFormat());
|
19,116 | datasetId = Integer.valueOf(DatasetDao.getDatasetByUrn(urn).get("id").toString());
rec.setDatasetId(datasetId);
}
else {
DICT_DATASET_WRITER.execute(UPDATE_DICT_DATASET_WITH_SCHEMA_CHANGE,
<BUG>new Object[]{rec.getOriginalSchema(), rec.getFormat(), StringUtil.objectToJsonString(rec.getFieldSchema()),
"API", System.currentTimeMillis() / 1000, datasetId});
}</BUG>
List<Map<String, Object>> oldInfo;
try {
| new Object[]{rec.getOriginalSchema().getText(), rec.getOriginalSchema().getFormat(),
StringUtil.objectToJsonString(rec.getFieldSchema()), "API", System.currentTimeMillis() / 1000, datasetId});
|
19,117 | case "deploymentInfo":
try {
DatasetInfoDao.updateDatasetDeployment(rootNode);
} catch (Exception ex) {
Logger.debug("Metadata change exception: deployment ", ex);
<BUG>}
break;
case "caseSensitivity":
try {
DatasetInfoDao.updateDatasetCaseSensitivity(rootNode);
} catch (Exception ex) {
Logger.debug("Metadata change exception: case sensitivity ", ex);</BUG>
}
| [DELETED] |
19,118 | wPassphrase.addModifyListener( lsMod );
fdPassphrase = new FormData();
fdPassphrase.left = new FormAttachment( 0, 0 );
fdPassphrase.top = new FormAttachment( wbFilename, margin );
fdPassphrase.right = new FormAttachment( 100, 0 );
<BUG>wPassphrase.setLayoutData( fdPassphrase );
wProxyHost =</BUG>
new LabelTextVar(
transMeta, wSettingsGroup, BaseMessages.getString( PKG, "SSHDialog.ProxyHost.Label" ), BaseMessages
.getString( PKG, "SSHDialog.ProxyHost.Tooltip" ) );
| wPassphrase.setEchoChar( '*' );
wProxyHost =
|
19,119 | serverName = XMLHandler.getTagValue( stepnode, "servername" );
userName = XMLHandler.getTagValue( stepnode, "userName" );
password = Encr.decryptPasswordOptionallyEncrypted( XMLHandler.getTagValue( stepnode, "password" ) );
usePrivateKey = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "usePrivateKey" ) );
keyFileName = XMLHandler.getTagValue( stepnode, "keyFileName" );
<BUG>passPhrase = XMLHandler.getTagValue( stepnode, "passPhrase" );
stdOutFieldName = XMLHandler.getTagValue( stepnode, "stdOutFieldName" );</BUG>
stdErrFieldName = XMLHandler.getTagValue( stepnode, "stdErrFieldName" );
timeOut = XMLHandler.getTagValue( stepnode, "timeOut" );
proxyHost = XMLHandler.getTagValue( stepnode, "proxyHost" );
| passPhrase =
Encr.decryptPasswordOptionallyEncrypted( XMLHandler.getTagValue( stepnode, "passPhrase" ) );
stdOutFieldName = XMLHandler.getTagValue( stepnode, "stdOutFieldName" );
|
19,120 | serverName = rep.getStepAttributeString( id_step, "servername" );
port = rep.getStepAttributeString( id_step, "port" );
userName = rep.getStepAttributeString( id_step, "userName" );
password = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "password" ) );
usePrivateKey = rep.getStepAttributeBoolean( id_step, "usePrivateKey" );
<BUG>keyFileName = rep.getStepAttributeString( id_step, "keyFileName" );
passPhrase = rep.getStepAttributeString( id_step, "passPhrase" );
</BUG>
stdOutFieldName = rep.getStepAttributeString( id_step, "stdOutFieldName" );
stdErrFieldName = rep.getStepAttributeString( id_step, "stdErrFieldName" );
| passPhrase =
Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "passPhrase" ) );
|
19,121 | rep.saveStepAttribute( id_transformation, id_step, "userName", userName );
rep.saveStepAttribute( id_transformation, id_step, "password", Encr
.encryptPasswordIfNotUsingVariables( password ) );
rep.saveStepAttribute( id_transformation, id_step, "usePrivateKey", usePrivateKey );
rep.saveStepAttribute( id_transformation, id_step, "keyFileName", keyFileName );
<BUG>rep.saveStepAttribute( id_transformation, id_step, "passPhrase", passPhrase );
rep.saveStepAttribute( id_transformation, id_step, "stdOutFieldName", stdOutFieldName );</BUG>
rep.saveStepAttribute( id_transformation, id_step, "stdErrFieldName", stdErrFieldName );
rep.saveStepAttribute( id_transformation, id_step, "timeOut", timeOut );
| rep.saveStepAttribute( id_transformation, id_step, "passPhrase", Encr
.encryptPasswordIfNotUsingVariables( passPhrase ) );
rep.saveStepAttribute( id_transformation, id_step, "stdOutFieldName", stdOutFieldName );
|
19,122 | 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.*;
|
19,123 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1]);
</BUG>
boolean isWorldRegion = false;
if (region == null) {
| String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
19,124 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!"));
if (region instanceof IGlobal) {
|
19,125 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]);
if (handler == null)
throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1);
if (handler instanceof GlobalHandler)</BUG>
throw new CommandException(Text.of("You may not delete the global handler!"));
| Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
19,126 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
19,127 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
19,128 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private static FoxGuardMain instanceField;</BUG>
@Inject
private Logger logger;
| private static FoxGuardMain instanceField;
|
19,129 | private UserStorageService userStorage;
private EconomyService economyService = null;
private boolean loaded = false;
private FCCommandDispatcher fgDispatcher;
public static FoxGuardMain instance() {
<BUG>return instanceField;
}</BUG>
@Listener
public void construct(GameConstructionEvent event) {
instanceField = this;
| }
public static Cause getCause() {
return instance().pluginCause;
}
|
19,130 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
19,131 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandHere extends FCCommandBase {
private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"};
private static final FlagMapper MAPPER = map -> key -> value -> {
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
19,132 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index > 0) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
19,133 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG>
if (k instanceof IFGObject) {
m.put((IFGObject) k, true);
return true;
| public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
19,134 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
|
19,135 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
19,136 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());
if (region != null) {
logger.info("Loading links for region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
19,137 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (region != null) {
logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
19,138 | StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
<BUG>return builder.toString();
}</BUG>
private final class LoadEntry {
public final String name;
public final Type type;
| public enum Type {
REGION, WREGION, HANDLER
|
19,139 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "worldregion", "handler", "controller")
|
19,140 | import com.continuuity.internal.io.DatumWriter;
import com.google.common.base.Objects;
import com.google.common.base.Throwables;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
<BUG>import com.google.common.cache.LoadingCache;
import com.google.common.reflect.TypeToken;
import org.objectweb.asm.Type;
public final class ASMDatumWriterFactory {</BUG>
private final LoadingCache<CacheKey, Class<DatumWriter<?>>> datumWriterClasses;
| import com.google.common.collect.Maps;
import java.util.Map;
public final class ASMDatumWriterFactory {
|
19,141 | @Override
public int hashCode() {
return Objects.hashCode(schema, type);
}
}
<BUG>private static final class ASMDatumWriterClassLoader extends ClassLoader {
private ASMDatumWriterClassLoader(ClassLoader parent) {
super(parent);
}
private Class<?> defineClass(String name, byte[] bytes) {
return defineClass(name, bytes, 0, bytes.length);
}</BUG>
}
| public Class<DatumWriter<?>> load(CacheKey key) throws Exception {
DatumWriterGenerator.ClassDefinition classDef = new DatumWriterGenerator().generate(key.getType(),
key.getSchema());
ClassLoader typeClassloader = key.getType().getRawType().getClassLoader();
ASMDatumWriterClassLoader classloader = classloaders.get(typeClassloader);
if (classloader == null) {
classloader = new ASMDatumWriterClassLoader(typeClassloader);
classloaders.put(typeClassloader, classloader);
|
19,142 | mvLeftX = mv[0];
mvLeftY = mv[1];
CAVLCWriter.writeSE(out, mv[0] - mvpx); // mvdx
CAVLCWriter.writeSE(out, mv[1] - mvpy); // mvdy
Picture8Bit mbRef = Picture8Bit.create(16, 16, sps.chroma_format_idc);
<BUG>Picture mb = Picture.create(16, 16, sps.chroma_format_idc);
interpolator.getBlockLuma(ref, mbRef, 0, (mbX << 6) + mv[0], (mbY << 6) + mv[1], 16, 16);</BUG>
interpolator.getBlockChroma(ref.getPlaneData(1), ref.getPlaneWidth(1), ref.getPlaneHeight(1),
mbRef.getPlaneData(1), 0, mbRef.getPlaneWidth(1), (mbX << 6) + mv[0], (mbY << 6) + mv[1], 8, 8);
interpolator.getBlockChroma(ref.getPlaneData(2), ref.getPlaneWidth(2), ref.getPlaneHeight(2),
| int[][] mb = new int[][] {new int[256], new int[256 >> (cw + ch)], new int[256 >> (cw + ch)]};
interpolator.getBlockLuma(ref, mbRef, 0, (mbX << 6) + mv[0], (mbY << 6) + mv[1], 16, 16);
|
19,143 | public void transcode(Cmd cmd) throws IOException {
FileChannelWrapper sink = null;
try {
sink = NIOUtils.writableChannel(tildeExpand(cmd.getArg(1)));
VP8Encoder encoder = VP8Encoder.createVP8Encoder(10); // qp
<BUG>RgbToYuv420p transform = new RgbToYuv420p(0, 0);
MKVMuxer muxer = new MKVMuxer();</BUG>
MKVMuxerTrack videoTrack = null;
int i;
for (i = 0; i < cmd.getIntegerFlagD("maxFrames", Integer.MAX_VALUE); i++) {
| Transform8Bit transform = new RgbToYuv420j8Bit();
MKVMuxer muxer = new MKVMuxer();
|
19,144 |
transform.transform(AWTUtil.fromBufferedImageRGB(rgb), yuv);
</BUG>
ByteBuffer buf = ByteBuffer.allocate(rgb.getWidth() * rgb.getHeight() * 3);
<BUG>ByteBuffer ff = encoder.encodeFrame(yuv, buf);
</BUG>
videoTrack.addSampleEntry(ff, i - 1);
}
if (i == 1) {
System.out.println("Image sequence not found");
| if (!nextImg.exists())
continue;
BufferedImage rgb = ImageIO.read(nextImg);
if (videoTrack == null)
videoTrack = muxer.createVideoTrack(new Size(rgb.getWidth(), rgb.getHeight()), "V_VP8");
Picture8Bit yuv = Picture8Bit.create(rgb.getWidth(), rgb.getHeight(), ColorSpace.YUV420);
transform.transform(AWTUtil.fromBufferedImageRGB8Bit(rgb), yuv);
ByteBuffer ff = encoder.encodeFrame8Bit(yuv, buf);
|
19,145 | SeekableByteChannel source = null;
try {
sink = writableChannel(tildeExpand(cmd.getArg(1)));
source = readableChannel(tildeExpand(cmd.getArg(0)));
MP4Demuxer demux = new MP4Demuxer(source);
<BUG>Transform transform = new Yuv422pToYuv420p(0, 0);
</BUG>
VP8Encoder encoder = VP8Encoder.createVP8Encoder(10); // qp
IVFMuxer muxer = null;
AbstractMP4DemuxerTrack inTrack = demux.getVideoTrack();
| Transform8Bit transform = new Yuv422pToYuv420p8Bit();
|
19,146 | </BUG>
VP8Encoder encoder = VP8Encoder.createVP8Encoder(10); // qp
IVFMuxer muxer = null;
AbstractMP4DemuxerTrack inTrack = demux.getVideoTrack();
VideoSampleEntry ine = (VideoSampleEntry) inTrack.getSampleEntries()[0];
<BUG>Picture target1 = Picture.create(1920, 1088, ColorSpace.YUV422);
Picture target2 = null;
</BUG>
ByteBuffer _out = ByteBuffer.allocate(ine.getWidth() * ine.getHeight() * 6);
| SeekableByteChannel source = null;
try {
sink = writableChannel(tildeExpand(cmd.getArg(1)));
source = readableChannel(tildeExpand(cmd.getArg(0)));
MP4Demuxer demux = new MP4Demuxer(source);
Transform8Bit transform = new Yuv422pToYuv420p8Bit();
Picture8Bit target1 = Picture8Bit.create(1920, 1088, ColorSpace.YUV422);
Picture8Bit target2 = null;
|
19,147 | SeekableByteChannel source = null;
try {
sink = writableChannel(tildeExpand(cmd.getArg(1)));
source = readableChannel(tildeExpand(cmd.getArg(0)));
MP4Demuxer demux = new MP4Demuxer(source);
<BUG>Transform transform = new Yuv422pToYuv420p(0, 0);
</BUG>
VP8Encoder encoder = VP8Encoder.createVP8Encoder(10); // qp
MKVMuxer muxer = new MKVMuxer();
MKVMuxerTrack videoTrack = null;
| Transform8Bit transform = new Yuv422pToYuv420p8Bit();
|
19,148 | VP8Encoder encoder = VP8Encoder.createVP8Encoder(10); // qp
MKVMuxer muxer = new MKVMuxer();
MKVMuxerTrack videoTrack = null;
AbstractMP4DemuxerTrack inTrack = demux.getVideoTrack();
VideoSampleEntry ine = (VideoSampleEntry) inTrack.getSampleEntries()[0];
<BUG>Picture target1 = Picture.create(1920, 1088, ColorSpace.YUV422);
Picture target2 = null;
</BUG>
ByteBuffer _out = ByteBuffer.allocate(ine.getWidth() * ine.getHeight() * 6);
| Picture8Bit target1 = Picture8Bit.create(1920, 1088, ColorSpace.YUV422);
Picture8Bit target2 = null;
|
19,149 | </BUG>
if (bi == null)
bi = new BufferedImage(pic.getWidth(), pic.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
if (rgb == null)
<BUG>rgb = Picture.create(pic.getWidth(), pic.getHeight(), RGB);
transform.transform(pic, rgb);
AWTUtil.toBufferedImage(rgb, bi);
</BUG>
ImageIO.write(bi, "png", new File(format(cmd.getArg(1), i++)));
| decoder.decode(inFrame.getData());
} catch (AssertionError ae) {
ae.printStackTrace(System.err);
continue;
}
Picture8Bit pic = decoder.getPicture8Bit();
rgb = Picture8Bit.create(pic.getWidth(), pic.getHeight(), RGB);
rgbToBgr.transform(rgb, rgb);
AWTUtil.toBufferedImage8Bit(rgb, bi);
|
19,150 | FileChannelWrapper sink = null;
try {
sink = new FileChannelWrapper(fos.getChannel());
MKVMuxer muxer = new MKVMuxer();
H264Encoder encoder = H264Encoder.createH264Encoder();
<BUG>RgbToYuv420p transform = new RgbToYuv420p(0, 0);
</BUG>
MKVMuxerTrack videoTrack = null;
int i;
for (i = 1;; i++) {
| RgbToYuv420p8Bit transform = new RgbToYuv420p8Bit();
|
19,151 |
transform.transform(AWTUtil.fromBufferedImageRGB(rgb), yuv);
</BUG>
ByteBuffer buf = ByteBuffer.allocate(rgb.getWidth() * rgb.getHeight() * 3);
<BUG>ByteBuffer ff = encoder.encodeFrame(yuv, buf);
</BUG>
videoTrack.addSampleEntry(ff, i);
}
if (i == 1) {
System.out.println("Image sequence not found");
| BufferedImage rgb = ImageIO.read(nextImg);
if (videoTrack == null) {
videoTrack = muxer.createVideoTrack(new Size(rgb.getWidth(), rgb.getHeight()),
"V_MPEG4/ISO/AVC");
Picture8Bit yuv = Picture8Bit.create(rgb.getWidth(), rgb.getHeight(), ColorSpace.YUV420);
transform.transform(AWTUtil.fromBufferedImageRGB8Bit(rgb), yuv);
ByteBuffer ff = encoder.encodeFrame8Bit(yuv, buf);
|
19,152 | FileInputStream inputStream = new FileInputStream(file);
LinkedList<Packet> presentationStack = new LinkedList<Packet>();
try {
MKVDemuxer demux = MKVDemuxer.getDemuxer(new FileChannelWrapper(inputStream.getChannel()));
H264Decoder decoder = new H264Decoder();
<BUG>Transform transform = new Yuv420pToRgb(0, 0);
DemuxerTrack inTrack = demux.getVideoTrack();
Picture rgb = Picture.create(demux.getPictureWidth(), demux.getPictureHeight(), ColorSpace.RGB);
</BUG>
BufferedImage bi = new BufferedImage(demux.getPictureWidth(), demux.getPictureHeight(),
| Transform8Bit transform = new Yuv420pToRgb8Bit();
RgbToBgr8Bit rgbToBgr = new RgbToBgr8Bit();
Picture8Bit rgb = Picture8Bit.create(demux.getPictureWidth(), demux.getPictureHeight(), ColorSpace.RGB);
|
19,153 | } else
gopSize++;
if (bi == null)
bi = new BufferedImage(pic.getWidth(), pic.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
if (rgb == null)
<BUG>rgb = Picture.create(pic.getWidth(), pic.getHeight(), RGB);
transform.transform(pic.toPicture(8), rgb);
AWTUtil.toBufferedImage(rgb, bi);
</BUG>
int framePresentationIndex = (pic.getPOC() >> 1) + prevGopsSize;
| rgb = Picture8Bit.create(pic.getWidth(), pic.getHeight(), RGB);
transform.transform(pic, rgb);
rgbToBgr.transform(rgb, rgb);
AWTUtil.toBufferedImage8Bit(rgb, bi);
|
19,154 | H264Encoder encoder = new H264Encoder(rc);
encoder.setKeyInterval(25);
AbstractMP4DemuxerTrack inTrack = demux.getVideoTrack();
FramesMP4MuxerTrack outTrack = muxer.addTrack(TrackType.VIDEO, (int) inTrack.getTimescale());
VideoSampleEntry ine = (VideoSampleEntry) inTrack.getSampleEntries()[0];
<BUG>Picture target1 = Picture.create(1920, 1088, ColorSpace.YUV422);
Picture target2 = null;
</BUG>
ByteBuffer _out = ByteBuffer.allocate(ine.getWidth() * ine.getHeight() * 6);
| Picture8Bit target1 = Picture8Bit.create(1920, 1088, ColorSpace.YUV422);
Picture8Bit target2 = null;
|
19,155 | FileOutputStream fos = null;
try {
fos = new FileOutputStream(new File(cmd.getArg(1)));
sink = fos.getChannel();
H264Encoder encoder = H264Encoder.createH264Encoder();
<BUG>RgbToYuv420p transform = new RgbToYuv420p(0, 0);
</BUG>
int i;
for (i = 0; i < cmd.getIntegerFlagD("maxFrames", Integer.MAX_VALUE); i++) {
File nextImg = new File(String.format(cmd.getArg(0), i));
| RgbToYuv420p8Bit transform = new RgbToYuv420p8Bit();
|
19,156 |
transform.transform(AWTUtil.fromBufferedImageRGB(rgb), yuv);
</BUG>
ByteBuffer buf = ByteBuffer.allocate(rgb.getWidth() * rgb.getHeight() * 3);
<BUG>ByteBuffer ff = encoder.encodeFrame(yuv, buf);
</BUG>
sink.write(ff);
}
if (i == 1) {
System.out.println("Image sequence not found");
| for (i = 0; i < cmd.getIntegerFlagD("maxFrames", Integer.MAX_VALUE); i++) {
File nextImg = new File(String.format(cmd.getArg(0), i));
if (!nextImg.exists())
break;
BufferedImage rgb = ImageIO.read(nextImg);
Picture8Bit yuv = Picture8Bit.create(rgb.getWidth(), rgb.getHeight(), encoder.getSupportedColorSpaces()[0]);
transform.transform(AWTUtil.fromBufferedImageRGB8Bit(rgb), yuv);
ByteBuffer ff = encoder.encodeFrame8Bit(yuv, buf);
|
19,157 | FramesMP4DemuxerTrack videoTrack = (FramesMP4DemuxerTrack) rawDemuxer.getVideoTrack();
if (videoTrack == null) {
System.out.println("Video track not found");
return;
}
<BUG>Yuv422pToRgb transform = new Yuv422pToRgb(0, 0);
ProresDecoder decoder;</BUG>
Integer downscale = cmd.getIntegerFlag(FLAG_DOWNSCALE);
if (downscale == null) {
| Yuv422pToRgb8Bit transform = new Yuv422pToRgb8Bit();
RgbToBgr8Bit rgbToBgr = new RgbToBgr8Bit();
ProresDecoder decoder;
|
19,158 | </BUG>
int i = 0;
Packet pkt;
while ((pkt = videoTrack.nextFrame()) != null) {
<BUG>Picture buf = Picture.create(1920, 1088, ColorSpace.YUV420);
Picture pic = decoder.decodeFrame(pkt.getData(), buf.getData());
</BUG>
if (bi == null)
bi = new BufferedImage(pic.getWidth(), pic.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
| decoder = new ProresToThumb();
} else {
throw new IllegalArgumentException("Unsupported downscale factor: " + downscale + ".");
}
BufferedImage bi = null;
Picture8Bit rgb = null;
Picture8Bit buf = Picture8Bit.create(1920, 1088, ColorSpace.YUV420);
Picture8Bit pic = decoder.decodeFrame8Bit(pkt.getData(), buf.getData());
|
19,159 | SeekableByteChannel sink = null;
try {
sink = writableChannel(new File(cmd.getArg(1)));
MP4Muxer muxer = MP4Muxer.createMP4Muxer(sink, Brand.MOV);
ProresEncoder encoder = new ProresEncoder(profile, cmd.getBooleanFlagD(FLAG_INTERLACED, false));
<BUG>RgbToYuv422p transform = new RgbToYuv422p(0, 0);
</BUG>
FramesMP4MuxerTrack videoTrack = null;
int i;
for (i = 1;; i++) {
| RgbToYuv422p8Bit transform = new RgbToYuv422p8Bit();
|
19,160 |
transform.transform(AWTUtil.fromBufferedImageRGB(rgb), yuv);
</BUG>
ByteBuffer buf = ByteBuffer.allocate(rgb.getWidth() * rgb.getHeight() * 3);
<BUG>encoder.encodeFrame(yuv, buf);
</BUG>
videoTrack.addFrame(
MP4Packet.createMP4Packet(buf, i * 1001, 24000, 1001, i, true, null, 0, i * 1001, 0));
}
if (i == 1) {
| if (videoTrack == null) {
videoTrack = muxer.addVideoTrack(profile.fourcc, new Size(rgb.getWidth(), rgb.getHeight()),
APPLE_PRO_RES_422, 24000);
videoTrack.setTgtChunkDuration(HALF, SEC);
Picture8Bit yuv = Picture8Bit.create(rgb.getWidth(), rgb.getHeight(), ColorSpace.YUV422);
transform.transform(AWTUtil.fromBufferedImageRGB8Bit(rgb), yuv);
encoder.encodeFrame8Bit(yuv, buf);
|
19,161 | import static org.jcodec.codecs.vp8.VP8Util.getDefaultCoefProbs;
import static org.jcodec.codecs.vp8.VP8Util.getMacroblockCount;
import static org.jcodec.codecs.vp8.VP8Util.keyFrameYModeProb;
import static org.jcodec.codecs.vp8.VP8Util.keyFrameYModeTree;
import static org.jcodec.codecs.vp8.VP8Util.vp8CoefUpdateProbs;
<BUG>import java.io.IOException;
import java.nio.ByteBuffer;</BUG>
import org.jcodec.api.NotSupportedException;
import org.jcodec.codecs.vp8.Macroblock.Subblock;
import org.jcodec.codecs.vp8.VP8Util.QuantizationParams;
| [DELETED] |
19,162 | import org.jcodec.codecs.vp8.Macroblock.Subblock;
import org.jcodec.codecs.vp8.VP8Util.QuantizationParams;
import org.jcodec.codecs.vp8.VP8Util.SubblockConstants;
import org.jcodec.common.Assert;
import org.jcodec.common.model.ColorSpace;
<BUG>import org.jcodec.common.model.Picture;
public class VP8Decoder {</BUG>
private Macroblock[][] mbs;
private int width;
| import org.jcodec.common.model.Picture8Bit;
import java.io.IOException;
import java.nio.ByteBuffer;
public class VP8Decoder {
|
19,163 | int y = (mbRow << 4) + (lumaRow << 2) + lumaPRow;
int x = (mbCol << 4) + (lumaCol << 2) + lumaPCol;
if (x >= strideLuma || y >= luma.length / strideLuma)
continue;
int yy = mb.ySubblocks[lumaRow][lumaCol].val[lumaPRow * 4 + lumaPCol];
<BUG>luma[strideLuma * y + x] = yy;
</BUG>
}
for (int chromaRow = 0; chromaRow < 2; chromaRow++)
for (int chromaCol = 0; chromaCol < 2; chromaCol++)
| luma[strideLuma * y + x] = (byte)(yy - 128);
|
19,164 | int x = (mbCol << 3) + (chromaCol << 2) + chromaPCol;
if (x >= strideChroma || y >= cb.length / strideChroma)
continue;
int u = mb.uSubblocks[chromaRow][chromaCol].val[chromaPRow * 4 + chromaPCol];
int v = mb.vSubblocks[chromaRow][chromaCol].val[chromaPRow * 4 + chromaPCol];
<BUG>cb[strideChroma * y + x] = u;
cr[strideChroma * y + x] = v;
</BUG>
}
| cb[strideChroma * y + x] = (byte)(u - 128);
cr[strideChroma * y + x] = (byte)(v - 128);
|
19,165 | package org.jcodec.codecs.vpx;
import static java.lang.System.arraycopy;
import static org.jcodec.common.tools.MathUtil.clip;
<BUG>import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;</BUG>
import org.jcodec.codecs.common.biari.VPxBooleanEncoder;
import org.jcodec.common.ArrayUtil;
| [DELETED] |
19,166 | return new VP8Encoder(new NopRateControl(qp));
}
public VP8Encoder(RateControl rc) {
this.rc = rc;
this.tmp = new int[16];
<BUG>}
public ByteBuffer encodeFrame(Picture pic, ByteBuffer _buf) {
</BUG>
ByteBuffer out = _buf.duplicate();
int mbWidth = ((pic.getWidth() + 15) >> 4);
| @Override
public ByteBuffer encodeFrame8Bit(Picture8Bit pic, ByteBuffer _buf) {
|
19,167 | int[] segmentQps = rc.getSegmentQps();
VPxBooleanEncoder boolEnc = new VPxBooleanEncoder(dataBuffer);
int[] segmentMap = new int[mbWidth * mbHeight];
for (int mbY = 0, mbAddr = 0; mbY < mbHeight; mbY++) {
<BUG>initValue(leftRow, 129);
</BUG>
for (int mbX = 0; mbX < mbWidth; mbX++, mbAddr++) {
int before = boolEnc.position();
int segment = rc.getSegment();
segmentMap[mbAddr] = segment;
| initValue(leftRow, (byte)1);
|
19,168 | out.put((byte) 0x01);
out.put((byte) 0x2a);
out.putShort((short) width);
out.putShort((short) height);
}
<BUG>private void collectPredictors(Picture outMB, int mbX) {
</BUG>
arraycopy(outMB.getPlaneData(0), 240, topLine[0], mbX << 4, 16);
arraycopy(outMB.getPlaneData(1), 56, topLine[1], mbX << 3, 8);
arraycopy(outMB.getPlaneData(2), 56, topLine[2], mbX << 3, 8);
| private void collectPredictors(Picture8Bit outMB, int mbX) {
|
19,169 | arraycopy(outMB.getPlaneData(2), 56, topLine[2], mbX << 3, 8);
copyCol(outMB.getPlaneData(0), 15, 16, leftRow[0]);
copyCol(outMB.getPlaneData(1), 7, 8, leftRow[1]);
copyCol(outMB.getPlaneData(2), 7, 8, leftRow[2]);
}
<BUG>private void copyCol(int[] planeData, int off, int stride, int[] out) {
</BUG>
for (int i = 0; i < out.length; i++) {
out[i] = planeData[off];
off += stride;
| private void copyCol(byte[] planeData, int off, int stride, byte[] out) {
|
19,170 | for (int i = 0; i < out.length; i++) {
out[i] = planeData[off];
off += stride;
}
}
<BUG>private void luma(Picture pic, int mbX, int mbY, VPxBooleanEncoder out, int qp, Picture outMB) {
</BUG>
int x = mbX << 4;
int y = mbY << 4;
int[][] ac = transform(pic, 0, qp, x, y);
| private void luma(Picture8Bit pic, int mbX, int mbY, VPxBooleanEncoder out, int qp, Picture8Bit outMB) {
|
19,171 | private int[] zigzag(int[] zz, int[] tmp2) {
for (int i = 0; i < 16; i++)
tmp2[i] = zz[VPXConst.zigzag[i]];
return tmp2;
}
<BUG>private void chroma(Picture pic, int mbX, int mbY, VPxBooleanEncoder boolEnc, int qp, Picture outMB) {
</BUG>
int x = mbX << 3;
int y = mbY << 3;
int chromaPred1 = chromaPredBlk(1, x, y);
| private void chroma(Picture8Bit pic, int mbX, int mbY, VPxBooleanEncoder boolEnc, int qp, Picture8Bit outMB) {
|
19,172 | restorePlaneChroma(ac1, qp);
putChroma(outMB.getData()[1], 1, x, y, ac1, chromaPred1);
restorePlaneChroma(ac2, qp);
putChroma(outMB.getData()[2], 2, x, y, ac2, chromaPred2);
}
<BUG>private int[][] transformChroma(Picture pic, int comp, int qp, int x, int y, Picture outMB, int chromaPred) {
</BUG>
int[][] ac = new int[4][16];
for (int blk = 0; blk < ac.length; blk++) {
int blkOffX = (blk & 1) << 2;
| private int[][] transformChroma(Picture8Bit pic, int comp, int qp, int x, int y, Picture8Bit outMB, int chromaPred) {
|
19,173 | + blkOffY, coeff, dcc);
VPXDCT.fdct4x4(coeff);
}
return ac;
}
<BUG>private final void takeSubtract(int[] planeData, int planeWidth, int planeHeight, int x, int y, int[] coeff, int dc) {
</BUG>
if (x + 4 < planeWidth && y + 4 < planeHeight)
takeSubtractSafe(planeData, planeWidth, planeHeight, x, y, coeff, dc);
else
| private final void takeSubtract(byte[] planeData, int planeWidth, int planeHeight, int x, int y, int[] coeff, int dc) {
|
19,174 | if (x + 4 < planeWidth && y + 4 < planeHeight)
takeSubtractSafe(planeData, planeWidth, planeHeight, x, y, coeff, dc);
else
takeSubtractUnsafe(planeData, planeWidth, planeHeight, x, y, coeff, dc);
}
<BUG>private final void takeSubtractSafe(int[] planeData, int planeWidth, int planeHeight, int x, int y, int[] coeff,
</BUG>
int dc) {
for (int i = 0, srcOff = y * planeWidth + x, dstOff = 0; i < 4; i++, srcOff += planeWidth, dstOff += 4) {
coeff[dstOff] = planeData[srcOff] - dc;
| private final void takeSubtractSafe(byte[] planeData, int planeWidth, int planeHeight, int x, int y, int[] coeff,
|
19,175 | coeff[dstOff + 1] = planeData[srcOff + 1] - dc;
coeff[dstOff + 2] = planeData[srcOff + 2] - dc;
coeff[dstOff + 3] = planeData[srcOff + 3] - dc;
}
}
<BUG>private final void takeSubtractUnsafe(int[] planeData, int planeWidth, int planeHeight, int x, int y, int[] coeff,
</BUG>
int dc) {
int outOff = 0;
int i;
| private final void takeSubtractUnsafe(byte[] planeData, int planeWidth, int planeHeight, int x, int y, int[] coeff,
|
19,176 | package cn.edu.buaa.crypto.algebra.params;
import java.math.BigInteger;
<BUG>public class SecurePrimeParameters {
private static final BigInteger TWO = BigInteger.valueOf(2);</BUG>
public static final SecurePrimeParameters RFC3526_1536BIT_MODP_GROUP = new SecurePrimeParameters(
new BigInteger(
"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" +
| import org.bouncycastle.crypto.CipherParameters;
public class SecurePrimeParameters implements CipherParameters {
private static final BigInteger TWO = BigInteger.valueOf(2);
|
19,177 | package com.intellij.execution;
import com.intellij.execution.configurations.*;
<BUG>import com.intellij.execution.runners.JavaProgramRunner;
public interface RunnerAndConfigurationSettings {
ConfigurationFactory getFactory();</BUG>
boolean isTemplate();
RunConfiguration getConfiguration();
| import org.jetbrains.annotations.Nullable;
@Nullable
ConfigurationFactory getFactory();
|
19,178 | import com.intellij.ide.util.PropertiesComponent;
import com.intellij.lang.ant.config.AntBuildTarget;
import com.intellij.lang.ant.config.AntConfiguration;
import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.diagnostic.Logger;
<BUG>import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.InvalidDataException;</BUG>
import com.intellij.openapi.util.JDOMExternalizable;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.psi.PsiElement;
| import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.InvalidDataException;
|
19,179 | protected MyRefactoringElementListenerProvider myRefactoringElementListenerProvider;
private RunnerAndConfigurationSettingsImpl myTempConfiguration;
@NonNls
private static final String TEMP_CONFIGURATION = "tempConfiguration";
@NonNls
<BUG>private static final String CONFIGURATION = "configuration";
</BUG>
private ConfigurationType[] myTypes;
private final RunManagerConfig myConfig;
@NonNls
| protected static final String CONFIGURATION = "configuration";
|
19,180 | protected static final String NAME_ATTR = "name";
@NonNls
protected static final String SELECTED_ATTR = "selected";
@NonNls private static final String METHOD = "method";
@NonNls private static final String OPTION = "option";
<BUG>@NonNls private static final String VALUE = "value";
public RunManagerImpl(final Project project,</BUG>
PropertiesComponent propertiesComponent,
ConfigurationType[] configurationTypes) {
myConfig = new RunManagerConfig(propertiesComponent, this);
| private List<Element> myUnloadedElements = null;
public RunManagerImpl(final Project project,
|
19,181 | if (TEMP_CONFIGURATION.equals(element.getName())) {
myTempConfiguration = configuration;
}
final Map<String, Boolean> map = updateStepsBeforeRun(methodsElement);
addConfiguration(configuration, isShared, map);
<BUG>}
}</BUG>
@Nullable
private static Map<String, Boolean> updateStepsBeforeRun(final Element child) {
if (child == null){
| return true;
|
19,182 | import com.intellij.openapi.util.Factory;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.JDOMExternalizable;
import com.intellij.openapi.util.WriteExternalException;
import org.jdom.Element;
<BUG>import org.jetbrains.annotations.NonNls;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;</BUG>
public class RunnerAndConfigurationSettingsImpl implements JDOMExternalizable, Cloneable, RunnerAndConfigurationSettings, Comparable {
| import org.jetbrains.annotations.Nullable;
import java.util.*;
|
19,183 | }
public RunnerAndConfigurationSettingsImpl(RunManagerImpl manager, RunConfiguration configuration, boolean isTemplate) {
myManager = manager;
myConfiguration = configuration;
myIsTemplate = isTemplate;
<BUG>}
public ConfigurationFactory getFactory() {</BUG>
return myConfiguration == null ? null : myConfiguration.getFactory();
}
public boolean isTemplate() {
| @Nullable
public ConfigurationFactory getFactory() {
|
19,184 | else {
final String name = element.getAttributeValue(NAME_ATTR);
myConfiguration = myManager.createConfiguration(name, factory).getConfiguration();
}
myConfiguration.readExternal(element);
<BUG>List runners = element.getChildren(RUNNER_ELEMENT);
for (final Object runner1 : runners) {</BUG>
Element runnerElement = (Element)runner1;
String id = runnerElement.getAttributeValue(RUNNER_ID);
JavaProgramRunner runner = ExecutionRegistry.getInstance().findRunnerById(id);
| myUnloadedRunnerSettings = null;
for (final Object runner1 : runners) {
|
19,185 | myManager = manager;
}
public void projectOpened() {
}
public void projectClosed() {
<BUG>}
@NonNls</BUG>
public String getComponentName() {
return "ProjectRunConfigurationManager";
}
| @NotNull
@NonNls
|
19,186 | package org.rstudio.studio.client.workbench.views.vcs.dialog;
<BUG>import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;</BUG>
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
| import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
|
19,187 | import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import org.rstudio.core.client.widget.LeftRightToggleButton;
<BUG>import org.rstudio.core.client.widget.Toolbar;
import org.rstudio.studio.client.workbench.views.vcs.BranchToolbarButton;</BUG>
import org.rstudio.studio.client.workbench.views.vcs.dialog.HistoryPresenter.CommitDetailDisplay;
import org.rstudio.studio.client.workbench.views.vcs.dialog.HistoryPresenter.CommitListDisplay;
import org.rstudio.studio.client.workbench.views.vcs.dialog.HistoryPresenter.Display;
| import org.rstudio.core.client.widget.ToolbarButton;
import org.rstudio.studio.client.workbench.commands.Commands;
import org.rstudio.studio.client.workbench.views.vcs.BranchToolbarButton;
|
19,188 | String commitDetail();
}
interface Binder extends UiBinder<Widget, HistoryPanel>
{}
@Inject
<BUG>public HistoryPanel(BranchToolbarButton branchToolbarButton)
{</BUG>
splitPanel_ = new SplitLayoutPanel(4);
initWidget(GWT.<Binder>create(Binder.class).createAndBindUi(this));
| public HistoryPanel(BranchToolbarButton branchToolbarButton,
Commands commands)
{
|
19,189 | return;
}
final ReloadSession reloadSession = new ReloadSession();
for (final VFileEvent event : events) {
String path = event.getPath();
<BUG>File file = new File(path);
FileUtil.processFilesRecursively(file, new Processor<File>() {</BUG>
public boolean process(File file) {
String filePath = file.getAbsolutePath();
if (MPSFileTypesManager.instance().isModelFile(filePath)) {
| if (file.isDirectory() && file.exists()) {
FileUtil.processFilesRecursively(file, new Processor<File>() {
|
19,190 | } else if (MPSFileTypesManager.instance().isModuleFile(filePath)) {
ModuleFileProcessor.getInstance().process(new VFileEventDecorator(event, filePath), reloadSession);
}
return true;
}
<BUG>});
if (MPSFileTypesManager.instance().isModelFile(path)) {</BUG>
ModelFileProcessor.getInstance().process(event, reloadSession);
} else if (MPSFileTypesManager.instance().isModuleFile(path)) {
ModuleFileProcessor.getInstance().process(event, reloadSession);
| if (MPSFileTypesManager.instance().isModelFile(path)) {
|
19,191 | 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;
|
19,192 | 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;
|
19,193 | 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"),
|
19,194 | 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] |
19,195 | 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) {
|
19,196 | 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;
|
19,197 | 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;
|
19,198 | 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;
|
19,199 | 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"),
|
19,200 | 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] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.