conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
logger.debug("pod-template-hash: {}", podTemplateHash);
return K8SRuntimeConstants.K8S_DEPLOYMENT_POD_TEMPLATE_HASH + "=" + podTemplateHash;
=======
LOGGER.debug("pod-template-hash: {}", podTemplateHash);
return K8SRuntimeConstants.K8s_DEPLOYMENT_POD_TEMPLATE_HASH + "=" + podTemplateHash;
>>>>>>>
LOGGER.debug("pod-template-hash: {}", podTemplateHash);
return K8SRuntimeConstants.K8S_DEPLOYMENT_POD_TEMPLATE_HASH + "=" + podTemplateHash; |
<<<<<<<
@Autowired
private RotateVoteStatsDao rotateVoteStatsDao;
=======
@Autowired
private FeedService feedService;
>>>>>>>
@Autowired
private RotateVoteStatsDao rotateVoteStatsDao;
@Autowired
private FeedService feedService; |
<<<<<<<
objMngr.registerObject( new PathDesired() );
objMngr.registerObject( new PathPlannerSettings() );
=======
objMngr.registerObject( new PathAction() );
>>>>>>>
objMngr.registerObject( new PathAction() );
objMngr.registerObject( new PathDesired() );
objMngr.registerObject( new PathPlannerSettings() ); |
<<<<<<<
import de.erethon.commons.command.DRECommand;
import de.erethon.commons.config.CommonMessage;
=======
import de.erethon.dungeonsxl.DungeonsXL;
>>>>>>>
import de.erethon.commons.config.CommonMessage;
import de.erethon.dungeonsxl.DungeonsXL;
<<<<<<<
public class LivesCommand extends DRECommand {de.erethon.dungeonsxl.player.DPlayerCache dPlayers = de.erethon.dungeonsxl.DungeonsXL.getInstance().getDPlayers();// 0.17
=======
public class LivesCommand extends DCommand {
>>>>>>>
public class LivesCommand extends DCommand { |
<<<<<<<
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
=======
import org.json.JSONObject;
>>>>>>>
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
import org.json.JSONObject; |
<<<<<<<
List<TaskQueueLock> lockSharedAgentTasks(int count, String agentId, int lockSeconds, long maxSleepMillis);
=======
List<TaskRequest> lockSharedTasks(int limit, String agentId, int lockSeconds, long maxWaitMillis);
default void interruptLocalWait()
{ }
>>>>>>>
List<TaskQueueLock> lockSharedAgentTasks(int count, String agentId, int lockSeconds, long maxSleepMillis);
default void interruptLocalWait()
{ } |
<<<<<<<
import io.digdag.spi.TaskQueueClient;
=======
>>>>>>>
<<<<<<<
private final AgentConfig config;
private final AgentId agentId;
private final TaskServerApi taskServer;
private final OperatorManager operatorManager;
private final ExecutorService executor;
=======
private final Supplier<MultiThreadAgent> agentFactory;
private Thread thread;
private MultiThreadAgent agent;
>>>>>>>
private final Supplier<MultiThreadAgent> agentFactory;
private Thread thread;
private MultiThreadAgent agent;
<<<<<<<
this.config = config;
this.agentId = agentId;
this.taskServer = taskServer;
this.operatorManager = operatorManager;
=======
>>>>>>>
<<<<<<<
if (executor != null) {
executor.submit(
new LocalAgent(
config,
agentId,
taskServer,
operatorManager
)
);
=======
if (agentFactory != null) {
agent = agentFactory.get();
Thread thread = new ThreadFactoryBuilder()
.setDaemon(true)
.setNameFormat("local-agent-%d")
.build()
.newThread(agent);
thread.start();
this.thread = thread;
}
}
@PreDestroy
public void shutdown()
throws InterruptedException
{
if (thread != null) {
agent.shutdown();
thread.join();
>>>>>>>
if (agentFactory != null) {
agent = agentFactory.get();
Thread thread = new ThreadFactoryBuilder()
.setDaemon(true)
.setNameFormat("local-agent-%d")
.build()
.newThread(agent);
thread.start();
this.thread = thread;
}
}
@PreDestroy
public void shutdown()
throws InterruptedException
{
if (thread != null) {
agent.shutdown();
thread.join(); |
<<<<<<<
private AbstractFacet flushEntry(final UpdateInfo updateInfo, final String username, final Message message, Class type) throws Exception {
final String emailId = message.getHeader("Message-ID")[0] + message.getHeader("X-smssync-id")[0];
=======
private void flushEntry(final UpdateInfo updateInfo, final String username, final Message message, Class type) throws Exception{
final String messageId;
final String smsBackupId;
final String smsBackupAddress;
if (message.getHeader("Message-ID") != null){
messageId = message.getHeader("Message-ID")[0];
}
else if (message.getHeader("X-smssync-date") != null){
messageId = message.getHeader("X-smssync-date")[0];
}
else{
messageId = message.getHeader("X-backup2gmail-sms-date")[0];
}
if (message.getHeader("X-smssync-id") != null){
smsBackupId = message.getHeader("X-smssync-id")[0];
}
else{
smsBackupId = message.getHeader("X-backup2gmail-sms-id")[0];
}
if (message.getHeader("X-smssync-address") != null){
smsBackupAddress = message.getHeader("X-smssync-address")[0];
}
else{
smsBackupAddress = message.getHeader("X-backup2gmail-sms-address")[0];
}
final String emailId = messageId + smsBackupId;
>>>>>>>
private AbstractFacet flushEntry(final UpdateInfo updateInfo, final String username, final Message message, Class type) throws Exception{
final String messageId;
final String smsBackupId;
final String smsBackupAddress;
if (message.getHeader("Message-ID") != null){
messageId = message.getHeader("Message-ID")[0];
}
else if (message.getHeader("X-smssync-date") != null){
messageId = message.getHeader("X-smssync-date")[0];
}
else{
messageId = message.getHeader("X-backup2gmail-sms-date")[0];
}
if (message.getHeader("X-smssync-id") != null){
smsBackupId = message.getHeader("X-smssync-id")[0];
}
else{
smsBackupId = message.getHeader("X-backup2gmail-sms-id")[0];
}
if (message.getHeader("X-smssync-address") != null){
smsBackupAddress = message.getHeader("X-smssync-address")[0];
}
else{
smsBackupAddress = message.getHeader("X-backup2gmail-sms-address")[0];
}
final String emailId = messageId + smsBackupId; |
<<<<<<<
public String json;
public String getDate() {
return date;
}
public long getLastSync() {
return lastSync;
}
public String getJson() {
return json;
}
public void setDate(final String date) {
this.date = date;
}
public void setLastSync(final long lastSync) {
this.lastSync = lastSync;
}
public void setJson(final String json) {
this.json = json;
}
=======
public String json;
>>>>>>>
public String Json;
public String getDate() {
return date;
}
public long getLastSync() {
return lastSync;
}
public String getJson() {
return Json;
}
public void setDate(final String date) {
this.date = date;
}
public void setLastSync(final long lastSync) {
this.lastSync = lastSync;
}
public void setJson(final String json) {
this.json = json;
} |
<<<<<<<
=======
import java.util.Set;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
>>>>>>>
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
<<<<<<<
=======
import com.fluxtream.domain.ChannelStyle;
import com.fluxtream.domain.GrapherView;
import com.fluxtream.utils.HttpUtils;
import com.fluxtream.utils.JPAUtils;
>>>>>>>
import com.fluxtream.domain.GrapherView;
import com.fluxtream.utils.JPAUtils; |
<<<<<<<
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
=======
>>>>>>>
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
<<<<<<<
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
=======
>>>>>>>
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
<<<<<<<
import com.fluxtream.connectors.updaters.AbstractGoogleOAuthUpdater;
=======
import com.fluxtream.connectors.updaters.AbstractUpdater;
>>>>>>>
import com.fluxtream.connectors.updaters.AbstractUpdater;
<<<<<<<
import com.fluxtream.domain.ApiKey;
=======
>>>>>>>
import com.fluxtream.domain.ApiKey;
<<<<<<<
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;
=======
import com.fluxtream.services.GuestService;
import com.fluxtream.services.JPADaoService;
import com.google.api.client.http.HttpTransport;
>>>>>>>
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;
<<<<<<<
public class GoogleLatitudeUpdater extends AbstractGoogleOAuthUpdater implements FileUploadSupport {
=======
public class GoogleLatitudeUpdater extends AbstractUpdater {
@Autowired
GuestService guestService;
@Autowired
ApiDataService apiDataService;
@Autowired
GoogleOAuth2Helper oAuth2Helper;
>>>>>>>
public class GoogleLatitudeUpdater extends AbstractUpdater implements FileUploadSupport { |
<<<<<<<
import com.fluxtream.connectors.updaters.UpdateInfo;
=======
import com.fluxtream.connectors.location.LocationFacet;
>>>>>>>
import com.fluxtream.connectors.updaters.UpdateInfo;
import com.fluxtream.connectors.location.LocationFacet;
<<<<<<<
public List<AbstractFacet> extractFacets(final UpdateInfo updateInfo, final ApiData apiData,
=======
@Autowired
MetadataService metadataService;
public List<AbstractFacet> extractFacets(ApiData apiData,
>>>>>>>
@Autowired
MetadataService metadataService;
public List<AbstractFacet> extractFacets(final UpdateInfo updateInfo, final ApiData apiData, |
<<<<<<<
/** The Constant OVERFLOW. */
public static final String OVERFLOW = "overflow";
=======
>>>>>>>
/** The Constant OVERFLOW. */
public static final String OVERFLOW = "overflow";
<<<<<<<
/** The Constant OVERFLOW_X. */
public static final String OVERFLOW_X = "overflow-x";
/** The Constant OVERFLOW_Y. */
public static final String OVERFLOW_Y = "overflow-y";
=======
>>>>>>>
/** The Constant OVERFLOW_X. */
public static final String OVERFLOW_X = "overflow-x";
/** The Constant OVERFLOW_Y. */
public static final String OVERFLOW_Y = "overflow-y";
<<<<<<<
/** The Constant BREAK_WORD. */
public static final String BREAK_WORD = "break-word";
=======
>>>>>>>
/** The Constant BREAK_WORD. */
public static final String BREAK_WORD = "break-word"; |
<<<<<<<
=======
import static org.junit.Assert.assertEquals;
import org.junit.Test;
>>>>>>>
import static org.junit.Assert.assertEquals;
import org.junit.Test;
<<<<<<<
=======
@Test
public void testMulti() throws Exception {
byte[] key = "key".getBytes();
byte[] value = "value".getBytes();
BinaryJedis jedis = (BinaryJedis) connection.getNativeConnection();
Transaction multi = jedis.multi();
//connection.set(key, value);
multi.set(value, key);
System.out.println(multi.exec());
connection.multi();
connection.set(value, key);
System.out.println(connection.exec());
}
@Test
public void testIncrDecrBy() {
String key = "test.count";
long largeNumber = 0x123456789L; // > 32bits
connection.set(key.getBytes(), "0".getBytes());
connection.incrBy(key.getBytes(), largeNumber);
assertEquals(largeNumber, Long.valueOf(new String(connection.get(key.getBytes()))).longValue());
connection.decrBy(key.getBytes(), largeNumber);
assertEquals(0, Long.valueOf(new String(connection.get(key.getBytes()))).longValue());
connection.decrBy(key.getBytes(), 2*largeNumber);
assertEquals(-2*largeNumber, Long.valueOf(new String(connection.get(key.getBytes()))).longValue());
}
@Test
public void testHashIncrDecrBy() {
byte[] key = "test.hcount".getBytes();
byte[] hkey = "hashkey".getBytes();
long largeNumber = 0x123456789L; // > 32bits
connection.hSet(key, hkey, "0".getBytes());
connection.hIncrBy(key, hkey, largeNumber);
assertEquals(largeNumber, Long.valueOf(new String(connection.hGet(key, hkey))).longValue());
connection.hIncrBy(key, hkey, -2*largeNumber);
assertEquals(-largeNumber, Long.valueOf(new String(connection.hGet(key, hkey))).longValue());
}
// @Test
// public void setAdd() {
// connection.sadd("s1", "1");
// connection.sadd("s1", "2");
// connection.sadd("s1", "3");
// connection.sadd("s2", "2");
// connection.sadd("s2", "3");
// Set<String> intersection = connection.sinter("s1", "s2");
// System.out.println(intersection);
//
//
// }
//
// @Test
// public void setIntersectionTests() {
// RedisTemplate template = new RedisTemplate(clientFactory);
// RedisSet s1 = new RedisSet(template, "s1");
// s1.add("1");
// s1.add("2");
// s1.add("3");
// RedisSet s2 = new RedisSet(template, "s2");
// s2.add("2");
// s2.add("3");
// Set s3 = s1.intersection("s3", s1, s2);
// for (Object object : s3) {
// System.out.println(object);
// }
>>>>>>>
@Test
public void testIncrDecrBy() {
String key = "test.count";
long largeNumber = 0x123456789L; // > 32bits
connection.set(key.getBytes(), "0".getBytes());
connection.incrBy(key.getBytes(), largeNumber);
assertEquals(largeNumber, Long.valueOf(new String(connection.get(key.getBytes()))).longValue());
connection.decrBy(key.getBytes(), largeNumber);
assertEquals(0, Long.valueOf(new String(connection.get(key.getBytes()))).longValue());
connection.decrBy(key.getBytes(), 2*largeNumber);
assertEquals(-2*largeNumber, Long.valueOf(new String(connection.get(key.getBytes()))).longValue());
}
@Test
public void testHashIncrDecrBy() {
byte[] key = "test.hcount".getBytes();
byte[] hkey = "hashkey".getBytes();
long largeNumber = 0x123456789L; // > 32bits
connection.hSet(key, hkey, "0".getBytes());
connection.hIncrBy(key, hkey, largeNumber);
assertEquals(largeNumber, Long.valueOf(new String(connection.hGet(key, hkey))).longValue());
connection.hIncrBy(key, hkey, -2*largeNumber);
assertEquals(-largeNumber, Long.valueOf(new String(connection.hGet(key, hkey))).longValue());
} |
<<<<<<<
import java.util.Arrays;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.contains;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
=======
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
>>>>>>>
import java.util.Arrays;
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; |
<<<<<<<
=======
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
>>>>>>>
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
<<<<<<<
=======
public void paginationInfoBasedOnCurrentPageAndTotalPosts() {
List<Post> posts = new ArrayList<Post>();
long itemCount = 11;
for (int i = 0; i < itemCount; ++i) {
posts.add(PostBuilder.post().build());
}
postRepository.save(posts);
PageRequest pageRequest = new PageRequest(0, 10);
Page<Post> result = service.getAllPosts(pageRequest);
assertThat(result.getTotalElements(), is(itemCount));
}
@Test
>>>>>>>
public void paginationInfoBasedOnCurrentPageAndTotalPosts() {
List<Post> posts = new ArrayList<Post>();
long itemCount = 11;
for (int i = 0; i < itemCount; ++i) {
posts.add(PostBuilder.post().build());
}
postRepository.save(posts);
PageRequest pageRequest = new PageRequest(0, 10);
Page<Post> result = service.getAllPosts(pageRequest);
assertThat(result.getTotalElements(), is(itemCount));
}
@Test
<<<<<<<
=======
@Test
public void allPosts() {
Post post = PostBuilder.post().build();
postRepository.save(post);
Post draft = PostBuilder.post().draft().build();
postRepository.save(draft);
Page<Post> allPosts = service.getAllPosts(new BlogPostsPageRequest(0));
assertThat(allPosts.getContent(), containsInAnyOrder(post, draft));
}
>>>>>>>
@Test
public void allPosts() {
Post post = PostBuilder.post().build();
postRepository.save(post);
Post draft = PostBuilder.post().draft().build();
postRepository.save(draft);
Page<Post> allPosts = service.getAllPosts(new BlogPostsPageRequest(0));
assertThat(allPosts.getContent(), containsInAnyOrder(post, draft));
} |
<<<<<<<
import com.abrenoch.hyperiongrabber.common.util.BorderProcessor;
=======
import com.abrenoch.hyperiongrabber.common.util.HyperionGrabberOptions;
>>>>>>>
import com.abrenoch.hyperiongrabber.common.util.BorderProcessor;
import com.abrenoch.hyperiongrabber.common.util.HyperionGrabberOptions;
<<<<<<<
final MediaProjection projection, final int width, final int height,
final int density, int frameRate) {
super(listener, projection, width, height, density, frameRate);
=======
final MediaProjection projection, final int width, final int height,
final int density, HyperionGrabberOptions options) {
super(listener, projection, width, height, density, options);
>>>>>>>
final MediaProjection projection, final int width, final int height,
final int density, HyperionGrabberOptions options) {
super(listener, projection, width, height, density, options);
<<<<<<<
=======
private Runnable clearAndDisconnect = () -> {
mListener.clear();
mListener.disconnect();
};
>>>>>>> |
<<<<<<<
import com.abrenoch.hyperiongrabber.common.util.Preferences;
=======
import com.abrenoch.hyperiongrabber.common.network.Hyperion;
>>>>>>>
import com.abrenoch.hyperiongrabber.common.util.Preferences;
import com.abrenoch.hyperiongrabber.common.network.Hyperion;
<<<<<<<
Preferences prefs = new Preferences(getApplicationContext());
prefs.putString(R.string.pref_key_hyperion_port, hostName);
prefs.putString(R.string.pref_key_hyperion_port, port);
=======
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor editor = preferences.edit();
editor.putString("hyperion_host", hostName);
editor.putString("hyperion_port", String.valueOf(port));
editor.apply();
>>>>>>>
Preferences prefs = new Preferences(getApplicationContext());
prefs.putString(R.string.pref_key_hyperion_port, hostName);
prefs.putString(R.string.pref_key_hyperion_port, String.valueOf(port)); |
<<<<<<<
public List<Model> addAnnotationList(final List<Map<String,Object>> pJson) throws IOException, IDConflictException, MalformedAnnotation {
=======
public List<Model> addAnnotationList(final List<Map<String,Object>> pJson) throws IOException, IDConflictException, URISyntaxException {
>>>>>>>
public List<Model> addAnnotationList(final List<Map<String,Object>> pJson) throws IOException, IDConflictException, MalformedAnnotation {
<<<<<<<
/**
* Take the annotation add a unique ID if it doesn't have one
* also add within links to the manifest if one can be found.
*/
public Model addAnnotation(final Map<String,Object> pJson) throws IOException, IDConflictException, MalformedAnnotation {
Annotation tAnno = new Annotation(pJson);
tAnno.checkValid();
if (this.getNamedModel(tAnno.getId()) != null) {
_logger.debug("Found existing annotation with id " + tAnno.getId());
tAnno.setId(tAnno.getId() + "1");
if (tAnno.getId().length() > 400) {
throw new IDConflictException("Tried multiple times to make this id unique but have failed " + tAnno.getId());
=======
public Model addAnnotation(final Map<String,Object> pJson) throws IOException, IDConflictException, URISyntaxException {
if (this.getNamedModel((String)pJson.get("@id")) != null) {
_logger.debug("Found existing annotation with id " + pJson.get("@id").toString());
pJson.put("@id",(String)pJson.get("@id") + "1");
if (((String)pJson.get("@id")).length() > 400) {
throw new IDConflictException("Tried multiple times to make this id unique but have failed " + (String)pJson.get("@id"));
>>>>>>>
/**
* Take the annotation add a unique ID if it doesn't have one
* also add within links to the manifest if one can be found.
*/
public Model addAnnotation(final Map<String,Object> pJson) throws IOException, IDConflictException, MalformedAnnotation {
Annotation tAnno = new Annotation(pJson);
tAnno.checkValid();
if (this.getNamedModel(tAnno.getId()) != null) {
_logger.debug("Found existing annotation with id " + tAnno.getId());
tAnno.setId(tAnno.getId() + "1");
if (tAnno.getId().length() > 400) {
throw new IDConflictException("Tried multiple times to make this id unique but have failed " + tAnno.getId());
<<<<<<<
Resource tAnnoRes = tStoredAnno.getResource(tAnno.getId());
=======
this.begin(ReadWrite.READ);
Resource tAnnoRes = tStoredAnno.getResource(tAnnoId);
>>>>>>>
this.begin(ReadWrite.READ);
Resource tAnnoRes = tStoredAnno.getResource(tAnno.getId());
<<<<<<<
tAnno.updateModified();
_logger.debug("Modified annotation " + tAnno.toString());
deleteAnnotation(tAnno.getId());
=======
this.end();
pJson.put(DCTerms.modified.getURI(), _dateFormatter.format(new Date()));
_logger.debug("Modified annotation " + JsonUtils.toPrettyString(pJson));
deleteAnnotation(tAnnoId);
if (this.isMissingWithin(pJson)) {
// missing within so check to see if the canvas maps to a manifest
String tCanvasId = getFirstCanvasId(pJson.get("on"));
>>>>>>>
this.end();
tAnno.updateModified();
_logger.debug("Modified annotation " + tAnno.toString());
deleteAnnotation(tAnno.getId());
<<<<<<<
protected String createShortId(final String pLongId) throws IOException {
=======
public String createShortId(final String pLongId) throws IOException {
>>>>>>>
public String createShortId(final String pLongId) throws IOException { |
<<<<<<<
// @formatter:off
Status stat1 = Status.newBuilder().setBegin(100).setEnd(1000).setClosed(true).setInfiniteEnd(false).build(),
stat2 = Status.newBuilder().setBegin(500).setEnd(1000).setClosed(true).setInfiniteEnd(false).build(),
stat3 = Status.newBuilder().setBegin(1).setEnd(1000).setClosed(true).setInfiniteEnd(false).build();
ReplicationTarget target1 = new ReplicationTarget("peer1", "table1", Table.ID.of("1")),
target2 = new ReplicationTarget("peer2", "table2", Table.ID.of("1")),
target3 = new ReplicationTarget("peer3", "table3", Table.ID.of("1"));
// @formatter:on
=======
Status stat1 = Status.newBuilder().setBegin(100).setEnd(1000).setClosed(true)
.setInfiniteEnd(false).build();
Status stat2 = Status.newBuilder().setBegin(500).setEnd(1000).setClosed(true)
.setInfiniteEnd(false).build();
Status stat3 = Status.newBuilder().setBegin(1).setEnd(1000).setClosed(true)
.setInfiniteEnd(false).build();
ReplicationTarget target1 = new ReplicationTarget("peer1", "table1", "1");
ReplicationTarget target2 = new ReplicationTarget("peer2", "table2", "1");
ReplicationTarget target3 = new ReplicationTarget("peer3", "table3", "1");
>>>>>>>
Status stat1 = Status.newBuilder().setBegin(100).setEnd(1000).setClosed(true)
.setInfiniteEnd(false).build();
Status stat2 = Status.newBuilder().setBegin(500).setEnd(1000).setClosed(true)
.setInfiniteEnd(false).build();
Status stat3 = Status.newBuilder().setBegin(1).setEnd(1000).setClosed(true)
.setInfiniteEnd(false).build();
ReplicationTarget target1 = new ReplicationTarget("peer1", "table1", Table.ID.of("1"));
ReplicationTarget target2 = new ReplicationTarget("peer2", "table2", Table.ID.of("1"));
ReplicationTarget target3 = new ReplicationTarget("peer3", "table3", Table.ID.of("1"));
<<<<<<<
// @formatter:off
Status stat1 = Status.newBuilder().setBegin(100).setEnd(1000).setClosed(true).setInfiniteEnd(true).build(),
stat2 = Status.newBuilder().setBegin(1).setEnd(1000).setClosed(true).setInfiniteEnd(true).build(),
stat3 = Status.newBuilder().setBegin(500).setEnd(1000).setClosed(true).setInfiniteEnd(true).build();
ReplicationTarget target1 = new ReplicationTarget("peer1", "table1", Table.ID.of("1")),
target2 = new ReplicationTarget("peer2", "table2", Table.ID.of("1")),
target3 = new ReplicationTarget("peer3", "table3", Table.ID.of("1"));
// @formatter:on
=======
Status stat1 = Status.newBuilder().setBegin(100).setEnd(1000).setClosed(true)
.setInfiniteEnd(true).build();
Status stat2 = Status.newBuilder().setBegin(1).setEnd(1000).setClosed(true).setInfiniteEnd(true)
.build();
Status stat3 = Status.newBuilder().setBegin(500).setEnd(1000).setClosed(true)
.setInfiniteEnd(true).build();
ReplicationTarget target1 = new ReplicationTarget("peer1", "table1", "1");
ReplicationTarget target2 = new ReplicationTarget("peer2", "table2", "1");
ReplicationTarget target3 = new ReplicationTarget("peer3", "table3", "1");
>>>>>>>
Status stat1 = Status.newBuilder().setBegin(100).setEnd(1000).setClosed(true)
.setInfiniteEnd(true).build();
Status stat2 = Status.newBuilder().setBegin(1).setEnd(1000).setClosed(true).setInfiniteEnd(true)
.build();
Status stat3 = Status.newBuilder().setBegin(500).setEnd(1000).setClosed(true)
.setInfiniteEnd(true).build();
ReplicationTarget target1 = new ReplicationTarget("peer1", "table1", Table.ID.of("1"));
ReplicationTarget target2 = new ReplicationTarget("peer2", "table2", Table.ID.of("1"));
ReplicationTarget target3 = new ReplicationTarget("peer3", "table3", Table.ID.of("1")); |
<<<<<<<
public static Branch createBranchFromErrors(final List<Error> errors) {
=======
public static RequestStatus createRequestStatusFromErrors(List<Error> errors) {
return RequestStatus.create(false, errors);
}
public static RawContent createRawContentFromErrors(List<Error> errors) {
return RawContent.create(null, errors);
}
public static LinePage createLinePageFromErrors(List<Error> errors) {
return LinePage.create(-1, -1, -1, -1, true, null, null, errors);
}
public static Branch createBranchFromErrors(List<Error> errors) {
>>>>>>>
public static RequestStatus createRequestStatusFromErrors(final List<Error> errors) {
return RequestStatus.create(false, errors);
}
public static RawContent createRawContentFromErrors(final List<Error> errors) {
return RawContent.create(null, errors);
}
public static LinePage createLinePageFromErrors(final List<Error> errors) {
return LinePage.create(-1, -1, -1, -1, true, null, null, errors);
}
public static Branch createBranchFromErrors(final List<Error> errors) {
<<<<<<<
public static StatusPage createStatusPageFromErrors(final List<Error> errors) {
=======
public static Condition createConditionFromErrors(List<Error> errors) {
return Condition.create(null, null, null, null, null, null, errors);
}
public static StatusPage createStatusPageFromErrors(List<Error> errors) {
>>>>>>>
public static Condition createConditionFromErrors(final List<Error> errors) {
return Condition.create(null, null, null, null, null, null, errors);
}
public static StatusPage createStatusPageFromErrors(final List<Error> errors) {
<<<<<<<
public static BranchPermissionPage createBranchPermissionPageFromErrors(final List<Error> errors) {
return BranchPermissionPage.create(-1, -1, -1, -1, true, null, errors);
=======
public static BranchRestrictionPage createBranchPermissionPageFromErrors(List<Error> errors) {
return BranchRestrictionPage.create(-1, -1, -1, -1, true, null, errors);
>>>>>>>
public static BranchRestrictionPage createBranchPermissionPageFromErrors(final List<Error> errors) {
return BranchRestrictionPage.create(-1, -1, -1, -1, true, null, errors);
<<<<<<<
public static Comments createCommentsFromErrors(final List<Error> errors) {
return Comments.create(null, 0, 0, null, null, 0, 0, null, null, null, null, errors);
=======
public static Comments createCommentsFromErrors(List<Error> errors) {
return Comments.create(null, 0, 0, null, null, 0, 0, null, null, null, null, null, null, errors);
>>>>>>>
public static Comments createCommentsFromErrors(final List<Error> errors) {
return Comments.create(null, 0, 0, null, null, 0, 0, null, null, null, null, null, null, errors);
<<<<<<<
public static List<Error> getErrors(final String output) {
final JsonElement element = parser.parse(output);
final JsonObject object = element.getAsJsonObject();
final JsonArray errorsArray = object.get("errors").getAsJsonArray();
final List<Error> errors = Lists.newArrayList();
final Iterator<JsonElement> it = errorsArray.iterator();
while (it.hasNext()) {
final JsonObject obj = it.next().getAsJsonObject();
final JsonElement context = obj.get("context");
final JsonElement message = obj.get("message");
final JsonElement exceptionName = obj.get("exceptionName");
final Error error = Error.create(!context.isJsonNull() ? context.getAsString() : null,
!message.isJsonNull() ? message.getAsString() : null,
!exceptionName.isJsonNull() ? exceptionName.getAsString() : null);
=======
public static List<Error> getErrors(final String output) {
final List<Error> errors = Lists.newArrayList();
try {
final JsonElement element = parser.parse(output);
final JsonObject object = element.getAsJsonObject();
final JsonArray errorsArray = object.get("errors").getAsJsonArray();
final Iterator<JsonElement> it = errorsArray.iterator();
while (it.hasNext()) {
final JsonObject obj = it.next().getAsJsonObject();
final JsonElement context = obj.get("context");
final JsonElement message = obj.get("message");
final JsonElement exceptionName = obj.get("exceptionName");
final JsonElement conflicted = obj.get("conflicted");
final List<Veto> vetos = Lists.newArrayList();
final JsonElement possibleVetoesArray = obj.get("vetoes");
if (possibleVetoesArray != null && !possibleVetoesArray.isJsonNull()) {
final JsonArray vetoesArray = possibleVetoesArray.getAsJsonArray();
final Iterator<JsonElement> vetoIterator = vetoesArray.iterator();
while (vetoIterator.hasNext()) {
final JsonObject vetoObj = vetoIterator.next().getAsJsonObject();
final JsonElement summary = vetoObj.get("summaryMessage");
final JsonElement detailed = vetoObj.get("detailedMessage");
final Veto veto = Veto.create(!summary.isJsonNull() ? summary.getAsString() : null,
!detailed.isJsonNull() ? detailed.getAsString() : null);
vetos.add(veto);
}
}
final Error error = Error.create(!context.isJsonNull() ? context.getAsString() : null,
!message.isJsonNull() ? message.getAsString() : null,
!exceptionName.isJsonNull() ? exceptionName.getAsString() : null,
conflicted != null && !conflicted.isJsonNull() ? conflicted.getAsBoolean() : false,
vetos);
errors.add(error);
}
} catch (final Exception e) {
final Error error = Error.create(output,
"Failed to parse output: message=" + e.getMessage(),
e.getClass().getName(),
false,
null);
>>>>>>>
public static List<Error> getErrors(final String output) {
final List<Error> errors = Lists.newArrayList();
try {
final JsonElement element = parser.parse(output);
final JsonObject object = element.getAsJsonObject();
final JsonArray errorsArray = object.get("errors").getAsJsonArray();
final Iterator<JsonElement> it = errorsArray.iterator();
while (it.hasNext()) {
final JsonObject obj = it.next().getAsJsonObject();
final JsonElement context = obj.get("context");
final JsonElement message = obj.get("message");
final JsonElement exceptionName = obj.get("exceptionName");
final JsonElement conflicted = obj.get("conflicted");
final List<Veto> vetos = Lists.newArrayList();
final JsonElement possibleVetoesArray = obj.get("vetoes");
if (possibleVetoesArray != null && !possibleVetoesArray.isJsonNull()) {
final JsonArray vetoesArray = possibleVetoesArray.getAsJsonArray();
final Iterator<JsonElement> vetoIterator = vetoesArray.iterator();
while (vetoIterator.hasNext()) {
final JsonObject vetoObj = vetoIterator.next().getAsJsonObject();
final JsonElement summary = vetoObj.get("summaryMessage");
final JsonElement detailed = vetoObj.get("detailedMessage");
final Veto veto = Veto.create(!summary.isJsonNull() ? summary.getAsString() : null,
!detailed.isJsonNull() ? detailed.getAsString() : null);
vetos.add(veto);
}
}
final Error error = Error.create(!context.isJsonNull() ? context.getAsString() : null,
!message.isJsonNull() ? message.getAsString() : null,
!exceptionName.isJsonNull() ? exceptionName.getAsString() : null,
conflicted != null && !conflicted.isJsonNull() ? conflicted.getAsBoolean() : false,
vetos);
errors.add(error);
}
} catch (final Exception e) {
final Error error = Error.create(output,
"Failed to parse output: message=" + e.getMessage(),
e.getClass().getName(),
false,
null); |
<<<<<<<
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final String projectKey = "HELLO";
final boolean success = baseApi.projectApi().delete(projectKey);
assertThat(success).isTrue();
assertSent(server, "DELETE", restBasePath + BitbucketApiMetadata.API_VERSION + localPath + "/" + projectKey);
=======
BitbucketApi baseApi = api(server.getUrl("/"));
ProjectApi api = baseApi.projectApi();
try {
String projectKey = "HELLO";
final RequestStatus success = api.delete(projectKey);
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty();
assertSent(server, "DELETE", "/rest/api/" + BitbucketApiMetadata.API_VERSION + "/projects/" + projectKey);
>>>>>>>
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final String projectKey = "HELLO";
final RequestStatus success = baseApi.projectApi().delete(projectKey);
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty();
assertSent(server, "DELETE", "/rest/api/" + BitbucketApiMetadata.API_VERSION + "/projects/" + projectKey);
<<<<<<<
final MockWebServer server = mockWebServer();
server.enqueue(new MockResponse()
.setBody(payloadFromResource("/project-not-exist.json"))
.setResponseCode(404));
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final String projectKey = "NOTEXIST";
final boolean success = baseApi.projectApi().delete(projectKey);
assertThat(success).isFalse();
assertSent(server, "DELETE", restBasePath + BitbucketApiMetadata.API_VERSION + localPath + "/" + projectKey);
=======
MockWebServer server = mockEtcdJavaWebServer();
server.enqueue(new MockResponse().setBody(payloadFromResource("/project-not-exist.json")).setResponseCode(404));
BitbucketApi baseApi = api(server.getUrl("/"));
ProjectApi api = baseApi.projectApi();
try {
String projectKey = "NOTEXIST";
final RequestStatus success = api.delete(projectKey);
assertThat(success).isNotNull();
assertThat(success.value()).isFalse();
assertThat(success.errors()).isNotEmpty();
assertSent(server, "DELETE", "/rest/api/" + BitbucketApiMetadata.API_VERSION + "/projects/" + projectKey);
>>>>>>>
final MockWebServer server = mockWebServer();
server.enqueue(new MockResponse()
.setBody(payloadFromResource("/project-not-exist.json"))
.setResponseCode(404));
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final String projectKey = "NOTEXIST";
final RequestStatus success = baseApi.projectApi().delete(projectKey);
assertThat(success).isNotNull();
assertThat(success.value()).isFalse();
assertThat(success.errors()).isNotEmpty();
assertSent(server, "DELETE", "/rest/api/" + BitbucketApiMetadata.API_VERSION + "/projects/" + projectKey); |
<<<<<<<
try (BitbucketApi baseApi = api(server.getUrl("/"))) {
final boolean success = baseApi.branchApi().delete(projectKey, repoKey, "refs/heads/some-branch-name");
assertThat(success).isTrue();
assertSent(server, "DELETE", localRestPath + BitbucketApiMetadata.API_VERSION
+ localProjectsPath + projectKey + localReposPath + repoKey + localBranchesPath);
=======
BitbucketApi baseApi = api(server.getUrl("/"));
BranchApi api = baseApi.branchApi();
try {
String projectKey = "PRJ";
String repoKey = "myrepo";
final RequestStatus success = api.delete(projectKey, repoKey, "refs/heads/some-branch-name");
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty();
assertSent(server, "DELETE", "/rest/branch-utils/" + BitbucketApiMetadata.API_VERSION
+ "/projects/" + projectKey + "/repos/" + repoKey + "/branches");
>>>>>>>
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final RequestStatus success = baseApi.branchApi().delete(projectKey, repoKey, "refs/heads/some-branch-name");
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty();
assertSent(server, "DELETE", "/rest/branch-utils/" + BitbucketApiMetadata.API_VERSION
+ "/projects/" + projectKey + "/repos/" + repoKey + "/branches");
<<<<<<<
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final boolean success = baseApi.branchApi().updateDefault(projectKey, repoKey, "refs/heads/my-new-default-branch");
assertThat(success).isTrue();
assertSent(server, "PUT", restBasePath + BitbucketApiMetadata.API_VERSION
+ localProjectsPath + projectKey + localReposPath + repoKey + localBranchesPath + "/default");
=======
BitbucketApi baseApi = api(server.getUrl("/"));
BranchApi api = baseApi.branchApi();
try {
String projectKey = "PRJ";
String repoKey = "myrepo";
final RequestStatus success = api.updateDefault(projectKey, repoKey, "refs/heads/my-new-default-branch");
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty();
assertSent(server, "PUT", "/rest/api/" + BitbucketApiMetadata.API_VERSION
+ "/projects/" + projectKey + "/repos/" + repoKey + "/branches/default");
>>>>>>>
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final RequestStatus success = baseApi.branchApi().updateDefault(projectKey, repoKey, "refs/heads/my-new-default-branch");
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty();
assertSent(server, "PUT", "/rest/api/" + BitbucketApiMetadata.API_VERSION
+ "/projects/" + projectKey + "/repos/" + repoKey + "/branches/default");
<<<<<<<
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final BranchPermissionPage branch = baseApi.branchApi().listBranchPermission(projectKey, repoKey, null, 1);
=======
BitbucketApi baseApi = api(server.getUrl("/"));
BranchApi api = baseApi.branchApi();
try {
String projectKey = "PRJ";
String repoKey = "myrepo";
BranchRestrictionPage branch = api.listBranchRestriction(projectKey, repoKey, null, 1);
>>>>>>>
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final BranchRestrictionPage branch = baseApi.branchApi().listBranchRestriction(projectKey, repoKey, null, 1);
<<<<<<<
try (BitbucketApi baseApi = api(server.getUrl("/"))) {
final List<String> groupPermission = Lists.newArrayList("Test12354");
final List<Long> listAccessKey = Lists.newArrayList(123L);
final List<BranchPermission> listBranchPermission = new ArrayList<>();
listBranchPermission.add(BranchPermission.createWithId(839L, BranchPermissionEnumType.FAST_FORWARD_ONLY,
=======
BitbucketApi baseApi = api(server.getUrl("/"));
BranchApi api = baseApi.branchApi();
try {
List<String> groupPermission = new ArrayList<>();
groupPermission.add("Test12354");
List<Long> listAccessKey = new ArrayList<>();
listAccessKey.add(123L);
List<BranchRestriction> listBranchPermission = new ArrayList<>();
listBranchPermission.add(BranchRestriction.createWithId(839L, BranchRestrictionEnumType.FAST_FORWARD_ONLY,
>>>>>>>
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
List<String> groupPermission = new ArrayList<>();
groupPermission.add("Test12354");
List<Long> listAccessKey = new ArrayList<>();
listAccessKey.add(123L);
List<BranchRestriction> listBranchPermission = new ArrayList<>();
listBranchPermission.add(BranchRestriction.createWithId(839L, BranchRestrictionEnumType.FAST_FORWARD_ONLY,
<<<<<<<
final boolean success = baseApi.branchApi().updateBranchPermission(projectKey, repoKey, listBranchPermission);
assertThat(success).isTrue();
=======
String projectKey = "PRJ";
String repoKey = "myrepo";
final RequestStatus success = api.createBranchRestriction(projectKey, repoKey, listBranchPermission);
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty();
>>>>>>>
final RequestStatus success = baseApi.branchApi().createBranchRestriction(projectKey, repoKey, listBranchPermission);
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty();
<<<<<<<
try (BitbucketApi baseApi = api(server.getUrl("/"))) {
final Long idToDelete = 839L;
final boolean success = baseApi.branchApi().deleteBranchPermission(projectKey, repoKey, idToDelete);
assertThat(success).isTrue();
=======
BitbucketApi baseApi = api(server.getUrl("/"));
BranchApi api = baseApi.branchApi();
try {
String projectKey = "PRJ";
String repoKey = "myrepo";
Long idToDelete = 839L;
final RequestStatus success = api.deleteBranchRestriction(projectKey, repoKey, idToDelete);
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty();
>>>>>>>
try (final BitbucketApi baseApi = api(server.getUrl("/"))) {
final Long idToDelete = 839L;
final RequestStatus success = baseApi.branchApi().deleteBranchRestriction(projectKey, repoKey, idToDelete);
assertThat(success).isNotNull();
assertThat(success.value()).isTrue();
assertThat(success.errors()).isEmpty(); |
<<<<<<<
final UserPage userPage = api().listUserByGroup(randomString(), null, null, null);
=======
UserPage userPage = api().listUsersByGroup(TestUtilities.randomString(), null, null, null);
assertThat(userPage).isNotNull();
assertThat(userPage.size() == 0).isTrue();
}
@Test
public void testListUsers() {
final User user = TestUtilities.getDefaultUser(this.credential, this.api);
final UserPage userPage = api().listUsers(user.slug(), null, null);
assertThat(userPage).isNotNull();
assertThat(userPage.size() > 0).isTrue();
}
@Test
public void testListUsersNonExistent() {
UserPage userPage = api().listUsers(TestUtilities.randomString(), null, null);
>>>>>>>
final UserPage userPage = api().listUsersByGroup(TestUtilities.randomString(), null, null, null);
assertThat(userPage).isNotNull();
assertThat(userPage.size() == 0).isTrue();
}
@Test
public void testListUsers() {
final User user = TestUtilities.getDefaultUser(this.credential, this.api);
final UserPage userPage = api().listUsers(user.slug(), null, null);
assertThat(userPage).isNotNull();
assertThat(userPage.size() > 0).isTrue();
}
@Test
public void testListUsersNonExistent() {
final UserPage userPage = api().listUsers(TestUtilities.randomString(), null, null); |
<<<<<<<
=======
ReplayFile replayFile = getReplayFileForEvent(kind, file);
Platform.runLater(() -> {
fileListeners.forEach(fileListener -> fileListener.handle(replayFile));
LOG.info("File " + replayFile + " registered with listeners.");
});
>>>>>>> |
<<<<<<<
parsedReplay = new StormParser().apply(new File(fileName));
provider = new HotsLogsProvider();
s3ClientMock = mock(AmazonS3Client.class);
=======
parsedReplay = new StormParser(new File(fileName)).parseReplay();
>>>>>>>
parsedReplay = new StormParser().apply(new File(fileName)); |
<<<<<<<
import javax.inject.Inject;
=======
>>>>>>>
import javax.inject.Inject;
<<<<<<<
@Inject
public EVCacheClientPoolManager(IConnectionFactoryProvider connectionFactoryprovider, EVCacheNodeList evcacheNodeList) {
=======
public EVCacheClientPoolManager(IConnectionFactoryProvider connectionFactoryprovider, EVCacheNodeList evcacheNodeList) {
>>>>>>>
@Inject
public EVCacheClientPoolManager(IConnectionFactoryProvider connectionFactoryprovider, EVCacheNodeList evcacheNodeList) { |
<<<<<<<
private final Property<Boolean> fixup;
private final Property<Integer> fixupPoolSize;
=======
>>>>>>>
<<<<<<<
this.fixup = EVCacheConfig.getInstance().getPropertyRepository().get(_appName + ".addOperation.fixup", Boolean.class).orElse(false);
this.fixupPoolSize = EVCacheConfig.getInstance().getPropertyRepository().get(_appName + ".addOperation.fixup.poolsize", Integer.class).orElse(10);
RejectedExecutionHandler block = new RejectedExecutionHandler() {
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
EVCacheMetricsFactory.increment(_appName , null, null, _appName + "-AddCall-FixUp-REJECTED");
}
};
class SimpleThreadFactory implements ThreadFactory {
private final AtomicInteger counter = new AtomicInteger();
public Thread newThread(Runnable r) {
return new Thread(r, "EVCacheClientUtil-AddFixUp-" + counter.getAndIncrement());
}
}
final BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(10000);
threadPool = new ThreadPoolExecutor(fixupPoolSize.get(), fixupPoolSize.get() * 2, 30, TimeUnit.SECONDS, queue, new SimpleThreadFactory(), block);
CompositeMonitor<?> newThreadPoolMonitor = Monitors.newThreadPoolMonitor("EVCacheClientUtil-AddFixUp", threadPool);
DefaultMonitorRegistry.getInstance().register(newThreadPoolMonitor);
threadPool.prestartAllCoreThreads();
=======
>>>>>>> |
<<<<<<<
import com.netflix.evcache.pool.EVCacheNodeList;
import com.netflix.evcache.pool.eureka.DIEVCacheNodeListProvider;
=======
import com.netflix.evcache.version.VersionTracker;
import com.netflix.servo.tag.BasicTagList;
>>>>>>>
import com.netflix.evcache.pool.EVCacheNodeList;
import com.netflix.evcache.pool.eureka.DIEVCacheNodeListProvider;
import com.netflix.evcache.version.VersionTracker;
<<<<<<<
}
@Inject
EVCacheClientPoolManager manager;
@PostConstruct
public void init() {
if(manager != null) {
manager.initAtStartup();
} else {
EVCacheClientPoolManager.getInstance().initAtStartup();
}
}
=======
bind(VersionTracker.class).asEagerSingleton();
>>>>>>>
bind(VersionTracker.class).asEagerSingleton();
}
@Inject
EVCacheClientPoolManager manager;
@PostConstruct
public void init() {
if(manager != null) {
manager.initAtStartup();
} else {
EVCacheClientPoolManager.getInstance().initAtStartup();
}
} |
<<<<<<<
public void publish(String message, MessageColor color);
public void publish(String message);
=======
public void publish(String message, String color);
>>>>>>>
public void publish(String message);
public void publish(String message, String color); |
<<<<<<<
package com.mojang.mojam.level.gamemode;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import javax.imageio.ImageIO;
import com.mojang.mojam.MojamComponent;
import com.mojang.mojam.entity.Entity;
import com.mojang.mojam.entity.building.ShopItemBomb;
import com.mojang.mojam.entity.building.ShopItemHarvester;
import com.mojang.mojam.entity.building.ShopItemRaygun;
import com.mojang.mojam.entity.building.ShopItemRifle;
import com.mojang.mojam.entity.building.ShopItemShotgun;
import com.mojang.mojam.entity.building.ShopItemTurret;
import com.mojang.mojam.entity.mob.Team;
import com.mojang.mojam.level.DifficultyInformation;
import com.mojang.mojam.level.Level;
import com.mojang.mojam.level.LevelInformation;
import com.mojang.mojam.level.LevelUtils;
import com.mojang.mojam.level.tile.FloorTile;
import com.mojang.mojam.level.tile.SandTile;
import com.mojang.mojam.level.tile.Tile;
import com.mojang.mojam.level.tile.UnbreakableRailTile;
public class GameMode {
public static final int LEVEL_BORDER_SIZE = 16;
protected Level newLevel;
public Level generateLevel(LevelInformation li, int player1Character, int player2Character) throws IOException {
BufferedImage bufferedImage;
//System.out.println("Loading level from file: "+li.getPath());
if(li.vanilla){
bufferedImage = ImageIO.read(MojamComponent.class.getResource(li.getPath()));
} else {
bufferedImage = ImageIO.read(new File(li.getPath()));
}
int w = bufferedImage.getWidth() + LEVEL_BORDER_SIZE;
int h = bufferedImage.getHeight() + LEVEL_BORDER_SIZE;
newLevel = new Level(w, h, player1Character, player2Character);
processLevelImage(bufferedImage, w, h);
darkenMap(w, h);
setupPlayerSpawnArea();
setTickItems();
setVictoryCondition();
setTargetScore();
return newLevel;
}
private void processLevelImage(BufferedImage bufferedImage, int w, int h) {
int[] rgbs = defaultRgbArray(w, h);
bufferedImage.getRGB(0, 0, w - 16, h - 16, rgbs, 8 + 8 * w, w);
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
int col = rgbs[x + y * w] & 0xffffffff;
loadColorTile(col, x, y);
}
}
}
private int[] defaultRgbArray(int width, int height) {
int[] rgbs = new int[width * height];
Arrays.fill(rgbs, 0xffA8A800);
for (int y = 0 + 4; y < height - 4; y++) {
for (int x = (width / 2) - 4; x < (width / 2) + 3; x++) {
rgbs[x + y * width] = 0xff888800;
}
}
for (int y = 0 + 5; y < height - 5; y++) {
for (int x = (width / 2) - 2; x < (width / 2) + 1; x++) {
rgbs[x + y * width] = 0xffA8A800;
}
}
return rgbs;
}
private void darkenMap(int w, int h) {
for (int y = 0; y < h + 1; y++) {
for (int x = 0; x < w + 1; x++) {
if (x <= 8 || y <= 8 || x >= w - 8 || y >= h - 8) {
newLevel.getSeen()[x + y * (w + 1)] = true;
}
}
}
}
protected void loadColorTile(int color, int x, int y) {
Tile tile = LevelUtils.getNewTileFromColor(color);
newLevel.setTile(x, y, tile);
if(tile instanceof FloorTile) {
Entity entity = LevelUtils.getNewEntityFromColor(color,x,y);
if(entity != null) {
newLevel.addEntity(entity);
}
}
}
protected void setupPlayerSpawnArea() {
newLevel.maxMonsters = 1500 + (int)DifficultyInformation.calculateStrength(500);
newLevel.addEntity(new ShopItemTurret(32 * (newLevel.width / 2 - 1.5), 4.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemHarvester(32 * (newLevel.width / 2 - .5), 4.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemBomb(32 * (newLevel.width / 2 + .5), 4.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemRifle(32 * (newLevel.width / 2 - 2.0), 7.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemShotgun(32 * (newLevel.width / 2 - 2.0), 6.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemRaygun(32 * (newLevel.width / 2 - 2.0), 5.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemTurret(32 * (newLevel.width / 2 - 1.5), (newLevel.height - 4.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemHarvester(32 * (newLevel.width / 2 - .5), (newLevel.height - 4.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemBomb(32 * (newLevel.width / 2 + .5), (newLevel.height - 4.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemRifle(32 * (newLevel.width / 2 - 2.0), (newLevel.height - 7.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemShotgun(32 * (newLevel.width / 2 - 2.0), (newLevel.height - 6.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemRaygun(32 * (newLevel.width / 2 - 2.0), (newLevel.height - 5.5) * 32, Team.Team1));
newLevel.setTile((newLevel.width / 2) - 1, 7, new UnbreakableRailTile(new SandTile()));
newLevel.setTile((newLevel.width / 2) - 1, newLevel.height - 8, new UnbreakableRailTile(new SandTile()));
}
protected void setTickItems() {
}
protected void setVictoryCondition() {
}
protected void setTargetScore() {
}
}
=======
package com.mojang.mojam.level.gamemode;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import javax.imageio.ImageIO;
import com.mojang.mojam.MojamComponent;
import com.mojang.mojam.entity.Entity;
import com.mojang.mojam.entity.building.ShopItemBomb;
import com.mojang.mojam.entity.building.ShopItemHarvester;
import com.mojang.mojam.entity.building.ShopItemTurret;
import com.mojang.mojam.entity.mob.Team;
import com.mojang.mojam.level.DifficultyInformation;
import com.mojang.mojam.level.Level;
import com.mojang.mojam.level.LevelInformation;
import com.mojang.mojam.level.LevelUtils;
import com.mojang.mojam.level.tile.FloorTile;
import com.mojang.mojam.level.tile.SandTile;
import com.mojang.mojam.level.tile.Tile;
import com.mojang.mojam.level.tile.UnbreakableRailTile;
public class GameMode {
public static final int LEVEL_BORDER_SIZE = 16;
protected Level newLevel;
public Level generateLevel(LevelInformation li) throws IOException {
BufferedImage bufferedImage;
//System.out.println("Loading level from file: "+li.getPath());
if(li.vanilla){
bufferedImage = ImageIO.read(MojamComponent.class.getResource(li.getPath()));
} else {
bufferedImage = ImageIO.read(new File(li.getPath()));
}
int w = bufferedImage.getWidth() + LEVEL_BORDER_SIZE;
int h = bufferedImage.getHeight() + LEVEL_BORDER_SIZE;
newLevel = new Level(w, h);
processLevelImage(bufferedImage, w, h);
darkenMap(w, h);
setupPlayerSpawnArea();
setTickItems();
setVictoryCondition();
setTargetScore();
return newLevel;
}
private void processLevelImage(BufferedImage bufferedImage, int w, int h) {
int[] rgbs = defaultRgbArray(w, h);
bufferedImage.getRGB(0, 0, w - 16, h - 16, rgbs, 8 + 8 * w, w);
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
int col = rgbs[x + y * w] & 0xffffffff;
loadColorTile(col, x, y);
}
}
}
private int[] defaultRgbArray(int width, int height) {
int[] rgbs = new int[width * height];
Arrays.fill(rgbs, 0xffA8A800);
for (int y = 0 + 4; y < height - 4; y++) {
for (int x = (width / 2) - 4; x < (width / 2) + 3; x++) {
rgbs[x + y * width] = 0xff888800;
}
}
for (int y = 0 + 5; y < height - 5; y++) {
for (int x = (width / 2) - 2; x < (width / 2) + 1; x++) {
rgbs[x + y * width] = 0xffA8A800;
}
}
return rgbs;
}
private void darkenMap(int w, int h) {
for (int y = 0; y < h + 1; y++) {
for (int x = 0; x < w + 1; x++) {
if (x <= 8 || y <= 8 || x >= w - 8 || y >= h - 8) {
newLevel.getSeen()[x + y * (w + 1)] = true;
}
}
}
}
protected void loadColorTile(int color, int x, int y) {
Tile tile = LevelUtils.getNewTileFromColor(color);
newLevel.setTile(x, y, tile);
if(tile instanceof FloorTile) {
Entity entity = LevelUtils.getNewEntityFromColor(color,x,y);
if(entity != null) {
newLevel.addEntity(entity);
}
}
}
protected void setupPlayerSpawnArea() {
newLevel.maxMonsters = 1500 + (int)DifficultyInformation.calculateStrength(500);
newLevel.addEntity(new ShopItemTurret(32 * (newLevel.width / 2 - 1.5), 4.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemHarvester(32 * (newLevel.width / 2 - .5), 4.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemBomb(32 * (newLevel.width / 2 + .5), 4.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemTurret(32 * (newLevel.width / 2 - 1.5), (newLevel.height - 4.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemHarvester(32 * (newLevel.width / 2 - .5), (newLevel.height - 4.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemBomb(32 * (newLevel.width / 2 + .5), (newLevel.height - 4.5) * 32, Team.Team1));
for (int i=0; i<3; i++){
newLevel.setTile((newLevel.width / 2) - i, 7, new UnbreakableRailTile(new SandTile()));
newLevel.setTile((newLevel.width / 2) - i, newLevel.height - 8, new UnbreakableRailTile(new SandTile()));
}
}
protected void setTickItems() {
}
protected void setVictoryCondition() {
}
protected void setTargetScore() {
}
}
>>>>>>>
package com.mojang.mojam.level.gamemode;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import javax.imageio.ImageIO;
import com.mojang.mojam.MojamComponent;
import com.mojang.mojam.entity.Entity;
import com.mojang.mojam.entity.building.ShopItemBomb;
import com.mojang.mojam.entity.building.ShopItemHarvester;
import com.mojang.mojam.entity.building.ShopItemRaygun;
import com.mojang.mojam.entity.building.ShopItemRifle;
import com.mojang.mojam.entity.building.ShopItemShotgun;
import com.mojang.mojam.entity.building.ShopItemTurret;
import com.mojang.mojam.entity.mob.Team;
import com.mojang.mojam.level.DifficultyInformation;
import com.mojang.mojam.level.Level;
import com.mojang.mojam.level.LevelInformation;
import com.mojang.mojam.level.LevelUtils;
import com.mojang.mojam.level.tile.FloorTile;
import com.mojang.mojam.level.tile.SandTile;
import com.mojang.mojam.level.tile.Tile;
import com.mojang.mojam.level.tile.UnbreakableRailTile;
public class GameMode {
public static final int LEVEL_BORDER_SIZE = 16;
protected Level newLevel;
public Level generateLevel(LevelInformation li, int player1Character, int player2Character) throws IOException {
BufferedImage bufferedImage;
//System.out.println("Loading level from file: "+li.getPath());
if(li.vanilla){
bufferedImage = ImageIO.read(MojamComponent.class.getResource(li.getPath()));
} else {
bufferedImage = ImageIO.read(new File(li.getPath()));
}
int w = bufferedImage.getWidth() + LEVEL_BORDER_SIZE;
int h = bufferedImage.getHeight() + LEVEL_BORDER_SIZE;
newLevel = new Level(w, h, player1Character, player2Character);
processLevelImage(bufferedImage, w, h);
darkenMap(w, h);
setupPlayerSpawnArea();
setTickItems();
setVictoryCondition();
setTargetScore();
return newLevel;
}
private void processLevelImage(BufferedImage bufferedImage, int w, int h) {
int[] rgbs = defaultRgbArray(w, h);
bufferedImage.getRGB(0, 0, w - 16, h - 16, rgbs, 8 + 8 * w, w);
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
int col = rgbs[x + y * w] & 0xffffffff;
loadColorTile(col, x, y);
}
}
}
private int[] defaultRgbArray(int width, int height) {
int[] rgbs = new int[width * height];
Arrays.fill(rgbs, 0xffA8A800);
for (int y = 0 + 4; y < height - 4; y++) {
for (int x = (width / 2) - 4; x < (width / 2) + 3; x++) {
rgbs[x + y * width] = 0xff888800;
}
}
for (int y = 0 + 5; y < height - 5; y++) {
for (int x = (width / 2) - 2; x < (width / 2) + 1; x++) {
rgbs[x + y * width] = 0xffA8A800;
}
}
return rgbs;
}
private void darkenMap(int w, int h) {
for (int y = 0; y < h + 1; y++) {
for (int x = 0; x < w + 1; x++) {
if (x <= 8 || y <= 8 || x >= w - 8 || y >= h - 8) {
newLevel.getSeen()[x + y * (w + 1)] = true;
}
}
}
}
protected void loadColorTile(int color, int x, int y) {
Tile tile = LevelUtils.getNewTileFromColor(color);
newLevel.setTile(x, y, tile);
if(tile instanceof FloorTile) {
Entity entity = LevelUtils.getNewEntityFromColor(color,x,y);
if(entity != null) {
newLevel.addEntity(entity);
}
}
}
protected void setupPlayerSpawnArea() {
newLevel.maxMonsters = 1500 + (int)DifficultyInformation.calculateStrength(500);
newLevel.addEntity(new ShopItemTurret(32 * (newLevel.width / 2 - 1.5), 4.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemHarvester(32 * (newLevel.width / 2 - .5), 4.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemBomb(32 * (newLevel.width / 2 + .5), 4.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemRifle(32 * (newLevel.width / 2 - 2.0), 7.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemShotgun(32 * (newLevel.width / 2 - 2.0), 6.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemRaygun(32 * (newLevel.width / 2 - 2.0), 5.5 * 32, Team.Team2));
newLevel.addEntity(new ShopItemTurret(32 * (newLevel.width / 2 - 1.5), (newLevel.height - 4.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemHarvester(32 * (newLevel.width / 2 - .5), (newLevel.height - 4.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemBomb(32 * (newLevel.width / 2 + .5), (newLevel.height - 4.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemRifle(32 * (newLevel.width / 2 - 2.0), (newLevel.height - 7.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemShotgun(32 * (newLevel.width / 2 - 2.0), (newLevel.height - 6.5) * 32, Team.Team1));
newLevel.addEntity(new ShopItemRaygun(32 * (newLevel.width / 2 - 2.0), (newLevel.height - 5.5) * 32, Team.Team1));
for (int i=0; i<3; i++){
newLevel.setTile((newLevel.width / 2) - i, 7, new UnbreakableRailTile(new SandTile()));
newLevel.setTile((newLevel.width / 2) - i, newLevel.height - 8, new UnbreakableRailTile(new SandTile()));
}
}
protected void setTickItems() {
}
protected void setVictoryCondition() {
}
protected void setTargetScore() {
}
} |
<<<<<<<
addMenu(menu);
addKeyListener(this);
ModSystem.init(this);
=======
menuStack.add(menu);
addKeyListener(menuStack);
>>>>>>>
ModSystem.init(this);
menuStack.add(menu);
addKeyListener(menuStack);
<<<<<<<
ModSystem.onWin(winner);
addMenu(new WinMenu(GAME_WIDTH, GAME_HEIGHT, winner, winningCharacter));
=======
menuStack.add(new WinMenu(GAME_WIDTH, GAME_HEIGHT, winner, winningCharacter));
>>>>>>>
ModSystem.onWin(winner);
menuStack.add(new WinMenu(GAME_WIDTH, GAME_HEIGHT, winner, winningCharacter));
<<<<<<<
private void clearMenus() {
while (!menuStack.isEmpty()) {
menuStack.pop();
}
}
private void addMenu(GuiMenu menu) {
menuStack.add(menu);
menu.addButtonListener(this);
}
private void popMenu() {
if (!menuStack.isEmpty()) {
menuStack.pop();
}
}
@Override
public void keyPressed(KeyEvent e) {
if (!menuStack.isEmpty()) {
menuStack.peek().keyPressed(e);
}
}
@Override
public void keyReleased(KeyEvent e) {
if (!menuStack.isEmpty()) {
menuStack.peek().keyReleased(e);
}
}
@Override
public void keyTyped(KeyEvent e) {
if (!menuStack.isEmpty()) {
menuStack.peek().keyTyped(e);
}
}
=======
>>>>>>> |
<<<<<<<
private float volume;
private boolean creative;
private boolean alternative;
private ClickableComponent btnMusic;
private ClickableComponent btnFx;
=======
private float volume;
>>>>>>>
private float volume;
private boolean creative;
private boolean alternative;
<<<<<<<
ClickableComponent back = addButton(new Button(TitleMenu.BACK_ID,
MojamComponent.texts.getStatic("back"),
MojamComponent.GAME_WIDTH - 128 - 20,
MojamComponent.GAME_HEIGHT - 24 - 25));
back.addListener(new ButtonListener() {
@Override
public void buttonPressed(ClickableComponent button) {
Options.saveProperties();
}
});
=======
int gameWidth = MojamComponent.GAME_WIDTH;
int gameHeight = MojamComponent.GAME_HEIGHT;
int offset = 32;
int xOffset = (gameWidth - Button.BUTTON_WIDTH) / 2;
int yOffset = (gameHeight - (7 * offset + 20 + 32)) / 2;
textY = yOffset;
yOffset += 32;
>>>>>>>
int gameWidth = MojamComponent.GAME_WIDTH;
int gameHeight = MojamComponent.GAME_HEIGHT;
int offset = 32;
int xOffset = (gameWidth - Button.BUTTON_WIDTH) / 2;
int yOffset = (gameHeight - (7 * offset + 20 + 32)) / 2;
textY = yOffset;
yOffset += 32;
<<<<<<<
MojamComponent.texts.getStatic("options.keyBindings"), tab1, 30));
ClickableComponent btnFs = addButton(new Checkbox(
TitleMenu.FULLSCREEN_ID,
MojamComponent.texts.getStatic("options.fullscreen"), tab1, 60,
=======
MojamComponent.texts.getStatic("options.keyBindings"), xOffset, yOffset));
ClickableComponent fullscreenBtn = addButton(new Checkbox(TitleMenu.FULLSCREEN_ID,
MojamComponent.texts.getStatic("options.fullscreen"), xOffset, yOffset += offset,
>>>>>>>
MojamComponent.texts.getStatic("options.keyBindings"), xOffset, yOffset));
ClickableComponent fullscreenBtn = addButton(new Checkbox(TitleMenu.FULLSCREEN_ID,
MojamComponent.texts.getStatic("options.fullscreen"), xOffset, yOffset += offset,
<<<<<<<
ClickableComponent btnFps = addButton(new Checkbox(TitleMenu.FPS_ID,
MojamComponent.texts.getStatic("options.showfps"), tab1, 90,
Options.getAsBoolean(Options.DRAW_FPS, Options.VALUE_FALSE)));
btnFps.addListener(new ButtonListener() {
=======
fpsBtn.addListener(new ButtonListener() {
>>>>>>>
fpsBtn.addListener(new ButtonListener() {
<<<<<<<
btnFx = addButton(new Slider(TitleMenu.VOLUME,
MojamComponent.texts.getStatic("options.volume"), tab1, 120,
volume));
btnFx.addListener(new ButtonListener() {
@Override
public void buttonPressed(ClickableComponent button) {
Slider slider = (Slider) btnFx;
volume = slider.value;
Options.set(Options.VOLUME, volume + "");
MojamComponent.soundPlayer.soundSystem
.setMasterVolume(slider.value);
}
});
btnMusic = addButton(new Slider(TitleMenu.MUSIC,
MojamComponent.texts.getStatic("options.music"), tab1, 150,
musicVolume));
btnMusic.addListener(new ButtonListener() {
@Override
public void buttonPressed(ClickableComponent button) {
Slider slider = (Slider) btnMusic;
musicVolume = slider.value;
Options.set(Options.MUSIC, musicVolume + "");
MojamComponent.soundPlayer.soundSystem.setVolume(
SoundPlayer.BACKGROUND_TRACK, slider.value);
}
});
ClickableComponent btnCrea = addButton(new Checkbox(
TitleMenu.CREATIVE_ID,
MojamComponent.texts.getStatic("options.creative"), tab1, 180,
Options.getAsBoolean(Options.CREATIVE, Options.VALUE_FALSE)));
btnCrea.addListener(new ButtonListener() {
=======
Options.set(Options.MUSIC, musicVolume + "");
MojamComponent.soundPlayer.soundSystem.setVolume(SoundPlayer.BACKGROUND_TRACK,
slider.value);
}
});
creativeModeBtn.addListener(new ButtonListener() {
>>>>>>>
Options.set(Options.MUSIC, musicVolume + "");
MojamComponent.soundPlayer.soundSystem.setVolume(SoundPlayer.BACKGROUND_TRACK,
slider.value);
}
});
creativeModeBtn.addListener(new ButtonListener() {
<<<<<<<
if (e.getKeyCode() == KeyEvent.VK_ENTER
|| e.getKeyCode() == KeyEvent.VK_ESCAPE) {
buttons.get(0).postClick();
=======
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
back.postClick();
} else if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_W) {
selectedItem--;
if (selectedItem < 0) {
selectedItem = buttons.size() - 1;
}
} else if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_S) {
selectedItem++;
if (selectedItem >= buttons.size()) {
selectedItem = 0;
}
} else if (e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_A) {
ClickableComponent button = buttons.get(selectedItem);
if (button instanceof Slider) {
Slider slider = (Slider) button;
float value = slider.value - 0.1f;
if (value < 0) {
value = 0;
}
slider.setValue(value);
slider.postClick();
}
} else if (e.getKeyCode() == KeyEvent.VK_RIGHT || e.getKeyCode() == KeyEvent.VK_D) {
ClickableComponent button = buttons.get(selectedItem);
if (button instanceof Slider) {
Slider slider = (Slider) button;
float value = slider.value + 0.1f;
if (value > 1) {
value = 1;
}
slider.setValue(value);
slider.postClick();
}
} else if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_E) {
e.consume();
ClickableComponent button = buttons.get(selectedItem);
if (button instanceof Slider) {
Slider slider = (Slider) button;
if (slider.value == 1) {
slider.setValue(0);
} else {
slider.setValue(1);
}
}
button.postClick();
>>>>>>>
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
back.postClick();
} else if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_W) {
selectedItem--;
if (selectedItem < 0) {
selectedItem = buttons.size() - 1;
}
} else if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_S) {
selectedItem++;
if (selectedItem >= buttons.size()) {
selectedItem = 0;
}
} else if (e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_A) {
ClickableComponent button = buttons.get(selectedItem);
if (button instanceof Slider) {
Slider slider = (Slider) button;
float value = slider.value - 0.1f;
if (value < 0) {
value = 0;
}
slider.setValue(value);
slider.postClick();
}
} else if (e.getKeyCode() == KeyEvent.VK_RIGHT || e.getKeyCode() == KeyEvent.VK_D) {
ClickableComponent button = buttons.get(selectedItem);
if (button instanceof Slider) {
Slider slider = (Slider) button;
float value = slider.value + 0.1f;
if (value > 1) {
value = 1;
}
slider.setValue(value);
slider.postClick();
}
} else if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_E) {
e.consume();
ClickableComponent button = buttons.get(selectedItem);
if (button instanceof Slider) {
Slider slider = (Slider) button;
if (slider.value == 1) {
slider.setValue(0);
} else {
slider.setValue(1);
}
}
button.postClick(); |
<<<<<<<
public class Checkbox extends ClickableComponent
{
private final int id;
private String label;
public boolean checked = false;
public static final int WIDTH = 140;
public static final int HEIGHT = 19;
public Checkbox(int id, String label, int x, int y)
{
this(id, label, x, y, false);
}
public Checkbox(int id, String label, int x, int y, boolean checked)
{
super(x, y, 128, 24);
this.id = id;
this.label = label;
this.checked = checked;
}
protected void clicked(MouseButtons mouseButtons)
{
checked = ! checked;
}
public void render(Screen screen)
{
if (isPressed()) {
if(checked)
screen.blit(Art.checkbox[1][1], getX(), getY());
else
screen.blit(Art.checkbox[0][1], getX(), getY());
} else {
if(checked)
screen.blit(Art.checkbox[1][0], getX(), getY());
else
screen.blit(Art.checkbox[0][0], getX(), getY());
}
Font.defaultFont().draw(screen, label, getX() + 24 + 4, getY() + getHeight() / 2 - 4);
}
public int getId()
{
return id;
}
public void setLabel(String label){
this.label = label;
}
=======
public class Checkbox extends ClickableComponent {
private final int id;
private String label;
public boolean checked = false;
public static final int WIDTH = 140;
public static final int HEIGHT = 19;
public Checkbox(int id, String label, int x, int y) {
this(id, label, x, y, false);
}
public Checkbox(int id, String label, int x, int y, boolean checked) {
super(x, y, 128, 24);
this.id = id;
this.label = label;
this.checked = checked;
}
protected void clicked(MouseButtons mouseButtons) {
checked = !checked;
}
public void render(Screen screen) {
if (isPressed()) {
if (checked)
screen.blit(Art.checkbox[1][1], getX(), getY());
else
screen.blit(Art.checkbox[0][1], getX(), getY());
} else {
if (checked)
screen.blit(Art.checkbox[1][0], getX(), getY());
else
screen.blit(Art.checkbox[0][0], getX(), getY());
}
Font.defaultFont().draw(screen, label, getX() + 24 + 4,
getY() + getHeight() / 2 - 4);
}
public int getId() {
return id;
}
>>>>>>>
public class Checkbox extends ClickableComponent {
private final int id;
private String label;
public boolean checked = false;
public static final int WIDTH = 140;
public static final int HEIGHT = 19;
public Checkbox(int id, String label, int x, int y) {
this(id, label, x, y, false);
}
public int getId()
{
return id;
}
public void setLabel(String label){
this.label = label;
}
public Checkbox(int id, String label, int x, int y, boolean checked) {
super(x, y, 128, 24);
this.id = id;
this.label = label;
this.checked = checked;
}
protected void clicked(MouseButtons mouseButtons) {
checked = !checked;
}
public void render(Screen screen) {
if (isPressed()) {
if (checked)
screen.blit(Art.checkbox[1][1], getX(), getY());
else
screen.blit(Art.checkbox[0][1], getX(), getY());
} else {
if (checked)
screen.blit(Art.checkbox[1][0], getX(), getY());
else
screen.blit(Art.checkbox[0][0], getX(), getY());
}
Font.defaultFont().draw(screen, label, getX() + 24 + 4,
getY() + getHeight() / 2 - 4);
} |
<<<<<<<
public Key weaponSlot1 = new Key("weaponSlot1");
public Key weaponSlot2 = new Key("weaponSlot2");
public Key weaponSlot3 = new Key("weaponSlot3");
public Key cycleLeft = new Key("cycleLeft");
public Key cycleRight = new Key("cycleRight");
=======
public Key console = new Key("console");
>>>>>>>
public Key console = new Key("console");
public Key weaponSlot1 = new Key("weaponSlot1");
public Key weaponSlot2 = new Key("weaponSlot2");
public Key weaponSlot3 = new Key("weaponSlot3");
public Key cycleLeft = new Key("cycleLeft");
public Key cycleRight = new Key("cycleRight"); |
<<<<<<<
=======
import com.mojang.mojam.MojamComponent;
import com.mojang.mojam.gui.components.Font;
import com.mojang.mojam.screen.AbstractScreen;
>>>>>>> |
<<<<<<<
public static int localTeam; // local team is the team of the client. This
// can be used to check if something should
// be only rendered on one person's screen
public int playerCharacter;
public int opponentCharacter;
=======
public static int localTeam; //local team is the team of the client. This can be used to check if something should be only rendered on one person's screen
public GameCharacter playerCharacter;
private boolean sendCharacter = false;
>>>>>>>
public static int localTeam; //local team is the team of the client. This can be used to check if something should be only rendered on one person's screen
public GameCharacter playerCharacter;
private boolean sendCharacter = false;
<<<<<<<
private void initCharacters() {
opponentCharacter = Art.HERR_VON_SPECK;
if (!Options.isCharacterIDset()) {
=======
private void initCharacters(){
if(!Options.isCharacterIDset()){
>>>>>>>
private void initCharacters(){
if(!Options.isCharacterIDset()){
<<<<<<<
// level = Level.fromFile(li);
level = mode.generateLevel(li, playerCharacter, opponentCharacter);
=======
//level = Level.fromFile(li);
level = mode.generateLevel(li);
>>>>>>>
//level = Level.fromFile(li);
level = mode.generateLevel(li);
<<<<<<<
// level.init();
players[0] = new Player(synchedKeys[0], synchedMouseButtons[0], level.width * Tile.WIDTH / 2 - 16, (level.height - 5 - 1) * Tile.HEIGHT - 16, Team.Team1, playerCharacter);
=======
// level.init();
players[0] = new Player(synchedKeys[0], synchedMouseButtons[0], level.width * Tile.WIDTH
/ 2 - 16, (level.height - 5 - 1) * Tile.HEIGHT - 16, Team.Team1, character);
>>>>>>>
// level.init();
players[0] = new Player(synchedKeys[0], synchedMouseButtons[0], level.width * Tile.WIDTH
/ 2 - 16, (level.height - 5 - 1) * Tile.HEIGHT - 16, Team.Team1, character);
<<<<<<<
players[1] = new Player(synchedKeys[1], synchedMouseButtons[1], level.width * Tile.WIDTH / 2 - 16, 7 * Tile.HEIGHT - 16, Team.Team2, opponentCharacter);
=======
players[1] = new Player(synchedKeys[1], synchedMouseButtons[1], level.width
* Tile.WIDTH / 2 - 16, 7 * Tile.HEIGHT - 16, Team.Team2, character);
>>>>>>>
players[1] = new Player(synchedKeys[1], synchedMouseButtons[1], level.width
* Tile.WIDTH / 2 - 16, 7 * Tile.HEIGHT - 16, Team.Team2, character);
<<<<<<<
level.addEntity(new Base(32 * Tile.WIDTH - 20, 32 * Tile.WIDTH - 20, Team.Team2));
=======
} else {
players[1] = null;
>>>>>>>
} else {
players[1] = null;
<<<<<<<
int characterID = winner == MojamComponent.localTeam ? playerCharacter : opponentCharacter;
addMenu(new WinMenu(GAME_WIDTH, GAME_HEIGHT, winner, characterID));
level = null;
return;
}
}
=======
GameCharacter winningCharacter = winner == players[0].getTeam() ? players[0].getCharacter()
: players[1].getCharacter();
addMenu(new WinMenu(GAME_WIDTH, GAME_HEIGHT, winner, winningCharacter));
level = null;
return;
}
}
>>>>>>>
GameCharacter winningCharacter = winner == players[0].getTeam() ? players[0].getCharacter()
: players[1].getCharacter();
addMenu(new WinMenu(GAME_WIDTH, GAME_HEIGHT, winner, winningCharacter));
level = null;
return;
}
}
<<<<<<<
if (level == null) {
=======
if (sendCharacter) {
synchronizer.addCommand(new CharacterCommand(localId, playerCharacter.ordinal()));
sendCharacter = false;
}
if (level == null) {
>>>>>>>
if (sendCharacter) {
synchronizer.addCommand(new CharacterCommand(localId, playerCharacter.ordinal()));
sendCharacter = false;
}
if (level == null) {
<<<<<<<
synchronizer.onStartGamePacket((StartGamePacket) packet);
TitleMenu.difficulty = DifficultyList.getDifficulties().get(sgPacker.getDifficulty());
=======
synchronizer.onStartGamePacket((StartGamePacket) packet);
TitleMenu.difficulty = DifficultyList.getDifficulties().get(
sgPacker.getDifficulty());
>>>>>>>
synchronizer.onStartGamePacket((StartGamePacket) packet);
TitleMenu.difficulty = DifficultyList.getDifficulties().get(
sgPacker.getDifficulty());
<<<<<<<
case TitleMenu.LOCALE_EN_ID:
setLocale("en");
break;
case TitleMenu.LOCALE_DE_ID:
setLocale("de");
break;
case TitleMenu.LOCALE_ES_ID:
setLocale("es");
break;
case TitleMenu.LOCALE_FR_ID:
setLocale("fr");
break;
case TitleMenu.LOCALE_IN_ID:
setLocale("in");
break;
case TitleMenu.LOCALE_IT_ID:
setLocale("it");
break;
case TitleMenu.LOCALE_NL_ID:
setLocale("nl");
break;
case TitleMenu.LOCALE_PT_BR_ID:
setLocale("pt_br");
break;
case TitleMenu.LOCALE_RU_ID:
setLocale("ru");
break;
case TitleMenu.LOCALE_SI_ID:
setLocale("si");
break;
case TitleMenu.LOCALE_SV_ID:
setLocale("sv");
break;
case TitleMenu.RETURN_TO_TITLESCREEN:
clearMenus();
level = null;
TitleMenu menu = new TitleMenu(GAME_WIDTH, GAME_HEIGHT);
addMenu(menu);
this.nextMusicInterval = 0;
soundPlayer.stopBackgroundMusic();
soundPlayer.startTitleMusic();
break;
case TitleMenu.START_GAME_ID:
clearMenus();
isMultiplayer = false;
chat.clear();
localId = 0;
MojamComponent.localTeam = Team.Team1;
synchronizer = new TurnSynchronizer(this, null, 0, 1);
synchronizer.setStarted(true);
createLevel(TitleMenu.level, TitleMenu.defaultGameMode);
soundPlayer.stopBackgroundMusic();
break;
case TitleMenu.SELECT_LEVEL_ID:
addMenu(new LevelSelect(false));
break;
case TitleMenu.SELECT_HOST_LEVEL_ID:
addMenu(new LevelSelect(true));
break;
/*
* case TitleMenu.UPDATE_LEVELS: GuiMenu menu = menuStack.pop(); if
* (menu instanceof LevelSelect) { addMenu(new
* LevelSelect(((LevelSelect) menu).bHosting)); } else { addMenu(new
* LevelSelect(false)); } }
*/
case TitleMenu.HOST_GAME_ID:
addMenu(new HostingWaitMenu());
isMultiplayer = true;
isServer = true;
chat.clear();
try {
if (isServer) {
localId = 0;
MojamComponent.localTeam = Team.Team1;
serverSocket = new ServerSocket(Options.getAsInteger(Options.MP_PORT, 3000));
serverSocket.setSoTimeout(1000);
hostThread = new Thread() {
=======
case TitleMenu.RETURN_TO_TITLESCREEN:
clearMenus();
level = null;
TitleMenu menu = new TitleMenu(GAME_WIDTH, GAME_HEIGHT);
addMenu(menu);
this.nextMusicInterval = 0;
soundPlayer.stopBackgroundMusic();
soundPlayer.startTitleMusic();
break;
case TitleMenu.START_GAME_ID:
clearMenus();
isMultiplayer = false;
chat.clear();
localId = 0;
MojamComponent.localTeam = Team.Team1;
synchronizer = new TurnSynchronizer(this, null, 0, 1);
synchronizer.setStarted(true);
createLevel(TitleMenu.level, TitleMenu.defaultGameMode, playerCharacter);
soundPlayer.stopBackgroundMusic();
break;
case TitleMenu.SELECT_LEVEL_ID:
addMenu(new LevelSelect(false));
break;
case TitleMenu.SELECT_HOST_LEVEL_ID:
addMenu(new LevelSelect(true));
break;
/*
* case TitleMenu.UPDATE_LEVELS:
* GuiMenu menu = menuStack.pop();
* if (menu instanceof LevelSelect) { addMenu(new
* LevelSelect(((LevelSelect) menu).bHosting)); } else { addMenu(new
* LevelSelect(false)); } }
*/
case TitleMenu.HOST_GAME_ID:
addMenu(new HostingWaitMenu());
isMultiplayer = true;
isServer = true;
chat.clear();
try {
if (isServer) {
localId = 0;
MojamComponent.localTeam = Team.Team1;
serverSocket = new ServerSocket(Options.getAsInteger(Options.MP_PORT, 3000));
serverSocket.setSoTimeout(1000);
hostThread = new Thread() {
>>>>>>>
case TitleMenu.LOCALE_EN_ID:
setLocale("en");
break;
case TitleMenu.LOCALE_DE_ID:
setLocale("de");
break;
case TitleMenu.LOCALE_ES_ID:
setLocale("es");
break;
case TitleMenu.LOCALE_FR_ID:
setLocale("fr");
break;
case TitleMenu.LOCALE_IN_ID:
setLocale("in");
break;
case TitleMenu.LOCALE_IT_ID:
setLocale("it");
break;
case TitleMenu.LOCALE_NL_ID:
setLocale("nl");
break;
case TitleMenu.LOCALE_PT_BR_ID:
setLocale("pt_br");
break;
case TitleMenu.LOCALE_RU_ID:
setLocale("ru");
break;
case TitleMenu.LOCALE_SI_ID:
setLocale("si");
break;
case TitleMenu.LOCALE_SV_ID:
setLocale("sv");
break;
case TitleMenu.RETURN_TO_TITLESCREEN:
clearMenus();
level = null;
TitleMenu menu = new TitleMenu(GAME_WIDTH, GAME_HEIGHT);
addMenu(menu);
this.nextMusicInterval = 0;
soundPlayer.stopBackgroundMusic();
soundPlayer.startTitleMusic();
break;
case TitleMenu.START_GAME_ID:
clearMenus();
isMultiplayer = false;
chat.clear();
localId = 0;
MojamComponent.localTeam = Team.Team1;
synchronizer = new TurnSynchronizer(this, null, 0, 1);
synchronizer.setStarted(true);
createLevel(TitleMenu.level, TitleMenu.defaultGameMode, playerCharacter);
soundPlayer.stopBackgroundMusic();
break;
case TitleMenu.SELECT_LEVEL_ID:
addMenu(new LevelSelect(false));
break;
case TitleMenu.SELECT_HOST_LEVEL_ID:
addMenu(new LevelSelect(true));
break;
/*
* case TitleMenu.UPDATE_LEVELS: GuiMenu menu = menuStack.pop(); if
* (menu instanceof LevelSelect) { addMenu(new
* LevelSelect(((LevelSelect) menu).bHosting)); } else { addMenu(new
* LevelSelect(false)); } }
*/
case TitleMenu.HOST_GAME_ID:
addMenu(new HostingWaitMenu());
isMultiplayer = true;
isServer = true;
chat.clear();
try {
if (isServer) {
localId = 0;
MojamComponent.localTeam = Team.Team1;
serverSocket = new ServerSocket(Options.getAsInteger(Options.MP_PORT, 3000));
serverSocket.setSoTimeout(1000);
hostThread = new Thread() { |
<<<<<<<
import javax.annotation.PostConstruct;
import org.ngrinder.agent.model.AgentInfo;
import org.ngrinder.agent.service.AgentService;
=======
import org.ngrinder.agent.model.Agent;
>>>>>>>
import org.ngrinder.agent.model.AgentInfo;
<<<<<<<
@Autowired
private AgentService agentService;
@PostConstruct
public void init() {
Page<AgentInfo> agents = agentService.getAgents(null, null);
List<AgentInfo> agentList = agents.getContent();
this.addMonitorAgents("init", new HashSet<AgentInfo>(agentList));
}
=======
>>>>>>> |
<<<<<<<
monitorRecordWriterMap = new Hashtable<String, BufferedWriter>(agents.size());
monitorClientsMap = new HashMap<String, MonitorClientSerivce>(agents.size());
for (AgentInfo target : agents) {
String targetIP = target.getIp();
//create from context, because we use spring Asycn function to get monitor data
// from MBClient asynchronized.
MonitorClientSerivce clientServ = appContext.getBean(MonitorClientSerivce.class);
clientServ.init(targetIP, target.getPort());
monitorClientsMap.put(targetIP, clientServ);
//prepare monitor data file
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(new File(
singleConsole.getReportPath(), Config.MONITOR_FILE_PREFIX + targetIP + ".data"), false));
monitorRecordWriterMap.put(targetIP, bw);
//write header info
bw.write(SystemInfo.header);
bw.newLine();
bw.flush();
} catch (IOException e) {
LOG.error("Creating monitor data file error:{}", e.getMessage());
LOG.debug(e.getMessage(), e);
}
}
=======
monitorDataService.addMonitorAgents(agents);
for (OnTestSamplingRunnable each : testSamplingRnnables) {
try {
each.startSampling(singleConsole, perfTest, perfTestService);
} catch (Exception e) {
LOG.error("While running plugins, the error occurs.");
LOG.error("Details : ", e);
}
}
>>>>>>>
monitorRecordWriterMap = new Hashtable<String, BufferedWriter>(agents.size());
monitorClientsMap = new HashMap<String, MonitorClientSerivce>(agents.size());
for (AgentInfo target : agents) {
String targetIP = target.getIp();
// create from context, because we use spring Asycn function to get monitor data
// from MBClient asynchronized.
MonitorClientSerivce clientServ = appContext.getBean(MonitorClientSerivce.class);
clientServ.init(targetIP, target.getPort());
monitorClientsMap.put(targetIP, clientServ);
// prepare monitor data file
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(new File(singleConsole.getReportPath(),
Config.MONITOR_FILE_PREFIX + targetIP + ".data"), false));
monitorRecordWriterMap.put(targetIP, bw);
// write header info
bw.write(SystemInfo.header);
bw.newLine();
bw.flush();
} catch (IOException e) {
LOG.error("Creating monitor data file error:{}", e.getMessage());
LOG.debug(e.getMessage(), e);
}
}
for (OnTestSamplingRunnable each : testSamplingRnnables) {
try {
each.startSampling(singleConsole, perfTest, perfTestService);
} catch (Exception e) {
LOG.error("While running plugins, the error occurs.");
LOG.error("Details : ", e);
}
}
<<<<<<<
//monitorDataService.removeMonitorAgents(agents);
for (String ip : monitorRecordWriterMap.keySet()) {
BufferedWriter bw = monitorRecordWriterMap.get(ip);
IOUtils.closeQuietly(bw);
monitorClientsMap.get(ip).close();
}
monitorRecordWriterMap.clear();
monitorClientsMap.clear();
=======
monitorDataService.removeMonitorAgents(agents);
for (OnTestSamplingRunnable each : testSamplingRnnables) {
try {
each.endSampling(singleConsole, perfTest, perfTestService);
} catch (Exception e) {
LOG.error("While running plugin the following error occurs.");
LOG.error("Details : ", e);
}
}
>>>>>>>
// monitorDataService.removeMonitorAgents(agents);
for (String ip : monitorRecordWriterMap.keySet()) {
BufferedWriter bw = monitorRecordWriterMap.get(ip);
IOUtils.closeQuietly(bw);
monitorClientsMap.get(ip).close();
}
monitorRecordWriterMap.clear();
monitorClientsMap.clear();
for (OnTestSamplingRunnable each : testSamplingRnnables) {
try {
each.endSampling(singleConsole, perfTest, perfTestService);
} catch (Exception e) {
LOG.error("While running plugin the following error occurs.");
LOG.error("Details : ", e);
}
}
<<<<<<<
for (String targetIP : monitorRecordWriterMap.keySet()) {
BufferedWriter bw = monitorRecordWriterMap.get(targetIP);
monitorClientsMap.get(targetIP).recordMonitorData(bw);
}
=======
for (OnTestSamplingRunnable each : testSamplingRnnables) {
try {
each.sampling(singleConsole, perfTest, perfTestService, intervalStatistics,
cumulativeStatistics);
} catch (Exception e) {
LOG.error("While running plugin the following error occurs");
LOG.error("Details : ", e);
}
}
>>>>>>>
for (String targetIP : monitorRecordWriterMap.keySet()) {
BufferedWriter bw = monitorRecordWriterMap.get(targetIP);
monitorClientsMap.get(targetIP).recordMonitorData(bw);
}
for (OnTestSamplingRunnable each : testSamplingRnnables) {
try {
each.sampling(singleConsole, perfTest, perfTestService, intervalStatistics,
cumulativeStatistics);
} catch (Exception e) {
LOG.error("While running plugin the following error occurs");
LOG.error("Details : ", e);
}
} |
<<<<<<<
Set<AgentInfo> agents = new HashSet<AgentInfo>();
AgentInfo agt = new AgentInfo();
agt.setAppPort(10086);
=======
Set<Agent> agents = new HashSet<Agent>();
Agent agt = new Agent();
>>>>>>>
Set<AgentInfo> agents = new HashSet<AgentInfo>();
AgentInfo agt = new AgentInfo(); |
<<<<<<<
=======
private static SecurityPermission TABLE_MANAGER_PERMISSION = new SecurityPermission(
"tableManagerPermission");
>>>>>>>
<<<<<<<
private static final Set<TableObserver> observers = Collections.synchronizedSet(new HashSet<TableObserver>());
private static final Map<Table.ID,TableState> tableStateCache = Collections.synchronizedMap(new HashMap<>());
=======
private static final Set<TableObserver> observers = Collections
.synchronizedSet(new HashSet<TableObserver>());
private static final Map<String,TableState> tableStateCache = Collections
.synchronizedMap(new HashMap<String,TableState>());
>>>>>>>
private static final Set<TableObserver> observers = Collections
.synchronizedSet(new HashSet<TableObserver>());
private static final Map<Table.ID,TableState> tableStateCache = Collections
.synchronizedMap(new HashMap<>());
<<<<<<<
public static void prepareNewNamespaceState(String instanceId, Namespace.ID namespaceId, String namespace, NodeExistsPolicy existsPolicy)
throws KeeperException, InterruptedException {
log.debug("Creating ZooKeeper entries for new namespace {} (ID: {})", namespace, namespaceId);
=======
public static void prepareNewNamespaceState(String instanceId, String namespaceId,
String namespace, NodeExistsPolicy existsPolicy)
throws KeeperException, InterruptedException {
log.debug(
"Creating ZooKeeper entries for new namespace " + namespace + " (ID: " + namespaceId + ")");
>>>>>>>
public static void prepareNewNamespaceState(String instanceId, Namespace.ID namespaceId,
String namespace, NodeExistsPolicy existsPolicy)
throws KeeperException, InterruptedException {
log.debug("Creating ZooKeeper entries for new namespace {} (ID: {})", namespace, namespaceId);
<<<<<<<
public static void prepareNewTableState(String instanceId, Table.ID tableId, Namespace.ID namespaceId, String tableName, TableState state,
NodeExistsPolicy existsPolicy) throws KeeperException, InterruptedException {
=======
public static void prepareNewTableState(String instanceId, String tableId, String namespaceId,
String tableName, TableState state, NodeExistsPolicy existsPolicy)
throws KeeperException, InterruptedException {
>>>>>>>
public static void prepareNewTableState(String instanceId, Table.ID tableId,
Namespace.ID namespaceId, String tableName, TableState state, NodeExistsPolicy existsPolicy)
throws KeeperException, InterruptedException {
<<<<<<<
log.debug("Creating ZooKeeper entries for new table {} (ID: {}) in namespace (ID: {})", tableName, tableId, namespaceId);
=======
log.debug("Creating ZooKeeper entries for new table " + tableName + " (ID: " + tableId
+ ") in namespace (ID: " + namespaceId + ")");
>>>>>>>
log.debug("Creating ZooKeeper entries for new table {} (ID: {}) in namespace (ID: {})",
tableName, tableId, namespaceId);
<<<<<<<
zoo.putPersistentData(zTablePath + Constants.ZTABLE_NAMESPACE, namespaceId.getUtf8(), existsPolicy);
zoo.putPersistentData(zTablePath + Constants.ZTABLE_NAME, tableName.getBytes(UTF_8), existsPolicy);
=======
zoo.putPersistentData(zTablePath + Constants.ZTABLE_NAMESPACE, namespaceId.getBytes(UTF_8),
existsPolicy);
zoo.putPersistentData(zTablePath + Constants.ZTABLE_NAME, tableName.getBytes(UTF_8),
existsPolicy);
>>>>>>>
zoo.putPersistentData(zTablePath + Constants.ZTABLE_NAMESPACE, namespaceId.getUtf8(),
existsPolicy);
zoo.putPersistentData(zTablePath + Constants.ZTABLE_NAME, tableName.getBytes(UTF_8),
existsPolicy);
<<<<<<<
public synchronized void transitionTableState(final Table.ID tableId, final TableState newState) {
String statePath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE;
=======
public synchronized void transitionTableState(final String tableId, final TableState newState) {
String statePath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTABLES + "/"
+ tableId + Constants.ZTABLE_STATE;
>>>>>>>
public synchronized void transitionTableState(final Table.ID tableId, final TableState newState) {
String statePath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTABLES + "/"
+ tableId + Constants.ZTABLE_STATE;
<<<<<<<
ZooReaderWriter.getInstance().mutate(statePath, newState.name().getBytes(UTF_8), ZooUtil.PUBLIC, new Mutator() {
@Override
public byte[] mutate(byte[] oldData) throws Exception {
TableState oldState = TableState.UNKNOWN;
if (oldData != null)
oldState = TableState.valueOf(new String(oldData, UTF_8));
boolean transition = true;
// +--------+
// v |
// NEW -> (ONLINE|OFFLINE)+--- DELETING
switch (oldState) {
case NEW:
transition = (newState == TableState.OFFLINE || newState == TableState.ONLINE);
break;
case ONLINE: // fall-through intended
case UNKNOWN:// fall through intended
case OFFLINE:
transition = (newState != TableState.NEW);
break;
case DELETING:
// Can't transition to any state from DELETING
transition = false;
break;
}
if (!transition)
throw new IllegalTableTransitionException(oldState, newState);
log.debug("Transitioning state for table {} from {} to {}", tableId, oldState, newState);
return newState.name().getBytes(UTF_8);
}
});
=======
ZooReaderWriter.getInstance().mutate(statePath, newState.name().getBytes(UTF_8),
ZooUtil.PUBLIC, new Mutator() {
@Override
public byte[] mutate(byte[] oldData) throws Exception {
TableState oldState = TableState.UNKNOWN;
if (oldData != null)
oldState = TableState.valueOf(new String(oldData, UTF_8));
boolean transition = true;
// +--------+
// v |
// NEW -> (ONLINE|OFFLINE)+--- DELETING
switch (oldState) {
case NEW:
transition = (newState == TableState.OFFLINE || newState == TableState.ONLINE);
break;
case ONLINE: // fall-through intended
case UNKNOWN:// fall through intended
case OFFLINE:
transition = (newState != TableState.NEW);
break;
case DELETING:
// Can't transition to any state from DELETING
transition = false;
break;
}
if (!transition)
throw new IllegalTableTransitionException(oldState, newState);
log.debug("Transitioning state for table " + tableId + " from " + oldState + " to "
+ newState);
return newState.name().getBytes(UTF_8);
}
});
>>>>>>>
ZooReaderWriter.getInstance().mutate(statePath, newState.name().getBytes(UTF_8),
ZooUtil.PUBLIC, new Mutator() {
@Override
public byte[] mutate(byte[] oldData) throws Exception {
TableState oldState = TableState.UNKNOWN;
if (oldData != null)
oldState = TableState.valueOf(new String(oldData, UTF_8));
boolean transition = true;
// +--------+
// v |
// NEW -> (ONLINE|OFFLINE)+--- DELETING
switch (oldState) {
case NEW:
transition = (newState == TableState.OFFLINE || newState == TableState.ONLINE);
break;
case ONLINE: // fall-through intended
case UNKNOWN:// fall through intended
case OFFLINE:
transition = (newState != TableState.NEW);
break;
case DELETING:
// Can't transition to any state from DELETING
transition = false;
break;
}
if (!transition)
throw new IllegalTableTransitionException(oldState, newState);
log.debug("Transitioning state for table {} from {} to {}", tableId, oldState,
newState);
return newState.name().getBytes(UTF_8);
}
});
<<<<<<<
for (String tableId : zooStateCache.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES))
if (zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE) != null)
updateTableStateCache(Table.ID.of(tableId));
=======
for (String tableId : zooStateCache
.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES))
if (zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId
+ Constants.ZTABLE_STATE) != null)
updateTableStateCache(tableId);
>>>>>>>
for (String tableId : zooStateCache
.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES))
if (zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId
+ Constants.ZTABLE_STATE) != null)
updateTableStateCache(Table.ID.of(tableId));
<<<<<<<
public void removeNamespace(Namespace.ID namespaceId) throws KeeperException, InterruptedException {
ZooReaderWriter.getInstance().recursiveDelete(ZooUtil.getRoot(instance) + Constants.ZNAMESPACES + "/" + namespaceId, NodeMissingPolicy.SKIP);
=======
public void removeNamespace(String namespaceId) throws KeeperException, InterruptedException {
ZooReaderWriter.getInstance().recursiveDelete(
ZooUtil.getRoot(instance) + Constants.ZNAMESPACES + "/" + namespaceId,
NodeMissingPolicy.SKIP);
>>>>>>>
public void removeNamespace(Namespace.ID namespaceId)
throws KeeperException, InterruptedException {
ZooReaderWriter.getInstance().recursiveDelete(
ZooUtil.getRoot(instance) + Constants.ZNAMESPACES + "/" + namespaceId,
NodeMissingPolicy.SKIP); |
<<<<<<<
//update statistic cache
perfTestService.getAndPutAgentsInfo(perfTest.getRegion(), perfTest.getPort());
perfTestService.getAndPutStatistics(perfTest.getRegion(), perfTest.getPort());
=======
for (OnTestSamplingRunnable each : testSamplingRnnables) {
try {
each.sampling(singleConsole, perfTest, perfTestService, intervalStatistics,
cumulativeStatistics);
} catch (Exception e) {
LOG.error("While running plugin the following error occurs");
LOG.error("Details : ", e);
}
}
>>>>>>>
//update statistic cache
perfTestService.getAndPutAgentsInfo(perfTest.getRegion(), perfTest.getPort());
perfTestService.getAndPutStatistics(perfTest.getRegion(), perfTest.getPort());
for (OnTestSamplingRunnable each : testSamplingRnnables) {
try {
each.sampling(singleConsole, perfTest, perfTestService, intervalStatistics,
cumulativeStatistics);
} catch (Exception e) {
LOG.error("While running plugin the following error occurs");
LOG.error("Details : ", e);
}
} |
<<<<<<<
=======
/**
* User Name e.g) Jone Dogh.
*/
>>>>>>>
/**
* User Name e.g) Jone Dogh.
*/ |
<<<<<<<
public ProblemReport(String table, ProblemType problemType, String resource, String server, Throwable e) {
checkNotNull(table, "table is null");
checkNotNull(problemType, "problemType is null");
checkNotNull(resource, "resource is null");
=======
public ProblemReport(String table, ProblemType problemType, String resource, String server, Throwable e, long creationTime) {
ArgumentChecker.notNull(table, problemType, resource);
>>>>>>>
public ProblemReport(String table, ProblemType problemType, String resource, String server, Throwable e, long creationTime) {
checkNotNull(table, "table is null");
checkNotNull(problemType, "problemType is null");
checkNotNull(resource, "resource is null"); |
<<<<<<<
import org.la4j.iterator.VectorIterator;
import org.la4j.matrix.Matrices;
=======
import org.la4j.io.VectorIterator;
>>>>>>>
import org.la4j.iterator.VectorIterator; |
<<<<<<<
Assert.assertTrue(getConnector().tableOperations().exists(ReplicationTable.NAME));
Assert.assertEquals(ReplicationTable.ID.canonicalID(),
=======
assertTrue(getConnector().tableOperations().exists(ReplicationTable.NAME));
assertEquals(ReplicationTable.ID,
>>>>>>>
assertTrue(getConnector().tableOperations().exists(ReplicationTable.NAME));
assertEquals(ReplicationTable.ID.canonicalID(),
<<<<<<<
String fileUri = k.getRow().toString();
try {
new URI(fileUri);
} catch (URISyntaxException e) {
Assert.fail("Expected a valid URI: " + fileUri);
}
=======
String fileUri = k.getRow().toString();
try {
new URI(fileUri);
} catch (URISyntaxException e) {
fail("Expected a valid URI: " + fileUri);
}
>>>>>>>
String fileUri = k.getRow().toString();
try {
new URI(fileUri);
} catch (URISyntaxException e) {
fail("Expected a valid URI: " + fileUri);
}
<<<<<<<
try (Scanner s = ReplicationTable.getScanner(conn)) {
StatusSection.limit(s);
Iterator<Entry<Key,Value>> iter = s.iterator();
Assert.assertTrue("Found no records in replication table", iter.hasNext());
entry = iter.next();
Assert.assertTrue("Expected to find element in replication table",
tableIds.remove(entry.getKey().getColumnQualifier().toString()));
Assert.assertTrue("Expected to find two elements in replication table, only found one ",
iter.hasNext());
entry = iter.next();
Assert.assertTrue("Expected to find element in replication table",
tableIds.remove(entry.getKey().getColumnQualifier().toString()));
Assert.assertFalse("Expected to only find two elements in replication table", iter.hasNext());
}
=======
s = ReplicationTable.getScanner(conn);
StatusSection.limit(s);
Iterator<Entry<Key,Value>> iter = s.iterator();
assertTrue("Found no records in replication table", iter.hasNext());
entry = iter.next();
assertTrue("Expected to find element in replication table",
tableIds.remove(entry.getKey().getColumnQualifier().toString()));
assertTrue("Expected to find two elements in replication table, only found one ",
iter.hasNext());
entry = iter.next();
assertTrue("Expected to find element in replication table",
tableIds.remove(entry.getKey().getColumnQualifier().toString()));
assertFalse("Expected to only find two elements in replication table", iter.hasNext());
>>>>>>>
try (Scanner s = ReplicationTable.getScanner(conn)) {
StatusSection.limit(s);
Iterator<Entry<Key,Value>> iter = s.iterator();
assertTrue("Found no records in replication table", iter.hasNext());
entry = iter.next();
assertTrue("Expected to find element in replication table",
tableIds.remove(entry.getKey().getColumnQualifier().toString()));
assertTrue("Expected to find two elements in replication table, only found one ",
iter.hasNext());
entry = iter.next();
assertTrue("Expected to find element in replication table",
tableIds.remove(entry.getKey().getColumnQualifier().toString()));
assertFalse("Expected to only find two elements in replication table", iter.hasNext());
}
<<<<<<<
actual = Status.parseFrom(Iterables.getOnlyElement(s).getValue().get());
Assert.assertEquals(stat1, actual);
=======
Status actual = Status.parseFrom(Iterables.getOnlyElement(s).getValue().get());
assertEquals(stat1, actual);
>>>>>>>
actual = Status.parseFrom(Iterables.getOnlyElement(s).getValue().get());
assertEquals(stat1, actual);
<<<<<<<
Assert.assertEquals(expected, actual);
}
=======
assertEquals(expected, actual);
>>>>>>>
assertEquals(expected, actual);
}
<<<<<<<
=======
fail("We had a file that was referenced but didn't get closed");
>>>>>>>
<<<<<<<
=======
assertFalse("Did not find the work entry for the status entry", notFound);
}
// Write some more data so that we over-run the single WAL
writeSomeData(conn, table1, 3000, 50);
log.info("Issued compaction for table");
conn.tableOperations().compact(table1, null, null, true, true);
log.info("Compaction completed");
>>>>>>>
<<<<<<<
Assert.assertEquals(2, numRecords);
}
=======
assertEquals(2, numRecords);
>>>>>>>
assertEquals(2, numRecords);
}
<<<<<<<
=======
assertFalse("Did not find the work entries for the status entries", notFound);
>>>>>>>
<<<<<<<
Table.ID tableId = Table.ID.of(conn.tableOperations().tableIdMap().get(table1));
Assert.assertNotNull("Table ID was null", tableId);
=======
String tableId = conn.tableOperations().tableIdMap().get(table1);
assertNotNull("Table ID was null", tableId);
>>>>>>>
Table.ID tableId = Table.ID.of(conn.tableOperations().tableIdMap().get(table1));
assertNotNull("Table ID was null", tableId);
<<<<<<<
=======
fail("Expected all replication records in the metadata table to be closed");
>>>>>>>
<<<<<<<
=======
fail("Expected all replication records in the replication table to be closed");
>>>>>>>
<<<<<<<
Table.ID tableId = Table.ID.of(conn.tableOperations().tableIdMap().get(table1));
Assert.assertNotNull("Could not determine table id for " + table1, tableId);
=======
String tableId = conn.tableOperations().tableIdMap().get(table1);
assertNotNull("Could not determine table id for " + table1, tableId);
>>>>>>>
Table.ID tableId = Table.ID.of(conn.tableOperations().tableIdMap().get(table1));
assertNotNull("Could not determine table id for " + table1, tableId);
<<<<<<<
=======
fail("Found more than one work section entry");
>>>>>>>
<<<<<<<
Assert.assertTrue("Found unexpected replication records in the replication table",
recordsFound <= 2);
=======
assertTrue("Found unexpected replication records in the replication table", recordsFound <= 2);
>>>>>>>
assertTrue("Found unexpected replication records in the replication table", recordsFound <= 2); |
<<<<<<<
public List<? extends Element> withLeading() { return $this; }
public List<? extends Element> withTrailing() { return $this; }
public <Other>Iterable<? extends Other> withLeading$elements() { return (Iterable)$this; }
public <Other>Iterable<? extends Other> withTrailing$elements() { return (Iterable)$this; }
=======
@SuppressWarnings("rawtypes")
public <Other> List withLeading() { return $this; }
@SuppressWarnings("rawtypes")
public <Other> List withTrailing() { return $this; }
>>>>>>>
@SuppressWarnings("rawtypes")
public List<? extends Element> withLeading() { return $this; }
@SuppressWarnings("rawtypes")
public List<? extends Element> withTrailing() { return $this; }
public <Other>Iterable<? extends Other> withLeading$elements() { return (Iterable)$this; }
public <Other>Iterable<? extends Other> withTrailing$elements() { return (Iterable)$this; } |
<<<<<<<
// add the category of the file (this is searched so the value can also be attached on a folder)
String value = CmsProperty.get(CmsPropertyDefinition.PROPERTY_SEARCH_CATEGORY, propertiesSearched).getValue();
=======
Document doc = (Document)document.getDocument();
String value = CmsProperty.get(CmsPropertyDefinition.PROPERTY_SEARCH_CATEGORY, propertiesSearched).getValue();
>>>>>>>
Document doc = (Document)document.getDocument();
// add the category of the file (this is searched so the value can also be attached on a folder)
String value = CmsProperty.get(CmsPropertyDefinition.PROPERTY_SEARCH_CATEGORY, propertiesSearched).getValue();
<<<<<<<
Fieldable field = new Field(
CmsSearchField.FIELD_CATEGORY,
value,
Field.Store.YES,
Field.Index.NOT_ANALYZED);
field.setBoost(0);
document.add(field);
}
=======
Fieldable field = new Field(
I_CmsSearchField.FIELD_CATEGORY,
value,
Field.Store.YES,
Field.Index.NOT_ANALYZED);
field.setBoost(0.0F);
doc.add(field);
}
>>>>>>>
Fieldable field = new Field(
I_CmsSearchField.FIELD_CATEGORY,
value,
Field.Store.YES,
Field.Index.NOT_ANALYZED);
field.setBoost(0);
doc.add(field);
} |
<<<<<<<
String link = CmsFileUtil.removeTrailingSeparator(pageLink) + "/" + detailName;
return new CmsReturnLinkInfo(link, CmsReturnLinkInfo.Status.ok);
} catch (CmsVfsResourceNotFoundException e) {
=======
String uri = CmsStringUtil.joinPaths(pagePath, detailName);
return new CmsReturnLinkInfo(
CmsStringUtil.joinPaths(OpenCms.getSystemInfo().getOpenCmsContext(), uri),
CmsReturnLinkInfo.Status.ok);
} catch (@SuppressWarnings("unused") CmsVfsResourceNotFoundException e) {
>>>>>>>
String link = CmsFileUtil.removeTrailingSeparator(pageLink) + "/" + detailName;
return new CmsReturnLinkInfo(link, CmsReturnLinkInfo.Status.ok);
} catch (@SuppressWarnings("unused") CmsVfsResourceNotFoundException e) { |
<<<<<<<
=======
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
>>>>>>>
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
<<<<<<<
=======
* Checks whether the selected user and password are valid and the user has the ROOT_ADMIN role.<p>
*
* @return <code>true</code> if the selected user and password are valid and the user has the ROOT_ADMIN role
*/
public boolean isValidUser() {
CmsShell shell = new CmsShell(
getWebAppRfsPath() + "WEB-INF" + File.separator,
getServletMapping(),
getDefaultWebApplication(),
"${user}@${project}>",
null);
boolean validUser = shell.validateUser(getAdminUser(), getAdminPwd(), CmsRole.ROOT_ADMIN);
shell.exit();
return validUser;
}
/**
* Try to preload necessary classes, to avoid ugly class loader issues caused by JARs being deleted during the update.
*/
public void preload() {
//opencms.jar
preload(OpenCms.class);
//guava
preload(MapMaker.class);
//xerces
preload(org.apache.xerces.impl.Constants.class);
}
/**
* Preloads classes from the same jar file as a given class.<p>
*
* @param cls the class for which the classes from the same jar file should be loaded
*/
public void preload(Class<?> cls) {
try {
File jar = new File(cls.getProtectionDomain().getCodeSource().getLocation().getFile());
java.util.jar.JarFile jarfile = new JarFile(jar);
try {
Enumeration<JarEntry> entries = jarfile.entries();
while (entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
String name = entry.getName();
if (name.endsWith(".class")) {
String className = name.replaceFirst("\\.class$", "");
className = className.replace('/', '.');
try {
Class.forName(className);
} catch (VirtualMachineError e) {
throw e;
} catch (Throwable e) {
LOG.error(e.getLocalizedMessage(), e);
}
}
}
} finally {
jarfile.close();
}
} catch (VirtualMachineError e) {
throw e;
} catch (Throwable e) {
LOG.error(e.getLocalizedMessage(), e);
}
}
/**
>>>>>>>
* Checks whether the selected user and password are valid and the user has the ROOT_ADMIN role.<p>
*
* @return <code>true</code> if the selected user and password are valid and the user has the ROOT_ADMIN role
*/
public boolean isValidUser() {
CmsShell shell = new CmsShell(
getWebAppRfsPath() + "WEB-INF" + File.separator,
getServletMapping(),
getDefaultWebApplication(),
"${user}@${project}>",
null);
boolean validUser = shell.validateUser(getAdminUser(), getAdminPwd(), CmsRole.ROOT_ADMIN);
shell.exit();
return validUser;
}
/**
<<<<<<<
=======
preload();
>>>>>>> |
<<<<<<<
=======
* Returns an analyzer for the given class name.<p>
*
* Since Lucene 3.0, many analyzers require a "version" parameter in the constructor and
* can not be created by a simple <code>newInstance()</code> call.
* This method will create analyzers by name for the {@link CmsSearchIndex#LUCENE_VERSION} version.<p>
*
* @param className the class name of the analyzer
* @param stemmer the optional stemmer parameter required for the snowball analyzer
*
* @return the appropriate lucene analyzer
*
* @throws Exception if something goes wrong
*
* @deprecated The stemmer parameter is used only by the snownall analyzer, which is deprecated in Lucene 3.
*/
@Deprecated
private static Analyzer getAnalyzer(String className, String stemmer) throws Exception {
Analyzer analyzer = null;
Class<?> analyzerClass;
try {
analyzerClass = Class.forName(className);
} catch (ClassNotFoundException e) {
// allow Lucene standard classes to be written in a short form
analyzerClass = Class.forName(LUCENE_ANALYZER + className);
LOG.warn(e.getLocalizedMessage(), e);
}
// since Lucene 3.0 most analyzers need a "version" parameter and don't support an empty constructor
if (StandardAnalyzer.class.equals(analyzerClass)) {
// the Lucene standard analyzer is used
analyzer = new StandardAnalyzer(CmsSearchIndex.LUCENE_VERSION);
} else if (CmsGallerySearchAnalyzer.class.equals(analyzerClass)) {
// OpenCms gallery multiple language analyzer
analyzer = new CmsGallerySearchAnalyzer(CmsSearchIndex.LUCENE_VERSION);
} else {
boolean hasEmpty = false;
boolean hasVersion = false;
boolean hasVersionWithString = false;
// another analyzer is used, check if we find a suitable constructor
Constructor<?>[] constructors = analyzerClass.getConstructors();
for (int i = 0; i < constructors.length; i++) {
Constructor<?> c = constructors[i];
Class<?>[] parameters = c.getParameterTypes();
if (parameters.length == 0) {
// an empty constructor has been found
hasEmpty = true;
}
if ((parameters.length == 1) && parameters[0].equals(Version.class)) {
// a constructor with a Lucene version parameter has been found
hasVersion = true;
}
if ((stemmer != null)
&& (parameters.length == 2)
&& parameters[0].equals(Version.class)
&& parameters[1].equals(String.class)) {
// a constructor with a Lucene version parameter and a String has been found
hasVersionWithString = true;
}
}
if (hasVersionWithString) {
// a constructor with a Lucene version parameter and a String has been found
analyzer = (Analyzer)analyzerClass.getDeclaredConstructor(
new Class[] {Version.class, String.class}).newInstance(CmsSearchIndex.LUCENE_VERSION, stemmer);
} else if (hasVersion) {
// a constructor with a Lucene version parameter has been found
analyzer = (Analyzer)analyzerClass.getDeclaredConstructor(new Class[] {Version.class}).newInstance(
CmsSearchIndex.LUCENE_VERSION);
} else if (hasEmpty) {
// an empty constructor has been found
analyzer = (Analyzer)analyzerClass.newInstance();
}
}
return analyzer;
}
/**
>>>>>>>
<<<<<<<
* Creates the Solr core container.<p>
*
* @return the created core container
*/
private CoreContainer createCoreContainer() {
CoreContainer container = null;
try {
// get the core container
// still no core container: create it
container = CoreContainer.createAndLoad(m_solrConfig.getHome(), m_solrConfig.getSolrFile());
if (CmsLog.INIT.isInfoEnabled()) {
CmsLog.INIT.info(
Messages.get().getBundle().key(
Messages.INIT_SOLR_CORE_CONTAINER_CREATED_2,
m_solrConfig.getHome(),
m_solrConfig.getSolrFile().getName()));
}
} catch (Exception e) {
LOG.error(
Messages.get().container(
Messages.ERR_SOLR_CORE_CONTAINER_NOT_CREATED_1,
m_solrConfig.getSolrFile().getAbsolutePath()),
e);
}
return container;
}
/**
=======
>>>>>>>
* Creates the Solr core container.<p>
*
* @return the created core container
*/
private CoreContainer createCoreContainer() {
CoreContainer container = null;
try {
// get the core container
// still no core container: create it
container = CoreContainer.createAndLoad(m_solrConfig.getHome(), m_solrConfig.getSolrFile());
if (CmsLog.INIT.isInfoEnabled()) {
CmsLog.INIT.info(
Messages.get().getBundle().key(
Messages.INIT_SOLR_CORE_CONTAINER_CREATED_2,
m_solrConfig.getHome(),
m_solrConfig.getSolrFile().getName()));
}
} catch (Exception e) {
LOG.error(
Messages.get().container(
Messages.ERR_SOLR_CORE_CONTAINER_NOT_CREATED_1,
m_solrConfig.getSolrFile().getAbsolutePath()),
e);
}
return container;
}
/**
<<<<<<<
m_coreContainer.unload(core.getName());
if (core.getOpenCount() > 1) {
=======
m_coreContainer.remove(core.getName());
if (core.getOpenCount() > 0) {
>>>>>>>
m_coreContainer.unload(core.getName());
if (core.getOpenCount() > 1) { |
<<<<<<<
/** The site matcher that matches the workplace site. */
private CmsSiteMatcher m_workplaceSiteMatcher;
=======
/** The workpace servers. */
private List<String> m_workplaceServers;
>>>>>>>
/** The workpace servers. */
private List<String> m_workplaceServers;
<<<<<<<
* Set webserver script configuration.<p>
*
*
* @param webserverscript path
* @param targetpath path
* @param configtemplate path
* @param securetemplate path
* @param filenameprefix to add to files
* @param loggingdir path
*/
public void setWebServerScripting(
String webserverscript,
String targetpath,
String configtemplate,
String securetemplate,
String filenameprefix,
String loggingdir) {
m_apacheConfig = new HashMap<String, String>();
m_apacheConfig.put(WEB_SERVER_CONFIG_WEBSERVERSCRIPT, webserverscript);
m_apacheConfig.put(WEB_SERVER_CONFIG_TARGETPATH, targetpath);
m_apacheConfig.put(WEB_SERVER_CONFIG_CONFIGTEMPLATE, configtemplate);
m_apacheConfig.put(WEB_SERVER_CONFIG_SECURETEMPLATE, securetemplate);
m_apacheConfig.put(WEB_SERVER_CONFIG_FILENAMEPREFIX, filenameprefix);
m_apacheConfig.put(WEB_SERVER_CONFIG_LOGGINGDIR, loggingdir);
}
/**
* Sets the workplace server, this is only allowed during configuration.<p>
*
* If this method is called after the configuration is finished,
* a <code>RuntimeException</code> is thrown.<p>
*
* @param workplaceServer the workplace server to set
*/
public void setWorkplaceServer(String workplaceServer) {
if (m_frozen) {
throw new CmsRuntimeException(Messages.get().container(Messages.ERR_CONFIG_FROZEN_0));
}
m_workplaceServer = workplaceServer;
}
/**
=======
>>>>>>>
* Set webserver script configuration.<p>
*
*
* @param webserverscript path
* @param targetpath path
* @param configtemplate path
* @param securetemplate path
* @param filenameprefix to add to files
* @param loggingdir path
*/
public void setWebServerScripting(
String webserverscript,
String targetpath,
String configtemplate,
String securetemplate,
String filenameprefix,
String loggingdir) {
m_apacheConfig = new HashMap<String, String>();
m_apacheConfig.put(WEB_SERVER_CONFIG_WEBSERVERSCRIPT, webserverscript);
m_apacheConfig.put(WEB_SERVER_CONFIG_TARGETPATH, targetpath);
m_apacheConfig.put(WEB_SERVER_CONFIG_CONFIGTEMPLATE, configtemplate);
m_apacheConfig.put(WEB_SERVER_CONFIG_SECURETEMPLATE, securetemplate);
m_apacheConfig.put(WEB_SERVER_CONFIG_FILENAMEPREFIX, filenameprefix);
m_apacheConfig.put(WEB_SERVER_CONFIG_LOGGINGDIR, loggingdir);
}
/** |
<<<<<<<
import org.opencms.gwt.shared.CmsReplaceInfo;
=======
import org.opencms.gwt.shared.CmsRenameInfoBean;
>>>>>>>
import org.opencms.gwt.shared.CmsRenameInfoBean;
import org.opencms.gwt.shared.CmsReplaceInfo; |
<<<<<<<
result.add(new CmsPublishedResource(
resource.getStructureId(),
resource.getResourceId(),
resource.getPublishTag(),
resource.getRootPath(),
resource.getType(),
resource.isFolder(),
CmsResource.STATE_DELETED, // make sure index entry with outdated path is deleted
resource.getSiblingCount()));
=======
result.add(
new CmsPublishedResource(
resource.getStructureId(),
resource.getResourceId(),
resource.getPublishTag(),
resource.getRootPath(),
resource.getType(),
resource.isFolder(),
CmsResource.STATE_DELETED, // make sure index entry with outdated path is deleted
resource.getSiblingCount()));
>>>>>>>
result.add(
new CmsPublishedResource(
resource.getStructureId(),
resource.getResourceId(),
resource.getPublishTag(),
resource.getRootPath(),
resource.getType(),
resource.isFolder(),
CmsResource.STATE_DELETED, // make sure index entry with outdated path is deleted
resource.getSiblingCount()));
<<<<<<<
=======
* Returns an analyzer for the given class name.<p>
*
* Since Lucene 3.0, many analyzers require a "version" parameter in the constructor and
* can not be created by a simple <code>newInstance()</code> call.
* This method will create analyzers by name for the {@link CmsSearchIndex#LUCENE_VERSION} version.<p>
*
* @param className the class name of the analyzer
* @param stemmer the optional stemmer parameter required for the snowball analyzer
*
* @return the appropriate lucene analyzer
*
* @throws Exception if something goes wrong
*
* @deprecated The stemmer parameter is used only by the snownall analyzer, which is deprecated in Lucene 3.
*/
@Deprecated
private static Analyzer getAnalyzer(String className, String stemmer) throws Exception {
Analyzer analyzer = null;
Class<?> analyzerClass;
try {
analyzerClass = Class.forName(className);
} catch (ClassNotFoundException e) {
// allow Lucene standard classes to be written in a short form
analyzerClass = Class.forName(LUCENE_ANALYZER + className);
}
// since Lucene 3.0 most analyzers need a "version" parameter and don't support an empty constructor
if (StandardAnalyzer.class.equals(analyzerClass)) {
// the Lucene standard analyzer is used
analyzer = new StandardAnalyzer(CmsSearchIndex.LUCENE_VERSION);
} else if (CmsGallerySearchAnalyzer.class.equals(analyzerClass)) {
// OpenCms gallery multiple language analyzer
analyzer = new CmsGallerySearchAnalyzer(CmsSearchIndex.LUCENE_VERSION);
} else {
boolean hasEmpty = false;
boolean hasVersion = false;
boolean hasVersionWithString = false;
// another analyzer is used, check if we find a suitable constructor
Constructor<?>[] constructors = analyzerClass.getConstructors();
for (int i = 0; i < constructors.length; i++) {
Constructor<?> c = constructors[i];
Class<?>[] parameters = c.getParameterTypes();
if (parameters.length == 0) {
// an empty constructor has been found
hasEmpty = true;
}
if ((parameters.length == 1) && parameters[0].equals(Version.class)) {
// a constructor with a Lucene version parameter has been found
hasVersion = true;
}
if ((stemmer != null)
&& (parameters.length == 2)
&& parameters[0].equals(Version.class)
&& parameters[1].equals(String.class)) {
// a constructor with a Lucene version parameter and a String has been found
hasVersionWithString = true;
}
}
if (hasVersionWithString) {
// a constructor with a Lucene version parameter and a String has been found
analyzer = (Analyzer)analyzerClass.getDeclaredConstructor(
new Class[] {Version.class, String.class}).newInstance(CmsSearchIndex.LUCENE_VERSION, stemmer);
} else if (hasVersion) {
// a constructor with a Lucene version parameter has been found
analyzer = (Analyzer)analyzerClass.getDeclaredConstructor(new Class[] {Version.class}).newInstance(
CmsSearchIndex.LUCENE_VERSION);
} else if (hasEmpty) {
// an empty constructor has been found
analyzer = (Analyzer)analyzerClass.newInstance();
}
}
return analyzer;
}
/**
>>>>>>>
<<<<<<<
} catch (NullPointerException e) {
if (core != null) {
core.close();
}
throw new CmsConfigurationException(Messages.get().container(
Messages.ERR_SOLR_SERVER_NOT_CREATED_3,
index.getName(),
index.getPath(),
m_solrConfig.getSolrConfigFile().getAbsolutePath()), e);
=======
} catch (Exception e) {
throw new CmsConfigurationException(
Messages.get().container(
Messages.ERR_SOLR_SERVER_NOT_CREATED_3,
index.getName(),
index.getPath(),
m_solrConfig.getSolrConfigFile().getAbsolutePath()),
e);
>>>>>>>
} catch (NullPointerException e) {
if (core != null) {
core.close();
}
throw new CmsConfigurationException(
Messages.get().container(
Messages.ERR_SOLR_SERVER_NOT_CREATED_3,
index.getName(),
index.getPath(),
m_solrConfig.getSolrConfigFile().getAbsolutePath()),
e); |
<<<<<<<
=======
import org.opencms.ade.sitemap.shared.rpc.I_CmsSitemapServiceAsync;
import org.opencms.ade.upload.client.ui.CmsUploadButton;
import org.opencms.ade.upload.client.ui.I_CmsUploadButtonHandler;
>>>>>>>
import org.opencms.ade.sitemap.shared.rpc.I_CmsSitemapServiceAsync;
<<<<<<<
import org.opencms.gwt.client.ui.input.upload.CmsUploadButton;
import org.opencms.gwt.client.ui.input.upload.I_CmsUploadButtonHandler;
=======
import org.opencms.gwt.shared.alias.CmsAliasImportResult;
>>>>>>>
import org.opencms.gwt.client.ui.input.upload.CmsUploadButton;
import org.opencms.gwt.client.ui.input.upload.I_CmsUploadButtonHandler;
import org.opencms.gwt.shared.alias.CmsAliasImportResult; |
<<<<<<<
this.fsBufferedOutput = new SimpleBufferedOutputStream(this.fsOut,
fsOutputBuffer.getBytes());
=======
this.fsBufferedOutput =
new SimpleBufferedOutputStream(this.fsOut, fsOutputBuffer.getBytes());
// *This* is very important. Without this, when the crypto stream is closed (in order to
// flush its last bytes),
// the underlying RFile stream will *also* be closed, and that's undesirable as the cipher
// stream is closed for
// every block written.
cryptoParams.setCloseUnderylingStreamAfterCryptoStreamClose(false);
// *This* is also very important. We don't want the underlying stream messed with.
cryptoParams.setRecordParametersToStream(false);
// It is also important to make sure we get a new initialization vector on every call in
// here,
// so set any existing one to null, in case we're reusing a parameters object for its RNG or
// other bits
cryptoParams.setInitializationVector(null);
// Initialize the cipher including generating a new IV
cryptoParams = cryptoModule.initializeCipher(cryptoParams);
// Write the init vector in plain text, uncompressed, to the output stream. Due to the way
// the streams work out, there's no good way to write this
// compressed, but it's pretty small.
DataOutputStream tempDataOutputStream = new DataOutputStream(fsBufferedOutput);
// Init vector might be null if the underlying cipher does not require one (NullCipher being
// a good example)
if (cryptoParams.getInitializationVector() != null) {
tempDataOutputStream.writeInt(cryptoParams.getInitializationVector().length);
tempDataOutputStream.write(cryptoParams.getInitializationVector());
} else {
// Do nothing
}
// Initialize the cipher stream and get the IV
cryptoParams.setPlaintextOutputStream(tempDataOutputStream);
cryptoParams = cryptoModule.getEncryptingOutputStream(cryptoParams);
if (cryptoParams.getEncryptedOutputStream() == tempDataOutputStream) {
this.cipherOut = fsBufferedOutput;
} else {
this.cipherOut = cryptoParams.getEncryptedOutputStream();
}
>>>>>>>
this.fsBufferedOutput =
new SimpleBufferedOutputStream(this.fsOut, fsOutputBuffer.getBytes());
<<<<<<<
this.cryptoEnvironment = new CryptoEnvironmentImpl(Scope.RFILE, null);
this.encrypter = cryptoService.getFileEncrypter(this.cryptoEnvironment);
=======
// Set up crypto-related detail, including secret key generation and encryption
this.cryptoModule = CryptoModuleFactory.getCryptoModule(accumuloConfiguration);
this.cryptoParams = new BCFileCryptoModuleParameters();
CryptoModuleFactory.fillParamsObjectFromConfiguration(cryptoParams, accumuloConfiguration);
this.cryptoParams =
(BCFileCryptoModuleParameters) cryptoModule.generateNewRandomSessionKey(cryptoParams);
this.secretKeyEncryptionStrategy =
CryptoModuleFactory.getSecretKeyEncryptionStrategy(accumuloConfiguration);
this.cryptoParams =
(BCFileCryptoModuleParameters) secretKeyEncryptionStrategy.encryptSecretKey(cryptoParams);
// secretKeyEncryptionStrategy.encryptSecretKey(cryptoParameters);
>>>>>>>
this.cryptoEnvironment = new CryptoEnvironmentImpl(Scope.RFILE, null);
this.encrypter = cryptoService.getFileEncrypter(this.cryptoEnvironment);
<<<<<<<
try (BlockAppender appender = prepareMetaBlock(DataIndex.BLOCK_NAME,
getDefaultCompressionAlgorithm())) {
=======
BlockAppender appender =
prepareMetaBlock(DataIndex.BLOCK_NAME, getDefaultCompressionAlgorithm());
try {
>>>>>>>
try (BlockAppender appender =
prepareMetaBlock(DataIndex.BLOCK_NAME, getDefaultCompressionAlgorithm())) {
<<<<<<<
WBlockState wbs = new WBlockState(compressAlgo, out, fsOutputBuffer, conf, encrypter);
=======
WBlockState wbs =
new WBlockState(compressAlgo, out, fsOutputBuffer, conf, cryptoModule, cryptoParams);
>>>>>>>
WBlockState wbs = new WBlockState(compressAlgo, out, fsOutputBuffer, conf, encrypter);
<<<<<<<
=======
/**
* Callback to make sure a data block is added to the internal list when it's being closed.
*
*/
private class DataBlockRegister implements BlockRegister {
DataBlockRegister() {
// do nothing
}
@Override
public void register(long raw, long begin, long end) {
dataIndex.addBlockRegion(new BlockRegion(begin, end - begin, raw));
}
}
}
// sha256 of some random data
private static final byte[] NO_CPYPTO_KEY =
"ce18cf53c4c5077f771249b38033fa14bcb31cca0e5e95a371ee72daa8342ea2".getBytes(UTF_8);
// This class is used as a place holder in the cache for RFiles that have no crypto....
private static final BCFileCryptoModuleParameters NO_CRYPTO = new BCFileCryptoModuleParameters() {
@Override
public Map<String,String> getAllOptions() {
return Collections.emptyMap();
}
@Override
public byte[] getEncryptedKey() {
return NO_CPYPTO_KEY;
}
@Override
public String getOpaqueKeyEncryptionKeyID() {
// NONE + sha256 of random data
return "NONE:a4007e6aefb095a5a47030cd6c850818fb3a685dc6e85ba1ecc5a44ba68b193b";
}
};
private static class BCFileCryptoModuleParameters extends CryptoModuleParameters {
public void write(DataOutput out) throws IOException {
// Write out the context
out.writeInt(getAllOptions().size());
for (String key : getAllOptions().keySet()) {
out.writeUTF(key);
out.writeUTF(getAllOptions().get(key));
}
// Write the opaque ID
out.writeUTF(getOpaqueKeyEncryptionKeyID());
// Write the encrypted secret key
out.writeInt(getEncryptedKey().length);
out.write(getEncryptedKey());
}
public void read(DataInput in) throws IOException {
Map<String,String> optionsFromFile = new HashMap<>();
int numContextEntries = in.readInt();
for (int i = 0; i < numContextEntries; i++) {
optionsFromFile.put(in.readUTF(), in.readUTF());
}
CryptoModuleFactory.fillParamsObjectFromStringMap(this, optionsFromFile);
// Read opaque key encryption ID
setOpaqueKeyEncryptionKeyID(in.readUTF());
// Read encrypted secret key
int encryptedSecretKeyLength = in.readInt();
byte[] encryptedSecretKey = new byte[encryptedSecretKeyLength];
in.readFully(encryptedSecretKey);
setEncryptedKey(encryptedSecretKey);
}
>>>>>>>
<<<<<<<
CryptoEnvironment cryptoEnvironment = null;
=======
// If they exist, read the crypto parameters
if (!version.equals(BCFile.API_VERSION_1)) {
// read crypto parameters
this.in.seek(offsetCryptoParameters);
cryptoParams = new BCFileCryptoModuleParameters();
cryptoParams.read(this.in);
this.cryptoModule = CryptoModuleFactory.getCryptoModule(
cryptoParams.getAllOptions().get(Property.CRYPTO_MODULE_CLASS.getKey()));
// TODO: Do I need this? Hmmm, maybe I do.
if (accumuloConfiguration
.getBoolean(Property.CRYPTO_OVERRIDE_KEY_STRATEGY_WITH_CONFIGURED_STRATEGY)) {
Map<String,String> cryptoConfFromAccumuloConf =
accumuloConfiguration.getAllPropertiesWithPrefix(Property.CRYPTO_PREFIX);
Map<String,String> instanceConf =
accumuloConfiguration.getAllPropertiesWithPrefix(Property.INSTANCE_PREFIX);
cryptoConfFromAccumuloConf.putAll(instanceConf);
for (String name : cryptoParams.getAllOptions().keySet()) {
if (!name.equals(Property.CRYPTO_SECRET_KEY_ENCRYPTION_STRATEGY_CLASS.getKey())) {
cryptoConfFromAccumuloConf.put(name, cryptoParams.getAllOptions().get(name));
} else {
cryptoParams.setKeyEncryptionStrategyClass(cryptoConfFromAccumuloConf
.get(Property.CRYPTO_SECRET_KEY_ENCRYPTION_STRATEGY_CLASS.getKey()));
}
}
>>>>>>>
CryptoEnvironment cryptoEnvironment = null;
<<<<<<<
decryptionParams = CryptoUtils.readParams(dis);
CryptoEnvironmentImpl env = new CryptoEnvironmentImpl(Scope.RFILE, decryptionParams);
this.decrypter = cryptoService.getFileDecrypter(env);
=======
// read meta index
this.in.seek(offsetIndexMeta);
metaIndex = new MetaIndex(this.in);
// If they exist, read the crypto parameters
if (!version.equals(BCFile.API_VERSION_1) && cachedCryptoParams == null) {
// read crypto parameters
this.in.seek(offsetCryptoParameters);
cryptoParams = new BCFileCryptoModuleParameters();
cryptoParams.read(this.in);
if (accumuloConfiguration
.getBoolean(Property.CRYPTO_OVERRIDE_KEY_STRATEGY_WITH_CONFIGURED_STRATEGY)) {
Map<String,String> cryptoConfFromAccumuloConf =
accumuloConfiguration.getAllPropertiesWithPrefix(Property.CRYPTO_PREFIX);
Map<String,String> instanceConf =
accumuloConfiguration.getAllPropertiesWithPrefix(Property.INSTANCE_PREFIX);
cryptoConfFromAccumuloConf.putAll(instanceConf);
for (String name : cryptoParams.getAllOptions().keySet()) {
if (!name.equals(Property.CRYPTO_SECRET_KEY_ENCRYPTION_STRATEGY_CLASS.getKey())) {
cryptoConfFromAccumuloConf.put(name, cryptoParams.getAllOptions().get(name));
} else {
cryptoParams.setKeyEncryptionStrategyClass(cryptoConfFromAccumuloConf
.get(Property.CRYPTO_SECRET_KEY_ENCRYPTION_STRATEGY_CLASS.getKey()));
}
}
cryptoParams.setAllOptions(cryptoConfFromAccumuloConf);
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
cryptoParams.write(dos);
dos.close();
cache.cacheMetaBlock(CRYPTO_BLOCK_NAME, baos.toByteArray());
this.cryptoModule = CryptoModuleFactory.getCryptoModule(
cryptoParams.getAllOptions().get(Property.CRYPTO_MODULE_CLASS.getKey()));
this.secretKeyEncryptionStrategy = CryptoModuleFactory
.getSecretKeyEncryptionStrategy(cryptoParams.getKeyEncryptionStrategyClass());
// This call should put the decrypted session key within the cryptoParameters object
// secretKeyEncryptionStrategy.decryptSecretKey(cryptoParameters);
cryptoParams = (BCFileCryptoModuleParameters) secretKeyEncryptionStrategy
.decryptSecretKey(cryptoParams);
} else if (cachedCryptoParams != null) {
setupCryptoFromCachedData(cachedCryptoParams);
} else {
// Place something in cache that indicates this file has no crypto metadata. See
// ACCUMULO-4141
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
NO_CRYPTO.write(dos);
dos.close();
cache.cacheMetaBlock(CRYPTO_BLOCK_NAME, baos.toByteArray());
}
if (cachedMetaIndex == null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
metaIndex.write(dos);
dos.close();
cache.cacheMetaBlock(META_NAME, baos.toByteArray());
}
// read data:BCFile.index, the data block index
if (cachedDataIndex == null) {
BlockReader blockR = getMetaBlock(DataIndex.BLOCK_NAME);
cachedDataIndex = cache.cacheMetaBlock(DataIndex.BLOCK_NAME, blockR);
}
try {
dataIndex = new DataIndex(cachedDataIndex);
} catch (IOException e) {
LOG.error("Got IOException when trying to create DataIndex block");
throw e;
} finally {
cachedDataIndex.close();
}
} else {
// We have cached versions of the metaIndex, dataIndex and cryptoParams objects.
// Use them to fill out this reader's members.
version = null;
metaIndex = new MetaIndex(cachedMetaIndex);
dataIndex = new DataIndex(cachedDataIndex);
setupCryptoFromCachedData(cachedCryptoParams);
}
}
private void setupCryptoFromCachedData(BlockRead cachedCryptoParams) throws IOException {
BCFileCryptoModuleParameters params = new BCFileCryptoModuleParameters();
params.read(cachedCryptoParams);
if (Arrays.equals(params.getEncryptedKey(), NO_CRYPTO.getEncryptedKey())
&& NO_CRYPTO.getOpaqueKeyEncryptionKeyID().equals(params.getOpaqueKeyEncryptionKeyID())) {
this.cryptoParams = null;
this.cryptoModule = null;
this.secretKeyEncryptionStrategy = null;
} else {
this.cryptoModule = CryptoModuleFactory
.getCryptoModule(params.getAllOptions().get(Property.CRYPTO_MODULE_CLASS.getKey()));
this.secretKeyEncryptionStrategy = CryptoModuleFactory
.getSecretKeyEncryptionStrategy(params.getKeyEncryptionStrategyClass());
// This call should put the decrypted session key within the cryptoParameters object
cryptoParams =
(BCFileCryptoModuleParameters) secretKeyEncryptionStrategy.decryptSecretKey(params);
}
}
/**
* Get the name of the default compression algorithm.
*
* @return the name of the default compression algorithm.
*/
public String getDefaultCompressionName() {
return dataIndex.getDefaultCompressionAlgorithm().getName();
}
/**
* Get version of BCFile file being read.
*
* @return version of BCFile file being read.
*/
public Version getBCFileVersion() {
return version;
}
/**
* Get version of BCFile API.
*
* @return version of BCFile API.
*/
public Version getAPIVersion() {
return API_VERSION;
>>>>>>>
decryptionParams = CryptoUtils.readParams(dis);
CryptoEnvironmentImpl env = new CryptoEnvironmentImpl(Scope.RFILE, decryptionParams);
this.decrypter = cryptoService.getFileDecrypter(env);
<<<<<<<
RBlockState rbs = new RBlockState(compressAlgo, in, region, conf, decrypter);
=======
RBlockState rbs =
new RBlockState(compressAlgo, in, region, conf, cryptoModule, version, cryptoParams);
>>>>>>>
RBlockState rbs = new RBlockState(compressAlgo, in, region, conf, decrypter);
<<<<<<<
public DataIndex(String defaultCompressionAlgorithmName) {
this.defaultCompressionAlgorithm = Compression
.getCompressionAlgorithmByName(defaultCompressionAlgorithmName);
=======
public DataIndex(String defaultCompressionAlgorithmName, boolean trackBlocks) {
this.trackBlocks = trackBlocks;
this.defaultCompressionAlgorithm =
Compression.getCompressionAlgorithmByName(defaultCompressionAlgorithmName);
>>>>>>>
public DataIndex(String defaultCompressionAlgorithmName) {
this.defaultCompressionAlgorithm =
Compression.getCompressionAlgorithmByName(defaultCompressionAlgorithmName); |
<<<<<<<
* @see org.opencms.search.fields.CmsSearchFieldConfiguration#appendAdditionalValuesToDcoument(org.opencms.search.I_CmsSearchDocument, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List)
=======
* Appends the Solr specific search fields to the document.<p>
*
* @see org.opencms.search.fields.I_CmsSearchFieldAppdender#appendFields(org.opencms.search.I_CmsSearchDocument, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List)
>>>>>>>
* @see org.opencms.search.fields.CmsSearchFieldConfiguration#appendAdditionalValuesToDcoument(org.opencms.search.I_CmsSearchDocument, org.opencms.file.CmsObject, org.opencms.file.CmsResource, org.opencms.search.extractors.I_CmsExtractionResult, java.util.List, java.util.List)
<<<<<<<
// Add title
// System.out.println("-----------------------------------");
// System.out.println(resource.getName() + ": " + extractionResult.getContentItems().keySet());
// System.out.println(resource.getName() + ": " + extractionResult.getContentItems().get("title_en_s"));
// System.out.println("-----------------------------------");
// if (resource.isInternal()
// || resource.isFolder()
// || resource.isTemporaryFile()
// || (resource.getDateExpired() <= System.currentTimeMillis())) {
// // don't index internal resources, folders or temporary files or resources with expire date in the past
// return true;
// }
//
// try {
// // do property lookup with folder search
// String propValue = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_SEARCH_EXCLUDE, true).getValue();
// excludeFromIndex = Boolean.valueOf(propValue).booleanValue();
// if (!excludeFromIndex && (propValue != null)) {
// // property value was neither "true" nor null, must check for "all"
// excludeFromIndex = PROPERTY_SEARCH_EXCLUDE_VALUE_ALL.equalsIgnoreCase(propValue.trim());
// }
// } catch (CmsException e) {
// if (LOG.isDebugEnabled()) {
// LOG.debug(Messages.get().getBundle().key(Messages.LOG_UNABLE_TO_READ_PROPERTY_1, resource.getRootPath()));
// }
// }
// if (!excludeFromIndex && !USE_ALL_LOCALE.equalsIgnoreCase(getLocale().getLanguage())) {
// // check if any resource default locale has a match with the index locale, if not skip resource
// List<Locale> locales = OpenCms.getLocaleManager().getDefaultLocales(cms, resource);
// Locale match = OpenCms.getLocaleManager().getFirstMatchingLocale(
// Collections.singletonList(getLocale()),
// locales);
// excludeFromIndex = (match == null);
// }
boolean excludeFromIndex = false;
String propValue = CmsProperty.get(CmsPropertyDefinition.PROPERTY_SEARCH_EXCLUDE, propertiesSearched).getValue();
excludeFromIndex = Boolean.valueOf(propValue).booleanValue();
if (!excludeFromIndex && (propValue != null)) {
// property value was neither "true" nor null, must check for "all"
excludeFromIndex = CmsSearchIndex.PROPERTY_SEARCH_EXCLUDE_VALUE_ALL.equalsIgnoreCase(propValue.trim())
|| CmsSolrIndex.PROPERTY_SEARCH_EXCLUDE_VALUE_SOLR.equalsIgnoreCase(propValue.trim());
}
=======
return document;
}
/**
* Returns all configured Solr fields.<p>
*
* @return all configured Solr fields
*/
public Map<String, CmsSolrField> getSolrFields() {
return Collections.unmodifiableMap(m_solrFields);
}
/**
* Adds the additional fields to the configuration, if they are not null.<p>
*
* @param additionalFields the additional fields to add
*/
protected void addAdditionalFields(List<CmsSolrField> additionalFields) {
>>>>>>>
// Add title
// System.out.println("-----------------------------------");
// System.out.println(resource.getName() + ": " + extractionResult.getContentItems().keySet());
// System.out.println(resource.getName() + ": " + extractionResult.getContentItems().get("title_en_s"));
// System.out.println("-----------------------------------");
// if (resource.isInternal()
// || resource.isFolder()
// || resource.isTemporaryFile()
// || (resource.getDateExpired() <= System.currentTimeMillis())) {
// // don't index internal resources, folders or temporary files or resources with expire date in the past
// return true;
// }
//
// try {
// // do property lookup with folder search
// String propValue = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_SEARCH_EXCLUDE, true).getValue();
// excludeFromIndex = Boolean.valueOf(propValue).booleanValue();
// if (!excludeFromIndex && (propValue != null)) {
// // property value was neither "true" nor null, must check for "all"
// excludeFromIndex = PROPERTY_SEARCH_EXCLUDE_VALUE_ALL.equalsIgnoreCase(propValue.trim());
// }
// } catch (CmsException e) {
// if (LOG.isDebugEnabled()) {
// LOG.debug(Messages.get().getBundle().key(Messages.LOG_UNABLE_TO_READ_PROPERTY_1, resource.getRootPath()));
// }
// }
// if (!excludeFromIndex && !USE_ALL_LOCALE.equalsIgnoreCase(getLocale().getLanguage())) {
// // check if any resource default locale has a match with the index locale, if not skip resource
// List<Locale> locales = OpenCms.getLocaleManager().getDefaultLocales(cms, resource);
// Locale match = OpenCms.getLocaleManager().getFirstMatchingLocale(
// Collections.singletonList(getLocale()),
// locales);
// excludeFromIndex = (match == null);
// }
boolean excludeFromIndex = false;
String propValue = CmsProperty.get(
CmsPropertyDefinition.PROPERTY_SEARCH_EXCLUDE,
propertiesSearched).getValue();
excludeFromIndex = Boolean.valueOf(propValue).booleanValue();
if (!excludeFromIndex && (propValue != null)) {
// property value was neither "true" nor null, must check for "all"
excludeFromIndex = CmsSearchIndex.PROPERTY_SEARCH_EXCLUDE_VALUE_ALL.equalsIgnoreCase(propValue.trim())
|| CmsSolrIndex.PROPERTY_SEARCH_EXCLUDE_VALUE_SOLR.equalsIgnoreCase(propValue.trim());
}
<<<<<<<
=======
// append the found mapping result to text content of this field
if (text.length() > 0) {
text.append('\n');
}
>>>>>>>
<<<<<<<
document.addSearchField(new CmsSolrField(
prop.getName() + CmsSearchField.FIELD_DYNAMIC_PROPERTIES,
null,
null,
null,
CmsSearchField.BOOST_DEFAULT), prop.getValue());
// Also write the property using the dynamic field '_s' in order to prevent tokenization
// of the property. The resulting field is named '<property>_prop_s'.
document.addSearchField(new CmsSolrField(prop.getName()
+ CmsSearchField.FIELD_DYNAMIC_PROPERTIES
+ "_s", null, null, null, CmsSearchField.BOOST_DEFAULT), prop.getValue());
=======
document.addSearchField(
new CmsSolrField(
prop.getName() + CmsSearchField.FIELD_DYNAMIC_PROPERTIES,
null,
null,
null,
CmsSearchField.BOOST_DEFAULT),
prop.getValue());
// Also write the property using the dynamic field '_s' in order to prevent tokenization
// of the property. The resulting field is named '<property>_prop_s'.
document.addSearchField(
new CmsSolrField(
prop.getName() + CmsSearchField.FIELD_DYNAMIC_PROPERTIES + "_s",
null,
null,
null,
CmsSearchField.BOOST_DEFAULT),
prop.getValue());
>>>>>>>
document.addSearchField(
new CmsSolrField(
prop.getName() + CmsSearchField.FIELD_DYNAMIC_PROPERTIES,
null,
null,
null,
CmsSearchField.BOOST_DEFAULT),
prop.getValue());
// Also write the property using the dynamic field '_s' in order to prevent tokenization
// of the property. The resulting field is named '<property>_prop_s'.
document.addSearchField(
new CmsSolrField(
prop.getName() + CmsSearchField.FIELD_DYNAMIC_PROPERTIES + "_s",
null,
null,
null,
CmsSearchField.BOOST_DEFAULT),
prop.getValue()); |
<<<<<<<
=======
*
>>>>>>>
<<<<<<<
* @param page the container page
*
=======
*
>>>>>>>
* @param page the container page
*
<<<<<<<
OpenCms.getResourceManager().getResourceType(CmsResourceTypeFolder.getStaticTypeName()));
=======
OpenCms.getResourceManager().getResourceType(
CmsResourceTypeFolder.getStaticTypeName()).getTypeId());
>>>>>>>
OpenCms.getResourceManager().getResourceType(CmsResourceTypeFolder.getStaticTypeName()));
<<<<<<<
CmsADEConfigData config = getConfigData(containerPage.getRootPath());
CmsResourceTypeConfig typeConfig = config.getResourceType(CmsResourceTypeXmlContainerPage.INHERIT_CONTAINER_TYPE_NAME);
referenceResource = typeConfig.createNewElement(cms, containerPage.getRootPath());
=======
CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(cms, containerPage.getRootPath());
CmsResourceTypeConfig typeConfig = config.getResourceType(
CmsResourceTypeXmlContainerPage.INHERIT_CONTAINER_TYPE_NAME);
referenceResource = typeConfig.createNewElement(cms);
>>>>>>>
CmsADEConfigData config = getConfigData(containerPage.getRootPath());
CmsResourceTypeConfig typeConfig = config.getResourceType(
CmsResourceTypeXmlContainerPage.INHERIT_CONTAINER_TYPE_NAME);
referenceResource = typeConfig.createNewElement(cms, containerPage.getRootPath());
<<<<<<<
* @param pageRootPath the container page root path
*
=======
*
>>>>>>>
* @param pageRootPath the container page root path
*
<<<<<<<
* @param pageRootPath the container page root path
*
=======
*
>>>>>>>
* @param pageRootPath the container page root path
*
<<<<<<<
CmsContainerPageBean pageBean = generateContainerPageForContainers(
containers,
cms.getRequestContext().addSiteRoot(uriParam));
Map<String, CmsContainerElementBean> idMapping = new HashMap<String, CmsContainerElementBean>();
=======
CmsElementUtil elemUtil = new CmsElementUtil(
cms,
uriParam,
generateContainerPageForContainers(containers, cms.getRequestContext().addSiteRoot(uriParam)),
detailContentId,
getRequest(),
getResponse(),
locale);
Map<String, CmsContainerElementData> result = new HashMap<String, CmsContainerElementData>();
Set<String> ids = new HashSet<String>();
>>>>>>>
CmsContainerPageBean pageBean = generateContainerPageForContainers(
containers,
cms.getRequestContext().addSiteRoot(uriParam));
Map<String, CmsContainerElementBean> idMapping = new HashMap<String, CmsContainerElementBean>();
<<<<<<<
* @param containerPage the container page
* @param locale the locale to use
*
=======
* @param pageStructureId the container page structure id
* @param locale the locale to use
*
>>>>>>>
* @param containerPage the container page
* @param locale the locale to use
*
<<<<<<<
CmsADEConfigData config = getConfigData(pageResource.getRootPath());
CmsResourceTypeConfig typeConfig = config.getResourceType(CmsResourceTypeXmlContainerPage.GROUP_CONTAINER_TYPE_NAME);
groupContainerResource = typeConfig.createNewElement(getCmsObject(), pageResource.getRootPath());
=======
CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(
getCmsObject(),
pageResource.getRootPath());
CmsResourceTypeConfig typeConfig = config.getResourceType(
CmsResourceTypeXmlContainerPage.GROUP_CONTAINER_TYPE_NAME);
groupContainerResource = typeConfig.createNewElement(getCmsObject());
>>>>>>>
CmsADEConfigData config = getConfigData(pageResource.getRootPath());
CmsResourceTypeConfig typeConfig = config.getResourceType(
CmsResourceTypeXmlContainerPage.GROUP_CONTAINER_TYPE_NAME);
groupContainerResource = typeConfig.createNewElement(getCmsObject(), pageResource.getRootPath());
<<<<<<<
*
* @param containerPage the edited container page
=======
*
>>>>>>>
*
* @param containerPage the edited container page |
<<<<<<<
public <T> QueryResult<T> getMore(final MongoNamespace namespace, final GetMore getMore,
final Decoder<T> resultDecoder) {
=======
public <T> QueryResult<T> getMore(final MongoNamespace namespace, final MongoGetMore getMore,
final Serializer<T> resultSerializer) {
>>>>>>>
public <T> QueryResult<T> getMore(final MongoNamespace namespace, final MongoGetMore getMore,
final Decoder<T> resultDecoder) {
<<<<<<<
public <T> Future<QueryResult<T>> asyncGetMore(final MongoNamespace namespace, final GetMore getMore,
final Decoder<T> resultDecoder) {
=======
public <T> Future<QueryResult<T>> asyncGetMore(final MongoNamespace namespace, final MongoGetMore getMore,
final Serializer<T> resultSerializer) {
>>>>>>>
public <T> Future<QueryResult<T>> asyncGetMore(final MongoNamespace namespace, final GetMore getMore,
final Serializer<T> resultSerializer) {
<<<<<<<
public <T> void asyncGetMore(final MongoNamespace namespace, final GetMore getMore, final Decoder<T> resultDecoder,
=======
public <T> void asyncGetMore(final MongoNamespace namespace, final MongoGetMore getMore, final Serializer<T> resultSerializer,
>>>>>>>
public <T> void asyncGetMore(final MongoNamespace namespace, final GetMore getMore, final Serializer<T> resultSerializer, |
<<<<<<<
.writeConcern(writeConcern.toNew());
return insert(mongoInsert, codec);
=======
.writeConcern(aWriteConcern.toNew());
return new WriteResult(insertInternal(mongoInsert, serializer), aWriteConcern);
>>>>>>>
.writeConcern(aWriteConcern.toNew());
return new WriteResult(insertInternal(mongoInsert, codec), aWriteConcern);
<<<<<<<
public WriteResult insert(final List<DBObject> documents, final WriteConcern writeConcern, final DBEncoder encoder) {
final Codec<DBObject> codec;
//TODO: Is this really how it should work?
=======
public WriteResult insert(final List<DBObject> documents, final WriteConcern aWriteConcern, final DBEncoder encoder) {
final Serializer<DBObject> serializer = toDBObjectSerializer(encoder);
final MongoInsert<DBObject> mongoInsert = new MongoInsert<DBObject>(documents)
.writeConcern(this.writeConcern.toNew());
return new WriteResult(insertInternal(mongoInsert, serializer), aWriteConcern);
}
private Serializer<DBObject> toDBObjectSerializer(DBEncoder encoder) {
Serializer<DBObject> serializer;
>>>>>>>
public WriteResult insert(final List<DBObject> documents, final WriteConcern aWriteConcern, final DBEncoder encoder) {
final Codec<DBObject> serializer = toDBObjectSerializer(encoder);
final MongoInsert<DBObject> mongoInsert = new MongoInsert<DBObject>(documents)
.writeConcern(this.writeConcern.toNew());
return new WriteResult(insertInternal(mongoInsert, serializer), aWriteConcern);
}
private Serializer<DBObject> toDBObjectSerializer(DBEncoder encoder) {
Serializer<DBObject> serializer;
<<<<<<<
final org.mongodb.result.WriteResult result =
getConnector().update(getNamespace(), mongoUpdate, documentCodec);
return new WriteResult(result, writeConcern);
=======
return getConnector().update(getNamespace(), mongoUpdate, documentSerializer);
>>>>>>>
return getConnector().update(getNamespace(), mongoUpdate, documentSerializer);
<<<<<<<
final Codec<DBObject> codec;
if (encoder != null) {
codec = new DBEncoderDecoderCodec(encoder, null, null, null);
} else if (encoderFactory != null) {
codec = new DBEncoderDecoderCodec(encoderFactory.create(), null, null, null);
} else {
codec = this.codec;
}
=======
final Serializer<DBObject> serializer = toDBObjectSerializer(encoder);
>>>>>>>
final Serializer<DBObject> serializer = toDBObjectSerializer(encoder); |
<<<<<<<
public <T> QueryResult<T> getMore(final MongoNamespace namespace, final GetMore getMore,
final Decoder<T> resultDecoder) {
=======
public <T> QueryResult<T> getMore(final MongoNamespace namespace, final MongoGetMore getMore,
final Serializer<T> resultSerializer) {
>>>>>>>
public <T> QueryResult<T> getMore(final MongoNamespace namespace, final MongoGetMore getMore,
final Decoder<T> resultDecoder) {
<<<<<<<
public <T> Future<QueryResult<T>> asyncGetMore(final MongoNamespace namespace, final GetMore getMore,
final Decoder<T> resultDecoder) {
=======
public <T> Future<QueryResult<T>> asyncGetMore(final MongoNamespace namespace, final MongoGetMore getMore,
final Serializer<T> resultSerializer) {
>>>>>>>
public <T> Future<QueryResult<T>> asyncGetMore(final MongoNamespace namespace, final MongoGetMore getMore,
final Decoder<T> resultDecoder) {
<<<<<<<
public <T> void asyncGetMore(final MongoNamespace namespace, final GetMore getMore,
final Decoder<T> resultDecoder,
=======
public <T> void asyncGetMore(final MongoNamespace namespace, final MongoGetMore getMore,
final Serializer<T> resultSerializer,
>>>>>>>
public <T> void asyncGetMore(final MongoNamespace namespace, final MongoGetMore getMore,
final Decoder<T> resultDecoder, |
<<<<<<<
=======
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mongodb.impl.SingleServerMongoClient;
import org.mongodb.operation.MongoFind;
import org.mongodb.operation.MongoInsert;
>>>>>>>
<<<<<<<
public class MongoCursorTest extends MongoClientTestBase {
=======
@RunWith(JUnit4.class)
public class MongoCursorTest {
// TODO: this is untenable, and copied code as well
private static SingleServerMongoClient mongoClient;
private static final String DB_NAME = "MongoCollectionTest";
private static MongoDatabase mongoDatabase;
@BeforeClass
public static void setUpClass() throws UnknownHostException {
mongoClient = new SingleServerMongoClient(new ServerAddress());
mongoDatabase = mongoClient.getDatabase(DB_NAME);
mongoDatabase.admin().drop();
}
@AfterClass
public static void tearDownClass() {
mongoClient.close();
}
>>>>>>>
public class MongoCursorTest extends MongoClientTestBase { |
<<<<<<<
/**
* Sets the write concern. If this is not set, the write concern defaults to the combination of settings of
* the other write concern-related fields. If set, this will override all of the other write concern-related
* fields.
*
* @see #w
* @see #safe
* @see #wtimeout
* @see #fsync
* @see #j
*/
public WriteConcern writeConcern;
=======
/**
* Sets whether JMX beans registered by the driver should always be MBeans, regardless of whether the VM is
* Java 6 or greater. If false, the driver will use MXBeans if the VM is Java 6 or greater, and use MBeans if
* the VM is Java 5.
* <p>
* Default is false.
* </p>
*/
public boolean alwaysUseMBeans;
>>>>>>>
/**
* Sets the write concern. If this is not set, the write concern defaults to the combination of settings of
* the other write concern-related fields. If set, this will override all of the other write concern-related
* fields.
*
* @see #w
* @see #safe
* @see #wtimeout
* @see #fsync
* @see #j
*/
public WriteConcern writeConcern;
/**
* Sets whether JMX beans registered by the driver should always be MBeans, regardless of whether the VM is
* Java 6 or greater. If false, the driver will use MXBeans if the VM is Java 6 or greater, and use MBeans if
* the VM is Java 5.
* <p>
* Default is false.
* </p>
*/
public boolean alwaysUseMBeans; |
<<<<<<<
=======
private void fadeInSeekbarIfInvisible(){
if (mScrollSeekbar.getVisibility() == View.INVISIBLE || mScrollSeekbar.getVisibility() == View.GONE) {
mScrollSeekbar.startAnimation(mFadeInAnimation);
}
}
private void fadeoutSeekbarIfVisible(){
if (mScrollSeekbar.getVisibility() == View.VISIBLE) {
mScrollSeekbar.startAnimation(mFadeOutAnimation);
}
}
private Runnable mHideSeekbarRunnable = new Runnable() {
@Override
public void run() {
fadeoutSeekbarIfVisible();
}
};
private void initAnimations(){
mFadeInAnimation = AnimationUtils.loadAnimation(getActivity(), R.anim.fadein);
mFadeInAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
mScrollSeekbar.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
mFadeOutAnimation = AnimationUtils.loadAnimation(getActivity(), R.anim.fadeout);
mFadeOutAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
mScrollSeekbar.setVisibility(View.INVISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
}
@Override
public void onDestroyView() {
mFadeInAnimation.setAnimationListener(null);
mFadeOutAnimation.setAnimationListener(null);
super.onDestroyView();
}
>>>>>>>
private void fadeInSeekbarIfInvisible(){
if (mScrollSeekbar.getVisibility() == View.INVISIBLE || mScrollSeekbar.getVisibility() == View.GONE) {
mScrollSeekbar.startAnimation(mFadeInAnimation);
}
}
private void fadeoutSeekbarIfVisible(){
if (mScrollSeekbar.getVisibility() == View.VISIBLE) {
mScrollSeekbar.startAnimation(mFadeOutAnimation);
}
}
private Runnable mHideSeekbarRunnable = new Runnable() {
@Override
public void run() {
fadeoutSeekbarIfVisible();
}
};
private void initAnimations(){
mFadeInAnimation = AnimationUtils.loadAnimation(getActivity(), R.anim.fadein);
mFadeInAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
mScrollSeekbar.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
mFadeOutAnimation = AnimationUtils.loadAnimation(getActivity(), R.anim.fadeout);
mFadeOutAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
mScrollSeekbar.setVisibility(View.INVISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
}
@Override
public void onDestroyView() {
mFadeInAnimation.setAnimationListener(null);
mFadeOutAnimation.setAnimationListener(null);
super.onDestroyView();
} |
<<<<<<<
=======
@Override
public void onChapterSelect(int position) {
mFolioPageViewPager.setCurrentItem(position);
RelativeLayout relativeLayout= (RelativeLayout) findViewById(R.id.drawer_menu);
((DrawerLayout)findViewById(R.id.drawer_left)).closeDrawer(relativeLayout);
}
>>>>>>>
@Override
public void onChapterSelect(int position) {
mFolioPageViewPager.setCurrentItem(position);
RelativeLayout relativeLayout= (RelativeLayout) findViewById(R.id.drawer_menu);
((DrawerLayout)findViewById(R.id.drawer_left)).closeDrawer(relativeLayout);
} |
<<<<<<<
@Override
public void nextPage() {
if(isAdded()) {
if(getActivity() instanceof FolioActivity) {
((FolioActivity) getActivity()).nextPage();
}
}
}
@Override
public void previousPage() {
if(isAdded()) {
if(getActivity() instanceof FolioActivity) {
((FolioActivity) getActivity()).previousPage();
}
}
}
@Override
public void onStop() {
super.onStop();
mediaController.stop();
//TODO save last media overlay item
}
=======
>>>>>>>
@Override
public void nextPage() {
if(isAdded()) {
if(getActivity() instanceof FolioActivity) {
((FolioActivity) getActivity()).nextPage();
}
}
}
@Override
public void previousPage() {
if(isAdded()) {
if(getActivity() instanceof FolioActivity) {
((FolioActivity) getActivity()).previousPage();
}
}
} |
<<<<<<<
if (UiUtil.isOrientationHorizontal(getContext())) {
mWebview.loadUrl("javascript:alert(initializeHorizontalOrientation())");
}
scrollToHighlightId();
=======
>>>>>>>
if (UiUtil.isOrientationHorizontal(getContext())) {
mWebview.loadUrl("javascript:alert(initializeHorizontalOrientation())");
}
scrollToHighlightId(); |
<<<<<<<
File testPom = new File(GenerateReleaseTrainDocsTests.class.getResource("/test/pom.xml").toURI());
Model pom = PomReader.readPom(testPom);
String busVersion = pom.getProperties().getProperty("spring-cloud-bus.version");
List<Project> projects = new GenerateReleaseTrainDocs().mavenPropertiesToDocsProjects(testPom);
BDDAssertions.then(projects).extracting("name").containsOnly("spring-cloud-bus", "spring-cloud-build",
"spring-cloud-cloudfoundry", "spring-cloud-commons", "spring-cloud-circuitbreaker",
"spring-cloud-config", "spring-cloud-consul", "spring-cloud-contract", "spring-cloud-function",
"spring-cloud-gateway", "spring-cloud-kubernetes", "spring-cloud-netflix", "spring-cloud-openfeign",
"spring-cloud-security", "spring-cloud-sleuth", "spring-cloud-stream", "spring-cloud-task",
"spring-cloud-vault", "spring-cloud-zookeeper", "spring-cloud-cli");
BDDAssertions.then(projects).contains(new Project("spring-cloud-bus", busVersion));
=======
File testPom = new File(
GenerateReleaseTrainDocsTests.class.getResource("/test/pom.xml").toURI());
List<Project> projects = new GenerateReleaseTrainDocs()
.mavenPropertiesToDocsProjects(testPom);
BDDAssertions.then(projects).extracting("name").containsOnly(
"spring-cloud-foo-bus", "spring-cloud-foo-build",
"spring-cloud-foo-cloudfoundry", "spring-cloud-foo-commons",
"spring-cloud-foo-circuitbreaker", "spring-cloud-foo-config",
"spring-cloud-foo-consul", "spring-cloud-foo-contract",
"spring-cloud-foo-function", "spring-cloud-foo-gateway",
"spring-cloud-foo-kubernetes", "spring-cloud-foo-netflix",
"spring-cloud-foo-openfeign", "spring-cloud-foo-security",
"spring-cloud-foo-sleuth", "spring-cloud-foo-task",
"spring-cloud-foo-vault", "spring-cloud-foo-zookeeper",
"spring-cloud-foo-cli");
BDDAssertions.then(projects)
.contains(new Project("spring-cloud-foo-bus", "2.2.3.RELEASE"));
>>>>>>>
File testPom = new File(GenerateReleaseTrainDocsTests.class.getResource("/test/pom.xml").toURI());
List<Project> projects = new GenerateReleaseTrainDocs().mavenPropertiesToDocsProjects(testPom);
BDDAssertions.then(projects).extracting("name").containsOnly("spring-cloud-foo-bus", "spring-cloud-foo-build",
"spring-cloud-foo-cloudfoundry", "spring-cloud-foo-commons", "spring-cloud-foo-circuitbreaker",
"spring-cloud-foo-config", "spring-cloud-foo-consul", "spring-cloud-foo-contract",
"spring-cloud-foo-function", "spring-cloud-foo-gateway", "spring-cloud-foo-kubernetes",
"spring-cloud-foo-netflix", "spring-cloud-foo-openfeign", "spring-cloud-foo-security",
"spring-cloud-foo-sleuth", "spring-cloud-foo-task", "spring-cloud-foo-vault",
"spring-cloud-foo-zookeeper", "spring-cloud-foo-cli");
BDDAssertions.then(projects).contains(new Project("spring-cloud-foo-bus", "2.2.3.RELEASE"));
<<<<<<<
List<Project> projects = Arrays.asList(new Project("spring-cloud-foo", "1.0.0"),
new Project("spring-cloud-bar", "2.0.0"), new Project("spring-boot", "3.0.0"),
=======
List<Project> projects = Arrays.asList(
new Project("spring-cloud-foo-foo", "1.0.0"),
new Project("spring-cloud-foo-bar", "2.0.0"),
new Project("spring-boot", "3.0.0"),
>>>>>>>
List<Project> projects = Arrays.asList(new Project("spring-cloud-foo-foo", "1.0.0"),
new Project("spring-cloud-foo-bar", "2.0.0"), new Project("spring-boot", "3.0.0"),
<<<<<<<
BDDAssertions.then(configProps(generatedAdocs))
.contains("|spring.sleuth.async.configurer.enabled | true | Enable default AsyncConfigurer.");
=======
BDDAssertions.then(configProps(generatedAdocs)).contains(
"|spring.sleuth.async.configurer.enabled | `true` | Enable default AsyncConfigurer.");
>>>>>>>
BDDAssertions.then(configProps(generatedAdocs))
.contains("|spring.sleuth.async.configurer.enabled | `true` | Enable default AsyncConfigurer."); |
<<<<<<<
private static final String CONNECTION_TIMEOUT = "ConnectionTimeout";
private static final String READ_TIMEOUT = "ReadTimeout";
=======
private static final String TIMEOUT_CONFIG = "TimeoutConfig";
>>>>>>>
private static final String TIMEOUT_CONFIG = "TimeoutConfig";
<<<<<<<
final int connectionTimeout = getOrDefault(CONNECTION_TIMEOUT, int.class, Downloader.CONNECTION_TIMEOUT);
final int readTimeout = getOrDefault(READ_TIMEOUT, int.class, Downloader.READ_TIMEOUT);
=======
final ITimeoutConfig timeoutConfig = get(TIMEOUT_CONFIG, ITimeoutConfig.class);
>>>>>>>
final ITimeoutConfig timeoutConfig = get(TIMEOUT_CONFIG, ITimeoutConfig.class);
<<<<<<<
progressListener, userAgent, connectionTimeout, readTimeout);
=======
progressListener, userAgent,timeoutConfig);
>>>>>>>
progressListener, userAgent, timeoutConfig);
<<<<<<<
private final String _downloadPath;
private final IProgressListener _progressListener;
private final IDirectory _artifactStorePath;
private final ITempNaming _fileNaming;
private final String _downloadPrefix;
private final String _userAgent;
private final IPackageResolver _packageResolver;
private final int _connectionTimeout;
private final int _readTimeout;
public ImmutableDownloadConfig(String downloadPath, String downloadPrefix, IPackageResolver packageResolver,
IDirectory artifactStorePath, ITempNaming fileNaming,
IProgressListener progressListener, String userAgent,
int connectionTimeout, int readTimeout) {
super();
_downloadPath = downloadPath;
_downloadPrefix = downloadPrefix;
_packageResolver = packageResolver;
_artifactStorePath = artifactStorePath;
_fileNaming = fileNaming;
_progressListener = progressListener;
_userAgent = userAgent;
_connectionTimeout = connectionTimeout;
_readTimeout = readTimeout;
}
@Override
public String getDownloadPath() {
return _downloadPath;
}
@Override
public IProgressListener getProgressListener() {
return _progressListener;
}
@Override
public IDirectory getArtifactStorePath() {
return _artifactStorePath;
=======
private final String _downloadPath;
private final IProgressListener _progressListener;
private final IDirectory _artifactStorePath;
private final ITempNaming _fileNaming;
private final String _downloadPrefix;
private final String _userAgent;
private final IPackageResolver _packageResolver;
private final ITimeoutConfig _timeoutConfig;
public ImmutableDownloadConfig(String downloadPath, String downloadPrefix, IPackageResolver packageResolver,
IDirectory artifactStorePath, ITempNaming fileNaming, IProgressListener progressListener, String userAgent,ITimeoutConfig timeoutConfig) {
super();
_downloadPath = downloadPath;
_downloadPrefix = downloadPrefix;
_packageResolver = packageResolver;
_artifactStorePath = artifactStorePath;
_fileNaming = fileNaming;
_progressListener = progressListener;
_userAgent = userAgent;
_timeoutConfig = timeoutConfig;
}
@Override
public String getDownloadPath() {
return _downloadPath;
}
@Override
public IProgressListener getProgressListener() {
return _progressListener;
}
@Override
public IDirectory getArtifactStorePath() {
return _artifactStorePath;
}
@Override
public ITempNaming getFileNaming() {
return _fileNaming;
}
@Override
public String getDownloadPrefix() {
return _downloadPrefix;
}
@Override
public String getUserAgent() {
return _userAgent;
}
@Override
public IPackageResolver getPackageResolver() {
return _packageResolver;
}
@Override
public ITimeoutConfig getTimeoutConfig() {
return _timeoutConfig;
}
>>>>>>>
private final String _downloadPath;
private final IProgressListener _progressListener;
private final IDirectory _artifactStorePath;
private final ITempNaming _fileNaming;
private final String _downloadPrefix;
private final String _userAgent;
private final IPackageResolver _packageResolver;
private final ITimeoutConfig _timeoutConfig;
public ImmutableDownloadConfig(String downloadPath, String downloadPrefix, IPackageResolver packageResolver,
IDirectory artifactStorePath, ITempNaming fileNaming,
IProgressListener progressListener, String userAgent,
ITimeoutConfig timeoutConfig) {
super();
_downloadPath = downloadPath;
_downloadPrefix = downloadPrefix;
_packageResolver = packageResolver;
_artifactStorePath = artifactStorePath;
_fileNaming = fileNaming;
_progressListener = progressListener;
_userAgent = userAgent;
_timeoutConfig = timeoutConfig;
}
@Override
public String getDownloadPath() {
return _downloadPath;
}
@Override
public IProgressListener getProgressListener() {
return _progressListener;
}
@Override
public IDirectory getArtifactStorePath() {
return _artifactStorePath; |
<<<<<<<
=======
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
>>>>>>>
import org.apache.commons.io.IOUtils;
<<<<<<<
=======
private static final Pattern CONTENT_SCRIPTS_DOCUMENT_START_PATTERN = Pattern.compile("\"js\":\\s+\\[([^\\]]+)\\].+\"run_at\":\\s+\"document_start\"", Pattern.MULTILINE | Pattern.DOTALL);
private static final Pattern CONTENT_SCRIPTS_DOCUMENT_END_PATTERN = Pattern.compile("\"document_start\".+\"js\":\\s+\\[([^\\]]+)\\].+\"run_at\":\\s+\"document_end\"", Pattern.MULTILINE | Pattern.DOTALL);
public static void writeLocalScriptRulesToFile(File dest, Set<String> scriptRules) throws IOException {
String scriptRulesText = getScriptRulesText(scriptRules);
String settings = String.format(LOCAL_SCRIPT_RULES_FILE_TEMPLATE, scriptRulesText);
FileUtils.writeStringToFile(getLocalScriptRulesFile(dest), settings, "utf-8");
}
>>>>>>>
private static final Pattern CONTENT_SCRIPTS_DOCUMENT_START_PATTERN = Pattern.compile("\"js\":\\s+\\[([^\\]]+)\\].+\"run_at\":\\s+\"document_start\"", Pattern.MULTILINE | Pattern.DOTALL);
private static final Pattern CONTENT_SCRIPTS_DOCUMENT_END_PATTERN = Pattern.compile("\"document_start\".+\"js\":\\s+\\[([^\\]]+)\\].+\"run_at\":\\s+\"document_end\"", Pattern.MULTILINE | Pattern.DOTALL); |
<<<<<<<
public static boolean persistStringSet(final Preference preference, final Set<String> values) {
//noinspection ConstantConditions
if (values == null) {
throw new IllegalArgumentException("Cannot persist null string set.");
}
if (!shouldPersist(preference)) {
return false;
}
try {
// Shouldn't store null
if (values.equals(getPersistedStringSet(preference, null))) {
// It's already there, so the same as persisting
return true;
}
} catch (ClassCastException ignore) {
// We were checking for equality or null. We got a different type. Overwrite that.
}
PreferenceDataStore dataStore = preference.getPreferenceDataStore();
if (dataStore != null) {
dataStore.putStringSet(preference.getKey(), values);
} else {
SharedPreferences.Editor editor = XpPreferenceManagerCompat.getEditor(preference.getPreferenceManager());
editor.putStringSet(preference.getKey(), values);
tryCommit(preference, editor);
}
return true;
=======
public static boolean persistStringSet(@NonNull Preference preference, @NonNull Set<String> values) {
return XpPreferenceCompat.persistStringSet(preference, values);
>>>>>>>
public static boolean persistStringSet(final @NonNull Preference preference, final @NonNull Set<String> values) {
//noinspection ConstantConditions
if (values == null) {
throw new IllegalArgumentException("Cannot persist null string set.");
}
if (!shouldPersist(preference)) {
return false;
}
try {
// Shouldn't store null
if (values.equals(getPersistedStringSet(preference, null))) {
// It's already there, so the same as persisting
return true;
}
} catch (ClassCastException ignore) {
// We were checking for equality or null. We got a different type. Overwrite that.
}
PreferenceDataStore dataStore = preference.getPreferenceDataStore();
if (dataStore != null) {
dataStore.putStringSet(preference.getKey(), values);
} else {
SharedPreferences.Editor editor = XpPreferenceManagerCompat.getEditor(preference.getPreferenceManager());
editor.putStringSet(preference.getKey(), values);
tryCommit(preference, editor);
}
return true;
<<<<<<<
public static Set<String> getPersistedStringSet(
final Preference preference, @Nullable final Set<String> defaultReturnValue) {
if (!shouldPersist(preference)) {
return defaultReturnValue;
}
PreferenceDataStore dataStore = preference.getPreferenceDataStore();
if (dataStore != null) {
return dataStore.getStringSet(preference.getKey(), defaultReturnValue);
}
return XpSharedPreferences.getStringSet(preference.getSharedPreferences(), preference.getKey(), defaultReturnValue);
=======
public static Set<String> getPersistedStringSet(@NonNull Preference preference, @Nullable Set<String> defaultReturnValue) {
return XpPreferenceCompat.getPersistedStringSet(preference, defaultReturnValue);
>>>>>>>
public static Set<String> getPersistedStringSet(
final @NonNull Preference preference, @Nullable final Set<String> defaultReturnValue) {
if (!shouldPersist(preference)) {
return defaultReturnValue;
}
PreferenceDataStore dataStore = preference.getPreferenceDataStore();
if (dataStore != null) {
return dataStore.getStringSet(preference.getKey(), defaultReturnValue);
}
return XpSharedPreferences.getStringSet(preference.getSharedPreferences(), preference.getKey(), defaultReturnValue); |
<<<<<<<
=======
private static SecurityPermission TABLE_MANAGER_PERMISSION =
new SecurityPermission("tableManagerPermission");
>>>>>>>
<<<<<<<
private static final Set<TableObserver> observers = Collections.synchronizedSet(new HashSet<>());
private static final Map<TableId,TableState> tableStateCache = Collections
.synchronizedMap(new HashMap<>());
private static final byte[] ZERO_BYTE = {'0'};
private final ServerContext context;
private final String zkRoot;
private final String instanceID;
private final ZooReaderWriter zoo;
=======
private static final Set<TableObserver> observers =
Collections.synchronizedSet(new HashSet<TableObserver>());
private static final Map<String,TableState> tableStateCache =
Collections.synchronizedMap(new HashMap<String,TableState>());
private static final byte[] ZERO_BYTE = new byte[] {'0'};
private static TableManager tableManager = null;
private final Instance instance;
>>>>>>>
private static final Set<TableObserver> observers = Collections.synchronizedSet(new HashSet<>());
private static final Map<TableId,TableState> tableStateCache =
Collections.synchronizedMap(new HashMap<>());
private static final byte[] ZERO_BYTE = {'0'};
private final ServerContext context;
private final String zkRoot;
private final String instanceID;
private final ZooReaderWriter zoo;
<<<<<<<
this.message = "Error transitioning from " + oldState + " state to " + newState + " state";
=======
String defaultMessage =
"Error transitioning from " + oldState + " state to " + newState + " state";
this.message = defaultMessage;
>>>>>>>
this.message = "Error transitioning from " + oldState + " state to " + newState + " state";
<<<<<<<
for (String tableId : zooStateCache.getChildren(zkRoot + Constants.ZTABLES))
if (zooStateCache
.get(zkRoot + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE) != null)
updateTableStateCache(TableId.of(tableId));
=======
for (String tableId : zooStateCache
.getChildren(ZooUtil.getRoot(instance) + Constants.ZTABLES))
if (zooStateCache.get(
ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE)
!= null)
updateTableStateCache(tableId);
>>>>>>>
for (String tableId : zooStateCache.getChildren(zkRoot + Constants.ZTABLES))
if (zooStateCache.get(zkRoot + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE)
!= null)
updateTableStateCache(TableId.of(tableId)); |
<<<<<<<
=======
private static final int MSG_FETCHING_PICTURES = 17;
private static final int MSG_UPDATE_ATTACHMENT_ICON = 18;
>>>>>>>
private static final int MSG_UPDATE_ATTACHMENT_ICON = 18;
<<<<<<<
=======
case MSG_FETCHING_PICTURES:
Toast.makeText(MessageView.this,
getString(R.string.message_view_fetching_pictures_toast),
Toast.LENGTH_SHORT).show();
break;
case MSG_UPDATE_ATTACHMENT_ICON:
((Attachment) mAttachments.getChildAt(msg.arg1).getTag())
.iconView.setImageBitmap((Bitmap) msg.obj);
break;
>>>>>>>
case MSG_UPDATE_ATTACHMENT_ICON:
((Attachment) mAttachments.getChildAt(msg.arg1).getTag())
.iconView.setImageBitmap((Bitmap) msg.obj);
break;
<<<<<<<
=======
public void fetchingPictures() {
sendEmptyMessage(MSG_FETCHING_PICTURES);
}
public void updateAttachmentIcon(int pos, Bitmap icon) {
android.os.Message msg = android.os.Message.obtain(this, MSG_UPDATE_ATTACHMENT_ICON);
msg.arg1 = pos;
msg.obj = icon;
sendMessage(msg);
}
>>>>>>>
public void updateAttachmentIcon(int pos, Bitmap icon) {
android.os.Message msg = android.os.Message.obtain(this, MSG_UPDATE_ATTACHMENT_ICON);
msg.arg1 = pos;
msg.obj = icon;
sendMessage(msg);
} |
<<<<<<<
if (maxScreenLockTime > SCREEN_LOCK_TIME_MAX) {
throw new IllegalArgumentException("screen lock time");
}
if (passwordExpiration > PASSWORD_EXPIRATION_MAX) {
throw new IllegalArgumentException("password expiration");
}
if (passwordHistory > PASSWORD_HISTORY_MAX) {
throw new IllegalArgumentException("password history");
}
if (passwordComplexChars > PASSWORD_COMPLEX_CHARS_MAX) {
throw new IllegalArgumentException("complex chars");
}
=======
>>>>>>>
if (passwordExpiration > PASSWORD_EXPIRATION_MAX) {
throw new IllegalArgumentException("password expiration");
}
if (passwordHistory > PASSWORD_HISTORY_MAX) {
throw new IllegalArgumentException("password history");
}
if (passwordComplexChars > PASSWORD_COMPLEX_CHARS_MAX) {
throw new IllegalArgumentException("complex chars");
} |
<<<<<<<
/*
* Copyright (C) 2012-2019 52°North Initiative for Geospatial Open Source
=======
/**
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source
>>>>>>>
/*
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source |
<<<<<<<
* Scans the given file line-by-line (ignoring empty lines) and returns a list containing those lines. If decode is set to true, every line is decoded using
* {@link Base64} from the UTF-8 bytes of that line before inserting in the list.
=======
* Scans the given file line-by-line (ignoring empty lines) and returns a list containing those
* lines. If decode is set to true, every line is decoded using
* {@link Base64#decodeBase64(byte[])} from the UTF-8 bytes of that line before inserting in the
* list.
>>>>>>>
* Scans the given file line-by-line (ignoring empty lines) and returns a list containing those
* lines. If decode is set to true, every line is decoded using {@link Base64} from the UTF-8
* bytes of that line before inserting in the list. |
<<<<<<<
// flush of metadata table should change file set in root table
Assert.assertTrue(files2.size() > 0);
Assert.assertNotEquals(files1, files2);
=======
// flush of metadata table should change file set in root table
assertTrue(files2.size() > 0);
assertNotEquals(files1, files2);
>>>>>>>
// flush of metadata table should change file set in root table
assertTrue(files2.size() > 0);
assertNotEquals(files1, files2);
<<<<<<<
// compaction of metadata table should change file set in root table
Assert.assertNotEquals(files2, files3);
}
=======
// compaction of metadata table should change file set in root table
assertNotEquals(files2, files3);
>>>>>>>
// compaction of metadata table should change file set in root table
assertNotEquals(files2, files3);
} |
<<<<<<<
* Maximum size of a mutation (2GB).
*/
static final long MAX_MUTATION_SIZE = (1L << 31);
static final long SERIALIZATION_OVERHEAD = 5;
/**
* Formats available for serializing Mutations. The formats are described in a <a href="doc-files/mutation-serialization.html">separate document</a>.
=======
* Formats available for serializing Mutations. The formats are described in a
* <a href="doc-files/mutation-serialization.html">separate document</a>.
>>>>>>>
* Maximum size of a mutation (2GB).
*/
static final long MAX_MUTATION_SIZE = (1L << 31);
static final long SERIALIZATION_OVERHEAD = 5;
/**
* Formats available for serializing Mutations. The formats are described in a
* <a href="doc-files/mutation-serialization.html">separate document</a>. |
<<<<<<<
if (!useAccumuloStart)
clazz = Writer.class.getClassLoader().loadClass(classname).asSubclass(KeyFunctor.class);
else if (context != null && !context.equals(""))
clazz = AccumuloVFSClassLoader.getContextManager().loadClass(context, classname, KeyFunctor.class);
=======
if (context != null && !context.equals(""))
clazz = AccumuloVFSClassLoader.getContextManager().loadClass(context, classname,
KeyFunctor.class);
>>>>>>>
if (!useAccumuloStart)
clazz = Writer.class.getClassLoader().loadClass(classname).asSubclass(KeyFunctor.class);
else if (context != null && !context.equals(""))
clazz = AccumuloVFSClassLoader.getContextManager().loadClass(context, classname,
KeyFunctor.class);
<<<<<<<
ConfigurationCopy acuconf = new ConfigurationCopy(DefaultConfiguration.getInstance());
=======
ConfigurationCopy acuconf = new ConfigurationCopy(
AccumuloConfiguration.getDefaultConfiguration());
>>>>>>>
ConfigurationCopy acuconf = new ConfigurationCopy(DefaultConfiguration.getInstance());
<<<<<<<
org.apache.accumulo.core.data.Key k1 = new org.apache.accumulo.core.data.Key(new Text("r" + fi), new Text("cf1"));
bmfr.seek(new Range(k1, true, k1.followingKey(PartialKey.ROW_COLFAM), false), new ArrayList<>(), false);
=======
org.apache.accumulo.core.data.Key k1 = new org.apache.accumulo.core.data.Key(
new Text("r" + fi), new Text("cf1"));
bmfr.seek(new Range(k1, true, k1.followingKey(PartialKey.ROW_COLFAM), false),
new ArrayList<ByteSequence>(), false);
>>>>>>>
org.apache.accumulo.core.data.Key k1 = new org.apache.accumulo.core.data.Key(
new Text("r" + fi), new Text("cf1"));
bmfr.seek(new Range(k1, true, k1.followingKey(PartialKey.ROW_COLFAM), false),
new ArrayList<>(), false);
<<<<<<<
org.apache.accumulo.core.data.Key k1 = new org.apache.accumulo.core.data.Key(new Text("r" + fi), new Text("cf1"));
bmfr.seek(new Range(k1, true, k1.followingKey(PartialKey.ROW_COLFAM), false), new ArrayList<>(), false);
=======
org.apache.accumulo.core.data.Key k1 = new org.apache.accumulo.core.data.Key(
new Text("r" + fi), new Text("cf1"));
bmfr.seek(new Range(k1, true, k1.followingKey(PartialKey.ROW_COLFAM), false),
new ArrayList<ByteSequence>(), false);
>>>>>>>
org.apache.accumulo.core.data.Key k1 = new org.apache.accumulo.core.data.Key(
new Text("r" + fi), new Text("cf1"));
bmfr.seek(new Range(k1, true, k1.followingKey(PartialKey.ROW_COLFAM), false),
new ArrayList<>(), false); |
<<<<<<<
private final TrMainWindow mainWindow;
private final EventBus eventBus;
=======
private final TrUI mainWindow;
>>>>>>>
private final EventBus eventBus;
private final TrUI mainWindow; |
<<<<<<<
=======
import com.vladmihalcea.flexypool.strategy.RetryConnectionAcquiringStrategy;
>>>>>>>
import com.vladmihalcea.flexypool.strategy.RetryConnectionAcquiringStrategy;
<<<<<<<
=======
import org.apache.logging.log4j.LogManager;
>>>>>>> |
<<<<<<<
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collections;
import java.util.concurrent.ThreadFactory;
import java.util.function.Consumer;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import javax.annotation.Nonnull;
import javax.inject.Singleton;
import javax.sql.DataSource;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jooq.DSLContext;
=======
>>>>>>>
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collections;
import java.util.concurrent.ThreadFactory;
import java.util.function.Consumer;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import javax.annotation.Nonnull;
import javax.inject.Singleton;
import javax.sql.DataSource;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jooq.DSLContext; |
<<<<<<<
import com.torodb.core.transaction.metainf.MetaCollection;
import com.torodb.core.transaction.metainf.MetaDatabase;
import com.torodb.core.transaction.metainf.MetaDocPart;
import com.torodb.core.transaction.metainf.MutableMetaSnapshot;
import com.torodb.d2r.D2RTranslatorStack;
import com.torodb.d2r.IdentifierFactoryImpl;
import com.torodb.d2r.MockRidGenerator;
import com.torodb.d2r.R2DBackedTranslator;
import com.torodb.kvdocument.conversion.json.JacksonJsonParser;
import com.torodb.kvdocument.conversion.json.JsonParser;
import com.torodb.kvdocument.values.KVDocument;
=======
>>>>>>>
<<<<<<<
@SuppressWarnings({ "unchecked", "rawtypes" })
protected Collection<KVDocument> readDocuments(MetaDatabase metaDatabase, MetaCollection metaCollection,
DocPartResults<ResultSet> docPartResultSets) {
R2DTranslator r2dTranslator = new R2DBackedTranslator(new R2DBackendTranslatorImpl(databaseInterface, metaDatabase, metaCollection));
Collection<KVDocument> readedDocuments = r2dTranslator.translate(docPartResultSets);
return readedDocuments;
}
protected List<Integer> writeCollectionData(DSLContext dsl, CollectionData collectionData) {
Iterator<DocPartData> docPartDataIterator = StreamSupport.stream(collectionData.spliterator(), false)
.iterator();
List<Integer> generatedDids = new ArrayList<>();
while (docPartDataIterator.hasNext()) {
DocPartData docPartData = docPartDataIterator.next();
if (docPartData.getMetaDocPart().getTableRef().isRoot()) {
docPartData.forEach(docPartRow -> {
generatedDids.add(docPartRow.getDid());
});
}
databaseInterface.insertDocPartData(dsl, schema.databaseSchemaName, docPartData);
}
return generatedDids;
}
protected CollectionData writeDocumentMeta(MutableMetaSnapshot mutableSnapshot, DSLContext dsl, KVDocument document)
throws Exception {
CollectionData collectionData = readDataFromDocument(schema.databaseName, schema.collectionName, document, mutableSnapshot);
mutableSnapshot.streamMetaDatabases().forEachOrdered(metaDatabase -> {
metaDatabase.streamMetaCollections().forEachOrdered(metaCollection -> {
metaCollection.streamContainedMetaDocParts().sorted(TableRefComparator.MetaDocPart.ASC).forEachOrdered(metaDocPartObject -> {
MetaDocPart metaDocPart = (MetaDocPart) metaDocPartObject;
List<Field<?>> fields = new ArrayList<>(databaseInterface.getDocPartTableInternalFields(metaDocPart));
metaDocPart.streamFields().forEachOrdered(metaField -> {
fields.add(DSL.field(metaField.getIdentifier(), databaseInterface.getDataType(metaField.getType())));
});
dsl.execute(databaseInterface.createDocPartTableStatement(dsl.configuration(), schema.databaseSchemaName, metaDocPart.getIdentifier(), fields));
});
});
});
return collectionData;
}
protected CollectionData writeDocumentsMeta(MutableMetaSnapshot mutableSnapshot, DSLContext dsl, List<KVDocument> documents)
throws Exception {
CollectionData collectionData = readDataFromDocuments(schema.databaseName, schema.collectionName, documents, mutableSnapshot);
mutableSnapshot.streamMetaDatabases().forEachOrdered(metaDatabase -> {
metaDatabase.streamMetaCollections().forEachOrdered(metaCollection -> {
metaCollection.streamContainedMetaDocParts().sorted(TableRefComparator.MetaDocPart.ASC).forEachOrdered(metaDocPartObject -> {
MetaDocPart metaDocPart = (MetaDocPart) metaDocPartObject;
List<Field<?>> fields = new ArrayList<>(databaseInterface.getDocPartTableInternalFields(metaDocPart));
metaDocPart.streamFields().forEachOrdered(metaField -> {
fields.add(DSL.field(metaField.getIdentifier(), databaseInterface.getDataType(metaField.getType())));
});
dsl.execute(databaseInterface.createDocPartTableStatement(dsl.configuration(), schema.databaseSchemaName, metaDocPart.getIdentifier(), fields));
});
});
});
return collectionData;
}
protected KVDocument parseFromJson(String jsonFileName) throws Exception {
return parser.createFromResource("docs/" + jsonFileName);
}
=======
protected abstract void cleanDatabase(DatabaseInterface databaseInterface, DataSource dataSource) throws SQLException;
>>>>>>> |
<<<<<<<
protected static class ZooKeeperConnectionInfo {
String keepers, scheme;
int timeout;
byte[] auth;
public ZooKeeperConnectionInfo(String keepers, int timeout, String scheme, byte[] auth) {
Preconditions.checkNotNull(keepers);
this.keepers = keepers;
this.timeout = timeout;
this.scheme = scheme;
this.auth = auth;
}
@Override
public int hashCode() {
final HashCodeBuilder hcb = new HashCodeBuilder(31, 47);
hcb.append(keepers).append(timeout);
if (null != scheme) {
hcb.append(scheme);
}
if (null != auth) {
hcb.append(auth);
}
return hcb.toHashCode();
}
@Override
public boolean equals(Object o) {
if (o instanceof ZooKeeperConnectionInfo) {
ZooKeeperConnectionInfo other = (ZooKeeperConnectionInfo) o;
if (!keepers.equals(other.keepers) || timeout != other.timeout) {
return false;
}
if (null != scheme) {
if (null == other.scheme) {
// Ours is non-null, theirs is null
return false;
} else if (!scheme.equals(other.scheme)) {
// Both non-null but not equal
return false;
}
}
if (null != auth) {
if (null == other.auth) {
return false;
} else if (!Arrays.equals(auth, other.auth)) {
// both non-null but not equal
return false;
}
}
return true;
}
return false;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder(64);
sb.append("zookeepers=").append(keepers);
sb.append(", timeout=").append(timeout);
sb.append(", scheme=").append(scheme);
sb.append(", auth=").append(null == auth ? "null" : "REDACTED");
return sb.toString();
}
}
=======
>>>>>>>
protected static class ZooKeeperConnectionInfo {
String keepers, scheme;
int timeout;
byte[] auth;
public ZooKeeperConnectionInfo(String keepers, int timeout, String scheme, byte[] auth) {
Preconditions.checkNotNull(keepers);
this.keepers = keepers;
this.timeout = timeout;
this.scheme = scheme;
this.auth = auth;
}
@Override
public int hashCode() {
final HashCodeBuilder hcb = new HashCodeBuilder(31, 47);
hcb.append(keepers).append(timeout);
if (null != scheme) {
hcb.append(scheme);
}
if (null != auth) {
hcb.append(auth);
}
return hcb.toHashCode();
}
@Override
public boolean equals(Object o) {
if (o instanceof ZooKeeperConnectionInfo) {
ZooKeeperConnectionInfo other = (ZooKeeperConnectionInfo) o;
if (!keepers.equals(other.keepers) || timeout != other.timeout) {
return false;
}
if (null != scheme) {
if (null == other.scheme) {
// Ours is non-null, theirs is null
return false;
} else if (!scheme.equals(other.scheme)) {
// Both non-null but not equal
return false;
}
}
if (null != auth) {
if (null == other.auth) {
return false;
} else if (!Arrays.equals(auth, other.auth)) {
// both non-null but not equal
return false;
}
}
return true;
}
return false;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder(64);
sb.append("zookeepers=").append(keepers);
sb.append(", timeout=").append(timeout);
sb.append(", scheme=").append(scheme);
sb.append(", auth=").append(null == auth ? "null" : "REDACTED");
return sb.toString();
}
}
<<<<<<<
List<String> children;
final Retry retry = RETRY_FACTORY.create();
while (true) {
try {
children = getZooKeeper(info).getChildren(zPath, false);
break;
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
for (String child : children)
recursiveDelete(info, zPath + "/" + child, NodeMissingPolicy.SKIP);
Stat stat;
while (true) {
try {
stat = getZooKeeper(info).exists(zPath, null);
// Node exists
if (stat != null) {
try {
// Try to delete it
getZooKeeper(info).delete(zPath, stat.getVersion());
return;
} catch (NoNodeException e) {
// If the node is gone now, it's ok if we have SKIP
if (policy.equals(NodeMissingPolicy.SKIP)) {
return;
}
throw e;
}
// Let other KeeperException bubble to the outer catch
}
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
=======
for (String child : zk.getChildren(zPath, false))
recursiveDelete(zk, zPath + "/" + child, NodeMissingPolicy.SKIP);
if (zk.exists(zPath, null) != null) {
// Try to delete it. We don't care if there was an update to the node
// since we got the Stat, just delete all versions (-1).
zk.delete(zPath, -1);
}
>>>>>>>
List<String> children;
final Retry retry = RETRY_FACTORY.create();
while (true) {
try {
children = getZooKeeper(info).getChildren(zPath, false);
break;
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
for (String child : children)
recursiveDelete(info, zPath + "/" + child, NodeMissingPolicy.SKIP);
Stat stat;
while (true) {
try {
stat = getZooKeeper(info).exists(zPath, null);
// Node exists
if (stat != null) {
try {
// Try to delete it. We don't care if there was an update to the node
// since we got the Stat, just delete all versions (-1).
getZooKeeper(info).delete(zPath, -1);
return;
} catch (NoNodeException e) {
// If the node is gone now, it's ok if we have SKIP
if (policy.equals(NodeMissingPolicy.SKIP)) {
return;
}
throw e;
}
// Let other KeeperException bubble to the outer catch
}
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
<<<<<<<
public static boolean putPersistentData(ZooKeeperConnectionInfo info, String zPath, byte[] data, NodeExistsPolicy policy) throws KeeperException,
=======
public static boolean putPersistentData(ZooKeeper zk, String zPath, byte[] data, NodeExistsPolicy policy) throws KeeperException, InterruptedException {
return putData(zk, zPath, data, CreateMode.PERSISTENT, -1, policy, PUBLIC);
}
public static boolean putPersistentData(ZooKeeper zk, String zPath, byte[] data, int version, NodeExistsPolicy policy) throws KeeperException,
>>>>>>>
public static boolean putPersistentData(ZooKeeperConnectionInfo info, String zPath, byte[] data, NodeExistsPolicy policy) throws KeeperException,
<<<<<<<
public static boolean putPersistentData(ZooKeeperConnectionInfo info, String zPath, byte[] data, int version, NodeExistsPolicy policy)
=======
public static boolean putPersistentData(ZooKeeper zk, String zPath, byte[] data, int version, NodeExistsPolicy policy, List<ACL> acls)
>>>>>>>
public static boolean putPersistentData(ZooKeeperConnectionInfo info, String zPath, byte[] data, int version, NodeExistsPolicy policy)
<<<<<<<
public static boolean putPersistentData(ZooKeeperConnectionInfo info, String zPath, byte[] data, int version, NodeExistsPolicy policy, List<ACL> acls)
throws KeeperException, InterruptedException {
return putData(info, zPath, data, CreateMode.PERSISTENT, version, policy, acls);
}
private static boolean putData(ZooKeeperConnectionInfo info, String zPath, byte[] data, CreateMode mode, int version, NodeExistsPolicy policy, List<ACL> acls)
=======
private static boolean putData(ZooKeeper zk, String zPath, byte[] data, CreateMode mode, int version, NodeExistsPolicy policy, List<ACL> acls)
>>>>>>>
public static boolean putPersistentData(ZooKeeperConnectionInfo info, String zPath, byte[] data, int version, NodeExistsPolicy policy, List<ACL> acls)
throws KeeperException, InterruptedException {
return putData(info, zPath, data, CreateMode.PERSISTENT, version, policy, acls);
}
private static boolean putData(ZooKeeperConnectionInfo info, String zPath, byte[] data, CreateMode mode, int version, NodeExistsPolicy policy, List<ACL> acls)
<<<<<<<
final Retry retry = RETRY_FACTORY.create();
=======
>>>>>>>
final Retry retry = RETRY_FACTORY.create();
<<<<<<<
Stat stat = getZooKeeper(info).exists(lid.path + "/" + lid.node, false);
=======
Stat stat = zk.exists(lid.path + "/" + lid.node, false);
>>>>>>>
Stat stat = getZooKeeper(info).exists(lid.path + "/" + lid.node, false); |
<<<<<<<
import static org.junit.Assert.*;
=======
import com.google.inject.Injector;
import com.torodb.backend.AbstractBackendTest;
import com.torodb.backend.BackendDocumentTestHelper;
import com.torodb.backend.BackendTestHelper;
import com.torodb.backend.converters.jooq.DataTypeForKV;
import com.torodb.backend.exceptions.InvalidDatabaseException;
import com.torodb.backend.meta.TorodbMeta;
import com.torodb.core.d2r.CollectionData;
import com.torodb.core.d2r.DocPartResults;
import com.torodb.core.document.ToroDocument;
import com.torodb.core.transaction.metainf.FieldType;
import com.torodb.core.transaction.metainf.ImmutableMetaCollection;
import com.torodb.core.transaction.metainf.ImmutableMetaDatabase;
import com.torodb.core.transaction.metainf.ImmutableMetaDocPart;
import com.torodb.core.transaction.metainf.ImmutableMetaField;
import com.torodb.core.transaction.metainf.ImmutableMetaSnapshot;
import com.torodb.core.transaction.metainf.MetaCollection;
import com.torodb.core.transaction.metainf.MetaDatabase;
import com.torodb.core.transaction.metainf.MetaDocPart;
import com.torodb.core.transaction.metainf.MetaField;
import com.torodb.core.transaction.metainf.MetaSnapshot;
import com.torodb.core.transaction.metainf.MutableMetaSnapshot;
import com.torodb.core.transaction.metainf.WrapperMutableMetaSnapshot;
import com.torodb.kvdocument.values.KVDocument;
import com.torodb.kvdocument.values.KVInteger;
import com.torodb.kvdocument.values.KVValue;
import com.torodb.kvdocument.values.heap.ListKVArray;
>>>>>>>
import static org.junit.Assert.*;
<<<<<<<
/**
* This test whether the snapshot can be build and if it can be rebuild.
* @throws Exception
*/
=======
@Override
protected Injector createInjector() {
return Derby.createInjector();
}
@Override
protected void cleanDatabase(Injector injector) throws SQLException {
Derby.cleanDatabase(injector);
}
private FieldType fieldType(Field<?> field) {
return FieldType.from(((DataTypeForKV<?>) field.getDataType()).getKVValueConverter().getErasuredType());
}
private TorodbMeta buildTorodbMeta() throws SQLException, IOException, InvalidDatabaseException{
return new TorodbMeta(tableRefFactory, sqlInterface);
}
private DSLContext dsl(Connection connection){
return sqlInterface.createDSLContext(connection);
}
>>>>>>>
@Override
protected Injector createInjector() {
return Derby.createInjector();
}
@Override
protected void cleanDatabase(Injector injector) throws SQLException {
Derby.cleanDatabase(injector);
}
private FieldType fieldType(Field<?> field) {
return FieldType.from(((DataTypeForKV<?>) field.getDataType()).getKVValueConverter().getErasuredType());
}
private ImmutableMetaSnapshot buildMetaSnapshot() {
MvccMetainfoRepository metainfoRepository = new MvccMetainfoRepository();
SnapshotUpdater.updateSnapshot(metainfoRepository, sqlInterface, tableRefFactory);
try (SnapshotStage stage = metainfoRepository.startSnapshotStage()) {
return stage.createImmutableSnapshot();
}
}
private TorodbMeta buildTorodbMeta() throws SQLException, IOException, InvalidDatabaseException {
return new TorodbMeta(tableRefFactory, sqlInterface);
}
private DSLContext dsl(Connection connection){
return sqlInterface.createDSLContext(connection);
}
/**
* This test whether the snapshot can be build and if it can be rebuild.
* @throws Exception
*/
<<<<<<<
@Override
protected DbBackend createDbBackend() {
return Derby.getDbBackend();
}
@Override
protected SqlInterface createSqlInterface(DbBackend dbBackend) {
return new DerbySqlInterface(dbBackend);
}
@Override
protected void cleanDatabase(SqlInterface sqlInterface) throws SQLException {
Derby.cleanDatabase(sqlInterface);
}
private FieldType fieldType(Field<?> field) {
return FieldType.from(((DataTypeForKV<?>) field.getDataType()).getKVValueConverter().getErasuredType());
}
private ImmutableMetaSnapshot buildMetaSnapshot() {
MvccMetainfoRepository metainfoRepository = new MvccMetainfoRepository();
SnapshotUpdater.updateSnapshot(metainfoRepository, sqlInterface, tableRefFactory);
try (SnapshotStage stage = metainfoRepository.startSnapshotStage()) {
return stage.createImmutableSnapshot();
}
}
private DSLContext dsl(Connection connection){
return sqlInterface.createDSLContext(connection);
}
=======
>>>>>>> |
<<<<<<<
import java.io.IOException;
=======
import static com.google.common.base.Charsets.UTF_8;
>>>>>>>
import static com.google.common.base.Charsets.UTF_8;
import java.io.IOException; |
<<<<<<<
import java.sql.SQLException;
import org.junit.Before;
import com.google.inject.Injector;
=======
>>>>>>>
import java.sql.SQLException;
import org.junit.Before;
import com.google.inject.Injector;
<<<<<<<
Injector injector = createInjector();
cleanDatabase(injector);
sqlInterface = injector.getInstance(SqlInterface.class);
=======
DbBackend dbBackend = createDbBackend();
dbBackend.startAsync();
dbBackend.awaitRunning();
sqlInterface = createSqlInterface(dbBackend);
>>>>>>>
Injector injector = createInjector();
DbBackendService dbBackend = injector.getInstance(DbBackendService.class);
dbBackend.startAsync();
dbBackend.awaitRunning();
cleanDatabase(injector);
sqlInterface = injector.getInstance(SqlInterface.class); |
<<<<<<<
for(CustomModules module : ((IModuleInventory) te).getInsertedModules())
probeInfo.text(TextFormatting.GRAY + "- " + module.getName());
=======
for(ModuleType module : ((CustomizableTileEntity) te).getModules())
probeInfo.text(TextFormatting.GRAY + "- " + new TranslationTextComponent(module.getTranslationKey()).getFormattedText());
>>>>>>>
for(ModuleType module : ((IModuleInventory) te).getInsertedModules())
probeInfo.text(TextFormatting.GRAY + "- " + new TranslationTextComponent(module.getTranslationKey()).getFormattedText()); |
<<<<<<<
guiButtons[i][j] = new PictureButton(id++, btnX, btnY, 20, 20, itemRenderer, new ItemStack(SCContent.wireCutters), this::actionPerformed);
guiButtons[i][j].active = false;
=======
guiButtons[i][j] = new PictureButton(id++, btnX, btnY, 20, 20, itemRenderer, new ItemStack(SCContent.WIRE_CUTTERS.get()), this::actionPerformed);
guiButtons[i][j].active = active && bound && defusable;
>>>>>>>
guiButtons[i][j] = new PictureButton(id++, btnX, btnY, 20, 20, itemRenderer, new ItemStack(SCContent.WIRE_CUTTERS.get()), this::actionPerformed);
guiButtons[i][j].active = false; |
<<<<<<<
import net.geforcemods.securitycraft.containers.ModuleItemInventory;
import net.geforcemods.securitycraft.misc.CustomModules;
=======
import net.geforcemods.securitycraft.containers.ModuleInventory;
import net.geforcemods.securitycraft.misc.ModuleType;
>>>>>>>
import net.geforcemods.securitycraft.containers.ModuleItemInventory;
import net.geforcemods.securitycraft.misc.ModuleType; |
<<<<<<<
public IModuleInventory moduleInv;
=======
public CustomizableTileEntity tileEntity;
private final int maxSlots;
>>>>>>>
public IModuleInventory moduleInv;
private final int maxSlots;
<<<<<<<
this.moduleInv = (IModuleInventory)world.getTileEntity(pos);
int slotId = 0;
if(moduleInv.enableHack())
slotId = 100;
if(moduleInv.getMaxNumberOfModules() == 1)
addSlot(new SlotItemHandler(moduleInv, slotId, 79, 20));
else if(moduleInv.getMaxNumberOfModules() == 2){
addSlot(new SlotItemHandler(moduleInv, slotId++, 70, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 88, 20));
}else if(moduleInv.getMaxNumberOfModules() == 3){
addSlot(new SlotItemHandler(moduleInv, slotId++, 61, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 79, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 97, 20));
}else if(moduleInv.getMaxNumberOfModules() == 4){
addSlot(new SlotItemHandler(moduleInv, slotId++, 52, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 70, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 88, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 106, 20));
=======
this.tileEntity = (CustomizableTileEntity)world.getTileEntity(pos);
for(int i = 0; i < 3; i++)
for(int j = 0; j < 9; ++j)
addSlot(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
for(int i = 0; i < 9; i++)
addSlot(new Slot(inventory, i, 8 + i * 18, 142));
if(tileEntity.getNumberOfCustomizableOptions() == 1)
addSlot(new ModuleSlot(tileEntity, 0, 79, 20));
else if(tileEntity.getNumberOfCustomizableOptions() == 2){
addSlot(new ModuleSlot(tileEntity, 0, 70, 20));
addSlot(new ModuleSlot(tileEntity, 1, 88, 20));
}else if(tileEntity.getNumberOfCustomizableOptions() == 3){
addSlot(new ModuleSlot(tileEntity, 0, 61, 20));
addSlot(new ModuleSlot(tileEntity, 1, 79, 20));
addSlot(new ModuleSlot(tileEntity, 2, 97, 20));
}else if(tileEntity.getNumberOfCustomizableOptions() == 4){
addSlot(new ModuleSlot(tileEntity, 0, 52, 20));
addSlot(new ModuleSlot(tileEntity, 1, 70, 20));
addSlot(new ModuleSlot(tileEntity, 2, 88, 20));
addSlot(new ModuleSlot(tileEntity, 3, 106, 20));
}else if(tileEntity.getNumberOfCustomizableOptions() == 5){
addSlot(new ModuleSlot(tileEntity, 0, 34, 20));
addSlot(new ModuleSlot(tileEntity, 1, 52, 20));
addSlot(new ModuleSlot(tileEntity, 2, 70, 20));
addSlot(new ModuleSlot(tileEntity, 3, 88, 20));
addSlot(new ModuleSlot(tileEntity, 3, 106, 20));
>>>>>>>
this.moduleInv = (IModuleInventory)world.getTileEntity(pos);
int slotId = 0;
if(moduleInv.enableHack())
slotId = 100;
if(moduleInv.getMaxNumberOfModules() == 1)
addSlot(new SlotItemHandler(moduleInv, slotId, 79, 20));
else if(moduleInv.getMaxNumberOfModules() == 2){
addSlot(new SlotItemHandler(moduleInv, slotId++, 70, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 88, 20));
}else if(moduleInv.getMaxNumberOfModules() == 3){
addSlot(new SlotItemHandler(moduleInv, slotId++, 61, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 79, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 97, 20));
}else if(moduleInv.getMaxNumberOfModules() == 4){
addSlot(new SlotItemHandler(moduleInv, slotId++, 52, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 70, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 88, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 106, 20));
}else if(moduleInv.getMaxNumberOfModules() == 5){
addSlot(new SlotItemHandler(moduleInv, slotId++, 34, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 52, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 70, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 88, 20));
addSlot(new SlotItemHandler(moduleInv, slotId++, 106, 20));
<<<<<<<
else if (slotStack.getItem() instanceof ModuleItem && moduleInv.getAcceptedModules().contains(CustomModules.getModuleFromStack(slotStack)) && !mergeItemStack(slotStack, 0, moduleInv.getSlots(), false))
return ItemStack.EMPTY;
=======
>>>>>>> |
<<<<<<<
for(CustomModules module : moduleInv.acceptedModules())
=======
for(ModuleType module : scte.acceptedModules())
>>>>>>>
for(ModuleType module : moduleInv.acceptedModules()) |
<<<<<<<
if(policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
=======
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION)) {
>>>>>>>
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
<<<<<<<
if(policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
=======
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION)) {
>>>>>>>
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
<<<<<<<
if(policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
=======
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION)) {
>>>>>>>
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
<<<<<<<
if(policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
=======
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION)) {
>>>>>>>
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
<<<<<<<
if(policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
=======
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION)) {
>>>>>>>
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
<<<<<<<
if(policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
=======
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION)) {
>>>>>>>
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
<<<<<<<
if(policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
=======
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION)) {
>>>>>>>
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
<<<<<<<
if(policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
=======
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION)) {
>>>>>>>
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
<<<<<<<
if(policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION) &&
policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) {
=======
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.ADMINISTER_SECURITY_ACTION)) {
>>>>>>>
if (policy.isAllowed(IAuthorizationPolicy.READ_REPOSITORY_CONTENT_ACTION) && policy.isAllowed(IAuthorizationPolicy.CREATE_REPOSITORY_CONTENT_ACTION)
&& policy.isAllowed(IAuthorizationPolicy.MANAGE_SCHEDULING)) { |
<<<<<<<
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityNamePattern});
login(sysAdminUserName, systemTenant, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityName});
login(sysAdminUserName, systemTenant, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{tenantAdminAuthorityName});
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityName});
login(sysAdminUserName, systemTenant, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityName});
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityNamePattern});
login(sysAdminUserName, systemTenant, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityName});
login(sysAdminUserName, systemTenant, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{tenantAdminAuthorityName});
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityName});
login(sysAdminUserName, systemTenant, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityName});
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName}); |
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant2_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant1_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant2_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant1_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant2_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant1_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant2_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant1_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant2_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant1_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant1_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant1_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", subTenant2_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", subTenant2_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_2, new String[]{adminRoleName, authenticatedRoleName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminRoleName, tenantAuthenticatedRoleName});
=======
login("joe", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName});
>>>>>>>
login("admin", mainTenant_1, new String[]{adminRoleName, authenticatedRoleName}); |
<<<<<<<
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAuthenticatedAuthorityNamePattern});
=======
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{adminAuthorityName});
login("joe", mainTenant_1, new String[]{authenticatedAuthorityName});
>>>>>>>
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{adminAuthorityName});
login("admin", mainTenant_1, new String[]{authenticatedAuthorityName});
<<<<<<<
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAuthenticatedAuthorityNamePattern});
=======
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{adminAuthorityName});
login("joe", mainTenant_1, new String[]{authenticatedAuthorityName});
>>>>>>>
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{adminAuthorityName});
login("admin", mainTenant_1, new String[]{authenticatedAuthorityName});
<<<<<<<
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAuthenticatedAuthorityNamePattern});
=======
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{adminAuthorityName});
login("joe", mainTenant_1, new String[]{authenticatedAuthorityName});
>>>>>>>
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{adminAuthorityName});
login("admin", mainTenant_1, new String[]{authenticatedAuthorityName});
<<<<<<<
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAuthenticatedAuthorityNamePattern});
=======
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{adminAuthorityName});
login("joe", mainTenant_1, new String[]{authenticatedAuthorityName});
>>>>>>>
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
IPentahoUser tenantUser = userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{adminAuthorityName});
login("admin", mainTenant_1, new String[]{authenticatedAuthorityName});
<<<<<<<
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityNamePattern});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAuthenticatedAuthorityNamePattern});
=======
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{adminAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{adminAuthorityName});
login("joe", mainTenant_1, new String[]{authenticatedAuthorityName});
>>>>>>>
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{adminAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{adminAuthorityName});
login("admin", mainTenant_1, new String[]{authenticatedAuthorityName});
<<<<<<<
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityNamePattern});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAuthenticatedAuthorityNamePattern});
=======
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{adminAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{adminAuthorityName});
login("joe", mainTenant_1, new String[]{authenticatedAuthorityName});
>>>>>>>
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{adminAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{adminAuthorityName});
login("admin", mainTenant_1, new String[]{authenticatedAuthorityName});
<<<<<<<
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityNamePattern});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAuthenticatedAuthorityNamePattern});
=======
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{adminAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{adminAuthorityName});
login("joe", mainTenant_1, new String[]{authenticatedAuthorityName});
>>>>>>>
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{adminAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{adminAuthorityName});
login("admin", mainTenant_1, new String[]{authenticatedAuthorityName});
<<<<<<<
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityNamePattern});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAuthenticatedAuthorityNamePattern});
=======
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{adminAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{adminAuthorityName});
login("joe", mainTenant_1, new String[]{authenticatedAuthorityName});
>>>>>>>
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{adminAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, adminAuthorityName, authenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{adminAuthorityName});
login("admin", mainTenant_1, new String[]{authenticatedAuthorityName}); |
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityNamePattern});
login(sysAdminUserName, systemTenant, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
ITenant mainTenant_2 = tenantManager.createTenant(systemTenant, MAIN_TENANT_2, tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern, "Anonymous");
userRoleDao.createUser(mainTenant_2, "admin", "password", "", new String[]{tenantAdminAuthorityNamePattern});
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityName});
login(sysAdminUserName, systemTenant, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "joe", "password", "", new String[]{tenantAdminAuthorityName});
ITenant mainTenant_2 = tenantManager.createTenant(systemTenant, MAIN_TENANT_2, tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_2, "joe", "password", "", new String[]{tenantAdminAuthorityName});
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
ITenant systemTenant = tenantManager.createTenant(null, ServerRepositoryPaths.getPentahoRootFolderName(), tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(systemTenant, sysAdminUserName, "password", "", new String[]{tenantAdminAuthorityName});
login(sysAdminUserName, systemTenant, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
ITenant mainTenant_1 = tenantManager.createTenant(systemTenant, MAIN_TENANT_1, tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_1, "admin", "password", "", new String[]{tenantAdminAuthorityName});
ITenant mainTenant_2 = tenantManager.createTenant(systemTenant, MAIN_TENANT_2, tenantAdminAuthorityName, tenantAuthenticatedAuthorityName, "Anonymous");
userRoleDao.createUser(mainTenant_2, "admin", "password", "", new String[]{tenantAdminAuthorityName});
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_1, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
<<<<<<<
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityNamePattern, tenantAuthenticatedAuthorityNamePattern});
=======
login("joe", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName});
>>>>>>>
login("admin", mainTenant_2, new String[]{tenantAdminAuthorityName, tenantAuthenticatedAuthorityName}); |
<<<<<<<
private final List<String> mIdentifierList = Collections.synchronizedList(new ArrayList<String>());
private final Set<String> mIdentifierSet = Collections.synchronizedSet(new HashSet<String>());
=======
private final List<String> mList = Collections.synchronizedList(new ArrayList<String>());
private final EntryCorral entryCorral;
public AuctionList(EntryCorral corral) {
entryCorral = corral;
}
>>>>>>>
private final List<String> mIdentifierList = Collections.synchronizedList(new ArrayList<String>());
private final Set<String> mIdentifierSet = Collections.synchronizedSet(new HashSet<String>());
private final EntryCorral entryCorral;
public AuctionList(EntryCorral corral) {
entryCorral = corral;
}
<<<<<<<
synchronized (mIdentifierList) {
String identifier = mIdentifierList.get(i);
return EntryCorral.getInstance().takeForRead(identifier);
=======
synchronized (mList) {
String identifier = mList.get(i);
return entryCorral.takeForRead(identifier);
>>>>>>>
synchronized (mIdentifierList) {
String identifier = mIdentifierList.get(i);
return entryCorral.takeForRead(identifier);
<<<<<<<
synchronized (mIdentifierList) {
String identifier = mIdentifierList.get(i);
EntryCorral.getInstance().takeForRead(identifier);
mIdentifierList.remove(i);
mIdentifierSet.remove(identifier);
=======
synchronized (mList) {
String identifier = mList.get(i);
entryCorral.takeForRead(identifier);
mList.remove(i);
>>>>>>>
synchronized (mIdentifierList) {
String identifier = mIdentifierList.get(i);
entryCorral.takeForRead(identifier);
mIdentifierList.remove(i);
mIdentifierSet.remove(identifier);
<<<<<<<
if(ae.getIdentifier() == null || ae.getIdentifier().length() == 0 || mIdentifierSet.contains(ae.getIdentifier())) {
return;
}
synchronized (mIdentifierList) {
EntryCorral.getInstance().put(ae);
mIdentifierList.add(ae.getIdentifier());
mIdentifierSet.add(ae.getIdentifier());
=======
synchronized (mList) {
entryCorral.put(ae);
mList.add(ae.getIdentifier());
>>>>>>>
if(ae.getIdentifier() == null || ae.getIdentifier().length() == 0 || mIdentifierSet.contains(ae.getIdentifier())) {
return;
}
synchronized (mIdentifierList) {
entryCorral.put(ae);
mIdentifierList.add(ae.getIdentifier());
mIdentifierSet.add(ae.getIdentifier());
<<<<<<<
synchronized (mIdentifierList) {
for (String identifier : mIdentifierList) {
AuctionEntry result = EntryCorral.getInstance().takeForRead(identifier);
=======
synchronized (mList) {
for (String identifier : mList) {
AuctionEntry result = entryCorral.takeForRead(identifier);
>>>>>>>
synchronized (mIdentifierList) {
for (String identifier : mIdentifierList) {
AuctionEntry result = entryCorral.takeForRead(identifier);
<<<<<<<
synchronized(mIdentifierList) {
for (String identifier : mIdentifierList) {
AuctionEntry result = (AuctionEntry) EntryCorral.getInstance().takeForWrite(identifier);
try { task.execute(result); } finally { EntryCorral.getInstance().release(identifier); }
=======
synchronized(mList) {
for (String identifier : mList) {
AuctionEntry result = (AuctionEntry) entryCorral.takeForWrite(identifier);
try { task.execute(result); } finally { entryCorral.release(identifier); }
>>>>>>>
synchronized(mIdentifierList) {
for (String identifier : mIdentifierList) {
AuctionEntry result = (AuctionEntry) entryCorral.takeForWrite(identifier);
try { task.execute(result); } finally { entryCorral.release(identifier); } |
<<<<<<<
case TableColumnController.THUMBNAIL: {
String thumb = aEntry.getThumbnail();
if (thumb != null) {
if(iconCache.containsKey(thumb)) return iconCache.get(thumb);
thumb = thumb.replaceAll("file:", "");
ImageIcon thumbIcon = scaleImage(thumb);
iconCache.put(thumb, thumbIcon);
return thumbIcon;
} else return dummyIcon;
}
case TableColumnController.SELLER: return aEntry.getSellerName();
=======
case TableColumnController.THUMBNAIL:
return thumbnailColumn(aEntry);
case TableColumnController.SELLER: return aEntry.getSeller();
>>>>>>>
case TableColumnController.THUMBNAIL:
return thumbnailColumn(aEntry);
case TableColumnController.SELLER:
return aEntry.getSellerName();
<<<<<<<
Currency shipping = aEntry.getShippingWithInsurance();
if(shipping.getCurrencyType() == Currency.NONE) {
return "--"; // shipping not set so cannot add up values
}
try {
return aEntry.getCurrentPrice().add(shipping);
} catch (Currency.CurrencyTypeException e) {
JConfig.log().handleException("Currency addition threw a bad currency exception, which is odd...", e); //$NON-NLS-1$
}
return "--";
=======
return priceWithShippingColumn(aEntry);
>>>>>>>
return priceWithShippingColumn(aEntry);
<<<<<<<
private ImageIcon scaleImage(String thumb) {
ImageIcon base = new ImageIcon(thumb);
int h = base.getIconHeight();
int w = base.getIconWidth();
if (h <= 64 && w <= 64) {
h = -1;
w = -1;
}
if (h != -1 && w != -1) {
if (h > w) {
h = 64;
w = -1;
} else if (w > h) {
w = 64;
h = -1;
} else if (h == w) {
h = 64;
w = -1;
}
}
return new ImageIcon(base.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH));
}
=======
private Object priceWithShippingColumn(AuctionEntry aEntry) {Currency shipping = aEntry.getShippingWithInsurance();
if(shipping.getCurrencyType() == Currency.NONE) {
return "--"; // shipping not set so cannot add up values
}
try {
return aEntry.getCurrentPrice().add(shipping);
} catch (Currency.CurrencyTypeException e) {
JConfig.log().handleException("Currency addition threw a bad currency exception, which is odd...", e); //$NON-NLS-1$
}
return "--";
}
private Object thumbnailColumn(AuctionEntry aEntry) {
String thumb = aEntry.getThumbnail();
if (thumb != null) {
if(iconCache.containsKey(thumb)) return iconCache.get(thumb);
thumb = thumb.replaceAll("file:", "");
ImageIcon base = new ImageIcon(thumb);
int h = base.getIconHeight();
int w = base.getIconWidth();
if (h <= 64 && w <= 64) {
h = -1;
w = -1;
}
if (h != -1 && w != -1) {
if (h > w) {
h = 64;
w = -1;
} else if (w > h) {
w = 64;
h = -1;
} else if (h == w && h != -1) {
h = 64;
w = -1;
}
}
ImageIcon thumbIcon = new ImageIcon(base.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH));
if(thumbIcon != null) iconCache.put(thumb, thumbIcon);
return thumbIcon;
} else return dummyIcon;
}
private Object endDateColumn(AuctionEntry aEntry) {
if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
return "N/A";
SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
return fmt.format(aEntry.getEndDate());
}
private Object timeLeftColumn(AuctionEntry aEntry) {
if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
return "N/A";
String endTime = aEntry.getTimeLeft();
if(endTime.equals(AuctionEntry.endedAuction)) {
SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
endTime = fmt.format(aEntry.getEndDate());
if(!aEntry.isComplete()) {
endTime = "<html><body color=\"red\">" + endTime + "</body></html>";
}
}
return endTime;
}
private Object snipeColumn(AuctionEntry aEntry, String errorNote) {
if (aEntry.isSniped()) {
return formatSnipe(aEntry, errorNote);
}
if(aEntry.snipeCancelled() && aEntry.isComplete()) {
return errorNote + '(' + aEntry.getCancelledSnipe() + ')';
}
return neverBid;
}
private Object currentBid(AuctionEntry aEntry) {Currency curPrice = aEntry.getCurrentPrice();
if(aEntry.isFixed()) {
return curPrice + " (FP" + ((aEntry.getQuantity() > 1) ? " x " + aEntry.getQuantity() + ")" : ")");
} else {
return curPrice + " (" + Integer.toString(aEntry.getNumBidders()) + ')';
}
}
>>>>>>>
private Object priceWithShippingColumn(AuctionEntry aEntry) {Currency shipping = aEntry.getShippingWithInsurance();
if(shipping.getCurrencyType() == Currency.NONE) {
return "--"; // shipping not set so cannot add up values
}
try {
return aEntry.getCurrentPrice().add(shipping);
} catch (Currency.CurrencyTypeException e) {
JConfig.log().handleException("Currency addition threw a bad currency exception, which is odd...", e); //$NON-NLS-1$
}
return "--";
}
private Object thumbnailColumn(AuctionEntry aEntry) {
String thumb = aEntry.getThumbnail();
if (thumb != null) {
if(iconCache.containsKey(thumb)) return iconCache.get(thumb);
thumb = thumb.replaceAll("file:", "");
ImageIcon base = new ImageIcon(thumb);
int h = base.getIconHeight();
int w = base.getIconWidth();
if (h <= 64 && w <= 64) {
h = -1;
w = -1;
}
if (h != -1 && w != -1) {
if (h > w) {
h = 64;
w = -1;
} else if (w > h) {
w = 64;
h = -1;
} else if (h == w && h != -1) {
h = 64;
w = -1;
}
}
ImageIcon thumbIcon = new ImageIcon(base.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH));
if(thumbIcon != null) iconCache.put(thumb, thumbIcon);
return thumbIcon;
} else return dummyIcon;
}
private Object endDateColumn(AuctionEntry aEntry) {
if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
return "N/A";
SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
return fmt.format(aEntry.getEndDate());
}
private Object timeLeftColumn(AuctionEntry aEntry) {
if (aEntry.getEndDate() == null || aEntry.getEndDate().equals(Constants.FAR_FUTURE))
return "N/A";
String endTime = aEntry.getTimeLeft();
if(endTime.equals(AuctionEntry.endedAuction)) {
SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy HH:mm:ss zzz");
endTime = fmt.format(aEntry.getEndDate());
if(!aEntry.isComplete()) {
endTime = "<html><body color=\"red\">" + endTime + "</body></html>";
}
}
return endTime;
}
private Object snipeColumn(AuctionEntry aEntry, String errorNote) {
if (aEntry.isSniped()) {
return formatSnipe(aEntry, errorNote);
}
if(aEntry.snipeCancelled() && aEntry.isComplete()) {
return errorNote + '(' + aEntry.getCancelledSnipe() + ')';
}
return neverBid;
}
private Object currentBid(AuctionEntry aEntry) {Currency curPrice = aEntry.getCurrentPrice();
if(aEntry.isFixed()) {
return curPrice + " (FP" + ((aEntry.getQuantity() > 1) ? " x " + aEntry.getQuantity() + ")" : ")");
} else {
return curPrice + " (" + Integer.toString(aEntry.getNumBidders()) + ')';
}
}
private ImageIcon scaleImage(String thumb) {
ImageIcon base = new ImageIcon(thumb);
int h = base.getIconHeight();
int w = base.getIconWidth();
if (h <= 64 && w <= 64) {
h = -1;
w = -1;
}
if (h != -1 && w != -1) {
if (h > w) {
h = 64;
w = -1;
} else if (w > h) {
w = 64;
h = -1;
} else if (h == w) {
h = 64;
w = -1;
}
}
return new ImageIcon(base.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH));
} |
<<<<<<<
JBidToolBar.getInstance().setToolTipText("Login failed.");
JBidToolBar.getInstance().setTextIcon(redStatus, redStatus16);
JConfig.getMetrics().trackEvent("login", "fail");
notifyAlert(status.substring("FAILED ".length()));
=======
toolBar.setToolTipText("Login failed.");
toolBar.setTextIcon(redStatus, redStatus16);
>>>>>>>
toolBar.setToolTipText("Login failed.");
toolBar.setTextIcon(redStatus, redStatus16);
JConfig.getMetrics().trackEvent("login", "fail");
notifyAlert(status.substring("FAILED ".length()));
<<<<<<<
JBidToolBar.getInstance().setToolTipText("Login failed due to CAPTCHA.");
JBidToolBar.getInstance().setTextIcon(redStatus, redStatus16);
JConfig.getMetrics().trackEvent("login", "captcha");
=======
toolBar.setToolTipText("Login failed due to CAPTCHA.");
toolBar.setTextIcon(redStatus, redStatus16);
>>>>>>>
toolBar.setToolTipText("Login failed due to CAPTCHA.");
toolBar.setTextIcon(redStatus, redStatus16);
JConfig.getMetrics().trackEvent("login", "captcha");
<<<<<<<
JBidToolBar.getInstance().setToolTipText("Last login was successful.");
JBidToolBar.getInstance().setTextIcon(greenStatus, greenStatus16);
JConfig.getMetrics().trackEvent("login", "success");
=======
toolBar.setToolTipText("Last login was successful.");
toolBar.setTextIcon(greenStatus, greenStatus16);
>>>>>>>
toolBar.setToolTipText("Last login was successful.");
toolBar.setTextIcon(greenStatus, greenStatus16);
JConfig.getMetrics().trackEvent("login", "success");
<<<<<<<
JBidToolBar.getInstance().setToolTipText("Last login did not clearly fail, but no valid cookies were received.");
JBidToolBar.getInstance().setTextIcon(yellowStatus, yellowStatus16);
JConfig.getMetrics().trackEvent("login", "neutral");
=======
toolBar.setToolTipText("Last login did not clearly fail, but no valid cookies were received.");
toolBar.setTextIcon(yellowStatus, yellowStatus16);
>>>>>>>
toolBar.setToolTipText("Last login did not clearly fail, but no valid cookies were received.");
toolBar.setTextIcon(yellowStatus, yellowStatus16);
JConfig.getMetrics().trackEvent("login", "neutral"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.