conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
String key;
String unlocalizedName;
String postfix;
public AnimatedEntity owner;
=======
private final AnimatedEntity<?> owner;
>>>>>>>
String key;
String unlocalizedName;
String postfix;
public AnimatedEntity owner;
<<<<<<<
public AlterEntry(String postfix, String unlocalizedName)
{
this.postfix = postfix;
this.unlocalizedName = unlocalizedName;
}
public AlterEntry()
{
this("", null);
}
void onRegistered(AnimatedEntity owner)
=======
public AlterEntry(AnimatedEntity<?> owner)
>>>>>>>
public AlterEntry(String postfix, String unlocalizedName)
{
this.postfix = postfix;
this.unlocalizedName = unlocalizedName;
}
public AlterEntry()
{
this("", null);
}
void onRegistered(AnimatedEntity owner)
<<<<<<<
this.key = this.owner.key + postfix;
if (this.unlocalizedName == null)
{
this.unlocalizedName = this.owner.unlocalizedName;
}
=======
>>>>>>>
this.key = this.owner.key + postfix;
if (this.unlocalizedName == null)
{
this.unlocalizedName = this.owner.unlocalizedName;
} |
<<<<<<<
public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) {
return new MethodProperty(this, deser, _nullProvider);
}
@Override
public SettableBeanProperty withNullProvider(NullValueProvider nva) {
return new MethodProperty(this, _valueDeserializer, nva);
=======
public MethodProperty withValueDeserializer(JsonDeserializer<?> deser) {
if (_valueDeserializer == deser) {
return this;
}
return new MethodProperty(this, deser);
>>>>>>>
public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) {
if (_valueDeserializer == deser) {
return this;
}
return new MethodProperty(this, deser, _nullProvider);
}
@Override
public SettableBeanProperty withNullProvider(NullValueProvider nva) {
return new MethodProperty(this, _valueDeserializer, nva); |
<<<<<<<
fetchRatings(app.getPackageName(), stats);
stats.setNumberOfComments(fetchCommentsCount(app.getPackageName(),
Utils.getDisplayLocale()));
=======
fetchRatings(app, stats);
stats.setNumberOfComments(fetchCommentsCount(app));
>>>>>>>
fetchRatings(app, stats);
stats.setNumberOfComments(fetchCommentsCount(app, Utils.getDisplayLocale()));
<<<<<<<
int startIndex, int count, String displayLocale) throws DevConsoleException {
=======
String developerId, int startIndex, int count) throws DevConsoleException {
>>>>>>>
String developerId, int startIndex, int count, String displayLocale)
throws DevConsoleException {
<<<<<<<
return fetchComments(packageName, startIndex, count, displayLocale);
=======
return fetchComments(packageName, developerId, startIndex, count);
>>>>>>>
return fetchComments(packageName, developerId, startIndex, count, displayLocale);
<<<<<<<
return fetchComments(packageName, startIndex, count, displayLocale);
=======
return fetchComments(packageName, developerId, startIndex, count);
>>>>>>>
return fetchComments(packageName, developerId, startIndex, count, displayLocale);
<<<<<<<
String response = post(protocol.createFetchAppsUrl(), protocol.createFetchAppInfosRequest());
// don't skip incomplete apps, so we can get the package list
List<AppInfo> apps = protocol.parseAppInfosResponse(response, accountName, false);
if (apps.isEmpty()) {
return apps;
}
List<AppInfo> result = new ArrayList<AppInfo>(apps);
List<String> incompletePackages = new ArrayList<String>();
for (AppInfo app : apps) {
if (app.isIncomplete()) {
result.remove(app);
incompletePackages.add(app.getPackageName());
}
}
if (incompletePackages.isEmpty()) {
return result;
}
Log.d(TAG,
String.format("Got %d incomplete apps, issuing details request",
incompletePackages.size()));
response = post(protocol.createFetchAppsUrl(),
protocol.createFetchAppInfosRequest(incompletePackages));
// if info is not here, not much to do, skip
List<AppInfo> extraApps = protocol.parseAppInfosResponse(response, accountName, true);
Log.d(TAG, String.format("Got %d extra apps from details request", extraApps.size()));
result.addAll(extraApps);
return result;
=======
List<AppInfo> appInfos = new ArrayList<AppInfo>();
for (String developerId : protocol.getSessionCredentials().getDeveloperAccountIds()) {
String response = post(protocol.createFetchAppsUrl(developerId),
protocol.createFetchAppInfosRequest(), developerId);
List<AppInfo> currentAppInfos = protocol.parseAppInfosResponse(response, accountName);
for (AppInfo appInfo : currentAppInfos) {
appInfo.setDeveloperId(developerId);
}
appInfos.addAll(currentAppInfos);
}
return appInfos;
>>>>>>>
List<AppInfo> result = new ArrayList<AppInfo>();
for (String developerId : protocol.getSessionCredentials().getDeveloperAccountIds()) {
String response = post(protocol.createFetchAppsUrl(developerId),
protocol.createFetchAppInfosRequest(), developerId);
// don't skip incomplete apps, so we can get the package list
List<AppInfo> apps = protocol.parseAppInfosResponse(response, accountName, false);
if (apps.isEmpty()) {
continue;
}
for (AppInfo appInfo : apps) {
appInfo.setDeveloperId(developerId);
}
result.addAll(apps);
List<String> incompletePackages = new ArrayList<String>();
for (AppInfo app : apps) {
if (app.isIncomplete()) {
result.remove(app);
incompletePackages.add(app.getPackageName());
}
}
if (incompletePackages.isEmpty()) {
continue;
}
Log.d(TAG, String.format("Got %d incomplete apps, issuing details request",
incompletePackages.size()));
response = post(protocol.createFetchAppsUrl(developerId),
protocol.createFetchAppInfosRequest(incompletePackages), developerId);
// if info is not here, not much to do, skip
List<AppInfo> extraApps = protocol.parseAppInfosResponse(response, accountName, true);
Log.d(TAG, String.format("Got %d extra apps from details request", extraApps.size()));
for (AppInfo appInfo : extraApps) {
appInfo.setDeveloperId(developerId);
}
result.addAll(extraApps);
}
return result;
<<<<<<<
private int fetchCommentsCount(String packageName, String displayLocale)
throws DevConsoleException {
=======
private int fetchCommentsCount(AppInfo appInfo) throws DevConsoleException {
>>>>>>>
private int fetchCommentsCount(AppInfo appInfo, String displayLocale)
throws DevConsoleException {
<<<<<<<
String response = post(protocol.createFetchCommentsUrl(),
protocol.createFetchCommentsRequest(packageName, 0, pageSize, displayLocale));
=======
String developerId = appInfo.getDeveloperId();
String response = post(protocol.createFetchCommentsUrl(developerId),
protocol.createFetchCommentsRequest(appInfo.getPackageName(), 0, pageSize),
developerId);
>>>>>>>
String developerId = appInfo.getDeveloperId();
String response = post(protocol.createFetchCommentsUrl(developerId),
protocol.createFetchCommentsRequest(appInfo.getPackageName(), 0, pageSize,
displayLocale), developerId);
<<<<<<<
response = post(protocol.createFetchCommentsUrl(), protocol.createFetchCommentsRequest(
packageName, approxNumComments - pageSize, pageSize, displayLocale));
int finalNumComments = protocol.extractCommentsCount(response);
=======
response = post(
protocol.createFetchCommentsUrl(developerId),
protocol.createFetchCommentsRequest(appInfo.getPackageName(), approxNumComments
- pageSize, pageSize), developerId);
finalNumComments += protocol.extractCommentsCount(response);
>>>>>>>
response = post(
protocol.createFetchCommentsUrl(developerId),
protocol.createFetchCommentsRequest(appInfo.getPackageName(), approxNumComments
- pageSize, pageSize, displayLocale), developerId);
finalNumComments += protocol.extractCommentsCount(response);
<<<<<<<
private List<Comment> fetchComments(String packageName, int startIndex, int count,
String displayLocale) throws DevConsoleException {
String response = post(protocol.createFetchCommentsUrl(),
protocol.createFetchCommentsRequest(packageName, startIndex, count, displayLocale));
=======
private List<Comment> fetchComments(String packageName, String developerId, int startIndex,
int count) throws DevConsoleException {
List<Comment> comments = new ArrayList<Comment>();
String response = post(protocol.createFetchCommentsUrl(developerId),
protocol.createFetchCommentsRequest(packageName, startIndex, count), developerId);
comments.addAll(protocol.parseCommentsResponse(response));
>>>>>>>
private List<Comment> fetchComments(String packageName, String developerId, int startIndex,
int count, String displayLocale) throws DevConsoleException {
List<Comment> comments = new ArrayList<Comment>();
String response = post(protocol.createFetchCommentsUrl(developerId),
protocol.createFetchCommentsRequest(packageName, startIndex, count, displayLocale),
developerId);
comments.addAll(protocol.parseCommentsResponse(response)); |
<<<<<<<
=======
import com.github.andlyticsproject.model.Revenue;
import com.github.andlyticsproject.model.RevenueSummary;
import com.github.andlyticsproject.sync.AutosyncHandler;
>>>>>>>
import com.github.andlyticsproject.model.Revenue;
import com.github.andlyticsproject.model.RevenueSummary;
import com.github.andlyticsproject.sync.AutosyncHandler;
<<<<<<<
=======
Log.w(TAG, "Old version < 21 - add new stats colums");
db.execSQL("ALTER table " + AppStatsTable.DATABASE_TABLE_NAME + " add "
+ AppStatsTable.KEY_STATS_TOTAL_REVENUE + " double");
db.execSQL("ALTER table " + AppStatsTable.DATABASE_TABLE_NAME + " add "
+ AppStatsTable.KEY_STATS_CURRENCY + " text");
}
>>>>>>>
if (oldVersion < 17) {
Log.w(TAG, "Old version < 17 - changing comments date format");
db.execSQL("DROP TABLE IF EXISTS " + CommentsTable.DATABASE_TABLE_NAME);
db.execSQL(CommentsTable.TABLE_CREATE_COMMENTS);
}
if (oldVersion < 18) {
Log.w(TAG, "Old version < 18 - adding replies to comments");
db.execSQL("DROP TABLE IF EXISTS " + CommentsTable.DATABASE_TABLE_NAME);
db.execSQL(CommentsTable.TABLE_CREATE_COMMENTS);
}
if (oldVersion < 19) {
Log.w(TAG, "Old version < 19 - adding developer_accounts table");
db.execSQL("DROP TABLE IF EXISTS " + DeveloperAccountsTable.DATABASE_TABLE_NAME);
db.execSQL(DeveloperAccountsTable.TABLE_CREATE_DEVELOPER_ACCOUNT);
migrateAccountsFromPrefs(db);
Log.d(TAG, "Old version < 19 - adding new appinfo columns");
db.execSQL("ALTER table " + AppInfoTable.DATABASE_TABLE_NAME + " add "
+ AppInfoTable.KEY_APP_ADMOB_ACCOUNT + " text");
db.execSQL("ALTER table " + AppInfoTable.DATABASE_TABLE_NAME + " add "
+ AppInfoTable.KEY_APP_ADMOB_SITE_ID + " text");
db.execSQL("ALTER table " + AppInfoTable.DATABASE_TABLE_NAME + " add "
+ AppInfoTable.KEY_APP_LAST_COMMENTS_UPDATE + " date");
migrateAppInfoPrefs(db);
Log.d(TAG, "Old version < 19 - adding new appstats columns");
db.execSQL("ALTER table " + AppStatsTable.DATABASE_TABLE_NAME + " add "
+ AppStatsTable.KEY_STATS_NUM_ERRORS + " integer");
}
if (oldVersion < 20) {
Log.w(TAG, "Old version < 20 - add new comments colums");
db.execSQL("ALTER table " + CommentsTable.DATABASE_TABLE_NAME + " add "
+ CommentsTable.KEY_COMMENT_LANGUAGE + " text");
db.execSQL("ALTER table " + CommentsTable.DATABASE_TABLE_NAME + " add "
+ CommentsTable.KEY_COMMENT_ORIGINAL_TEXT + " text");
db.execSQL("ALTER table " + CommentsTable.DATABASE_TABLE_NAME + " add "
+ CommentsTable.KEY_COMMENT_UNIQUE_ID + " text");
Log.w(TAG, "Old version < 20 - adding links table");
db.execSQL("DROP TABLE IF EXISTS " + LinksTable.DATABASE_TABLE_NAME);
db.execSQL(LinksTable.TABLE_CREATE_LINKS);
Log.d(TAG, "Old version < 20 - adding new app_details table");
db.execSQL("DROP TABLE IF EXISTS " + AppDetailsTable.DATABASE_TABLE_NAME);
db.execSQL(AppDetailsTable.TABLE_CREATE_APP_DETAILS);
Log.d(TAG, "Old version < 20 - adding new appinfo columns");
db.execSQL("ALTER table " + AppInfoTable.DATABASE_TABLE_NAME + " add "
+ AppInfoTable.KEY_APP_DEVELOPER_ID + " text");
db.execSQL("ALTER table " + AppInfoTable.DATABASE_TABLE_NAME + " add "
+ AppInfoTable.KEY_APP_DEVELOPER_NAME + " text");
// XXX
// db.execSQL("ALTER table " + DeveloperAccountsTable.DATABASE_TABLE_NAME + " add "
// + DeveloperAccountsTable.DEVELOPER_ID + " text");
}
if (oldVersion < 21) {
Log.w(TAG, "Old version < 21 - adding revenue_summary table");
db.execSQL("DROP TABLE IF EXISTS " + RevenueSummaryTable.DATABASE_TABLE_NAME);
db.execSQL(RevenueSummaryTable.TABLE_CREATE_REVENUE_SUMMARY);
Log.w(TAG, "Old version < 21 - add new stats colums");
db.execSQL("ALTER table " + AppStatsTable.DATABASE_TABLE_NAME + " add "
+ AppStatsTable.KEY_STATS_TOTAL_REVENUE + " double");
db.execSQL("ALTER table " + AppStatsTable.DATABASE_TABLE_NAME + " add "
+ AppStatsTable.KEY_STATS_CURRENCY + " text");
}
<<<<<<<
=======
public synchronized void fetchRevenueSummary(AppInfo appInfo) {
if (appInfo.getId() == null) {
// not persistent
return;
}
SQLiteDatabase db = getReadableDatabase();
Cursor c = null;
try {
c = db.query(RevenueSummaryTable.DATABASE_TABLE_NAME, RevenueSummaryTable.ALL_COLUMNS,
RevenueSummaryTable.APPINFO_ID + "=?",
new String[] { Long.toString(appInfo.getId()) }, null, null, null);
if (c.getCount() < 1 || !c.moveToNext()) {
return;
}
Long id = c.getLong(c.getColumnIndex(RevenueSummaryTable.ROWID));
int typeIdx = c.getInt(c.getColumnIndex(RevenueSummaryTable.TYPE));
String currency = c.getString(c.getColumnIndex(RevenueSummaryTable.CURRENCY));
double lastDayTotal = c.getDouble(c.getColumnIndex(RevenueSummaryTable.LAST_DAY_TOTAL));
double last7DaysTotal = c.getDouble(c
.getColumnIndex(RevenueSummaryTable.LAST_7DAYS_TOTAL));
double last30DaysTotal = c.getDouble(c
.getColumnIndex(RevenueSummaryTable.LAST_30DAYS_TOTAL));
double overallTotal = c.getDouble(c
.getColumnIndex(RevenueSummaryTable.OVERALL_TOTAL));
Revenue.Type type = Revenue.Type.values()[typeIdx];
RevenueSummary revenue = new RevenueSummary(type, currency, lastDayTotal,
last7DaysTotal, last30DaysTotal, overallTotal);
revenue.setId(id);
appInfo.setTotalRevenueSummary(revenue);
} finally {
if (c != null) {
c.close();
}
}
}
>>>>>>>
public synchronized void fetchRevenueSummary(AppInfo appInfo) {
if (appInfo.getId() == null) {
// not persistent
return;
}
SQLiteDatabase db = getReadableDatabase();
Cursor c = null;
try {
c = db.query(RevenueSummaryTable.DATABASE_TABLE_NAME, RevenueSummaryTable.ALL_COLUMNS,
RevenueSummaryTable.APPINFO_ID + "=?",
new String[] { Long.toString(appInfo.getId()) }, null, null, null);
if (c.getCount() < 1 || !c.moveToNext()) {
return;
}
Long id = c.getLong(c.getColumnIndex(RevenueSummaryTable.ROWID));
int typeIdx = c.getInt(c.getColumnIndex(RevenueSummaryTable.TYPE));
String currency = c.getString(c.getColumnIndex(RevenueSummaryTable.CURRENCY));
double lastDayTotal = c.getDouble(c.getColumnIndex(RevenueSummaryTable.LAST_DAY_TOTAL));
double last7DaysTotal = c.getDouble(c
.getColumnIndex(RevenueSummaryTable.LAST_7DAYS_TOTAL));
double last30DaysTotal = c.getDouble(c
.getColumnIndex(RevenueSummaryTable.LAST_30DAYS_TOTAL));
double overallTotal = c.getDouble(c.getColumnIndex(RevenueSummaryTable.OVERALL_TOTAL));
Revenue.Type type = Revenue.Type.values()[typeIdx];
RevenueSummary revenue = new RevenueSummary(type, currency, lastDayTotal,
last7DaysTotal, last30DaysTotal, overallTotal);
revenue.setId(id);
appInfo.setTotalRevenueSummary(revenue);
} finally {
if (c != null) {
c.close();
}
}
} |
<<<<<<<
@SuppressWarnings("deprecation")
=======
>>>>>>>
@SuppressWarnings("deprecation") |
<<<<<<<
this(ClassUtil.rawClass(valueType));
=======
// 26-Sep-2017, tatu: [databind#1764] need to add null-check back until 3.x
_valueClass = (valueType == null) ? Object.class : valueType.getRawClass();
_valueType = valueType;
>>>>>>>
_valueType = Objects.requireNonNull(valueType, "`null` not accepted as value type");
_valueClass = valueType.getRawClass();
<<<<<<<
* new instances via {@link com.fasterxml.jackson.databind.JsonDeserializer#createContextual}.
=======
* new instances for {@link com.fasterxml.jackson.databind.deser.ContextualDeserializer}.
*
* @since 2.5
>>>>>>>
* new instances via {@link com.fasterxml.jackson.databind.JsonDeserializer#createContextual}.
<<<<<<<
=======
*
* @since 2.5
>>>>>>>
<<<<<<<
T result = (T) ctxt.handleUnexpectedToken(_valueClass, p.currentToken(), p, msg);
=======
T result = (T) ctxt.handleUnexpectedToken(getValueType(ctxt), p.getCurrentToken(), p, msg);
>>>>>>>
T result = (T) ctxt.handleUnexpectedToken(getValueType(ctxt), p.currentToken(), p, msg);
<<<<<<<
=======
*
* @since 2.2
>>>>>>>
<<<<<<<
=======
/**
* @since 2.9
*/
>>>>>>> |
<<<<<<<
=======
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.cronutils.model.Cron;
>>>>>>>
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
<<<<<<<
import java.util.*;
import java.util.stream.Collectors;
=======
import com.cronutils.model.field.expression.QuestionMark;
>>>>>>>
import java.util.stream.Collectors; |
<<<<<<<
} // end-class Option
=======
}
//</editor-fold>
>>>>>>>
}
//</editor-fold>
} // end-class Option |
<<<<<<<
return new BeanDeserializer(this, _beanDesc,
_constructPropMap(props), _backRefProperties, _ignorableProps, _ignoreAllUnknown,
_anyViews(props));
=======
return new BeanDeserializer(this,
_beanDesc, propertyMap, _backRefProperties, _ignorableProps, _ignoreAllUnknown, _includableProps,
anyViews);
>>>>>>>
return new BeanDeserializer(this,
_beanDesc, _constructPropMap(props), _backRefProperties, _ignorableProps, _ignoreAllUnknown, _includableProps,
_anyViews(props)); |
<<<<<<<
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
=======
import com.gemstone.gemfire.test.junit.categories.FlakyTest;
>>>>>>>
import com.gemstone.gemfire.test.junit.categories.FlakyTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized; |
<<<<<<<
=======
import static com.gemstone.gemfire.test.dunit.Assert.*;
import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
import static com.gemstone.gemfire.test.dunit.Wait.*;
import java.util.List;
import java.util.Properties;
import org.junit.Test;
import org.junit.experimental.categories.Category;
>>>>>>>
import static com.gemstone.gemfire.test.dunit.Assert.*;
import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
import static com.gemstone.gemfire.test.dunit.Wait.*;
import java.util.List;
import java.util.Properties;
import org.junit.Test;
import org.junit.experimental.categories.Category;
<<<<<<<
private static final long serialVersionUID = 1L;
=======
>>>>>>>
private static final long serialVersionUID = 1L;
<<<<<<<
final DistributedMember vm1Member = (DistributedMember) vm3.invoke(() -> getMember());
pause(10000);
=======
final DistributedMember vm1Member = (DistributedMember) vm3.invoke(() -> WANCommandTestBase.getMember());
pause(10000);
>>>>>>>
final DistributedMember vm1Member = (DistributedMember) vm3.invoke(() -> getMember());
pause(10000); |
<<<<<<<
/* Ok: time to mix type id, value; and we will actually use "wrapper-array"
* style to ensure we can handle all kinds of JSON constructs.
*/
JsonParser p2 = _tokens[index].asParser(ctxt, p);
=======
// Ok: time to mix type id, value; and we will actually use "wrapper-array"
// style to ensure we can handle all kinds of JSON constructs.
JsonParser p2 = _tokens[index].asParser(p);
>>>>>>>
// Ok: time to mix type id, value; and we will actually use "wrapper-array"
// style to ensure we can handle all kinds of JSON constructs.
JsonParser p2 = _tokens[index].asParser(ctxt, p); |
<<<<<<<
=======
import com.gemstone.gemfire.internal.logging.LogService;
import com.gemstone.org.jgroups.Event;
import com.gemstone.org.jgroups.JChannel;
import com.gemstone.org.jgroups.stack.Protocol;
>>>>>>>
import com.gemstone.gemfire.internal.logging.LogService; |
<<<<<<<
public IndexCommandsDUnitTest(boolean useHttpOnConnect, boolean enableAuth) {
super(useHttpOnConnect, enableAuth);
}
=======
>>>>>>>
public IndexCommandsDUnitTest(boolean useHttpOnConnect, boolean enableAuth) {
super(useHttpOnConnect, enableAuth);
} |
<<<<<<<
offHeap, hdfsStoreName , hdfsWriteOnly, mcastEnabled, regionAttributes);
=======
offHeap, regionAttributes);
>>>>>>>
offHeap, mcastEnabled, regionAttributes);
<<<<<<<
prTotalMaxMemory, prTotalNumBuckets, null,compressor, offHeap , hdfsStoreName , hdfsWriteOnly, mcastEnabled);
=======
prTotalMaxMemory, prTotalNumBuckets, null,compressor, offHeap);
>>>>>>>
prTotalMaxMemory, prTotalNumBuckets, null,compressor, offHeap , mcastEnabled); |
<<<<<<<
=======
import com.gemstone.gemfire.test.dunit.SerializableCallable;
>>>>>>>
<<<<<<<
import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
import org.junit.runners.Parameterized;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
=======
import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
>>>>>>>
import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
import org.junit.runners.Parameterized;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
<<<<<<<
public CliCommandTestBase(){
this(false, false);
}
// Junit will use the parameters to initialize the test class and run the tests with different parameters
public CliCommandTestBase(boolean useHttpOnConnect, boolean enableAuth){
this.useHttpOnConnect = useHttpOnConnect;
this.enableAuth = enableAuth;
}
@Parameterized.Parameters
public static Collection parameters() {
return Arrays.asList(new Object[][] {
{ false, false }, // useHttpOnConnect=false, no security enabled
{ true, false }, // useHttpOnConnect=true, no security enabled
{ false, true }, // useHttpOnConnect=false, security enabled with cacheServer.json
{ true, true } // useHttpOnConnect=true, security enabled with cacheServer.json
});
}
=======
>>>>>>>
public CliCommandTestBase(){
this(false, false);
}
// Junit will use the parameters to initialize the test class and run the tests with different parameters
public CliCommandTestBase(boolean useHttpOnConnect, boolean enableAuth){
this.useHttpOnConnect = useHttpOnConnect;
this.enableAuth = enableAuth;
}
@Parameterized.Parameters
public static Collection parameters() {
return Arrays.asList(new Object[][] {
{ false, false }, // useHttpOnConnect=false, no security enabled
{ true, false }, // useHttpOnConnect=true, no security enabled
{ false, true }, // useHttpOnConnect=false, security enabled with cacheServer.json
{ true, true } // useHttpOnConnect=true, security enabled with cacheServer.json
});
}
<<<<<<<
return executeCommand(shell, command.toString());
=======
CommandResult result = executeCommand(shell, command.toString());
if (!shell.isConnectedAndReady()) {
throw new AssertionError(
"Connect command failed to connect to manager " + endpoint + " result=" + commandResultToString(result));
}
info("Successfully connected to managing node using " + (useHttpOnConnect ? "HTTP" : "JMX"));
assertEquals(true, shell.isConnectedAndReady());
>>>>>>>
CommandResult result = executeCommand(shell, command.toString());
if (!shell.isConnectedAndReady()) {
throw new TestException(
"Connect command failed to connect to manager " + endpoint + " result=" + commandResultToString(result));
}
info("Successfully connected to managing node using " + (useHttpOnConnect ? "HTTP" : "JMX"));
assertEquals(true, shell.isConnectedAndReady());
return result; |
<<<<<<<
import org.n52.janmayen.Comparables;
import org.n52.shetland.util.CollectionHelper;
=======
>>>>>>>
import org.n52.janmayen.Comparables;
import org.n52.shetland.util.CollectionHelper;
<<<<<<<
public boolean hasSamplingGeometry() {
return getSamplingGeometry() != null && !getSamplingGeometry().isEmpty();
}
@Override
public Object getLongitude() {
return longitude;
}
@Override
public AbstractBaseObservation setLongitude(final Object longitude) {
this.longitude = longitude;
return this;
}
@Override
public Object getLatitude() {
return latitude;
}
@Override
public AbstractBaseObservation setLatitude(final Object latitude) {
this.latitude = latitude;
return this;
}
@Override
public Object getAltitude() {
return altitude;
}
@Override
public AbstractBaseObservation setAltitude(final Object altitude) {
this.altitude = altitude;
return this;
}
public boolean isSetLongLat() {
return getLongitude() != null && getLatitude() != null;
}
public boolean isSetAltitude() {
return getAltitude() != null;
}
public boolean isSpatial() {
return hasSamplingGeometry() || isSetLongLat();
}
@Override
public int getSrid() {
return srid;
}
@Override
public AbstractBaseObservation setSrid(final int srid) {
this.srid = srid;
return this;
}
public boolean isSetSrid() {
return getSrid() > 0;
}
@Override
=======
>>>>>>>
public Object getLongitude() {
return longitude;
}
@Override
public AbstractBaseObservation setLongitude(final Object longitude) {
this.longitude = longitude;
return this;
}
@Override
public Object getLatitude() {
return latitude;
}
@Override
public AbstractBaseObservation setLatitude(final Object latitude) {
this.latitude = latitude;
return this;
}
@Override
public Object getAltitude() {
return altitude;
}
@Override
public AbstractBaseObservation setAltitude(final Object altitude) {
this.altitude = altitude;
return this;
}
public boolean isSetLongLat() {
return getLongitude() != null && getLatitude() != null;
}
public boolean isSetAltitude() {
return getAltitude() != null;
}
public boolean isSpatial() {
return hasSamplingGeometry() || isSetLongLat();
}
@Override
public int getSrid() {
return srid;
}
@Override
public void setSrid(final int srid) {
this.srid = srid;
}
public boolean isSetSrid() {
return getSrid() > 0;
}
@Override
<<<<<<<
@Override
public boolean hasParameters() {
return CollectionHelper.isNotEmpty(getParameters());
}
@Override
public Set<RelatedObservation> getRelatedObservations() {
return relatedObservations;
}
@Override
public void setRelatedObservations(Set<RelatedObservation> relatedObservations) {
this.relatedObservations = relatedObservations;
}
@Override
public boolean hasRelatedObservations() {
return CollectionHelper.isNotEmpty(getRelatedObservations());
}
@Override
public int compareTo(AbstractBaseObservation o) {
return Comparables.chain(o).compare(getObservationId(), o.getObservationId()).result();
}
=======
>>>>>>>
@Override
public Set<RelatedObservation> getRelatedObservations() {
return relatedObservations;
}
@Override
public void setRelatedObservations(Set<RelatedObservation> relatedObservations) {
this.relatedObservations = relatedObservations;
}
@Override
public boolean hasRelatedObservations() {
return CollectionHelper.isNotEmpty(getRelatedObservations());
}
@Override
public int compareTo(AbstractBaseObservation o) {
return Comparables.chain(o).compare(getObservationId(), o.getObservationId()).result();
} |
<<<<<<<
import static com.gemstone.gemfire.test.dunit.Assert.*;
import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
=======
>>>>>>>
import static com.gemstone.gemfire.test.dunit.Assert.*;
import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
<<<<<<<
import com.gemstone.gemfire.test.dunit.SerializableRunnable;
=======
>>>>>>>
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.SerializableRunnable; |
<<<<<<<
@Category({ DistributedTest.class, FlakyTest.class }) // see GEODE-1034
@RunWith(Parameterized.class)
=======
@Category(DistributedTest.class)
>>>>>>>
@Category(DistributedTest.class)
@RunWith(Parameterized.class) |
<<<<<<<
@Category({ DistributedTest.class, FlakyTest.class }) // see GEODE-689, GEODE-1048
@RunWith(Parameterized.class)
=======
@Category(DistributedTest.class)
>>>>>>>
@Category(DistributedTest.class)
@RunWith(Parameterized.class)
<<<<<<<
=======
@Category(FlakyTest.class) // GEODE-1048: HeadlessGFSH, random ports
@Test
>>>>>>>
@Category(FlakyTest.class) // GEODE-1048: HeadlessGFSH, random ports
@Test
<<<<<<<
=======
@Category(FlakyTest.class) // GEODE-689: random ports, unused returns, HeadlessGfsh
@Test
>>>>>>>
@Category(FlakyTest.class) // GEODE-689: random ports, unused returns, HeadlessGfsh
@Test |
<<<<<<<
SerializableRunnable disconnect = new SerializableRunnable("Disconnect from " + locators) {
public void run() {
DistributedSystem sys = InternalDistributedSystem.getAnyInstance();
if (sys != null && sys.isConnected()) {
sys.disconnect();
}
MembershipManagerHelper.inhibitForcedDisconnectLogging(false);
}
};
SerializableRunnable expectedException = new SerializableRunnable("Add expected exceptions") {
public void run() {
MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
}
};
=======
addDSProps(properties);
SerializableRunnable disconnect =
new SerializableRunnable("Disconnect from " + locators) {
public void run() {
DistributedSystem sys = InternalDistributedSystem.getAnyInstance();
if (sys != null && sys.isConnected()) {
sys.disconnect();
}
MembershipManagerHelper.inhibitForcedDisconnectLogging(false);
}
};
SerializableRunnable expectedException =
new SerializableRunnable("Add expected exceptions") {
public void run() {
MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
}
};
>>>>>>>
addDSProps(properties);
SerializableRunnable disconnect = new SerializableRunnable("Disconnect from " + locators) {
public void run() {
DistributedSystem sys = InternalDistributedSystem.getAnyInstance();
if (sys != null && sys.isConnected()) {
sys.disconnect();
}
MembershipManagerHelper.inhibitForcedDisconnectLogging(false);
}
};
SerializableRunnable expectedException = new SerializableRunnable("Add expected exceptions") {
public void run() {
MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
}
};
<<<<<<<
SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
public void run() {
//System.setProperty("p2p.joinTimeout", "5000");
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, locators);
props.setProperty(MEMBER_TIMEOUT, "1000");
DistributedSystem.connect(props);
}
};
=======
SerializableRunnable connect =
new SerializableRunnable("Connect to " + locators) {
public void run() {
//System.setProperty("p2p.joinTimeout", "5000");
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, locators);
props.setProperty(MEMBER_TIMEOUT, "1000");
addDSProps(props);
DistributedSystem.connect(props);
}
};
>>>>>>>
SerializableRunnable connect =
new SerializableRunnable("Connect to " + locators) {
public void run() {
//System.setProperty("p2p.joinTimeout", "5000");
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, locators);
props.setProperty(MEMBER_TIMEOUT, "1000");
addDSProps(props);
DistributedSystem.connect(props);
}
};
<<<<<<<
SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
public void run() {
//System.setProperty("p2p.joinTimeout", "5000");
DistributedSystem sys = getSystem(props);
sys.getLogWriter().info(addExpected);
}
};
=======
addDSProps(props);
SerializableRunnable connect =
new SerializableRunnable("Connect to " + locators) {
public void run() {
//System.setProperty("p2p.joinTimeout", "5000");
DistributedSystem sys = getSystem(props);
sys.getLogWriter().info(addExpected);
}
};
>>>>>>>
addDSProps(props);
SerializableRunnable connect =
new SerializableRunnable("Connect to " + locators) {
public void run() {
//System.setProperty("p2p.joinTimeout", "5000");
DistributedSystem sys = getSystem(props);
sys.getLogWriter().info(addExpected);
}
};
<<<<<<<
vm0.invoke("start Locator1", () -> startLocator(port1, dsProps));
=======
addDSProps(dsProps);
vm0.invoke(new SerializableRunnable("Start locator on " + port1) {
public void run() {
File logFile = new File("");
try {
Locator.startLocatorAndDS(port1, logFile, dsProps);
} catch (IOException ex) {
com.gemstone.gemfire.test.dunit.Assert.fail("While starting locator on port " + port1, ex);
}
}
});
>>>>>>>
vm0.invoke("start Locator1", () -> startLocator(port1, dsProps));
<<<<<<<
SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
public void run() {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, locators);
DistributedSystem.connect(props);
}
};
=======
SerializableRunnable connect =
new SerializableRunnable("Connect to " + locators) {
public void run() {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, locators);
addDSProps(props);
DistributedSystem.connect(props);
}
};
>>>>>>>
SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
public void run() {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, locators);
addDSProps(properties);
DistributedSystem.connect(props);
}
};
<<<<<<<
=======
public void testLoop() throws Exception {
for(int i=0; i < 200; i++) {
testMultipleLocatorsRestartingAtSameTime();
tearDown();
setUp();
}
}
>>>>>>>
public void testLoop() throws Exception {
for(int i=0; i < 200; i++) {
testMultipleLocatorsRestartingAtSameTime();
tearDown();
setUp();
}
}
<<<<<<<
SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
public void run() {
Properties props = new Properties();
props.setProperty(MCAST_PORT, String.valueOf(mcastport));
props.setProperty(LOCATORS, locators);
props.setProperty(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
props.setProperty(MCAST_TTL, "0");
props.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "true");
DistributedSystem.connect(props);
}
};
=======
SerializableRunnable connect =
new SerializableRunnable("Connect to " + locators) {
public void run() {
Properties props = new Properties();
props.setProperty(MCAST_PORT, String.valueOf(mcastport));
props.setProperty(LOCATORS, locators);
props.setProperty(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
props.setProperty(MCAST_TTL, "0");
props.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "true");
addDSProps(props);
DistributedSystem.connect(props);
}
};
>>>>>>>
SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
public void run() {
Properties props = new Properties();
props.setProperty(MCAST_PORT, String.valueOf(mcastport));
props.setProperty(LOCATORS, locators);
props.setProperty(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
props.setProperty(MCAST_TTL, "0");
props.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "true");
addDSProps(properties);
DistributedSystem.connect(props);
}
}; |
<<<<<<<
startCacheServer(vm0, port[0]);
startCacheServer(vm1, port[1]);
=======
>>>>>>>
public CopyOnReadIndexDUnitTest(String name) {
super(name);
}
public void setUp() throws Exception {
super.setUp();
getSystem();
invokeInEveryVM(new SerializableRunnable("getSystem") {
public void run() {
getSystem();
}
});
Host host = Host.getHost(0);
vm0 = host.getVM(0);
vm1 = host.getVM(1);
vm2 = host.getVM(2);
}
public void tearDown2() throws Exception {
disconnectAllFromDS();
}
//test different queries against partitioned region
public void testPRQueryOnLocalNode() throws Exception {
QueryTestUtils utils = new QueryTestUtils();
configureServers();
helpTestPRQueryOnLocalNode(utils.queries.get("545"), 100, 100, true);
helpTestPRQueryOnLocalNode(utils.queries.get("546"), 100, 100, true);
helpTestPRQueryOnLocalNode(utils.queries.get("543"), 100, 100, true);
helpTestPRQueryOnLocalNode(utils.queries.get("544"), 100, 100, true);
helpTestPRQueryOnLocalNode("select * from /portfolios p where p.ID = 1", 100, 1, true);
helpTestPRQueryOnLocalNode(utils.queries.get("545"), 100, 100, false);
helpTestPRQueryOnLocalNode(utils.queries.get("546"), 100, 100, false);
helpTestPRQueryOnLocalNode(utils.queries.get("543"), 100, 100, false);
helpTestPRQueryOnLocalNode(utils.queries.get("544"), 100, 100, false);
helpTestPRQueryOnLocalNode("select * from /portfolios p where p.ID = 1", 100, 1, false);
}
//tests different queries with a transaction for replicated region
public void testTransactionsOnReplicatedRegion() throws Exception {
QueryTestUtils utils = new QueryTestUtils();
configureServers();
helpTestTransactionsOnReplicatedRegion(utils.queries.get("545"), 100, 100, true);
helpTestTransactionsOnReplicatedRegion(utils.queries.get("546"), 100, 100, true);
helpTestTransactionsOnReplicatedRegion(utils.queries.get("543"), 100, 100, true);
helpTestTransactionsOnReplicatedRegion(utils.queries.get("544"), 100, 100, true);
helpTestTransactionsOnReplicatedRegion("select * from /portfolios p where p.ID = 1", 100, 1, true);
helpTestTransactionsOnReplicatedRegion(utils.queries.get("545"), 100, 100, false);
helpTestTransactionsOnReplicatedRegion(utils.queries.get("546"), 100, 100, false);
helpTestTransactionsOnReplicatedRegion(utils.queries.get("543"), 100, 100, false);
helpTestTransactionsOnReplicatedRegion(utils.queries.get("544"), 100, 100, false);
helpTestTransactionsOnReplicatedRegion("select * from /portfolios p where p.ID = 1", 100, 1, false);
}
private void configureServers() throws Exception {
final int[] port = AvailablePortHelper.getRandomAvailableTCPPorts(3);
final int mcastPort = AvailablePortHelper.getRandomAvailableUDPPort();
startCacheServer(vm0, port[0], mcastPort);
startCacheServer(vm1, port[1], mcastPort);
startCacheServer(vm2, port[2], mcastPort);
}
//The tests sets up a partition region across 2 servers
//It does puts in each server, checking instance counts of portfolio objects
//Querying the data will result in deserialization of portfolio objects.
//In cases where index is present, the objects will be deserialized in the cache
public void helpTestPRQueryOnLocalNode(final String queryString, final int numPortfolios, final int numExpectedResults, final boolean hasIndex) throws Exception {
<<<<<<<
final int[] port = AvailablePortHelper.getRandomAvailableTCPPorts(3);
startCacheServer(vm0, port[0]);
startCacheServer(vm1, port[1]);
startCacheServer(vm2, port[2]);
=======
>>>>>>>
<<<<<<<
disconnectFromDS();
getSystem(getServerProperties());
=======
getSystem(getServerProperties());
>>>>>>>
getSystem(getServerProperties()); |
<<<<<<<
=======
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.lib.legacy.ClassImposteriser;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
>>>>>>>
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.lib.legacy.ClassImposteriser;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
<<<<<<<
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.lib.legacy.ClassImposteriser;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import static org.junit.Assert.*;
=======
>>>>>>> |
<<<<<<<
import com.gemstone.gemfire.internal.net.SSLEnabledComponent;
import com.gemstone.gemfire.internal.net.SocketCreator;
=======
import com.gemstone.gemfire.internal.security.SecurableComponent;
>>>>>>>
import com.gemstone.gemfire.internal.security.SecurableComponent;
import com.gemstone.gemfire.internal.net.SSLEnabledComponent;
import com.gemstone.gemfire.internal.net.SocketCreator;
<<<<<<<
=======
/**
* First check if sslComponents are in the list of valid components. If so, check that no other *-ssl-* properties other than cluster-ssl-* are set.
* This would mean one is mixing the "old" with the "new"
*/
@ConfigAttributeChecker(name=SECURITY_ENABLED_COMPONENTS)
protected String checkSecurityEnabledComponents(String value) {
// value with no commas
// empty value
// null
if (StringUtils.isEmpty(value) || SecurableComponent.NONE.name().equalsIgnoreCase(value)) {
return value;
}
if (!value.contains(",")) {
SecurableComponent.getEnum(value);
return value;
}
StringTokenizer stringTokenizer = new StringTokenizer(value, ",");
while (stringTokenizer.hasMoreTokens()){
SecurableComponent.getEnum(stringTokenizer.nextToken());
}
return value;
}
>>>>>>>
/**
* First check if sslComponents are in the list of valid components. If so, check that no other *-ssl-* properties other than cluster-ssl-* are set.
* This would mean one is mixing the "old" with the "new"
*/
@ConfigAttributeChecker(name=SECURITY_ENABLED_COMPONENTS)
protected String checkSecurityEnabledComponents(String value) {
// value with no commas
// empty value
// null
if (StringUtils.isEmpty(value) || SecurableComponent.NONE.name().equalsIgnoreCase(value)) {
return value;
}
if (!value.contains(",")) {
SecurableComponent.getEnum(value);
return value;
}
StringTokenizer stringTokenizer = new StringTokenizer(value, ",");
while (stringTokenizer.hasMoreTokens()){
SecurableComponent.getEnum(stringTokenizer.nextToken());
}
return value;
}
<<<<<<<
m.put(SSL_ENABLED_COMPONENTS, "A comma delimited list of components that require SSL communications");
m.put(SSL_CIPHERS, "List of available SSL cipher suites that are to be enabled. Defaults to \"" + DEFAULT_SSL_CIPHERS + "\" meaning your provider''s defaults.");
m.put(SSL_PROTOCOLS, "List of available SSL protocols that are to be enabled. Defaults to \"" + DEFAULT_SSL_PROTOCOLS + "\" meaning defaults of your provider.");
m.put(SSL_REQUIRE_AUTHENTICATION, "If set to false, ciphers and protocols that permit anonymous clients are allowed. Defaults to \"" + DEFAULT_SSL_REQUIRE_AUTHENTICATION + "\".");
m.put(SSL_KEYSTORE, "Location of the Java keystore file containing the certificate and private key.");
m.put(SSL_KEYSTORE_TYPE, "For Java keystore file format, this property has the value jks (or JKS).");
m.put(SSL_KEYSTORE_PASSWORD, "Password to access the private key from the keystore.");
m.put(SSL_TRUSTSTORE, "Location of the Java keystore file containing the collection of trusted certificates.");
m.put(SSL_TRUSTSTORE_PASSWORD, "Password to unlock the truststore.");
m.put(SSL_DEFAULT_ALIAS, "The default certificate alias to be used in a multi-key keystore");
m.put(SSL_HTTP_SERVICE_REQUIRE_AUTHENTICATION, "This property determines is the HTTP service with use mutual ssl authentication.");
=======
m.put(SECURITY_ENABLED_COMPONENTS, "A comma delimited list of components that should be secured");
>>>>>>>
m.put(SECURITY_ENABLED_COMPONENTS, "A comma delimited list of components that should be secured");
m.put(SSL_ENABLED_COMPONENTS, "A comma delimited list of components that require SSL communications");
m.put(SSL_CIPHERS, "List of available SSL cipher suites that are to be enabled. Defaults to \"" + DEFAULT_SSL_CIPHERS + "\" meaning your provider''s defaults.");
m.put(SSL_PROTOCOLS, "List of available SSL protocols that are to be enabled. Defaults to \"" + DEFAULT_SSL_PROTOCOLS + "\" meaning defaults of your provider.");
m.put(SSL_REQUIRE_AUTHENTICATION, "If set to false, ciphers and protocols that permit anonymous clients are allowed. Defaults to \"" + DEFAULT_SSL_REQUIRE_AUTHENTICATION + "\".");
m.put(SSL_KEYSTORE, "Location of the Java keystore file containing the certificate and private key.");
m.put(SSL_KEYSTORE_TYPE, "For Java keystore file format, this property has the value jks (or JKS).");
m.put(SSL_KEYSTORE_PASSWORD, "Password to access the private key from the keystore.");
m.put(SSL_TRUSTSTORE, "Location of the Java keystore file containing the collection of trusted certificates.");
m.put(SSL_TRUSTSTORE_PASSWORD, "Password to unlock the truststore.");
m.put(SSL_DEFAULT_ALIAS, "The default certificate alias to be used in a multi-key keystore");
m.put(SSL_HTTP_SERVICE_REQUIRE_AUTHENTICATION, "This property determines is the HTTP service with use mutual ssl authentication."); |
<<<<<<<
=======
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
>>>>>>>
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
<<<<<<<
@Rule
public RetryRule retryRule = new RetryRule();
public CreateAlterDestroyRegionCommandsDUnitTest(boolean useHttpOnConnect){
super(useHttpOnConnect);
}
=======
>>>>>>>
public CreateAlterDestroyRegionCommandsDUnitTest(boolean useHttpOnConnect){
super(useHttpOnConnect);
} |
<<<<<<<
=======
import org.junit.BeforeClass;
import org.junit.Ignore;
>>>>>>>
import org.junit.BeforeClass;
import org.junit.Ignore;
<<<<<<<
=======
private static void loadJGroupsJar(List<String> excludedClasses) throws Exception {
System.out.println("loadJGroupsJar starting");
String cp = System.getProperty("java.class.path");
System.out.println("java classpath is " + cp);
System.out.flush();
String[] entries = cp.split(File.pathSeparator);
String gfejgroupsjar = null;
String gfejgroupsjarname = GemFireVersion.getGemFireJGroupsJarFileName();
for (int i=0; i<entries.length; i++) {
System.out.println("examining '" + entries[i] + "'");
System.out.flush();
if (entries[i].endsWith(gfejgroupsjarname)) {
gfejgroupsjar = entries[i];
break;
}
}
if (gfejgroupsjar != null) {
System.out.println("loading class files from " + gfejgroupsjar);
System.out.flush();
loadClasses(new File(gfejgroupsjar), excludedClasses);
}
else {
fail("unable to find jgroups jar");
}
}
>>>>>>> |
<<<<<<<
=======
>>>>>>> |
<<<<<<<
c.drawBitmap(mBitmap, 0, 0, null);
=======
c.drawBitmap(mBitmap, 0, 0, null);
>>>>>>>
c.drawBitmap(mBitmap, 0, 0, null);
<<<<<<<
if (mRedoBuffer != null) {
mUndoBuffer = mRedoBuffer;
=======
if (mRedoBuffer != null) {
mUndoBuffer = mRedoBuffer;
>>>>>>>
if (mRedoBuffer != null) {
mUndoBuffer = mRedoBuffer;
<<<<<<<
mRedoBuffer = saveBuffer();
=======
mRedoBuffer = saveBuffer();
>>>>>>>
mRedoBuffer = saveBuffer();
<<<<<<<
public void restoreBitmap(Bitmap bitmap, Matrix matrix) {
mCanvas.drawBitmap(bitmap, matrix, new Paint(Paint.FILTER_BITMAP_FLAG));
mUndoBuffer = saveBuffer();
=======
public void restoreBitmap(Bitmap bitmap, Matrix matrix) {
mCanvas.drawBitmap(bitmap, matrix, new Paint(Paint.FILTER_BITMAP_FLAG));
mUndoBuffer = saveBuffer();
>>>>>>>
public void restoreBitmap(Bitmap bitmap, Matrix matrix) {
mCanvas.drawBitmap(bitmap, matrix, new Paint(Paint.FILTER_BITMAP_FLAG));
mUndoBuffer = saveBuffer();
<<<<<<<
mUndoBuffer = null;
mRedoBuffer = null;
=======
>>>>>>>
mUndoBuffer = null;
mRedoBuffer = null;
<<<<<<<
if (mUndoBuffer == null) {
mBitmap.eraseColor(mCanvasBgColor);
} else {
restoreBuffer(mUndoBuffer);
}
=======
if (mUndoBuffer == null) {
mBitmap.eraseColor(mCanvasBgColor);
} else {
restoreBuffer(mUndoBuffer);
}
>>>>>>>
if (mUndoBuffer == null) {
mBitmap.eraseColor(mCanvasBgColor);
} else {
restoreBuffer(mUndoBuffer);
} |
<<<<<<<
private ToolboxCategory mToolboxCategory;
private BlockFactory mBlockFactory;
=======
private final Dragger mDragger;
// The FragmentManager is used to show/hide fragments like the trash and toolbox.
private FragmentManager mFragmentManager;
>>>>>>>
private final Dragger mDragger;
private ToolboxCategory mToolboxCategory;
private BlockFactory mBlockFactory;
// The FragmentManager is used to show/hide fragments like the trash and toolbox.
private FragmentManager mFragmentManager;
<<<<<<<
mDeletedBlocks.addBlock(block);
mTrash.getAdapter().notifyDataSetChanged();
=======
mDeletedBlocks.add(block);
mTrashFragment.getAdapter().notifyDataSetChanged();
>>>>>>>
mDeletedBlocks.addBlock(block);
mTrashFragment.getAdapter().notifyDataSetChanged();
<<<<<<<
public void setToolboxFragment(ToolboxFragment toolbox) {
// Invalidate the old toolbox.
if (mToolbox != null) {
mToolbox.setWorkspace(null);
mToolbox.setContents(null);
}
mToolbox = toolbox;
// Set up the new toolbox.
if (mToolbox != null) {
mToolbox.setWorkspace(this);
mToolbox.setContents(mToolboxCategory);
}
=======
public void loadToolboxContents(int toolboxResId) {
InputStream is = mContext.getResources().openRawResource(toolboxResId);
BlocklyXmlHelper.loadFromXml(is, mBlockFactory, null, mToolboxContents);
>>>>>>>
public void loadToolboxContents(int toolboxResId) {
InputStream is = mContext.getResources().openRawResource(toolboxResId);
loadToolboxContents(is);
}
/**
* Set up toolbox's contents.
*
* @param source The source of the set of blocks or block groups to show in the toolbox.
*/
public void loadToolboxContents(InputStream source) {
mToolboxCategory = BlocklyXmlHelper.loadToolboxFromXml(source, mBlockFactory); |
<<<<<<<
import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
=======
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
import org.eclipse.cdt.managedbuilder.core.IProjectType;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
>>>>>>>
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
<<<<<<<
=======
import org.eclipse.core.runtime.NullProgressMonitor;
>>>>>>>
import org.eclipse.core.runtime.NullProgressMonitor;
<<<<<<<
CodeDescriptor codeDescription, CompileOptions compileOptions, IProgressMonitor monitor) throws Exception {
CCorePlugin cCorePlugin =CCorePlugin.getDefault();
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
String realProjectName=Common.MakeNameCompileSafe(projectName);
final IProject newProjectHandle = root.getProject(realProjectName);
// if (!newProjectHandle.exists()) {
//create standard cdt managed build project using sloeber typeid
ShouldHaveBeenInCDT.createNewManagedProject(newProjectHandle, projectURI, "io.sloeber.core.sketch");
ICProjectDescription prjCDesc = cCorePlugin.getProjectDescription( newProjectHandle);
//add sloeber stuff
ManagedCProjectNature.addNature(newProjectHandle, "org.eclipse.cdt.core.ccnature", monitor);
ManagedCProjectNature.addNature(newProjectHandle, Const.ARDUINO_NATURE_ID, monitor);
Helpers.createNewFolder(newProjectHandle, Const.ARDUINO_CODE_FOLDER_NAME, null);
// // Add the Arduino folder
for (ICConfigurationDescription curConfig : prjCDesc.getConfigurations()) {
compileOptions.save(curConfig);
save(curConfig);
=======
CodeDescriptor codeDescription, CompileOptions compileOptions, IProgressMonitor monitor) throws Exception {
CCorePlugin cCorePlugin =CCorePlugin.getDefault();
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
String realProjectName=Common.MakeNameCompileSafe(projectName);
// IProjectDescription description = workspace.newProjectDescription(realProjectName);
// if (projectURI != null) {
// description.setLocationURI(projectURI);
// }
final IProject newProjectHandle = root.getProject(realProjectName);
// newProjectHandle.create(description, new NullProgressMonitor());
// newProjectHandle.open( new NullProgressMonitor());
//
// ICProjectDescription prjCDesc = cCorePlugin.createProjectDescription(newProjectHandle, true,true);
// cCorePlugin.setProjectDescription(newProjectHandle, prjCDesc, true,null);
//
// cCorePlugin.createCProject(description, newProjectHandle, new NullProgressMonitor(),
// ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID);
//
ShouldHaveBeenInCDT.createNewManagedProject(newProjectHandle, projectURI, "io.sloeber.core.sketch");
// Create the base project
//
//
// ManagedBuildManager.createBuildInfo(newProjectHandle);
//
//
//
// // Find the base project type definition
// IProjectType projType = ManagedBuildManager.getProjectType("io.sloeber.core.sketch");
// IManagedProject newManagedProject = ManagedBuildManager.createManagedProject(newProjectHandle, projType);
//
// ManagedBuildManager.setNewProjectVersion(newProjectHandle);
// // Copy over the configurations
//
// IConfiguration[] configs = projType.getConfigurations();
// for (int i = 0; i < configs.length; ++i) {
// newManagedProject.createConfiguration(configs[i], projType.getId() + "." + i);
// }
//
//
// IConfiguration cfgs[] = newManagedProject.getConfigurations();
// for (int i = 0; i < cfgs.length; i++) {
// cfgs[i].setArtifactName(newManagedProject.getDefaultArtifactName());
// }
//
//
//
// prjCDesc = cCorePlugin.getProjectDescription( newProjectHandle);
// cCorePlugin.setProjectDescription(newProjectHandle, prjCDesc, true,null);
//
// boolean iscreating = prjCDesc.isCdtProjectCreating();
//// cCorePlugin.mapCProjectOwner(newProjectHandle, ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID, false);
//
// // Add C Nature ... does not add duplicates
// CProjectNature.addCNature(newProjectHandle, new NullProgressMonitor());
//// cCorePlugin.createCProject(description, newProjectHandle, new NullProgressMonitor(),
//// ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID);
ICProjectDescription prjCDesc = cCorePlugin.getProjectDescription( newProjectHandle);
//add sloeber stuff
ManagedCProjectNature.addManagedNature(newProjectHandle, new NullProgressMonitor());
ManagedCProjectNature.addManagedBuilder(newProjectHandle, new NullProgressMonitor());
ManagedCProjectNature.addNature(newProjectHandle, "org.eclipse.cdt.core.ccnature", monitor);
ManagedCProjectNature.addNature(newProjectHandle, Const.ARDUINO_NATURE_ID, monitor);
IConfiguration defaultConfig = null;
// // Add the Arduino folder
for (ICConfigurationDescription curConfig : prjCDesc.getConfigurations()) {
compileOptions.save(curConfig);
save(curConfig);
>>>>>>>
CodeDescriptor codeDescription, CompileOptions compileOptions, IProgressMonitor monitor) throws Exception {
CCorePlugin cCorePlugin =CCorePlugin.getDefault();
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
String realProjectName=Common.MakeNameCompileSafe(projectName);
// IProjectDescription description = workspace.newProjectDescription(realProjectName);
// if (projectURI != null) {
// description.setLocationURI(projectURI);
// }
final IProject newProjectHandle = root.getProject(realProjectName);
// newProjectHandle.create(description, new NullProgressMonitor());
// newProjectHandle.open( new NullProgressMonitor());
//
// ICProjectDescription prjCDesc = cCorePlugin.createProjectDescription(newProjectHandle, true,true);
// cCorePlugin.setProjectDescription(newProjectHandle, prjCDesc, true,null);
//
// cCorePlugin.createCProject(description, newProjectHandle, new NullProgressMonitor(),
// ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID);
//
// ShouldHaveBeenInCDT.createNewManagedProject(newProjectHandle, projectURI, "io.sloeber.core.sketch");
// Create the base project
//
//
// ManagedBuildManager.createBuildInfo(newProjectHandle);
//
//
//
// // Find the base project type definition
// IProjectType projType = ManagedBuildManager.getProjectType("io.sloeber.core.sketch");
// IManagedProject newManagedProject = ManagedBuildManager.createManagedProject(newProjectHandle, projType);
//
// ManagedBuildManager.setNewProjectVersion(newProjectHandle);
// // Copy over the configurations
//
// IConfiguration[] configs = projType.getConfigurations();
// for (int i = 0; i < configs.length; ++i) {
// newManagedProject.createConfiguration(configs[i], projType.getId() + "." + i);
// }
//
//
// IConfiguration cfgs[] = newManagedProject.getConfigurations();
// for (int i = 0; i < cfgs.length; i++) {
// cfgs[i].setArtifactName(newManagedProject.getDefaultArtifactName());
// }
//
//
//
// prjCDesc = cCorePlugin.getProjectDescription( newProjectHandle);
// cCorePlugin.setProjectDescription(newProjectHandle, prjCDesc, true,null);
//
// boolean iscreating = prjCDesc.isCdtProjectCreating();
//// cCorePlugin.mapCProjectOwner(newProjectHandle, ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID, false);
//
// // Add C Nature ... does not add duplicates
// CProjectNature.addCNature(newProjectHandle, new NullProgressMonitor());
//// cCorePlugin.createCProject(description, newProjectHandle, new NullProgressMonitor(),
//// ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID);
ICProjectDescription prjCDesc = cCorePlugin.getProjectDescription( newProjectHandle);
//add sloeber stuff
ManagedCProjectNature.addManagedNature(newProjectHandle, new NullProgressMonitor());
ManagedCProjectNature.addManagedBuilder(newProjectHandle, new NullProgressMonitor());
ManagedCProjectNature.addNature(newProjectHandle, "org.eclipse.cdt.core.ccnature", monitor);
ManagedCProjectNature.addNature(newProjectHandle, Const.ARDUINO_NATURE_ID, monitor);
IConfiguration defaultConfig = null;
// // Add the Arduino folder
for (ICConfigurationDescription curConfig : prjCDesc.getConfigurations()) {
compileOptions.save(curConfig);
save(curConfig); |
<<<<<<<
/**
* Searches for all libraries that can be installed but are not yet installed. A
* library is considered installed when 1 version of the library is installed.
*
* @return a map of all instalable libraries
*/
public static Map<String, io.sloeber.core.managers.Library> getAllInstallableLibraries() {
Map<String, Library> ret = new HashMap<>();
for (LibraryIndex libraryIndex : libraryIndices) {
ret.putAll(libraryIndex.getLatestInstallableLibraries());
}
return ret;
}
public static Map<String, io.sloeber.core.managers.Library> getLatestInstallableLibraries(Set<String> libnames) {
Set<String> remainingLibNames = new TreeSet<>(libnames);
Map<String, Library> ret = new HashMap<>();
for (LibraryIndex libraryIndex : libraryIndices) {
ret.putAll(libraryIndex.getLatestInstallableLibraries(remainingLibNames));
remainingLibNames.removeAll(ret.keySet());
}
return ret;
}
public static void registerInstallLibraryHandler(IInstallLibraryHandler installLibraryHandler) {
myInstallLibraryHandler = installLibraryHandler;
}
public static IInstallLibraryHandler getInstallLibraryHandler() {
return myInstallLibraryHandler;
}
=======
/**
* Check wether a library is installed.
* The check looks at the library installation place at the disk.
*
* @return true if at least one library is installed
*/
public static boolean libsAreInstalled() {
if (ConfigurationPreferences.getInstallationPathLibraries().toFile().exists()) {
return ConfigurationPreferences.getInstallationPathLibraries().toFile().list().length != 0;
}
return false;
}
>>>>>>>
/**
* Searches for all libraries that can be installed but are not yet installed. A
* library is considered installed when 1 version of the library is installed.
*
* @return a map of all instalable libraries
*/
public static Map<String, io.sloeber.core.managers.Library> getAllInstallableLibraries() {
Map<String, Library> ret = new HashMap<>();
for (LibraryIndex libraryIndex : libraryIndices) {
ret.putAll(libraryIndex.getLatestInstallableLibraries());
}
return ret;
}
public static Map<String, io.sloeber.core.managers.Library> getLatestInstallableLibraries(Set<String> libnames) {
Set<String> remainingLibNames = new TreeSet<>(libnames);
Map<String, Library> ret = new HashMap<>();
for (LibraryIndex libraryIndex : libraryIndices) {
ret.putAll(libraryIndex.getLatestInstallableLibraries(remainingLibNames));
remainingLibNames.removeAll(ret.keySet());
}
return ret;
}
public static void registerInstallLibraryHandler(IInstallLibraryHandler installLibraryHandler) {
myInstallLibraryHandler = installLibraryHandler;
}
public static IInstallLibraryHandler getInstallLibraryHandler() {
return myInstallLibraryHandler;
}
/**
* Check wether a library is installed.
* The check looks at the library installation place at the disk.
*
* @return true if at least one library is installed
*/
public static boolean libsAreInstalled() {
if (ConfigurationPreferences.getInstallationPathLibraries().toFile().exists()) {
return ConfigurationPreferences.getInstallationPathLibraries().toFile().list().length != 0;
}
return false;
} |
<<<<<<<
public static final short SCOPE_START_DATA = (short) 0xCDAB;// This is the
// 205 171 or
// -85 -51
// flag that
// indicates
// scope data is
// following
// least significant first 0xCDAB;
=======
public static final short SCOPE_START_DATA = (short) 0xCDAB;// This is the
// 205 171 or
// -85 -51 flag
// that
// indicates
// scope data is
// following
// least
// significant
// first 0xCDAB;
>>>>>>>
public static final short SCOPE_START_DATA = (short) 0xCDAB;// This is the
// 205 171 or
// -85 -51
// flag that
// indicates
// scope data is
// following
// least
// significant
// first 0xCDAB; |
<<<<<<<
private void makeActions() {
this.connect = new Action() {
@SuppressWarnings("synthetic-access")
@Override
public void run() {
OpenSerialDialogBox comportSelector = new OpenSerialDialogBox(SerialMonitor.this.parent.getShell());
comportSelector.create();
if (comportSelector.open() == Window.OK) {
connectSerial(comportSelector.GetComPort(), comportSelector.GetBaudRate());
}
}
};
this.connect.setText(Messages.serialMonitorConnectedTo);
this.connect.setToolTipText(Messages.serialMonitorAddConnectionToSeralMonitor);
this.connect.setImageDescriptor(
PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_ADD)); // IMG_OBJS_INFO_TSK));
this.disconnect = new Action() {
@Override
public void run() {
disConnectSerialPort(getSerialMonitor().serialPorts.getCombo().getText());
}
};
this.disconnect.setText(Messages.serialMonitorDisconnectedFrom);
this.disconnect.setToolTipText(Messages.serialMonitorRemoveSerialPortFromMonitor);
this.disconnect.setImageDescriptor(
PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ELCL_REMOVE));// IMG_OBJS_INFO_TSK));
this.disconnect.setEnabled(this.serialConnections.size() != 0);
this.clear = new Action(Messages.serialMonitorClear) {
@Override
public void run() {
SerialMonitor.this.monitorOutput.setText(Const.EMPTY_STRING);
}
};
this.clear.setImageDescriptor(ImageDescriptor.createFromURL(IMG_CLEAR));
this.clear.setEnabled(true);
this.scrollLock = new Action(Messages.serialMonitorScrollLock, IAction.AS_CHECK_BOX) {
@Override
public void run() {
InstancePreferences.setLastUsedAutoScroll(!this.isChecked());
}
};
this.scrollLock.setImageDescriptor(ImageDescriptor.createFromURL(IMG_LOCK));
this.scrollLock.setEnabled(true);
this.scrollLock.setChecked(!InstancePreferences.getLastUsedAutoScroll());
this.scopeFilter = new Action(Messages.serialMonitorFilterScope, IAction.AS_CHECK_BOX) {
@Override
public void run() {
SerialListener.setScopeFilter(this.isChecked());
InstancePreferences.setLastUsedScopeFilter(this.isChecked());
}
};
this.scopeFilter.setImageDescriptor(ImageDescriptor.createFromURL(IMG_FILTER));
this.scopeFilter.setEnabled(true);
this.scopeFilter.setChecked(InstancePreferences.getLastUsedScopeFilter());
SerialListener.setScopeFilter(InstancePreferences.getLastUsedScopeFilter());
}
/**
* Passing the focus request to the viewer's control.
*/
@Override
public void setFocus() {
this.parent.getShell().setDefaultButton(this.send);
}
/**
* The listener calls this method to report that serial data has arrived
*
* @param stInfo
* The serial data that has arrived
* @param style
* The style that should be used to report the data; Actually
* this is the index number of the opened port
*/
public void ReportSerialActivity(String stInfo, int style) {
int startPoint = this.monitorOutput.getCharCount();
this.monitorOutput.append(stInfo);
StyleRange styleRange = new StyleRange();
styleRange.start = startPoint;
styleRange.length = stInfo.length();
styleRange.fontStyle = SWT.NORMAL;
styleRange.foreground = this.colorRegistry.get(this.serialColorID[style]);
this.monitorOutput.setStyleRange(styleRange);
if (!this.scrollLock.isChecked()) {
this.monitorOutput.setSelection(this.monitorOutput.getCharCount());
=======
>>>>>>>
<<<<<<<
/**
* Connect to a serial port and sets the listener
*
* @param comPort
* the name of the com port to connect to
* @param baudRate
* the baud rate to connect to the com port
*/
public void connectSerial(String comPort, int baudRate) {
if (this.serialConnections.size() < MY_MAX_SERIAL_PORTS) {
int colorindex = this.serialConnections.size();
Serial newSerial = new Serial(comPort, baudRate);
if (newSerial.IsConnected()) {
newSerial.registerService();
SerialListener theListener = new SerialListener(this, colorindex);
newSerial.addListener(theListener);
theListener.event(System.getProperty("line.separator") + Messages.serialMonitorConnectedtTo + comPort //$NON-NLS-1$
+ Messages.serialMonitorAt + baudRate + System.getProperty("line.separator")); //$NON-NLS-1$
this.serialConnections.put(newSerial, theListener);
SerialPortsUpdated();
return;
}
} else {
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID,
Messages.serialMonitorNoMoreSerialPortsSupported, null));
}
}
public void disConnectSerialPort(String comPort) {
Serial newSerial = GetSerial(comPort);
if (newSerial != null) {
SerialListener theListener = SerialMonitor.this.serialConnections.get(newSerial);
SerialMonitor.this.serialConnections.remove(newSerial);
newSerial.removeListener(theListener);
newSerial.dispose();
theListener.dispose();
SerialPortsUpdated();
}
=======
}
/**
* Connect to a serial port and sets the listener
*
* @param ComPort
* the name of the com port to connect to
* @param BaudRate
* the baud rate to connect to the com port
*/
public void connectSerial(String ComPort, int BaudRate) {
if (this.serialConnections.size() < myMaxSerialPorts) {
int colorindex = this.serialConnections.size();
Serial newSerial = new Serial(ComPort, BaudRate);
if (newSerial.IsConnected()) {
newSerial.registerService();
SerialListener theListener = new SerialListener(this, colorindex);
newSerial.addListener(theListener);
theListener.event(System.getProperty("line.separator") + Messages.SerialMonitor_connectedt_to + ComPort //$NON-NLS-1$
+ Messages.SerialMonitor_at + BaudRate + System.getProperty("line.separator")); //$NON-NLS-1$
this.serialConnections.put(newSerial, theListener);
SerialPortsUpdated();
return;
}
} else {
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID,
Messages.SerialMonitor_no_more_serial_ports_supported, null));
>>>>>>>
}
/**
* Connect to a serial port and sets the listener
*
* @param comPort
* the name of the com port to connect to
* @param baudRate
* the baud rate to connect to the com port
*/
public void connectSerial(String comPort, int baudRate) {
if (this.serialConnections.size() < MY_MAX_SERIAL_PORTS) {
int colorindex = this.serialConnections.size();
Serial newSerial = new Serial(comPort, baudRate);
if (newSerial.IsConnected()) {
newSerial.registerService();
SerialListener theListener = new SerialListener(this, colorindex);
newSerial.addListener(theListener);
theListener.event(System.getProperty("line.separator") + Messages.serialMonitorConnectedtTo + comPort //$NON-NLS-1$
+ Messages.serialMonitorAt + baudRate + System.getProperty("line.separator")); //$NON-NLS-1$
this.serialConnections.put(newSerial, theListener);
SerialPortsUpdated();
return;
}
} else {
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID,
Messages.serialMonitorNoMoreSerialPortsSupported, null)); |
<<<<<<<
RevokeCert rCert;
=======
SignCert siCert;
>>>>>>>
RevokeCert rCert;
SignCert siCert;
<<<<<<<
public SideBarListener(CreateCert cCert, ShowCert sCert, RevokeCert rCert, Composite comp_right){
=======
public SideBarListener(CreateCert cCert, ShowCert sCert, SignCert siCert, Composite comp_right){
>>>>>>>
public SideBarListener(CreateCert cCert, ShowCert sCert, RevokeCert rCert, SignCert siCert, Composite comp_right){
<<<<<<<
if(rCert != null) {
rCert.dispose();
}
=======
if(siCert != null) {
siCert.dispose();
}
>>>>>>>
if(rCert != null) {
rCert.dispose();
}
if(siCert != null) {
siCert.dispose();
}
<<<<<<<
else if(text.equals("Revoke Certificate")){
rCert = new RevokeCert(comp_right);
rCert.setVisible(true);
}
=======
else if(text.equals("Sign File/Text")){
siCert = new SignCert(comp_right);
siCert.setVisible(true);
}
>>>>>>>
else if(text.equals("Revoke Certificate")){
rCert = new RevokeCert(comp_right);
rCert.setVisible(true);
}
else if(text.equals("Sign File/Text")){
siCert = new SignCert(comp_right);
siCert.setVisible(true);
} |
<<<<<<<
RSAPrivateCrtKeyParameters privateKey = (RSAPrivateCrtKeyParameters) keypair
.getPrivate();
RSAPublicKey pkStruct = new RSAPublicKey(publicKey.getModulus(),
publicKey.getExponent());
=======
RSAPrivateCrtKeyParameters privateKey = (RSAPrivateCrtKeyParameters) keypair.getPrivate();
@SuppressWarnings("unused")
RSAPublicKey pkStruct = new RSAPublicKey(
publicKey.getModulus(), publicKey.getExponent());
>>>>>>>
RSAPrivateCrtKeyParameters privateKey = (RSAPrivateCrtKeyParameters) keypair
.getPrivate();
@SuppressWarnings("unused")
RSAPublicKey pkStruct = new RSAPublicKey(publicKey.getModulus(),
publicKey.getExponent()); |
<<<<<<<
import org.eclipse.swt.custom.StyledText;
=======
import org.eclipse.swt.custom.ScrolledComposite;
>>>>>>>
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.ScrolledComposite; |
<<<<<<<
import org.eclipse.swt.custom.StyledText;
=======
import org.eclipse.swt.custom.ScrolledComposite;
>>>>>>>
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.ScrolledComposite; |
<<<<<<<
import org.jcryptool.visual.jctca.ResizeHelper;
import org.jcryptool.visual.jctca.listeners.ResizeListener;
=======
import org.jcryptool.visual.jctca.listeners.CSRListener;
>>>>>>>
import org.jcryptool.visual.jctca.ResizeHelper;
import org.jcryptool.visual.jctca.listeners.ResizeListener;
import org.jcryptool.visual.jctca.listeners.CSRListener;
<<<<<<<
util.set_image_name("ausweis");
lbl_img.addControlListener(new ResizeListener(lbl_img, right));
=======
lst_csr.addSelectionListener(new CSRListener(lbl_value_firstname, lbl_value_lastname, lbl_value_street, lbl_value_ZIP, lbl_value_city, lbl_value_country, lbl_value_mail, lbl_img));
>>>>>>>
util.set_image_name("ausweis");
lbl_img.addControlListener(new ResizeListener(lbl_img, right));
lst_csr.addSelectionListener(new CSRListener(lbl_value_firstname, lbl_value_lastname, lbl_value_street, lbl_value_ZIP, lbl_value_city, lbl_value_country, lbl_value_mail, lbl_img)); |
<<<<<<<
=======
String txt_reason;
Combo reason;
>>>>>>>
String txt_reason;
Combo reason;
<<<<<<<
=======
>>>>>>>
<<<<<<<
Combo reason = new Combo(container, SWT.DROP_DOWN);
=======
reason = new Combo(container, SWT.DROP_DOWN);
>>>>>>>
reason = new Combo(container, SWT.DROP_DOWN);
reason = new Combo(container, SWT.DROP_DOWN);
<<<<<<<
=======
>>>>>>> |
<<<<<<<
import org.antlr.intellij.plugin.configdialogs.ANTLRv4GrammarProperties;
=======
import org.antlr.intellij.plugin.ANTLRv4TokenTypes;
>>>>>>>
import org.antlr.intellij.plugin.configdialogs.ANTLRv4GrammarProperties;
import org.antlr.intellij.plugin.ANTLRv4TokenTypes;
<<<<<<<
import java.util.*;
=======
import java.util.*;
import java.util.regex.Pattern;
import static com.intellij.psi.util.PsiTreeUtil.getChildOfType;
import static org.antlr.intellij.plugin.psi.MyPsiUtils.findChildrenOfType;
>>>>>>>
import java.util.*;
import java.util.regex.Pattern;
import static com.intellij.psi.util.PsiTreeUtil.getChildOfType;
import static org.antlr.intellij.plugin.psi.MyPsiUtils.findChildrenOfType;
<<<<<<<
boolean autogen = ConfigANTLRPerGrammar.getBooleanProp(project, qualFileName, ANTLRv4GrammarProperties.PROP_AUTO_GEN, false);
// System.out.println("autogen is "+autogen+", force="+forceGeneration);
=======
boolean autogen = ConfigANTLRPerGrammar.getBooleanProp(project, qualFileName, ConfigANTLRPerGrammar.PROP_AUTO_GEN, false);
>>>>>>>
boolean autogen = ConfigANTLRPerGrammar.getBooleanProp(project, qualFileName, ANTLRv4GrammarProperties.PROP_AUTO_GEN, false);
<<<<<<<
String package_ = ANTLRv4GrammarProperties.getProp(project, qualFileName, ANTLRv4GrammarProperties.PROP_PACKAGE, MISSING);
if ( package_==MISSING) {
=======
String package_ = ConfigANTLRPerGrammar.getProp(project, qualFileName, ConfigANTLRPerGrammar.PROP_PACKAGE, MISSING);
if ( package_.equals(MISSING) && !hasPackageDeclarationInHeader(project, vfile)) {
>>>>>>>
String package_ = ANTLRv4GrammarProperties.getProp(project, qualFileName, ANTLRv4GrammarProperties.PROP_PACKAGE, MISSING);
if ( package_.equals(MISSING) && !hasPackageDeclarationInHeader(project, vfile)) {
<<<<<<<
String language = ANTLRv4GrammarProperties.getProp(project, qualFileName, ANTLRv4GrammarProperties.PROP_LANGUAGE, MISSING);
if ( language!=MISSING) {
=======
String language = ConfigANTLRPerGrammar.getProp(project, qualFileName, ConfigANTLRPerGrammar.PROP_LANGUAGE, MISSING);
if ( !language.equals(MISSING) ) {
>>>>>>>
String language = ANTLRv4GrammarProperties.getProp(project, qualFileName, ANTLRv4GrammarProperties.PROP_LANGUAGE, MISSING);
if ( !language.equals(MISSING) ) {
<<<<<<<
String encoding = ANTLRv4GrammarProperties.getProp(project, qualFileName, ANTLRv4GrammarProperties.PROP_ENCODING, MISSING);
if ( encoding!=MISSING ) {
=======
String encoding = ConfigANTLRPerGrammar.getProp(project, qualFileName, ConfigANTLRPerGrammar.PROP_ENCODING, MISSING);
if ( !encoding.equals(MISSING) ) {
>>>>>>>
String encoding = ANTLRv4GrammarProperties.getProp(project, qualFileName, ANTLRv4GrammarProperties.PROP_ENCODING, MISSING);
if ( !encoding.equals(MISSING) ) { |
<<<<<<<
public NetworkPersistedBatchReadyListener(final Context context, File file, SerializationStrategy<E, T> serializationStrategy, final Handler handler, NetworkBatchListener<E, T> listener, int maxRetryCount) {
super(file, serializationStrategy, handler, null);
this.context = context;
this.networkBatchListener = listener;
this.maxRetryCount = maxRetryCount;
this.mCurrentTimeoutMs = defaultTimeoutMs;
this.setListener(persistedBatchCallback);
}
public int getDefaultTimeoutMs() {
return defaultTimeoutMs;
}
=======
public NetworkPersistedBatchReadyListener(final Context context, File file, SerializationStrategy<E, T> serializationStrategy, final Handler handler, NetworkBatchListener<E, T> listener, int maxRetryCount) {
super(file, serializationStrategy, handler, null);
this.context = context;
this.networkBatchListener = listener;
this.maxRetryCount = maxRetryCount;
this.mCurrentTimeoutMs = defaultTimeoutMs;
this.setListener(persistedBatchCallback);
}
public void setNetworkBatchListener(NetworkBatchListener<E, T> networkBatchListener) {
this.networkBatchListener = networkBatchListener;
}
private void unregisterReceiver() {
if (receiverRegistered) {
context.unregisterReceiver(networkBroadcastReceiver);
receiverRegistered = false;
}
}
private void registerReceiverIfRequired() {
if (!receiverRegistered) {
//Register the broadcast receiver
IntentFilter filter = new IntentFilter();
filter.addAction(Context.CONNECTIVITY_SERVICE);
context.registerReceiver(networkBroadcastReceiver, filter); //todo, does calling this multple times cause duplicate broadcasts
receiverRegistered = true;
}
}
>>>>>>>
public NetworkPersistedBatchReadyListener(final Context context, File file, SerializationStrategy<E, T> serializationStrategy, final Handler handler, NetworkBatchListener<E, T> listener, int maxRetryCount) {
super(file, serializationStrategy, handler, null);
this.context = context;
this.networkBatchListener = listener;
this.maxRetryCount = maxRetryCount;
this.mCurrentTimeoutMs = defaultTimeoutMs;
this.setListener(persistedBatchCallback);
}
public void setNetworkBatchListener(NetworkBatchListener<E, T> networkBatchListener) {
this.networkBatchListener = networkBatchListener;
}
public int getDefaultTimeoutMs() {
return defaultTimeoutMs;
}
<<<<<<<
public NetworkRequestResponse(boolean isComplete, int httpErrorCode){
=======
public NetworkRequestResponse(boolean isComplete, int httpErrorCode) {
>>>>>>>
public NetworkRequestResponse(boolean isComplete, int httpErrorCode){ |
<<<<<<<
import com.birbit.android.jobqueue.messaging.message.SchedulerMessage;
import com.birbit.android.jobqueue.scheduling.Scheduler;
import com.birbit.android.jobqueue.scheduling.SchedulerConstraint;
=======
import com.path.android.jobqueue.CancelReason;
>>>>>>>
import com.birbit.android.jobqueue.messaging.message.SchedulerMessage;
import com.birbit.android.jobqueue.scheduling.Scheduler;
import com.birbit.android.jobqueue.scheduling.SchedulerConstraint;
import com.path.android.jobqueue.CancelReason;
<<<<<<<
import java.util.UUID;
=======
import java.util.Set;
>>>>>>>
import java.util.UUID;
import java.util.Set;
<<<<<<<
consumerManager.onJobAdded();
if (persistent) {
// tell scheduler that we may want to be invoked
scheduleWakeUpFor(job);
}
}
private void scheduleWakeUpFor(Job job) {
if (scheduler == null) {
return;
}
boolean requireNetwork = job.requiresNetwork(timer);
boolean requireUnmeteredNetwork = job.requiresUnmeteredNetwork(timer);
long delayInMs = job.getDelayInMs();
long delay = delayInMs > 0 ? delayInMs : 0;
if (!requireNetwork && !requireUnmeteredNetwork
&& delay < JobManager.MIN_DELAY_TO_USE_SCHEDULER_IN_MS) {
return;
}
SchedulerConstraint constraint = new SchedulerConstraint(UUID.randomUUID().toString());
constraint.setNetworkStatus(requireUnmeteredNetwork ? NetworkUtil.UNMETERED :
requireNetwork ? NetworkUtil.METERED : NetworkUtil.DISCONNECTED);
constraint.setDelayInMs(delay);
scheduler.request(constraint);
shouldCancelAllScheduledWhenEmpty = true;
=======
if (insert) {
consumerManager.onJobAdded();
} else {
cancelSafely(jobHolder, CancelReason.SINGLE_INSTANCE_ID_QUEUED);
callbackManager.notifyOnDone(jobHolder.getJob());
}
}
/**
* Returns a queued job with the same single id. If any matching non-running job is found,
* that one is returned. Otherwise any matching running job will be returned.
*/
private JobHolder findJobBySingleId(/*Nullable*/String singleIdTag) {
if (singleIdTag != null) {
queryConstraint.clear();
queryConstraint.setTags(new String[]{singleIdTag});
queryConstraint.setTagConstraint(TagConstraint.ANY);
Set<JobHolder> jobs = nonPersistentJobQueue.findJobs(queryConstraint);
jobs.addAll(persistentJobQueue.findJobs(queryConstraint));
if (!jobs.isEmpty()) {
for (JobHolder job : jobs) {
if (!consumerManager.isJobRunning(job.getId())) {
return job;
}
}
return jobs.iterator().next();
}
}
return null;
>>>>>>>
if (insert) {
consumerManager.onJobAdded();
if (job.isPersistent()) {
scheduleWakeUpFor(job);
}
} else {
cancelSafely(jobHolder, CancelReason.SINGLE_INSTANCE_ID_QUEUED);
callbackManager.notifyOnDone(jobHolder.getJob());
}
}
private void scheduleWakeUpFor(Job job) {
if (scheduler == null) {
return;
}
boolean requireNetwork = job.requiresNetwork(timer);
boolean requireUnmeteredNetwork = job.requiresUnmeteredNetwork(timer);
long delayInMs = job.getDelayInMs();
long delay = delayInMs > 0 ? delayInMs : 0;
if (!requireNetwork && !requireUnmeteredNetwork
&& delay < JobManager.MIN_DELAY_TO_USE_SCHEDULER_IN_MS) {
return;
}
SchedulerConstraint constraint = new SchedulerConstraint(UUID.randomUUID().toString());
constraint.setNetworkStatus(requireUnmeteredNetwork ? NetworkUtil.UNMETERED :
requireNetwork ? NetworkUtil.METERED : NetworkUtil.DISCONNECTED);
constraint.setDelayInMs(delay);
scheduler.request(constraint);
shouldCancelAllScheduledWhenEmpty = true;
}
/**
* Returns a queued job with the same single id. If any matching non-running job is found,
* that one is returned. Otherwise any matching running job will be returned.
*/
private JobHolder findJobBySingleId(/*Nullable*/String singleIdTag) {
if (singleIdTag != null) {
queryConstraint.clear();
queryConstraint.setTags(new String[]{singleIdTag});
queryConstraint.setTagConstraint(TagConstraint.ANY);
Set<JobHolder> jobs = nonPersistentJobQueue.findJobs(queryConstraint);
jobs.addAll(persistentJobQueue.findJobs(queryConstraint));
if (!jobs.isEmpty()) {
for (JobHolder job : jobs) {
if (!consumerManager.isJobRunning(job.getId())) {
return job;
}
}
return jobs.iterator().next();
}
}
return null; |
<<<<<<<
=======
/**
* Method that should be called after {@link #writeTypePrefix(JsonGenerator, WritableTypeId)}
* and matching value write have called, passing {@link WritableTypeId} returned.
* Usual idiom is:
*<pre>
* // Indicator generator that type identifier may be needed; generator may write
* // one as suggested, modify information, or take some other action
* // NOTE! For Object/Array types, this will ALSO write start marker!
* WritableTypeId typeIdDef = typeSer.writeTypePrefix(gen,
* typeSer.typeId(value, JsonToken.START_OBJECT));
*
* // serializing actual value for which TypeId may have been written... like
* // NOTE: do NOT write START_OBJECT before OR END_OBJECT after:
* g.writeStringField("message", "Hello, world!"
*
* // matching type suffix call to let generator chance to add suffix, if any
* // NOTE! For Object/Array types, this will ALSO write end marker!
* typeSer.writeTypeSuffix(gen, typeIdDef);
*</pre>
*
* @since 2.9
*/
>>>>>>>
<<<<<<<
=======
/*
/**********************************************************
/* Legacy type serialization methods
/**********************************************************
*/
/**
* DEPRECATED: now equivalent to:
*{@code writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING));}.
* See {@link #writeTypePrefix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeTypePrefixForScalar(Object value, JsonGenerator g) throws IOException {
writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypePrefix(g, typeId(value, JsonToken.START_OBJECT));}.
* See {@link #writeTypePrefix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeTypePrefixForObject(Object value, JsonGenerator g) throws IOException {
writeTypePrefix(g, typeId(value, JsonToken.START_OBJECT));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY));}.
* See {@link #writeTypePrefix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeTypePrefixForArray(Object value, JsonGenerator g) throws IOException {
writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypeSuffix(g, typeId(value, JsonToken.VALUE_STRING));}.
* See {@link #writeTypeSuffix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeTypeSuffixForScalar(Object value, JsonGenerator g) throws IOException {
_writeLegacySuffix(g, typeId(value, JsonToken.VALUE_STRING));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypeSuffix(g, typeId(value, JsonToken.START_OBJECT));}.
* See {@link #writeTypeSuffix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeTypeSuffixForObject(Object value, JsonGenerator g) throws IOException {
_writeLegacySuffix(g, typeId(value, JsonToken.START_OBJECT));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypeSuffix(g, typeId(value, JsonToken.START_ARRAY));}.
* See {@link #writeTypeSuffix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeTypeSuffixForArray(Object value, JsonGenerator g) throws IOException {
_writeLegacySuffix(g, typeId(value, JsonToken.START_ARRAY));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypePrefix(g, typeId(value, type, JsonToken.VALUE_STRING));}.
* See {@link #writeTypePrefix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeTypePrefixForScalar(Object value, JsonGenerator g, Class<?> type) throws IOException {
writeTypePrefix(g, typeId(value, type, JsonToken.VALUE_STRING));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypePrefix(g, typeId(value, type, JsonToken.START_OBJECT));}.
* See {@link #writeTypePrefix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeTypePrefixForObject(Object value, JsonGenerator g, Class<?> type) throws IOException {
writeTypePrefix(g, typeId(value, type, JsonToken.START_OBJECT));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypePrefix(g, typeId(value, type, JsonToken.START_ARRAY));}.
* See {@link #writeTypePrefix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeTypePrefixForArray(Object value, JsonGenerator g, Class<?> type) throws IOException {
writeTypePrefix(g, typeId(value, type, JsonToken.START_ARRAY));
}
/*
/**********************************************************
/* Type serialization methods with type id override
/**********************************************************
*/
/**
* DEPRECATED: now equivalent to:
*{@code writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING, typeId));}.
* See {@link #writeTypePrefix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeCustomTypePrefixForScalar(Object value, JsonGenerator g, String typeId) throws IOException {
writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING, typeId));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypePrefix(g, typeId(value, JsonToken.START_OBJECT, typeId));}.
* See {@link #writeTypePrefix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeCustomTypePrefixForObject(Object value, JsonGenerator g, String typeId) throws IOException {
writeTypePrefix(g, typeId(value, JsonToken.START_OBJECT, typeId));
}
/**
* DEPRECATED: now equivalent to:
*{@code writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY, typeId));}.
* See {@link #writeTypePrefix} for more info.
*
* @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeCustomTypePrefixForArray(Object value, JsonGenerator g, String typeId) throws IOException {
writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY, typeId));
}
/**
* @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeCustomTypeSuffixForScalar(Object value, JsonGenerator g, String typeId) throws IOException {
_writeLegacySuffix(g, typeId(value, JsonToken.VALUE_STRING, typeId));
}
/**
* @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeCustomTypeSuffixForObject(Object value, JsonGenerator g, String typeId) throws IOException {
_writeLegacySuffix(g, typeId(value, JsonToken.START_OBJECT, typeId));
}
/**
* @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId) instead
*/
@Deprecated // since 2.9
public void writeCustomTypeSuffixForArray(Object value, JsonGenerator g, String typeId) throws IOException {
_writeLegacySuffix(g, typeId(value, JsonToken.START_ARRAY, typeId));
}
>>>>>>> |
<<<<<<<
/* Then with leaf-level mix-in; without (method) auto-detect, should
* use field
*/
m = ObjectMapper.builder()
.addMixIn(LeafClass.class, MixIn.class)
.build();
=======
// Then with leaf-level mix-in; without (method) auto-detect,
// should use field
m = new ObjectMapper();
m.addMixIn(LeafClass.class, MixIn.class);
>>>>>>>
// Then with leaf-level mix-in; without (method) auto-detect,
// should use field
m = ObjectMapper.builder()
.addMixIn(LeafClass.class, MixIn.class)
.build(); |
<<<<<<<
Translator.addBundle("i18n");
Install4JUtils.applicationVersion().ifPresent(v -> LOG.info("Starting OpenWebStart {}", v));
=======
>>>>>>> |
<<<<<<<
import com.alibaba.android.vlayout.extend.PerformanceMonitor;
=======
import com.alibaba.android.vlayout.extend.ViewLifeCycleListener;
>>>>>>>
import com.alibaba.android.vlayout.extend.PerformanceMonitor;
import com.alibaba.android.vlayout.extend.ViewLifeCycleListener; |
<<<<<<<
/**
* Signals if this producer needs to be started automatically.
*
* Default: true
*/
private boolean autoStartup = true;
=======
/**
* Signals if this producer needs to be started automatically
*
* Default: true
*/
private boolean autoStartup = true;
>>>>>>>
/**
* Signals if this producer needs to be started automatically.
* Default: true
*/
private boolean autoStartup = true;
<<<<<<<
public boolean isAutoStartup() {
return this.autoStartup;
}
public void setAutoStartup(boolean autoStartup) {
this.autoStartup = autoStartup;
}
=======
public boolean isAutoStartup() {
return autoStartup;
}
public void setAutoStartup(boolean autoStartup) {
this.autoStartup = autoStartup;
}
>>>>>>>
public boolean isAutoStartup() {
return this.autoStartup;
}
public void setAutoStartup(boolean autoStartup) {
this.autoStartup = autoStartup;
} |
<<<<<<<
* Returns the name of this binding (i.e., channel name).
* @return binding name
=======
* Returns the name of the destination for this binding
*
* @return destination name
>>>>>>>
* Returns the name of the destination for this binding
*
* @return destination name
<<<<<<<
=======
/**
* Returns the name of the target for this binding (i.e., channel name)
*
* @return binding name
*
* @since 2.2
*/
default String getBindingName() {
return null;
}
>>>>>>>
/**
* Returns the name of the target for this binding (i.e., channel name)
*
* @return binding name
*
* @since 2.2
*/
default String getBindingName() {
return null;
}
<<<<<<<
/**
* Returns boolean flag representing this binding's type. If 'true' this binding is an
* 'input' binding otherwise it is 'output' (as in binding annotated with
* either @Input or @Output).
* @return 'true' if this binding represents an input binding.
*/
default boolean isInput() {
throw new UnsupportedOperationException(
"Binding implementation `" + this.getClass().getName()
+ "` must implement this operation before it is called");
}
=======
/**
* Returns boolean flag representing this binding's type. If 'true' this binding is an 'input' binding
* otherwise it is 'output' (as in binding annotated with either @Input or @Output).
*
* @return 'true' if this binding represents an input binding.
*/
default boolean isInput() {
throw new UnsupportedOperationException("Binding implementation `" + this.getClass().getName()
+ "` must implement this operation before it is called");
}
>>>>>>>
/**
* Returns boolean flag representing this binding's type. If 'true' this binding is an
* 'input' binding otherwise it is 'output' (as in binding annotated with
* either @Input or @Output).
* @return 'true' if this binding represents an input binding.
*/
default boolean isInput() {
throw new UnsupportedOperationException(
"Binding implementation `" + this.getClass().getName()
+ "` must implement this operation before it is called");
} |
<<<<<<<
//TODO: load options
FinderWindow w = new FinderWindow(); //as long as we design it well, we won’t need a reference to it ;)
=======
FinderWindow w = new FinderWindow();
>>>>>>>
FinderWindow w = new FinderWindow(); //as long as we design it well, we won’t need a reference to it ;) |
<<<<<<<
resetHandlers(_participantHandlers);
resetHandlers(_controllerHandlers);
logger.info("Handling new session, session id:" + _sessionId);
=======
resetHandlers(_handlers);
logger.info("Handling new session, session id:" + _sessionId + "instance:" + _instanceName);
>>>>>>>
resetHandlers(_handlers);
logger.info("Handling new session, session id:" + _sessionId + "instance:" + _instanceName);
<<<<<<<
handleNewSessionAsParticipant();
=======
// Check if liveInstancePath for the instance already exists. If yes, throw exception
if(_accessor.getClusterProperty(ClusterPropertyType.LIVEINSTANCES, _instanceName) != null)
{
logger.warn("find liveinstance record for "+_instanceName + " in cluster "+_clusterName);
// Wait for a while, in case previous storage node exits unexpectedly and its liveinstance
// still hangs around until session timeout happens
try
{
Thread.sleep(SESSIONTIMEOUT + 5000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
if(_accessor.getClusterProperty(ClusterPropertyType.LIVEINSTANCES, _instanceName) != null)
{
String errorMessage = "instance " + _instanceName + " already has a liveinstance in cluster " + _clusterName;
logger.error(errorMessage);
throw new ClusterManagerException(errorMessage);
}
}
carryOverPreviousCurrentState();
addLiveInstance();
startStatusUpdatedumpTask();
>>>>>>>
handleNewSessionAsParticipant();
<<<<<<<
private void carryOverPreviousCurrentState()
{
List<String> subPaths = _accessor.getInstancePropertySubPaths(
_instanceName, InstancePropertyType.CURRENTSTATES);
for (String previousSessionId : subPaths)
{
List<ZNRecord> previousCurrentStates = _accessor.getInstancePropertyList(
_instanceName, previousSessionId, InstancePropertyType.CURRENTSTATES);
for (ZNRecord previousCurrentState : previousCurrentStates)
{
if (!previousSessionId.equalsIgnoreCase(_sessionId))
{
logger.info("Carrying over old session:" + previousSessionId
+ " resource " + previousCurrentState.getId()
+ " to new session:" + _sessionId);
for (String resourceKey : previousCurrentState.mapFields.keySet())
{
previousCurrentState.getMapField(resourceKey).put(
ZNAttribute.CURRENT_STATE.toString(), "OFFLINE");
}
previousCurrentState.setSimpleField(
CMConstants.ZNAttribute.SESSION_ID.toString(), _sessionId);
_accessor.setInstanceProperty(_instanceName,
InstancePropertyType.CURRENTSTATES, _sessionId,
previousCurrentState.getId(), previousCurrentState);
}
}
}
// Deleted old current state
for (String previousSessionId : subPaths)
{
if (!previousSessionId.equalsIgnoreCase(_sessionId))
{
String path = CMUtil.getInstancePropertyPath(_clusterName,
_instanceName, InstancePropertyType.CURRENTSTATES);
_zkClient.deleteRecursive(path + "/" + previousSessionId);
logger.info("Deleting previous current state. path: " + path + "/"
+ previousSessionId);
}
}
}
@Override
public <T> PropertyStore<T> getPropertyStore(String rootNamespace,
PropertySerializer<T> serializer)
{
String path = "/" + _clusterName + "/" + "PRPOPERTY_STORE" + "/"
+ rootNamespace;
if (!_zkClient.exists(path))
{
_zkClient.createPersistent(path);
}
return new ZKPropertyStore<T>((ZkConnection) _zkClient.getConnection(),
serializer, path);
}
=======
private void carryOverPreviousCurrentState()
{
List<String> subPaths = _accessor.getInstancePropertySubPaths(
_instanceName, InstancePropertyType.CURRENTSTATES);
for (String previousSessionId : subPaths)
{
List<ZNRecord> previousCurrentStates = _accessor.getInstancePropertyList(
_instanceName, previousSessionId, InstancePropertyType.CURRENTSTATES);
for (ZNRecord previousCurrentState : previousCurrentStates)
{
if (!previousSessionId.equalsIgnoreCase(_sessionId))
{
logger.info("Carrying over old session:" + previousSessionId
+ " resource " + previousCurrentState.getId() + " to new session:" +
_sessionId);
for (String resourceKey : previousCurrentState.mapFields.keySet())
{
previousCurrentState.getMapField(resourceKey).put(
ZNAttribute.CURRENT_STATE.toString(), "OFFLINE");
}
previousCurrentState.setSimpleField(
CMConstants.ZNAttribute.SESSION_ID.toString(), _sessionId);
_accessor.setInstanceProperty(_instanceName,
InstancePropertyType.CURRENTSTATES, _sessionId,
previousCurrentState.getId(), previousCurrentState);
}
}
}
// Deleted old current state
for (String previousSessionId : subPaths)
{
if (!previousSessionId.equalsIgnoreCase(_sessionId))
{
String path = CMUtil.getInstancePropertyPath(_clusterName,
_instanceName, InstancePropertyType.CURRENTSTATES);
_zkClient.deleteRecursive(path + "/" + previousSessionId);
logger.info("Deleting previous current state. path: " + path + "/"
+ previousSessionId);
}
}
}
@Override
public <T> PropertyStore<T> getPropertyStore(String rootNamespace, PropertySerializer<T> serializer)
{
String path = "/" + _clusterName + "/" + "PRPOPERTY_STORE" + "/" + rootNamespace;
if (!_zkClient.exists(path))
{
_zkClient.createPersistent(path);
}
return new ZKPropertyStore<T>((ZkConnection)_zkClient.getConnection(), serializer, path);
}
>>>>>>>
private void carryOverPreviousCurrentState()
{
List<String> subPaths = _accessor.getInstancePropertySubPaths(
_instanceName, InstancePropertyType.CURRENTSTATES);
for (String previousSessionId : subPaths)
{
List<ZNRecord> previousCurrentStates = _accessor.getInstancePropertyList(
_instanceName, previousSessionId, InstancePropertyType.CURRENTSTATES);
for (ZNRecord previousCurrentState : previousCurrentStates)
{
if (!previousSessionId.equalsIgnoreCase(_sessionId))
{
logger.info("Carrying over old session:" + previousSessionId
+ " resource " + previousCurrentState.getId()
+ " to new session:" + _sessionId);
for (String resourceKey : previousCurrentState.mapFields.keySet())
{
previousCurrentState.getMapField(resourceKey).put(
ZNAttribute.CURRENT_STATE.toString(), "OFFLINE");
}
previousCurrentState.setSimpleField(
CMConstants.ZNAttribute.SESSION_ID.toString(), _sessionId);
_accessor.setInstanceProperty(_instanceName,
InstancePropertyType.CURRENTSTATES, _sessionId,
previousCurrentState.getId(), previousCurrentState);
}
}
}
// Deleted old current state
for (String previousSessionId : subPaths)
{
if (!previousSessionId.equalsIgnoreCase(_sessionId))
{
String path = CMUtil.getInstancePropertyPath(_clusterName,
_instanceName, InstancePropertyType.CURRENTSTATES);
_zkClient.deleteRecursive(path + "/" + previousSessionId);
logger.info("Deleting previous current state. path: " + path + "/"
+ previousSessionId);
}
}
}
@Override
public <T> PropertyStore<T> getPropertyStore(String rootNamespace,
PropertySerializer<T> serializer)
{
String path = "/" + _clusterName + "/" + "PRPOPERTY_STORE" + "/"
+ rootNamespace;
if (!_zkClient.exists(path))
{
_zkClient.createPersistent(path);
}
return new ZKPropertyStore<T>((ZkConnection) _zkClient.getConnection(),
serializer, path);
}
<<<<<<<
@Override
public ParticipantHealthReportCollector getHealthReportCollector()
{
return (ParticipantHealthReportCollector)_participantHealthCheckInfoCollector;
}
=======
@Override
public InstanceType getInstanceType()
{
return _instanceType;
}
>>>>>>>
@Override
public ParticipantHealthReportCollector getHealthReportCollector()
{
return (ParticipantHealthReportCollector)_participantHealthCheckInfoCollector;
}
@Override
public InstanceType getInstanceType()
{
return _instanceType;
} |
<<<<<<<
import com.linkedin.helix.HelixAdmin;
=======
import com.linkedin.helix.ClusterManagementService;
import com.linkedin.helix.PropertyPathConfig;
>>>>>>>
import com.linkedin.helix.HelixAdmin;
import com.linkedin.helix.PropertyPathConfig; |
<<<<<<<
private static final Logger LOG =
Logger.getLogger(ZkCachedDataAccessor.class);
=======
private static final Logger LOG = Logger
.getLogger(ZkCachedDataAccessor.class);
>>>>>>>
private static final Logger LOG =
Logger.getLogger(ZkCachedDataAccessor.class);
<<<<<<<
private void updateCacheAlongPath(String parentPath,
List<ZNRecord> records,
boolean[] success)
=======
private void updateCacheAlongPath(String parentPath, List<ZNRecord> records,
boolean[] success)
>>>>>>>
private void updateCacheAlongPath(String parentPath,
List<ZNRecord> records,
boolean[] success)
<<<<<<<
ZkCachedDataAccessor accessor =
new ZkCachedDataAccessor(new ZkBaseDataAccessor(root, zkClient), list);
System.out.println("accessor1:" + accessor);
=======
ZkCachedDataAccessor accessor = new ZkCachedDataAccessor(
new ZkBaseDataAccessor(zkClient), list);
>>>>>>>
ZkCachedDataAccessor accessor =
new ZkCachedDataAccessor(new ZkBaseDataAccessor(zkClient), list);
System.out.println("accessor1:" + accessor);
<<<<<<<
ZkCachedDataAccessor accessor2 =
new ZkCachedDataAccessor(new ZkBaseDataAccessor(root, zkClient2), list);
System.out.println("accessor2:" + accessor2);
accessor2.subscribe("/" + root, new HelixDataListener()
{
@Override
public void onDataChange(String path)
{
System.out.println("DataChange:" + path);
}
@Override
public void onDataCreate(String path)
{
System.out.println("DataCreate:" + path);
}
@Override
public void onDataDelete(String path)
{
System.out.println("DataDelete:" + path);
}
});
=======
ZkCachedDataAccessor accessor2 = new ZkCachedDataAccessor(
new ZkBaseDataAccessor(zkClient2), list);
>>>>>>>
ZkCachedDataAccessor accessor2 =
new ZkCachedDataAccessor(new ZkBaseDataAccessor(zkClient2), list);
System.out.println("accessor2:" + accessor2);
accessor2.subscribe("/" + root, new HelixDataListener()
{
@Override
public void onDataChange(String path)
{
System.out.println("DataChange:" + path);
}
@Override
public void onDataCreate(String path)
{
System.out.println("DataCreate:" + path);
}
@Override
public void onDataDelete(String path)
{
System.out.println("DataDelete:" + path);
}
}); |
<<<<<<<
public enum IdealStateProperty {
PARTITIONS, STATE_MODEL_DEF_REF, REPLICAS, IDEAL_STATE_MODE, STATE_MODEL_FACTORY_NAME
=======
public enum IdealStateProperty
{
NUM_PARTITIONS,
STATE_MODEL_DEF_REF,
REPLICAS,
IDEAL_STATE_MODE
>>>>>>>
public enum IdealStateProperty {
NUM_PARTITIONS, STATE_MODEL_DEF_REF, STATE_MODEL_FACTORY_NAME, REPLICAS, IDEAL_STATE_MODE
<<<<<<<
private List<String> getInstancePreferenceList(String resourceKeyName,
StateModelDefinition stateModelDef)
=======
private List<String> getInstancePreferenceList(String partitionName,
StateModelDefinition stateModelDef)
>>>>>>>
private List<String> getInstancePreferenceList(String partitionName,
StateModelDefinition stateModelDef)
<<<<<<<
public List<String> getPreferenceList(String resourceKeyName, StateModelDefinition stateModelDef)
=======
public List<String> getPreferenceList(String partitionName,
StateModelDefinition stateModelDef)
>>>>>>>
public List<String> getPreferenceList(String partitionName, StateModelDefinition stateModelDef)
<<<<<<<
return Integer.parseInt(_record.getSimpleField(IdealStateProperty.PARTITIONS.toString()));
} catch (Exception e)
=======
return Integer.parseInt(_record.getSimpleField(IdealStateProperty.NUM_PARTITIONS.toString()));
}
catch (Exception e)
>>>>>>>
return Integer.parseInt(_record.getSimpleField(IdealStateProperty.NUM_PARTITIONS.toString()));
} catch (Exception e)
<<<<<<<
// if(getReplicas() < 0)
// {
// logger.error("idealStates does not have replicas. IS:" +
// _record.getId());
// return false;
// }
=======
>>>>>>> |
<<<<<<<
stateMach.registerStateModelFactory(LEADER_STANDBY, _stateModelFty, _resGroupName);
=======
stateMach.registerStateModelFactory(LEADER_STANDBY, _resourceName,
_stateModelFty);
>>>>>>>
stateMach.registerStateModelFactory(LEADER_STANDBY, _stateModelFty, _resourceName);
<<<<<<<
LOG.info("Set idealState for participantLeader:" + _resGroupName + ", idealState:"
+ idealState);
=======
LOG.info("Set idealState for participantLeader:" + _resourceName
+ ", idealState:" + idealState);
>>>>>>>
LOG.info("Set idealState for participantLeader:" + _resourceName + ", idealState:"
+ idealState);
<<<<<<<
LOG.info("Removing stateModelFactory for " + _resGroupName);
_manager.getStateMachineEngine().removeStateModelFactory(LEADER_STANDBY, _stateModelFty,
_resGroupName);
=======
LOG.info("Removing stateModelFactory for " + _resourceName);
_manager.getStateMachineEngine().removeStateModelFactory(LEADER_STANDBY,
_resourceName, _stateModelFty);
>>>>>>>
LOG.info("Removing stateModelFactory for " + _resourceName);
_manager.getStateMachineEngine().removeStateModelFactory(LEADER_STANDBY, _stateModelFty,
_resourceName); |
<<<<<<<
@Override
public void addHealthStateChangeListener(HealthStateChangeListener listener,
String instanceName) throws Exception {
// TODO Auto-generated method stub
}
=======
@Override
public String getVersion()
{
return _version;
}
>>>>>>>
@Override
public void addHealthStateChangeListener(HealthStateChangeListener listener,
String instanceName) throws Exception {
// TODO Auto-generated method stub
}
@Override
public String getVersion()
{
return _version;
} |
<<<<<<<
import com.linkedin.helix.util.StatusUpdateUtil;
import com.linkedin.helix.*;
=======
>>>>>>>
import com.linkedin.helix.util.StatusUpdateUtil;
import com.linkedin.helix.*;
<<<<<<<
=======
static class Transition implements Comparable<Transition>
{
private final String _msgID;
private final long _timeStamp;
private final String _from;
private final String _to;
public Transition(String msgID, long timeStamp, String from, String to)
{
this._msgID = msgID;
this._timeStamp = timeStamp;
this._from = from;
this._to = to;
}
@Override
public int compareTo(Transition t)
{
if (_timeStamp < t._timeStamp)
return -1;
else if (_timeStamp > t._timeStamp)
return 1;
else
return 0;
}
public boolean equals(Transition t)
{
return (_timeStamp == t._timeStamp && _from.equals(t._from) && _to.equals(t._to));
}
public String getFromState()
{
return _from;
}
public String getToState()
{
return _to;
}
public String getMsgID()
{
return _msgID;
}
@Override
public String toString()
{
return _msgID + ":" + _timeStamp + ":" + _from + "->" + _to;
}
}
enum TaskStatus
{
UNKNOWN, SCHEDULED, INVOKING, COMPLETED, FAILED
}
static class StatusUpdateContents
{
private final List<Transition> _transitions;
private final Map<String, TaskStatus> _taskMessages;
private StatusUpdateContents(List<Transition> transitions,
Map<String, TaskStatus> taskMessages)
{
this._transitions = transitions;
this._taskMessages = taskMessages;
}
// TODO: We should build a map and return the key instead of searching everytime
// for an (instance, resourceGroup, partition) tuple.
// But such a map is very similar to what exists in ZNRecord
public static StatusUpdateContents getStatusUpdateContents(DataAccessor accessor,
String instance,
String resourceGroup,
String partition)
{
List<ZNRecord> instances = accessor.getChildValues(PropertyType.CONFIGS,
ConfigScopeProperty.PARTICIPANT.toString());
List<ZNRecord> partitionRecords = new ArrayList<ZNRecord>();
for (ZNRecord znRecord : instances)
{
String instanceName = znRecord.getId();
if (!instanceName.equals(instance))
{
continue;
}
List<String> sessions =
accessor.getChildNames(PropertyType.STATUSUPDATES, instanceName);
for (String session : sessions)
{
List<String> resourceGroups =
accessor.getChildNames(PropertyType.STATUSUPDATES, instanceName, session);
for (String resourceGroupName : resourceGroups)
{
if (!resourceGroupName.equals(resourceGroup))
{
continue;
}
List<String> partitionStrings =
accessor.getChildNames(PropertyType.STATUSUPDATES, instanceName, session, resourceGroupName);
for (String partitionString : partitionStrings)
{
ZNRecord partitionRecord = accessor.getProperty(PropertyType.STATUSUPDATES, instanceName,
session, resourceGroupName, partitionString);
String partitionName = partitionString.split("_")[1];
if(!partitionName.equals(partition))
{
continue;
}
partitionRecords.add(partitionRecord);
}
}
}
}
return new StatusUpdateContents(getSortedTransitions(partitionRecords),
getTaskMessages(partitionRecords));
}
public List<Transition> getTransitions()
{
return _transitions;
}
public Map<String, TaskStatus> getTaskMessages()
{
return _taskMessages;
}
// input: List<ZNRecord> corresponding to (instance, database,
// partition) tuples across all sessions
// return list of transitions sorted from earliest to latest
private static List<Transition> getSortedTransitions(List<ZNRecord> partitionRecords)
{
List<Transition> transitions = new ArrayList<Transition>();
for (ZNRecord partition : partitionRecords)
{
Map<String, Map<String, String>> mapFields = partition.getMapFields();
for (String key : mapFields.keySet())
{
if (key.startsWith("MESSAGE"))
{
Map<String, String> m = mapFields.get(key);
long createTimeStamp = 0;
try
{
createTimeStamp = Long.parseLong(m.get("CREATE_TIMESTAMP"));
}
catch (Exception e)
{
}
transitions.add(new Transition(m.get("MSG_ID"),
createTimeStamp,
m.get("FROM_STATE"),
m.get("TO_STATE")));
}
}
}
Collections.sort(transitions);
return transitions;
}
private static Map<String, TaskStatus> getTaskMessages(List<ZNRecord> partitionRecords)
{
Map<String, TaskStatus> taskMessages = new HashMap<String, TaskStatus>();
for (ZNRecord partition : partitionRecords)
{
Map<String, Map<String, String>> mapFields = partition.getMapFields();
//iterate over the task status updates in the order they occurred
//so that the last status can be recorded
for (String key : mapFields.keySet())
{
if (key.contains("STATE_TRANSITION"))
{
Map<String, String> m = mapFields.get(key);
String id = m.get("MSG_ID");
String statusString = m.get("AdditionalInfo");
TaskStatus status = TaskStatus.UNKNOWN;
if (statusString.contains("scheduled"))
status = TaskStatus.SCHEDULED;
else if (statusString.contains("invoking"))
status = TaskStatus.INVOKING;
else if (statusString.contains("completed"))
status = TaskStatus.COMPLETED;
taskMessages.put(id, status);
}
}
}
return taskMessages;
}
}
>>>>>>>
static class Transition implements Comparable<Transition>
{
private final String _msgID;
private final long _timeStamp;
private final String _from;
private final String _to;
public Transition(String msgID, long timeStamp, String from, String to)
{
this._msgID = msgID;
this._timeStamp = timeStamp;
this._from = from;
this._to = to;
}
@Override
public int compareTo(Transition t)
{
if (_timeStamp < t._timeStamp)
return -1;
else if (_timeStamp > t._timeStamp)
return 1;
else
return 0;
}
public boolean equals(Transition t)
{
return (_timeStamp == t._timeStamp && _from.equals(t._from) && _to.equals(t._to));
}
public String getFromState()
{
return _from;
}
public String getToState()
{
return _to;
}
public String getMsgID()
{
return _msgID;
}
@Override
public String toString()
{
return _msgID + ":" + _timeStamp + ":" + _from + "->" + _to;
}
}
enum TaskStatus
{
UNKNOWN, SCHEDULED, INVOKING, COMPLETED, FAILED
}
static class StatusUpdateContents
{
private final List<Transition> _transitions;
private final Map<String, TaskStatus> _taskMessages;
private StatusUpdateContents(List<Transition> transitions,
Map<String, TaskStatus> taskMessages)
{
this._transitions = transitions;
this._taskMessages = taskMessages;
}
// TODO: We should build a map and return the key instead of searching everytime
// for an (instance, resourceGroup, partition) tuple.
// But such a map is very similar to what exists in ZNRecord
public static StatusUpdateContents getStatusUpdateContents(DataAccessor accessor,
String instance,
String resourceGroup,
String partition)
{
List<ZNRecord> instances = accessor.getChildValues(PropertyType.CONFIGS,
ConfigScopeProperty.PARTICIPANT.toString());
List<ZNRecord> partitionRecords = new ArrayList<ZNRecord>();
for (ZNRecord znRecord : instances)
{
String instanceName = znRecord.getId();
if (!instanceName.equals(instance))
{
continue;
}
List<String> sessions =
accessor.getChildNames(PropertyType.STATUSUPDATES, instanceName);
for (String session : sessions)
{
List<String> resourceGroups =
accessor.getChildNames(PropertyType.STATUSUPDATES, instanceName, session);
for (String resourceGroupName : resourceGroups)
{
if (!resourceGroupName.equals(resourceGroup))
{
continue;
}
List<String> partitionStrings =
accessor.getChildNames(PropertyType.STATUSUPDATES, instanceName, session, resourceGroupName);
for (String partitionString : partitionStrings)
{
ZNRecord partitionRecord = accessor.getProperty(PropertyType.STATUSUPDATES, instanceName,
session, resourceGroupName, partitionString);
String partitionName = partitionString.split("_")[1];
if(!partitionName.equals(partition))
{
continue;
}
partitionRecords.add(partitionRecord);
}
}
}
}
return new StatusUpdateContents(getSortedTransitions(partitionRecords),
getTaskMessages(partitionRecords));
}
public List<Transition> getTransitions()
{
return _transitions;
}
public Map<String, TaskStatus> getTaskMessages()
{
return _taskMessages;
}
// input: List<ZNRecord> corresponding to (instance, database,
// partition) tuples across all sessions
// return list of transitions sorted from earliest to latest
private static List<Transition> getSortedTransitions(List<ZNRecord> partitionRecords)
{
List<Transition> transitions = new ArrayList<Transition>();
for (ZNRecord partition : partitionRecords)
{
Map<String, Map<String, String>> mapFields = partition.getMapFields();
for (String key : mapFields.keySet())
{
if (key.startsWith("MESSAGE"))
{
Map<String, String> m = mapFields.get(key);
long createTimeStamp = 0;
try
{
createTimeStamp = Long.parseLong(m.get("CREATE_TIMESTAMP"));
}
catch (Exception e)
{
}
transitions.add(new Transition(m.get("MSG_ID"),
createTimeStamp,
m.get("FROM_STATE"),
m.get("TO_STATE")));
}
}
}
Collections.sort(transitions);
return transitions;
}
private static Map<String, TaskStatus> getTaskMessages(List<ZNRecord> partitionRecords)
{
Map<String, TaskStatus> taskMessages = new HashMap<String, TaskStatus>();
for (ZNRecord partition : partitionRecords)
{
Map<String, Map<String, String>> mapFields = partition.getMapFields();
//iterate over the task status updates in the order they occurred
//so that the last status can be recorded
for (String key : mapFields.keySet())
{
if (key.contains("STATE_TRANSITION"))
{
Map<String, String> m = mapFields.get(key);
String id = m.get("MSG_ID");
String statusString = m.get("AdditionalInfo");
TaskStatus status = TaskStatus.UNKNOWN;
if (statusString.contains("scheduled"))
status = TaskStatus.SCHEDULED;
else if (statusString.contains("invoking"))
status = TaskStatus.INVOKING;
else if (statusString.contains("completed"))
status = TaskStatus.COMPLETED;
taskMessages.put(id, status);
}
}
}
return taskMessages;
}
} |
<<<<<<<
import com.linkedin.clustermanager.ZNRecord;
import com.linkedin.clustermanager.model.Alerts;
=======
import com.linkedin.clustermanager.ZNRecordDecorator;
>>>>>>>
import com.linkedin.clustermanager.ZNRecord;
import com.linkedin.clustermanager.model.Alerts;
import com.linkedin.clustermanager.ZNRecordDecorator;
<<<<<<<
private final Map<String, LiveInstance> _liveInstanceMap = new HashMap<String, LiveInstance>();
private final Map<String, IdealState> _idealStateMap = new HashMap<String, IdealState>();
private final Map<String, StateModelDefinition> _stateModelDefMap = new HashMap<String, StateModelDefinition>();
private final Map<String, InstanceConfig> _instanceConfigMap = new HashMap<String, InstanceConfig>();
private final Map<String, Map<String, Map<String, CurrentState>>> _currentStateMap = new HashMap<String, Map<String, Map<String, CurrentState>>>();
private final Map<String, Map<String, Message>> _messageMap = new HashMap<String, Map<String, Message>>();
private final Map<String, Map<String, HealthStat>> _healthStatMap = new HashMap<String, Map<String, HealthStat>>();
private HealthStat _globalStats; //DON'T THINK I WILL USE THIS ANYMORE
//private final Map<String, Map<String, String>> _persistentStats = new HashMap<String, Map<String, String>>();
private PersistentStats _persistentStats;
//private final Map<String, Map<String, String>> _alerts = new HashMap<String, Map<String,String>>();
private Alerts _alerts;
private static final Logger logger = Logger.getLogger(ClusterDataCache.class
.getName());
// private <T extends Object> Map<String, T> retrieve(
// ClusterDataAccessor dataAccessor, PropertyType type, Class<T> clazz,
// String... keys)
// {
// List<ZNRecord> instancePropertyList = dataAccessor.getChildValues(type,
// keys);
// Map<String, T> map = ZNRecordUtil.convertListToTypedMap(
// instancePropertyList, clazz);
// return map;
// }
//
// private <T extends Object> Map<String, T> retrieve(
// ClusterDataAccessor dataAccessor, PropertyType type, Class<T> clazz)
// {
//
// List<ZNRecord> clusterPropertyList;
// clusterPropertyList = dataAccessor.getChildValues(type);
// Map<String, T> map = ZNRecordUtil.convertListToTypedMap(
// clusterPropertyList, clazz);
// return map;
// }
=======
Map<String, LiveInstance> _liveInstanceMap;
Map<String, IdealState> _idealStateMap;
Map<String, StateModelDefinition> _stateModelDefMap;
Map<String, InstanceConfig> _instanceConfigMap;
final Map<String, Map<String, Map<String, CurrentState>>> _currentStateMap = new HashMap<String, Map<String, Map<String, CurrentState>>>();
final Map<String, Map<String, Message>> _messageMap = new HashMap<String, Map<String, Message>>();
private static final Logger logger = Logger.getLogger(ClusterDataCache.class.getName());
>>>>>>>
Map<String, LiveInstance> _liveInstanceMap;
Map<String, IdealState> _idealStateMap;
Map<String, StateModelDefinition> _stateModelDefMap;
Map<String, InstanceConfig> _instanceConfigMap;
final Map<String, Map<String, Map<String, CurrentState>>> _currentStateMap = new HashMap<String, Map<String, Map<String, CurrentState>>>();
final Map<String, Map<String, Message>> _messageMap = new HashMap<String, Map<String, Message>>();
final Map<String, Map<String, HealthStat>> _healthStatMap = new HashMap<String, Map<String, HealthStat>>();
private HealthStat _globalStats; //DON'T THINK I WILL USE THIS ANYMORE
private PersistentStats _persistentStats;
private Alerts _alerts;
private static final Logger logger = Logger.getLogger(ClusterDataCache.class.getName()); |
<<<<<<<
PAUSE(Type.CONTROLLER, false,false, true),
PERSISTENTSTATS(Type.CONTROLLER, true, false, false, false),
ALERTS(Type.CONTROLLER, true, false, false, false),
MESSAGES_CONTROLLER(Type.CONTROLLER, true, false, true),
STATUSUPDATES_CONTROLLER(Type.CONTROLLER, true, true, true),
=======
PAUSE(Type.CONTROLLER, false, false, true),
MESSAGES_CONTROLLER(Type.CONTROLLER, true, false, true),
STATUSUPDATES_CONTROLLER(Type.CONTROLLER, true, true, true),
>>>>>>>
PAUSE(Type.CONTROLLER, false, false, true),
MESSAGES_CONTROLLER(Type.CONTROLLER, true, false, true),
STATUSUPDATES_CONTROLLER(Type.CONTROLLER, true, true, true),
<<<<<<<
boolean createOnlyIfAbsent;
=======
boolean createOnlyIfAbsent;
/**
* "isCached" defines whether the property is cached in data accessor
* if data is cached, then read from zk can be optimized
*/
boolean isCached;
>>>>>>>
boolean createOnlyIfAbsent;
/**
* "isCached" defines whether the property is cached in data accessor
* if data is cached, then read from zk can be optimized
*/
boolean isCached;
<<<<<<<
public boolean isCreateOnlyIfAbsent() {
return createOnlyIfAbsent;
}
public void setCreateOnlyIfAbsent(boolean createOnlyIfAbsent) {
this.createOnlyIfAbsent = createOnlyIfAbsent;
}
=======
>>>>>>>
<<<<<<<
boolean mergeOnUpdate, boolean updateOnlyOnExists,boolean createOnlyIfAbsent)
=======
boolean mergeOnUpdate, boolean updateOnlyOnExists, boolean createOnlyIfAbsent)
{
this(type, isPersistent, mergeOnUpdate, updateOnlyOnExists, createOnlyIfAbsent, false);
}
private PropertyType(Type type, boolean isPersistent,
boolean mergeOnUpdate, boolean updateOnlyOnExists, boolean createOnlyIfAbsent,
boolean isCached)
>>>>>>>
boolean mergeOnUpdate, boolean updateOnlyOnExists, boolean createOnlyIfAbsent)
{
this(type, isPersistent, mergeOnUpdate, updateOnlyOnExists, createOnlyIfAbsent, false);
}
private PropertyType(Type type, boolean isPersistent,
boolean mergeOnUpdate, boolean updateOnlyOnExists, boolean createOnlyIfAbsent,
boolean isCached)
<<<<<<<
this.createOnlyIfAbsent = createOnlyIfAbsent;
=======
this.createOnlyIfAbsent = createOnlyIfAbsent;
this.isCached = isCached;
}
public boolean isCreateOnlyIfAbsent()
{
return createOnlyIfAbsent;
}
public void setCreateIfAbsent(boolean createIfAbsent)
{
this.createOnlyIfAbsent = createIfAbsent;
>>>>>>>
this.createOnlyIfAbsent = createOnlyIfAbsent;
this.isCached = isCached;
}
public boolean isCreateOnlyIfAbsent()
{
return createOnlyIfAbsent;
}
public void setCreateIfAbsent(boolean createIfAbsent)
{
this.createOnlyIfAbsent = createIfAbsent; |
<<<<<<<
=======
import org.flywaydb.core.internal.configuration.ConfigUtils;
>>>>>>>
import org.flywaydb.core.internal.configuration.ConfigUtils;
<<<<<<<
import java.net.MalformedURLException;
=======
import java.lang.reflect.Method;
>>>>>>>
import java.lang.reflect.Method;
import java.net.MalformedURLException;
<<<<<<<
/**
* Configurations that will be added to the classpath for running flyway tasks.
* <p>
* By default flyway respects <code>compile</code>, <code>runtime</code>, <code>testCompile</code>, <code>testRuntime</code> (in this order).
* {@code empty list or null} for accepting the default classpath. (default: {@code null}).
*/
public List<Configuration> classpathExtensions;
=======
/**
* The fully qualified class names of handlers for errors and warnings that occur during a migration. This can be
* used to customize Flyway's behavior by for example
* throwing another runtime exception, outputting a warning or suppressing the error instead of throwing a FlywayException.
* ErrorHandlers are invoked in order until one reports to have successfully handled the errors or warnings.
* If none do, or if none are present, Flyway falls back to its default handling of errors and warnings.
* (default: none)
* <p>Also configurable with Gradle or System Property: ${flyway.errorHandler}</p>
* <p><i>Flyway Pro and Flyway Enterprise only</i></p>
*/
public String[] errorHandlers;
>>>>>>>
/**
* Configurations that will be added to the classpath for running flyway tasks.
* <p>
* By default flyway respects <code>compile</code>, <code>runtime</code>, <code>testCompile</code>, <code>testRuntime</code> (in this order).
* {@code empty list or null} for accepting the default classpath. (default: {@code null}).
*/
public List<Configuration> classpathExtensions;
/**
* The fully qualified class names of handlers for errors and warnings that occur during a migration. This can be
* used to customize Flyway's behavior by for example
* throwing another runtime exception, outputting a warning or suppressing the error instead of throwing a FlywayException.
* ErrorHandlers are invoked in order until one reports to have successfully handled the errors or warnings.
* If none do, or if none are present, Flyway falls back to its default handling of errors and warnings.
* (default: none)
* <p>Also configurable with Gradle or System Property: ${flyway.errorHandler}</p>
* <p><i>Flyway Pro and Flyway Enterprise only</i></p>
*/
public String[] errorHandlers;
<<<<<<<
addClasspathDependencies(extraURLs);
=======
addDependenciesWithScope(extraURLs, "compile");
addDependenciesWithScope(extraURLs, "runtime");
addDependenciesWithScope(extraURLs, "testCompile");
addDependenciesWithScope(extraURLs, "testRuntime");
>>>>>>>
addClasspathDependencies(extraURLs);
<<<<<<<
private List<Configuration> nullToEmpty(List<Configuration> input) {
if (input != null) {
return input;
}
return Collections.emptyList();
}
=======
/**
* Determines the encoding to use for loading the configuration files.
*
* @param envVars The environment variables converted to Flyway properties.
* @return The encoding. (default: UTF-8)
*/
private String determineConfigurationFileEncoding(Map<String, String> envVars) {
if (envVars.containsKey(ConfigUtils.CONFIG_FILE_ENCODING)) {
return envVars.get(ConfigUtils.CONFIG_FILE_ENCODING);
}
if (System.getProperties().containsKey(ConfigUtils.CONFIG_FILE_ENCODING)) {
return System.getProperties().getProperty(ConfigUtils.CONFIG_FILE_ENCODING);
}
if (configFileEncoding != null) {
return configFileEncoding;
}
if (extension.configFileEncoding != null) {
return extension.configFileEncoding;
}
return "UTF-8";
}
/**
* Determines the files to use for loading the configuration.
*
* @param envVars The environment variables converted to Flyway properties.
* @return The configuration files.
*/
private List<File> determineConfigFiles(Map<String, String> envVars) {
List<File> configFiles = new ArrayList<>();
if (envVars.containsKey(ConfigUtils.CONFIG_FILES)) {
for (String file : StringUtils.tokenizeToStringArray(envVars.get(ConfigUtils.CONFIG_FILES), ",")) {
configFiles.add(toFile(file));
}
return configFiles;
}
if (System.getProperties().containsKey(ConfigUtils.CONFIG_FILES)) {
for (String file : StringUtils.tokenizeToStringArray(System.getProperties().getProperty(ConfigUtils.CONFIG_FILES), ",")) {
configFiles.add(toFile(file));
}
return configFiles;
}
if (getProject().getProperties().containsKey(ConfigUtils.CONFIG_FILES)) {
for (String file : StringUtils.tokenizeToStringArray(System.getProperties().getProperty(ConfigUtils.CONFIG_FILES), ",")) {
configFiles.add(toFile(file));
}
return configFiles;
}
if (this.configFiles != null) {
for (String file : this.configFiles) {
configFiles.add(toFile(file));
}
return configFiles;
}
if (extension.configFiles != null) {
for (String file : extension.configFiles) {
configFiles.add(toFile(file));
}
return configFiles;
}
return configFiles;
}
/**
* Converts this fileName into a file, adjusting relative paths if necessary to make them relative to the pom.
*
* @param fileName The name of the file, relative or absolute.
* @return The resulting file.
*/
private File toFile(String fileName) {
File file = new File(fileName);
if (file.isAbsolute()) {
return file;
}
return new File(getProject().getProjectDir(), fileName);
}
/**
* Filters there properties to remove the Flyway Gradle Plugin-specific ones to avoid warnings.
*
* @param conf The properties to filter.
*/
private static void removeGradlePluginSpecificPropertiesToAvoidWarnings(Map<String, String> conf) {
conf.remove(ConfigUtils.CONFIG_FILES);
conf.remove(ConfigUtils.CONFIG_FILE_ENCODING);
conf.remove("flyway.version");
}
>>>>>>>
/**
* Determines the encoding to use for loading the configuration files.
*
* @param envVars The environment variables converted to Flyway properties.
* @return The encoding. (default: UTF-8)
*/
private String determineConfigurationFileEncoding(Map<String, String> envVars) {
if (envVars.containsKey(ConfigUtils.CONFIG_FILE_ENCODING)) {
return envVars.get(ConfigUtils.CONFIG_FILE_ENCODING);
}
if (System.getProperties().containsKey(ConfigUtils.CONFIG_FILE_ENCODING)) {
return System.getProperties().getProperty(ConfigUtils.CONFIG_FILE_ENCODING);
}
if (configFileEncoding != null) {
return configFileEncoding;
}
if (extension.configFileEncoding != null) {
return extension.configFileEncoding;
}
return "UTF-8";
}
/**
* Determines the files to use for loading the configuration.
*
* @param envVars The environment variables converted to Flyway properties.
* @return The configuration files.
*/
private List<File> determineConfigFiles(Map<String, String> envVars) {
List<File> configFiles = new ArrayList<>();
if (envVars.containsKey(ConfigUtils.CONFIG_FILES)) {
for (String file : StringUtils.tokenizeToStringArray(envVars.get(ConfigUtils.CONFIG_FILES), ",")) {
configFiles.add(toFile(file));
}
return configFiles;
}
if (System.getProperties().containsKey(ConfigUtils.CONFIG_FILES)) {
for (String file : StringUtils.tokenizeToStringArray(System.getProperties().getProperty(ConfigUtils.CONFIG_FILES), ",")) {
configFiles.add(toFile(file));
}
return configFiles;
}
if (getProject().getProperties().containsKey(ConfigUtils.CONFIG_FILES)) {
for (String file : StringUtils.tokenizeToStringArray(System.getProperties().getProperty(ConfigUtils.CONFIG_FILES), ",")) {
configFiles.add(toFile(file));
}
return configFiles;
}
if (this.configFiles != null) {
for (String file : this.configFiles) {
configFiles.add(toFile(file));
}
return configFiles;
}
if (extension.configFiles != null) {
for (String file : extension.configFiles) {
configFiles.add(toFile(file));
}
return configFiles;
}
return configFiles;
}
/**
* Converts this fileName into a file, adjusting relative paths if necessary to make them relative to the pom.
*
* @param fileName The name of the file, relative or absolute.
* @return The resulting file.
*/
private File toFile(String fileName) {
File file = new File(fileName);
if (file.isAbsolute()) {
return file;
}
return new File(getProject().getProjectDir(), fileName);
}
/**
* Filters there properties to remove the Flyway Gradle Plugin-specific ones to avoid warnings.
*
* @param conf The properties to filter.
*/
private static void removeGradlePluginSpecificPropertiesToAvoidWarnings(Map<String, String> conf) {
conf.remove(ConfigUtils.CONFIG_FILES);
conf.remove(ConfigUtils.CONFIG_FILE_ENCODING);
conf.remove("flyway.version");
}
<<<<<<<
/**
* Puts this property in the config if it has been set either in the task or the extension.
*
* @param config The config.
* @param key The peoperty name.
* @param propValue The value in the plugin.
* @param extensionValue The value in the extension.
*/
private void putIfSet(Map<String, String> config, String key, Object propValue, Object extensionValue) {
getLogger().lifecycle("putIfSet: "+key + " val("+propValue+") // ext("+extensionValue+")");
if (propValue != null) {
config.put("flyway." + key, propValue.toString());
} else if (extensionValue != null) {
config.put("flyway." + key, extensionValue.toString());
}
}
=======
>>>>>>>
private List<Configuration> nullToEmpty(List<Configuration> input) {
if (input != null) {
return input;
}
return Collections.emptyList();
} |
<<<<<<<
* Gets the list of callbacks set for lifecycle notifications
*
* @return FlywayCallback interface implementations or an empty list
*/
public List<FlywayCallback> getCallbacks() {
return callbacks;
}
/**
* Set custom FlywayCallback interface implementations that Flyway will
* use for lifecycle notifications
*
* @param callbacks
*/
public void setCallbacks(List<FlywayCallback> callbacks) {
this.callbacks = callbacks;
}
/**
=======
* Sets custom MigrationResolvers to be used in addition to the built-in ones.
*
* @param customMigrationResolvers The custom MigrationResolvers to be used in addition to the built-in ones.
*/
public void setCustomMigrationResolvers(MigrationResolver... customMigrationResolvers) {
this.customMigrationResolvers = customMigrationResolvers;
}
/**
>>>>>>>
* Gets the list of callbacks set for lifecycle notifications
*
* @return FlywayCallback interface implementations or an empty list
*/
public List<FlywayCallback> getCallbacks() {
return callbacks;
}
/**
* Set custom FlywayCallback interface implementations that Flyway will
* use for lifecycle notifications
*
* @param callbacks
*/
public void setCallbacks(List<FlywayCallback> callbacks) {
this.callbacks = callbacks;
}
/**
* Sets custom MigrationResolvers to be used in addition to the built-in ones.
*
* @param customMigrationResolvers The custom MigrationResolvers to be used in addition to the built-in ones.
*/
public void setCustomMigrationResolvers(MigrationResolver... customMigrationResolvers) {
this.customMigrationResolvers = customMigrationResolvers;
}
/**
<<<<<<<
for (FlywayCallback callback: getCallbacks()) {
callback.beforeMigrate(connectionUserObjects);
}
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table));
=======
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
>>>>>>>
for (FlywayCallback callback: getCallbacks()) {
callback.beforeMigrate(connectionUserObjects);
}
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
<<<<<<<
for (FlywayCallback callback: getCallbacks()) {
callback.beforeValidate(connectionUserObjects);
}
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table));
=======
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
>>>>>>>
for (FlywayCallback callback: getCallbacks()) {
callback.beforeValidate(connectionUserObjects);
}
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
<<<<<<<
for (FlywayCallback callback: getCallbacks()) {
callback.beforeClean(connectionUserObjects);
}
MetaDataTableImpl metaDataTable =
new MetaDataTableImpl(dbSupport, schemas[0].getTable(table));
=======
MetaDataTableImpl metaDataTable =
new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
>>>>>>>
for (FlywayCallback callback: getCallbacks()) {
callback.beforeClean(connectionUserObjects);
}
MetaDataTableImpl metaDataTable =
new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
<<<<<<<
for (FlywayCallback callback: getCallbacks()) {
callback.beforeInfo(connectionUserObjects);
}
MigrationResolver migrationResolver = createMigrationResolver(dbSupport);
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table));
=======
MigrationResolver migrationResolver = createMigrationResolver(dbSupport);
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
>>>>>>>
for (FlywayCallback callback: getCallbacks()) {
callback.beforeInfo(connectionUserObjects);
}
MigrationResolver migrationResolver = createMigrationResolver(dbSupport);
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
<<<<<<<
for (FlywayCallback callback: getCallbacks()) {
callback.beforeInit(connectionUserObjects);
}
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table));
=======
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
>>>>>>>
for (FlywayCallback callback: getCallbacks()) {
callback.beforeInit(connectionUserObjects);
}
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
<<<<<<<
for (FlywayCallback callback: getCallbacks()) {
callback.beforeRepair(connectionUserObjects);
}
new MetaDataTableImpl(dbSupport, schemas[0].getTable(table)).repair();
for (FlywayCallback callback: getCallbacks()) {
callback.afterRepair(connectionUserObjects);
}
return null;
=======
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
new DbRepair(connectionMetaDataTable, metaDataTable).repair();
return null;
>>>>>>>
for (FlywayCallback callback: getCallbacks()) {
callback.beforeRepair(connectionUserObjects);
}
MetaDataTable metaDataTable = new MetaDataTableImpl(dbSupport, schemas[0].getTable(table), classLoader);
new DbRepair(connectionMetaDataTable, metaDataTable).repair();
for (FlywayCallback callback: getCallbacks()) {
callback.afterRepair(connectionUserObjects);
}
return null; |
<<<<<<<
if (!exists()) {
LOG.info("Creating Metadata table: " + table);
final String source =
new ClassPathResource(dbSupport.getScriptLocation() + "createMetaDataTable.sql").loadAsString("UTF-8");
Map<String, String> placeholders = new HashMap<String, String>();
placeholders.put("schema", table.getSchema().getName());
placeholders.put("table", table.getName());
final String sourceNoPlaceholders = new PlaceholderReplacer(placeholders, "${", "}").replacePlaceholders(source);
try {
new TransactionTemplate(connection).execute(new TransactionCallback<Void>() {
public Void doInTransaction() {
SqlScript sqlScript = new SqlScript(sourceNoPlaceholders, dbSupport);
sqlScript.execute(jdbcTemplate);
return null;
}
});
} catch (SQLException e) {
throw new FlywayException("Error while creating metadata table " + table, e);
}
LOG.debug("Metadata table " + table + " created.");
=======
if (!table.exists()) {
create();
>>>>>>>
if (!table.exists()) {
LOG.info("Creating Metadata table: " + table);
final String source =
new ClassPathResource(dbSupport.getScriptLocation() + "createMetaDataTable.sql").loadAsString("UTF-8");
Map<String, String> placeholders = new HashMap<String, String>();
placeholders.put("schema", table.getSchema().getName());
placeholders.put("table", table.getName());
final String sourceNoPlaceholders = new PlaceholderReplacer(placeholders, "${", "}").replacePlaceholders(source);
try {
new TransactionTemplate(connection).execute(new TransactionCallback<Void>() {
public Void doInTransaction() {
SqlScript sqlScript = new SqlScript(sourceNoPlaceholders, dbSupport);
sqlScript.execute(jdbcTemplate);
return null;
}
});
} catch (SQLException e) {
throw new FlywayException("Error while creating metadata table " + table, e);
}
LOG.debug("Metadata table " + table + " created.");
<<<<<<<
=======
public boolean hasFailedMigration() {
if (!table.exists()) {
return false;
}
try {
int failedCount = jdbcTemplate.queryForInt("SELECT COUNT(*) FROM " + table
+ " WHERE " + dbSupport.quote("success") + "=" + dbSupport.getBooleanFalse());
return failedCount > 0;
} catch (SQLException e) {
throw new FlywayException("Unable to check the metadata table " + table + " for failed migrations", e);
}
}
>>>>>>> |
<<<<<<<
import com.googlecode.flyway.core.Flyway;
import com.googlecode.flyway.core.migration.Migration;
=======
import com.googlecode.flyway.core.migration.MigrationTestCase;
>>>>>>>
import com.googlecode.flyway.core.migration.Migration;
import com.googlecode.flyway.core.migration.MigrationTestCase;
<<<<<<<
import org.junit.Assert;
import org.junit.Before;
=======
>>>>>>>
import org.junit.Assert; |
<<<<<<<
ObjectMapper mapper = jsonMapperBuilder()
.enableDefaultTypingAsProperty(NoCheckSubTypeValidator.instance,
DefaultTyping.OBJECT_AND_NON_CONCRETE,
=======
final ObjectMapper mapper = JsonMapper.builder()
.activateDefaultTypingAsProperty(NoCheckSubTypeValidator.instance,
ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE,
>>>>>>>
ObjectMapper mapper = jsonMapperBuilder()
.activateDefaultTypingAsProperty(NoCheckSubTypeValidator.instance,
DefaultTyping.OBJECT_AND_NON_CONCRETE, |
<<<<<<<
"webelement.focus();" +
=======
"if (webelement.getAttribute('disabled') != undefined) return 'Cannot change value of disabled element';" +
>>>>>>>
"if (webelement.getAttribute('disabled') != undefined) return 'Cannot change value of disabled element';" +
"webelement.focus();" + |
<<<<<<<
=======
import com.codeborne.selenide.Configuration;
import com.codeborne.selenide.ex.TimeoutException;
import org.junit.Before;
import org.junit.Test;
>>>>>>>
<<<<<<<
=======
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.*;
import static org.junit.Assume.assumeFalse;
>>>>>>>
<<<<<<<
@BeforeEach
void setUp() {
=======
@Before
public void setUp() {
assumeFalse(isPhantomjs()); // Why it's not working in PhantomJS? It's magic for me...
>>>>>>>
@BeforeEach
void setUp() {
Assumptions.assumeFalse(isPhantomjs()); // Why it's not working in PhantomJS? It's magic for me...
<<<<<<<
void downloadsFiles() throws IOException {
Assumptions.assumeFalse(isPhantomjs()); // Why it's not working? It's magic for me...
=======
public void downloadsFiles() throws IOException {
>>>>>>>
void downloadsFiles() throws IOException {
<<<<<<<
void downloadsFileWithCyrillicName() throws IOException {
Assumptions.assumeFalse(isPhantomjs()); // Why it's not working? It's magic for me...
=======
public void downloadsFileWithCyrillicName() throws IOException {
>>>>>>>
void downloadsFileWithCyrillicName() throws IOException { |
<<<<<<<
List<WebElement> actualElements = filteringCollection.getActualElements();
assertThat(actualElements)
.hasSize(1);
assertThat(actualElements.get(0))
.isEqualTo(mockedWebElement2);
=======
List<WebElement> actualElements = filteringCollection.getElements();
assertEquals(1, actualElements.size());
assertEquals(mockedWebElement2, actualElements.get(0));
>>>>>>>
List<WebElement> actualElements = filteringCollection.getElements();
assertThat(actualElements)
.hasSize(1);
assertThat(actualElements.get(0))
.isEqualTo(mockedWebElement2); |
<<<<<<<
=======
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.feedback.IFeedback;
>>>>>>>
import org.apache.wicket.feedback.IFeedback;
<<<<<<<
import org.wicketstuff.event.annotation.OnEvent;
=======
import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wicketstuff.event.annotation.OnEvent;
<<<<<<<
event.getTarget().add(conceptTreePanel);
event.getTarget().add(propertyListPanel);
event.getTarget().add(detailContainer);
=======
target.add(conceptTreePanel);
target.add(propertyListPanel);
target.add(detailContainer);
target.addChildren(getPage(), IFeedback.class);
>>>>>>>
event.getTarget().add(conceptTreePanel);
event.getTarget().add(propertyListPanel);
event.getTarget().add(detailContainer);
target.addChildren(getPage(), IFeedback.class);
<<<<<<<
event.getTarget().add(conceptTreePanel);
event.getTarget().add(propertyListPanel);
event.getTarget().add(detailContainer);
=======
target.add(conceptTreePanel);
target.add(propertyListPanel);
target.add(detailContainer);
target.addChildren(getPage(), IFeedback.class);
>>>>>>>
event.getTarget().add(conceptTreePanel);
event.getTarget().add(propertyListPanel);
event.getTarget().add(detailContainer);
target.addChildren(getPage(), IFeedback.class); |
<<<<<<<
// TODO what about handling type intersection when multiple range statements are
// present?
// obtain IRI of property range, if existent
Optional<KBProperty> property = kbService.readProperty(groupModel.getObject().getKb(),
groupModel.getObject().getProperty().getIdentifier());
IModel<KBProperty> propertyModel = Model.of(property.orElse(null));
=======
>>>>>>>
// TODO what about handling type intersection when multiple range statements are
// present?
// obtain IRI of property range, if existent
Optional<KBProperty> property = kbService.readProperty(groupModel.getObject().getKb(),
groupModel.getObject().getProperty().getIdentifier());
IModel<KBProperty> propertyModel = Model.of(property.orElse(null)); |
<<<<<<<
writeLearningRecordInDatabase(LearningRecordUserAction.ACCEPTED);
// Create annotation from recommendation
AnnotatorState annotatorState = ActiveLearningSidebar.this.getModelObject();
JCas jCas = this.getJCasProvider().get();
SpanAdapter adapter = (SpanAdapter) annotationService.getAdapter(selectedLayer.getObject());
AnnotationObject acceptedRecommendation = currentRecommendation;
int begin = acceptedRecommendation.getOffset().getBeginCharacter();
int end = acceptedRecommendation.getOffset().getEndCharacter();
int id = adapter.add(annotatorState, jCas, begin, end);
annotationFeature = annotationService
.getFeature(acceptedRecommendation.getFeature(), selectedLayer.getObject());
=======
>>>>>>>
<<<<<<<
recommendationService
.setFeatureValue(annotationFeature, predictedValue, adapter, annotatorState, jCas, id);
=======
AnnotatorState state = ActiveLearningSidebar.this.getModelObject();
int begin = currentRecommendation.getOffset().getBeginCharacter();
int end = currentRecommendation.getOffset().getEndCharacter();
>>>>>>>
AnnotatorState state = ActiveLearningSidebar.this.getModelObject();
int begin = currentRecommendation.getOffset().getBeginCharacter();
int end = currentRecommendation.getOffset().getEndCharacter(); |
<<<<<<<
=======
>>>>>>>
<<<<<<<
// Query to retrieve concept for an instance
public static String CONCEPT_FOR_INSTANCE = String.join("\n"
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?pInstance ?pTYPE ?s ."
, " OPTIONAL {"
, " ?pInstance ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT 10000");
=======
//Query to get property specific range elements
public static String PROPERTY_SPECIFIC_RANGE = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?aProperty rdfs:range/(owl:unionOf/rdf:rest*/rdf:first)* ?s "
, " OPTIONAL {"
, " ?aProperty ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT 10000");
// Query to retrieve super class concept for a concept
public static String PARENT_CONCEPT = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE { "
, " {?oChild ?pSUBCLASS ?s . }"
, " UNION { ?s ?pTYPE ?oCLASS ."
, " ?oChild owl:intersectionOf ?list . "
, " FILTER EXISTS {?list rdf:rest*/rdf:first ?s. } }"
, " OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} ");
// Query to retrieve concept for an instance
public static String CONCEPT_FOR_INSTANCE = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?pInstance ?pTYPE ?s ."
, " OPTIONAL {"
, " ?pInstance ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT 10000");
>>>>>>>
//Query to get property specific range elements
public static String PROPERTY_SPECIFIC_RANGE = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?aProperty rdfs:range/(owl:unionOf/rdf:rest*/rdf:first)* ?s "
, " OPTIONAL {"
, " ?aProperty ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT 10000");
// Query to retrieve super class concept for a concept
public static String PARENT_CONCEPT = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE { "
, " {?oChild ?pSUBCLASS ?s . }"
, " UNION { ?s ?pTYPE ?oCLASS ."
, " ?oChild owl:intersectionOf ?list . "
, " FILTER EXISTS {?list rdf:rest*/rdf:first ?s. } }"
, " OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} ");
// Query to retrieve concept for an instance
public static String CONCEPT_FOR_INSTANCE = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?pInstance ?pTYPE ?s ."
, " OPTIONAL {"
, " ?pInstance ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT 10000"); |
<<<<<<<
public PredictionTask(User aUser, Project aProject)
=======
public PredictionTask(User aUser, Project aProject, String aTrigger)
>>>>>>>
public PredictionTask(User aUser, Project aProject, String aTrigger)
<<<<<<<
RecommendationEngine recommendationEngine = factory.build(recommender);
recommendationEngine.predict(ctx, jCas.get().getCas());
String predictedTypeName = recommendationEngine.getPredictedType();
String predictedFeatureName = recommendationEngine.getPredictedFeature();
Optional<String> scoreFeatureName = recommendationEngine.getScoreFeature();
Type predictionType = getAnnotationType(jCas.get().getCas(),
predictedTypeName);
Feature labelFeature = predictionType
.getFeatureByBaseName(predictedFeatureName);
Optional<Feature> scoreFeature = scoreFeatureName
.map(predictionType::getFeatureByBaseName);
// Extract the suggestions from the data which the recommender has written
// into the CAS
List<AnnotationSuggestion> predictions = extractSuggestions(user,
jCas.get().getCas(), predictionType, labelFeature, scoreFeature,
document, recommender);
// Calculate the visbility of the suggestions
Collection<SuggestionGroup> groups = SuggestionGroup.group(predictions);
calculateVisibility(learningRecordService, annoService, jCas.get(),
getUser().getUsername(), layer, groups, 0,
jCas.get().getDocumentText().length());
model.putPredictions(layer.getId(), predictions);
// In order to just extract the annotations for a single recommender, each
// recommender undoes the changes applied in `recommendationEngine.predict`
removePredictions(jCas.get().getCas(), predictionType);
=======
Type predictionType = getAnnotationType(predictionCas.get(),
recommendationEngine.getPredictedType());
Feature labelFeature = predictionType
.getFeatureByBaseName(recommendationEngine.getPredictedFeature());
Optional<Feature> scoreFeature = recommendationEngine.getScoreFeature()
.map(predictionType::getFeatureByBaseName);
// Remove any annotations that will be predicted (either manually created
// or from a previous prediction run) from the CAS
removePredictions(predictionCas.get(), predictionType);
// Perform the actual prediction
recommendationEngine.predict(ctx, predictionCas.get());
// Extract the suggestions from the data which the recommender has written
// into the CAS
List<AnnotationSuggestion> predictions = extractSuggestions(user,
predictionCas.get(), predictionType, labelFeature, scoreFeature,
document, recommender);
// Calculate the visbility of the suggestions. This happens via the original
// CAS which contains only the manually created annotations and *not* the
// suggestions.
Collection<SuggestionGroup> groups = SuggestionGroup.group(predictions);
calculateVisibility(learningRecordService, annoService, originalCas.get(),
getUser().getUsername(), layer, groups, 0,
originalCas.get().getDocumentText().length());
model.putPredictions(layer.getId(), predictions);
>>>>>>>
RecommendationEngine recommendationEngine = factory.build(recommender);
Type predictionType = getAnnotationType(predictionCas.get(),
recommendationEngine.getPredictedType());
Feature labelFeature = predictionType
.getFeatureByBaseName(recommendationEngine.getPredictedFeature());
Optional<Feature> scoreFeature = recommendationEngine.getScoreFeature()
.map(predictionType::getFeatureByBaseName);
// Remove any annotations that will be predicted (either manually created
// or from a previous prediction run) from the CAS
removePredictions(predictionCas.get(), predictionType);
// Perform the actual prediction
recommendationEngine.predict(ctx, predictionCas.get());
// Extract the suggestions from the data which the recommender has written
// into the CAS
List<AnnotationSuggestion> predictions = extractSuggestions(user,
predictionCas.get(), predictionType, labelFeature, scoreFeature,
document, recommender);
// Calculate the visbility of the suggestions. This happens via the original
// CAS which contains only the manually created annotations and *not* the
// suggestions.
Collection<SuggestionGroup> groups = SuggestionGroup.group(predictions);
calculateVisibility(learningRecordService, annoService, originalCas.get(),
getUser().getUsername(), layer, groups, 0,
originalCas.get().getDocumentText().length());
model.putPredictions(layer.getId(), predictions); |
<<<<<<<
Statement nameStmt = vf.createStatement(subject, kb.getLabelIri(),
vf.createLiteral(name));
=======
Statement nameStmt = vf.createStatement(subject, RDFS.LABEL,
vf.createLiteral(name, language));
>>>>>>>
Statement nameStmt = vf.createStatement(subject, kb.getLabelIri(),
vf.createLiteral(name, language));
<<<<<<<
Statement descStmt = vf.createStatement(subject, kb.getDescriptionIri(),
vf.createLiteral(description));
=======
Statement descStmt = vf.createStatement(subject, RDFS.COMMENT,
vf.createLiteral(description, language));
>>>>>>>
Statement descStmt = vf.createStatement(subject, kb.getDescriptionIri(),
vf.createLiteral(description, language));
<<<<<<<
readFirst(aConn, aStmt.getSubject(), kb.getLabelIri(), null).ifPresent((stmt) -> {
=======
readFirst(aConn, aStmt.getSubject(), RDFS.LABEL, null, ENGLISH).ifPresent((stmt) -> {
>>>>>>>
readFirst(aConn, aStmt.getSubject(), kb.getLabelIri(), null, ENGLISH).ifPresent((stmt) -> {
<<<<<<<
readFirst(aConn, aStmt.getSubject(), kb.getDescriptionIri(), null).ifPresent((stmt) -> {
=======
readFirst(aConn, aStmt.getSubject(), RDFS.COMMENT, null, ENGLISH).ifPresent((stmt) -> {
>>>>>>>
readFirst(aConn, aStmt.getSubject(), kb.getDescriptionIri(), null, ENGLISH)
.ifPresent((stmt) -> { |
<<<<<<<
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
=======
import org.eclipse.rdf4j.common.iteration.Iterations;
>>>>>>>
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.eclipse.rdf4j.common.iteration.Iterations; |
<<<<<<<
import java.net.URI;
=======
import java.util.ArrayList;
import java.util.Collections;
>>>>>>>
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
<<<<<<<
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
=======
import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wicketstuff.event.annotation.OnEvent;
>>>>>>>
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wicketstuff.event.annotation.OnEvent;
<<<<<<<
import de.tudarmstadt.ukp.inception.ui.kb.stmt.editor.StatementEditor;
import de.tudarmstadt.ukp.inception.ui.kb.util.WriteProtectionBehavior;
=======
>>>>>>>
import de.tudarmstadt.ukp.inception.ui.kb.stmt.editor.StatementEditor; |
<<<<<<<
ekb.setReification(kb.getReification());
=======
ekb.setSupportConceptLinking(kb.isSupportConceptLinking());
>>>>>>>
ekb.setReification(kb.getReification());
ekb.setSupportConceptLinking(kb.isSupportConceptLinking()); |
<<<<<<<
if (aExLayer.getOverlapMode() == null) {
// This allows importing old projects which did not have the overlap mode yet
aLayer.setOverlapMode(aExLayer.isAllowStacking() ? ANY_OVERLAP : OVERLAP_ONLY);
}
else {
aLayer.setOverlapMode(aExLayer.getOverlapMode());
}
=======
aLayer.setValidationMode(aExLayer.getValidationMode() != null ? aExLayer.getValidationMode()
: ValidationMode.NEVER);
>>>>>>>
if (aExLayer.getOverlapMode() == null) {
// This allows importing old projects which did not have the overlap mode yet
aLayer.setOverlapMode(aExLayer.isAllowStacking() ? ANY_OVERLAP : OVERLAP_ONLY);
}
else {
aLayer.setOverlapMode(aExLayer.getOverlapMode());
}
aLayer.setValidationMode(aExLayer.getValidationMode() != null ? aExLayer.getValidationMode()
: ValidationMode.NEVER); |
<<<<<<<
=======
private LoadableDetachableModel<Boolean> annotationFinished = LoadableDetachableModel
.of(this::loadAnnotationFinished);
>>>>>>>
private LoadableDetachableModel<Boolean> annotationFinished = LoadableDetachableModel
.of(this::loadAnnotationFinished); |
<<<<<<<
import de.tudarmstadt.ukp.clarin.webanno.model.OverlapMode;
=======
import de.tudarmstadt.ukp.clarin.webanno.model.ValidationMode;
>>>>>>>
import de.tudarmstadt.ukp.clarin.webanno.model.OverlapMode;
import de.tudarmstadt.ukp.clarin.webanno.model.ValidationMode;
<<<<<<<
@JsonProperty("overlap_mode")
private OverlapMode overlapMode;
=======
@JsonProperty("validation_mode")
private ValidationMode validationMode;
>>>>>>>
@JsonProperty("overlap_mode")
private OverlapMode overlapMode;
@JsonProperty("validation_mode")
private ValidationMode validationMode; |
<<<<<<<
@ImportResource({
"classpath:/META-INF/application-context.xml" })
=======
>>>>>>>
<<<<<<<
// The WebAnno User model class picks this bean up by name!
=======
// The WebAnno User model class picks this bean up by name!
@Bean
public PasswordEncoder passwordEncoder()
{
// Set up a DelegatingPasswordEncoder which decodes legacy passwords using the
// StandardPasswordEncoder but encodes passwords using the modern BCryptPasswordEncoder
String encoderForEncoding = "bcrypt";
Map<String, PasswordEncoder> encoders = new HashMap<>();
encoders.put(encoderForEncoding, new BCryptPasswordEncoder());
DelegatingPasswordEncoder delegatingEncoder = new DelegatingPasswordEncoder(
encoderForEncoding, encoders);
// Decode legacy passwords without encoder ID using the StandardPasswordEncoder
delegatingEncoder.setDefaultPasswordEncoderForMatches(new StandardPasswordEncoder());
return delegatingEncoder;
}
>>>>>>>
// The WebAnno User model class picks this bean up by name! |
<<<<<<<
tupleQuery.setBinding("pLABEL", aKB.getLabelIri());
tupleQuery.setBinding("pDESCRIPTION", aKB.getDescriptionIri());
tupleQuery.setBinding("pSUBPROPERTY", aKB.getSubPropertyIri());
=======
tupleQuery.setBinding("pLABEL", aKB.getPropertyLabelIri());
tupleQuery.setBinding("pDESCRIPTION", aKB.getPropertyDescriptionIri());
>>>>>>>
tupleQuery.setBinding("pLABEL", aKB.getLabelIri());
tupleQuery.setBinding("pDESCRIPTION", aKB.getDescriptionIri());
tupleQuery.setBinding("pSUBPROPERTY", aKB.getSubPropertyIri());
<<<<<<<
if (resultList.size() > 1) {
resultList.sort(Comparator.comparing(KBObject::getUiLabel));
}
=======
resultList.sort(Comparator.comparing(KBObject::getUiLabel));
>>>>>>>
if (resultList.size() > 1) {
resultList.sort(Comparator.comparing(KBObject::getUiLabel));
}
<<<<<<<
Binding label = bindings.getBinding(langVariable);
Binding description = bindings.getBinding(descVariable);
Binding subpropertyLabel = bindings.getBinding("spl");
=======
>>>>>>>
Binding label = bindings.getBinding(langVariable);
Binding description = bindings.getBinding(descVariable);
Binding subpropertyLabel = bindings.getBinding("spl");
<<<<<<<
else if (subpropertyLabel != null) {
handle.setName(subpropertyLabel.getValue().stringValue());
}
=======
else if (labelGeneral != null) {
handle.setName(labelGeneral.getValue().stringValue());
}
>>>>>>>
else if (labelGeneral != null) {
handle.setName(labelGeneral.getValue().stringValue());
}
<<<<<<<
mapping.getTypeIri(), mapping.getSubPropertyIri(), mapping.getDescriptionIri(),
mapping.getLabelIri(), mapping.getPropertyTypeIri(),
mapping.getPropertyLabelIri(), mapping.getPropertyDescriptionIri())) {
=======
mapping.getTypeIri(), mapping.getDescriptionIri(), mapping.getLabelIri(),
mapping.getPropertyTypeIri(), mapping.getPropertyLabelIri(),
mapping.getPropertyDescriptionIri())) {
>>>>>>>
mapping.getTypeIri(), mapping.getSubPropertyIri(), mapping.getDescriptionIri(), mapping.getLabelIri(),
mapping.getPropertyTypeIri(), mapping.getPropertyLabelIri(),
mapping.getPropertyDescriptionIri())) {
<<<<<<<
aKb.getTypeIri(), aKb.getSubPropertyIri(), aKb.getDescriptionIri(),
aKb.getLabelIri(), aKb.getPropertyTypeIri(), aKb.getPropertyLabelIri(),
aKb.getDescriptionIri())) {
=======
aKb.getTypeIri(), aKb.getDescriptionIri(), aKb.getLabelIri(),
aKb.getPropertyTypeIri(), aKb.getPropertyLabelIri(),
aKb.getPropertyDescriptionIri())) {
>>>>>>>
aKb.getTypeIri(), aKb.getSubPropertyIri(), aKb.getDescriptionIri(), aKb.getLabelIri(),
aKb.getPropertyTypeIri(), aKb.getPropertyLabelIri(),
aKb.getPropertyDescriptionIri())) {
<<<<<<<
private boolean equalsSchemaProfile(SchemaProfile aProfile, IRI aClassIri, IRI aSubclassIri,
IRI aTypeIri, IRI aSubPropertyIRI, IRI aDescriptionIri, IRI aLabelIri, IRI aPropertyTypeIri,
IRI aPropertyLabelIri, IRI aPropertyDescriptionIri)
{
return aProfile.getClassIri().equals(aClassIri)
&& aProfile.getSubclassIri().equals(aSubclassIri)
&& aProfile.getTypeIri().equals(aTypeIri)
&& aProfile.getSubPropertyIri().equals(aSubPropertyIRI)
&& aProfile.getDescriptionIri().equals(aDescriptionIri)
&& aProfile.getLabelIri().equals(aLabelIri)
&& aProfile.getPropertyTypeIri().equals(aPropertyTypeIri)
&& aProfile.getPropertyLabelIri().equals(aPropertyLabelIri)
&& aProfile.getPropertyDescriptionIri().equals(aPropertyDescriptionIri);
=======
private boolean equalsSchemaProfile(SchemaProfile profile, IRI classIri, IRI subclassIri,
IRI typeIri, IRI descriptionIri, IRI labelIri, IRI propertyTypeIri, IRI propertyLabelIri,
IRI propertyDescriptionIri)
{
return Objects.equals(profile.getClassIri(), classIri) &&
Objects.equals(profile.getSubclassIri(), subclassIri) &&
Objects.equals(profile.getTypeIri(), typeIri) &&
Objects.equals(profile.getDescriptionIri(), descriptionIri) &&
Objects.equals(profile.getLabelIri(), labelIri) &&
Objects.equals(profile.getPropertyTypeIri(), propertyTypeIri) &&
Objects.equals(profile.getPropertyLabelIri(), propertyLabelIri) &&
Objects.equals(profile.getPropertyDescriptionIri(), propertyDescriptionIri);
>>>>>>>
private boolean equalsSchemaProfile(SchemaProfile profile, IRI classIri, IRI subclassIri,
IRI typeIri, IRI subPropertyIRI, IRI descriptionIri, IRI labelIri, IRI propertyTypeIri, IRI propertyLabelIri,
IRI propertyDescriptionIri)
{
return Objects.equals(profile.getClassIri(), classIri) &&
Objects.equals(profile.getSubclassIri(), subclassIri) &&
Objects.equals(profile.getTypeIri(), typeIri) &&
Objects.equals(profile.getSubPropertyIri(), subPropertyIRI) &&
Objects.equals(profile.getDescriptionIri(), descriptionIri) &&
Objects.equals(profile.getLabelIri(), labelIri) &&
Objects.equals(profile.getPropertyTypeIri(), propertyTypeIri) &&
Objects.equals(profile.getPropertyLabelIri(), propertyLabelIri) &&
Objects.equals(profile.getPropertyDescriptionIri(), propertyDescriptionIri); |
<<<<<<<
=======
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.feedback.IFeedback;
>>>>>>>
import org.apache.wicket.feedback.IFeedback;
<<<<<<<
import org.wicketstuff.event.annotation.OnEvent;
=======
import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import org.wicketstuff.event.annotation.OnEvent;
import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; |
<<<<<<<
private Label noDocsLabel;
private Label finishedLabel;
=======
private final Label noDocsLabel;
private final Label finishedLabel;
>>>>>>>
private final Label noDocsLabel;
private final Label finishedLabel;
<<<<<<<
=======
// init. state with stored curation user
AnnotatorState state = aModel.getObject();
long projectid = state.getProject().getId();
String currentUsername = userRepository.getCurrentUsername();
User curationUser = curationService.retrieveCurationUser(currentUsername,
projectid);
User initUser = state.getUser();
state.setUser(curationUser);
// if curation user changed we have to reload the document
if (!initUser.equals(curationUser)) {
Optional<AjaxRequestTarget> target = RequestCycle.get().find(AjaxRequestTarget.class);
annoPage.actionLoadDocument(target.orElseGet(null));
}
>>>>>>>
// init. state with stored curation user
AnnotatorState state = aModel.getObject();
long projectid = state.getProject().getId();
String currentUsername = userRepository.getCurrentUsername();
User curationUser = curationService.retrieveCurationUser(currentUsername, projectid);
User initUser = state.getUser();
state.setUser(curationUser);
// if curation user changed we have to reload the document
if (!initUser.equals(curationUser)) {
Optional<AjaxRequestTarget> target = RequestCycle.get().find(AjaxRequestTarget.class);
annoPage.actionLoadDocument(target.orElseGet(null));
}
<<<<<<<
finishedLabel.add(visibleWhen(
() -> documentService.isAnnotationFinished(state.getDocument(), state.getUser())));
noDocsLabel.add(
visibleWhen(() -> !finishedLabel.isVisible() && users.getModelObject().isEmpty()));
=======
finishedLabel
.add(visibleWhen(() -> curationService.isCurationFinished(state, currentUsername)));
noDocsLabel.add(visibleWhen(() -> !finishedLabel.isVisible() &&
users.getModelObject().isEmpty()));
>>>>>>>
finishedLabel
.add(visibleWhen(() -> curationService.isCurationFinished(state, currentUsername)));
noDocsLabel.add(
visibleWhen(() -> !finishedLabel.isVisible() && users.getModelObject().isEmpty()));
<<<<<<<
// if curation user changed we have to reload the document
long projectid = state.getProject().getId();
String currentUsername = userRepository.getCurrentUsername();
User curationUser = curationService.retrieveCurationUser(currentUsername, projectid);
if (currentUsername != null && !currentUsername.equals(curationUser.getUsername())) {
state.setUser(curationUser);
Optional<AjaxRequestTarget> target = RequestCycle.get().find(AjaxRequestTarget.class);
annoPage.actionLoadDocument(target.orElseGet(null));
}
=======
// add toggle for settings
mainContainer.add(new AjaxLink<Void>("toggleOptionsVisibility")
{
private static final long serialVersionUID = -5535838955781542216L;
@Override
public void onClick(AjaxRequestTarget aTarget)
{
settingsForm.setVisible(!settingsForm.isVisible());
aTarget.add(mainContainer);
}
});
>>>>>>>
// add toggle for settings
mainContainer.add(new AjaxLink<Void>("toggleOptionsVisibility")
{
private static final long serialVersionUID = -5535838955781542216L;
@Override
public void onClick(AjaxRequestTarget aTarget)
{
settingsForm.setVisible(!settingsForm.isVisible());
aTarget.add(mainContainer);
}
});
<<<<<<<
String username = state.getUser().getUsername();
add(enabledWhen(() -> (username.equals(currentUsername) || username.equals(CURATION_USER))
&& !documentService.isAnnotationFinished(state.getDocument(), state.getUser())));
=======
usersForm.add(enabledWhen(() -> !finishedLabel.isVisible()));
>>>>>>>
usersForm.add(enabledWhen(() -> !finishedLabel.isVisible()));
<<<<<<<
// toggle visibility of settings form
usersForm.add(new AjaxButton("toggleOptionsVisibility")
{
private static final long serialVersionUID = -5535838955781542216L;
@Override
protected void onSubmit(AjaxRequestTarget aTarget)
{
settingsForm.setVisible(!settingsForm.isVisible());
aTarget.add(mainContainer);
}
});
=======
>>>>>>>
<<<<<<<
return curationService
.listFinishedUsers(getModelObject().getProject(), getModelObject().getDocument())
.stream().filter(user -> !user.equals(currentUser)).collect(Collectors.toList());
=======
String curatorName = getModelObject().getUser().getUsername();
return curationService.listFinishedUsers(getModelObject().getProject(),
getModelObject().getDocument()).stream()
.filter(user -> !user.equals(currentUser) || curatorName.equals(CURATION_USER))
.collect(Collectors.toList());
>>>>>>>
String curatorName = getModelObject().getUser().getUsername();
return curationService
.listFinishedUsers(getModelObject().getProject(), getModelObject().getDocument())
.stream()
.filter(user -> !user.equals(currentUser) || curatorName.equals(CURATION_USER))
.collect(Collectors.toList()); |
<<<<<<<
public static final String ANY_OBJECT = "<ANY>";
public static final String TYPE_ANY_OBJECT = PREFIX + ANY_OBJECT;
=======
public static final String ANY_CONCEPT = "<ANY>";
public static final String TYPE_ANY_CONCEPT = PREFIX + ANY_CONCEPT;
private static final Logger LOG = LoggerFactory.getLogger(ConceptFeatureSupport.class);
>>>>>>>
public static final String ANY_OBJECT = "<ANY>";
public static final String TYPE_ANY_OBJECT = PREFIX + ANY_OBJECT;
private static final Logger LOG = LoggerFactory.getLogger(ConceptFeatureSupport.class);
<<<<<<<
// FIXME Since this might be called very often during rendering, it *might* be
// worth to set up an LRU cache instead of relying on the performance of the
// underlying KB store.
if (aLabel != null) {
ConceptFeatureTraits t = readTraits(aFeature);
// Use the kbobject from a particular knowledge base
Optional<KBObject> kbObject;
if (t.getRepositoryId() != null) {
kbObject = kbService
.getKnowledgeBaseById(aFeature.getProject(), t.getRepositoryId())
.flatMap(kb -> kbService.readKBIdentifier(kb, aLabel));
}
// Use the kbobject from any knowledge base (leave KB unselected)
else {
kbObject = kbService.readKBIdentifier(aFeature.getProject(), aLabel);
}
renderValue = kbObject.map(KBObject::getUiLabel)
.orElseThrow(NoSuchElementException::new);
=======
// Use the concept from any knowledge base (leave KB unselected)
else {
instance = kbService.readInstance(aKey.getAnnotationFeature().getProject(),
aKey.getLabel());
>>>>>>>
// Use the concept from any knowledge base (leave KB unselected)
else {
instance = kbService.readInstance(aKey.getAnnotationFeature().getProject(),
aKey.getLabel()); |
<<<<<<<
, optionalLanguageFilteredValue("?pLABEL", aKB.getDefaultLanguage(),"?l")
, optionalLanguageFilteredValue("?pDESCRIPTION", aKB.getDefaultLanguage(),"?d")
, "} "
, "LIMIT " + aKB.getMaxResults());
=======
, optionalLanguageFilteredValue("?pLABEL", aKB.getDefaultLanguage(),"?label")
, optionalLanguageFilteredValue("?pDESCRIPTION", aKB.getDefaultLanguage(),"?desc")
, "} GROUP BY ?s"
, "LIMIT " + LIMIT);
>>>>>>>
, optionalLanguageFilteredValue("?pLABEL", aKB.getDefaultLanguage(),"?label")
, optionalLanguageFilteredValue("?pDESCRIPTION", aKB.getDefaultLanguage(),"?desc")
, "} GROUP BY ?s"
, "LIMIT " + aKB.getMaxResults());
<<<<<<<
, optionalLanguageFilteredValue("?pLABEL", aKB.getDefaultLanguage(),"?l")
, optionalLanguageFilteredValue("?pDESCRIPTION", aKB.getDefaultLanguage(),"?d")
, "}"
, "LIMIT " + aKB.getMaxResults());
=======
, optionalLanguageFilteredValue("?pLABEL", aKB.getDefaultLanguage(),"?label")
, optionalLanguageFilteredValue("?pDESCRIPTION", aKB.getDefaultLanguage(),"?desc")
, "} GROUP BY ?s"
, "LIMIT " + LIMIT);
>>>>>>>
, optionalLanguageFilteredValue("?pLABEL", aKB.getDefaultLanguage(),"?label")
, optionalLanguageFilteredValue("?pDESCRIPTION", aKB.getDefaultLanguage(),"?desc")
, "} GROUP BY ?s"
, "LIMIT " + aKB.getMaxResults()); |
<<<<<<<
// // If we added the input term as the first result and by freak accident
// // it is even returned as a result, then skip it.
// .filter(t -> !(inputAsFirstResult && t.getName().equals(aTerm)))
.skip(aPage * 10).limit(11).map(Tag::getName).collect(Collectors.toList());
=======
// // If we added the input term as the first result and by freak accident
// // it is even returned as a result, then skip it.
// .filter(t -> !(inputAsFirstResult && t.getName().equals(aTerm)))
.skip(aPage * 10)
.limit(11)
.map(ReorderableTag::getName)
.collect(Collectors.toList());
>>>>>>>
// // If we added the input term as the first result and by freak accident
// // it is even returned as a result, then skip it.
// .filter(t -> !(inputAsFirstResult && t.getName().equals(aTerm)))
.skip(aPage * 10) //
.limit(11) //
.map(ReorderableTag::getName) //
.collect(Collectors.toList()); |
<<<<<<<
/**
* Gets a list of sub-property of label
*
* @param aKB
* a knowledge base.
* @return set of properties
*/
Set<KBHandle> getSubPropertyLabels(KnowledgeBase aKB);
=======
/**
* List all Instances of a given knowledge base
* @param aKB the knowledge base
* @param aAll indicates whether to include everything
* @return list of all the instances {@link KBHandle}
*/
List<KBHandle> listAllInstances(KnowledgeBase aKB, boolean aAll);
/**
* List all the concepts/instances in a given scope. The scope is given in form of a knowledge
* base id and a concept id. Null can be passed as a wildcard. If the the given
* knowledge base id or concept id can not be found the method will return an empty list.
*
* @param aRepositoryId the id of the knowledge base that is searched in
* @param aConceptScope the id of a concept that defines a scope
* @param aValueType whether only concepts/instances or both should be returned
* @param project the corresponding project
* @return a list of all entities within the given scope
*/
List<KBHandle> getEntitiesInScope(String aRepositoryId, String aConceptScope,
ConceptFeatureValueType aValueType, Project project);
>>>>>>>
* List all Instances of a given knowledge base
* @param aKB the knowledge base
* @param aAll indicates whether to include everything
* @return list of all the instances {@link KBHandle}
*/
List<KBHandle> listAllInstances(KnowledgeBase aKB, boolean aAll);
/**
* List all the concepts/instances in a given scope. The scope is given in form of a knowledge
* base id and a concept id. Null can be passed as a wildcard. If the the given
* knowledge base id or concept id can not be found the method will return an empty list.
*
* @param aRepositoryId the id of the knowledge base that is searched in
* @param aConceptScope the id of a concept that defines a scope
* @param aValueType whether only concepts/instances or both should be returned
* @param project the corresponding project
* @return a list of all entities within the given scope
*/
List<KBHandle> getEntitiesInScope(String aRepositoryId, String aConceptScope,
ConceptFeatureValueType aValueType, Project project);
/**
* Gets a list of sub-property of label
*
* @param aKB
* a knowledge base.
* @return set of properties
*/
Set<KBHandle> getSubPropertyLabels(KnowledgeBase aKB); |
<<<<<<<
corefLayer.setOverlapMode(ANY_OVERLAP);
sut.addSpan(document, username, jcas, 0, 1);
=======
sut.addSpan(document, username, jcas.getCas(), 0, 1);
>>>>>>>
corefLayer.setOverlapMode(ANY_OVERLAP);
sut.addSpan(document, username, jcas.getCas(), 0, 1);
<<<<<<<
.isThrownBy(() -> sut.addSpan(document, username, jcas, 0, 1))
.withMessageContaining("no overlap or stacking");
corefLayer.setOverlapMode(OVERLAP_ONLY);
assertThatExceptionOfType(AnnotationException.class)
.isThrownBy(() -> sut.addSpan(document, username, jcas, 0, 1))
.withMessageContaining("stacking is not allowed");
// Adding another annotation at the same place DOES work
corefLayer.setOverlapMode(STACKING_ONLY);
assertThatCode(() -> sut.addSpan(document, username, jcas, 0, 1))
.doesNotThrowAnyException();
corefLayer.setOverlapMode(ANY_OVERLAP);
assertThatCode(() -> sut.addSpan(document, username, jcas, 0, 1))
.doesNotThrowAnyException();
=======
.isThrownBy(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("stacking is not enabled");
>>>>>>>
.isThrownBy(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("no overlap or stacking");
corefLayer.setOverlapMode(OVERLAP_ONLY);
assertThatExceptionOfType(AnnotationException.class)
.isThrownBy(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("stacking is not allowed");
// Adding another annotation at the same place DOES work
corefLayer.setOverlapMode(STACKING_ONLY);
assertThatCode(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.doesNotThrowAnyException();
corefLayer.setOverlapMode(ANY_OVERLAP);
assertThatCode(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.doesNotThrowAnyException();
<<<<<<<
corefLayer.setOverlapMode(ANY_OVERLAP);
sut.addSpan(document, username, jcas, 0, 4);
=======
sut.addSpan(document, username, jcas.getCas(), 0, 4);
>>>>>>>
corefLayer.setOverlapMode(ANY_OVERLAP);
sut.addSpan(document, username, jcas.getCas(), 0, 4);
<<<<<<<
.isThrownBy(() -> sut.addSpan(document, username, jcas, 0, 1))
.withMessageContaining("no overlap or stacking");
corefLayer.setOverlapMode(OVERLAP_ONLY);
assertThatExceptionOfType(AnnotationException.class)
.isThrownBy(() -> sut.addSpan(document, username, jcas, 0, 1))
.withMessageContaining("stacking is not allowed");
// Adding another annotation at the same place DOES work
// Here we annotate "T" but it should be expanded to "This"
corefLayer.setOverlapMode(STACKING_ONLY);
assertThatCode(() -> sut.addSpan(document, username, jcas, 0, 1))
.doesNotThrowAnyException();
corefLayer.setOverlapMode(ANY_OVERLAP);
assertThatCode(() -> sut.addSpan(document, username, jcas, 0, 1))
.doesNotThrowAnyException(); }
=======
.isThrownBy(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("stacking is not enabled");
}
>>>>>>>
.isThrownBy(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("no overlap or stacking");
corefLayer.setOverlapMode(OVERLAP_ONLY);
assertThatExceptionOfType(AnnotationException.class)
.isThrownBy(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("stacking is not allowed");
// Adding another annotation at the same place DOES work
// Here we annotate "T" but it should be expanded to "This"
corefLayer.setOverlapMode(STACKING_ONLY);
assertThatCode(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.doesNotThrowAnyException();
corefLayer.setOverlapMode(ANY_OVERLAP);
assertThatCode(() -> sut.addSpan(document, username, jcas.getCas(), 0, 1))
.doesNotThrowAnyException();
} |
<<<<<<<
List<KBHandle> listProperties(KnowledgeBase kb, IRI aType, boolean aIncludeInferred, boolean
aAll);
=======
>>>>>>>
List<KBHandle> listProperties(KnowledgeBase kb, IRI aType, boolean aIncludeInferred, boolean
aAll); |
<<<<<<<
void render(CAS aCas, AnnotatorState aState, VDocument vdoc);
=======
void render(JCas jCas, AnnotatorState aState, VDocument vdoc,
int aWindowBeginOffset, int aWindowEndOffset);
>>>>>>>
void render(CAS aCas, AnnotatorState aState, VDocument vdoc, int aWindowBeginOffset,
int aWindowEndOffset); |
<<<<<<<
SuggestionDocumentGroup groups = model.getPredictions(
DocumentMetaData.get(aJcas).getDocumentTitle(), layer, aWindowBeginOffset,
aWindowEndOffset);
=======
SuggestionDocumentGroup groups = model.getPredictions(getDocumentTitle(aCas), layer,
windowBegin, windowEnd);
>>>>>>>
SuggestionDocumentGroup groups = model.getPredictions(getDocumentTitle(aCas), layer,
aWindowBeginOffset, aWindowEndOffset);
<<<<<<<
aJcas.getCas(), aState.getUser().getUsername(), layer, groups, aWindowBeginOffset,
aWindowEndOffset);
=======
aCas, aState.getUser().getUsername(), layer, groups, windowBegin,
windowEnd);
>>>>>>>
aCas, aState.getUser().getUsername(), layer, groups, aWindowBeginOffset,
aWindowEndOffset); |
<<<<<<<
List<KBHandle> rootConcepts = sut.listRootConcepts(kb, false);
assertThat(rootConcepts).as("Check that root concepts have been found").hasSize(kb.getMaxResults());
=======
Stream<String> rootConcepts = sut.listRootConcepts(kb, false).stream().map(KBHandle::getIdentifier);
String expectedInstances = "http://www.wikidata.org/entity/Q35120";
assertThat(rootConcepts).as("Check that root concepts have been found").contains(expectedInstances);
>>>>>>>
Stream<String> rootConcepts = sut.listRootConcepts(kb, false).stream().map(KBHandle::getIdentifier);
String expectedInstances = "http://www.wikidata.org/entity/Q35120";
assertThat(rootConcepts).as("Check that root concepts have been found").contains(expectedInstances);
<<<<<<<
kb_wikidata_direct.setMaxResults(1000);
=======
>>>>>>>
kb_wikidata_direct.setMaxResults(1000); |
<<<<<<<
private static final String NO_LABEL = "no_label";
=======
private static final String UNKNOWN_LABEL = "unknown";
>>>>>>>
private static final String NO_LABEL = "no_label";
private static final String UNKNOWN_LABEL = "unknown"; |
<<<<<<<
void fireRender(CAS aCas, AnnotatorState aModelObject, VDocument aVdoc);
=======
void fireRender(JCas aJCas, AnnotatorState aModelObject, VDocument aVdoc,
int aWindowBeginOffset, int aWindowEndOffset);
>>>>>>>
void fireRender(CAS aCas, AnnotatorState aModelObject, VDocument aVdoc,
int aWindowBeginOffset, int aWindowEndOffset); |
<<<<<<<
private List<KBHandle> evaluateListQuery(TupleQuery tupleQuery, boolean aAll)
=======
/**
* Method process the Tuple Query Results
*
* @param tupleQuery Tuple Query Variable
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @param itemVariable The variable to define the item IRI (eg.'s')
* @param langVariable The variable to define the item IRI (In general: 'l')
* @param descVariable The variable to define the item IRI (In general: 'd')
* @return list of all the {@link KBHandle}
* @throws QueryEvaluationException
*/
private List<KBHandle> evaluateListQuery(TupleQuery tupleQuery, boolean aAll,
String itemVariable, String langVariable, String descVariable)
>>>>>>>
/**
* Method process the Tuple Query Results
*
* @param tupleQuery Tuple Query Variable
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @param itemVariable The variable to define the item IRI (eg.'s')
* @param langVariable The variable to define the item IRI (In general: 'l')
* @param descVariable The variable to define the item IRI (In general: 'd')
* @return list of all the {@link KBHandle}
* @throws QueryEvaluationException
*/
private List<KBHandle> evaluateListQuery(TupleQuery tupleQuery, boolean aAll,
String itemVariable, String langVariable, String descVariable)
<<<<<<<
String id = bindings.getBinding("s").getValue().stringValue();
Binding label = bindings.getBinding("l");
Binding description = bindings.getBinding("d");
Binding subpropertyLabel = bindings.getBinding("spl");
=======
String id = bindings.getBinding(itemVariable).getValue().stringValue();
Binding label = bindings.getBinding(langVariable);
Binding description = bindings.getBinding(descVariable);
>>>>>>>
String id = bindings.getBinding(itemVariable).getValue().stringValue();
Binding label = bindings.getBinding(langVariable);
Binding description = bindings.getBinding(descVariable);
Binding subpropertyLabel = bindings.getBinding("spl"); |
<<<<<<<
List<KBHandle> resultList = new ArrayList<>();
if (!kb.getExplicitlyDefinedRootConcepts().isEmpty()) {
for (IRI conceptIRI : kb.getExplicitlyDefinedRootConcepts()) {
KBConcept concept = readConcept(kb, conceptIRI.stringValue()).get();
KBHandle conceptHandle = new KBHandle(concept.getIdentifier(), concept.getName(),
concept.getDescription());
resultList.add(conceptHandle);
}
}
else {
resultList = read(kb, (conn) -> {
String QUERY = String.join("\n"
, "SELECT DISTINCT ?s ?l WHERE { "
, " ?s ?pTYPE ?oCLASS . "
, "FILTER NOT EXISTS { "
, " ?s ?pSUBCLASS ?otherSub . "
, "} OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} "
, "LIMIT 10000");
TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, QUERY);
tupleQuery.setBinding("pTYPE", kb.getTypeIri());
tupleQuery.setBinding("oCLASS", kb.getClassIri());
tupleQuery.setBinding("pSUBCLASS", kb.getSubclassIri());
tupleQuery.setBinding("pLABEL", kb.getLabelIri());
tupleQuery.setIncludeInferred(false);
return evaluateListQuery(tupleQuery, aAll);
});
}
=======
List<KBHandle> resultList = read(kb, (conn) -> {
String QUERY = String.join("\n"
, "SELECT DISTINCT ?s ?l WHERE { "
, " { ?s ?pTYPE ?oCLASS . } "
, " UNION { ?someSubClass ?pSUBCLASS ?s . } ."
, " FILTER NOT EXISTS { "
, " ?s ?pSUBCLASS ?otherSub . "
, " FILTER (?s != ?otherSub) }"
, " FILTER NOT EXISTS { "
, " ?s owl:intersectionOf ?list . }"
, " OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} "
, "LIMIT 10000" );
TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, QUERY);
tupleQuery.setBinding("pTYPE", kb.getTypeIri());
tupleQuery.setBinding("oCLASS", kb.getClassIri());
tupleQuery.setBinding("pSUBCLASS", kb.getSubclassIri());
tupleQuery.setBinding("pLABEL", kb.getLabelIri());
tupleQuery.setIncludeInferred(false);
return evaluateListQuery(tupleQuery, aAll);
});
>>>>>>>
List<KBHandle> resultList = new ArrayList<>();
if (!kb.getExplicitlyDefinedRootConcepts().isEmpty()) {
for (IRI conceptIRI : kb.getExplicitlyDefinedRootConcepts()) {
KBConcept concept = readConcept(kb, conceptIRI.stringValue()).get();
KBHandle conceptHandle = new KBHandle(concept.getIdentifier(), concept.getName(),
concept.getDescription());
resultList.add(conceptHandle);
}
}
else {
resultList = read(kb, (conn) -> {
String QUERY = String.join("\n"
, "SELECT DISTINCT ?s ?l WHERE { "
, " { ?s ?pTYPE ?oCLASS . } "
, " UNION { ?someSubClass ?pSUBCLASS ?s . } ."
, " FILTER NOT EXISTS { "
, " ?s ?pSUBCLASS ?otherSub . "
, " FILTER (?s != ?otherSub) }"
, " FILTER NOT EXISTS { "
, " ?s owl:intersectionOf ?list . }"
, " OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} "
, "LIMIT 10000" );
TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, QUERY);
tupleQuery.setBinding("pTYPE", kb.getTypeIri());
tupleQuery.setBinding("oCLASS", kb.getClassIri());
tupleQuery.setBinding("pSUBCLASS", kb.getSubclassIri());
tupleQuery.setBinding("pLABEL", kb.getLabelIri());
tupleQuery.setIncludeInferred(false);
return evaluateListQuery(tupleQuery, aAll);
});
} |
<<<<<<<
=======
private AutoCompleteTextField<KBHandle> createSelectPropertyAutoCompleteTextField()
{
AutoCompleteTextField<KBHandle> field = new AutoCompleteTextField<KBHandle>("newRole",
new PropertyModel<KBHandle>(this, "selectedRole"),
new TextRenderer<KBHandle>("uiLabel"), KBHandle.class)
{
private static final long serialVersionUID = 1458626823154651501L;
@Override protected List<KBHandle> getChoices(String input)
{
return factService.getAllPredicatesFromKB(project);
}
@Override public void onConfigure(JQueryBehavior behavior)
{
super.onConfigure(behavior);
behavior.setOption("autoWidth", true);
}
@Override
protected IJQueryTemplate newTemplate()
{
return KendoChoiceDescriptionScriptReference.template();
}
};
// Ensure that markup IDs of feature editor focus components remain constant across
// refreshes of the feature editor panel. This is required to restore the focus.
field.setOutputMarkupId(true);
field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
return field;
}
>>>>>>> |
<<<<<<<
=======
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
>>>>>>>
import org.apache.wicket.model.Model;
<<<<<<<
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
=======
import org.eclipse.rdf4j.model.vocabulary.OWL;
import org.eclipse.rdf4j.model.vocabulary.RDF;
import org.eclipse.rdf4j.model.vocabulary.RDFS;
>>>>>>>
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.model.vocabulary.OWL;
import org.eclipse.rdf4j.model.vocabulary.RDF;
import org.eclipse.rdf4j.model.vocabulary.RDFS;
<<<<<<<
private final CompoundPropertyModel<KnowledgeBaseWrapper> wizardDataModel;
=======
private final CompoundPropertyModel<EnrichedKnowledgeBase> wizardDataModel;
private final IModel<IriSchemaType> selectedIriSchema;
>>>>>>>
private final CompoundPropertyModel<KnowledgeBaseWrapper> wizardDataModel;
private final IModel<IriSchemaType> selectedIriSchema;
<<<<<<<
add(buildComboBox("classIri", model.bind("kb.classIri"), IriConstants.CLASS_IRIS));
add(buildComboBox("subclassIri", model.bind("kb.subclassIri"),
IriConstants.SUBCLASS_IRIS));
add(buildComboBox("typeIri", model.bind("kb.typeIri"), IriConstants.TYPE_IRIS));
=======
// RadioGroup to select the IriSchemaType
BootstrapRadioGroup<IriSchemaType> iriSchemaChoice = new BootstrapRadioGroup<>(
"iriSchema", selectedIriSchema, Arrays.asList(IriSchemaType.values()),
new EnumRadioChoiceRenderer<>(Buttons.Type.Default, this));
iriSchemaChoice.setOutputMarkupId(true);
// Add text fields for classIri, subclassIri and typeIri
ComboBox<String> classField = buildComboBox("classIri", model, IriConstants.CLASS_IRIS);
add(classField);
ComboBox<String> subclassField = buildComboBox("subclassIri", model,
IriConstants.SUBCLASS_IRIS);
add(subclassField);
ComboBox<String> typeField = buildComboBox("typeIri", model, IriConstants.TYPE_IRIS);
add(typeField);
// OnChange update the model with corresponding iris
iriSchemaChoice.setChangeHandler(new ISelectionChangeHandler<IriSchemaType>()
{
private static final long serialVersionUID = 1653808650286121732L;
@Override
public void onSelectionChanged(AjaxRequestTarget target, IriSchemaType bean)
{
classField.setModelObject(bean.getClassIriString());
subclassField.setModelObject(bean.getSubclassIriString());
typeField.setModelObject(bean.getTypeIriString());
// For some reason it does not work if just the checkboxes
// are added to the target
target.addChildren(getPage(), KnowledgeBaseCreationWizard.class);
}
});
add(iriSchemaChoice);
>>>>>>>
// RadioGroup to select the IriSchemaType
BootstrapRadioGroup<IriSchemaType> iriSchemaChoice = new BootstrapRadioGroup<>(
"iriSchema", selectedIriSchema, Arrays.asList(IriSchemaType.values()),
new EnumRadioChoiceRenderer<>(Buttons.Type.Default, this));
iriSchemaChoice.setOutputMarkupId(true);
// Add text fields for classIri, subclassIri and typeIri
ComboBox<String> classField = buildComboBox("classIri", model.bind("kb.classIri"), IriConstants.CLASS_IRIS);
add(classField);
ComboBox<String> subclassField = buildComboBox("subclassIri", model.bind("kb.subclassIri"),
IriConstants.SUBCLASS_IRIS);
add(subclassField);
ComboBox<String> typeField = buildComboBox("typeIri", model.bind("kb.typeIri"), IriConstants.TYPE_IRIS);
add(typeField);
// OnChange update the model with corresponding iris
iriSchemaChoice.setChangeHandler(new ISelectionChangeHandler<IriSchemaType>()
{
private static final long serialVersionUID = 1653808650286121732L;
@Override
public void onSelectionChanged(AjaxRequestTarget target, IriSchemaType bean)
{
classField.setModelObject(bean.getClassIriString());
subclassField.setModelObject(bean.getSubclassIriString());
typeField.setModelObject(bean.getTypeIriString());
// For some reason it does not work if just the checkboxes
// are added to the target
target.addChildren(getPage(), KnowledgeBaseCreationWizard.class);
}
});
add(iriSchemaChoice);
<<<<<<<
private ComboBox<String> buildComboBox(String name, IModel<IRI> model, List<IRI> iris)
{
model.setObject(iris.get(0));
List<String> choices = iris.stream().map(IRI::stringValue).collect(Collectors.toList());
IModel<String> adapter = new LambdaModelAdapter<String>(
() -> model.getObject().stringValue(),
str -> model.setObject(SimpleValueFactory.getInstance().createIRI(str)));
ComboBox<String> comboBox = new ComboBox<String>(name, adapter, choices);
=======
private static final long serialVersionUID = 1575770301215073872L;
@Override
protected void onConfigure()
{
super.onConfigure();
setEnabled(IriSchemaType.CUSTOMSCHEMA.equals(selectedIriSchema.getObject()));
}
};
comboBox.setOutputMarkupId(true);
>>>>>>>
private static final long serialVersionUID = 1575770301215073872L;
@Override
protected void onConfigure()
{
super.onConfigure();
setEnabled(IriSchemaType.CUSTOMSCHEMA.equals(selectedIriSchema.getObject()));
}
};
comboBox.setOutputMarkupId(true);
<<<<<<<
comboBox.add(Validators.IRI_VALIDATOR);
=======
comboBox.add(EnrichedKnowledgeBaseUtils.URL_VALIDATOR);
comboBox.add(new LambdaAjaxFormComponentUpdatingBehavior("change", t -> {
// Do nothing just update the model values
}));
>>>>>>>
comboBox.add(Validators.IRI_VALIDATOR);
comboBox.add(new LambdaAjaxFormComponentUpdatingBehavior("change", t -> {
// Do nothing just update the model values
}));
<<<<<<<
{
KnowledgeBaseWrapper ekb = wizardDataModel.getObject();
=======
{
EnrichedKnowledgeBase ekb = wizardDataModel.getObject();
>>>>>>>
{
KnowledgeBaseWrapper ekb = wizardDataModel.getObject(); |
<<<<<<<
import org.apache.wicket.markup.html.form.DropDownChoice;
=======
import org.apache.wicket.markup.html.form.CheckBox;
>>>>>>>
import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.form.DropDownChoice; |
<<<<<<<
import de.tudarmstadt.ukp.inception.recommendation.imls.core.classificationtool.ClassificationTool;
import de.tudarmstadt.ukp.inception.recommendation.imls.core.classifier.Classifier;
import de.tudarmstadt.ukp.inception.recommendation.imls.core.dataobjects.AnnotationObject;
import de.tudarmstadt.ukp.inception.recommendation.model.Predictions;
import de.tudarmstadt.ukp.inception.recommendation.model.Recommender;
import de.tudarmstadt.ukp.inception.recommendation.service.RecommendationService;
=======
import de.tudarmstadt.ukp.inception.recommendation.api.ClassificationTool;
import de.tudarmstadt.ukp.inception.recommendation.api.Classifier;
import de.tudarmstadt.ukp.inception.recommendation.api.RecommendationService;
import de.tudarmstadt.ukp.inception.recommendation.api.model.AnnotationObject;
import de.tudarmstadt.ukp.inception.recommendation.api.model.Predictions;
import de.tudarmstadt.ukp.inception.recommendation.api.model.Recommender;
import de.tudarmstadt.ukp.inception.recommendation.api.model.TokenObject;
import de.tudarmstadt.ukp.inception.recommendation.imls.util.CasUtil;
>>>>>>>
import de.tudarmstadt.ukp.inception.recommendation.api.ClassificationTool;
import de.tudarmstadt.ukp.inception.recommendation.api.Classifier;
import de.tudarmstadt.ukp.inception.recommendation.api.RecommendationService;
import de.tudarmstadt.ukp.inception.recommendation.api.model.AnnotationObject;
import de.tudarmstadt.ukp.inception.recommendation.api.model.Predictions;
import de.tudarmstadt.ukp.inception.recommendation.api.model.Recommender; |
<<<<<<<
public static TupleQuery generateCandidateQuery(RepositoryConnection conn, String tokens,
int limit)
=======
public static TupleQuery generateCandidateQuery(RepositoryConnection conn, List<String>
tokens, int limit, IRI aDescriptionIri)
>>>>>>>
public static TupleQuery generateCandidateQuery(RepositoryConnection conn, String tokens,
int limit, IRI aDescriptionIri) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.