id
int64 1
194k
| buggy
stringlengths 23
37.5k
| fixed
stringlengths 6
37.4k
|
---|---|---|
1 | public static final String TYPE_JAZMIN_CDN="jazmin-cdn";
public static final String TYPE_JAZMIN_FILE="jazmin-file";
public static final String TYPE_MYSQL="mysql";
public static final String TYPE_MEMCACHED="memcached";
public static final String TYPE_HAPROXY="haproxy";
<BUG>public static final String TYPE_REDIS="redis";
public static final String TYPE_BROSWER="broswer";</BUG>
public static final String TYPE_CLIENT="client";
public static final String TYPE_API="api";
public static final String LAYER_USER="User Tier";
| public static final String TYPE_JAZMIN_CDN="jazmin-cdn";
public static final String TYPE_JAZMIN_FILE="jazmin-file";
public static final String TYPE_MYSQL="mysql";
public static final String TYPE_MEMCACHED="memcached";
public static final String TYPE_HAPROXY="haproxy";
public static final String TYPE_REDIS="redis";
public static final String TYPE_INFLUXDB="influxdb";
public static final String TYPE_BROSWER="broswer";
public static final String TYPE_CLIENT="client";
public static final String TYPE_API="api";
public static final String LAYER_USER="User Tier";
|
2 | typeLayerMap.put(TYPE_JAZMIN_RELAY,LAYER_WEB);
typeLayerMap.put(TYPE_JAZMIN_RTSP,LAYER_WEB);
typeLayerMap.put(TYPE_JAZMIN_CDN,LAYER_WEB);
typeLayerMap.put(TYPE_MYSQL,LAYER_DB);
typeLayerMap.put(TYPE_JAZMIN_FILE,LAYER_DB);
<BUG>typeLayerMap.put(TYPE_REDIS,LAYER_DB);
typeLayerMap.put(TYPE_MEMCACHED,LAYER_CACHE);</BUG>
typeLayerMap.put(TYPE_HAPROXY,LAYER_PROXY);
typeLayerMap.put(TYPE_BROSWER,LAYER_USER);
typeLayerMap.put(TYPE_CLIENT,LAYER_USER);
| typeLayerMap.put(TYPE_JAZMIN_RELAY,LAYER_WEB);
typeLayerMap.put(TYPE_JAZMIN_RTSP,LAYER_WEB);
typeLayerMap.put(TYPE_JAZMIN_CDN,LAYER_WEB);
typeLayerMap.put(TYPE_MYSQL,LAYER_DB);
typeLayerMap.put(TYPE_JAZMIN_FILE,LAYER_DB);
typeLayerMap.put(TYPE_REDIS,LAYER_DB);
typeLayerMap.put(TYPE_INFLUXDB,LAYER_DB);
typeLayerMap.put(TYPE_MEMCACHED,LAYER_CACHE);
typeLayerMap.put(TYPE_HAPROXY,LAYER_PROXY);
typeLayerMap.put(TYPE_BROSWER,LAYER_USER);
typeLayerMap.put(TYPE_CLIENT,LAYER_USER);
|
3 | "importPackage(Packages.jazmin.driver.lucene);"+
"importPackage(Packages.jazmin.driver.process);"+
"importPackage(Packages.jazmin.driver.redis);"+
"importPackage(Packages.jazmin.driver.http);"+
"importPackage(Packages.jazmin.driver.mail);"+
<BUG>"importPackage(Packages.jazmin.driver.mongodb);"+
"importPackage(Packages.jazmin.server.console);"+</BUG>
"importPackage(Packages.jazmin.server.cdn);"+
"importPackage(Packages.jazmin.server.file);"+
"importPackage(Packages.jazmin.server.jmx);"+
| "importPackage(Packages.jazmin.driver.lucene);"+
"importPackage(Packages.jazmin.driver.process);"+
"importPackage(Packages.jazmin.driver.redis);"+
"importPackage(Packages.jazmin.driver.http);"+
"importPackage(Packages.jazmin.driver.mail);"+
"importPackage(Packages.jazmin.driver.mongodb);"+
"importPackage(Packages.jazmin.driver.influxdb);"+
"importPackage(Packages.jazmin.server.console);"+
"importPackage(Packages.jazmin.server.cdn);"+
"importPackage(Packages.jazmin.server.file);"+
"importPackage(Packages.jazmin.server.jmx);"+
|
4 | import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import com.fuck_boilerplate.rx_paparazzo.entities.Config;
import com.fuck_boilerplate.rx_paparazzo.entities.Size;
<BUG>import com.fuck_boilerplate.rx_paparazzo.entities.TargetUi;
import com.fuck_boilerplate.rx_paparazzo.interactors.GetDimens;
import com.fuck_boilerplate.rx_paparazzo.interactors.GetPath;
import com.fuck_boilerplate.rx_paparazzo.sample.activities.StartActivity;</BUG>
import com.fuck_boilerplate.rx_paparazzo.sample.activities.Testable;
| import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import com.fuck_boilerplate.rx_paparazzo.entities.Config;
import com.fuck_boilerplate.rx_paparazzo.entities.Size;
import com.fuck_boilerplate.rx_paparazzo.entities.TargetUi;
import com.fuck_boilerplate.rx_paparazzo.interactors.DownloadImage;
import com.fuck_boilerplate.rx_paparazzo.interactors.GetDimens;
import com.fuck_boilerplate.rx_paparazzo.interactors.GetPath;
import com.fuck_boilerplate.rx_paparazzo.interactors.ImageUtils;
import com.fuck_boilerplate.rx_paparazzo.sample.activities.StartActivity;
import com.fuck_boilerplate.rx_paparazzo.sample.activities.Testable;
|
5 | private int[] getDimensionsPortrait(int width, int height) {
if (width < height) return new int [] {width, height};
else return new int [] {height, width};
}
private GetDimens getDimens(Size size) {
<BUG>TargetUi targetUi = new TargetUi(activityRule.getActivity());
GetPath getPath = new GetPath(targetUi);</BUG>
Config config = new Config();
<BUG>config.setSize(size);
return new GetDimens(targetUi, config, getPath);</BUG>
}
| private int[] getDimensionsPortrait(int width, int height) {
if (width < height) return new int [] {width, height};
else return new int [] {height, width};
}
private GetDimens getDimens(Size size) {
Config config = new Config();
config.setSize(size);
TargetUi targetUi = new TargetUi(activityRule.getActivity());
ImageUtils imageUtils = new ImageUtils(targetUi, config);
DownloadImage downloadImage = new DownloadImage(targetUi, imageUtils);
GetPath getPath = new GetPath(targetUi, imageUtils, downloadImage);
return new GetDimens(targetUi, config, getPath);
}
|
6 | public GetPath with(Uri uri) {
this.uri = uri;
return this;
}
@Override public Observable<String> react() {
<BUG>return Observable.just(getPath());
}</BUG>
@SuppressLint("NewApi")
<BUG>private String getPath() {
</BUG>
boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
| public GetPath with(Uri uri) {
this.uri = uri;
return this;
}
@Override public Observable<String> react() {
return getPath();
}
@SuppressLint("NewApi")
private Observable<String> getPath() {
|
7 | @SuppressLint("NewApi")
<BUG>private String getPath() {
</BUG>
boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
<BUG>Context context = targetUi.activity();
if (uri == null) {</BUG>
return null;
}
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
if (isExternalStorageDocument(uri)) {
| @SuppressLint("NewApi")
private Observable<String> getPath() {
boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
Context context = targetUi.activity();
String filePath = null;
if (uri == null) {
return null;
}
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
if (isExternalStorageDocument(uri)) {
|
8 | </BUG>
}
}
else if ("content".equalsIgnoreCase(uri.getScheme())) {
<BUG>return getDataColumn(context, uri, null, null);
</BUG>
}
else if ("file".equalsIgnoreCase(uri.getScheme())) {
<BUG>return uri.getPath();
</BUG>
}
| contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
}
else if ("audio".equals(document.type)) {
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
filePath = getDataColumn(context, contentUri, "_id=?", new String[] {document.id});
}
}
else if ("content".equalsIgnoreCase(uri.getScheme())) {
filePath = getDataColumn(context, uri, null, null);
}
else if ("file".equalsIgnoreCase(uri.getScheme())) {
filePath = uri.getPath();
|
9 | else if ("file".equalsIgnoreCase(uri.getScheme())) {
<BUG>return uri.getPath();
</BUG>
}
<BUG>return null;
}</BUG>
private class Document {
String type;
String id;
}
| else if ("file".equalsIgnoreCase(uri.getScheme())) {
filePath = uri.getPath();
}
if (filePath == null) {
return downloadImage.with(uri).react();
}
return Observable.just(filePath);
}
private class Document {
String type;
String id;
}
|
10 | @Override
public void afterExecute(Bus handler, SingleResponse<Relationship> result) {
if (result.hasData()) {
handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData()));
} else if (result.hasException()) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, "Unable to update friendship", result.getException());
}</BUG>
}
| @Override
public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
11 | MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
DebugLog.w(LOGTAG, null, e);
|
12 | for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
DebugLog.w(LOGTAG, null, e);
}
|
13 | import de.vanita5.twittnuker.receiver.NotificationReceiver;
import de.vanita5.twittnuker.service.LengthyOperationsService;
import de.vanita5.twittnuker.util.ActivityTracker;
import de.vanita5.twittnuker.util.AsyncTwitterWrapper;
import de.vanita5.twittnuker.util.DataStoreFunctionsKt;
<BUG>import de.vanita5.twittnuker.util.DataStoreUtils;
import de.vanita5.twittnuker.util.ImagePreloader;</BUG>
import de.vanita5.twittnuker.util.InternalTwitterContentUtils;
import de.vanita5.twittnuker.util.JsonSerializer;
import de.vanita5.twittnuker.util.NotificationManagerWrapper;
| import de.vanita5.twittnuker.receiver.NotificationReceiver;
import de.vanita5.twittnuker.service.LengthyOperationsService;
import de.vanita5.twittnuker.util.ActivityTracker;
import de.vanita5.twittnuker.util.AsyncTwitterWrapper;
import de.vanita5.twittnuker.util.DataStoreFunctionsKt;
import de.vanita5.twittnuker.util.DataStoreUtils;
import de.vanita5.twittnuker.util.DebugLog;
import de.vanita5.twittnuker.util.ImagePreloader;
import de.vanita5.twittnuker.util.InternalTwitterContentUtils;
import de.vanita5.twittnuker.util.JsonSerializer;
import de.vanita5.twittnuker.util.NotificationManagerWrapper;
|
14 | final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, ignore);
}</BUG>
}
| final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
DebugLog.w(LOGTAG, null, ignore);
}
|
15 | import de.vanita5.twittnuker.annotation.CustomTabType;
import de.vanita5.twittnuker.library.MicroBlog;
import de.vanita5.twittnuker.library.MicroBlogException;
import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus;
import de.vanita5.twittnuker.library.twitter.model.Status;
<BUG>import de.vanita5.twittnuker.fragment.AbsStatusesFragment;
import org.mariotaku.sqliteqb.library.AllColumns;</BUG>
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
| import de.vanita5.twittnuker.annotation.CustomTabType;
import de.vanita5.twittnuker.library.MicroBlog;
import de.vanita5.twittnuker.library.MicroBlogException;
import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus;
import de.vanita5.twittnuker.library.twitter.model.Status;
import de.vanita5.twittnuker.fragment.AbsStatusesFragment;
import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
|
16 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
Location location = null;
|
17 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
Utils.closeSilently(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
18 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBackgroundImage(fileBody, tile);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
Utils.closeSilently(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
19 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
return twitter.updateProfileImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
Utils.closeSilently(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
20 | import java.util.List;
import java.util.Map.Entry;
import javax.inject.Singleton;
import okhttp3.Dns;
@Singleton
<BUG>public class TwidereDns implements Constants, Dns {
</BUG>
private static final String RESOLVER_LOGTAG = "TwittnukerDns";
private final SharedPreferences mHostMapping;
private final SharedPreferencesWrapper mPreferences;
| import java.util.List;
import java.util.Map.Entry;
import javax.inject.Singleton;
import okhttp3.Dns;
@Singleton
public class TwidereDns implements Dns, Constants {
private static final String RESOLVER_LOGTAG = "TwittnukerDns";
private final SharedPreferences mHostMapping;
private final SharedPreferencesWrapper mPreferences;
|
21 | private List<InetAddress> resolveInternal(final String originalHost, final String host, final int depth,
final boolean useResolver) throws IOException, SecurityException {
final TimingLogger logger = new TimingLogger(RESOLVER_LOGTAG, "resolve");
final List<InetAddress> fromAddressString = fromAddressString(originalHost, host);
if (fromAddressString != null) {
<BUG>if (BuildConfig.DEBUG) {</BUG>
addLogSplit(logger, host, "valid ip address", depth);
dumpLog(logger, fromAddressString);
<BUG>}</BUG>
return fromAddressString;
| private List<InetAddress> resolveInternal(final String originalHost, final String host, final int depth,
final boolean useResolver) throws IOException, SecurityException {
final TimingLogger logger = new TimingLogger(RESOLVER_LOGTAG, "resolve");
final List<InetAddress> fromAddressString = fromAddressString(originalHost, host);
if (fromAddressString != null) {
addLogSplit(logger, host, "valid ip address", depth);
dumpLog(logger, fromAddressString);
return fromAddressString;
|
22 | if (useResolver) {
addLogSplit(logger, host, "start /etc/hosts resolve", depth);
final List<InetAddress> fromSystemHosts = fromSystemHosts(host);
addLogSplit(logger, host, "end /etc/hosts resolve", depth);
if (fromSystemHosts != null) {
<BUG>if (BuildConfig.DEBUG) {</BUG>
dumpLog(logger, fromSystemHosts);
<BUG>}</BUG>
return fromSystemHosts;
}
| if (useResolver) {
addLogSplit(logger, host, "start /etc/hosts resolve", depth);
final List<InetAddress> fromSystemHosts = fromSystemHosts(host);
addLogSplit(logger, host, "end /etc/hosts resolve", depth);
if (fromSystemHosts != null) {
dumpLog(logger, fromSystemHosts);
return fromSystemHosts;
}
|
23 | dumpLog(logger, fromDefault);
<BUG>}</BUG>
return fromDefault;
}
<BUG>private void dumpLog(final TimingLogger logger, @NonNull List<InetAddress> addresses) {
Log.v(RESOLVER_LOGTAG, "Resolved " + addresses);</BUG>
logger.dumpToLog();
}
<BUG>private void addLogSplit(final TimingLogger logger, String host, String message, int depth) {
final StringBuilder sb = new StringBuilder();</BUG>
for (int i = 0; i < depth; i++) {
| dumpLog(logger, fromDefault);
return fromDefault;
}
private void dumpLog(final TimingLogger logger, @NonNull List<InetAddress> addresses) {
if (BuildConfig.DEBUG) return;
Log.v(RESOLVER_LOGTAG, "Resolved " + addresses);
logger.dumpToLog();
}
private void addLogSplit(final TimingLogger logger, String host, String message, int depth) {
if (BuildConfig.DEBUG) return;
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < depth; i++) {
|
24 | package com.easytoolsoft.easyreport.web.controller.common;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/error")
<BUG>public class ErrorController extends AbstractController {
@RequestMapping(value = {"/404"})</BUG>
public String error404() {
return "/error/404";
}
| package com.easytoolsoft.easyreport.web.controller.common;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/error")
public class ErrorController {
@RequestMapping(value = {"/404"})
public String error404() {
return "/error/404";
}
|
25 | package com.easytoolsoft.easyreport.web.controller.membership;
<BUG>import com.easytoolsoft.easyreport.web.controller.common.AbstractController;</BUG>
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/membership")
<BUG>public class LoginController extends AbstractController {
@RequestMapping(value = {"/login"})</BUG>
public String login() {
| package com.easytoolsoft.easyreport.web.controller.membership;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/membership")
public class LoginController {
@RequestMapping(value = {"/login"})
public String login() {
|
26 | package com.easytoolsoft.easyreport.metadata.service.impl;
import com.alibaba.fastjson.JSON;
<BUG>import com.easytoolsoft.easyreport.engine.query.QueryerFactory;</BUG>
import com.easytoolsoft.easyreport.data.common.helper.PageInfo;
import com.easytoolsoft.easyreport.data.common.helper.ParameterBuilder;
import com.easytoolsoft.easyreport.data.common.service.AbstractCrudService;
<BUG>import com.easytoolsoft.easyreport.engine.data.ReportDataSource;
import com.easytoolsoft.easyreport.engine.data.ReportMetaDataColumn;
import com.easytoolsoft.easyreport.engine.data.ReportQueryParamItem;</BUG>
import com.easytoolsoft.easyreport.data.metadata.dao.IReportDao;
| package com.easytoolsoft.easyreport.metadata.service.impl;
import com.alibaba.fastjson.JSON;
import com.easytoolsoft.easyreport.data.common.helper.PageInfo;
import com.easytoolsoft.easyreport.data.common.helper.ParameterBuilder;
import com.easytoolsoft.easyreport.data.common.service.AbstractCrudService;
import com.easytoolsoft.easyreport.data.metadata.dao.IReportDao;
import com.easytoolsoft.easyreport.data.metadata.po.Category;
import com.easytoolsoft.easyreport.data.metadata.po.DataSource;
import com.easytoolsoft.easyreport.data.metadata.po.Report;
import com.easytoolsoft.easyreport.data.metadata.po.ReportOptions;
import com.easytoolsoft.easyreport.engine.data.ReportDataSource;
|
27 | package com.easytoolsoft.easyreport.web.controller;
<BUG>import com.easytoolsoft.easyreport.web.controller.common.AbstractController;</BUG>
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/home")
<BUG>public class HomeController extends AbstractController {
@RequestMapping(value = {"", "/", "/index"})</BUG>
public String index() {
| package com.easytoolsoft.easyreport.web.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/home")
public class HomeController {
@RequestMapping(value = {"", "/", "/index"})
public String index() {
|
28 | package org.literacyapp.model.contributor;
import java.util.Calendar;
<BUG>import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;</BUG>
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
| package org.literacyapp.model.contributor;
import java.util.Calendar;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
|
29 | import javax.persistence.Temporal;</BUG>
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.literacyapp.model.BaseEntity;
import org.literacyapp.model.Contributor;
<BUG>@Entity
public class ContributorEvent extends BaseEntity {
</BUG>
@NotNull
@ManyToOne
| package org.literacyapp.model.contributor;
import java.util.Calendar;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.literacyapp.model.BaseEntity;
import org.literacyapp.model.Contributor;
@MappedSuperclass
public abstract class ContributorEvent extends BaseEntity {
@NotNull
@ManyToOne
|
30 | import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
<BUG>import org.literacyapp.dao.ContentCreationEventDao;</BUG>
import org.literacyapp.model.Contributor;
import org.literacyapp.model.content.Allophone;
<BUG>import org.literacyapp.model.contributor.ContentCreationEvent;</BUG>
import org.literacyapp.model.enums.Environment;
| import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
import org.literacyapp.model.Contributor;
import org.literacyapp.model.content.Allophone;
import org.literacyapp.model.enums.Environment;
|
31 | @RequestMapping("/content/allophone/create")
public class AllophoneCreateController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
<BUG>@Autowired
private ContentCreationEventDao contentCreationEventDao;</BUG>
@Autowired
private MessageSource messageSource;
@RequestMapping(method = RequestMethod.GET)
| @RequestMapping("/content/allophone/create")
public class AllophoneCreateController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
@Autowired
private MessageSource messageSource;
@RequestMapping(method = RequestMethod.GET)
|
32 | package org.literacyapp.web.content.allophone;
<BUG>import java.net.URLEncoder;</BUG>
import java.util.Calendar;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
<BUG>import org.literacyapp.dao.ContentCreationEventDao;</BUG>
import org.literacyapp.model.Contributor;
| package org.literacyapp.web.content.allophone;
import java.util.Calendar;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
import org.literacyapp.model.Contributor;
|
33 | import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
<BUG>import org.literacyapp.dao.ContentCreationEventDao;</BUG>
import org.literacyapp.model.Contributor;
import org.literacyapp.model.content.Allophone;
<BUG>import org.literacyapp.model.contributor.ContentCreationEvent;
import org.literacyapp.model.enums.Environment;
import org.literacyapp.model.enums.Team;
import org.literacyapp.util.SlackApiHelper;
import org.literacyapp.web.context.EnvironmentContextLoaderListener;</BUG>
import org.springframework.beans.factory.annotation.Autowired;
| import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
import org.literacyapp.model.Contributor;
import org.literacyapp.model.content.Allophone;
import org.springframework.beans.factory.annotation.Autowired;
|
34 | @RequestMapping("/content/allophone/edit")
public class AllophoneEditController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
<BUG>@Autowired
private ContentCreationEventDao contentCreationEventDao;</BUG>
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(Model model, @PathVariable Long id) {
logger.info("handleRequest");
| @RequestMapping("/content/allophone/edit")
public class AllophoneEditController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(Model model, @PathVariable Long id) {
logger.info("handleRequest");
|
35 | import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/content")
public class MainContentController {
private final Logger logger = Logger.getLogger(getClass());
<BUG>@Autowired
private ContentCreationEventDao contentCreationEventDao;</BUG>
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(
HttpServletRequest request,
| import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/content")
public class MainContentController {
private final Logger logger = Logger.getLogger(getClass());
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(
HttpServletRequest request,
|
36 | import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor;
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
import org.jetbrains.jet.lang.descriptors.Modality;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.BindingContext;
<BUG>import org.jetbrains.jet.lang.resolve.BindingContextUtils;
import org.jetbrains.jet.lexer.JetTokens;</BUG>
import org.jetbrains.jet.plugin.JetBundle;
import org.jetbrains.jet.plugin.codeInsight.JetFunctionPsiElementCellRenderer;
import org.jetbrains.jet.plugin.project.WholeProjectAnalyzerFacade;
| import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor;
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
import org.jetbrains.jet.lang.descriptors.Modality;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
import org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils;
import org.jetbrains.jet.lexer.JetTokens;
import org.jetbrains.jet.plugin.JetBundle;
import org.jetbrains.jet.plugin.codeInsight.JetFunctionPsiElementCellRenderer;
import org.jetbrains.jet.plugin.project.WholeProjectAnalyzerFacade;
|
37 | cgl.setLexicalvalue(valueEdit);
cgl.setIdgroup(idDomaine);
cgl.setIdthesaurus(idTheso);
cgl.setLang(langueEdit);
GroupHelper cgh = new GroupHelper();
<BUG>if (!cgh.isDomainExist(connect.getPoolConnexion(),
cgl.getLexicalvalue(),</BUG>
cgl.getIdthesaurus(), cgl.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
return;
| cgl.setLexicalvalue(valueEdit);
cgl.setIdgroup(idDomaine);
cgl.setIdthesaurus(idTheso);
cgl.setLang(langueEdit);
GroupHelper cgh = new GroupHelper();
if (cgh.isDomainExist(connect.getPoolConnexion(),
cgl.getLexicalvalue(),
cgl.getIdthesaurus(), cgl.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
return;
|
38 | Term terme = new Term();
terme.setId_thesaurus(idTheso);
terme.setLang(langueEdit);
terme.setLexical_value(valueEdit);
terme.setId_term(idT);
<BUG>if (new TermHelper().isTermExist(connect.getPoolConnexion(),
</BUG>
terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
| Term terme = new Term();
terme.setId_thesaurus(idTheso);
terme.setLang(langueEdit);
terme.setLexical_value(valueEdit);
terme.setId_term(idT);
if (termHelper.isTermExist(connect.getPoolConnexion(),
terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
|
39 | terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
return;
}
<BUG>ConceptHelper ch = new ConceptHelper();</BUG>
if (!ch.addTopConceptTraduction(connect.getPoolConnexion(), terme, user.getUser().getId())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("Error")));
return;
}
<BUG>ArrayList<NodeTermTraduction> tempNTT = new TermHelper().getTraductionsOfConcept(connect.getPoolConnexion(), idC, idTheso, idlangue);
</BUG>
langues = new ArrayList<>();
| terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
return;
}
if (!ch.addTopConceptTraduction(connect.getPoolConnexion(), terme, user.getUser().getId())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("Error")));
return;
}
ArrayList<NodeTermTraduction> tempNTT = termHelper.getTraductionsOfConcept(connect.getPoolConnexion(), idC, idTheso, idlangue);
langues = new ArrayList<>();
|
40 | Term terme = new Term();
terme.setId_thesaurus(idTheso);
terme.setLang(langueEdit);
terme.setLexical_value(valueEdit);
terme.setId_term(idT);
<BUG>if (new TermHelper().isTermExist(connect.getPoolConnexion(),
</BUG>
terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
| Term terme = new Term();
terme.setId_thesaurus(idTheso);
terme.setLang(langueEdit);
terme.setLexical_value(valueEdit);
terme.setId_term(idT);
if (termHelper.isTermExist(connect.getPoolConnexion(),
terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
|
41 | terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
return;
}
<BUG>ConceptHelper ch = new ConceptHelper();</BUG>
if (!ch.addConceptTraduction(connect.getPoolConnexion(), terme, user.getUser().getId())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("Error")));
return;
}
<BUG>ArrayList<NodeTermTraduction> tempNTT = new TermHelper().getTraductionsOfConcept(connect.getPoolConnexion(), idC, idTheso, idlangue);
</BUG>
langues = new ArrayList<>();
| terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
return;
}
if (!ch.addConceptTraduction(connect.getPoolConnexion(), terme, user.getUser().getId())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("Error")));
return;
}
ArrayList<NodeTermTraduction> tempNTT = termHelper.getTraductionsOfConcept(connect.getPoolConnexion(), idC, idTheso, idlangue);
langues = new ArrayList<>();
|
42 | langues = new ArrayList<>();
HashMap<String, String> tempMapL = new HashMap<>();
for (NodeTermTraduction ntt : tempNTT) {
tempMapL.put(ntt.getLang(), ntt.getLexicalValue());
}
<BUG>langues.addAll(tempMapL.entrySet());
}</BUG>
langueEdit = "";
valueEdit = "";
if (!tradExist) {
| langues = new ArrayList<>();
HashMap<String, String> tempMapL = new HashMap<>();
for (NodeTermTraduction ntt : tempNTT) {
tempMapL.put(ntt.getLang(), ntt.getLexicalValue());
}
langues.addAll(tempMapL.entrySet());
if(newTraduction) {
nom = termHelper.getThisTerm(connect.getPoolConnexion(),idC, idTheso, idlangue).getLexical_value();
}
}
langueEdit = "";
valueEdit = "";
if (!tradExist) {
|
43 | if (n.getTitle().trim().isEmpty()) {
dynamicTreeNode = (TreeNode) new MyTreeNode(1, n.getIdConcept(), idTheso, idlangue, "", "", "dossier", n.getIdConcept(), root);
} else {
dynamicTreeNode = (TreeNode) new MyTreeNode(1, n.getIdConcept(), idTheso, idlangue, "", "", "dossier", n.getTitle(), root);
}
<BUG>new DefaultTreeNode("fake", dynamicTreeNode);
}</BUG>
}
public void onNodeExpand(NodeExpandEvent event) {
String theso = ((MyTreeNode) event.getTreeNode()).getIdTheso();
| if (n.getTitle().trim().isEmpty()) {
dynamicTreeNode = (TreeNode) new MyTreeNode(1, n.getIdConcept(), idTheso, idlangue, "", "", "dossier", n.getIdConcept(), root);
} else {
dynamicTreeNode = (TreeNode) new MyTreeNode(1, n.getIdConcept(), idTheso, idlangue, "", "", "dossier", n.getTitle(), root);
}
DefaultTreeNode defaultTreeNode = new DefaultTreeNode("fake", dynamicTreeNode);
defaultTreeNode.setExpanded(true);
}
}
public void onNodeExpand(NodeExpandEvent event) {
String theso = ((MyTreeNode) event.getTreeNode()).getIdTheso();
|
44 | SKOSXmlDocument sxd = new ReadFileSKOS().readStringBuffer(sb);
for (SKOSResource resource : sxd.getResourcesList()) {
NodeAlignment na = new NodeAlignment();
na.setInternal_id_concept(idC);
na.setInternal_id_thesaurus(idTheso);
<BUG>na.setThesaurus_target("OpenTheso");
</BUG>
na.setUri_target(resource.getUri());
for(SKOSLabel label : resource.getLabelsList()) {
switch (label.getProperty()) {
| SKOSXmlDocument sxd = new ReadFileSKOS().readStringBuffer(sb);
for (SKOSResource resource : sxd.getResourcesList()) {
NodeAlignment na = new NodeAlignment();
na.setInternal_id_concept(idC);
na.setInternal_id_thesaurus(idTheso);
na.setThesaurus_target("Pactols");
na.setUri_target(resource.getUri());
for(SKOSLabel label : resource.getLabelsList()) {
switch (label.getProperty()) {
|
45 | 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.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
public final class PatchUtils {
|
46 | package org.jboss.as.patching;
import org.jboss.as.controller.AttributeDefinition;
<BUG>import org.jboss.as.controller.SimpleAttributeDefinition;</BUG>
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
import org.jboss.dmr.ModelType;
<BUG>class Constants {
</BUG>
static final AttributeDefinition PATCH_ID = SimpleAttributeDefinitionBuilder.create("patch-id", ModelType.STRING).build();
| package org.jboss.as.patching;
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
import org.jboss.dmr.ModelType;
public class Constants {
|
47 | 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 {
| 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;
import org.jboss.logging.annotations.MessageBundle;
import org.jboss.logging.annotations.Cause;
import java.io.IOException;
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
|
48 | 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;
| package org.jboss.as.patching.runner;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.PatchLogger;
import org.jboss.as.patching.PatchMessages;
|
49 | 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"),
| 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"),
ADDED_MODULE("added-module"),
APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MISC_FILES("misc-files"),
|
50 | writer.writeEndElement();
final Patch.PatchType type = patch.getPatchType();
<BUG>final List<String> appliesTo = patch.getAppliesTo();</BUG>
if(type == Patch.PatchType.ONE_OFF) {
<BUG>writer.writeEmptyElement(Element.ONE_OFF.name);
</BUG>
} else {
<BUG>writer.writeEmptyElement(Element.CUMULATIVE.name);
</BUG>
writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
| writer.writeEndElement();
writer.writeStartElement(Element.DESCRIPTION.name);
writer.writeCharacters(patch.getDescription());
writer.writeEndElement();
final Patch.PatchType type = patch.getPatchType();
if(type == Patch.PatchType.ONE_OFF) {
writer.writeStartElement(Element.ONE_OFF.name);
} else {
writer.writeStartElement(Element.CUMULATIVE.name);
writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
|
51 | } else {
<BUG>writer.writeEmptyElement(Element.CUMULATIVE.name);
</BUG>
writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
}
<BUG>writer.writeAttribute(Attribute.APPLIES_TO_VERSION.name, appliesTo);
final List<ContentModification> bundlesAdd = new ArrayList<ContentModification>();</BUG>
final List<ContentModification> bundlesUpdate = new ArrayList<ContentModification>();
final List<ContentModification> bundlesRemove = new ArrayList<ContentModification>();
final List<ContentModification> miscAdd = new ArrayList<ContentModification>();
| } else {
writer.writeStartElement(Element.CUMULATIVE.name);
writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
}
writeAppliesToVersions(writer, patch.getAppliesTo());
writer.writeEndElement(); // </one-off> or </cumulative>
final List<ContentModification> bundlesAdd = new ArrayList<ContentModification>();
final List<ContentModification> bundlesUpdate = new ArrayList<ContentModification>();
final List<ContentModification> bundlesRemove = new ArrayList<ContentModification>();
final List<ContentModification> miscAdd = new ArrayList<ContentModification>();
|
52 | 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) {
| 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) {
case RESULTING_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
|
53 | 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) {
| final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
writer.writeAttribute(Attribute.PATH.name, path.toString());
if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
}
if(type != ModificationType.REMOVE) {
writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
|
54 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\"")));
}
| }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
.in(() -> task2)
.process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\"")));
}
|
55 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, sum, fib));
}
| return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, sum, fib));
}
|
56 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task<String> task2 = Task.ofType(String.class).named("Baz", 40)
.in(() -> task1)</BUG>
.ins(() -> singletonList(task1))
| final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
.process(() -> 9999L);
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
.ins(() -> singletonList(task1))
|
57 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField + " causes an outer reference");</BUG>
serialize(task);
}
@Test
| assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
serialize(task);
}
@Test
|
58 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.evaluate(des).consume(val);
| serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
serialize(task);
Task<String> des = deserialize();
context.evaluate(des).consume(val);
|
59 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() -> n);
| TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
if (n < 2) {
return fib
.process(() -> n);
|
60 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
}
@Test
public void shouldParseFlags() throws Exception {
|
61 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
}
@Test
public void shouldParseCustomTypes() throws Exception {
|
62 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
}
public enum CustomEnum {
BAR
|
63 | if (itemStack.getAmount() > 0) {
return itemStack;
}
}
}
<BUG>return null;
}</BUG>
public static Collection<ItemDrop> parseConfig(ConfigurationSection config)
{
Collection<ItemDrop> drops = Collections.emptyList();
| if (itemStack.getAmount() > 0) {
return itemStack;
}
}
}
return new ItemStack(Material.AIR, 0);
}
public static Collection<ItemDrop> parseConfig(ConfigurationSection config)
{
Collection<ItemDrop> drops = Collections.emptyList();
|
64 | import java.util.Collections;
import java.util.Map;
import org.apache.commons.lang.math.NumberRange;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
<BUG>import org.bukkit.entity.EntityType;</BUG>
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
<BUG>import org.bukkit.inventory.ItemStack;</BUG>
import se.crafted.chrisb.ecoCreature.commons.DependencyUtils;
| import java.util.Collections;
import java.util.Map;
import org.apache.commons.lang.math.NumberRange;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import se.crafted.chrisb.ecoCreature.commons.DependencyUtils;
|
65 | {
private static final String NO_COIN_REWARD_MESSAGE = "&7You slayed a &5<crt>&7 using a &3<itm>&7.";
private static final String COIN_REWARD_MESSAGE = "&7You are awarded &6<amt>&7 for slaying a &5<crt>&7.";
private static final String COIN_PENALTY_MESSAGE = "&7You are penalized &6<amt>&7 for slaying a &5<crt>&7.";
private String name;
<BUG>private CoinDrop coin;
private Collection<ItemDrop> itemDrops;
private Collection<EntityDrop> entityDrops;
private Collection<JockeyDrop> jockeyDrops;</BUG>
private Message noCoinRewardMessage;
| {
private static final String NO_COIN_REWARD_MESSAGE = "&7You slayed a &5<crt>&7 using a &3<itm>&7.";
private static final String COIN_REWARD_MESSAGE = "&7You are awarded &6<amt>&7 for slaying a &5<crt>&7.";
private static final String COIN_PENALTY_MESSAGE = "&7You are penalized &6<amt>&7 for slaying a &5<crt>&7.";
private String name;
private Collection<AbstractDrop> drops;
private Message noCoinRewardMessage;
|
66 | this.name = name;
}
public boolean hasPermission(Player player)
{
return DependencyUtils.hasPermission(player, "reward." + name);
<BUG>}
public boolean hasCoin()
{
return coin != null;</BUG>
}
| this.name = name;
}
public boolean hasPermission(Player player)
{
return DependencyUtils.hasPermission(player, "reward." + name);
}
|
67 | <BUG>package se.crafted.chrisb.ecoCreature.drops.models;
import org.apache.commons.lang.math.NumberRange;</BUG>
import org.bukkit.configuration.ConfigurationSection;
public class CoinDrop extends AbstractDrop
{
| package se.crafted.chrisb.ecoCreature.drops.models;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import org.apache.commons.lang.math.NumberRange;
import org.bukkit.configuration.ConfigurationSection;
public class CoinDrop extends AbstractDrop
{
|
68 | gain = IDENTITY;
party = Collections.emptyList();
integerCurrency = false;
name = "Unknown";
coin = ZERO;
<BUG>itemDrops = Collections.emptyList();
entityDrops = Collections.emptyList();
jockeyDrops = Collections.emptyList();
message = DefaultMessage.NO_MESSAGE;</BUG>
parameters = new HashMap<>();
| gain = IDENTITY;
party = Collections.emptyList();
integerCurrency = false;
name = "Unknown";
coin = ZERO;
itemDrops = new ArrayList<>();
entityDrops = new ArrayList<>();
jockeyDrops = new ArrayList<>();
message = DefaultMessage.NO_MESSAGE;
parameters = new HashMap<>();
|
69 | Range nod = nodata;
<BUG>Double destNod = null;
</BUG>
if (backgroundValues != null && backgroundValues.length > 0) {
<BUG>destNod = backgroundValues[0];
}</BUG>
if (interp instanceof InterpolationBilinear) {
interpB = (InterpolationBilinear) interp;
this.interp = interpB;
interpB.setROIdata(roiBounds, roiIter);
| Range nod = nodata;
double[] destNod = null;
if (backgroundValues != null && backgroundValues.length > 0) {
destNod = backgroundValues;
}
if (interp instanceof InterpolationBilinear) {
interpB = (InterpolationBilinear) interp;
this.interp = interpB;
interpB.setROIdata(roiBounds, roiIter);
|
70 | interpB.setROIdata(roiBounds, roiIter);
if (nod == null) {
nod = interpB.getNoDataRange();
}
if (destNod == null) {
<BUG>destNod = interpB.getDestinationNoData();
</BUG>
}
}
if (nod != null) {
| interpB.setROIdata(roiBounds, roiIter);
if (nod == null) {
nod = interpB.getNoDataRange();
}
if (destNod == null) {
destNod = new double[]{interpB.getDestinationNoData()};
}
}
if (nod != null) {
|
71 | } else {
<BUG>byteLookupTable[i] = 0;
</BUG>
if(i !=0){
<BUG>byteLookupTable[0] = 1;
</BUG>
}
}
} else {
<BUG>byteLookupTable[i] = value;
</BUG>
}
| } else {
byteLookupTable[b][i] = 0;
if(i !=0){
byteLookupTable[b][0] = 1;
}
}
} else {
byteLookupTable[b][i] = value;
|
72 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
dstPixelOffset += dstPixelStride;
}
} else
|
73 | dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
| dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
dstPixelOffset += dstPixelStride;
}
}
|
74 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
dstPixelOffset += dstPixelStride;
}
} else
|
75 | final int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
final int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
}
}
} else {
| final int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
final int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
}
}
} else {
|
76 | dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
| dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
dstPixelOffset += dstPixelStride;
}
}
|
77 | for (int k2 = 0; k2 < dst_num_bands; k2++) {
int s00 = srcDataArrays[k2][posx + posy + bandOffsets[k2]];
int s01 = srcDataArrays[k2][posxhigh + posy + bandOffsets[k2]];
int s10 = srcDataArrays[k2][posx + posyhigh + bandOffsets[k2]];
int s11 = srcDataArrays[k2][posxhigh + posyhigh + bandOffsets[k2]];
<BUG>int w00 = byteLookupTable[s00&0xFF] == destinationNoDataByte ? 0 : 1;
int w01 = byteLookupTable[s01&0xFF] == destinationNoDataByte ? 0 : 1;
int w10 = byteLookupTable[s10&0xFF] == destinationNoDataByte ? 0 : 1;
int w11 = byteLookupTable[s11&0xFF] == destinationNoDataByte ? 0 : 1;
</BUG>
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
| for (int k2 = 0; k2 < dst_num_bands; k2++) {
int s00 = srcDataArrays[k2][posx + posy + bandOffsets[k2]];
int s01 = srcDataArrays[k2][posxhigh + posy + bandOffsets[k2]];
int s10 = srcDataArrays[k2][posx + posyhigh + bandOffsets[k2]];
int s11 = srcDataArrays[k2][posxhigh + posyhigh + bandOffsets[k2]];
int w00 = byteLookupTable[k2][s00&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
int w01 = byteLookupTable[k2][s01&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
int w10 = byteLookupTable[k2][s10&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
int w11 = byteLookupTable[k2][s11&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
|
78 | dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = (byte) (intResult & 0xff);
}
}
} else if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
}
}
if (fracx < fracdx1) {
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = (byte) (intResult & 0xff);
}
}
} else if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
}
}
if (fracx < fracdx1) {
|
79 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
dstPixelOffset += dstPixelStride;
}
} else
|
80 | int w11 = w11index < roiDataLength ? roiDataArray[w11index] & 0xff : 0;
if (baseIndex > roiDataLength || w00 == 0
|| (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0)) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
}
}
} else {
| int w11 = w11index < roiDataLength ? roiDataArray[w11index] & 0xff : 0;
if (baseIndex > roiDataLength || w00 == 0
|| (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0)) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
}
}
} else {
|
81 | final int s00 = srcDataArrays[k2][posx + posy + bandOffsets[k2]];
final int s01 = srcDataArrays[k2][posxhigh + posy + bandOffsets[k2]];
final int s10 = srcDataArrays[k2][posx + posyhigh + bandOffsets[k2]];
final int s11 = srcDataArrays[k2][posxhigh + posyhigh
+ bandOffsets[k2]];
<BUG>w00 = byteLookupTable[s00&0xFF] == destinationNoDataByte ? 0 : 1;
w01 = byteLookupTable[s01&0xFF] == destinationNoDataByte ? 0 : 1;
w10 = byteLookupTable[s10&0xFF] == destinationNoDataByte ? 0 : 1;
w11 = byteLookupTable[s11&0xFF] == destinationNoDataByte ? 0 : 1;
</BUG>
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
| final int s00 = srcDataArrays[k2][posx + posy + bandOffsets[k2]];
final int s01 = srcDataArrays[k2][posxhigh + posy + bandOffsets[k2]];
final int s10 = srcDataArrays[k2][posx + posyhigh + bandOffsets[k2]];
final int s11 = srcDataArrays[k2][posxhigh + posyhigh
+ bandOffsets[k2]];
w00 = byteLookupTable[k2][s00&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w01 = byteLookupTable[k2][s01&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w10 = byteLookupTable[k2][s10&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w11 = byteLookupTable[k2][s11&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
|
82 | dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
| dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
dstPixelOffset += dstPixelStride;
}
}
|
83 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
dstPixelOffset += dstPixelStride;
}
} else
|
84 | int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
}
}
} else {
| int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
}
}
} else {
|
85 | + bandOffsets[k2]];
final int s10 = srcDataArrays[k2][posx + posyhigh
+ bandOffsets[k2]];
final int s11 = srcDataArrays[k2][posxhigh + posyhigh
+ bandOffsets[k2]];
<BUG>w00 = byteLookupTable[s00&0xFF] == destinationNoDataByte ? 0 : 1;
w01 = byteLookupTable[s01&0xFF] == destinationNoDataByte ? 0 : 1;
w10 = byteLookupTable[s10&0xFF] == destinationNoDataByte ? 0 : 1;
w11 = byteLookupTable[s11&0xFF] == destinationNoDataByte ? 0 : 1;
</BUG>
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
| + bandOffsets[k2]];
final int s10 = srcDataArrays[k2][posx + posyhigh
+ bandOffsets[k2]];
final int s11 = srcDataArrays[k2][posxhigh + posyhigh
+ bandOffsets[k2]];
w00 = byteLookupTable[k2][s00&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w01 = byteLookupTable[k2][s01&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w10 = byteLookupTable[k2][s10&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w11 = byteLookupTable[k2][s11&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
|
86 | dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
| dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
dstPixelOffset += dstPixelStride;
}
}
|
87 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
dstPixelOffset += dstPixelStride;
}
} else
|
88 | dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
| dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
dstPixelOffset += dstPixelStride;
}
}
|
89 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
dstPixelOffset += dstPixelStride;
}
} else
|
90 | final int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
final int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
}
}
} else {
| final int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
final int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
}
}
} else {
|
91 | dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
| dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
dstPixelOffset += dstPixelStride;
}
}
|
92 | int w01 = noData.contains(s01) ? 0 : 1;
int w10 = noData.contains(s10) ? 0 : 1;
int w11 = noData.contains(s11) ? 0 : 1;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
}
} else {
double result = computeValue(s00, s01, s10, s11, w00, w01, w10,
| int w01 = noData.contains(s01) ? 0 : 1;
int w10 = noData.contains(s10) ? 0 : 1;
int w11 = noData.contains(s11) ? 0 : 1;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
}
} else {
double result = computeValue(s00, s01, s10, s11, w00, w01, w10,
|
93 | dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = (short) (intResult & 0xffff);
}
}
} else if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
}
}
if (fracx < fracdx1) {
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = (short) (intResult & 0xffff);
}
}
} else if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
}
}
if (fracx < fracdx1) {
|
94 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
dstPixelOffset += dstPixelStride;
}
} else
|
95 | int w11 = w11index < roiDataLength ? roiDataArray[w11index] & 0xff : 0;
if (baseIndex > roiDataLength || w00 == 0
|| (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0)) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
}
}
} else {
| int w11 = w11index < roiDataLength ? roiDataArray[w11index] & 0xff : 0;
if (baseIndex > roiDataLength || w00 == 0
|| (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0)) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
}
}
} else {
|
96 | w01 = noData.contains(s01) ? 0 : 1;
w10 = noData.contains(s10) ? 0 : 1;
w11 = noData.contains(s11) ? 0 : 1;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
}
} else {
double result = computeValue(s00, s01, s10, s11, w00, w01, w10,
| w01 = noData.contains(s01) ? 0 : 1;
w10 = noData.contains(s10) ? 0 : 1;
w11 = noData.contains(s11) ? 0 : 1;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
}
} else {
double result = computeValue(s00, s01, s10, s11, w00, w01, w10,
|
97 | dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
| dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
dstPixelOffset += dstPixelStride;
}
}
|
98 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
dstPixelOffset += dstPixelStride;
}
} else
|
99 | int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
}
}
} else {
| int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
}
}
} else {
|
100 | w01 = noData.contains(s01) ? 0 : 1;
w10 = noData.contains(s10) ? 0 : 1;
w11 = noData.contains(s11) ? 0 : 1;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort;
</BUG>
}
} else {
double result = computeValue(s00, s01, s10, s11, w00, w01,
| w01 = noData.contains(s01) ? 0 : 1;
w10 = noData.contains(s10) ? 0 : 1;
w11 = noData.contains(s11) ? 0 : 1;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataUShort[k2];
}
} else {
double result = computeValue(s00, s01, s10, s11, w00, w01,
|
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 31