conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
* @author Artsiom Yudovin
=======
* @since 1.0.0
>>>>>>>
* @author Artsiom Yudovin
* @since 1.0.0 |
<<<<<<<
if (jarFile == null) {
return Collections.<URL>emptyList();
}
try {
return getUrlsFromClassPathAttribute(url, jarFile.getManifest());
}
catch (IOException ex) {
throw new IllegalStateException(
"Failed to read Class-Path attribute from manifest of jar " + url);
=======
if (jarFile != null) {
try {
return getUrlsFromClassPathAttribute(url, jarFile.getManifest());
}
catch (IOException ex) {
throw new IllegalStateException(
"Failed to read Class-Path attribute from manifest of jar " + url,
ex);
}
>>>>>>>
if (jarFile == null) {
return Collections.<URL>emptyList();
}
try {
return getUrlsFromClassPathAttribute(url, jarFile.getManifest());
}
catch (IOException ex) {
throw new IllegalStateException(
"Failed to read Class-Path attribute from manifest of jar " + url,
ex); |
<<<<<<<
this.contextRunner
.withPropertyValues("management.endpoints.web.exposure.include=beans")
.run((context) -> assertThat(context).hasSingleBean(BeansEndpoint.class));
=======
this.contextRunner.run((context) -> assertThat(context).hasSingleBean(BeansEndpoint.class));
>>>>>>>
this.contextRunner.withPropertyValues("management.endpoints.web.exposure.include=beans")
.run((context) -> assertThat(context).hasSingleBean(BeansEndpoint.class));
<<<<<<<
.withPropertyValues("management.endpoints.web.exposure.include=*")
.run((context) -> assertThat(context)
.doesNotHaveBean(BeansEndpoint.class));
=======
.run((context) -> assertThat(context).doesNotHaveBean(BeansEndpoint.class));
>>>>>>>
.withPropertyValues("management.endpoints.web.exposure.include=*")
.run((context) -> assertThat(context).doesNotHaveBean(BeansEndpoint.class)); |
<<<<<<<
void testHome() throws Exception {
this.mvc.perform(get("/")).andExpect(status().isOk())
.andExpect(xpath("//tbody/tr").nodeCount(4));
=======
public void testHome() throws Exception {
this.mvc.perform(get("/")).andExpect(status().isOk()).andExpect(xpath("//tbody/tr").nodeCount(4));
>>>>>>>
void testHome() throws Exception {
this.mvc.perform(get("/")).andExpect(status().isOk()).andExpect(xpath("//tbody/tr").nodeCount(4)); |
<<<<<<<
=======
private final Iterable<MBeanExporter> mbeanExporters;
private final Environment environment;
public SpringApplicationAdminJmxAutoConfiguration(ObjectProvider<MBeanExporter> mbeanExporters,
Environment environment) {
this.mbeanExporters = mbeanExporters;
this.environment = environment;
}
>>>>>>>
<<<<<<<
public SpringApplicationAdminMXBeanRegistrar springApplicationAdminRegistrar(
ObjectProvider<MBeanExporter> mbeanExporters, Environment environment)
throws MalformedObjectNameException {
String jmxName = environment.getProperty(JMX_NAME_PROPERTY, DEFAULT_JMX_NAME);
if (mbeanExporters != null) { // Make sure to not register that MBean twice
for (MBeanExporter mbeanExporter : mbeanExporters) {
=======
public SpringApplicationAdminMXBeanRegistrar springApplicationAdminRegistrar() throws MalformedObjectNameException {
String jmxName = this.environment.getProperty(JMX_NAME_PROPERTY, DEFAULT_JMX_NAME);
if (this.mbeanExporters != null) { // Make sure to not register that MBean twice
for (MBeanExporter mbeanExporter : this.mbeanExporters) {
>>>>>>>
public SpringApplicationAdminMXBeanRegistrar springApplicationAdminRegistrar(
ObjectProvider<MBeanExporter> mbeanExporters, Environment environment) throws MalformedObjectNameException {
String jmxName = environment.getProperty(JMX_NAME_PROPERTY, DEFAULT_JMX_NAME);
if (mbeanExporters != null) { // Make sure to not register that MBean twice
for (MBeanExporter mbeanExporter : mbeanExporters) { |
<<<<<<<
* @author HaiTao Zhang
=======
* @author Rafiullah Hamedy
>>>>>>>
* @author HaiTao Zhang
* @author Rafiullah Hamedy
<<<<<<<
propertyMapper.from(jettyProperties::getMaxHttpPostSize).asInt(DataSize::toBytes).when(this::isPositive)
.to((maxHttpPostSize) -> customizeMaxHttpPostSize(factory, maxHttpPostSize));
propertyMapper.from(jettyProperties::getMaxThreads).when(this::isPositive)
.to((maxThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMaxThreads(maxThreads)));
propertyMapper.from(jettyProperties::getMinThreads).when(this::isPositive)
.to((minThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMinThreads(minThreads)));
propertyMapper.from(jettyProperties::getThreadIdleTimeout).whenNonNull().asInt(Duration::toMillis).to(
(idleTimeout) -> customizeThreadPool(factory, (threadPool) -> threadPool.setIdleTimeout(idleTimeout)));
=======
propertyMapper.from(jettyProperties::getMaxHttpFormPostSize).asInt(DataSize::toBytes).when(this::isPositive)
.to((maxHttpFormPostSize) -> customizeMaxHttpFormPostSize(factory, maxHttpFormPostSize));
>>>>>>>
propertyMapper.from(jettyProperties::getMaxHttpFormPostSize).asInt(DataSize::toBytes).when(this::isPositive)
.to((maxHttpFormPostSize) -> customizeMaxHttpFormPostSize(factory, maxHttpFormPostSize));
propertyMapper.from(jettyProperties::getMaxThreads).when(this::isPositive)
.to((maxThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMaxThreads(maxThreads)));
propertyMapper.from(jettyProperties::getMinThreads).when(this::isPositive)
.to((minThreads) -> customizeThreadPool(factory, (threadPool) -> threadPool.setMinThreads(minThreads)));
propertyMapper.from(jettyProperties::getThreadIdleTimeout).whenNonNull().asInt(Duration::toMillis).to(
(idleTimeout) -> customizeThreadPool(factory, (threadPool) -> threadPool.setIdleTimeout(idleTimeout))); |
<<<<<<<
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
=======
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.ToStringConsumer;
import org.testcontainers.images.builder.ImageFromDockerfile;
import org.testcontainers.utility.MountableFile;
>>>>>>>
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.ToStringConsumer;
import org.testcontainers.images.builder.ImageFromDockerfile;
import org.testcontainers.utility.MountableFile;
<<<<<<<
@ParameterizedTest(name = "{0} {1}")
@MethodSource("parameters")
void whenJarOwnerAndRunAsUserAreBothSpecifiedRunAsUserTakesPrecedence(String os, String version) throws Exception {
String output = doTest(os, version, "launch-with-run-as-user-preferred-to-jar-owner.sh");
assertThat(output).contains("wagner root");
}
@ParameterizedTest(name = "{0} {1}")
@MethodSource("parameters")
void whenLaunchedUsingNonRootUserWithRunAsUserSpecifiedLaunchFailsWithInsufficientPrivilege(String os,
String version) throws Exception {
String output = doTest(os, version, "launch-with-run-as-user-root-required.sh");
assertThat(output).contains("Status: 4");
assertThat(output).has(coloredString(AnsiColor.RED, "Cannot run as 'wagner': current user is not root"));
}
static List<Object[]> parameters() {
List<Object[]> parameters = new ArrayList<>();
for (File os : new File("src/test/resources/conf").listFiles()) {
for (File version : os.listFiles()) {
parameters.add(new Object[] { os.getName(), version.getName() });
}
}
return parameters;
}
private void doLaunch(String os, String version, String script) throws Exception {
assertThat(doTest(os, version, script)).contains("Launched");
}
private String doTest(String os, String version, String script) throws Exception {
DockerClient docker = createClient();
String imageId = buildImage(os, version, docker);
String container = createContainer(docker, imageId, script);
try {
copyFilesToContainer(docker, container, script);
docker.startContainerCmd(container).exec();
StringBuilder output = new StringBuilder();
AttachContainerResultCallback resultCallback = docker.attachContainerCmd(container).withStdOut(true)
.withStdErr(true).withFollowStream(true).withLogs(true).exec(new AttachContainerResultCallback() {
@Override
public void onNext(Frame item) {
output.append(new String(item.getPayload()));
super.onNext(item);
}
});
resultCallback.awaitCompletion(60, TimeUnit.SECONDS);
WaitContainerResultCallback waitContainerCallback = new WaitContainerResultCallback();
docker.waitContainerCmd(container).exec(waitContainerCallback);
waitContainerCallback.awaitCompletion(60, TimeUnit.SECONDS);
return output.toString();
}
finally {
try {
docker.removeContainerCmd(container).exec();
}
catch (Exception ex) {
// Continue
}
}
}
private DockerClient createClient() {
DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder().withApiVersion("1.19")
.build();
return DockerClientBuilder.getInstance(config).withDockerCmdExecFactory(this.commandExecFactory).build();
}
private String buildImage(String os, String version, DockerClient docker) {
String dockerfile = "src/test/resources/conf/" + os + "/" + version + "/Dockerfile";
String tag = "spring-boot-it/" + os.toLowerCase(Locale.ENGLISH) + ":" + version;
BuildImageResultCallback resultCallback = new BuildImageResultCallback() {
private List<BuildResponseItem> items = new ArrayList<>();
@Override
public void onNext(BuildResponseItem item) {
super.onNext(item);
this.items.add(item);
}
@Override
public String awaitImageId() {
try {
awaitCompletion();
}
catch (InterruptedException ex) {
throw new DockerClientException("Interrupted while waiting for image id", ex);
}
return getImageId();
}
@SuppressWarnings("deprecation")
private String getImageId() {
if (this.items.isEmpty()) {
throw new DockerClientException("Could not build image");
}
String imageId = extractImageId();
if (imageId == null) {
throw new DockerClientException(
"Could not build image: " + this.items.get(this.items.size() - 1).getError());
}
return imageId;
}
private String extractImageId() {
Collections.reverse(this.items);
for (BuildResponseItem item : this.items) {
if (item.isErrorIndicated() || item.getStream() == null) {
return null;
}
if (item.getStream().contains("Successfully built")) {
return item.getStream().replace("Successfully built", "").trim();
}
}
return null;
}
};
docker.buildImageCmd(new File(dockerfile)).withTags(new HashSet<>(Arrays.asList(tag))).exec(resultCallback);
String imageId = resultCallback.awaitImageId();
return imageId;
}
private String createContainer(DockerClient docker, String imageId, String testScript) {
return docker.createContainerCmd(imageId).withTty(false)
.withCmd("/bin/bash", "-c", "chmod +x " + testScript + " && ./" + testScript).exec().getId();
}
private void copyFilesToContainer(DockerClient docker, final String container, String script) {
copyToContainer(docker, container, findApplication());
copyToContainer(docker, container, new File("src/test/resources/scripts/test-functions.sh"));
copyToContainer(docker, container, new File("src/test/resources/scripts/" + script));
}
private void copyToContainer(DockerClient docker, final String container, final File file) {
this.commandExecFactory.createCopyToContainerCmdExec().exec(new CopyToContainerCmd(container, file));
}
private File findApplication() {
File targetDir = new File("target");
for (File file : targetDir.listFiles()) {
if (file.getName().startsWith("spring-boot-launch-script-tests") && file.getName().endsWith(".jar")
&& !file.getName().endsWith("-sources.jar")) {
return file;
=======
private String doTest(String script) throws Exception {
ToStringConsumer consumer = new ToStringConsumer().withRemoveAnsiCodes(false);
try (LaunchScriptTestContainer container = new LaunchScriptTestContainer(this.os, this.version, script)) {
container.withLogConsumer(consumer);
container.start();
while (container.isRunning()) {
Thread.sleep(100);
>>>>>>>
@ParameterizedTest(name = "{0} {1}")
@MethodSource("parameters")
void whenJarOwnerAndRunAsUserAreBothSpecifiedRunAsUserTakesPrecedence(String os, String version) throws Exception {
String output = doTest(os, version, "launch-with-run-as-user-preferred-to-jar-owner.sh");
assertThat(output).contains("wagner root");
}
@ParameterizedTest(name = "{0} {1}")
@MethodSource("parameters")
void whenLaunchedUsingNonRootUserWithRunAsUserSpecifiedLaunchFailsWithInsufficientPrivilege(String os,
String version) throws Exception {
String output = doTest(os, version, "launch-with-run-as-user-root-required.sh");
assertThat(output).contains("Status: 4");
assertThat(output).has(coloredString(AnsiColor.RED, "Cannot run as 'wagner': current user is not root"));
}
static List<Object[]> parameters() {
List<Object[]> parameters = new ArrayList<>();
for (File os : new File("src/test/resources/conf").listFiles()) {
for (File version : os.listFiles()) {
parameters.add(new Object[] { os.getName(), version.getName() });
}
}
return parameters;
}
private void doLaunch(String os, String version, String script) throws Exception {
assertThat(doTest(os, version, script)).contains("Launched");
}
private String doTest(String os, String version, String script) throws Exception {
ToStringConsumer consumer = new ToStringConsumer().withRemoveAnsiCodes(false);
try (LaunchScriptTestContainer container = new LaunchScriptTestContainer(os, version, script)) {
container.withLogConsumer(consumer);
container.start();
while (container.isRunning()) {
Thread.sleep(100);
<<<<<<<
}
}
private static final class CopyToContainerCmd implements DockerCmd<Void> {
private final String container;
private final File file;
private CopyToContainerCmd(String container, File file) {
this.container = container;
this.file = file;
}
String getContainer() {
return this.container;
}
File getFile() {
return this.file;
}
@Override
public void close() {
}
}
private static final class SpringBootDockerCmdExecFactory extends JerseyDockerCmdExecFactory {
private CopyToContainerCmdExec createCopyToContainerCmdExec() {
return new CopyToContainerCmdExec(getBaseResource(), getDockerClientConfig());
=======
throw new IllegalStateException(
"Could not find test application in target directory. Have you built it (mvn package)?");
>>>>>>>
throw new IllegalStateException(
"Could not find test application in target directory. Have you built it (mvn package)?"); |
<<<<<<<
void contextLoads() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/hello",
String.class);
=======
public void contextLoads() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/hello", String.class);
>>>>>>>
void contextLoads() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/hello", String.class);
<<<<<<<
void reverse() {
ResponseEntity<String> entity = this.restTemplate
.getForEntity("/reverse?input=olleh", String.class);
=======
public void reverse() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/reverse?input=olleh", String.class);
>>>>>>>
void reverse() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/reverse?input=olleh", String.class);
<<<<<<<
void validation() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/reverse",
String.class);
=======
public void validation() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/reverse", String.class);
>>>>>>>
void validation() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/reverse", String.class);
<<<<<<<
void actuatorStatus() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/actuator/health",
String.class);
=======
public void actuatorStatus() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/actuator/health", String.class);
>>>>>>>
void actuatorStatus() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/actuator/health", String.class); |
<<<<<<<
import java.net.BindException;
import java.time.Duration;
=======
>>>>>>>
import java.time.Duration; |
<<<<<<<
@SpringBootTest(classes = SampleJettyWebSocketsApplication.class,
webEnvironment = WebEnvironment.RANDOM_PORT)
class SampleWebSocketsApplicationTests {
=======
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SampleJettyWebSocketsApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT)
public class SampleWebSocketsApplicationTests {
>>>>>>>
@SpringBootTest(classes = SampleJettyWebSocketsApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT)
class SampleWebSocketsApplicationTests {
<<<<<<<
void echoEndpoint() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port
+ "/echo/websocket")
=======
public void echoEndpoint() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class,
PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port + "/echo/websocket")
>>>>>>>
void echoEndpoint() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class,
PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port + "/echo/websocket")
<<<<<<<
void reverseEndpoint() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(
ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
.properties(
"websocket.uri:ws://localhost:" + this.port + "/reverse")
=======
public void reverseEndpoint() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class,
PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port + "/reverse")
>>>>>>>
void reverseEndpoint() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(ClientConfiguration.class,
PropertyPlaceholderAutoConfiguration.class)
.properties("websocket.uri:ws://localhost:" + this.port + "/reverse") |
<<<<<<<
void testInsecureStaticResources() {
ResponseEntity<String> entity = restTemplate()
.getForEntity("/css/bootstrap.min.css", String.class);
=======
public void testInsecureStaticResources() {
ResponseEntity<String> entity = restTemplate().getForEntity("/css/bootstrap.min.css", String.class);
>>>>>>>
void testInsecureStaticResources() {
ResponseEntity<String> entity = restTemplate().getForEntity("/css/bootstrap.min.css", String.class);
<<<<<<<
void actuatorInsecureEndpoint() {
ResponseEntity<String> entity = restTemplate().getForEntity("/actuator/health",
String.class);
=======
public void actuatorInsecureEndpoint() {
ResponseEntity<String> entity = restTemplate().getForEntity("/actuator/health", String.class);
>>>>>>>
void actuatorInsecureEndpoint() {
ResponseEntity<String> entity = restTemplate().getForEntity("/actuator/health", String.class);
<<<<<<<
void actuatorLinksIsSecure() {
ResponseEntity<Object> entity = restTemplate().getForEntity("/actuator",
Object.class);
=======
public void actuatorLinksIsSecure() {
ResponseEntity<Object> entity = restTemplate().getForEntity("/actuator", Object.class);
>>>>>>>
void actuatorLinksIsSecure() {
ResponseEntity<Object> entity = restTemplate().getForEntity("/actuator", Object.class); |
<<<<<<<
@ConditionalOnClass(SessionFactory.class)
@ConditionalOnBean(SessionFactory.class)
@ConditionalOnEnabledHealthIndicator("neo4j")
public static class Neo4jHealthIndicatorConfiguration extends
CompositeHealthIndicatorConfiguration<Neo4jHealthIndicator, SessionFactory> {
private final Map<String, SessionFactory> sessionFactories;
public Neo4jHealthIndicatorConfiguration(
Map<String, SessionFactory> sessionFactories) {
this.sessionFactories = sessionFactories;
}
@Bean
@ConditionalOnMissingBean(name = "neo4jHealthIndicator")
public HealthIndicator neo4jHealthIndicator() {
return createHealthIndicator(this.sessionFactories);
}
}
@Configuration
=======
@ConditionalOnClass(RedisConnectionFactory.class)
>>>>>>>
@ConditionalOnClass(SessionFactory.class)
@ConditionalOnBean(SessionFactory.class)
@ConditionalOnEnabledHealthIndicator("neo4j")
public static class Neo4jHealthIndicatorConfiguration extends
CompositeHealthIndicatorConfiguration<Neo4jHealthIndicator, SessionFactory> {
private final Map<String, SessionFactory> sessionFactories;
public Neo4jHealthIndicatorConfiguration(
Map<String, SessionFactory> sessionFactories) {
this.sessionFactories = sessionFactories;
}
@Bean
@ConditionalOnMissingBean(name = "neo4jHealthIndicator")
public HealthIndicator neo4jHealthIndicator() {
return createHealthIndicator(this.sessionFactories);
}
}
@Configuration
@ConditionalOnClass(RedisConnectionFactory.class) |
<<<<<<<
this.contextRunner.withUserConfiguration(TestConfiguration.class)
.run((context) -> {
RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class);
RabbitMessagingTemplate messagingTemplate = context
.getBean(RabbitMessagingTemplate.class);
CachingConnectionFactory connectionFactory = context
.getBean(CachingConnectionFactory.class);
RabbitAdmin amqpAdmin = context.getBean(RabbitAdmin.class);
assertThat(rabbitTemplate.getConnectionFactory())
.isEqualTo(connectionFactory);
assertThat(getMandatory(rabbitTemplate)).isFalse();
assertThat(messagingTemplate.getRabbitTemplate())
.isEqualTo(rabbitTemplate);
assertThat(amqpAdmin).isNotNull();
assertThat(connectionFactory.getHost()).isEqualTo("localhost");
assertThat(connectionFactory.isPublisherConfirms()).isFalse();
assertThat(connectionFactory.isPublisherReturns()).isFalse();
assertThat(context.containsBean("rabbitListenerContainerFactory"))
.as("Listener container factory should be created by default")
.isTrue();
});
=======
this.contextRunner.withUserConfiguration(TestConfiguration.class).run((context) -> {
RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class);
RabbitMessagingTemplate messagingTemplate = context.getBean(RabbitMessagingTemplate.class);
CachingConnectionFactory connectionFactory = context.getBean(CachingConnectionFactory.class);
DirectFieldAccessor dfa = new DirectFieldAccessor(connectionFactory);
RabbitAdmin amqpAdmin = context.getBean(RabbitAdmin.class);
assertThat(rabbitTemplate.getConnectionFactory()).isEqualTo(connectionFactory);
assertThat(getMandatory(rabbitTemplate)).isFalse();
assertThat(messagingTemplate.getRabbitTemplate()).isEqualTo(rabbitTemplate);
assertThat(amqpAdmin).isNotNull();
assertThat(connectionFactory.getHost()).isEqualTo("localhost");
assertThat(dfa.getPropertyValue("publisherConfirms")).isEqualTo(false);
assertThat(dfa.getPropertyValue("publisherReturns")).isEqualTo(false);
assertThat(context.containsBean("rabbitListenerContainerFactory"))
.as("Listener container factory should be created by default").isTrue();
});
>>>>>>>
this.contextRunner.withUserConfiguration(TestConfiguration.class).run((context) -> {
RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class);
RabbitMessagingTemplate messagingTemplate = context.getBean(RabbitMessagingTemplate.class);
CachingConnectionFactory connectionFactory = context.getBean(CachingConnectionFactory.class);
RabbitAdmin amqpAdmin = context.getBean(RabbitAdmin.class);
assertThat(rabbitTemplate.getConnectionFactory()).isEqualTo(connectionFactory);
assertThat(getMandatory(rabbitTemplate)).isFalse();
assertThat(messagingTemplate.getRabbitTemplate()).isEqualTo(rabbitTemplate);
assertThat(amqpAdmin).isNotNull();
assertThat(connectionFactory.getHost()).isEqualTo("localhost");
assertThat(connectionFactory.isPublisherConfirms()).isFalse();
assertThat(connectionFactory.isPublisherReturns()).isFalse();
assertThat(context.containsBean("rabbitListenerContainerFactory"))
.as("Listener container factory should be created by default").isTrue();
});
<<<<<<<
this.contextRunner
.withUserConfiguration(ConnectionNameStrategyConfiguration.class)
.run((context) -> {
CachingConnectionFactory connectionFactory = context
.getBean(CachingConnectionFactory.class);
Address[] addresses = (Address[]) ReflectionTestUtils
.getField(connectionFactory, "addresses");
assertThat(addresses).hasSize(1);
com.rabbitmq.client.ConnectionFactory rcf = mock(
com.rabbitmq.client.ConnectionFactory.class);
given(rcf.newConnection(isNull(), eq(addresses), anyString()))
.willReturn(mock(Connection.class));
ReflectionTestUtils.setField(connectionFactory,
"rabbitConnectionFactory", rcf);
connectionFactory.createConnection();
verify(rcf).newConnection(isNull(), eq(addresses), eq("test#0"));
connectionFactory.resetConnection();
connectionFactory.createConnection();
verify(rcf).newConnection(isNull(), eq(addresses), eq("test#1"));
});
=======
this.contextRunner.withUserConfiguration(ConnectionNameStrategyConfiguration.class).run((context) -> {
CachingConnectionFactory connectionFactory = context.getBean(CachingConnectionFactory.class);
DirectFieldAccessor dfa = new DirectFieldAccessor(connectionFactory);
Address[] addresses = (Address[]) dfa.getPropertyValue("addresses");
assertThat(addresses).hasSize(1);
com.rabbitmq.client.ConnectionFactory rcf = mock(com.rabbitmq.client.ConnectionFactory.class);
given(rcf.newConnection(isNull(), eq(addresses), anyString())).willReturn(mock(Connection.class));
dfa.setPropertyValue("rabbitConnectionFactory", rcf);
connectionFactory.createConnection();
verify(rcf).newConnection(isNull(), eq(addresses), eq("test#0"));
connectionFactory.resetConnection();
connectionFactory.createConnection();
verify(rcf).newConnection(isNull(), eq(addresses), eq("test#1"));
});
>>>>>>>
this.contextRunner.withUserConfiguration(ConnectionNameStrategyConfiguration.class).run((context) -> {
CachingConnectionFactory connectionFactory = context.getBean(CachingConnectionFactory.class);
Address[] addresses = (Address[]) ReflectionTestUtils.getField(connectionFactory, "addresses");
assertThat(addresses).hasSize(1);
com.rabbitmq.client.ConnectionFactory rcf = mock(com.rabbitmq.client.ConnectionFactory.class);
given(rcf.newConnection(isNull(), eq(addresses), anyString())).willReturn(mock(Connection.class));
ReflectionTestUtils.setField(connectionFactory, "rabbitConnectionFactory", rcf);
connectionFactory.createConnection();
verify(rcf).newConnection(isNull(), eq(addresses), eq("test#0"));
connectionFactory.resetConnection();
connectionFactory.createConnection();
verify(rcf).newConnection(isNull(), eq(addresses), eq("test#1"));
});
<<<<<<<
this.contextRunner.withUserConfiguration(MessageConvertersConfiguration.class)
.run((context) -> {
RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class);
assertThat(rabbitTemplate.getMessageConverter())
.isSameAs(context.getBean("myMessageConverter"));
assertThat(rabbitTemplate)
.hasFieldOrPropertyWithValue("retryTemplate", null);
});
=======
this.contextRunner.withUserConfiguration(MessageConvertersConfiguration.class).run((context) -> {
RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class);
assertThat(rabbitTemplate.getMessageConverter()).isSameAs(context.getBean("myMessageConverter"));
DirectFieldAccessor dfa = new DirectFieldAccessor(rabbitTemplate);
assertThat(dfa.getPropertyValue("retryTemplate")).isNull();
});
>>>>>>>
this.contextRunner.withUserConfiguration(MessageConvertersConfiguration.class).run((context) -> {
RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class);
assertThat(rabbitTemplate.getMessageConverter()).isSameAs(context.getBean("myMessageConverter"));
assertThat(rabbitTemplate).hasFieldOrPropertyWithValue("retryTemplate", null);
});
<<<<<<<
CachingConnectionFactory connectionFactory = context
.getBean(CachingConnectionFactory.class);
assertThat(connectionFactory.getChannelCacheSize()).isEqualTo(23);
assertThat(connectionFactory.getCacheMode())
.isEqualTo(CacheMode.CONNECTION);
assertThat(connectionFactory.getConnectionCacheSize()).isEqualTo(2);
assertThat(connectionFactory)
.hasFieldOrPropertyWithValue("channelCheckoutTimeout", 1000L);
=======
CachingConnectionFactory connectionFactory = context.getBean(CachingConnectionFactory.class);
DirectFieldAccessor dfa = new DirectFieldAccessor(connectionFactory);
assertThat(dfa.getPropertyValue("channelCacheSize")).isEqualTo(23);
assertThat(dfa.getPropertyValue("cacheMode")).isEqualTo(CacheMode.CONNECTION);
assertThat(dfa.getPropertyValue("connectionCacheSize")).isEqualTo(2);
assertThat(dfa.getPropertyValue("channelCheckoutTimeout")).isEqualTo(1000L);
>>>>>>>
CachingConnectionFactory connectionFactory = context.getBean(CachingConnectionFactory.class);
assertThat(connectionFactory.getChannelCacheSize()).isEqualTo(23);
assertThat(connectionFactory.getCacheMode()).isEqualTo(CacheMode.CONNECTION);
assertThat(connectionFactory.getConnectionCacheSize()).isEqualTo(2);
assertThat(connectionFactory).hasFieldOrPropertyWithValue("channelCheckoutTimeout", 1000L);
<<<<<<<
this.contextRunner.withUserConfiguration(TestConfiguration5.class)
.run((context) -> {
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory = context
.getBean("rabbitListenerContainerFactory",
SimpleRabbitListenerContainerFactory.class);
rabbitListenerContainerFactory.setTxSize(10);
verify(rabbitListenerContainerFactory).setTxSize(10);
assertThat(rabbitListenerContainerFactory.getAdviceChain()).isNull();
});
=======
this.contextRunner.withUserConfiguration(TestConfiguration5.class).run((context) -> {
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory = context
.getBean("rabbitListenerContainerFactory", SimpleRabbitListenerContainerFactory.class);
rabbitListenerContainerFactory.setTxSize(10);
verify(rabbitListenerContainerFactory).setTxSize(10);
DirectFieldAccessor dfa = new DirectFieldAccessor(rabbitListenerContainerFactory);
Advice[] adviceChain = (Advice[]) dfa.getPropertyValue("adviceChain");
assertThat(adviceChain).isNull();
});
>>>>>>>
this.contextRunner.withUserConfiguration(TestConfiguration5.class).run((context) -> {
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory = context
.getBean("rabbitListenerContainerFactory", SimpleRabbitListenerContainerFactory.class);
rabbitListenerContainerFactory.setTxSize(10);
verify(rabbitListenerContainerFactory).setTxSize(10);
assertThat(rabbitListenerContainerFactory.getAdviceChain()).isNull();
});
<<<<<<<
.getBean("rabbitListenerContainerFactory",
SimpleRabbitListenerContainerFactory.class);
assertThat(rabbitListenerContainerFactory)
.hasFieldOrPropertyWithValue("concurrentConsumers", 5);
assertThat(rabbitListenerContainerFactory)
.hasFieldOrPropertyWithValue("maxConcurrentConsumers", 10);
assertThat(rabbitListenerContainerFactory)
.hasFieldOrPropertyWithValue("txSize", 20);
assertThat(rabbitListenerContainerFactory)
.hasFieldOrPropertyWithValue("missingQueuesFatal", false);
checkCommonProps(context, rabbitListenerContainerFactory);
=======
.getBean("rabbitListenerContainerFactory", SimpleRabbitListenerContainerFactory.class);
DirectFieldAccessor dfa = new DirectFieldAccessor(rabbitListenerContainerFactory);
assertThat(dfa.getPropertyValue("concurrentConsumers")).isEqualTo(5);
assertThat(dfa.getPropertyValue("maxConcurrentConsumers")).isEqualTo(10);
assertThat(dfa.getPropertyValue("txSize")).isEqualTo(20);
checkCommonProps(context, dfa);
>>>>>>>
.getBean("rabbitListenerContainerFactory", SimpleRabbitListenerContainerFactory.class);
assertThat(rabbitListenerContainerFactory).hasFieldOrPropertyWithValue("concurrentConsumers", 5);
assertThat(rabbitListenerContainerFactory).hasFieldOrPropertyWithValue("maxConcurrentConsumers",
10);
assertThat(rabbitListenerContainerFactory).hasFieldOrPropertyWithValue("txSize", 20);
assertThat(rabbitListenerContainerFactory).hasFieldOrPropertyWithValue("missingQueuesFatal", false);
checkCommonProps(context, rabbitListenerContainerFactory);
<<<<<<<
.getBean("rabbitListenerContainerFactory",
DirectRabbitListenerContainerFactory.class);
assertThat(rabbitListenerContainerFactory)
.hasFieldOrPropertyWithValue("consumersPerQueue", 5);
assertThat(rabbitListenerContainerFactory)
.hasFieldOrPropertyWithValue("missingQueuesFatal", true);
checkCommonProps(context, rabbitListenerContainerFactory);
=======
.getBean("rabbitListenerContainerFactory", DirectRabbitListenerContainerFactory.class);
DirectFieldAccessor dfa = new DirectFieldAccessor(rabbitListenerContainerFactory);
assertThat(dfa.getPropertyValue("consumersPerQueue")).isEqualTo(5);
checkCommonProps(context, dfa);
>>>>>>>
.getBean("rabbitListenerContainerFactory", DirectRabbitListenerContainerFactory.class);
assertThat(rabbitListenerContainerFactory).hasFieldOrPropertyWithValue("consumersPerQueue", 5);
assertThat(rabbitListenerContainerFactory).hasFieldOrPropertyWithValue("missingQueuesFatal", true);
checkCommonProps(context, rabbitListenerContainerFactory);
<<<<<<<
private com.rabbitmq.client.ConnectionFactory getTargetConnectionFactory(
AssertableApplicationContext context) {
CachingConnectionFactory connectionFactory = context
.getBean(CachingConnectionFactory.class);
return connectionFactory.getRabbitConnectionFactory();
=======
private com.rabbitmq.client.ConnectionFactory getTargetConnectionFactory(AssertableApplicationContext context) {
CachingConnectionFactory connectionFactory = context.getBean(CachingConnectionFactory.class);
return (com.rabbitmq.client.ConnectionFactory) new DirectFieldAccessor(connectionFactory)
.getPropertyValue("rabbitConnectionFactory");
>>>>>>>
private com.rabbitmq.client.ConnectionFactory getTargetConnectionFactory(AssertableApplicationContext context) {
CachingConnectionFactory connectionFactory = context.getBean(CachingConnectionFactory.class);
return connectionFactory.getRabbitConnectionFactory();
<<<<<<<
return rabbitTemplate.isMandatoryFor(mock(Message.class));
=======
ValueExpression<Boolean> expression = (ValueExpression<Boolean>) new DirectFieldAccessor(rabbitTemplate)
.getPropertyValue("mandatoryExpression");
return expression.getValue();
>>>>>>>
return rabbitTemplate.isMandatoryFor(mock(Message.class)); |
<<<<<<<
void virtualHostDefaultsToNull() {
=======
public void determinePortReturnsDefaultAmqpsPortWhenFirstAddressHasNoExplicitPortButSslEnabled() {
this.properties.getSsl().setEnabled(true);
this.properties.setPort(1234);
this.properties.setAddresses("rabbit1.example.com,rabbit2.example.com:2345");
assertThat(this.properties.determinePort()).isEqualTo(5671);
}
@Test
public void virtualHostDefaultsToNull() {
>>>>>>>
void determinePortReturnsDefaultAmqpsPortWhenFirstAddressHasNoExplicitPortButSslEnabled() {
this.properties.getSsl().setEnabled(true);
this.properties.setPort(1234);
this.properties.setAddresses("rabbit1.example.com,rabbit2.example.com:2345");
assertThat(this.properties.determinePort()).isEqualTo(5671);
}
@Test
void virtualHostDefaultsToNull() {
<<<<<<<
void determineSslUsingAmqpReturnsStateOfFirstAddress() {
=======
public void sslDetermineEnabledIsTrueWhenAddressHasNoProtocolAndSslIsEnabled() {
this.properties.getSsl().setEnabled(true);
this.properties.setAddresses("root:password@otherhost");
assertThat(this.properties.getSsl().determineEnabled()).isTrue();
}
@Test
public void sslDetermineEnabledIsFalseWhenAddressHasNoProtocolAndSslIsDisabled() {
this.properties.getSsl().setEnabled(false);
this.properties.setAddresses("root:password@otherhost");
assertThat(this.properties.getSsl().determineEnabled()).isFalse();
}
@Test
public void determineSslUsingAmqpReturnsStateOfFirstAddress() {
>>>>>>>
void sslDetermineEnabledIsTrueWhenAddressHasNoProtocolAndSslIsEnabled() {
this.properties.getSsl().setEnabled(true);
this.properties.setAddresses("root:password@otherhost");
assertThat(this.properties.getSsl().determineEnabled()).isTrue();
}
@Test
void sslDetermineEnabledIsFalseWhenAddressHasNoProtocolAndSslIsDisabled() {
this.properties.getSsl().setEnabled(false);
this.properties.setAddresses("root:password@otherhost");
assertThat(this.properties.getSsl().determineEnabled()).isFalse();
}
@Test
void determineSslUsingAmqpReturnsStateOfFirstAddress() { |
<<<<<<<
public void wsdlLocationsDefinedAsList() {
this.contextRunner
.withPropertyValues("spring.webservices.wsdl-locations[0]=value1")
=======
public void bootstrapHostsDefinedAsList() {
this.contextRunner.withPropertyValues("spring.webservices.wsdl-locations[0]=value1")
>>>>>>>
public void wsdlLocationsDefinedAsList() {
this.contextRunner.withPropertyValues("spring.webservices.wsdl-locations[0]=value1") |
<<<<<<<
this.context = doLoad(new Class<?>[]{TestConfiguration9.class,
EnableJmsConfiguration.class}, "spring.jms.listener.autoStartup=false");
assertThat(this.context.containsBean("jmsListenerContainerFactory")).isTrue();
=======
this.context = doLoad(
new Class<?>[] { TestConfiguration9.class, EnableJmsConfiguration.class },
"spring.jms.listener.autoStartup=false");
assertTrue(this.context.containsBean("jmsListenerContainerFactory"));
>>>>>>>
this.context = doLoad(
new Class<?>[] { TestConfiguration9.class, EnableJmsConfiguration.class },
"spring.jms.listener.autoStartup=false");
assertThat(this.context.containsBean("jmsListenerContainerFactory")).isTrue(); |
<<<<<<<
private Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain,
Principal principal, WebSession session) {
ServerWebExchangeTraceableRequest request = new ServerWebExchangeTraceableRequest(
exchange);
HttpTrace trace = this.tracer.receivedRequest(request);
=======
private Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain, Principal principal,
WebSession session) {
ServerWebExchangeTraceableRequest request = new ServerWebExchangeTraceableRequest(exchange);
final HttpTrace trace = this.tracer.receivedRequest(request);
>>>>>>>
private Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain, Principal principal,
WebSession session) {
ServerWebExchangeTraceableRequest request = new ServerWebExchangeTraceableRequest(exchange);
HttpTrace trace = this.tracer.receivedRequest(request); |
<<<<<<<
NameIdentifierTreeImpl tree = new NameIdentifierTreeImpl(new InternalSyntaxToken(line, 1, "tree", Collections.EMPTY_LIST, 0, false, null));
PHPIssue issue = new PHPIssue(CHECK, "message").tree(tree);
=======
NameIdentifierTreeImpl tree = new NameIdentifierTreeImpl(new InternalSyntaxToken(line, 1, "tree", Collections.EMPTY_LIST, 0, false));
PHPIssue issue = new PHPIssue("key", "message").tree(tree);
>>>>>>>
NameIdentifierTreeImpl tree = new NameIdentifierTreeImpl(new InternalSyntaxToken(line, 1, "tree", Collections.EMPTY_LIST, 0, false));
PHPIssue issue = new PHPIssue(CHECK, "message").tree(tree); |
<<<<<<<
if (this.time == null) {
=======
if( !hasTimeAttr() ){
>>>>>>>
if( !hasTimeAttr() ){
<<<<<<<
@Nonnull
private String getEnclosingNodeDisplayName(@Nonnull WorkflowRun run, @Nonnull String nodeId) {
FlowExecution execution = run.getExecution();
try {
FlowNode node = execution.getNode(nodeId);
if (node.getAction(LabelAction.class) != null) {
ThreadNameAction threadNameAction = node.getAction(ThreadNameAction.class);
if (threadNameAction != null) {
return threadNameAction.getThreadName();
}
}
return node.getDisplayName();
} catch (Exception e) {
// TODO: Something in that odd case where we can get an NPE
}
return "";
}
=======
/**
* Returns true if the time attribute is present in this Suite.
*/
private boolean hasTimeAttr() {
return time != null;
}
>>>>>>>
@Nonnull
private String getEnclosingNodeDisplayName(@Nonnull WorkflowRun run, @Nonnull String nodeId) {
FlowExecution execution = run.getExecution();
try {
FlowNode node = execution.getNode(nodeId);
if (node.getAction(LabelAction.class) != null) {
ThreadNameAction threadNameAction = node.getAction(ThreadNameAction.class);
if (threadNameAction != null) {
return threadNameAction.getThreadName();
}
}
return node.getDisplayName();
} catch (Exception e) {
// TODO: Something in that odd case where we can get an NPE
}
return "";
}
/**
* Returns true if the time attribute is present in this Suite.
*/
private boolean hasTimeAttr() {
return time != null;
} |
<<<<<<<
List<ColumnDesc> columns = getColumnDesc(cardinality, nonNestedEmitters);
LOG.info(_emitterColNames);
=======
>>>>>>> |
<<<<<<<
import ch.epfl.data.squall.storm_components.theta.StormThetaJoinBDB;
import ch.epfl.data.squall.storm_components.hyper_cube.TradionalTwoWayJoin;
import ch.epfl.data.squall.thetajoin.matrix_assignment.ManualHybridHyperCubeAssignment.Dimension;
=======
>>>>>>>
import ch.epfl.data.squall.storm_components.theta.StormThetaJoinBDB;
import ch.epfl.data.squall.storm_components.hyper_cube.TradionalTwoWayJoin;
import ch.epfl.data.squall.thetajoin.matrix_assignment.ManualHybridHyperCubeAssignment.Dimension;
<<<<<<<
StormBoltComponent joiner;
if (MyUtilities.isHypercube(conf)) {
joiner = new TradionalTwoWayJoin(_firstParent, _secondParent, _relColNames,
_parentNameColTypes, _randomColumns, this, allCompNames,
getJoinPredicate(), _isPartitioner, hierarchyPosition, builder, killer, conf,
_isContentSensitive, _contentSensitiveThetaJoinWrapper);
} else if (isBDB && (hierarchyPosition == StormComponent.FINAL_COMPONENT)) {
joiner = new StormThetaJoinBDB(_firstParent, _secondParent, this,
allCompNames, getJoinPredicate(), hierarchyPosition, builder,
killer, conf);
} else {
joiner = new StormThetaJoin(_firstParent, _secondParent, this,
=======
StormBoltComponent joiner;
// if (isBDB && (hierarchyPosition == StormComponent.FINAL_COMPONENT)) {
// joiner = new StormThetaJoinBDB(_firstParent, _secondParent, this,
// allCompNames, getJoinPredicate(), hierarchyPosition, builder,
// killer, conf);
// } else {
joiner = new StormThetaJoin(_firstParent, _secondParent, this,
>>>>>>>
StormBoltComponent joiner;
if (MyUtilities.isHypercube(conf)) {
joiner = new TradionalTwoWayJoin(_firstParent, _secondParent, _relColNames,
_parentNameColTypes, _randomColumns, this, allCompNames,
getJoinPredicate(), _isPartitioner, hierarchyPosition, builder, killer, conf,
_isContentSensitive, _contentSensitiveThetaJoinWrapper);
// } else if (isBDB && (hierarchyPosition == StormComponent.FINAL_COMPONENT)) {
// joiner = new StormThetaJoinBDB(_firstParent, _secondParent, this,
// allCompNames, getJoinPredicate(), hierarchyPosition, builder,
// killer, conf);
} else {
joiner = new StormThetaJoin(_firstParent, _secondParent, this, |
<<<<<<<
// register metric consumer
if (SystemParameters.getBooleanIfExist(conf, "GRAPHITE_METRICS_CONSUMER_ENABLED")) {
conf.registerMetricsConsumer(com.verisign.storm.metrics.GraphiteMetricsConsumer.class,
SystemParameters.getInt(conf, "GRAPHITE_METRICS_CONSUMER_PARALELISM"));
conf.put(Config.TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS,
SystemParameters.getInt(conf, "TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS"));
}
List<DBToasterJoinComponent> dbtComponents = new LinkedList<DBToasterJoinComponent>();
=======
>>>>>>>
if (SystemParameters.getBooleanIfExist(conf, "GRAPHITE_METRICS_CONSUMER_ENABLED")) {
conf.registerMetricsConsumer(com.verisign.storm.metrics.GraphiteMetricsConsumer.class,
SystemParameters.getInt(conf, "GRAPHITE_METRICS_CONSUMER_PARALELISM"));
conf.put(Config.TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS,
SystemParameters.getInt(conf, "TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS"));
}
List<DBToasterJoinComponent> dbtComponents = new LinkedList<DBToasterJoinComponent>(); |
<<<<<<<
public String toString() {
String tmp = "";
for (String s : columnNames) tmp += " " + s;
return name + " " + cardinality + "\n" + tmp;
}
=======
public EmitterDesc(String name, long cardinality, String[] columnsNames, boolean random) {
this(name, cardinality, columnsNames);
this.random = random;
}
>>>>>>>
public EmitterDesc(String name, long cardinality, String[] columnsNames, boolean random) {
this(name, cardinality, columnsNames);
this.random = random;
}
public String toString() {
String tmp = "";
for (String s : columnNames) tmp += " " + s;
return name + " " + cardinality + "\n" + tmp;
} |
<<<<<<<
private boolean printHeader = false;
private String separator = systemLineSeparator;
=======
private final boolean printHeader = false;
private String separator = SYSTEMLINESEPARATOR;
>>>>>>>
private boolean printHeader = false;
private String separator = SYSTEMLINESEPARATOR; |
<<<<<<<
public void apply(ServiceContext context, Optional<BaragonService> maybeOldService, boolean revertOnFailure) throws InvalidConfigException, LbAdapterExecuteException, IOException, MissingTemplateException, InterruptedException, LockTimeoutException {
=======
public void apply(ServiceContext context, Optional<BaragonService> maybeOldService, boolean revertOnFailure, boolean noReload, boolean noValidate) throws InvalidConfigException, LbAdapterExecuteException, IOException, MissingTemplateException {
>>>>>>>
public void apply(ServiceContext context, Optional<BaragonService> maybeOldService, boolean revertOnFailure, boolean noReload, boolean noValidate) throws InvalidConfigException, LbAdapterExecuteException, IOException, MissingTemplateException, InterruptedException, LockTimeoutException {
<<<<<<<
adapter.checkConfigs();
adapter.reloadConfigs();
=======
if (!noValidate) {
adapter.checkConfigs();
} else {
LOG.debug("Not validating configs due to 'noValidate' specified in request");
}
>>>>>>>
if (!noValidate) {
adapter.checkConfigs();
} else {
LOG.debug("Not validating configs due to 'noValidate' specified in request");
}
if (!noReload) {
adapter.reloadConfigs();
} else {
LOG.debug("Not reloading configs due to 'noReload' specified in request");
}
<<<<<<<
=======
if (!noReload) {
adapter.reloadConfigs();
} else {
LOG.debug("Not reloading configs due to 'noReload' specified in request");
}
>>>>>>>
<<<<<<<
public void delete(BaragonService service, Optional<BaragonService> maybeOldService) throws InvalidConfigException, LbAdapterExecuteException, IOException, MissingTemplateException, InterruptedException, LockTimeoutException {
=======
public void delete(BaragonService service, Optional<BaragonService> maybeOldService, boolean noReload, boolean noValidate) throws InvalidConfigException, LbAdapterExecuteException, IOException, MissingTemplateException {
>>>>>>>
public void delete(BaragonService service, Optional<BaragonService> maybeOldService, boolean noReload, boolean noValidate) throws InvalidConfigException, LbAdapterExecuteException, IOException, MissingTemplateException, InterruptedException, LockTimeoutException {
<<<<<<<
if (!agentLock.tryLock(agentLockTimeoutMs, TimeUnit.MILLISECONDS)) {
throw new LockTimeoutException("Timed out waiting to acquire lock");
}
try {
if (previousConfigsExist) {
backupConfigs(service);
remove(service, false);
}
if (oldServiceExists && !maybeOldService.get().equals(service)) {
backupConfigs(maybeOldService.get());
remove(maybeOldService.get(), false);
}
adapter.checkConfigs();
adapter.reloadConfigs();
=======
try {
if (previousConfigsExist) {
backupConfigs(service);
remove(service);
}
if (oldServiceExists && !maybeOldService.get().equals(service)) {
backupConfigs(maybeOldService.get());
remove(maybeOldService.get());
}
if (!noValidate) {
adapter.checkConfigs();
} else {
LOG.debug("Not validating configs due to 'noValidate' specified in request");
}
>>>>>>>
if (!agentLock.tryLock(agentLockTimeoutMs, TimeUnit.MILLISECONDS)) {
throw new LockTimeoutException("Timed out waiting to acquire lock");
}
try {
if (previousConfigsExist) {
backupConfigs(service);
remove(service);
}
if (oldServiceExists && !maybeOldService.get().equals(service)) {
backupConfigs(maybeOldService.get());
remove(maybeOldService.get());
}
if (!noValidate) {
adapter.checkConfigs();
} else {
LOG.debug("Not validating configs due to 'noValidate' specified in request");
}
if (!noReload) {
adapter.reloadConfigs();
} else {
LOG.debug("Not reloading configs due to 'noReload' specified in request");
}
<<<<<<<
} finally {
agentLock.unlock();
}
=======
}
if (!noReload) {
adapter.reloadConfigs();
} else {
LOG.debug("Not reloading configs due to 'noReload' specified in request");
}
>>>>>>>
} finally {
agentLock.unlock();
} |
<<<<<<<
@JsonProperty("extraAgentData")
private Map<String, String> extraAgentData = Collections.emptyMap();
=======
@JsonProperty("maxNotifyServiceAttempts")
private int maxNotifyServiceAttempts = 3;
>>>>>>>
@JsonProperty("extraAgentData")
private Map<String, String> extraAgentData = Collections.emptyMap();
@JsonProperty("maxNotifyServiceAttempts")
private int maxNotifyServiceAttempts = 3;
<<<<<<<
public Map<String, String> getExtraAgentData() {
return extraAgentData;
}
public void setExtraAgentData(Map<String, String> extraAgentData) {
this.extraAgentData = extraAgentData;
}
=======
public int getMaxNotifyServiceAttempts() {
return maxNotifyServiceAttempts;
}
public void setMaxNotifyServiceAttempts(int maxNotifyServiceAttempts) {
this.maxNotifyServiceAttempts = maxNotifyServiceAttempts;
}
>>>>>>>
public Map<String, String> getExtraAgentData() {
return extraAgentData;
}
public void setExtraAgentData(Map<String, String> extraAgentData) {
this.extraAgentData = extraAgentData;
}
public int getMaxNotifyServiceAttempts() {
return maxNotifyServiceAttempts;
}
public void setMaxNotifyServiceAttempts(int maxNotifyServiceAttempts) {
this.maxNotifyServiceAttempts = maxNotifyServiceAttempts;
} |
<<<<<<<
import com.google.inject.name.Named;
import com.hubspot.baragon.agent.BaragonAgentServiceModule;
import com.hubspot.baragon.exceptions.LockTimeoutException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
=======
>>>>>>> |
<<<<<<<
final int blanksLimit = Integer.parseInt(request.getParameter(AjaxRequest.BLANKS_LIMIT));
=======
final String oldPassword = game.getPassword();
>>>>>>>
final int blanksLimit = Integer.parseInt(request.getParameter(AjaxRequest.BLANKS_LIMIT));
final String oldPassword = game.getPassword();
<<<<<<<
game.updateGameSettings(scoreLimit, playerLimit, cardSets, blanksLimit, password, useTimer);
=======
game.updateGameSettings(scoreLimit, playerLimit, cardSets, password, useTimer);
// only broadcast an update if the password state has changed, because it needs to change
// the text on the join button and the sort order
if (!password.equals(oldPassword)) {
gameManager.broadcastGameListRefresh();
}
>>>>>>>
game.updateGameSettings(scoreLimit, playerLimit, cardSets, blanksLimit, password, useTimer);
// only broadcast an update if the password state has changed, because it needs to change
// the text on the join button and the sort order
if (!password.equals(oldPassword)) {
gameManager.broadcastGameListRefresh();
} |
<<<<<<<
@Parameter(names = { "-ln", "--with-line-numbers" }, description = "Include line numbers (Java or raw bytecode modes only).")
=======
@Parameter(
names = { "-ln" },
description = "Include instruction line numbers (only in combination with -r).")
>>>>>>>
@Parameter(
names = { "-ln", "--with-line-numbers" },
description = "Include line numbers (Java or raw bytecode modes).")
<<<<<<<
@Parameter(names = { "-sl", "--stretch-lines" }, description = "Stretch lines to match original line numbers (Java mode only) [EXPERIMENTAL].")
private boolean _stretchLines;
@Parameter(names = { "-dl", "--debug-line-numbers" }, description = "For debugging, show line numbers as inline comments (Java mode only). Implies -ln.")
private boolean _showDebugLineNumbers;
@Parameter(names = { "-ps", "--retain-pointless-switches" }, description = "Do not lift the contents of switches having only a default label.")
=======
@Parameter(
names = { "-ps", "--retain-pointless-switches" },
description = "Do not lift the contents of switches having only a default label.")
>>>>>>>
@Parameter(
names = { "-sl", "--stretch-lines" },
description = "Stretch lines to match original line numbers (Java mode only) [EXPERIMENTAL].")
private boolean _stretchLines;
@Parameter(
names = { "-dl", "--debug-line-numbers" },
description = "For debugging, show line numbers as inline comments (Java mode only). Implies -ln.")
private boolean _showDebugLineNumbers;
@Parameter(
names = { "-ps", "--retain-pointless-switches" },
description = "Do not lift the contents of switches having only a default label.") |
<<<<<<<
new TypeReferenceExpression(Expression.MYSTERY_OFFSET, new SimpleType(Pattern.ANY_STRING)).member("$assertionsDisabled"),
=======
new LeftmostBinaryOperandNode(
new NamedNode(
"assertionsDisabledCheck",
new TypeReferenceExpression(new SimpleType(Pattern.ANY_STRING)).member("$assertionsDisabled")
),
BinaryOperatorType.LOGICAL_OR,
true
).toExpression(),
>>>>>>>
new LeftmostBinaryOperandNode(
new NamedNode(
"assertionsDisabledCheck",
new TypeReferenceExpression(Expression.MYSTERY_OFFSET, new SimpleType(Pattern.ANY_STRING)).member("$assertionsDisabled")
),
BinaryOperatorType.LOGICAL_OR,
true
).toExpression(),
<<<<<<<
final Expression condition = firstOrDefault(m.<Expression>get("condition"));
final AssertStatement assertStatement = new AssertStatement(
condition == null ? ifElse.getOffset() : condition.getOffset());
=======
final Expression assertionsDisabledCheck = firstOrDefault(m.<Expression>get("assertionsDisabledCheck"));
Expression condition = firstOrDefault(m.<Expression>get("condition"));
if (assertionsDisabledCheck != null &&
assertionsDisabledCheck.getParent() instanceof BinaryOperatorExpression &&
assertionsDisabledCheck.getParent().getParent() instanceof BinaryOperatorExpression) {
final BinaryOperatorExpression logicalOr = (BinaryOperatorExpression) assertionsDisabledCheck.getParent();
final Expression right = logicalOr.getRight();
right.remove();
assertionsDisabledCheck.replaceWith(right);
condition.remove();
logicalOr.setRight(condition);
condition = logicalOr;
}
final AssertStatement assertStatement = new AssertStatement();
>>>>>>>
final Expression assertionsDisabledCheck = firstOrDefault(m.<Expression>get("assertionsDisabledCheck"));
Expression condition = firstOrDefault(m.<Expression>get("condition"));
if (assertionsDisabledCheck != null &&
assertionsDisabledCheck.getParent() instanceof BinaryOperatorExpression &&
assertionsDisabledCheck.getParent().getParent() instanceof BinaryOperatorExpression) {
final BinaryOperatorExpression logicalOr = (BinaryOperatorExpression) assertionsDisabledCheck.getParent();
final Expression right = logicalOr.getRight();
right.remove();
assertionsDisabledCheck.replaceWith(right);
condition.remove();
logicalOr.setRight(condition);
condition = logicalOr;
}
final AssertStatement assertStatement = new AssertStatement(
condition == null ? ifElse.getOffset() : condition.getOffset()); |
<<<<<<<
=======
/**
* This method is used to fetch a ValueObject from the database.
*/
public static Object getVOWithIdLockless(Class arg, String idName, Integer id) throws SystemException, Bug
{
Database db = CastorDatabaseService.getDatabase();
Object ret = null;
try
{
beginTransaction(db);
ret = getVOWithIdLockless(arg, idName, id, db);
commitTransaction(db);
}
catch (Exception e)
{
rollbackTransaction(db);
throw new SystemException("An error occurred when we tried to fetch the object " + arg.getName() + ". Reason:" + e.getMessage(), e);
}
return ret;
}
/**
* This method is used to fetch a ValueObject from the database.
*/
public static Object getVOWithIdLockless(Class arg, String idName, Integer id, Database db) throws SystemException, Bug
{
Object ret = null;
try
{
OQLQuery oql = db.getOQLQuery("SELECT u FROM " + arg.getName() + " u WHERE u." + idName +" = $1 ORDER BY u." + idName +" desc");
QueryResults results = oql.execute(Database.READONLY);
if (results.hasMore())
{
IBaseEntity o = (IBaseEntity)results.next();
ret = o.getVO();
}
results.close();
oql.close();
}
catch(Exception e)
{
throw new SystemException("An error occurred when we tried to fetch the object " + arg.getName() + ". Reason:" + e.getMessage(), e);
}
return ret;
}
>>>>>>> |
<<<<<<<
assertEquals("valid value", true, validCourse.isValid());
=======
assertTrue("valid value", c.isValid());
>>>>>>>
assertTrue("valid value", validCourse.isValid());
<<<<<<<
assertEquals("invalid value", false, invalidCourse.isValid());
=======
assertFalse("invalid value", c.isValid());
>>>>>>>
assertFalse("invalid value", invalidCourse.isValid()); |
<<<<<<<
logger = LogManager.getLogger("manager-" + username);
logger.info("Creating new manager for " + username + " (stored in " + settingsPath + ")");
=======
logger = LogManager.getLogger("manager-" + Util.redact(username));
logger.info("Creating new manager for " + Util.redact(username) + " (stored at " + settingsPath + ")");
>>>>>>>
logger = LogManager.getLogger("manager-" + Util.redact(username));
logger.info("Creating new manager for " + Util.redact(username) + " (stored at " + settingsPath + ")");
<<<<<<<
logger.warn("UntrustedIdentityException sending message to " + e.getIdentifier());
=======
logger.warn("UntrustedIdentityException sending message to " + Util.redact(e.getE164Number()));
>>>>>>>
logger.warn("UntrustedIdentityException sending message to " + Util.redact(e.getIdentifier()));
<<<<<<<
networkExceptions.add(new NetworkFailureException(address.getIdentifier(), e));
logger.warn("PushNetworkException when sending message to %s" + address.getNumber());
=======
networkExceptions.add(new NetworkFailureException(address.getNumber(), e));
logger.warn("PushNetworkException when sending message to %s" + Util.redact(address.getNumber()));
>>>>>>>
networkExceptions.add(new NetworkFailureException(address.getIdentifier(), e));
logger.warn("PushNetworkException when sending message to %s" + Util.redact(address.getIdentifier()));
<<<<<<<
logger.warn("contactStore is unexpectedly null!");
return Collections.emptyList();
=======
return Collections.<ContactInfo>emptyList();
>>>>>>>
return Collections.emptyList(); |
<<<<<<<
//==========================================================================
public void makeAccountNonInstructor(String instructorId) {
accountsDb.makeAccountNonInstructor(instructorId);
}
=======
//==========================================================================
public List<AccountData> getInstructorAccounts() {
return accountsDb.getInstructorAccounts();
}
>>>>>>>
//==========================================================================
public List<AccountData> getInstructorAccounts() {
return accountsDb.getInstructorAccounts();
}
//==========================================================================
public void makeAccountNonInstructor(String instructorId) {
accountsDb.makeAccountNonInstructor(instructorId);
} |
<<<<<<<
courseEditPage.clickAddSectionLevelPrivilegesLink(instructorIndex);
=======
courseEditPage.clickAddSessionLevelPrivilegesLink(instructorIndex);
courseEditPage.clickSectionCheckBoxInSectionLevel(instructorIndex, 1, 1);
>>>>>>>
courseEditPage.clickAddSectionLevelPrivilegesLink(instructorIndex);
courseEditPage.clickSectionCheckBoxInSectionLevel(instructorIndex, 1, 1);
<<<<<<<
courseEditPage.clickAddSectionLevelPrivilegesLink(instructorIndex);
courseEditPage.clickAddSectionLevelPrivilegesLink(instructorIndex);
=======
courseEditPage.clickAddSessionLevelPrivilegesLink(instructorIndex);
courseEditPage.clickSectionCheckBoxInSectionLevel(instructorIndex, 2, 2);
courseEditPage.clickAddSessionLevelPrivilegesLink(instructorIndex);
>>>>>>>
courseEditPage.clickAddSectionLevelPrivilegesLink(instructorIndex);
courseEditPage.clickSectionCheckBoxInSectionLevel(instructorIndex, 2, 2);
courseEditPage.clickAddSectionLevelPrivilegesLink(instructorIndex);
<<<<<<<
assertEquals(false, courseEditPage.addSectionLevelPrivilegesLink(instructorIndex).isDisplayed());
=======
assertFalse(courseEditPage.addSessionLevelPrivilegesLink(instructorIndex).isDisplayed());
>>>>>>>
assertFalse(courseEditPage.addSectionLevelPrivilegesLink(instructorIndex).isDisplayed()); |
<<<<<<<
public boolean isComplete;
public FeedbackSessionResultsBundle (FeedbackSessionAttributes feedbackSession,
List<FeedbackResponseAttributes> responses,
Map<String, FeedbackQuestionAttributes> questions,
Map<String, String> emailNameTable,
Map<String, String> emailTeamNameTable,
Map<String, boolean[]> visibilityTable,
FeedbackSessionResponseStatus responseStatus,
Map<String, List<FeedbackResponseCommentAttributes>> responseComments){
this(feedbackSession, responses, questions, emailNameTable, emailTeamNameTable, visibilityTable, responseStatus, responseComments, true);
}
=======
/**
* Responses with identities of giver/recipients NOT hidden.
* To be used for anonymous result calculation only, and identities hidden before showing to users.
*/
public List<FeedbackResponseAttributes> actualResponses = null;
>>>>>>>
public boolean isComplete;
/**
* Responses with identities of giver/recipients NOT hidden.
* To be used for anonymous result calculation only, and identities hidden before showing to users.
*/
public List<FeedbackResponseAttributes> actualResponses = null;
public FeedbackSessionResultsBundle (FeedbackSessionAttributes feedbackSession,
List<FeedbackResponseAttributes> responses,
Map<String, FeedbackQuestionAttributes> questions,
Map<String, String> emailNameTable,
Map<String, String> emailTeamNameTable,
Map<String, boolean[]> visibilityTable,
FeedbackSessionResponseStatus responseStatus,
Map<String, List<FeedbackResponseCommentAttributes>> responseComments){
this(feedbackSession, responses, questions, emailNameTable, emailTeamNameTable, visibilityTable, responseStatus, responseComments, true);
} |
<<<<<<<
String courseName = "";
List<CourseAttributes> courses = logic.getCoursesForStudentAccount(account.googleId);
Collections.sort(courses);
for (int i = 0; i < courses.size(); i++) {
CourseAttributes course = courses.get(i);
coursePaginationList.add(course.getId());
if (courseId.isEmpty()) {
//if courseId not provided, select the newest course
courseId = course.getId();
}
if (course.getId().equals(courseId)) {
courseName = course.getId() + " : " + course.getName();
=======
List<String> coursePaginationList = new ArrayList<>();
for (CourseAttributes course : sortedCourses) {
coursePaginationList.add(course.id);
}
return coursePaginationList;
}
private String getSelectedCourseName(List<CourseAttributes> sortedCourses) {
for (CourseAttributes course : sortedCourses) {
if (course.id.equals(courseId)) {
return course.id + " : " + course.name;
>>>>>>>
List<String> coursePaginationList = new ArrayList<>();
for (CourseAttributes course : sortedCourses) {
coursePaginationList.add(course.getId());
}
return coursePaginationList;
}
private String getSelectedCourseName(List<CourseAttributes> sortedCourses) {
for (CourseAttributes course : sortedCourses) {
if (course.getId().equals(courseId)) {
return course.getId() + " : " + course.getName(); |
<<<<<<<
private InstructorResultsModerationButton buildModerationButtonForExistingResponse(FeedbackQuestionAttributes question,
FeedbackResponseAttributes response) {
return buildModerationButtonForGiver(question, response.giverEmail, "btn btn-default btn-xs", "Moderate Response");
}
private InstructorResultsModerationButton buildModerationButtonForGiver(FeedbackQuestionAttributes question,
String giverEmail, String className,
String buttonText) {
boolean isAllowedToModerate = instructor.isAllowedForPrivilege(bundle.getSectionFromRoster(giverEmail),
getFeedbackSessionName(),
Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS);
boolean isDisabled = !isAllowedToModerate;
String giverIdentifier = giverEmail;
if (question != null) {
giverIdentifier = question.giverType.isTeam() ? giverEmail.replace(Const.TEAM_OF_EMAIL_OWNER,"")
: giverIdentifier;
}
InstructorResultsModerationButton moderationButton = new InstructorResultsModerationButton(isAllowedToModerate, isDisabled,
className, giverIdentifier,
getCourseId(), getFeedbackSessionName(),
question, buttonText);
return moderationButton;
}
private InstructorFeedbackResultsGroupByQuestionPanel buildInstructorFeedbackResultsGroupByQuestionPanelWithoutModerationButton(
String participantIdentifier, String participantName,
List<InstructorResultsQuestionTable> questionTables) {
return buildInstructorFeedbackResultsGroupByQuestionPanel(
participantIdentifier, participantName,
questionTables, null, false);
}
private InstructorFeedbackResultsGroupByQuestionPanel buildInstructorFeedbackResultsGroupByQuestionPanel(
String participantIdentifier, String participantName,
List<InstructorResultsQuestionTable> questionTables,
InstructorResultsModerationButton moderationButton,
boolean isModerationButtonDisplayed) {
boolean isEmailValid = validator.getInvalidityInfo(FieldValidator.FieldType.EMAIL, participantIdentifier).isEmpty();
Url profilePictureLink = new Url(getProfilePictureLink(participantIdentifier));
InstructorResultsQuestionTable.sortByQuestionNumber(questionTables);
InstructorFeedbackResultsGroupByQuestionPanel giverPanel =
InstructorFeedbackResultsGroupByQuestionPanel.buildInstructorFeedbackResultsGroupByQuestionPanel(
questionTables, isEmailValid, profilePictureLink,
viewType.isFirstGroupedByGiver(), participantIdentifier, participantName,
moderationButton, isModerationButtonDisplayed);
return giverPanel;
}
/*
* getInstructorFeedbackSessionPublishAndUnpublishAction()
* is not covered in action test, but covered in UI tests.
*/
private FeedbackSessionPublishButton getInstructorFeedbackSessionPublishAndUnpublishAction() {
boolean isHome = false;
return new FeedbackSessionPublishButton(this,
bundle.feedbackSession,
isHome,
instructor,
"btn-primary btn-block");
}
=======
// TODO remove this entirely and use PageData method directly
>>>>>>>
private InstructorResultsModerationButton buildModerationButtonForExistingResponse(FeedbackQuestionAttributes question,
FeedbackResponseAttributes response) {
return buildModerationButtonForGiver(question, response.giverEmail, "btn btn-default btn-xs", "Moderate Response");
}
private InstructorResultsModerationButton buildModerationButtonForGiver(FeedbackQuestionAttributes question,
String giverEmail, String className,
String buttonText) {
boolean isAllowedToModerate = instructor.isAllowedForPrivilege(bundle.getSectionFromRoster(giverEmail),
getFeedbackSessionName(),
Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS);
boolean isDisabled = !isAllowedToModerate;
String giverIdentifier = giverEmail;
if (question != null) {
giverIdentifier = question.giverType.isTeam() ? giverEmail.replace(Const.TEAM_OF_EMAIL_OWNER,"")
: giverIdentifier;
}
InstructorResultsModerationButton moderationButton = new InstructorResultsModerationButton(isAllowedToModerate, isDisabled,
className, giverIdentifier,
getCourseId(), getFeedbackSessionName(),
question, buttonText);
return moderationButton;
}
private InstructorFeedbackResultsGroupByQuestionPanel buildInstructorFeedbackResultsGroupByQuestionPanelWithoutModerationButton(
String participantIdentifier, String participantName,
List<InstructorResultsQuestionTable> questionTables) {
return buildInstructorFeedbackResultsGroupByQuestionPanel(
participantIdentifier, participantName,
questionTables, null, false);
}
private InstructorFeedbackResultsGroupByQuestionPanel buildInstructorFeedbackResultsGroupByQuestionPanel(
String participantIdentifier, String participantName,
List<InstructorResultsQuestionTable> questionTables,
InstructorResultsModerationButton moderationButton,
boolean isModerationButtonDisplayed) {
boolean isEmailValid = validator.getInvalidityInfo(FieldValidator.FieldType.EMAIL, participantIdentifier).isEmpty();
Url profilePictureLink = new Url(getProfilePictureLink(participantIdentifier));
InstructorResultsQuestionTable.sortByQuestionNumber(questionTables);
InstructorFeedbackResultsGroupByQuestionPanel giverPanel =
InstructorFeedbackResultsGroupByQuestionPanel.buildInstructorFeedbackResultsGroupByQuestionPanel(
questionTables, isEmailValid, profilePictureLink,
viewType.isFirstGroupedByGiver(), participantIdentifier, participantName,
moderationButton, isModerationButtonDisplayed);
return giverPanel;
}
/*
* getInstructorFeedbackSessionPublishAndUnpublishAction()
* is not covered in action test, but covered in UI tests.
*/
private FeedbackSessionPublishButton getInstructorFeedbackSessionPublishAndUnpublishAction() {
boolean isHome = false;
return new FeedbackSessionPublishButton(this,
bundle.feedbackSession,
isHome,
instructor,
"btn-primary btn-block");
}
// TODO remove this entirely and use PageData method directly |
<<<<<<<
import teammates.common.datatransfer.InstructorPrivileges;
=======
import teammates.common.datatransfer.SectionDetailsBundle;
>>>>>>>
import teammates.common.datatransfer.InstructorPrivileges;
import teammates.common.datatransfer.SectionDetailsBundle; |
<<<<<<<
public boolean isResponseCommentPublicToRecipient(FeedbackQuestionAttributes question) {
return (question.giverType == FeedbackParticipantType.STUDENTS
|| question.giverType == FeedbackParticipantType.TEAMS)
|| (question.isResponseVisibleTo(FeedbackParticipantType.RECEIVER)
|| question.isResponseVisibleTo(FeedbackParticipantType.OWN_TEAM_MEMBERS)
|| question.isResponseVisibleTo(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS)
|| question.isResponseVisibleTo(FeedbackParticipantType.STUDENTS));
}
=======
public boolean isInstructorAllowedForPrivilegeOnComment(CommentAttributes comment, String privilegeName) {
// TODO: remember to come back and change this if later CommentAttributes.recipients can have multiple later!!!
Logic logic = new Logic();
if (this.currentInstructor == null) {
return false;
}
if (comment.recipientType == CommentRecipientType.COURSE) {
return this.currentInstructor.isAllowedForPrivilege(privilegeName);
} else if (comment.recipientType == CommentRecipientType.SECTION) {
String section = "";
if (!comment.recipients.isEmpty()) {
Iterator<String> iterator = comment.recipients.iterator();
section = iterator.next();
}
return this.currentInstructor.isAllowedForPrivilege(section, privilegeName);
} else if (comment.recipientType == CommentRecipientType.TEAM) {
String team = "";
String section = "";
if (!comment.recipients.isEmpty()) {
Iterator<String> iterator = comment.recipients.iterator();
team = iterator.next();
}
try {
List<StudentAttributes> students = logic.getStudentsForTeam(team, courseId);
if (!students.isEmpty()) {
section = students.get(0).section;
}
} catch(EntityDoesNotExistException e) {
return false;
}
return this.currentInstructor.isAllowedForPrivilege(section, privilegeName);
} else if (comment.recipientType == CommentRecipientType.PERSON) {
String studentEmail = "";
String section = "";
if (!comment.recipients.isEmpty()) {
Iterator<String> iterator = comment.recipients.iterator();
studentEmail = iterator.next();
}
StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail);
if (student != null) {
section = student.section;
}
return this.currentInstructor.isAllowedForPrivilege(section, privilegeName);
} else {
// TODO: implement this if instructor is later allowed to be added to recipients
return false;
}
}
>>>>>>>
public boolean isResponseCommentPublicToRecipient(FeedbackQuestionAttributes question) {
return (question.giverType == FeedbackParticipantType.STUDENTS
|| question.giverType == FeedbackParticipantType.TEAMS)
|| (question.isResponseVisibleTo(FeedbackParticipantType.RECEIVER)
|| question.isResponseVisibleTo(FeedbackParticipantType.OWN_TEAM_MEMBERS)
|| question.isResponseVisibleTo(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS)
|| question.isResponseVisibleTo(FeedbackParticipantType.STUDENTS));
}
public boolean isInstructorAllowedForPrivilegeOnComment(CommentAttributes comment, String privilegeName) {
// TODO: remember to come back and change this if later CommentAttributes.recipients can have multiple later!!!
Logic logic = new Logic();
if (this.currentInstructor == null) {
return false;
}
if (comment.recipientType == CommentRecipientType.COURSE) {
return this.currentInstructor.isAllowedForPrivilege(privilegeName);
} else if (comment.recipientType == CommentRecipientType.SECTION) {
String section = "";
if (!comment.recipients.isEmpty()) {
Iterator<String> iterator = comment.recipients.iterator();
section = iterator.next();
}
return this.currentInstructor.isAllowedForPrivilege(section, privilegeName);
} else if (comment.recipientType == CommentRecipientType.TEAM) {
String team = "";
String section = "";
if (!comment.recipients.isEmpty()) {
Iterator<String> iterator = comment.recipients.iterator();
team = iterator.next();
}
try {
List<StudentAttributes> students = logic.getStudentsForTeam(team, courseId);
if (!students.isEmpty()) {
section = students.get(0).section;
}
} catch(EntityDoesNotExistException e) {
return false;
}
return this.currentInstructor.isAllowedForPrivilege(section, privilegeName);
} else if (comment.recipientType == CommentRecipientType.PERSON) {
String studentEmail = "";
String section = "";
if (!comment.recipients.isEmpty()) {
Iterator<String> iterator = comment.recipients.iterator();
studentEmail = iterator.next();
}
StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail);
if (student != null) {
section = student.section;
}
return this.currentInstructor.isAllowedForPrivilege(section, privilegeName);
} else {
// TODO: implement this if instructor is later allowed to be added to recipients
return false;
}
} |
<<<<<<<
verifyModerateResponsesButton(4, "Team 1");
resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Session with Instructors as Givers");
resultsPage.displayByQuestion();
ThreadHelper.waitFor(2000);
______TS("Typical case: test moderate responses button for instructors as givers");
verifyModerateResponsesButton(1, "[email protected]", "[email protected]", "[email protected]");
=======
verifyModerateResponsesButton(4, "Team 1</td></div>'\"");
>>>>>>>
verifyModerateResponsesButton(4, "Team 1</td></div>'\"");
resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Session with Instructors as Givers");
resultsPage.displayByQuestion();
ThreadHelper.waitFor(2000);
______TS("Typical case: test moderate responses button for instructors as givers");
verifyModerateResponsesButton(1, "[email protected]", "[email protected]", "[email protected]"); |
<<<<<<<
InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId);
StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail);
// although "None" means "no section", yet in the intructorPrivilege sectionLevel, "None" will also never be a key
=======
String commentRecipient = getRequestParamValue(Const.ParamsNames.SHOW_COMMENT_BOX);
>>>>>>>
InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId);
StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail);
String commentRecipient = getRequestParamValue(Const.ParamsNames.SHOW_COMMENT_BOX);
// although "None" means "no section", yet in the intructorPrivilege sectionLevel, "None" will also never be a key |
<<<<<<<
public static final String JSP_ADMIN_SEARCH = "/jsp/adminSearch.jsp";
=======
public static final String JSP_ADMIN_ACTIVITY_LOG = "/jsp/adminActivityLog.jsp";
>>>>>>>
public static final String JSP_ADMIN_SEARCH = "/jsp/adminSearch.jsp";
public static final String JSP_ADMIN_ACTIVITY_LOG = "/jsp/adminActivityLog.jsp"; |
<<<<<<<
import teammates.test.util.Priority;
=======
import teammates.test.pageobjects.StudentCourseDetailsPage;
import teammates.test.pageobjects.StudentFeedbackResultsPage;
import teammates.test.pageobjects.StudentHomePage;
>>>>>>>
import teammates.test.util.Priority;
import teammates.test.pageobjects.StudentCourseDetailsPage;
import teammates.test.pageobjects.StudentFeedbackResultsPage;
import teammates.test.pageobjects.StudentHomePage; |
<<<<<<<
List<InstructorResultsQuestionTable> questionPanels;
// for giver > question > recipient, recipient > question > giver,
// giver > recipient > question, recipient > giver > question
=======
List<InstructorFeedbackResultsQuestionTable> questionPanels;
// for giver > question > recipient, recipient > question > giver...
>>>>>>>
List<InstructorFeedbackResultsQuestionTable> questionPanels;
// for giver > question > recipient, recipient > question > giver,
// giver > recipient > question, recipient > giver > question
<<<<<<<
new ArrayList<InstructorResultsQuestionTable>(), getProfilePictureLink(teamMember),
viewType.isPrimaryGroupingOfGiverType(), moderationButton);
} else {
giverPanel =
buildInstructorFeedbackResultsGroupBySecondaryParticipantPanel(
teamMember, bundle.getFullNameFromRoster(teamMember) + " (" + bundle.getTeamNameFromRoster(teamMember) + ")",
new ArrayList<InstructorFeedbackResultsSecondaryParticipantPanelBody>(),
moderationButton);
}
=======
new ArrayList<InstructorFeedbackResultsQuestionTable>(), getProfilePictureLink(teamMember),
viewType.isFirstGroupedByGiver(), moderationButton);
>>>>>>>
new ArrayList<InstructorFeedbackResultsQuestionTable>(), getProfilePictureLink(teamMember),
viewType.isPrimaryGroupingOfGiverType(), moderationButton);
} else {
giverPanel =
buildInstructorFeedbackResultsGroupBySecondaryParticipantPanel(
teamMember, bundle.getFullNameFromRoster(teamMember) + " (" + bundle.getTeamNameFromRoster(teamMember) + ")",
new ArrayList<InstructorFeedbackResultsSecondaryParticipantPanelBody>(),
moderationButton);
}
<<<<<<<
new ArrayList<InstructorResultsQuestionTable>(), getProfilePictureLink(teamMember),
viewType.isPrimaryGroupingOfGiverType(), teamMember, bundle.getFullNameFromRoster(teamMember));
=======
new ArrayList<InstructorFeedbackResultsQuestionTable>(), getProfilePictureLink(teamMember),
viewType.isFirstGroupedByGiver(), teamMember, bundle.getFullNameFromRoster(teamMember));
>>>>>>>
new ArrayList<InstructorFeedbackResultsQuestionTable>(), getProfilePictureLink(teamMember),
viewType.isPrimaryGroupingOfGiverType(), teamMember, bundle.getFullNameFromRoster(teamMember));
<<<<<<<
InstructorResultsParticipantPanel giverPanel) {
List<InstructorResultsParticipantPanel> teamsMembersPanels;
=======
InstructorFeedbackResultsGroupByQuestionPanel giverPanel) {
List<InstructorFeedbackResultsParticipantPanel> teamsMembersPanels;
>>>>>>>
InstructorFeedbackResultsParticipantPanel giverPanel) {
List<InstructorFeedbackResultsParticipantPanel> teamsMembersPanels; |
<<<<<<<
=======
private static String TEST_DATA_FOLDER = "src/test/resources/data/";
>>>>>>>
<<<<<<<
public void testDataBundle() {
printTestCaseHeader();
String jsonString = SharedLib.getFileContents(Common.TEST_DATA_FOLDER + "typicalDataBundle.json");
Gson gson = Common.getTeammatesGson();
DataBundle data = gson.fromJson(jsonString, DataBundle.class);
Coordinator typicalCoord1 = data.coords.get("typicalCoord1");
assertEquals("idOfTypicalCoord1", typicalCoord1.getGoogleID());
assertEquals("Typical Coordinator1", typicalCoord1.getName());
assertEquals("[email protected]", typicalCoord1.getEmail());
Coordinator typicalCoord2 = data.coords.get("typicalCoord2");
assertEquals("idOfTypicalCoord2", typicalCoord2.getGoogleID());
assertEquals("Typical Coordinator2", typicalCoord2.getName());
assertEquals("[email protected]", typicalCoord2.getEmail());
Course course1 = data.courses.get("course1OfCoord1");
assertEquals("idOfCourse1OfCoord1", course1.getID());
assertEquals("course1OfCoord1 name", course1.getName());
assertEquals("idOfTypicalCoord1", course1.getCoordinatorID());
Student student1InCourse1 = data.students.get("student1InCourse1");
assertEquals("student1InCourse1", student1InCourse1.getID());
assertEquals("student1 In Course1", student1InCourse1.getName());
assertEquals("Team 1.1", student1InCourse1.getTeamName());
assertEquals("comment for student1InCourse1",
student1InCourse1.getComments());
assertEquals("profile summary for student1InCourse1",
student1InCourse1.getProfileSummary());
assertEquals("idOfCourse1OfCoord1", student1InCourse1.getCourseID());
assertEquals("profiledetail for student1InCourse1", student1InCourse1
.getProfileDetail().getValue());
Student student2InCourse2 = data.students.get("student2InCourse2");
assertEquals("student2InCourse2", student2InCourse2.getID());
assertEquals("student2 In Course2", student2InCourse2.getName());
assertEquals("Team 2.1", student2InCourse2.getTeamName());
Evaluation evaluation1 = data.evaluations.get("evaluation1InCourse1OfCoord1");
assertEquals("evaluation1 In Course1", evaluation1.getName());
assertEquals("idOfCourse1OfCoord1", evaluation1.getCourseID());
assertEquals("instructions for evaluation1InCourse1",
evaluation1.getInstructions());
assertEquals(10, evaluation1.getGracePeriod());
assertEquals(true, evaluation1.isCommentsEnabled());
assertEquals("Sun Apr 01 23:59:00 SGT 2012", evaluation1.getStart()
.toString());
assertEquals("Tue Apr 30 23:59:00 SGT 2013", evaluation1.getDeadline()
.toString());
assertEquals(true, evaluation1.isActivated());
assertEquals(false, evaluation1.isPublished());
assertEquals(2.0, evaluation1.getTimeZone(), 0.01);
Evaluation evaluation2 = data.evaluations.get("evaluation2InCourse1OfCoord1");
assertEquals("evaluation2 In Course1", evaluation2.getName());
assertEquals("idOfCourse1OfCoord1", evaluation2.getCourseID());
Submission submissionFromS1C1ToS2C1 = data.submissions
.get("submissionFromS1C1ToS2C1");
assertEquals("[email protected]",
submissionFromS1C1ToS2C1.getFromStudent());
assertEquals("[email protected]",
submissionFromS1C1ToS2C1.getToStudent());
assertEquals("idOfCourse1OfCoord1", submissionFromS1C1ToS2C1.getCourseID());
assertEquals("evaluation1 In Course1",
submissionFromS1C1ToS2C1.getEvaluationName());
assertEquals(10, submissionFromS1C1ToS2C1.getPoints());
assertEquals("Team 1.1", submissionFromS1C1ToS2C1.getTeamName());
// since justification filed is of Text type, we have to use it's
// .getValue() method to access the string contained inside it
assertEquals(
"justification of student1InCourse1 rating to student2InCourse1",
submissionFromS1C1ToS2C1.getJustification().getValue());
assertEquals("comments from student1InCourse1 to student2InCourse1",
submissionFromS1C1ToS2C1.getCommentsToStudent().getValue());
Submission submissionFromS2C1ToS1C1 = data.submissions
.get("submissionFromS2C1ToS1C1");
assertEquals("[email protected]",
submissionFromS2C1ToS1C1.getFromStudent());
assertEquals("[email protected]",
submissionFromS2C1ToS1C1.getToStudent());
TeamFormingSession tfsInCourse1 = data.teamFormingSessions
.get("tfsInCourse1");
assertEquals("idOfCourse1OfCoord1", tfsInCourse1.getCourseID());
assertEquals(8.0, tfsInCourse1.getTimeZone(), 0.01);
assertEquals("Sun Apr 01 23:59:00 SGT 2012", tfsInCourse1.getStart()
.toString());
assertEquals("Sun Apr 15 23:59:00 SGT 2012", tfsInCourse1.getDeadline()
.toString());
assertEquals("instructions for tfsInCourse1",
tfsInCourse1.getInstructions());
assertEquals("profile template for tfsInCourse1",
tfsInCourse1.getProfileTemplate());
assertEquals(10, tfsInCourse1.getGracePeriod());
assertEquals(false, tfsInCourse1.isActivated());
TeamProfile profileOfTeam1_1 = data.teamProfiles
.get("profileOfTeam1.1");
assertEquals("idOfCourse1OfCoord1", profileOfTeam1_1.getCourseID());
assertEquals("course1OfCoord1 name", profileOfTeam1_1.getCourseName());
assertEquals("Team 1.1", profileOfTeam1_1.getTeamName());
assertEquals("team profile of Team 1.1", profileOfTeam1_1
.getTeamProfile().getValue());
TeamFormingLog tfsLogMessageForTfsInCourse1 = data.teamFormingLogs
.get("tfsLogMessage1ForTfsInCourse1");
assertEquals("idOfCourse1OfCoord1", tfsLogMessageForTfsInCourse1.getCourseID());
assertEquals("student1 In Course1",
tfsLogMessageForTfsInCourse1.getStudentName());
assertEquals("[email protected]",
tfsLogMessageForTfsInCourse1.getStudentEmail());
assertEquals("Sun Jan 01 01:01:00 SGT 2012",
tfsLogMessageForTfsInCourse1.getTime().toString());
assertEquals("log message 1 of course1, [email protected]",
tfsLogMessageForTfsInCourse1.getMessage().getValue());
}
@Test
public void testPersistDataBundle(){
=======
public void testPersistenceAndDeletion() {
>>>>>>>
public void testPersistenceAndDeletion() { |
<<<<<<<
courseIdForNewSession != null && course.getId().equals(courseIdForNewSession);
=======
course.id.equals(courseIdForNewSession);
>>>>>>>
course.getId().equals(courseIdForNewSession);
<<<<<<<
ElementTag option = createOption(course.getId(), course.getId(),
(isFilledFormForSessionInThisCourse || isEmptyFormForSessionInThisCourse));
=======
ElementTag option = createOption(course.id, course.id,
isFilledFormForSessionInThisCourse || isEmptyFormForSessionInThisCourse);
>>>>>>>
ElementTag option = createOption(course.getId(), course.getId(),
isFilledFormForSessionInThisCourse || isEmptyFormForSessionInThisCourse); |
<<<<<<<
// this test uses accounts from test.properties
confirmationPage.verifyHtml("/instructorCourseJoinConfirmationHTML.html");
=======
confirmationPage.verifyHtmlMainContent("/instructorCourseJoinConfirmationHTML.html");
>>>>>>>
// this test uses accounts from test.properties
confirmationPage.verifyHtmlMainContent("/instructorCourseJoinConfirmationHTML.html"); |
<<<<<<<
.replaceAll("\"([a-zA-Z0-9-_]){50,}\"","\"{*}\"")
//questionid regex in responseid
.replaceAll("\"([a-zA-Z0-9-_]){62,}%", "\"{*}%")
=======
//regkey and questionid (same regex for both)
.replaceAll("value=\"([a-zA-Z0-9-_]){50,}\"","value=\"{*}\"")
//responseid
.replaceAll("([a-zA-Z0-9-_]){30,}%"
+ "[\\w+-][\\w+!#$%&'*/=?^_`{}~-]*+(\\.[\\w+!#$%&'*/=?^_`{}~-]+)*+@([A-Za-z0-9-]+\\.)*[A-Za-z]+%"
+ "[\\w+-][\\w+!#$%&'*/=?^_`{}~-]*+(\\.[\\w+!#$%&'*/=?^_`{}~-]+)*+@([A-Za-z0-9-]+\\.)*[A-Za-z]+", "{*}")
//questionid
.replaceAll("([a-zA-Z0-9-_]){62,}","{*}")
>>>>>>>
//regkey and questionid (same regex for both)
.replaceAll("value=\"([a-zA-Z0-9-_]){50,}\"","value=\"{*}\"")
//questionid regex in responseid
.replaceAll("\"([a-zA-Z0-9-_]){62,}%", "\"{*}%") |
<<<<<<<
protected double maxTimeInVehicle = Double.MAX_VALUE;
Builder(String id){
this.id = id;
timeWindows = new TimeWindowsImpl();
timeWindows.add(timeWindow);
}
=======
Builder(String id){
this.id = id;
timeWindows = new TimeWindowsImpl();
timeWindows.add(timeWindow);
}
>>>>>>>
protected double maxTimeInVehicle = Double.MAX_VALUE;Builder(String id){
this.id = id;
timeWindows = new TimeWindowsImpl();
timeWindows.add(timeWindow);
}
<<<<<<<
private final double maxTimeInVehicle;
Service(Builder builder) {
=======
Service(Builder<?> builder) {
setUserData(builder.userData);
>>>>>>>
private final double maxTimeInVehicle;
Service(Builder<?> builder) {
setUserData(builder.userData);
<<<<<<<
maxTimeInVehicle = builder.maxTimeInVehicle;
}
=======
}
>>>>>>>
maxTimeInVehicle = builder.maxTimeInVehicle;} |
<<<<<<<
public void selectAddOtherOptionCheckboxForNewQuestion() {
addOtherOptionCheckboxForNewQuestion.click();
}
/**
* Empties the input box for the given {@code field}.
* @param field : the ID of the field to clear.
*/
public void clearField(String field){
JavascriptExecutor js = (JavascriptExecutor) browser.driver;
js.executeScript("$('#" + field
+ "')[0].value='';");
}
=======
>>>>>>> |
<<<<<<<
//@formatter:off
=======
>>>>>>>
//@formatter:off
<<<<<<<
// Unit tests
AllUnitTests.class,
// Js tests
AllJsUnitTests.class,
// Api tests
TMAPITest.class,
APIServletTest.class,
// Ui tests
CoordCourseAddPageUiTest.class,
CoordCourseEnrollPageUiTest.class,
CoordHomePageUiTest.class })
=======
//Unit tests
CommonTest.class,
StudentTest.class,
TeamDataTest.class,
EvalResultDataTest.class,
TeamEvalResultTest.class,
HtmlHelperTest.class,
//Js tests
AllJsUnitTests.class,
//Api tests
TMAPITest.class,
APIServletTest.class,
//Ui tests
CoordCourseAddPageUiTest.class,
CoordCourseEnrollPageUiTest.class,
CoordEvalPageUiTest.class,
CoordEvalResultsPageUiTest.class,
CoordHomePageUiTest.class
})
>>>>>>>
// Unit tests
AllUnitTests.class,
// Js tests
AllJsUnitTests.class,
// Api tests
TMAPITest.class,
APIServletTest.class,
// Ui tests
CoordCourseAddPageUiTest.class,
CoordCourseEnrollPageUiTest.class,
CoordEvalPageUiTest.class,
CoordEvalResultsPageUiTest.class,
CoordHomePageUiTest.class }) |
<<<<<<<
import teammates.common.util.TimeHelper;
import teammates.ui.template.CommentRow;
import teammates.ui.template.ElementTag;
=======
import teammates.common.util.Url;
import teammates.ui.template.Comment;
>>>>>>>
import teammates.ui.template.Comment; |
<<<<<<<
public static final String SEARCH_COMMENTS_FOR_STUDENTS = "searchcommentforstudents";
public static final String SEARCH_COMMENTS_FOR_RESPONSES = "searchcommentforresponses";
}
public class SearchIndex {
public static final String COMMENT = "comment";
public static final String FEEDBACK_RESPONSE_COMMENT = "feedbackresponsecomment";
}
public class SearchDocumentField {
public static final String ATTRIBUTE = "attribute";
public static final String COMMENT_ATTRIBUTE = "commentAttibute";
public static final String COMMENT_GIVER_NAME = "commentGiverName";
public static final String COMMENT_RECIPIENT_NAME = "commentRecipientName";
public static final String FEEDBACK_RESPONSE_COMMENT_ATTRIBUTE = "frCommentAttibute";
public static final String FEEDBACK_RESPONSE_COMMENT_GIVER_NAME = "frCommentGiverName";
public static final String FEEDBACK_RESPONSE_ATTRIBUTE = "feedbackResponseAttibute";
public static final String FEEDBACK_RESPONSE_GIVER_NAME = "feedbackResponseGiverName";
public static final String FEEDBACK_RESPONSE_RECEIVER_NAME = "feedbackResponseReceiverName";
public static final String FEEDBACK_QUESTION_ATTRIBUTE = "feedbackQuestionAttibute";
public static final String FEEDBACK_SESSION_ATTRIBUTE = "feedbackSessionAttibute";
public static final String SEARCHABLE_TEXT = "searchableText";
public static final String CREATED_DATE = "createdDate";
public static final String COURSE_ID = "courseId";
public static final String GIVER_EMAIL = "giverEmail";
public static final String GIVER_SECTION = "giverSection";
public static final String RECIPIENT_EMAIL = "recipientEmail";
public static final String RECIPIENT_SECTION = "recipientSection";
public static final String IS_VISIBLE_TO_INSTRUCTOR = "isVisibleToInstructor";
public static final String IS_VISIBLE_TO_RECEIVER = "isVisibleToReceiver";
=======
public static final String PROFILE_PICTURE_LEFTX = "cropboxleftx";
public static final String PROFILE_PICTURE_TOPY = "cropboxtopy";
public static final String PROFILE_PICTURE_RIGHTX = "cropboxrightx";
public static final String PROFILE_PICTURE_BOTTOMY = "cropboxbottomy";
public static final String PROFILE_PICTURE_HEIGHT = "pictureheight";
public static final String PROFILE_PICTURE_WIDTH = "picturewidth";
>>>>>>>
public static final String PROFILE_PICTURE_LEFTX = "cropboxleftx";
public static final String PROFILE_PICTURE_TOPY = "cropboxtopy";
public static final String PROFILE_PICTURE_RIGHTX = "cropboxrightx";
public static final String PROFILE_PICTURE_BOTTOMY = "cropboxbottomy";
public static final String PROFILE_PICTURE_HEIGHT = "pictureheight";
public static final String PROFILE_PICTURE_WIDTH = "picturewidth";
public static final String SEARCH_COMMENTS_FOR_STUDENTS = "searchcommentforstudents";
public static final String SEARCH_COMMENTS_FOR_RESPONSES = "searchcommentforresponses";
}
public class SearchIndex {
public static final String COMMENT = "comment";
public static final String FEEDBACK_RESPONSE_COMMENT = "feedbackresponsecomment";
}
public class SearchDocumentField {
public static final String ATTRIBUTE = "attribute";
public static final String COMMENT_ATTRIBUTE = "commentAttibute";
public static final String COMMENT_GIVER_NAME = "commentGiverName";
public static final String COMMENT_RECIPIENT_NAME = "commentRecipientName";
public static final String FEEDBACK_RESPONSE_COMMENT_ATTRIBUTE = "frCommentAttibute";
public static final String FEEDBACK_RESPONSE_COMMENT_GIVER_NAME = "frCommentGiverName";
public static final String FEEDBACK_RESPONSE_ATTRIBUTE = "feedbackResponseAttibute";
public static final String FEEDBACK_RESPONSE_GIVER_NAME = "feedbackResponseGiverName";
public static final String FEEDBACK_RESPONSE_RECEIVER_NAME = "feedbackResponseReceiverName";
public static final String FEEDBACK_QUESTION_ATTRIBUTE = "feedbackQuestionAttibute";
public static final String FEEDBACK_SESSION_ATTRIBUTE = "feedbackSessionAttibute";
public static final String SEARCHABLE_TEXT = "searchableText";
public static final String CREATED_DATE = "createdDate";
public static final String COURSE_ID = "courseId";
public static final String GIVER_EMAIL = "giverEmail";
public static final String GIVER_SECTION = "giverSection";
public static final String RECIPIENT_EMAIL = "recipientEmail";
public static final String RECIPIENT_SECTION = "recipientSection";
public static final String IS_VISIBLE_TO_INSTRUCTOR = "isVisibleToInstructor";
public static final String IS_VISIBLE_TO_RECEIVER = "isVisibleToReceiver"; |
<<<<<<<
req.setAttribute(Const.ParamsNames.ERROR, "" + isError);
addStatusMessagesToPageData(req);
clearStatusMessageForRequest(req);
=======
req.setAttribute(Const.ParamsNames.ERROR, "" + isError);
if (isClearingStatusMessage) {
clearStatusMessageForRequest(req);
}
>>>>>>>
req.setAttribute(Const.ParamsNames.ERROR, "" + isError);
addStatusMessagesToPageData(req);
if (isClearingStatusMessage) {
clearStatusMessageForRequest(req);
} |
<<<<<<<
String courseId = helper.courseID;
=======
String courseIdBackup = helper.courseID;
String courseInstitute = helper.account.institute; // Assumption: Logged in user is from the Institute of the course, not App Admin
>>>>>>>
String courseId = helper.courseID;
String courseInstitute = helper.account.institute; // Assumption: Logged in user is from the Institute of the course, not App Admin
<<<<<<<
helper.server.updateCourseInstructors(courseId, helper.instructorList);
=======
helper.server.updateCourseInstructors(courseIdBackup, helper.instructorList, courseInstitute);
>>>>>>>
helper.server.updateCourseInstructors(courseId, helper.instructorList, courseInstitute); |
<<<<<<<
//TODO: find a way to test status message from session
InstructorAttributes instructor1InCourse1 = dataBundle.instructors.get("instructor1InCourse1");
gaeSimulation.loginAsInstructor(instructor1InCourse1.googleId);
=======
>>>>>>>
InstructorAttributes instructor1InCourse1 = dataBundle.instructors.get("instructor1InCourse1");
gaeSimulation.loginAsInstructor(instructor1InCourse1.googleId); |
<<<<<<<
public static final String COURSE_ADD_EVALUATION = "Add a feedback session for the course";
public static final String CLAIMED = "This is student own estimation of his/her contributions to the project";
public static final String PERCEIVED = "This is the average of what other team members think this student contributed to the project";
=======
public static final String COURSE_ADD_EVALUATION = "Add an evaluation for the course";
public static final String CLAIMED = "This is the students own estimation of his/her contributions";
public static final String PERCEIVED = "This is the average of what other team members think this student contributed";
>>>>>>>
public static final String COURSE_ADD_EVALUATION = "Add a feedback session for the course";
public static final String CLAIMED = "This is the students own estimation of his/her contributions";
public static final String PERCEIVED = "This is the average of what other team members think this student contributed"; |
<<<<<<<
=======
>>>>>>>
<<<<<<<
/**
* Retrieves the link to submit the request for remind of particular student.
* Also contains home page link to return after the action.
* @return form submit action link
*/
public String getRemindParticularStudentActionLink() {
return getInstructorFeedbackRemindParticularStudentActionLink(Const.ActionURIs.INSTRUCTOR_HOME_PAGE);
}
=======
/**
* Retrieves the link to submit the request for copy of session.
* Also contains home page link to return after the action.
* @return form submit action link
*/
public String getEditCopyActionLink() {
return getInstructorFeedbackEditCopyActionLink(Const.ActionURIs.INSTRUCTOR_HOME_PAGE);
}
>>>>>>>
/**
* Retrieves the link to submit the request for remind of particular student.
* Also contains home page link to return after the action.
* @return form submit action link
*/
public String getRemindParticularStudentActionLink() {
return getInstructorFeedbackRemindParticularStudentActionLink(Const.ActionURIs.INSTRUCTOR_HOME_PAGE);
}
/**
* Retrieves the link to submit the request for copy of session.
* Also contains home page link to return after the action.
* @return form submit action link
*/
public String getEditCopyActionLink() {
return getInstructorFeedbackEditCopyActionLink(Const.ActionURIs.INSTRUCTOR_HOME_PAGE);
} |
<<<<<<<
homePage.getStatus().contains("Instructor AHPUiT Instrúctör has been successfully created with join link:\n"
+ expectedjoinUrl);
=======
assertEquals("Instructor AHPUiT Instrúctör has been successfully created with join link:\n" + expectedjoinUrl,
homePage.getStatus());
homePage.verifyHtml("/adminHomePageCreateInstructorSuccess.html");
>>>>>>>
assertEquals("Instructor AHPUiT Instrúctör has been successfully created with join link:\n" + expectedjoinUrl,
homePage.getStatus()); |
<<<<<<<
assertEquals(false, coursesLogic.isSampleCourse(notSampleCousre.getId()));
=======
assertFalse(coursesLogic.isSampleCourse(c.id));
>>>>>>>
assertFalse(coursesLogic.isSampleCourse(notSampleCousre.getId()));
<<<<<<<
CourseAttributes sampleCourse = new CourseAttributes("course.id-demo3", "sample course");
assertEquals(true, coursesLogic.isSampleCourse(sampleCourse.getId()));
=======
c.id = c.id.concat("-demo3");
assertTrue(coursesLogic.isSampleCourse(c.id));
>>>>>>>
CourseAttributes sampleCourse = new CourseAttributes("course.id-demo3", "sample course");
assertTrue(coursesLogic.isSampleCourse(sampleCourse.getId()));
<<<<<<<
CourseAttributes sampleCourse2 = new CourseAttributes("course.id-demo3-demo33",
"sample course with additional -demo");
assertEquals(true, coursesLogic.isSampleCourse(sampleCourse2.getId()));
=======
c.id = c.id.concat("-demo33");
assertTrue(coursesLogic.isSampleCourse(c.id));
>>>>>>>
CourseAttributes sampleCourse2 = new CourseAttributes("course.id-demo3-demo33",
"sample course with additional -demo");
assertTrue(coursesLogic.isSampleCourse(sampleCourse2.getId()));
<<<<<<<
assertEquals(false, coursesLogic.isCoursePresent(nonExistentCourse.getId()));
=======
assertFalse(coursesLogic.isCoursePresent(c.id));
>>>>>>>
assertFalse(coursesLogic.isCoursePresent(nonExistentCourse.getId()));
<<<<<<<
assertEquals(true, coursesLogic.isCoursePresent(existingCourse.getId()));
=======
assertTrue(coursesLogic.isCoursePresent(c.id));
>>>>>>>
assertTrue(coursesLogic.isCoursePresent(existingCourse.getId()));
<<<<<<<
CourseAttributes courseRetrieved = coursesLogic.getCourse(course.getId());
assertEquals(true, courseRetrieved.isArchived);
=======
CourseAttributes courseRetrieved = coursesLogic.getCourse(course.id);
assertTrue(courseRetrieved.isArchived);
>>>>>>>
CourseAttributes courseRetrieved = coursesLogic.getCourse(course.getId());
assertTrue(courseRetrieved.isArchived);
<<<<<<<
courseRetrieved = coursesLogic.getCourse(course.getId());
assertEquals(false, courseRetrieved.isArchived);
=======
courseRetrieved = coursesLogic.getCourse(course.id);
assertFalse(courseRetrieved.isArchived);
>>>>>>>
courseRetrieved = coursesLogic.getCourse(course.getId());
assertFalse(courseRetrieved.isArchived);
<<<<<<<
CourseDetailsBundle courseSummary = coursesLogic.getCourseSummary(course.getId());
assertEquals(course.getId(), courseSummary.course.getId());
assertEquals(course.getName(), courseSummary.course.getName());
assertEquals(false, courseSummary.course.isArchived);
=======
CourseDetailsBundle courseSummary = coursesLogic.getCourseSummary(course.id);
assertEquals(course.id, courseSummary.course.id);
assertEquals(course.name, courseSummary.course.name);
assertFalse(courseSummary.course.isArchived);
>>>>>>>
CourseDetailsBundle courseSummary = coursesLogic.getCourseSummary(course.getId());
assertEquals(course.getId(), courseSummary.course.getId());
assertEquals(course.getName(), courseSummary.course.getName());
assertFalse(courseSummary.course.isArchived);
<<<<<<<
CourseSummaryBundle courseSummary = coursesLogic.getCourseSummaryWithoutStats(course.getId());
assertEquals(course.getId(), courseSummary.course.getId());
assertEquals(course.getName(), courseSummary.course.getName());
assertEquals(false, courseSummary.course.isArchived);
=======
CourseSummaryBundle courseSummary = coursesLogic.getCourseSummaryWithoutStats(course.id);
assertEquals(course.id, courseSummary.course.id);
assertEquals(course.name, courseSummary.course.name);
assertFalse(courseSummary.course.isArchived);
>>>>>>>
CourseSummaryBundle courseSummary = coursesLogic.getCourseSummaryWithoutStats(course.getId());
assertEquals(course.getId(), courseSummary.course.getId());
assertEquals(course.getName(), courseSummary.course.getName());
assertFalse(courseSummary.course.isArchived);
<<<<<<<
CourseDetailsBundle courseDetails = coursesLogic.getCourseDetails(course.getId());
assertEquals(course.getId(), courseDetails.course.getId());
assertEquals(course.getName(), courseDetails.course.getName());
assertEquals(false, courseDetails.course.isArchived);
=======
CourseDetailsBundle courseDetails = coursesLogic.getCourseDetails(course.id);
assertEquals(course.id, courseDetails.course.id);
assertEquals(course.name, courseDetails.course.name);
assertFalse(courseDetails.course.isArchived);
>>>>>>>
CourseDetailsBundle courseDetails = coursesLogic.getCourseDetails(course.getId());
assertEquals(course.getId(), courseDetails.course.getId());
assertEquals(course.getName(), courseDetails.course.getName());
assertFalse(courseDetails.course.isArchived);
<<<<<<<
assertEquals(false, coursesLogic.hasIndicatedSections(typicalCourse2.getId()));
=======
assertFalse(coursesLogic.hasIndicatedSections(typicalCourse2.id));
>>>>>>>
assertFalse(coursesLogic.hasIndicatedSections(typicalCourse2.getId()));
<<<<<<<
assertTrue(StudentsLogic.inst().getStudentsForCourse(course1OfInstructor.getId()).size() != 0);
=======
assertNotSame(StudentsLogic.inst().getStudentsForCourse(course1OfInstructor.id).size(), 0);
>>>>>>>
assertNotSame(StudentsLogic.inst().getStudentsForCourse(course1OfInstructor.getId()).size(), 0); |
<<<<<<<
public void selectRecipientsToBeGiverTeamMembersAndGiver() {
selectDropdownByVisibleValue(recipientDropdown, "Giver's team members and Giver");
}
=======
public void selectRecipientsToBeInstructors() {
selectDropdownByVisibleValue(recipientDropdown, "Instructors in the course");
}
>>>>>>>
public void selectRecipientsToBeGiverTeamMembersAndGiver() {
selectDropdownByVisibleValue(recipientDropdown, "Giver's team members and Giver");
}
public void selectRecipientsToBeInstructors() {
selectDropdownByVisibleValue(recipientDropdown, "Instructors in the course");
} |
<<<<<<<
public void testSortAction() {
______TS("Typical case: test sort types");
=======
public void testSortAction(){
______TS("test sort by giver > recipient > question");
>>>>>>>
public void testSortAction() {
______TS("Typical case: test sort by giver > recipient > question");
<<<<<<<
=======
______TS("test sort by recipient > giver > question");
>>>>>>>
______TS("test sort by recipient > giver > question");
<<<<<<<
=======
assertEquals(true, resultsPage.clickQuestionAdditionalInfoButton(12,"giver-1-recipient-1"));
assertEquals(false, resultsPage.clickQuestionAdditionalInfoButton(12,"giver-1-recipient-1"));
______TS("test sort by giver > question > recipient");
>>>>>>>
______TS("test sort by giver > question > recipient");
<<<<<<<
=======
______TS("test sort by recipient > question > giver");
>>>>>>>
______TS("test sort by recipient > question > giver");
<<<<<<<
=======
______TS("test order in giver > recipient > question team");
>>>>>>>
______TS("test order in giver > recipient > question team");
<<<<<<<
=======
______TS("test order in giver > question > recipient team");
>>>>>>>
______TS("test order in giver > question > recipient team");
<<<<<<<
=======
______TS("test order in recipient > question > giver team");
>>>>>>>
______TS("test order in recipient > question > giver team"); |
<<<<<<<
private String imageUrl;
private String expression;
private String characteristic;
private String mentality;
private String matters;
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getExpression() {
return expression;
}
public void setExpression(String expression) {
this.expression = expression;
}
public String getCharacteristic() {
return characteristic;
}
public void setCharacteristic(String characteristic) {
this.characteristic = characteristic;
}
public String getMentality() {
return mentality;
}
public void setMentality(String mentality) {
this.mentality = mentality;
}
public String getMatters() {
return matters;
}
public void setMatters(String matters) {
this.matters = matters;
}
@Override
public String toString() {
return "Physique{" +
"physical_name='" + physical_name + '\'' +
", cure_material=" + cure_material +
'}';
=======
public static class ElementsBean {
/**
* id : 81
* calorie : 1.2
* carbohydrate : 0
* fat : 0
* protein : 0
* cellulose : 0
* vitaminA : 500
* vitaminB1 : 0
* vitaminB2 : 0
* vitaminB6 : 1500
* vitaminC : 100
* vitaminE : 0
* carotene : 1500
* cholesterol : 0
* Mg : 0
* Ca : 0
* Fe : 0
* Zn : 0
* Cu : 0
* Mn : 0
* K : 0
* P : 500
* Na : 1000
* Se : 0
* niacin : 0
* thiamine : 0
*/
private float id;
private double calorie;
private float carbohydrate;
private float fat;
private float protein;
private float cellulose;
private float vitaminA;
private float vitaminB1;
private float vitaminB2;
private float vitaminB6;
private float vitaminC;
private float vitaminE;
private float carotene;
private float cholesterol;
private float Mg;
private float Ca;
private float Fe;
private float Zn;
private float Cu;
private float Mn;
private float K;
private float P;
private float Na;
private float Se;
private float niacin;
private float thiamine;
@Override
public String toString() {
return "ElementsBean{" +
"id=" + id +
", calorie=" + calorie +
", carbohydrate=" + carbohydrate +
", fat=" + fat +
", protein=" + protein +
", cellulose=" + cellulose +
", vitaminA=" + vitaminA +
", vitaminB1=" + vitaminB1 +
", vitaminB2=" + vitaminB2 +
", vitaminB6=" + vitaminB6 +
", vitaminC=" + vitaminC +
", vitaminE=" + vitaminE +
", carotene=" + carotene +
", cholesterol=" + cholesterol +
", Mg=" + Mg +
", Ca=" + Ca +
", Fe=" + Fe +
", Zn=" + Zn +
", Cu=" + Cu +
", Mn=" + Mn +
", K=" + K +
", P=" + P +
", Na=" + Na +
", Se=" + Se +
", niacin=" + niacin +
", thiamine=" + thiamine +
'}';
}
public float getId() {
return id;
}
public void setId(float id) {
this.id = id;
}
public double getCalorie() {
return calorie;
}
public void setCalorie(double calorie) {
this.calorie = calorie;
}
public float getCarbohydrate() {
return carbohydrate;
}
public void setCarbohydrate(float carbohydrate) {
this.carbohydrate = carbohydrate;
}
public float getFat() {
return fat;
}
public void setFat(float fat) {
this.fat = fat;
}
public float getProtein() {
return protein;
}
public void setProtein(float protein) {
this.protein = protein;
}
public float getCellulose() {
return cellulose;
}
public void setCellulose(float cellulose) {
this.cellulose = cellulose;
}
public float getVitaminA() {
return vitaminA;
}
public void setVitaminA(float vitaminA) {
this.vitaminA = vitaminA;
}
public float getVitaminB1() {
return vitaminB1;
}
public void setVitaminB1(float vitaminB1) {
this.vitaminB1 = vitaminB1;
}
public float getVitaminB2() {
return vitaminB2;
}
public void setVitaminB2(float vitaminB2) {
this.vitaminB2 = vitaminB2;
}
public float getVitaminB6() {
return vitaminB6;
}
public void setVitaminB6(float vitaminB6) {
this.vitaminB6 = vitaminB6;
}
public float getVitaminC() {
return vitaminC;
}
public void setVitaminC(float vitaminC) {
this.vitaminC = vitaminC;
}
public float getVitaminE() {
return vitaminE;
}
public void setVitaminE(float vitaminE) {
this.vitaminE = vitaminE;
}
public float getCarotene() {
return carotene;
}
public void setCarotene(float carotene) {
this.carotene = carotene;
}
public float getCholesterol() {
return cholesterol;
}
public void setCholesterol(float cholesterol) {
this.cholesterol = cholesterol;
}
public float getMg() {
return Mg;
}
public void setMg(float Mg) {
this.Mg = Mg;
}
public float getCa() {
return Ca;
}
public void setCa(float Ca) {
this.Ca = Ca;
}
public float getFe() {
return Fe;
}
public void setFe(float Fe) {
this.Fe = Fe;
}
public float getZn() {
return Zn;
}
public void setZn(float Zn) {
this.Zn = Zn;
}
public float getCu() {
return Cu;
}
public void setCu(float Cu) {
this.Cu = Cu;
}
public float getMn() {
return Mn;
}
public void setMn(float Mn) {
this.Mn = Mn;
}
public float getK() {
return K;
}
public void setK(float K) {
this.K = K;
}
public float getP() {
return P;
}
public void setP(float P) {
this.P = P;
}
public float getNa() {
return Na;
}
public void setNa(float Na) {
this.Na = Na;
}
public float getSe() {
return Se;
}
public void setSe(float Se) {
this.Se = Se;
}
public float getNiacin() {
return niacin;
}
public void setNiacin(float niacin) {
this.niacin = niacin;
}
public float getThiamine() {
return thiamine;
}
public void setThiamine(float thiamine) {
this.thiamine = thiamine;
}
>>>>>>>
private String imageUrl;
private String expression;
private String characteristic;
private String mentality;
private String matters;
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getExpression() {
return expression;
}
public void setExpression(String expression) {
this.expression = expression;
}
public String getCharacteristic() {
return characteristic;
}
public void setCharacteristic(String characteristic) {
this.characteristic = characteristic;
}
public String getMentality() {
return mentality;
}
public void setMentality(String mentality) {
this.mentality = mentality;
}
public String getMatters() {
return matters;
}
public void setMatters(String matters) {
this.matters = matters;
}
@Override
public String toString() {
return "Physique{" +
"physical_name='" + physical_name + '\'' +
", cure_material=" + cure_material +
'}';
}
public static class ElementsBean {
/**
* id : 81
* calorie : 1.2
* carbohydrate : 0
* fat : 0
* protein : 0
* cellulose : 0
* vitaminA : 500
* vitaminB1 : 0
* vitaminB2 : 0
* vitaminB6 : 1500
* vitaminC : 100
* vitaminE : 0
* carotene : 1500
* cholesterol : 0
* Mg : 0
* Ca : 0
* Fe : 0
* Zn : 0
* Cu : 0
* Mn : 0
* K : 0
* P : 500
* Na : 1000
* Se : 0
* niacin : 0
* thiamine : 0
*/
private float id;
private double calorie;
private float carbohydrate;
private float fat;
private float protein;
private float cellulose;
private float vitaminA;
private float vitaminB1;
private float vitaminB2;
private float vitaminB6;
private float vitaminC;
private float vitaminE;
private float carotene;
private float cholesterol;
private float Mg;
private float Ca;
private float Fe;
private float Zn;
private float Cu;
private float Mn;
private float K;
private float P;
private float Na;
private float Se;
private float niacin;
private float thiamine;
@Override
public String toString() {
return "ElementsBean{" +
"id=" + id +
", calorie=" + calorie +
", carbohydrate=" + carbohydrate +
", fat=" + fat +
", protein=" + protein +
", cellulose=" + cellulose +
", vitaminA=" + vitaminA +
", vitaminB1=" + vitaminB1 +
", vitaminB2=" + vitaminB2 +
", vitaminB6=" + vitaminB6 +
", vitaminC=" + vitaminC +
", vitaminE=" + vitaminE +
", carotene=" + carotene +
", cholesterol=" + cholesterol +
", Mg=" + Mg +
", Ca=" + Ca +
", Fe=" + Fe +
", Zn=" + Zn +
", Cu=" + Cu +
", Mn=" + Mn +
", K=" + K +
", P=" + P +
", Na=" + Na +
", Se=" + Se +
", niacin=" + niacin +
", thiamine=" + thiamine +
'}';
}
public float getId() {
return id;
}
public void setId(float id) {
this.id = id;
}
public double getCalorie() {
return calorie;
}
public void setCalorie(double calorie) {
this.calorie = calorie;
}
public float getCarbohydrate() {
return carbohydrate;
}
public void setCarbohydrate(float carbohydrate) {
this.carbohydrate = carbohydrate;
}
public float getFat() {
return fat;
}
public void setFat(float fat) {
this.fat = fat;
}
public float getProtein() {
return protein;
}
public void setProtein(float protein) {
this.protein = protein;
}
public float getCellulose() {
return cellulose;
}
public void setCellulose(float cellulose) {
this.cellulose = cellulose;
}
public float getVitaminA() {
return vitaminA;
}
public void setVitaminA(float vitaminA) {
this.vitaminA = vitaminA;
}
public float getVitaminB1() {
return vitaminB1;
}
public void setVitaminB1(float vitaminB1) {
this.vitaminB1 = vitaminB1;
}
public float getVitaminB2() {
return vitaminB2;
}
public void setVitaminB2(float vitaminB2) {
this.vitaminB2 = vitaminB2;
}
public float getVitaminB6() {
return vitaminB6;
}
public void setVitaminB6(float vitaminB6) {
this.vitaminB6 = vitaminB6;
}
public float getVitaminC() {
return vitaminC;
}
public void setVitaminC(float vitaminC) {
this.vitaminC = vitaminC;
}
public float getVitaminE() {
return vitaminE;
}
public void setVitaminE(float vitaminE) {
this.vitaminE = vitaminE;
}
public float getCarotene() {
return carotene;
}
public void setCarotene(float carotene) {
this.carotene = carotene;
}
public float getCholesterol() {
return cholesterol;
}
public void setCholesterol(float cholesterol) {
this.cholesterol = cholesterol;
}
public float getMg() {
return Mg;
}
public void setMg(float Mg) {
this.Mg = Mg;
}
public float getCa() {
return Ca;
}
public void setCa(float Ca) {
this.Ca = Ca;
}
public float getFe() {
return Fe;
}
public void setFe(float Fe) {
this.Fe = Fe;
}
public float getZn() {
return Zn;
}
public void setZn(float Zn) {
this.Zn = Zn;
}
public float getCu() {
return Cu;
}
public void setCu(float Cu) {
this.Cu = Cu;
}
public float getMn() {
return Mn;
}
public void setMn(float Mn) {
this.Mn = Mn;
}
public float getK() {
return K;
}
public void setK(float K) {
this.K = K;
}
public float getP() {
return P;
}
public void setP(float P) {
this.P = P;
}
public float getNa() {
return Na;
}
public void setNa(float Na) {
this.Na = Na;
}
public float getSe() {
return Se;
}
public void setSe(float Se) {
this.Se = Se;
}
public float getNiacin() {
return niacin;
}
public void setNiacin(float niacin) {
this.niacin = niacin;
}
public float getThiamine() {
return thiamine;
}
public void setThiamine(float thiamine) {
this.thiamine = thiamine;
} |
<<<<<<<
@operator (
value = { "points_at" },
content_type = IType.POINT,
category = { IOperatorCategory.SPATIAL, IOperatorCategory.POINT },
concept = { IConcept.GEOMETRY, IConcept.SPATIAL_COMPUTATION, IConcept.SPATIAL_RELATION,
IConcept.POINT })
@doc (
value = "A list of left-operand number of points located at a the right-operand distance to the agent location.",
examples = { @example (
value = "3 points_at(20.0)",
equals = "returns [pt1, pt2, pt3] with pt1, pt2 and pt3 located at a distance of 20.0 to the agent location",
test = false) },
see = { "any_location_in", "any_point_in", "closest_points_with", "farthest_point_to" })
=======
@operator(value = { "points_along" }, type = IType.LIST, content_type = IType.POINT, category = {
IOperatorCategory.SPATIAL, IOperatorCategory.POINT }, concept = { IConcept.GEOMETRY,
IConcept.SPATIAL_COMPUTATION, IConcept.SPATIAL_RELATION, IConcept.POINT })
@doc(value = "A list of points along the operand-geometry given its location in terms of rate of distance from the starting points of the geometry.", examples = {
@example(value = " line([{10,10},{80,80}]) points_along ([0.3, 0.5, 0.9])", equals = "the list of following points: [{31.0,31.0,0.0},{45.0,45.0,0.0},{73.0,73.0,0.0}]", test = false) }, see = {
"closest_points_with", "farthest_point_to", "points_at", "points_on" })
public static IList points_along(final IShape geom, final IList<Double> rates) {
final IList<GamaPoint> locs = GamaListFactory.create(Types.POINT);
if (geom.getInnerGeometry() instanceof GeometryCollection) {
for (int i = 0; i < geom.getInnerGeometry().getNumGeometries(); i++) {
locs.addAll(GeometryUtils.locsAlongGeometry(geom.getInnerGeometry().getGeometryN(i), rates));
}
} else {
locs.addAll(GeometryUtils.locsAlongGeometry(geom.getInnerGeometry(), rates));
}
return locs;
}
@operator(value = { "points_at" }, content_type = IType.POINT, category = { IOperatorCategory.SPATIAL,
IOperatorCategory.POINT }, concept = { IConcept.GEOMETRY, IConcept.SPATIAL_COMPUTATION,
IConcept.SPATIAL_RELATION, IConcept.POINT })
@doc(value = "A list of left-operand number of points located at a the right-operand distance to the agent location.", examples = {
@example(value = "3 points_at(20.0)", equals = "returns [pt1, pt2, pt3] with pt1, pt2 and pt3 located at a distance of 20.0 to the agent location", test = false) }, see = {
"any_location_in", "any_point_in", "closest_points_with", "farthest_point_to" })
>>>>>>>
@operator (
value = { "points_along" },
type = IType.LIST,
content_type = IType.POINT,
category = { IOperatorCategory.SPATIAL, IOperatorCategory.POINT },
concept = { IConcept.GEOMETRY, IConcept.SPATIAL_COMPUTATION, IConcept.SPATIAL_RELATION,
IConcept.POINT })
@doc (
value = "A list of points along the operand-geometry given its location in terms of rate of distance from the starting points of the geometry.",
examples = { @example (
value = " line([{10,10},{80,80}]) points_along ([0.3, 0.5, 0.9])",
equals = "the list of following points: [{31.0,31.0,0.0},{45.0,45.0,0.0},{73.0,73.0,0.0}]",
test = false) },
see = { "closest_points_with", "farthest_point_to", "points_at", "points_on" })
public static IList points_along(final IShape geom, final IList<Double> rates) {
final IList<GamaPoint> locs = GamaListFactory.create(Types.POINT);
if (geom.getInnerGeometry() instanceof GeometryCollection) {
for (int i = 0; i < geom.getInnerGeometry().getNumGeometries(); i++) {
locs.addAll(GeometryUtils.locsAlongGeometry(geom.getInnerGeometry().getGeometryN(i), rates));
}
} else {
locs.addAll(GeometryUtils.locsAlongGeometry(geom.getInnerGeometry(), rates));
}
return locs;
}
@operator (
value = { "points_at" },
content_type = IType.POINT,
category = { IOperatorCategory.SPATIAL, IOperatorCategory.POINT },
concept = { IConcept.GEOMETRY, IConcept.SPATIAL_COMPUTATION, IConcept.SPATIAL_RELATION,
IConcept.POINT })
@doc (
value = "A list of left-operand number of points located at a the right-operand distance to the agent location.",
examples = { @example (
value = "3 points_at(20.0)",
equals = "returns [pt1, pt2, pt3] with pt1, pt2 and pt3 located at a distance of 20.0 to the agent location",
test = false) },
see = { "any_location_in", "any_point_in", "closest_points_with", "farthest_point_to" }) |
<<<<<<<
import msi.gama.metamodel.shape.ILocation;
import msi.gama.outputs.layers.AgentLayerStatement;
import msi.gama.outputs.layers.ChartLayerStatement;
import msi.gama.outputs.layers.GridLayer;
import msi.gama.outputs.layers.GridLayerStatement;
import msi.gama.outputs.layers.ILayerStatement;
import msi.gama.outputs.layers.ImageLayerStatement;
import msi.gama.outputs.layers.SpeciesLayerStatement;
=======
import msi.gama.metamodel.shape.GamaPoint;
import msi.gama.outputs.layers.*;
import msi.gama.outputs.layers.charts.ChartLayerStatement;
import msi.gama.outputs.*;
>>>>>>>
import msi.gama.metamodel.shape.ILocation;
import msi.gama.outputs.layers.AgentLayerStatement;
import msi.gama.outputs.layers.charts.ChartLayerStatement;
import msi.gama.outputs.layers.GridLayer;
import msi.gama.outputs.layers.GridLayerStatement;
import msi.gama.outputs.layers.ILayerStatement;
import msi.gama.outputs.layers.ImageLayerStatement;
import msi.gama.outputs.layers.SpeciesLayerStatement; |
<<<<<<<
public interface Owner {
boolean evictAtAddress(long address, boolean shrink);
=======
public static interface Owner {
Collection<Long> evictAtAddress(long address, boolean shrink);
>>>>>>>
public interface Owner {
Collection<Long> evictAtAddress(long address, boolean shrink); |
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `long`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of long");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Long.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `long`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Long.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `long`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of long");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Long.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `long`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Long.TYPE, e.getTargetType()); |
<<<<<<<
_requireJSONFactory("Non-blocking source not (yet?) supported for this format (%s)");
IOContext ctxt = _createContext(null, false);
=======
_requireJSONFactory("Non-blocking source not (yet?) support for this format (%s)");
IOContext ctxt = _createNonBlockingContext(null);
>>>>>>>
_requireJSONFactory("Non-blocking source not (yet?) supported for this format (%s)");
IOContext ctxt = _createNonBlockingContext(null); |
<<<<<<<
f = f.rebuild().disable(JsonGenerator.Feature.QUOTE_NON_NUMERIC_NUMBERS)
.build();
=======
f = JsonFactory.builder()
.disable(JsonWriteFeature.WRITE_NAN_AS_STRINGS)
.build();
>>>>>>>
f = f.rebuild().disable(JsonWriteFeature.WRITE_NAN_AS_STRINGS)
.build();
<<<<<<<
f = f.rebuild()
.enable(JsonGenerator.Feature.QUOTE_NON_NUMERIC_NUMBERS)
.build();
=======
f = JsonFactory.builder()
.enable(JsonWriteFeature.WRITE_NAN_AS_STRINGS)
.build();
>>>>>>>
f = f.rebuild()
.enable(JsonWriteFeature.WRITE_NAN_AS_STRINGS)
.build(); |
<<<<<<<
public double maxTimeInVehicle = Double.MAX_VALUE;
=======
public Object userData;
>>>>>>>
public Object userData;
public double maxTimeInVehicle = Double.MAX_VALUE; |
<<<<<<<
assertTrue(f.isEnabled(StreamWriteFeature.FLUSH_PASSED_TO_STREAM));
MyChars sw = new MyChars();
=======
assertTrue(f.isEnabled(JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM));
StringWriterForTesting sw = new StringWriterForTesting();
>>>>>>>
assertTrue(f.isEnabled(StreamWriteFeature.FLUSH_PASSED_TO_STREAM));
StringWriterForTesting sw = new StringWriterForTesting(); |
<<<<<<<
assertEquals(JsonToken.START_OBJECT, p.currentToken());
=======
assertEquals(JsonToken.START_OBJECT, p.getCurrentToken());
assertEquals(JsonToken.START_OBJECT, p.currentToken());
assertEquals(JsonTokenId.ID_START_OBJECT, p.currentTokenId());
assertEquals(JsonTokenId.ID_START_OBJECT, p.getCurrentTokenId());
>>>>>>>
assertEquals(JsonToken.START_OBJECT, p.currentToken());
assertEquals(JsonTokenId.ID_START_OBJECT, p.currentTokenId());
<<<<<<<
assertEquals(JsonToken.FIELD_NAME, p.currentToken());
assertEquals("ob", p.currentName());
=======
assertEquals(JsonToken.FIELD_NAME, p.getCurrentToken());
assertTrue(p.hasToken(JsonToken.FIELD_NAME));
assertTrue(p.hasTokenId(JsonTokenId.ID_FIELD_NAME));
assertEquals("ob", p.getCurrentName());
>>>>>>>
assertEquals(JsonToken.FIELD_NAME, p.currentToken());
assertTrue(p.hasToken(JsonToken.FIELD_NAME));
assertTrue(p.hasTokenId(JsonTokenId.ID_FIELD_NAME));
assertEquals("ob", p.currentName());
<<<<<<<
assertEquals("value", p.currentName());
=======
assertEquals(3, p.getValueAsInt());
assertEquals(3, p.getValueAsInt(7));
assertEquals(3L, p.getLongValue());
assertEquals(3L, p.getValueAsLong());
assertEquals(3L, p.getValueAsLong(6L));
assertEquals((double)3, p.getDoubleValue());
assertEquals((double)3, p.getValueAsDouble());
assertEquals((double)3, p.getValueAsDouble(0.5));
assertEquals((short)3, p.getShortValue());
assertEquals((byte)3, p.getByteValue());
assertEquals((float)3, p.getFloatValue());
assertEquals(BigInteger.valueOf(3L), p.getBigIntegerValue());
assertEquals(Integer.valueOf(3), p.getNumberValue());
assertTrue(p.getValueAsBoolean());
assertTrue(p.getValueAsBoolean(false));
assertEquals("value", p.currentName());
>>>>>>>
assertEquals(3, p.getValueAsInt());
assertEquals(3, p.getValueAsInt(7));
assertEquals(3L, p.getLongValue());
assertEquals(3L, p.getValueAsLong());
assertEquals(3L, p.getValueAsLong(6L));
assertEquals((double)3, p.getDoubleValue());
assertEquals((double)3, p.getValueAsDouble());
assertEquals((double)3, p.getValueAsDouble(0.5));
assertEquals((short)3, p.getShortValue());
assertEquals((byte)3, p.getByteValue());
assertEquals((float)3, p.getFloatValue());
assertEquals(BigInteger.valueOf(3L), p.getBigIntegerValue());
assertEquals(Integer.valueOf(3), p.getNumberValue());
assertTrue(p.getValueAsBoolean());
assertTrue(p.getValueAsBoolean(false));
assertEquals("value", p.currentName()); |
<<<<<<<
=======
*<p>
* Hash area is divided into 4 sections:
*<ol>
* <li>Primary area (1/2 of total size), direct match from hash (LSB)</li>
* <li>Secondary area (1/4 of total size), match from {@code hash (LSB) >> 1}</li>
* <li>Tertiary area (1/8 of total size), match from {@code hash (LSB) >> 2}</li>
* <li>Spill-over area (remaining 1/8) with linear scan, insertion order</li>
* <li></li>
* </ol>
* and within every area, entries are 4 {@code int}s, where 1 - 3 ints contain 1 - 12
* UTF-8 encoded bytes of name (null-padded), and last int is offset in
* {@code _names} that contains actual name Strings.
*
* @since 2.6
>>>>>>>
*<p>
* Hash area is divided into 4 sections:
*<ol>
* <li>Primary area (1/2 of total size), direct match from hash (LSB)</li>
* <li>Secondary area (1/4 of total size), match from {@code hash (LSB) >> 1}</li>
* <li>Tertiary area (1/8 of total size), match from {@code hash (LSB) >> 2}</li>
* <li>Spill-over area (remaining 1/8) with linear scan, insertion order</li>
* <li></li>
* </ol>
* and within every area, entries are 4 {@code int}s, where 1 - 3 ints contain 1 - 12
* UTF-8 encoded bytes of name (null-padded), and last int is offset in
* {@code _names} that contains actual name Strings. |
<<<<<<<
=======
public void testConfig() throws Exception
{
JsonParser p = createParser(MODE_READER, "[ ]");
Object src = p.getInputSource();
assertNotNull(src);
assertTrue(src instanceof Reader);
p.enable(JsonParser.Feature.AUTO_CLOSE_SOURCE);
assertTrue(p.isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE));
p.disable(JsonParser.Feature.AUTO_CLOSE_SOURCE);
assertFalse(p.isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE));
p.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, true);
assertTrue(p.isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE));
p.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false);
assertFalse(p.isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE));
p.close();
p = createParser(MODE_INPUT_STREAM, "[ ]");
src = p.getInputSource();
assertNotNull(src);
assertTrue(src instanceof InputStream);
p.close();
p = createParser(MODE_DATA_INPUT, "[ ]");
src = p.getInputSource();
assertNotNull(src);
assertTrue(src instanceof DataInput);
p.close();
}
>>>>>>>
public void testInputSourceAccess() throws Exception
{
JsonParser p = createParser(MODE_READER, "[ ]");
Object src = p.getInputSource();
assertNotNull(src);
assertTrue(src instanceof Reader);
p.close();
p = createParser(MODE_INPUT_STREAM, "[ ]");
src = p.getInputSource();
assertNotNull(src);
assertTrue(src instanceof InputStream);
p.close();
p = createParser(MODE_DATA_INPUT, "[ ]");
src = p.getInputSource();
assertNotNull(src);
assertTrue(src instanceof DataInput);
p.close();
}
<<<<<<<
assertEquals("a", parser.currentName());
=======
assertEquals("a", parser.getCurrentName());
_getAndVerifyText(parser, "a");
>>>>>>>
assertEquals("a", parser.currentName());
_getAndVerifyText(parser, "a"); |
<<<<<<<
=======
*<p>
* NOTE: value checks are performed similar to {@link #getIntValue()}
*
* @param defaultValue Value to return if next token is NOT of type {@code JsonToken.VALUE_NUMBER_INT}
*
* @return Integer ({@code int}) value of the {@code JsonToken.VALUE_NUMBER_INT} token parser advanced
* to; or {@code defaultValue} if next token is of some other type
*
* @throws IOException for low-level read issues, or
* {@link JsonParseException} for decoding problems
* @throws InputCoercionException if integer number does not fit in Java {@code int}
>>>>>>>
*<p>
* NOTE: value checks are performed similar to {@link #getIntValue()}
*
* @param defaultValue Value to return if next token is NOT of type {@code JsonToken.VALUE_NUMBER_INT}
*
* @return Integer ({@code int}) value of the {@code JsonToken.VALUE_NUMBER_INT} token parser advanced
* to; or {@code defaultValue} if next token is of some other type
*
* @throws IOException for low-level read issues, or
* {@link JsonParseException} for decoding problems
* @throws InputCoercionException if integer number does not fit in Java {@code int}
<<<<<<<
=======
*<p>
* NOTE: value checks are performed similar to {@link #getLongValue()}
*
* @param defaultValue Value to return if next token is NOT of type {@code JsonToken.VALUE_NUMBER_INT}
*
* @return {@code long} value of the {@code JsonToken.VALUE_NUMBER_INT} token parser advanced
* to; or {@code defaultValue} if next token is of some other type
*
* @throws IOException for low-level read issues, or
* {@link JsonParseException} for decoding problems
* @throws InputCoercionException if integer number does not fit in Java {@code long}
>>>>>>>
*<p>
* NOTE: value checks are performed similar to {@link #getLongValue()}
*
* @param defaultValue Value to return if next token is NOT of type {@code JsonToken.VALUE_NUMBER_INT}
*
* @return {@code long} value of the {@code JsonToken.VALUE_NUMBER_INT} token parser advanced
* to; or {@code defaultValue} if next token is of some other type
*
* @throws IOException for low-level read issues, or
* {@link JsonParseException} for decoding problems
* @throws InputCoercionException if integer number does not fit in Java {@code long}
<<<<<<<
=======
*
* @return {@code Boolean} value of the {@code JsonToken.VALUE_TRUE} or {@code JsonToken.VALUE_FALSE}
* token parser advanced to; or {@code null} if next token is of some other type
*
* @throws IOException for low-level read issues, or
* {@link JsonParseException} for decoding problems
>>>>>>>
*
* @return {@code Boolean} value of the {@code JsonToken.VALUE_TRUE} or {@code JsonToken.VALUE_FALSE}
* token parser advanced to; or {@code null} if next token is of some other type
*
* @throws IOException for low-level read issues, or
* {@link JsonParseException} for decoding problems
<<<<<<<
=======
/**
* Method that will skip all child tokens of an array or
* object token that the parser currently points to,
* iff stream points to
* {@link JsonToken#START_OBJECT} or {@link JsonToken#START_ARRAY}.
* If not, it will do nothing.
* After skipping, stream will point to <b>matching</b>
* {@link JsonToken#END_OBJECT} or {@link JsonToken#END_ARRAY}
* (possibly skipping nested pairs of START/END OBJECT/ARRAY tokens
* as well as value tokens).
* The idea is that after calling this method, application
* will call {@link #nextToken} to point to the next
* available token, if any.
*
* @return This parser, to allow call chaining
*
* @throws IOException for low-level read issues, or
* {@link JsonParseException} for decoding problems
*/
public abstract JsonParser skipChildren() throws IOException;
/**
* Method that may be used to force full handling of the current token
* so that even if lazy processing is enabled, the whole contents are
* read for possible retrieval. This is usually used to ensure that
* the token end location is available, as well as token contents
* (similar to what calling, say {@link #getTextCharacters()}, would
* achieve).
*<p>
* Note that for many dataformat implementations this method
* will not do anything; this is the default implementation unless
* overridden by sub-classes.
*
* @throws IOException for low-level read issues, or
* {@link JsonParseException} for decoding problems
*
* @since 2.8
*/
public void finishToken() throws IOException {
; // nothing
}
>>>>>>>
<<<<<<<
=======
*
* @return {@code True} if the parser current points to specified token
*
* @since 2.5
>>>>>>>
*
* @return {@code True} if the parser current points to specified token
<<<<<<<
=======
*
* @return {@code True} if the parser current points to specified token
*
* @since 2.6
>>>>>>>
*
* @return {@code True} if the parser current points to specified token
<<<<<<<
=======
*
* @return True if the current token can be considered as a
* start-array marker (such {@link JsonToken#START_OBJECT});
* {@code false} if not
*
* @since 2.5
>>>>>>>
*
* @return True if the current token can be considered as a
* start-array marker (such {@link JsonToken#START_OBJECT});
* {@code false} if not
<<<<<<<
=======
*
* @return True if the current token can be considered as a
* start-array marker (such {@link JsonToken#VALUE_NUMBER_INT});
* {@code false} if not
*
* @since 2.12
>>>>>>>
*
* @return True if the current token can be considered as a
* start-array marker (such {@link JsonToken#VALUE_NUMBER_INT});
* {@code false} if not |
<<<<<<<
f = f.rebuild().disable(JsonGenerator.Feature.QUOTE_FIELD_NAMES)
.build();
=======
f = JsonFactory.builder()
.disable(JsonWriteFeature.QUOTE_FIELD_NAMES)
.build();
>>>>>>>
f = f.rebuild().disable(JsonWriteFeature.QUOTE_FIELD_NAMES)
.build();
<<<<<<<
f = f.rebuild()
.enable(JsonGenerator.Feature.QUOTE_FIELD_NAMES)
.build();
=======
f = JsonFactory.builder()
.enable(JsonWriteFeature.QUOTE_FIELD_NAMES)
.build();
>>>>>>>
f = f.rebuild()
.enable(JsonWriteFeature.QUOTE_FIELD_NAMES)
.build();
<<<<<<<
JsonFactory f2 = JsonFactory.builder()
.disable(JsonGenerator.Feature.QUOTE_FIELD_NAMES)
.build();
=======
JsonFactory f2 = JsonFactory.builder()
.disable(JsonWriteFeature.QUOTE_FIELD_NAMES)
.build();
>>>>>>>
JsonFactory f2 = JsonFactory.builder()
.disable(JsonWriteFeature.QUOTE_FIELD_NAMES)
.build(); |
<<<<<<<
@SuppressWarnings("deprecation")
public void testDefaults() {
JsonFactory f = new JsonFactory();
assertFalse(f.isEnabled(JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS));
assertFalse(f.isEnabled(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS));
}
public void testSimpleUnquotedBytes() throws Exception {
_testSimpleUnquoted(MODE_INPUT_STREAM);
_testSimpleUnquoted(MODE_INPUT_STREAM_THROTTLED);
_testSimpleUnquoted(MODE_DATA_INPUT);
}
public void testSimpleUnquotedChars() throws Exception {
_testSimpleUnquoted(MODE_READER);
}
public void testLargeUnquoted() throws Exception
{
_testLargeUnquoted(MODE_INPUT_STREAM);
_testLargeUnquoted(MODE_INPUT_STREAM_THROTTLED);
_testLargeUnquoted(MODE_DATA_INPUT);
_testLargeUnquoted(MODE_READER);
}
=======
>>>>>>>
@SuppressWarnings("deprecation")
public void testDefaults() {
JsonFactory f = new JsonFactory();
assertFalse(f.isEnabled(JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS));
assertFalse(f.isEnabled(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS));
} |
<<<<<<<
=======
*
* @return Underlying parser calls are delegated to
*
* @since 2.10
>>>>>>>
*
* @return Underlying parser calls are delegated to |
<<<<<<<
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.json.JsonFactoryBuilder;
=======
import com.fasterxml.jackson.core.json.JsonReadFeature;
>>>>>>>
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.json.JsonFactoryBuilder;
import com.fasterxml.jackson.core.json.JsonReadFeature;
<<<<<<<
public AsyncMissingValuesInArrayTest(Collection<JsonParser.Feature> features) {
this.features = new HashSet<JsonParser.Feature>(features);
JsonFactoryBuilder b = JsonFactory.builder();
for (JsonParser.Feature feature : features) {
b = b.enable(feature);
=======
public AsyncMissingValuesInArrayTest(Collection<JsonReadFeature> features) {
this.features = new HashSet<JsonReadFeature>(features);
JsonFactoryBuilder b = (JsonFactoryBuilder) JsonFactory.builder();
for (JsonReadFeature feature : features) {
b = b.enable(feature);
>>>>>>>
public AsyncMissingValuesInArrayTest(Collection<JsonReadFeature> features) {
this.features = new HashSet<JsonReadFeature>(features);
JsonFactoryBuilder b = JsonFactory.builder();
for (JsonReadFeature feature : features) {
b = b.enable(feature);
<<<<<<<
this.factory = b.build();
=======
factory = b.build();
>>>>>>>
factory = b.build(); |
<<<<<<<
=======
/**
* Default set of {@link StreamReadCapability}ies that may be used as
* basis for format-specific readers (or as bogus instance if non-null
* set needs to be passed).
*
* @since 2.12
*/
protected final static JacksonFeatureSet<StreamWriteCapability> DEFAULT_WRITE_CAPABILITIES
= JacksonFeatureSet.fromDefaults(StreamWriteCapability.values());
/**
* Default set of {@link StreamReadCapability}ies for typical textual formats,
* to use either as-is, or as a base with possible differences.
*
* @since 2.12
*/
protected final static JacksonFeatureSet<StreamWriteCapability> DEFAULT_TEXTUAL_WRITE_CAPABILITIES
= DEFAULT_WRITE_CAPABILITIES.with(StreamWriteCapability.CAN_WRITE_FORMATTED_NUMBERS);
/**
* Default set of {@link StreamReadCapability}ies for typical binary formats,
* to use either as-is, or as a base with possible differences.
*
* @since 2.12
*/
protected final static JacksonFeatureSet<StreamWriteCapability> DEFAULT_BINARY_WRITE_CAPABILITIES
= DEFAULT_WRITE_CAPABILITIES.with(StreamWriteCapability.CAN_WRITE_BINARY_NATIVELY);
/**
* Enumeration that defines all togglable features for generators.
*/
public enum Feature {
// // Low-level I/O / content features
/**
* Feature that determines whether generator will automatically
* close underlying output target that is NOT owned by the
* generator.
* If disabled, calling application has to separately
* close the underlying {@link OutputStream} and {@link Writer}
* instances used to create the generator. If enabled, generator
* will handle closing, as long as generator itself gets closed:
* this happens when end-of-input is encountered, or generator
* is closed by a call to {@link JsonGenerator#close}.
*<p>
* Feature is enabled by default.
*/
AUTO_CLOSE_TARGET(true),
/**
* Feature that determines what happens when the generator is
* closed while there are still unmatched
* {@link JsonToken#START_ARRAY} or {@link JsonToken#START_OBJECT}
* entries in output content. If enabled, such Array(s) and/or
* Object(s) are automatically closed; if disabled, nothing
* specific is done.
*<p>
* Feature is enabled by default.
*/
AUTO_CLOSE_JSON_CONTENT(true),
/**
* Feature that specifies that calls to {@link #flush} will cause
* matching <code>flush()</code> to underlying {@link OutputStream}
* or {@link Writer}; if disabled this will not be done.
* Main reason to disable this feature is to prevent flushing at
* generator level, if it is not possible to prevent method being
* called by other code (like <code>ObjectMapper</code> or third
* party libraries).
*<p>
* Feature is enabled by default.
*/
FLUSH_PASSED_TO_STREAM(true),
// // Quoting-related features
/**
* Feature that determines whether JSON Object field names are
* quoted using double-quotes, as specified by JSON specification
* or not. Ability to disable quoting was added to support use
* cases where they are not usually expected, which most commonly
* occurs when used straight from Javascript.
*<p>
* Feature is enabled by default (since it is required by JSON specification).
*
* @deprecated Since 2.10 use {@link com.fasterxml.jackson.core.json.JsonWriteFeature#QUOTE_FIELD_NAMES} instead
*/
@Deprecated
QUOTE_FIELD_NAMES(true),
/**
* Feature that determines whether "exceptional" (not real number)
* float/double values are output as quoted strings.
* The values checked are Double.Nan,
* Double.POSITIVE_INFINITY and Double.NEGATIVE_INIFINTY (and
* associated Float values).
* If feature is disabled, these numbers are still output using
* associated literal values, resulting in non-conformant
* output.
*<p>
* Feature is enabled by default.
*
* @deprecated Since 2.10 use {@link com.fasterxml.jackson.core.json.JsonWriteFeature#WRITE_NAN_AS_STRINGS} instead
*/
@Deprecated
QUOTE_NON_NUMERIC_NUMBERS(true),
// // Character escaping features
/**
* Feature that specifies that all characters beyond 7-bit ASCII
* range (i.e. code points of 128 and above) need to be output
* using format-specific escapes (for JSON, backslash escapes),
* if format uses escaping mechanisms (which is generally true
* for textual formats but not for binary formats).
*<p>
* Note that this setting may not necessarily make sense for all
* data formats (for example, binary formats typically do not use
* any escaping mechanisms; and some textual formats do not have
* general-purpose escaping); if so, settings is simply ignored.
* Put another way, effects of this feature are data-format specific.
*<p>
* Feature is disabled by default.
*
* @deprecated Since 2.10 use {@link com.fasterxml.jackson.core.json.JsonWriteFeature#ESCAPE_NON_ASCII} instead
*/
@Deprecated
ESCAPE_NON_ASCII(false),
// // Datatype coercion features
/**
* Feature that forces all Java numbers to be written as Strings,
* even if the underlying data format has non-textual representation
* (which is the case for JSON as well as all binary formats).
* Default state is 'false', meaning that Java numbers are to
* be serialized using basic numeric serialization (as JSON
* numbers, integral or floating point, for example).
* If enabled, all such numeric values are instead written out as
* textual values (which for JSON means quoted in double-quotes).
*<p>
* One use case is to avoid problems with Javascript limitations:
* since Javascript standard specifies that all number handling
* should be done using 64-bit IEEE 754 floating point values,
* result being that some 64-bit integer values can not be
* accurately represent (as mantissa is only 51 bit wide).
*<p>
* Feature is disabled by default.
*
* @deprecated Since 2.10 use {@link com.fasterxml.jackson.core.json.JsonWriteFeature#WRITE_NUMBERS_AS_STRINGS} instead
*/
@Deprecated
WRITE_NUMBERS_AS_STRINGS(false),
/**
* Feature that determines whether {@link java.math.BigDecimal} entries are
* serialized using {@link java.math.BigDecimal#toPlainString()} to prevent
* values to be written using scientific notation.
*<p>
* NOTE: only affects generators that serialize {@link java.math.BigDecimal}s
* using textual representation (textual formats but potentially some binary
* formats).
*<p>
* Feature is disabled by default, so default output mode is used; this generally
* depends on how {@link BigDecimal} has been created.
*
* @since 2.3
*/
WRITE_BIGDECIMAL_AS_PLAIN(false),
// // Schema/Validity support features
/**
* Feature that determines whether {@link JsonGenerator} will explicitly
* check that no duplicate JSON Object field names are written.
* If enabled, generator will check all names within context and report
* duplicates by throwing a {@link JsonGenerationException}; if disabled,
* no such checking will be done. Assumption in latter case is
* that caller takes care of not trying to write duplicate names.
*<p>
* Note that enabling this feature will incur performance overhead
* due to having to store and check additional information.
*<p>
* Feature is disabled by default.
*
* @since 2.3
*/
STRICT_DUPLICATE_DETECTION(false),
/**
* Feature that determines what to do if the underlying data format requires knowledge
* of all properties to output, and if no definition is found for a property that
* caller tries to write. If enabled, such properties will be quietly ignored;
* if disabled, a {@link JsonProcessingException} will be thrown to indicate the
* problem.
* Typically most textual data formats do NOT require schema information (although
* some do, such as CSV), whereas many binary data formats do require definitions
* (such as Avro, protobuf), although not all (Smile, CBOR, BSON and MessagePack do not).
*<p>
* Note that support for this feature is implemented by individual data format
* module, if (and only if) it makes sense for the format in question. For JSON,
* for example, this feature has no effect as properties need not be pre-defined.
*<p>
* Feature is disabled by default, meaning that if the underlying data format
* requires knowledge of all properties to output, attempts to write an unknown
* property will result in a {@link JsonProcessingException}
*
* @since 2.5
*/
IGNORE_UNKNOWN(false),
;
private final boolean _defaultState;
private final int _mask;
/**
* Method that calculates bit set (flags) of all features that
* are enabled by default.
*/
public static int collectDefaults()
{
int flags = 0;
for (Feature f : values()) {
if (f.enabledByDefault()) {
flags |= f.getMask();
}
}
return flags;
}
private Feature(boolean defaultState) {
_defaultState = defaultState;
_mask = (1 << ordinal());
}
public boolean enabledByDefault() { return _defaultState; }
/**
* @since 2.3
*/
public boolean enabledIn(int flags) { return (flags & _mask) != 0; }
public int getMask() { return _mask; }
}
>>>>>>>
<<<<<<<
=======
/**
* Method that allows overriding String used for separating root-level
* JSON values (default is single space character)
*<p>
* Default implementation throws {@link UnsupportedOperationException}.
*
* @param sep Separator to use, if any; null means that no separator is
* automatically added
*
* @since 2.1
*/
public JsonGenerator setRootValueSeparator(SerializableString sep) {
throw new UnsupportedOperationException();
}
/*
/**********************************************************
/* Public API, output state access
/**********************************************************
*/
/**
* Method that can be used to get access to object that is used
* as target for generated output; this is usually either
* {@link OutputStream} or {@link Writer}, depending on what
* generator was constructed with.
* Note that returned value may be null in some cases; including
* case where implementation does not want to exposed raw
* source to caller.
* In cases where output has been decorated, object returned here
* is the decorated version; this allows some level of interaction
* between users of generator and decorator object.
*<p>
* In general use of this accessor should be considered as
* "last effort", i.e. only used if no other mechanism is applicable.
*/
public Object getOutputTarget() {
return null;
}
/**
* Method for verifying amount of content that is buffered by generator
* but not yet flushed to the underlying target (stream, writer),
* in units (byte, char) that the generator implementation uses for buffering;
* or -1 if this information is not available.
* Unit used is often the same as the unit of underlying target (that is,
* `byte` for {@link java.io.OutputStream}, `char` for {@link java.io.Writer}),
* but may differ if buffering is done before encoding.
* Default JSON-backed implementations do use matching units.
*<p>
* Note: non-JSON implementations will be retrofitted for 2.6 and beyond;
* please report if you see -1 (missing override)
*
* @return Amount of content buffered in internal units, if amount known and
* accessible; -1 if not accessible.
*
* @since 2.6
*/
public int getOutputBuffered() {
return -1;
}
/**
* Helper method, usually equivalent to:
*<code>
* getOutputContext().getCurrentValue();
*</code>
*<p>
* Note that "current value" is NOT populated (or used) by Streaming parser;
* it is only used by higher-level data-binding functionality.
* The reason it is included here is that it can be stored and accessed hierarchically,
* and gets passed through data-binding.
*
* @since 2.5
*/
public Object getCurrentValue() {
JsonStreamContext ctxt = getOutputContext();
return (ctxt == null) ? null : ctxt.getCurrentValue();
}
/**
* Helper method, usually equivalent to:
*<code>
* getOutputContext().setCurrentValue(v);
*</code>
*
* @since 2.5
*/
public void setCurrentValue(Object v) {
JsonStreamContext ctxt = getOutputContext();
if (ctxt != null) {
ctxt.setCurrentValue(v);
}
}
>>>>>>> |
<<<<<<<
=======
*<p>
* Default implementation returns <code>false</code> as JSON does NOT
* require stable ordering. Formats that require ordering include positional
* textual formats like <code>CSV</code>, and schema-based binary formats
* like <code>Avro</code>.
*
* @return Whether format supported by this factory
* requires Object properties to be ordered.
>>>>>>>
*
* @return Whether format supported by this factory
* requires Object properties to be ordered.
<<<<<<<
=======
*<p>
* Default implementation returns <code>false</code> as JSON does not
* support native access: all binary content must use Base64 encoding.
* Most binary formats (like Smile and Avro) support native binary content.
*
* @return Whether format supported by this factory
* supports native binary content
>>>>>>>
*
* @return Whether format supported by this factory
* supports native binary content
<<<<<<<
=======
*
* @return Type of format-specific stream read features, if any; {@code null} if none
*
* @since 2.6
>>>>>>>
*
* @return Type of format-specific stream read features, if any; {@code null} if none
<<<<<<<
=======
*
* @return Type of format-specific stream read features, if any; {@code null} if none
*
* @since 2.6
>>>>>>>
*
* @return Type of format-specific stream read features, if any; {@code null} if none
<<<<<<<
=======
*
* @param schema Schema instance to check
*
* @return Whether parsers and generators constructed by this factory
* can use specified format schema instance
*
* @since 2.1
>>>>>>>
*
* @param schema Schema instance to check
*
* @return Whether parsers and generators constructed by this factory
* can use specified format schema instance
<<<<<<<
*<p>
* Note: sub-classes should override this method; default
* implementation will return null for all sub-classes
=======
*
* @return Name of the format handled by parsers, generators this factory creates
>>>>>>>
*
* @return Name of the format handled by parsers, generators this factory creates |
<<<<<<<
int length = (escCode < 0) ? _appendNumeric(d, _qbuf)
: _appendNamed(escCode, _qbuf);
=======
int length = (escCode < 0)
? _appendNumeric(d, qbuf)
: _appendNamed(escCode, qbuf);
;
if ((outPtr + length) > outputBuffer.length) {
int first = outputBuffer.length - outPtr;
if (first > 0) {
System.arraycopy(qbuf, 0, outputBuffer, outPtr, first);
}
if (textBuffer == null) {
textBuffer = TextBuffer.fromInitial(outputBuffer);
}
outputBuffer = textBuffer.finishCurrentSegment();
int second = length - first;
System.arraycopy(qbuf, first, outputBuffer, 0, second);
outPtr = second;
} else {
System.arraycopy(qbuf, 0, outputBuffer, outPtr, length);
outPtr += length;
}
}
if (textBuffer == null) {
return Arrays.copyOfRange(outputBuffer, 0, outPtr);
}
textBuffer.setCurrentLength(outPtr);
return textBuffer.contentsAsArray();
}
/**
* Overloaded variant of {@link #quoteAsString(String)}.
*
* @since 2.10
*/
public char[] quoteAsString(CharSequence input)
{
// 15-Aug-2019, tatu: Optimize common case as JIT can't get rid of overhead otherwise
if (input instanceof String) {
return quoteAsString((String) input);
}
TextBuffer textBuffer = null;
char[] outputBuffer = new char[100];
final int[] escCodes = CharTypes.get7BitOutputEscapes();
final int escCodeCount = escCodes.length;
int inPtr = 0;
final int inputLen = input.length();
int outPtr = 0;
char[] qbuf = null;
outer:
while (inPtr < inputLen) {
tight_loop:
while (true) {
char c = input.charAt(inPtr);
if (c < escCodeCount && escCodes[c] != 0) {
break tight_loop;
}
if (outPtr >= outputBuffer.length) {
if (textBuffer == null) {
textBuffer = TextBuffer.fromInitial(outputBuffer);
}
outputBuffer = textBuffer.finishCurrentSegment();
outPtr = 0;
}
outputBuffer[outPtr++] = c;
if (++inPtr >= inputLen) {
break outer;
}
}
// something to escape; 2 or 6-char variant?
if (qbuf == null) {
qbuf = _qbuf();
}
char d = input.charAt(inPtr++);
int escCode = escCodes[d];
int length = (escCode < 0)
? _appendNumeric(d, qbuf)
: _appendNamed(escCode, qbuf);
;
>>>>>>>
int length = (escCode < 0) ? _appendNumeric(d, qbuf)
: _appendNamed(escCode, qbuf); |
<<<<<<<
=======
*
* @return {@code True} if this is a "referential" type, {@code false} if not
*
* @since 2.6
>>>>>>>
*
* @return {@code True} if this is a "referential" type, {@code false} if not
<<<<<<<
=======
* @deprecated Since 2.7: does not have meaning as parameters depend on type
* resolved.
*
* @return Type-erased class of something not usable at this point
*/
@Deprecated // since 2.7
public Class<?> getParameterSource() {
return null;
}
/**
>>>>>>>
<<<<<<<
* @return Referenced type, if any; null if not.
=======
* @return Referenced type, if any; {@code null} if not.
*
* @since 2.6
>>>>>>>
* @return Referenced type, if any; {@code null} if not. |
<<<<<<<
public void testIsNextTokenName4() throws Exception {
_testIsNextTokenName4(false);
_testIsNextTokenName4(true);
}
// [Issue#34]
=======
// [jackson-core#34]
>>>>>>>
public void testIsNextTokenName4() throws Exception {
_testIsNextTokenName4(false);
_testIsNextTokenName4(true);
}
// [jackson-core#34]
<<<<<<<
private void _testIsNextTokenName4(boolean useStream) throws Exception
{
final String DOC = "{\"name\":-123,\"name2\":99}";
JsonParser jp = useStream ?
JSON_F.createParser(new ByteArrayInputStream(DOC.getBytes("UTF-8")))
: JSON_F.createParser(new StringReader(DOC));
assertToken(JsonToken.START_OBJECT, jp.nextToken());
assertTrue(jp.nextFieldName(new SerializedString("name")));
assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken());
assertEquals(-123, jp.getIntValue());
assertTrue(jp.nextFieldName(new SerializedString("name2")));
assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken());
assertEquals(99, jp.getIntValue());
assertToken(JsonToken.END_OBJECT, jp.nextToken());
assertNull(jp.nextToken());
jp.close();
}
=======
private void _testNextFieldNameIndent(boolean useStream) throws Exception
{
final String DOC = "{\n \"name\" : \n [\n ]\n }";
JsonParser p = useStream ?
JSON_F.createParser(new ByteArrayInputStream(DOC.getBytes("UTF-8")))
: JSON_F.createParser(new StringReader(DOC));
assertToken(JsonToken.START_OBJECT, p.nextToken());
assertTrue(p.nextFieldName(new SerializedString("name")));
assertToken(JsonToken.START_ARRAY, p.nextToken());
assertToken(JsonToken.END_ARRAY, p.nextToken());
assertToken(JsonToken.END_OBJECT, p.nextToken());
assertNull(p.nextToken());
p.close();
}
>>>>>>>
private void _testIsNextTokenName4(boolean useStream) throws Exception
{
final String DOC = "{\"name\":-123,\"name2\":99}";
JsonParser jp = useStream ?
JSON_F.createParser(new ByteArrayInputStream(DOC.getBytes("UTF-8")))
: JSON_F.createParser(new StringReader(DOC));
assertToken(JsonToken.START_OBJECT, jp.nextToken());
assertTrue(jp.nextFieldName(new SerializedString("name")));
assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken());
assertEquals(-123, jp.getIntValue());
assertTrue(jp.nextFieldName(new SerializedString("name2")));
assertToken(JsonToken.VALUE_NUMBER_INT, jp.nextToken());
assertEquals(99, jp.getIntValue());
assertToken(JsonToken.END_OBJECT, jp.nextToken());
assertNull(jp.nextToken());
jp.close();
}
private void _testNextFieldNameIndent(boolean useStream) throws Exception
{
final String DOC = "{\n \"name\" : \n [\n ]\n }";
JsonParser p = useStream ?
JSON_F.createParser(new ByteArrayInputStream(DOC.getBytes("UTF-8")))
: JSON_F.createParser(new StringReader(DOC));
assertToken(JsonToken.START_OBJECT, p.nextToken());
assertTrue(p.nextFieldName(new SerializedString("name")));
assertToken(JsonToken.START_ARRAY, p.nextToken());
assertToken(JsonToken.END_ARRAY, p.nextToken());
assertToken(JsonToken.END_OBJECT, p.nextToken());
assertNull(p.nextToken());
p.close();
} |
<<<<<<<
*
* @param rootSeparator
=======
*
* @param rootSeparator String to use as root value separator
>>>>>>>
*
* @param rootSeparator String to use as root value separator
<<<<<<<
=======
*
* @param rootSeparator String to use as root value separator
>>>>>>>
*
* @param rootSeparator String to use as root value separator
<<<<<<<
=======
/**
* @param rootSeparator Root-level value separator to use
*
* @return This pretty-printer instance (for call chaining)
*
* @since 2.6
*/
>>>>>>>
/**
* @param rootSeparator Root-level value separator to use
*
* @return This pretty-printer instance (for call chaining)
*/
<<<<<<<
=======
// @since 2.3
>>>>>>>
<<<<<<<
=======
// @since 2.3
>>>>>>>
<<<<<<<
=======
*
* @return This pretty-printer instance (for call chaining)
*
* @since 2.3
>>>>>>>
*
* @return This pretty-printer instance (for call chaining)
<<<<<<<
=======
*
* @return This pretty-printer instance (for call chaining)
*
* @since 2.3
>>>>>>>
*
* @return This pretty-printer instance (for call chaining)
<<<<<<<
=======
/**
* Method for configuring separators for this pretty-printer to use
*
* @param separators Separator definitions to use
*
* @return This pretty-printer instance (for call chaining)
*
* @since 2.9
*/
>>>>>>>
/**
* Method for configuring separators for this pretty-printer to use
*
* @param separators Separator definitions to use
*
* @return This pretty-printer instance (for call chaining)
*/ |
<<<<<<<
* base class in <code>databind</code> package.
=======
* base class in <code>mapper</code> package.
*<p>
* Note that in Jackson 1.x <code>JsonNode</code> itself
* was part of core package: Jackson 2.x refactored this
* since conceptually Tree Model is part of mapper package,
* and so part visible to <code>core</code> package should
* be minimized.
*<p>
* NOTE: starting with Jackson 2.2, there is more functionality
* available via this class, and the intent was that this should
* form actual base for multiple alternative tree representations;
* for example, immutable trees could use different implementation
* than mutable trees.
*
* @since 2.2
>>>>>>>
* base class in {@code databind} package.
<<<<<<<
=======
*
* @return True if this node is considered a value node; something that
* represents either a scalar value or explicit {@code null}
*
* @since 2.2
>>>>>>>
*
* @return True if this node is considered a value node; something that
* represents either a scalar value or explicit {@code null}
<<<<<<<
=======
*
* @return {@code True} for Array and Object nodes, {@code false} otherwise
*
* @since 2.2
>>>>>>>
*
* @return {@code True} for Array and Object nodes, {@code false} otherwise
<<<<<<<
=======
*
* @return {@code True} if this node represents a "missing" node
*
* @since 2.2
>>>>>>>
*
* @return {@code True} if this node represents a "missing" node
<<<<<<<
=======
*
* @return {@code True} for Array nodes, {@code false} for everything else
*
* @since 2.2
>>>>>>>
*
* @return {@code True} for Array nodes, {@code false} for everything else
<<<<<<<
=======
*
* @return {@code True} for Object nodes, {@code false} for everything else
*
* @since 2.2
>>>>>>>
*
* @return {@code True} for Object nodes, {@code false} for everything else
<<<<<<<
* if this node is an object and has value for the specified
* field. Null otherwise.
=======
* if this node is an Object and has value for the specified
* field; {@code null} otherwise.
*
* @since 2.2
>>>>>>>
* if this node is an Object and has value for the specified
* field; {@code null} otherwise.
<<<<<<<
* if this node is an array and has specified element.
* Null otherwise.
=======
* if this node is an array and has specified element;
* {@code null} otherwise.
*
* @since 2.2
>>>>>>>
* if this node is an array and has specified element;
* {@code null} otherwise.
<<<<<<<
=======
*
* @return An iterator for traversing names of all fields this Object node
* has (if Object node); empty {@link Iterator} otherwise (never {@code null}).
*
* @since 2.2
>>>>>>>
*
* @return An iterator for traversing names of all fields this Object node
* has (if Object node); empty {@link Iterator} otherwise (never {@code null}).
<<<<<<<
* will return a node for which {@link TreeNode#isMissingNode()} returns true.
*
* @return Node that matches given JSON Pointer: if no match exists,
* will return a node for which {@link TreeNode#isMissingNode()} returns true.
=======
* will return a node for which {@link TreeNode#isMissingNode()} returns true.
*
* @param ptr {@link JsonPointer} expression for descendant node to return
*
* @return Node that matches given JSON Pointer, if any: if no match exists,
* will return a "missing" node (for which {@link TreeNode#isMissingNode()}
* returns {@code true}).
*
* @since 2.3
>>>>>>>
* will return a node for which {@link TreeNode#isMissingNode()} returns true.
*
* @param ptr {@link JsonPointer} expression for descendant node to return
*
* @return Node that matches given JSON Pointer, if any: if no match exists,
* will return a "missing" node (for which {@link TreeNode#isMissingNode()}
* returns {@code true}).
<<<<<<<
* @param ptrExpr Expression to compile as a {@link JsonPointer} instance
*
* @return Node that matches given JSON Pointer: if no match exists,
* will return a node for which {@link TreeNode#isMissingNode()} returns true.
=======
* @param jsonPointerExpression Expression to compile as a {@link JsonPointer}
* instance
*
* @return Node that matches given JSON Pointer, if any: if no match exists,
* will return a "missing" node (for which {@link TreeNode#isMissingNode()}
* returns {@code true}).
*
* @since 2.3
>>>>>>>
* @param jsonPointerExpression Expression to compile as a {@link JsonPointer}
* instance
*
* @return Node that matches given JSON Pointer, if any: if no match exists,
* will return a "missing" node (for which {@link TreeNode#isMissingNode()}
* returns {@code true}).
*
* @since 2.3
<<<<<<<
=======
*<p>
* Also note that calling this method will <b>NOT</b> pass {@link ObjectCodec}
* reference, so data-binding callback methods like {@link JsonParser#readValueAs(Class)}
* will not work with calling {@link JsonParser#setCodec}).
* It is often better to call {@link #traverse(ObjectCodec)} to pass the codec explicitly.
*
* @return {@link JsonParser} that will stream over contents of this node
*/
JsonParser traverse();
/**
* Same as {@link #traverse()}, but additionally passes {@link com.fasterxml.jackson.core.ObjectCodec}
* to use if {@link JsonParser#readValueAs(Class)} is used (otherwise caller must call
* {@link JsonParser#setCodec} on response explicitly).
*<p>
* NOTE: constructed parser instance will NOT initially point to a token,
* so before passing it to deserializers, it is typically necessary to
* advance it to the first available token by calling {@link JsonParser#nextToken()}.
*
* @param codec {@link ObjectCodec} to associate with parser constructed
*
* @return {@link JsonParser} that will stream over contents of this node
*
* @since 2.1
>>>>>>>
*
* @param readCtxt {@link ObjectReadContext} to associate with parser constructed
* (to allow seamless databinding functionality)
*
* @return {@link JsonParser} that will stream over contents of this node |
<<<<<<<
import com.fasterxml.jackson.core.json.JsonFactory;
=======
import com.fasterxml.jackson.core.json.JsonReadFeature;
>>>>>>>
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.json.JsonReadFeature;
<<<<<<<
JsonFactory f = JsonFactory.builder()
.enable(JsonParser.Feature.ALLOW_YAML_COMMENTS)
.build();
=======
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_YAML_COMMENTS)
.build();
>>>>>>>
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_YAML_COMMENTS)
.build();
<<<<<<<
JsonFactory f = JsonFactory.builder()
.enable(JsonParser.Feature.ALLOW_YAML_COMMENTS)
.build();
=======
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_YAML_COMMENTS)
.build();
>>>>>>>
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_YAML_COMMENTS)
.build();
<<<<<<<
JsonFactory f = JsonFactory.builder()
.enable(JsonParser.Feature.ALLOW_COMMENTS)
.build();
=======
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)
.build();
>>>>>>>
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)
.build();
<<<<<<<
JsonFactory f = JsonFactory.builder()
.enable(JsonParser.Feature.ALLOW_COMMENTS)
.build();
=======
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)
.build();
>>>>>>>
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)
.build();
<<<<<<<
JsonFactory f = JsonFactory.builder()
.enable(JsonParser.Feature.ALLOW_COMMENTS)
.build();
=======
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)
.build();
>>>>>>>
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)
.build();
<<<<<<<
JsonFactory f = JsonFactory.builder()
.enable(JsonParser.Feature.ALLOW_COMMENTS)
.build();
=======
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)
.build();
>>>>>>>
final JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS)
.build();
<<<<<<<
JsonFactory f = JsonFactory.builder()
.configure(JsonParser.Feature.ALLOW_COMMENTS, enabled)
.build();
=======
final JsonFactory f = JsonFactory.builder()
.configure(JsonReadFeature.ALLOW_JAVA_COMMENTS, enabled)
.build();
>>>>>>>
final JsonFactory f = JsonFactory.builder()
.configure(JsonReadFeature.ALLOW_JAVA_COMMENTS, enabled)
.build(); |
<<<<<<<
import com.fasterxml.jackson.core.json.JsonFactory;
=======
import com.fasterxml.jackson.core.io.SerializedString;
>>>>>>>
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.io.SerializedString;
<<<<<<<
=======
public void testSimpleDocWithDefault() throws Exception
{
StringWriter sw = new StringWriter();
JsonGenerator gen = JSON_F.createGenerator(sw);
gen.useDefaultPrettyPrinter();
_verifyPrettyPrinter(gen, sw);
gen.close();
}
>>>>>>>
<<<<<<<
=======
JsonGenerator gen = JSON_F.createGenerator(sw);
>>>>>>>
<<<<<<<
JsonFactory f = new JsonFactory();
=======
>>>>>>>
<<<<<<<
assertEquals("{} {} []", _generateRoot(f, null));
=======
assertEquals("{} {} []", _generateRoot(JSON_F, null));
>>>>>>>
assertEquals("{} {} []", _generateRoot(JSON_F, null));
<<<<<<<
assertEquals("{ } { } [ ]", _generateRoot(f, new DefaultPrettyPrinter()));
=======
assertEquals("{ } { } [ ]", _generateRoot(JSON_F, new DefaultPrettyPrinter()));
>>>>>>>
assertEquals("{ } { } [ ]", _generateRoot(JSON_F, new DefaultPrettyPrinter()));
<<<<<<<
assertEquals("{ }|{ }|[ ]", _generateRoot(f, new DefaultPrettyPrinter("|")));
=======
assertEquals("{ }|{ }|[ ]", _generateRoot(JSON_F, new DefaultPrettyPrinter("|")));
>>>>>>>
assertEquals("{ }|{ }|[ ]", _generateRoot(JSON_F, new DefaultPrettyPrinter("|")));
<<<<<<<
ObjectWriteContext ppContext = new ObjectWriteContext.Base() {
@Override
public PrettyPrinter getPrettyPrinter() {
return pp;
}
};
JsonGenerator gen = new JsonFactory().createGenerator(ppContext, sw);
=======
JsonGenerator gen = jf.createGenerator(sw);
gen.setPrettyPrinter(pp);
>>>>>>>
ObjectWriteContext ppContext = new ObjectWriteContext.Base() {
@Override
public PrettyPrinter getPrettyPrinter() {
return pp;
}
};
JsonGenerator gen = f.createGenerator(ppContext, sw); |
<<<<<<<
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase;
=======
>>>>>>>
import com.fasterxml.jackson.core.json.JsonFactory; |
<<<<<<<
JsonFactory f = JsonFactory.builder()
.disable(JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION).build();
JsonParser p = f.createParser(ObjectReadContext.empty(), "[ foobar ]");
=======
JsonFactory f = JsonFactory.builder()
.disable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION)
.build();
JsonParser p = f.createParser("[ foobar ]");
>>>>>>>
JsonFactory f = JsonFactory.builder()
.disable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION)
.build();
JsonParser p = f.createParser(ObjectReadContext.empty(), "[ foobar ]"); |
<<<<<<<
forceFloat = (c == INT_PERIOD);
if (forceFloat) {
// [core#611]: allow optionally leading decimal point
if (!isEnabled(JsonReadFeature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS)) {
return _handleUnexpectedValue(c);
}
}
=======
>>>>>>> |
<<<<<<<
public final static int SURR1_FIRST = 0xD800;
public final static int SURR1_LAST = 0xDBFF;
public final static int SURR2_FIRST = 0xDC00;
public final static int SURR2_LAST = 0xDFFF;
=======
/**
* Set of feature masks related to features that need updates of other
* local configuration or state.
*
* @since 2.5
*/
protected final static int DERIVED_FEATURES_MASK = Feature.WRITE_NUMBERS_AS_STRINGS.getMask()
| Feature.ESCAPE_NON_ASCII.getMask()
| Feature.STRICT_DUPLICATE_DETECTION.getMask()
;
>>>>>>>
public final static int SURR1_FIRST = 0xD800;
public final static int SURR1_LAST = 0xDBFF;
public final static int SURR2_FIRST = 0xDC00;
public final static int SURR2_LAST = 0xDFFF;
/**
* Set of feature masks related to features that need updates of other
* local configuration or state.
*
* @since 2.5
*/
protected final static int DERIVED_FEATURES_MASK = Feature.WRITE_NUMBERS_AS_STRINGS.getMask()
| Feature.ESCAPE_NON_ASCII.getMask()
| Feature.STRICT_DUPLICATE_DETECTION.getMask()
; |
<<<<<<<
=======
* @param linefeed Linefeed to use for encoded content
*
* @return Base64 encoded String of encoded {@code input} bytes
*
* @since 2.10
>>>>>>>
* @param linefeed Linefeed to use for encoded content
*
* @return Base64 encoded String of encoded {@code input} bytes
<<<<<<<
=======
* @return Byte array of decoded contents
*
* @since 2.3
*
>>>>>>>
* @return Byte array of decoded contents
*
<<<<<<<
=======
*
* @param str Input to decode
* @param builder Builder used for assembling decoded content
*
* @since 2.3
>>>>>>>
*
* @param str Input to decode
* @param builder Builder used for assembling decoded content
<<<<<<<
=======
*
* @return Exception message for indicating "missing padding" case
*
* @since 2.10
>>>>>>>
*
* @return Exception message for indicating "missing padding" case |
<<<<<<<
import com.fasterxml.jackson.core.JsonParseException;
=======
import com.fasterxml.jackson.core.JsonFactory;
>>>>>>>
<<<<<<<
import com.fasterxml.jackson.core.json.JsonFactory;
=======
import com.fasterxml.jackson.core.exc.InputCoercionException;
>>>>>>>
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.exc.InputCoercionException;
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `int`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of int");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `int`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Integer.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `long`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of long");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Long.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `long`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Long.TYPE, e.getTargetType());
<<<<<<<
} catch (JsonParseException e) {
verifyException(e, "out of range of `long`");
=======
} catch (InputCoercionException e) {
verifyException(e, "out of range of long");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Long.TYPE, e.getTargetType());
>>>>>>>
} catch (InputCoercionException e) {
verifyException(e, "out of range of `long`");
assertEquals(JsonToken.VALUE_NUMBER_INT, e.getInputType());
assertEquals(Long.TYPE, e.getTargetType()); |
<<<<<<<
import com.fasterxml.jackson.core.json.JsonFactory;
=======
import com.fasterxml.jackson.core.json.JsonReadFeature;
>>>>>>>
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.json.JsonReadFeature;
<<<<<<<
JsonFactory f = JsonFactory.builder()
.enable(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS)
.build();
=======
JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS)
.build();
>>>>>>>
JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS)
.build();
<<<<<<<
f = f.rebuild().enable(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS)
.build();
=======
f = JsonFactory.builder()
.configure(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS, true)
.build();
>>>>>>>
f = f.rebuild().enable(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS)
.build();
<<<<<<<
JsonFactory f = JsonFactory.builder()
.enable(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS)
.build();
=======
JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS)
.build();
>>>>>>>
JsonFactory f = JsonFactory.builder()
.enable(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS)
.build();
<<<<<<<
f = f.rebuild().enable(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS)
.build();
=======
f = JsonFactory.builder()
.configure(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS, true)
.build();
>>>>>>>
f = f.rebuild().enable(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS)
.build(); |
<<<<<<<
=======
*
* @param p Parser in use when encountering issue reported
* @param msg Base exception message to use
*
* @since 2.7
>>>>>>>
*
* @param p Parser in use when encountering issue reported
* @param msg Base exception message to use
<<<<<<<
=======
// @since 2.7
>>>>>>>
<<<<<<<
=======
// @since 2.7
>>>>>>>
<<<<<<<
=======
// @since 2.7
>>>>>>>
<<<<<<<
=======
/**
* Fluent method that may be used to assign originating {@link JsonParser},
* to be accessed using {@link #getProcessor()}.
*<p>
* NOTE: `this` instance is modified and no new instance is constructed.
*
* @param p Parser instance to assign to this exception
*
* @return This exception instance to allow call chaining
*
* @since 2.7
*/
>>>>>>>
/**
* Fluent method that may be used to assign originating {@link JsonParser},
* to be accessed using {@link #getProcessor()}.
*<p>
* NOTE: `this` instance is modified and no new instance is constructed.
*
* @param p Parser instance to assign to this exception
*
* @return This exception instance to allow call chaining
*/
<<<<<<<
=======
/**
* Fluent method that may be used to assign payload to this exception,
* to let recipient access it for diagnostics purposes.
*<p>
* NOTE: `this` instance is modified and no new instance is constructed.
*
* @param payload Payload to assign to this exception
*
* @return This exception instance to allow call chaining
*
* @since 2.8
*/
>>>>>>>
/**
* Fluent method that may be used to assign payload to this exception,
* to let recipient access it for diagnostics purposes.
*<p>
* NOTE: `this` instance is modified and no new instance is constructed.
*
* @param payload Payload to assign to this exception
*
* @return This exception instance to allow call chaining
*/ |
<<<<<<<
@Override
public void writeStartArray(Object currValue) throws IOException
{
if (_itemFilter == null) {
_filterContext = _filterContext.createChildArrayContext(null, currValue, false);
return;
}
if (_itemFilter == TokenFilter.INCLUDE_ALL) {
_filterContext = _filterContext.createChildArrayContext(_itemFilter, currValue, true);
delegate.writeStartArray(currValue);
return;
}
_itemFilter = _filterContext.checkValue(_itemFilter);
if (_itemFilter == null) {
_filterContext = _filterContext.createChildArrayContext(null, currValue, false);
return;
}
if (_itemFilter != TokenFilter.INCLUDE_ALL) {
_itemFilter = _itemFilter.filterStartArray();
}
if (_itemFilter == TokenFilter.INCLUDE_ALL) {
_checkParentPath();
_filterContext = _filterContext.createChildArrayContext(_itemFilter, currValue, true);
delegate.writeStartArray(currValue);
} else {
_filterContext = _filterContext.createChildArrayContext(_itemFilter, currValue, false);
}
}
=======
>>>>>>>
@Override
public void writeStartArray(Object currValue) throws IOException
{
if (_itemFilter == null) {
_filterContext = _filterContext.createChildArrayContext(null, currValue, false);
return;
}
if (_itemFilter == TokenFilter.INCLUDE_ALL) {
_filterContext = _filterContext.createChildArrayContext(_itemFilter, currValue, true);
delegate.writeStartArray(currValue);
return;
}
_itemFilter = _filterContext.checkValue(_itemFilter);
if (_itemFilter == null) {
_filterContext = _filterContext.createChildArrayContext(null, currValue, false);
return;
}
if (_itemFilter != TokenFilter.INCLUDE_ALL) {
_itemFilter = _itemFilter.filterStartArray();
}
if (_itemFilter == TokenFilter.INCLUDE_ALL) {
_checkParentPath();
_filterContext = _filterContext.createChildArrayContext(_itemFilter, currValue, true);
delegate.writeStartArray(currValue);
} else {
_filterContext = _filterContext.createChildArrayContext(_itemFilter, currValue, false);
}
}
<<<<<<<
@Override
public void writeStartObject(Object currValue) throws IOException
{
if (_itemFilter == null) {
_filterContext = _filterContext.createChildObjectContext(_itemFilter, currValue, false);
return;
}
if (_itemFilter == TokenFilter.INCLUDE_ALL) {
_filterContext = _filterContext.createChildObjectContext(_itemFilter, currValue, true);
delegate.writeStartObject(currValue);
return;
}
TokenFilter f = _filterContext.checkValue(_itemFilter);
if (f == null) {
return;
}
if (f != TokenFilter.INCLUDE_ALL) {
f = f.filterStartObject();
}
if (f == TokenFilter.INCLUDE_ALL) {
_checkParentPath();
_filterContext = _filterContext.createChildObjectContext(f, currValue, true);
delegate.writeStartObject(currValue);
} else { // filter out
_filterContext = _filterContext.createChildObjectContext(f, currValue, false);
}
}
=======
>>>>>>>
@Override
public void writeStartObject(Object currValue) throws IOException
{
if (_itemFilter == null) {
_filterContext = _filterContext.createChildObjectContext(_itemFilter, currValue, false);
return;
}
if (_itemFilter == TokenFilter.INCLUDE_ALL) {
_filterContext = _filterContext.createChildObjectContext(_itemFilter, currValue, true);
delegate.writeStartObject(currValue);
return;
}
TokenFilter f = _filterContext.checkValue(_itemFilter);
if (f == null) {
return;
}
if (f != TokenFilter.INCLUDE_ALL) {
f = f.filterStartObject();
}
if (f == TokenFilter.INCLUDE_ALL) {
_checkParentPath();
_filterContext = _filterContext.createChildObjectContext(f, currValue, true);
delegate.writeStartObject(currValue);
} else { // filter out
_filterContext = _filterContext.createChildObjectContext(f, currValue, false);
}
} |
<<<<<<<
import java.io.IOException;
import java.io.StringWriter;
=======
import java.io.StringWriter;
>>>>>>>
import java.io.IOException;
import java.io.StringWriter;
<<<<<<<
import com.fasterxml.jackson.core.json.JsonFactory;
=======
import com.fasterxml.jackson.core.filter.TokenFilter.Inclusion;
>>>>>>>
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.filter.TokenFilter.Inclusion;
<<<<<<<
FilteringParserDelegate p = new FilteringParserDelegate(JSON_F.createParser(ObjectReadContext.empty(), SIMPLE),
new IndexMatchFilter(1), true, true);
=======
FilteringParserDelegate p = new FilteringParserDelegate(JSON_F.createParser(SIMPLE),
new IndexMatchFilter(1), Inclusion.INCLUDE_ALL_AND_PATH, true);
>>>>>>>
FilteringParserDelegate p = new FilteringParserDelegate(JSON_F.createParser(ObjectReadContext.empty(), SIMPLE),
new IndexMatchFilter(1), Inclusion.INCLUDE_ALL_AND_PATH, true);
<<<<<<<
p = new FilteringParserDelegate(JSON_F.createParser(ObjectReadContext.empty(), SIMPLE),
new IndexMatchFilter(0), true, true);
=======
p = new FilteringParserDelegate(JSON_F.createParser(SIMPLE),
new IndexMatchFilter(0), Inclusion.INCLUDE_ALL_AND_PATH, true);
>>>>>>>
p = new FilteringParserDelegate(JSON_F.createParser(ObjectReadContext.empty(), SIMPLE),
new IndexMatchFilter(0), Inclusion.INCLUDE_ALL_AND_PATH, true);
<<<<<<<
FilteringParserDelegate p = new FilteringParserDelegate(JSON_F.createParser(ObjectReadContext.empty(), SIMPLE),
new IndexMatchFilter(0, 1), true, true);
=======
FilteringParserDelegate p = new FilteringParserDelegate(JSON_F.createParser(SIMPLE),
new IndexMatchFilter(0, 1), Inclusion.INCLUDE_ALL_AND_PATH, true);
>>>>>>>
FilteringParserDelegate p = new FilteringParserDelegate(JSON_F.createParser(ObjectReadContext.empty(), SIMPLE),
new IndexMatchFilter(0, 1), Inclusion.INCLUDE_ALL_AND_PATH, true);
<<<<<<<
p = new FilteringParserDelegate(JSON_F.createParser(ObjectReadContext.empty(), JSON),
new IndexMatchFilter(1, 3), true, true);
=======
p = new FilteringParserDelegate(JSON_F.createParser(JSON),
new IndexMatchFilter(1, 3), Inclusion.INCLUDE_ALL_AND_PATH, true);
>>>>>>>
p = new FilteringParserDelegate(JSON_F.createParser(ObjectReadContext.empty(), JSON),
new IndexMatchFilter(1, 3), Inclusion.INCLUDE_ALL_AND_PATH, true); |
<<<<<<<
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.sym.FieldNameMatcher;
import com.fasterxml.jackson.core.type.ResolvedType;
=======
import com.fasterxml.jackson.core.exc.InputCoercionException;
>>>>>>>
import com.fasterxml.jackson.core.exc.InputCoercionException;
import com.fasterxml.jackson.core.json.JsonFactory;
import com.fasterxml.jackson.core.sym.FieldNameMatcher;
import com.fasterxml.jackson.core.type.ResolvedType;
<<<<<<<
throw _constructError("Numeric value (%s) out of range of `byte`", getText());
=======
throw new InputCoercionException(this,
String.format("Numeric value (%s) out of range of Java byte", getText()),
JsonToken.VALUE_NUMBER_INT, Byte.TYPE);
>>>>>>>
throw new InputCoercionException(this,
String.format("Numeric value (%s) out of range of `byte`", getText()),
JsonToken.VALUE_NUMBER_INT, Byte.TYPE);
<<<<<<<
throw _constructError("Numeric value (%s) out of range of `short`", getText());
=======
throw new InputCoercionException(this,
String.format("Numeric value (%s) out of range of Java short", getText()),
JsonToken.VALUE_NUMBER_INT, Short.TYPE);
>>>>>>>
throw new InputCoercionException(this,
String.format("Numeric value (%s) out of range of `short`", getText()),
JsonToken.VALUE_NUMBER_INT, Short.TYPE); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.