Set the priority to allow user changes

Set the priority to allow user changes

--- ms-engine/src/main/java/net/trajano/ms/engine/jaxrs/CommonObjectMapper.java
+++ ms-engine/src/main/java/net/trajano/ms/engine/jaxrs/CommonObjectMapper.java
@@ -1,5 +1,7 @@
 package net.trajano.ms.engine.jaxrs;

+import javax.annotation.Priority;
+import javax.ws.rs.Priorities;
 import javax.ws.rs.ext.ContextResolver;
 import javax.ws.rs.ext.Provider;

@@ -19,6 +21,7 @@
  */
 @Component
 @Provider
+@Priority(Priorities.ENTITY_CODER)
 public class CommonObjectMapper implements
     ContextResolver<ObjectMapper> {

<|original_code|>
package net.trajano.ms.engine.jaxrs;

import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

import org.springframework.stereotype.Component;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.vertx.core.json.Json;

/**
 * This {@link ObjectMapper} sets up Jackson for some common defaults. This
 * utilizes Vert.x mapper to support their json objects in addition it will
 * prevent null from being put into a resulting JSON.
 *
 * @author Archimedes Trajano
 */
@Component
@Provider
public class CommonObjectMapper implements
    ContextResolver<ObjectMapper> {

    private static final ObjectMapper MAPPER;
    static {
        MAPPER = Json.mapper.copy();
        MAPPER.setSerializationInclusion(Include.NON_NULL);
    }

    @Override
    public ObjectMapper getContext(final Class<?> clazz) {

        return MAPPER;
    }
}

<|edits_diff|>
--- ms-engine/src/main/java/net/trajano/ms/engine/jaxrs/CommonObjectMapper.java
+++ ms-engine/src/main/java/net/trajano/ms/engine/jaxrs/CommonObjectMapper.java
@@ -1,5 +1,7 @@
 package net.trajano.ms.engine.jaxrs;

+import javax.annotation.Priority;
+import javax.ws.rs.Priorities;
 import javax.ws.rs.ext.ContextResolver;
 import javax.ws.rs.ext.Provider;

<|current_version|>
package net.trajano.ms.engine.jaxrs;

import javax.annotation.Priority;
import javax.ws.rs.Priorities;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

import org.springframework.stereotype.Component;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.vertx.core.json.Json;

/**
 * This {@link ObjectMapper} sets up Jackson for some common defaults. This
 * utilizes Vert.x mapper to support their json objects in addition it will
 * prevent null from being put into a resulting JSON.
 *
 * @author Archimedes Trajano
 */
@Component
@Provider
public class CommonObjectMapper implements
    ContextResolver<ObjectMapper> {

    private static final ObjectMapper MAPPER;
    static {
        MAPPER = Json.mapper.copy();
        MAPPER.setSerializationInclusion(Include.NON_NULL);
    }

    @Override
    public ObjectMapper getContext(final Class<?> clazz) {

        return MAPPER;
    }
}

<|next_version|>
package net.trajano.ms.engine.jaxrs;

import javax.annotation.Priority;
import javax.ws.rs.Priorities;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

import org.springframework.stereotype.Component;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.vertx.core.json.Json;

/**
 * This {@link ObjectMapper} sets up Jackson for some common defaults. This
 * utilizes Vert.x mapper to support their json objects in addition it will
 * prevent null from being put into a resulting JSON.
 *
 * @author Archimedes Trajano
 */
@Component
@Provider
@Priority(Priorities.ENTITY_CODER)
public class CommonObjectMapper implements
    ContextResolver<ObjectMapper> {

    private static final ObjectMapper MAPPER;
    static {
        MAPPER = Json.mapper.copy();
        MAPPER.setSerializationInclusion(Include.NON_NULL);
    }

    @Override
    public ObjectMapper getContext(final Class<?> clazz) {

        return MAPPER;
    }
}


Add missing javadoc and block constructors

--- src/main/java/com/github/danzx/zekke/message/impl/MessageSourceFactory.java
+++ src/main/java/com/github/danzx/zekke/message/impl/MessageSourceFactory.java
@@ -18,10 +18,17 @@
 import com.github.danzx.zekke.message.MessageSource;

 /**
+ * Creates message sources.
+ *
  * @author Daniel Pedraza-Arcega
  */
 public class MessageSourceFactory {

+    private MessageSourceFactory() {
+        throw new AssertionError();
+    }
+
+    /** @return the default message source for this application. */
     public static MessageSource defaultSource() {
         return InstanceHolder.INSTANCE;
     }
@@ -29,5 +36,9 @@
     private static class InstanceHolder {
         private static final String MESSAGES_BASENAME = "com.github.danzx.zekke.Messages";
         private static final MessageSource INSTANCE = new DefaultMessageDecorator(new ResourceBundleMessageSource(MESSAGES_BASENAME));
+
+        private InstanceHolder() {
+            throw new AssertionError();
+        }
     }
 }

<|original_code|>
/*
 * Copyright 2017 Daniel Pedraza-Arcega
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.danzx.zekke.message.impl;

import com.github.danzx.zekke.message.MessageSource;

/**
 * @author Daniel Pedraza-Arcega
 */
public class MessageSourceFactory {

    public static MessageSource defaultSource() {
        return InstanceHolder.INSTANCE;
    }

    private static class InstanceHolder {
        private static final String MESSAGES_BASENAME = "com.github.danzx.zekke.Messages";
        private static final MessageSource INSTANCE = new DefaultMessageDecorator(new ResourceBundleMessageSource(MESSAGES_BASENAME));
    }
}

<|edits_diff|>
--- src/main/java/com/github/danzx/zekke/message/impl/MessageSourceFactory.java
+++ src/main/java/com/github/danzx/zekke/message/impl/MessageSourceFactory.java
@@ -18,10 +18,17 @@
 import com.github.danzx.zekke.message.MessageSource;

 /**
+ * Creates message sources.
+ *
  * @author Daniel Pedraza-Arcega
  */
 public class MessageSourceFactory {

+    private MessageSourceFactory() {
+        throw new AssertionError();
+    }
+
+    /** @return the default message source for this application. */
     public static MessageSource defaultSource() {
         return InstanceHolder.INSTANCE;
     }
<|current_version|>
/*
 * Copyright 2017 Daniel Pedraza-Arcega
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.danzx.zekke.message.impl;

import com.github.danzx.zekke.message.MessageSource;

/**
 * Creates message sources.
 *
 * @author Daniel Pedraza-Arcega
 */
public class MessageSourceFactory {

    private MessageSourceFactory() {
        throw new AssertionError();
    }

    /** @return the default message source for this application. */
    public static MessageSource defaultSource() {
        return InstanceHolder.INSTANCE;
    }

    private static class InstanceHolder {
        private static final String MESSAGES_BASENAME = "com.github.danzx.zekke.Messages";
        private static final MessageSource INSTANCE = new DefaultMessageDecorator(new ResourceBundleMessageSource(MESSAGES_BASENAME));
    }
}

<|next_version|>
/*
 * Copyright 2017 Daniel Pedraza-Arcega
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.danzx.zekke.message.impl;

import com.github.danzx.zekke.message.MessageSource;

/**
 * Creates message sources.
 *
 * @author Daniel Pedraza-Arcega
 */
public class MessageSourceFactory {

    private MessageSourceFactory() {
        throw new AssertionError();
    }

    /** @return the default message source for this application. */
    public static MessageSource defaultSource() {
        return InstanceHolder.INSTANCE;
    }

    private static class InstanceHolder {
        private static final String MESSAGES_BASENAME = "com.github.danzx.zekke.Messages";
        private static final MessageSource INSTANCE = new DefaultMessageDecorator(new ResourceBundleMessageSource(MESSAGES_BASENAME));

        private InstanceHolder() {
            throw new AssertionError();
        }
    }
}


Make CXF serialize date type in pre-defined format.

--- core/src/main/java/com/zyeeda/framework/cxf/JacksonJsonProvider.java
+++ core/src/main/java/com/zyeeda/framework/cxf/JacksonJsonProvider.java
@@ -1,7 +1,10 @@
 package com.zyeeda.framework.cxf;
+
+import java.text.SimpleDateFormat;

 import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
 import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 import org.codehaus.jackson.map.SerializationConfig.Feature;

@@ -12,8 +15,15 @@
 		if (m == null) {
 			m = this._mapperConfig.getDefaultMapper();
 		}
+		SerializationConfig sc = m.getSerializationConfig().withDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
+		sc.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
+		sc.set(Feature.FAIL_ON_EMPTY_BEANS, false);
+		m.setSerializationConfig(sc);
+		/*
 		m.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
 		m.configure(Feature.FAIL_ON_EMPTY_BEANS, false);
+		m.setSerializationConfig(m.getSerializationConfig().withDateFormat(new SimpleDateFormat("yyyy-MM-dd")));
+		*/
 	}

 }

<|original_code|>
package com.zyeeda.framework.cxf;

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.SerializationConfig.Feature;

public class JacksonJsonProvider extends JacksonJaxbJsonProvider {

	public JacksonJsonProvider() {
		ObjectMapper m = this._mapperConfig.getConfiguredMapper();
		if (m == null) {
			m = this._mapperConfig.getDefaultMapper();
		}
		m.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
		m.configure(Feature.FAIL_ON_EMPTY_BEANS, false);
	}

}

<|edits_diff|>
--- core/src/main/java/com/zyeeda/framework/cxf/JacksonJsonProvider.java
+++ core/src/main/java/com/zyeeda/framework/cxf/JacksonJsonProvider.java
@@ -1,7 +1,10 @@
 package com.zyeeda.framework.cxf;
+
+import java.text.SimpleDateFormat;

 import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
 import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 import org.codehaus.jackson.map.SerializationConfig.Feature;

@@ -12,6 +15,11 @@
 		if (m == null) {
 			m = this._mapperConfig.getDefaultMapper();
 		}
+		SerializationConfig sc = m.getSerializationConfig().withDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
+		sc.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
+		sc.set(Feature.FAIL_ON_EMPTY_BEANS, false);
+		m.setSerializationConfig(sc);
+		/*
 		m.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
 		m.configure(Feature.FAIL_ON_EMPTY_BEANS, false);
 	}
<|current_version|>
package com.zyeeda.framework.cxf;

import java.text.SimpleDateFormat;

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.SerializationConfig.Feature;

public class JacksonJsonProvider extends JacksonJaxbJsonProvider {

	public JacksonJsonProvider() {
		ObjectMapper m = this._mapperConfig.getConfiguredMapper();
		if (m == null) {
			m = this._mapperConfig.getDefaultMapper();
		}
		SerializationConfig sc = m.getSerializationConfig().withDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
		sc.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
		sc.set(Feature.FAIL_ON_EMPTY_BEANS, false);
		m.setSerializationConfig(sc);
		/*
		m.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
		m.configure(Feature.FAIL_ON_EMPTY_BEANS, false);
	}

}

<|next_version|>
package com.zyeeda.framework.cxf;

import java.text.SimpleDateFormat;

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.SerializationConfig.Feature;

public class JacksonJsonProvider extends JacksonJaxbJsonProvider {

	public JacksonJsonProvider() {
		ObjectMapper m = this._mapperConfig.getConfiguredMapper();
		if (m == null) {
			m = this._mapperConfig.getDefaultMapper();
		}
		SerializationConfig sc = m.getSerializationConfig().withDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
		sc.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
		sc.set(Feature.FAIL_ON_EMPTY_BEANS, false);
		m.setSerializationConfig(sc);
		/*
		m.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
		m.configure(Feature.FAIL_ON_EMPTY_BEANS, false);
		m.setSerializationConfig(m.getSerializationConfig().withDateFormat(new SimpleDateFormat("yyyy-MM-dd")));
		*/
	}

}


Add addAll method for keyboardrow

Add addAll method for keyboardrow

--- telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/KeyboardRow.java
+++ telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/KeyboardRow.java
@@ -4,6 +4,7 @@
 import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;

 import java.util.ArrayList;
+import java.util.List;

 /**
  * @author Ruben Bermudez
@@ -18,6 +19,10 @@

     public void add(int index, String text) {
         super.add(index, new KeyboardButton(text));
+    }
+
+    public void addAll(List<String> buttonNames) {
+        buttonNames.forEach(KeyboardButton::new);
     }

     public boolean contains(String text) {

<|original_code|>
package org.telegram.telegrambots.meta.api.objects.replykeyboard.buttons;

import org.telegram.telegrambots.meta.api.interfaces.Validable;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;

import java.util.ArrayList;

/**
 * @author Ruben Bermudez
 * @version 1.0
 * @brief Row for ReplyKeyBoardMarkup
 * @date 10 of April of 2016
 */
public class KeyboardRow extends ArrayList<KeyboardButton> implements Validable {
    public boolean add(String text) {
        return super.add(new KeyboardButton(text));
    }

    public void add(int index, String text) {
        super.add(index, new KeyboardButton(text));
    }

    public boolean contains(String text) {
        return super.contains(new KeyboardButton(text));
    }

    public int lastIndexOf(String text) {
        return super.lastIndexOf(new KeyboardButton(text));
    }

    public int indexOf(String text) {
        return super.indexOf(new KeyboardButton(text));
    }

    public KeyboardButton set(int index, String text) {
        return super.set(index, new KeyboardButton(text));
    }

    public boolean remove(String text) {
        return super.remove(new KeyboardButton(text));
    }

    @Override
    public void validate() throws TelegramApiValidationException {
        for (KeyboardButton keyboardButton : this) {
            keyboardButton.validate();
        }
    }
}

<|edits_diff|>
--- telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/KeyboardRow.java
+++ telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/KeyboardRow.java
@@ -4,6 +4,7 @@
 import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;

 import java.util.ArrayList;
+import java.util.List;

 /**
  * @author Ruben Bermudez
<|current_version|>
package org.telegram.telegrambots.meta.api.objects.replykeyboard.buttons;

import org.telegram.telegrambots.meta.api.interfaces.Validable;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Ruben Bermudez
 * @version 1.0
 * @brief Row for ReplyKeyBoardMarkup
 * @date 10 of April of 2016
 */
public class KeyboardRow extends ArrayList<KeyboardButton> implements Validable {
    public boolean add(String text) {
        return super.add(new KeyboardButton(text));
    }

    public void add(int index, String text) {
        super.add(index, new KeyboardButton(text));
    }

    public boolean contains(String text) {
        return super.contains(new KeyboardButton(text));
    }

    public int lastIndexOf(String text) {
        return super.lastIndexOf(new KeyboardButton(text));
    }

    public int indexOf(String text) {
        return super.indexOf(new KeyboardButton(text));
    }

    public KeyboardButton set(int index, String text) {
        return super.set(index, new KeyboardButton(text));
    }

    public boolean remove(String text) {
        return super.remove(new KeyboardButton(text));
    }

    @Override
    public void validate() throws TelegramApiValidationException {
        for (KeyboardButton keyboardButton : this) {
            keyboardButton.validate();
        }
    }
}

<|next_version|>
package org.telegram.telegrambots.meta.api.objects.replykeyboard.buttons;

import org.telegram.telegrambots.meta.api.interfaces.Validable;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Ruben Bermudez
 * @version 1.0
 * @brief Row for ReplyKeyBoardMarkup
 * @date 10 of April of 2016
 */
public class KeyboardRow extends ArrayList<KeyboardButton> implements Validable {
    public boolean add(String text) {
        return super.add(new KeyboardButton(text));
    }

    public void add(int index, String text) {
        super.add(index, new KeyboardButton(text));
    }

    public void addAll(List<String> buttonNames) {
        buttonNames.forEach(KeyboardButton::new);
    }

    public boolean contains(String text) {
        return super.contains(new KeyboardButton(text));
    }

    public int lastIndexOf(String text) {
        return super.lastIndexOf(new KeyboardButton(text));
    }

    public int indexOf(String text) {
        return super.indexOf(new KeyboardButton(text));
    }

    public KeyboardButton set(int index, String text) {
        return super.set(index, new KeyboardButton(text));
    }

    public boolean remove(String text) {
        return super.remove(new KeyboardButton(text));
    }

    @Override
    public void validate() throws TelegramApiValidationException {
        for (KeyboardButton keyboardButton : this) {
            keyboardButton.validate();
        }
    }
}


Add Preconditions NPE check to pool release method

Reviewed By: oprisnik

Differential Revision: D14706933

fbshipit-source-id: 5ef5a1dbee73ce1ec11533efeb61845fa15a61a5

--- imagepipeline/src/main/java/com/facebook/imagepipeline/memory/DummyBitmapPool.java
+++ imagepipeline/src/main/java/com/facebook/imagepipeline/memory/DummyBitmapPool.java
@@ -7,6 +7,7 @@
 package com.facebook.imagepipeline.memory;

 import android.graphics.Bitmap;
+import com.facebook.common.internal.Preconditions;
 import com.facebook.common.memory.MemoryTrimType;
 import com.facebook.imageutils.BitmapUtil;

@@ -27,6 +28,7 @@

   @Override
   public void release(Bitmap value) {
+    Preconditions.checkNotNull(value);
     value.recycle();
   }
 }

<|original_code|>
/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
package com.facebook.imagepipeline.memory;

import android.graphics.Bitmap;
import com.facebook.common.memory.MemoryTrimType;
import com.facebook.imageutils.BitmapUtil;

public class DummyBitmapPool implements BitmapPool {

  @Override
  public void trim(MemoryTrimType trimType) {
    // nop
  }

  @Override
  public Bitmap get(int size) {
    return Bitmap.createBitmap(
        1,
        (int) Math.ceil(size / (double) BitmapUtil.RGB_565_BYTES_PER_PIXEL),
        Bitmap.Config.RGB_565);
  }

  @Override
  public void release(Bitmap value) {
    value.recycle();
  }
}

<|edits_diff|>
--- imagepipeline/src/main/java/com/facebook/imagepipeline/memory/DummyBitmapPool.java
+++ imagepipeline/src/main/java/com/facebook/imagepipeline/memory/DummyBitmapPool.java
@@ -7,6 +7,7 @@
 package com.facebook.imagepipeline.memory;

 import android.graphics.Bitmap;
+import com.facebook.common.internal.Preconditions;
 import com.facebook.common.memory.MemoryTrimType;
 import com.facebook.imageutils.BitmapUtil;

<|current_version|>
/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
package com.facebook.imagepipeline.memory;

import android.graphics.Bitmap;
import com.facebook.common.internal.Preconditions;
import com.facebook.common.memory.MemoryTrimType;
import com.facebook.imageutils.BitmapUtil;

public class DummyBitmapPool implements BitmapPool {

  @Override
  public void trim(MemoryTrimType trimType) {
    // nop
  }

  @Override
  public Bitmap get(int size) {
    return Bitmap.createBitmap(
        1,
        (int) Math.ceil(size / (double) BitmapUtil.RGB_565_BYTES_PER_PIXEL),
        Bitmap.Config.RGB_565);
  }

  @Override
  public void release(Bitmap value) {
    value.recycle();
  }
}

<|next_version|>
/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
package com.facebook.imagepipeline.memory;

import android.graphics.Bitmap;
import com.facebook.common.internal.Preconditions;
import com.facebook.common.memory.MemoryTrimType;
import com.facebook.imageutils.BitmapUtil;

public class DummyBitmapPool implements BitmapPool {

  @Override
  public void trim(MemoryTrimType trimType) {
    // nop
  }

  @Override
  public Bitmap get(int size) {
    return Bitmap.createBitmap(
        1,
        (int) Math.ceil(size / (double) BitmapUtil.RGB_565_BYTES_PER_PIXEL),
        Bitmap.Config.RGB_565);
  }

  @Override
  public void release(Bitmap value) {
    Preconditions.checkNotNull(value);
    value.recycle();
  }
}


Add content types to POST

Add content types to POST

--- src/main/java/org/cryptonit/cloud/timestamping/Application.java
+++ src/main/java/org/cryptonit/cloud/timestamping/Application.java
@@ -2,8 +2,10 @@

 import java.io.IOException;
 import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
@@ -24,6 +26,8 @@
     private static TimestampingAuthorityFactory tsaFactory = null;

     @POST
+    @Consumes("application/timestamp-query")
+    @Produces("application/timestamp-reply")
     public Response timestamp(@Context HttpServletRequest request,
             @Context HttpHeaders headers) throws IOException, TSPException {
         TimeStampRequest tsq = new TimeStampRequest(request.getInputStream());

<|original_code|>
package org.cryptonit.cloud.timestamping;

import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import org.bouncycastle.tsp.TSPException;
import org.bouncycastle.tsp.TimeStampRequest;
import org.bouncycastle.tsp.TimeStampResponse;
import org.cryptonit.cloud.interfaces.TimestampingAuthority;
import org.cryptonit.cloud.interfaces.TimestampingAuthorityFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Mathias Brossard
 */
@Path("/timestamp")
public class Application {
    private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);
    private static TimestampingAuthorityFactory tsaFactory = null;

    @POST
    public Response timestamp(@Context HttpServletRequest request,
            @Context HttpHeaders headers) throws IOException, TSPException {
        TimeStampRequest tsq = new TimeStampRequest(request.getInputStream());

        TimestampingAuthority tsa = tsaFactory.getTimestampingAuthority(request.getServerName());
        TimeStampResponse tsr = tsa.timestamp(tsq);

        return Response.ok(tsr.getEncoded()).build();
    }

    public static void setTimestampingAuthorityFactory(TimestampingAuthorityFactory factory) {
        tsaFactory = factory;
    }
}

<|edits_diff|>
--- src/main/java/org/cryptonit/cloud/timestamping/Application.java
+++ src/main/java/org/cryptonit/cloud/timestamping/Application.java
@@ -2,8 +2,10 @@

 import java.io.IOException;
 import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
<|current_version|>
package org.cryptonit.cloud.timestamping;

import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import org.bouncycastle.tsp.TSPException;
import org.bouncycastle.tsp.TimeStampRequest;
import org.bouncycastle.tsp.TimeStampResponse;
import org.cryptonit.cloud.interfaces.TimestampingAuthority;
import org.cryptonit.cloud.interfaces.TimestampingAuthorityFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Mathias Brossard
 */
@Path("/timestamp")
public class Application {
    private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);
    private static TimestampingAuthorityFactory tsaFactory = null;

    @POST
    public Response timestamp(@Context HttpServletRequest request,
            @Context HttpHeaders headers) throws IOException, TSPException {
        TimeStampRequest tsq = new TimeStampRequest(request.getInputStream());

        TimestampingAuthority tsa = tsaFactory.getTimestampingAuthority(request.getServerName());
        TimeStampResponse tsr = tsa.timestamp(tsq);

        return Response.ok(tsr.getEncoded()).build();
    }

    public static void setTimestampingAuthorityFactory(TimestampingAuthorityFactory factory) {
        tsaFactory = factory;
    }
}

<|next_version|>
package org.cryptonit.cloud.timestamping;

import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import org.bouncycastle.tsp.TSPException;
import org.bouncycastle.tsp.TimeStampRequest;
import org.bouncycastle.tsp.TimeStampResponse;
import org.cryptonit.cloud.interfaces.TimestampingAuthority;
import org.cryptonit.cloud.interfaces.TimestampingAuthorityFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Mathias Brossard
 */
@Path("/timestamp")
public class Application {
    private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);
    private static TimestampingAuthorityFactory tsaFactory = null;

    @POST
    @Consumes("application/timestamp-query")
    @Produces("application/timestamp-reply")
    public Response timestamp(@Context HttpServletRequest request,
            @Context HttpHeaders headers) throws IOException, TSPException {
        TimeStampRequest tsq = new TimeStampRequest(request.getInputStream());

        TimestampingAuthority tsa = tsaFactory.getTimestampingAuthority(request.getServerName());
        TimeStampResponse tsr = tsa.timestamp(tsq);

        return Response.ok(tsr.getEncoded()).build();
    }

    public static void setTimestampingAuthorityFactory(TimestampingAuthorityFactory factory) {
        tsaFactory = factory;
    }
}


Fix issue with accent escaped in some xml response

--- src/main/java/fr/insee/rmes/utils/CustomXmlEscapingWriterFactory.java
+++ src/main/java/fr/insee/rmes/utils/CustomXmlEscapingWriterFactory.java
@@ -4,6 +4,7 @@
 import java.io.OutputStream;
 import java.io.Writer;

+import org.apache.commons.text.StringEscapeUtils;
 import org.codehaus.stax2.io.EscapingWriterFactory;

 public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
@@ -36,6 +37,7 @@

 	private String escapeHtml(String s) {
+		 s = StringEscapeUtils.unescapeHtml4(s);
 		 return s.replace("&", "&")
 				 .replace(">", ">")
 				 .replace("<", "<")

<|original_code|>
package fr.insee.rmes.utils;

import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;

import org.codehaus.stax2.io.EscapingWriterFactory;

public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {

public Writer createEscapingWriterFor(final Writer out, String enc) {
    return new Writer(){
        @Override
        public void write(char[] cbuf, int off, int len) throws IOException {
        	//WARN : the cbuf contains only part of the string = can't validate xml here
            String val = "";
            for (int i = off; i < len; i++) {
                val += cbuf[i];
            }
            String escapedStr = XmlUtils.encodeXml(escapeHtml(val)); //encode manually some xml tags
            out.write(escapedStr);
        }

        @Override
        public void flush() throws IOException {
            out.flush();
        }

        @Override
        public void close() throws IOException {
            out.close();
        }
      };
    }

	private String escapeHtml(String s) {
		 return s.replace("&", "&")
				 .replace(">", ">")
				 .replace("<", "<")
				 .replace("\"", """);
	}

    public Writer createEscapingWriterFor(OutputStream out, String enc) {
        throw new IllegalArgumentException("not supported");
    }
}
<|edits_diff|>
--- src/main/java/fr/insee/rmes/utils/CustomXmlEscapingWriterFactory.java
+++ src/main/java/fr/insee/rmes/utils/CustomXmlEscapingWriterFactory.java
@@ -4,6 +4,7 @@
 import java.io.OutputStream;
 import java.io.Writer;

+import org.apache.commons.text.StringEscapeUtils;
 import org.codehaus.stax2.io.EscapingWriterFactory;

 public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
<|current_version|>
package fr.insee.rmes.utils;

import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;

import org.apache.commons.text.StringEscapeUtils;
import org.codehaus.stax2.io.EscapingWriterFactory;

public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {

public Writer createEscapingWriterFor(final Writer out, String enc) {
    return new Writer(){
        @Override
        public void write(char[] cbuf, int off, int len) throws IOException {
        	//WARN : the cbuf contains only part of the string = can't validate xml here
            String val = "";
            for (int i = off; i < len; i++) {
                val += cbuf[i];
            }
            String escapedStr = XmlUtils.encodeXml(escapeHtml(val)); //encode manually some xml tags
            out.write(escapedStr);
        }

        @Override
        public void flush() throws IOException {
            out.flush();
        }

        @Override
        public void close() throws IOException {
            out.close();
        }
      };
    }

	private String escapeHtml(String s) {
		 return s.replace("&", "&")
				 .replace(">", ">")
				 .replace("<", "<")
				 .replace("\"", """);
	}

    public Writer createEscapingWriterFor(OutputStream out, String enc) {
        throw new IllegalArgumentException("not supported");
    }
}
<|next_version|>
package fr.insee.rmes.utils;

import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;

import org.apache.commons.text.StringEscapeUtils;
import org.codehaus.stax2.io.EscapingWriterFactory;

public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {

public Writer createEscapingWriterFor(final Writer out, String enc) {
    return new Writer(){
        @Override
        public void write(char[] cbuf, int off, int len) throws IOException {
        	//WARN : the cbuf contains only part of the string = can't validate xml here
            String val = "";
            for (int i = off; i < len; i++) {
                val += cbuf[i];
            }
            String escapedStr = XmlUtils.encodeXml(escapeHtml(val)); //encode manually some xml tags
            out.write(escapedStr);
        }

        @Override
        public void flush() throws IOException {
            out.flush();
        }

        @Override
        public void close() throws IOException {
            out.close();
        }
      };
    }

	private String escapeHtml(String s) {
		 s = StringEscapeUtils.unescapeHtml4(s);
		 return s.replace("&", "&")
				 .replace(">", ">")
				 .replace("<", "<")
				 .replace("\"", """);
	}

    public Writer createEscapingWriterFor(OutputStream out, String enc) {
        throw new IllegalArgumentException("not supported");
    }
}


Mark middleware class as nullsafe

Mark middleware class as nullsafe

Reviewed By: defHLT

Differential Revision: D24256184

fbshipit-source-id: cf0342d0ed800576ce0cad9a37bcd96d8483ae4a

--- middleware/src/main/java/com/facebook/fresco/middleware/MiddlewareUtils.java
+++ middleware/src/main/java/com/facebook/fresco/middleware/MiddlewareUtils.java
@@ -4,9 +4,11 @@
 import android.graphics.Rect;
 import android.net.Uri;
 import com.facebook.fresco.ui.common.ControllerListener2.Extras;
+import com.facebook.infer.annotation.Nullsafe;
 import java.util.Map;
 import javax.annotation.Nullable;

+@Nullsafe(Nullsafe.Mode.STRICT)
 public class MiddlewareUtils {

   public static Extras obtainExtras(

<|original_code|>
package com.facebook.fresco.middleware;

import android.graphics.PointF;
import android.graphics.Rect;
import android.net.Uri;
import com.facebook.fresco.ui.common.ControllerListener2.Extras;
import java.util.Map;
import javax.annotation.Nullable;

public class MiddlewareUtils {

  public static Extras obtainExtras(
      Map<String, Object> componentAttribution,
      Map<String, Object> shortcutAttribution,
      @Nullable Map<String, Object> dataSourceExtras,
      @Nullable Rect viewportDimensions,
      @Nullable String scaleType,
      @Nullable PointF focusPoint,
      @Nullable Map<String, Object> imageExtras,
      @Nullable Object callerContext,
      @Nullable Uri mainUri) {
    final Extras extras = new Extras();

    if (viewportDimensions != null) {
      extras.viewportWidth = viewportDimensions.width();
      extras.viewportHeight = viewportDimensions.height();
    }
    extras.scaleType = scaleType;
    if (focusPoint != null) {
      extras.focusX = focusPoint.x;
      extras.focusY = focusPoint.y;
    }

    extras.callerContext = callerContext;
    extras.mainUri = mainUri;

    extras.datasourceExtras = dataSourceExtras;
    extras.imageExtras = imageExtras;
    extras.shortcutExtras = shortcutAttribution;
    extras.componentExtras = componentAttribution;

    return extras;
  }
}

<|edits_diff|>
--- middleware/src/main/java/com/facebook/fresco/middleware/MiddlewareUtils.java
+++ middleware/src/main/java/com/facebook/fresco/middleware/MiddlewareUtils.java
@@ -4,6 +4,7 @@
 import android.graphics.Rect;
 import android.net.Uri;
 import com.facebook.fresco.ui.common.ControllerListener2.Extras;
+import com.facebook.infer.annotation.Nullsafe;
 import java.util.Map;
 import javax.annotation.Nullable;

<|current_version|>
package com.facebook.fresco.middleware;

import android.graphics.PointF;
import android.graphics.Rect;
import android.net.Uri;
import com.facebook.fresco.ui.common.ControllerListener2.Extras;
import com.facebook.infer.annotation.Nullsafe;
import java.util.Map;
import javax.annotation.Nullable;

public class MiddlewareUtils {

  public static Extras obtainExtras(
      Map<String, Object> componentAttribution,
      Map<String, Object> shortcutAttribution,
      @Nullable Map<String, Object> dataSourceExtras,
      @Nullable Rect viewportDimensions,
      @Nullable String scaleType,
      @Nullable PointF focusPoint,
      @Nullable Map<String, Object> imageExtras,
      @Nullable Object callerContext,
      @Nullable Uri mainUri) {
    final Extras extras = new Extras();

    if (viewportDimensions != null) {
      extras.viewportWidth = viewportDimensions.width();
      extras.viewportHeight = viewportDimensions.height();
    }
    extras.scaleType = scaleType;
    if (focusPoint != null) {
      extras.focusX = focusPoint.x;
      extras.focusY = focusPoint.y;
    }

    extras.callerContext = callerContext;
    extras.mainUri = mainUri;

    extras.datasourceExtras = dataSourceExtras;
    extras.imageExtras = imageExtras;
    extras.shortcutExtras = shortcutAttribution;
    extras.componentExtras = componentAttribution;

    return extras;
  }
}

<|next_version|>
package com.facebook.fresco.middleware;

import android.graphics.PointF;
import android.graphics.Rect;
import android.net.Uri;
import com.facebook.fresco.ui.common.ControllerListener2.Extras;
import com.facebook.infer.annotation.Nullsafe;
import java.util.Map;
import javax.annotation.Nullable;

@Nullsafe(Nullsafe.Mode.STRICT)
public class MiddlewareUtils {

  public static Extras obtainExtras(
      Map<String, Object> componentAttribution,
      Map<String, Object> shortcutAttribution,
      @Nullable Map<String, Object> dataSourceExtras,
      @Nullable Rect viewportDimensions,
      @Nullable String scaleType,
      @Nullable PointF focusPoint,
      @Nullable Map<String, Object> imageExtras,
      @Nullable Object callerContext,
      @Nullable Uri mainUri) {
    final Extras extras = new Extras();

    if (viewportDimensions != null) {
      extras.viewportWidth = viewportDimensions.width();
      extras.viewportHeight = viewportDimensions.height();
    }
    extras.scaleType = scaleType;
    if (focusPoint != null) {
      extras.focusX = focusPoint.x;
      extras.focusY = focusPoint.y;
    }

    extras.callerContext = callerContext;
    extras.mainUri = mainUri;

    extras.datasourceExtras = dataSourceExtras;
    extras.imageExtras = imageExtras;
    extras.shortcutExtras = shortcutAttribution;
    extras.componentExtras = componentAttribution;

    return extras;
  }
}


Add method to fetch pending events.

Add method to fetch pending events.

--- src/main/java/au/gov/ga/geodesy/igssitelog/domain/model/EventRepository.java
+++ src/main/java/au/gov/ga/geodesy/igssitelog/domain/model/EventRepository.java
@@ -1,7 +1,14 @@
 package au.gov.ga.geodesy.igssitelog.domain.model;

+import java.util.List;
+
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+
 import au.gov.ga.geodesy.domain.model.Event;

 public interface EventRepository extends JpaRepository<Event, Integer> {
+
+    @Query("select e from Event e where e.timeHandled is null")
+    List<Event> getPendingEvents();
 }

<|original_code|>
package au.gov.ga.geodesy.igssitelog.domain.model;

import org.springframework.data.jpa.repository.JpaRepository;
import au.gov.ga.geodesy.domain.model.Event;

public interface EventRepository extends JpaRepository<Event, Integer> {
}

<|edits_diff|>
--- src/main/java/au/gov/ga/geodesy/igssitelog/domain/model/EventRepository.java
+++ src/main/java/au/gov/ga/geodesy/igssitelog/domain/model/EventRepository.java
@@ -1,6 +1,10 @@
 package au.gov.ga.geodesy.igssitelog.domain.model;

+import java.util.List;
+
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+
 import au.gov.ga.geodesy.domain.model.Event;

 public interface EventRepository extends JpaRepository<Event, Integer> {
<|current_version|>
package au.gov.ga.geodesy.igssitelog.domain.model;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import au.gov.ga.geodesy.domain.model.Event;

public interface EventRepository extends JpaRepository<Event, Integer> {
}

<|next_version|>
package au.gov.ga.geodesy.igssitelog.domain.model;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import au.gov.ga.geodesy.domain.model.Event;

public interface EventRepository extends JpaRepository<Event, Integer> {

    @Query("select e from Event e where e.timeHandled is null")
    List<Event> getPendingEvents();
}


Include console command output in logs.

Include console command output in logs.

Signed-off-by: Ross Allan <ca2c77e14df1e7ee673215c1ef658354e220f471@gmail.com>

--- src/common/me/nallar/tickthreading/minecraft/commands/Command.java
+++ src/common/me/nallar/tickthreading/minecraft/commands/Command.java
@@ -4,11 +4,17 @@
 import java.util.Arrays;
 import java.util.List;

+import me.nallar.tickthreading.Log;
 import net.minecraft.command.CommandBase;
 import net.minecraft.command.ICommandSender;
+import net.minecraft.server.MinecraftServer;

 public abstract class Command extends CommandBase {
 	public static void sendChat(ICommandSender commandSender, String message) {
+		if (commandSender == MinecraftServer.getServer()) {
+			Log.info('\n' + message);
+			return;
+		}
 		while (message != null) {
 			int nlIndex = message.indexOf('\n');
 			String sent;

<|original_code|>
package me.nallar.tickthreading.minecraft.commands;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;

public abstract class Command extends CommandBase {
	public static void sendChat(ICommandSender commandSender, String message) {
		while (message != null) {
			int nlIndex = message.indexOf('\n');
			String sent;
			if (nlIndex == -1) {
				sent = message;
				message = null;
			} else {
				sent = message.substring(0, nlIndex);
				message = message.substring(nlIndex + 1);
			}
			commandSender.sendChatToPlayer(sent);
		}
	}

	@Override
	public final void processCommand(ICommandSender commandSender, String... argumentsArray) {
		processCommand(commandSender, new ArrayList<String>(Arrays.asList(argumentsArray)));
	}

	protected abstract void processCommand(ICommandSender commandSender, List<String> arguments);
}

<|edits_diff|>
--- src/common/me/nallar/tickthreading/minecraft/commands/Command.java
+++ src/common/me/nallar/tickthreading/minecraft/commands/Command.java
@@ -4,8 +4,10 @@
 import java.util.Arrays;
 import java.util.List;

+import me.nallar.tickthreading.Log;
 import net.minecraft.command.CommandBase;
 import net.minecraft.command.ICommandSender;
+import net.minecraft.server.MinecraftServer;

 public abstract class Command extends CommandBase {
 	public static void sendChat(ICommandSender commandSender, String message) {
<|current_version|>
package me.nallar.tickthreading.minecraft.commands;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import me.nallar.tickthreading.Log;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;

public abstract class Command extends CommandBase {
	public static void sendChat(ICommandSender commandSender, String message) {
		while (message != null) {
			int nlIndex = message.indexOf('\n');
			String sent;
			if (nlIndex == -1) {
				sent = message;
				message = null;
			} else {
				sent = message.substring(0, nlIndex);
				message = message.substring(nlIndex + 1);
			}
			commandSender.sendChatToPlayer(sent);
		}
	}

	@Override
	public final void processCommand(ICommandSender commandSender, String... argumentsArray) {
		processCommand(commandSender, new ArrayList<String>(Arrays.asList(argumentsArray)));
	}

	protected abstract void processCommand(ICommandSender commandSender, List<String> arguments);
}

<|next_version|>
package me.nallar.tickthreading.minecraft.commands;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import me.nallar.tickthreading.Log;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;

public abstract class Command extends CommandBase {
	public static void sendChat(ICommandSender commandSender, String message) {
		if (commandSender == MinecraftServer.getServer()) {
			Log.info('\n' + message);
			return;
		}
		while (message != null) {
			int nlIndex = message.indexOf('\n');
			String sent;
			if (nlIndex == -1) {
				sent = message;
				message = null;
			} else {
				sent = message.substring(0, nlIndex);
				message = message.substring(nlIndex + 1);
			}
			commandSender.sendChatToPlayer(sent);
		}
	}

	@Override
	public final void processCommand(ICommandSender commandSender, String... argumentsArray) {
		processCommand(commandSender, new ArrayList<String>(Arrays.asList(argumentsArray)));
	}

	protected abstract void processCommand(ICommandSender commandSender, List<String> arguments);
}


Add missing DEPLOYMENT, DEPLOYMENT_STATUS, RELEASE and STATUS events.

--- src/main/java/org/kohsuke/github/GHEvent.java
+++ src/main/java/org/kohsuke/github/GHEvent.java
@@ -12,6 +12,8 @@
     COMMIT_COMMENT,
     CREATE,
     DELETE,
+    DEPLOYMENT,
+    DEPLOYMENT_STATUS,
     DOWNLOAD,
     FOLLOW,
     FORK,
@@ -25,6 +27,8 @@
     PULL_REQUEST,
     PULL_REQUEST_REVIEW_COMMENT,
     PUSH,
+    RELEASE,
+    STATUS,
     TEAM_ADD,
     WATCH
 }

<|original_code|>
package org.kohsuke.github;

/**
 * Hook event type.
 *
 * See http://developer.github.com/v3/events/types/
 *
 * @author Kohsuke Kawaguchi
 * @see GHEventInfo
 */
public enum GHEvent {
    COMMIT_COMMENT,
    CREATE,
    DELETE,
    DOWNLOAD,
    FOLLOW,
    FORK,
    FORK_APPLY,
    GIST,
    GOLLUM,
    ISSUE_COMMENT,
    ISSUES,
    MEMBER,
    PUBLIC,
    PULL_REQUEST,
    PULL_REQUEST_REVIEW_COMMENT,
    PUSH,
    TEAM_ADD,
    WATCH
}

<|edits_diff|>
--- src/main/java/org/kohsuke/github/GHEvent.java
+++ src/main/java/org/kohsuke/github/GHEvent.java
@@ -12,6 +12,8 @@
     COMMIT_COMMENT,
     CREATE,
     DELETE,
+    DEPLOYMENT,
+    DEPLOYMENT_STATUS,
     DOWNLOAD,
     FOLLOW,
     FORK,
<|current_version|>
package org.kohsuke.github;

/**
 * Hook event type.
 *
 * See http://developer.github.com/v3/events/types/
 *
 * @author Kohsuke Kawaguchi
 * @see GHEventInfo
 */
public enum GHEvent {
    COMMIT_COMMENT,
    CREATE,
    DELETE,
    DEPLOYMENT,
    DEPLOYMENT_STATUS,
    DOWNLOAD,
    FOLLOW,
    FORK,
    FORK_APPLY,
    GIST,
    GOLLUM,
    ISSUE_COMMENT,
    ISSUES,
    MEMBER,
    PUBLIC,
    PULL_REQUEST,
    PULL_REQUEST_REVIEW_COMMENT,
    PUSH,
    TEAM_ADD,
    WATCH
}

<|next_version|>
package org.kohsuke.github;

/**
 * Hook event type.
 *
 * See http://developer.github.com/v3/events/types/
 *
 * @author Kohsuke Kawaguchi
 * @see GHEventInfo
 */
public enum GHEvent {
    COMMIT_COMMENT,
    CREATE,
    DELETE,
    DEPLOYMENT,
    DEPLOYMENT_STATUS,
    DOWNLOAD,
    FOLLOW,
    FORK,
    FORK_APPLY,
    GIST,
    GOLLUM,
    ISSUE_COMMENT,
    ISSUES,
    MEMBER,
    PUBLIC,
    PULL_REQUEST,
    PULL_REQUEST_REVIEW_COMMENT,
    PUSH,
    RELEASE,
    STATUS,
    TEAM_ADD,
    WATCH
}


Allow passing in box client when intializing OauthWebView

--- BoxJavaLibraryV2/src/com/box/boxjavalibv2/authorization/IAuthFlowUI.java
+++ BoxJavaLibraryV2/src/com/box/boxjavalibv2/authorization/IAuthFlowUI.java
@@ -1,4 +1,6 @@
 package com.box.boxjavalibv2.authorization;
+
+import com.box.boxjavalibv2.BoxClient;

 /**
  * Interface for UI to generate auth.
@@ -23,4 +25,6 @@
      */
     void initializeAuthFlow(final Object applicationContext, String clientId, String clientSecret, String redirectUrl);

+    void initializeAuthFlow(Object activity, String clientId, String clientSecret, String redirectUrl, BoxClient boxClient);
+
 }

<|original_code|>
package com.box.boxjavalibv2.authorization;

/**
 * Interface for UI to generate auth.
 */
public interface IAuthFlowUI {

    /**
     * Authenticate.
     *
     * @param listener
     *            listener listening to events/messages fired during authentication process.
     */
    void authenticate(IAuthFlowListener listener);

    /**
     * Initialize the UI for OAuth flow. This needs to be called everytime before starting an auth flow.
     */
    void initializeAuthFlow(final Object applicationContext, String clientId, String clientSecret);

    /**
     * Initialize the UI for OAuth flow. This needs to be called everytime before starting an auth flow.
     */
    void initializeAuthFlow(final Object applicationContext, String clientId, String clientSecret, String redirectUrl);

}

<|edits_diff|>
--- BoxJavaLibraryV2/src/com/box/boxjavalibv2/authorization/IAuthFlowUI.java
+++ BoxJavaLibraryV2/src/com/box/boxjavalibv2/authorization/IAuthFlowUI.java
@@ -1,4 +1,6 @@
 package com.box.boxjavalibv2.authorization;
+
+import com.box.boxjavalibv2.BoxClient;

 /**
  * Interface for UI to generate auth.
<|current_version|>
package com.box.boxjavalibv2.authorization;

import com.box.boxjavalibv2.BoxClient;

/**
 * Interface for UI to generate auth.
 */
public interface IAuthFlowUI {

    /**
     * Authenticate.
     *
     * @param listener
     *            listener listening to events/messages fired during authentication process.
     */
    void authenticate(IAuthFlowListener listener);

    /**
     * Initialize the UI for OAuth flow. This needs to be called everytime before starting an auth flow.
     */
    void initializeAuthFlow(final Object applicationContext, String clientId, String clientSecret);

    /**
     * Initialize the UI for OAuth flow. This needs to be called everytime before starting an auth flow.
     */
    void initializeAuthFlow(final Object applicationContext, String clientId, String clientSecret, String redirectUrl);

}

<|next_version|>
package com.box.boxjavalibv2.authorization;

import com.box.boxjavalibv2.BoxClient;

/**
 * Interface for UI to generate auth.
 */
public interface IAuthFlowUI {

    /**
     * Authenticate.
     *
     * @param listener
     *            listener listening to events/messages fired during authentication process.
     */
    void authenticate(IAuthFlowListener listener);

    /**
     * Initialize the UI for OAuth flow. This needs to be called everytime before starting an auth flow.
     */
    void initializeAuthFlow(final Object applicationContext, String clientId, String clientSecret);

    /**
     * Initialize the UI for OAuth flow. This needs to be called everytime before starting an auth flow.
     */
    void initializeAuthFlow(final Object applicationContext, String clientId, String clientSecret, String redirectUrl);

    void initializeAuthFlow(Object activity, String clientId, String clientSecret, String redirectUrl, BoxClient boxClient);

}


Add logging to the main file.

Add logging to the main file.

--- bdp/platform/cluster/server/src/main/java/es/tid/bdp/platform/cluster/server/ClusterServerMain.java
+++ bdp/platform/cluster/server/src/main/java/es/tid/bdp/platform/cluster/server/ClusterServerMain.java
@@ -1,15 +1,20 @@
 package es.tid.bdp.platform.cluster.server;
+
+import org.apache.log4j.Logger;

 /**
  *
  * @author dmicol
  */
 public class ClusterServerMain {
+    private static final Logger LOG = Logger.getLogger(ClusterServer.class);
+
     public static void main(String[] args) {
         try {
             ClusterServer server = new ClusterServer();
             server.start();
         } catch (Exception ex) {
+            LOG.fatal(ex.getMessage());
             System.exit(1);
         }
     }

<|original_code|>
package es.tid.bdp.platform.cluster.server;

/**
 *
 * @author dmicol
 */
public class ClusterServerMain {
    public static void main(String[] args) {
        try {
            ClusterServer server = new ClusterServer();
            server.start();
        } catch (Exception ex) {
            System.exit(1);
        }
    }

    private ClusterServerMain() {
    }
}

<|edits_diff|>
--- bdp/platform/cluster/server/src/main/java/es/tid/bdp/platform/cluster/server/ClusterServerMain.java
+++ bdp/platform/cluster/server/src/main/java/es/tid/bdp/platform/cluster/server/ClusterServerMain.java
@@ -1,10 +1,14 @@
 package es.tid.bdp.platform.cluster.server;
+
+import org.apache.log4j.Logger;

 /**
  *
  * @author dmicol
  */
 public class ClusterServerMain {
+    private static final Logger LOG = Logger.getLogger(ClusterServer.class);
+
     public static void main(String[] args) {
         try {
             ClusterServer server = new ClusterServer();
<|current_version|>
package es.tid.bdp.platform.cluster.server;

import org.apache.log4j.Logger;

/**
 *
 * @author dmicol
 */
public class ClusterServerMain {
    private static final Logger LOG = Logger.getLogger(ClusterServer.class);

    public static void main(String[] args) {
        try {
            ClusterServer server = new ClusterServer();
            server.start();
        } catch (Exception ex) {
            System.exit(1);
        }
    }

    private ClusterServerMain() {
    }
}

<|next_version|>
package es.tid.bdp.platform.cluster.server;

import org.apache.log4j.Logger;

/**
 *
 * @author dmicol
 */
public class ClusterServerMain {
    private static final Logger LOG = Logger.getLogger(ClusterServer.class);

    public static void main(String[] args) {
        try {
            ClusterServer server = new ClusterServer();
            server.start();
        } catch (Exception ex) {
            LOG.fatal(ex.getMessage());
            System.exit(1);
        }
    }

    private ClusterServerMain() {
    }
}


Disable Bouncycastle JSSE native test

Disable Bouncycastle JSSE native test

Issue tracked in https://github.com/quarkusio/quarkus/issues/17046

--- integration-tests/bouncycastle-jsse/src/test/java/io/quarkus/it/bouncycastle/BouncyCastleJsseITCase.java
+++ integration-tests/bouncycastle-jsse/src/test/java/io/quarkus/it/bouncycastle/BouncyCastleJsseITCase.java
@@ -2,11 +2,13 @@

 import org.junit.jupiter.api.Test;

+import io.quarkus.test.junit.DisabledOnNativeImage;
 import io.quarkus.test.junit.NativeImageTest;

 @NativeImageTest
 public class BouncyCastleJsseITCase extends BouncyCastleJsseTestCase {
     @Test
+    @DisabledOnNativeImage
     @Override
     public void testListProviders() {
         doTestListProviders();

<|original_code|>
package io.quarkus.it.bouncycastle;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.NativeImageTest;

@NativeImageTest
public class BouncyCastleJsseITCase extends BouncyCastleJsseTestCase {
    @Test
    @Override
    public void testListProviders() {
        doTestListProviders();
        checkLog(true);
    }
}

<|edits_diff|>
--- integration-tests/bouncycastle-jsse/src/test/java/io/quarkus/it/bouncycastle/BouncyCastleJsseITCase.java
+++ integration-tests/bouncycastle-jsse/src/test/java/io/quarkus/it/bouncycastle/BouncyCastleJsseITCase.java
@@ -2,6 +2,7 @@

 import org.junit.jupiter.api.Test;

+import io.quarkus.test.junit.DisabledOnNativeImage;
 import io.quarkus.test.junit.NativeImageTest;

 @NativeImageTest
<|current_version|>
package io.quarkus.it.bouncycastle;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.DisabledOnNativeImage;
import io.quarkus.test.junit.NativeImageTest;

@NativeImageTest
public class BouncyCastleJsseITCase extends BouncyCastleJsseTestCase {
    @Test
    @Override
    public void testListProviders() {
        doTestListProviders();
        checkLog(true);
    }
}

<|next_version|>
package io.quarkus.it.bouncycastle;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.DisabledOnNativeImage;
import io.quarkus.test.junit.NativeImageTest;

@NativeImageTest
public class BouncyCastleJsseITCase extends BouncyCastleJsseTestCase {
    @Test
    @DisabledOnNativeImage
    @Override
    public void testListProviders() {
        doTestListProviders();
        checkLog(true);
    }
}


Add results to LoadSessionServlet model.

Each reservation may contain many results. Since clients may
be depending on these results we will want to keep them
constant when loading sessions from the CMS. This means that
results must be included in the model that is used to update
the reservation.

Change-Id: I8318b3866573b71a4e02dbd43541021f78a57f34

--- server/src/main/java/com/google/samples/apps/iosched/server/schedule/reservations/model/Reservation.java
+++ server/src/main/java/com/google/samples/apps/iosched/server/schedule/reservations/model/Reservation.java
@@ -15,6 +15,8 @@
  */
 package com.google.samples.apps.iosched.server.schedule.reservations.model;

+import java.util.Map;
+
 /**
  * Representation of a Reservation object in RTDB.
  */
@@ -22,6 +24,7 @@

   public long last_status_changed;
   public String status;
+  public Map<String, String> results;

   @Override
   public int compareTo(Reservation reservation) {

<|original_code|>
/*
 * Copyright 2017 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.samples.apps.iosched.server.schedule.reservations.model;

/**
 * Representation of a Reservation object in RTDB.
 */
public class Reservation implements Comparable<Reservation> {

  public long last_status_changed;
  public String status;

  @Override
  public int compareTo(Reservation reservation) {
    if (last_status_changed < reservation.last_status_changed) {
      return -1;
    } else if (last_status_changed > reservation.last_status_changed) {
      return 1;
    }
    return 0;
  }
}

<|edits_diff|>
--- server/src/main/java/com/google/samples/apps/iosched/server/schedule/reservations/model/Reservation.java
+++ server/src/main/java/com/google/samples/apps/iosched/server/schedule/reservations/model/Reservation.java
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 package com.google.samples.apps.iosched.server.schedule.reservations.model;
+
+import java.util.Map;

 /**
  * Representation of a Reservation object in RTDB.
<|current_version|>
/*
 * Copyright 2017 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.samples.apps.iosched.server.schedule.reservations.model;

import java.util.Map;

/**
 * Representation of a Reservation object in RTDB.
 */
public class Reservation implements Comparable<Reservation> {

  public long last_status_changed;
  public String status;

  @Override
  public int compareTo(Reservation reservation) {
    if (last_status_changed < reservation.last_status_changed) {
      return -1;
    } else if (last_status_changed > reservation.last_status_changed) {
      return 1;
    }
    return 0;
  }
}

<|next_version|>
/*
 * Copyright 2017 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.samples.apps.iosched.server.schedule.reservations.model;

import java.util.Map;

/**
 * Representation of a Reservation object in RTDB.
 */
public class Reservation implements Comparable<Reservation> {

  public long last_status_changed;
  public String status;
  public Map<String, String> results;

  @Override
  public int compareTo(Reservation reservation) {
    if (last_status_changed < reservation.last_status_changed) {
      return -1;
    } else if (last_status_changed > reservation.last_status_changed) {
      return 1;
    }
    return 0;
  }
}


Check configuration objects passed to the constructor are not null.

--- annotation-rest/src/main/java/uk/ac/ebi/quickgo/annotation/service/statistics/RequiredStatisticsProvider.java
+++ annotation-rest/src/main/java/uk/ac/ebi/quickgo/annotation/service/statistics/RequiredStatisticsProvider.java
@@ -1,6 +1,9 @@
 package uk.ac.ebi.quickgo.annotation.service.statistics;

 import java.util.List;
+import java.util.Objects;
+
+import static com.google.common.base.Preconditions.checkArgument;

 /**
  * A source of {@link RequiredStatistics} instances.
@@ -19,6 +22,10 @@

     public RequiredStatisticsProvider(StatisticsTypeConfigurer standardConfiguration, StatisticsTypeConfigurer
             downloadConfiguration) {
+        checkArgument(Objects.nonNull(standardConfiguration), "The standard StatisticsTypeConfigurer instance cannot" +
+                " be null");
+        checkArgument(Objects.nonNull(standardConfiguration), "The download StatisticsTypeConfigurer instance cannot" +
+                " be null");
         standardUsage = new RequiredStatistics(standardConfiguration);
         downloadUsage = new RequiredStatistics(downloadConfiguration);
         standardUsageWithGeneProductFiltering = new RequiredStatisticsWithGeneProduct(standardConfiguration);

<|original_code|>
package uk.ac.ebi.quickgo.annotation.service.statistics;

import java.util.List;

/**
 * A source of {@link RequiredStatistics} instances.
 *
 * @author Tony Wardell
 * Date: 19/12/2017
 * Time: 11:04
 * Created with IntelliJ IDEA.
 */
public class RequiredStatisticsProvider {

    private final RequiredStatistics standardUsage;
    private final RequiredStatistics downloadUsage;
    private final RequiredStatistics standardUsageWithGeneProductFiltering;
    private final RequiredStatistics downloadUsageWithGeneProductFiltering;

    public RequiredStatisticsProvider(StatisticsTypeConfigurer standardConfiguration, StatisticsTypeConfigurer
            downloadConfiguration) {
        standardUsage = new RequiredStatistics(standardConfiguration);
        downloadUsage = new RequiredStatistics(downloadConfiguration);
        standardUsageWithGeneProductFiltering = new RequiredStatisticsWithGeneProduct(standardConfiguration);
        downloadUsageWithGeneProductFiltering = new RequiredStatisticsWithGeneProduct(downloadConfiguration);
    }

    public List<RequiredStatistic> getStandardUsage() {
        return standardUsage.getRequiredStatistics();
    }

    public List<RequiredStatistic> getDownloadUsage() {
        return downloadUsage.getRequiredStatistics();
    }

    public List<RequiredStatistic> getStandardUsageWithGeneProductFiltering() {
        return standardUsageWithGeneProductFiltering.getRequiredStatistics();
    }

    public List<RequiredStatistic> getDownloadUsageWithGeneProductFiltering() {
        return downloadUsageWithGeneProductFiltering.getRequiredStatistics();
    }
}

<|edits_diff|>
--- annotation-rest/src/main/java/uk/ac/ebi/quickgo/annotation/service/statistics/RequiredStatisticsProvider.java
+++ annotation-rest/src/main/java/uk/ac/ebi/quickgo/annotation/service/statistics/RequiredStatisticsProvider.java
@@ -1,6 +1,9 @@
 package uk.ac.ebi.quickgo.annotation.service.statistics;

 import java.util.List;
+import java.util.Objects;
+
+import static com.google.common.base.Preconditions.checkArgument;

 /**
  * A source of {@link RequiredStatistics} instances.
<|current_version|>
package uk.ac.ebi.quickgo.annotation.service.statistics;

import java.util.List;
import java.util.Objects;

import static com.google.common.base.Preconditions.checkArgument;

/**
 * A source of {@link RequiredStatistics} instances.
 *
 * @author Tony Wardell
 * Date: 19/12/2017
 * Time: 11:04
 * Created with IntelliJ IDEA.
 */
public class RequiredStatisticsProvider {

    private final RequiredStatistics standardUsage;
    private final RequiredStatistics downloadUsage;
    private final RequiredStatistics standardUsageWithGeneProductFiltering;
    private final RequiredStatistics downloadUsageWithGeneProductFiltering;

    public RequiredStatisticsProvider(StatisticsTypeConfigurer standardConfiguration, StatisticsTypeConfigurer
            downloadConfiguration) {
        standardUsage = new RequiredStatistics(standardConfiguration);
        downloadUsage = new RequiredStatistics(downloadConfiguration);
        standardUsageWithGeneProductFiltering = new RequiredStatisticsWithGeneProduct(standardConfiguration);
        downloadUsageWithGeneProductFiltering = new RequiredStatisticsWithGeneProduct(downloadConfiguration);
    }

    public List<RequiredStatistic> getStandardUsage() {
        return standardUsage.getRequiredStatistics();
    }

    public List<RequiredStatistic> getDownloadUsage() {
        return downloadUsage.getRequiredStatistics();
    }

    public List<RequiredStatistic> getStandardUsageWithGeneProductFiltering() {
        return standardUsageWithGeneProductFiltering.getRequiredStatistics();
    }

    public List<RequiredStatistic> getDownloadUsageWithGeneProductFiltering() {
        return downloadUsageWithGeneProductFiltering.getRequiredStatistics();
    }
}

<|next_version|>
package uk.ac.ebi.quickgo.annotation.service.statistics;

import java.util.List;
import java.util.Objects;

import static com.google.common.base.Preconditions.checkArgument;

/**
 * A source of {@link RequiredStatistics} instances.
 *
 * @author Tony Wardell
 * Date: 19/12/2017
 * Time: 11:04
 * Created with IntelliJ IDEA.
 */
public class RequiredStatisticsProvider {

    private final RequiredStatistics standardUsage;
    private final RequiredStatistics downloadUsage;
    private final RequiredStatistics standardUsageWithGeneProductFiltering;
    private final RequiredStatistics downloadUsageWithGeneProductFiltering;

    public RequiredStatisticsProvider(StatisticsTypeConfigurer standardConfiguration, StatisticsTypeConfigurer
            downloadConfiguration) {
        checkArgument(Objects.nonNull(standardConfiguration), "The standard StatisticsTypeConfigurer instance cannot" +
                " be null");
        checkArgument(Objects.nonNull(standardConfiguration), "The download StatisticsTypeConfigurer instance cannot" +
                " be null");
        standardUsage = new RequiredStatistics(standardConfiguration);
        downloadUsage = new RequiredStatistics(downloadConfiguration);
        standardUsageWithGeneProductFiltering = new RequiredStatisticsWithGeneProduct(standardConfiguration);
        downloadUsageWithGeneProductFiltering = new RequiredStatisticsWithGeneProduct(downloadConfiguration);
    }

    public List<RequiredStatistic> getStandardUsage() {
        return standardUsage.getRequiredStatistics();
    }

    public List<RequiredStatistic> getDownloadUsage() {
        return downloadUsage.getRequiredStatistics();
    }

    public List<RequiredStatistic> getStandardUsageWithGeneProductFiltering() {
        return standardUsageWithGeneProductFiltering.getRequiredStatistics();
    }

    public List<RequiredStatistic> getDownloadUsageWithGeneProductFiltering() {
        return downloadUsageWithGeneProductFiltering.getRequiredStatistics();
    }
}


Fix mem build - implement no-op method.

Fix mem build - implement no-op method.

--- mem_sql/src/main/java/com/splicemachine/derby/impl/sql/NoOpManager.java
+++ mem_sql/src/main/java/com/splicemachine/derby/impl/sql/NoOpManager.java
@@ -4,6 +4,7 @@
 import java.util.Properties;

 import com.splicemachine.backup.BackupManager;
+import com.splicemachine.colperms.ColPermsManager;
 import com.splicemachine.db.authentication.UserAuthenticator;
 import com.splicemachine.db.impl.jdbc.authentication.AuthenticationServiceBase;
 import com.splicemachine.management.Manager;
@@ -34,4 +35,9 @@
     public UserAuthenticator getAuthenticationManager(AuthenticationServiceBase svc, Properties properties) throws SQLException {
         return null;
     }
+
+    @Override
+    public ColPermsManager getColPermsManager() throws SQLException {
+        return null;
+    }
 }

<|original_code|>
package com.splicemachine.derby.impl.sql;

import java.sql.SQLException;
import java.util.Properties;

import com.splicemachine.backup.BackupManager;
import com.splicemachine.db.authentication.UserAuthenticator;
import com.splicemachine.db.impl.jdbc.authentication.AuthenticationServiceBase;
import com.splicemachine.management.Manager;

/**
 * Fake manager impl for mem db
 */
public class NoOpManager implements Manager {
    private static NoOpManager ourInstance=new NoOpManager();

    public static NoOpManager getInstance(){
        return ourInstance;
    }

    private NoOpManager(){ }

    @Override
    public void enableEnterprise(char[] value) throws SQLException {
        // no-op
    }

    @Override
    public BackupManager getBackupManager() throws SQLException {
        return NoOpBackupManager.getInstance();
    }

    @Override
    public UserAuthenticator getAuthenticationManager(AuthenticationServiceBase svc, Properties properties) throws SQLException {
        return null;
    }
}

<|edits_diff|>
--- mem_sql/src/main/java/com/splicemachine/derby/impl/sql/NoOpManager.java
+++ mem_sql/src/main/java/com/splicemachine/derby/impl/sql/NoOpManager.java
@@ -4,6 +4,7 @@
 import java.util.Properties;

 import com.splicemachine.backup.BackupManager;
+import com.splicemachine.colperms.ColPermsManager;
 import com.splicemachine.db.authentication.UserAuthenticator;
 import com.splicemachine.db.impl.jdbc.authentication.AuthenticationServiceBase;
 import com.splicemachine.management.Manager;
<|current_version|>
package com.splicemachine.derby.impl.sql;

import java.sql.SQLException;
import java.util.Properties;

import com.splicemachine.backup.BackupManager;
import com.splicemachine.colperms.ColPermsManager;
import com.splicemachine.db.authentication.UserAuthenticator;
import com.splicemachine.db.impl.jdbc.authentication.AuthenticationServiceBase;
import com.splicemachine.management.Manager;

/**
 * Fake manager impl for mem db
 */
public class NoOpManager implements Manager {
    private static NoOpManager ourInstance=new NoOpManager();

    public static NoOpManager getInstance(){
        return ourInstance;
    }

    private NoOpManager(){ }

    @Override
    public void enableEnterprise(char[] value) throws SQLException {
        // no-op
    }

    @Override
    public BackupManager getBackupManager() throws SQLException {
        return NoOpBackupManager.getInstance();
    }

    @Override
    public UserAuthenticator getAuthenticationManager(AuthenticationServiceBase svc, Properties properties) throws SQLException {
        return null;
    }
}

<|next_version|>
package com.splicemachine.derby.impl.sql;

import java.sql.SQLException;
import java.util.Properties;

import com.splicemachine.backup.BackupManager;
import com.splicemachine.colperms.ColPermsManager;
import com.splicemachine.db.authentication.UserAuthenticator;
import com.splicemachine.db.impl.jdbc.authentication.AuthenticationServiceBase;
import com.splicemachine.management.Manager;

/**
 * Fake manager impl for mem db
 */
public class NoOpManager implements Manager {
    private static NoOpManager ourInstance=new NoOpManager();

    public static NoOpManager getInstance(){
        return ourInstance;
    }

    private NoOpManager(){ }

    @Override
    public void enableEnterprise(char[] value) throws SQLException {
        // no-op
    }

    @Override
    public BackupManager getBackupManager() throws SQLException {
        return NoOpBackupManager.getInstance();
    }

    @Override
    public UserAuthenticator getAuthenticationManager(AuthenticationServiceBase svc, Properties properties) throws SQLException {
        return null;
    }

    @Override
    public ColPermsManager getColPermsManager() throws SQLException {
        return null;
    }
}


Use the spring component as well to allow for migrations

--- net.stickycode.bootstrap/sticky-bootstrap-spring3/src/main/java/net/stickycode/bootstrap/spring3/StickySpringBootstrap.java
+++ net.stickycode.bootstrap/sticky-bootstrap-spring3/src/main/java/net/stickycode/bootstrap/spring3/StickySpringBootstrap.java
@@ -6,6 +6,7 @@
 import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
 import org.springframework.context.support.GenericApplicationContext;
 import org.springframework.core.type.filter.AnnotationTypeFilter;
+import org.springframework.stereotype.Component;

 public class StickySpringBootstrap {

@@ -20,6 +21,7 @@
     scanner.setScopeMetadataResolver(new StickyScopeMetadataResolver());
     scanner.addIncludeFilter(new AnnotationTypeFilter(StickyComponent.class));
     scanner.addIncludeFilter(new AnnotationTypeFilter(StickyPlugin.class));
+    scanner.addIncludeFilter(new AnnotationTypeFilter(Component.class));
     scanner.scan(paths);
   }

<|original_code|>
package net.stickycode.bootstrap.spring3;

import net.stickycode.stereotype.StickyComponent;
import net.stickycode.stereotype.StickyPlugin;

import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.type.filter.AnnotationTypeFilter;

public class StickySpringBootstrap {

  private GenericApplicationContext context;

  public StickySpringBootstrap(GenericApplicationContext context) {
    this.context = context;
  }

  public void scan(String... paths) {
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context, false);
    scanner.setScopeMetadataResolver(new StickyScopeMetadataResolver());
    scanner.addIncludeFilter(new AnnotationTypeFilter(StickyComponent.class));
    scanner.addIncludeFilter(new AnnotationTypeFilter(StickyPlugin.class));
    scanner.scan(paths);
  }

}

<|edits_diff|>
--- net.stickycode.bootstrap/sticky-bootstrap-spring3/src/main/java/net/stickycode/bootstrap/spring3/StickySpringBootstrap.java
+++ net.stickycode.bootstrap/sticky-bootstrap-spring3/src/main/java/net/stickycode/bootstrap/spring3/StickySpringBootstrap.java
@@ -6,6 +6,7 @@
 import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
 import org.springframework.context.support.GenericApplicationContext;
 import org.springframework.core.type.filter.AnnotationTypeFilter;
+import org.springframework.stereotype.Component;

 public class StickySpringBootstrap {

<|current_version|>
package net.stickycode.bootstrap.spring3;

import net.stickycode.stereotype.StickyComponent;
import net.stickycode.stereotype.StickyPlugin;

import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.stereotype.Component;

public class StickySpringBootstrap {

  private GenericApplicationContext context;

  public StickySpringBootstrap(GenericApplicationContext context) {
    this.context = context;
  }

  public void scan(String... paths) {
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context, false);
    scanner.setScopeMetadataResolver(new StickyScopeMetadataResolver());
    scanner.addIncludeFilter(new AnnotationTypeFilter(StickyComponent.class));
    scanner.addIncludeFilter(new AnnotationTypeFilter(StickyPlugin.class));
    scanner.scan(paths);
  }

}

<|next_version|>
package net.stickycode.bootstrap.spring3;

import net.stickycode.stereotype.StickyComponent;
import net.stickycode.stereotype.StickyPlugin;

import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.stereotype.Component;

public class StickySpringBootstrap {

  private GenericApplicationContext context;

  public StickySpringBootstrap(GenericApplicationContext context) {
    this.context = context;
  }

  public void scan(String... paths) {
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context, false);
    scanner.setScopeMetadataResolver(new StickyScopeMetadataResolver());
    scanner.addIncludeFilter(new AnnotationTypeFilter(StickyComponent.class));
    scanner.addIncludeFilter(new AnnotationTypeFilter(StickyPlugin.class));
    scanner.addIncludeFilter(new AnnotationTypeFilter(Component.class));
    scanner.scan(paths);
  }

}


Add file name parsing helper

Add file name parsing helper

--- com.github.sormuras.bach/src/main/java/com/github/sormuras/bach/internal/StringSupport.java
+++ com.github.sormuras.bach/src/main/java/com/github/sormuras/bach/internal/StringSupport.java
@@ -1,5 +1,7 @@
 package com.github.sormuras.bach.internal;

+import java.net.URI;
+import java.nio.file.Path;
 import java.util.List;
 import java.util.stream.Collectors;

@@ -12,6 +14,11 @@
     var lines = string.lines().toList();
     var size = lines.size();
     return size <= 1 ? string : lines.get(0) + "[...%d lines]".formatted(size);
+  }
+
+  static String parseFileName(String string) {
+    var path = string.indexOf(':') > 0 ? URI.create(string).getPath() : string;
+    return Path.of(path).getFileName().toString();
   }

   record Property(String key, String value) {}

<|original_code|>
package com.github.sormuras.bach.internal;

import java.util.List;
import java.util.stream.Collectors;

public interface StringSupport {
  static String join(List<String> strings) {
    return strings.stream().map(StringSupport::firstLine).collect(Collectors.joining(" "));
  }

  static String firstLine(String string) {
    var lines = string.lines().toList();
    var size = lines.size();
    return size <= 1 ? string : lines.get(0) + "[...%d lines]".formatted(size);
  }

  record Property(String key, String value) {}

  static Property parseProperty(String string) {
    return StringSupport.parseProperty(string, '=');
  }

  static Property parseProperty(String string, char separator) {
    int index = string.indexOf(separator);
    if (index < 0) {
      var message = "Expected a `KEY%sVALUE` string, but got: %s".formatted(separator, string);
      throw new IllegalArgumentException(message);
    }
    var key = string.substring(0, index);
    var value = string.substring(index + 1);
    return new Property(key, value);
  }
}

<|edits_diff|>
--- com.github.sormuras.bach/src/main/java/com/github/sormuras/bach/internal/StringSupport.java
+++ com.github.sormuras.bach/src/main/java/com/github/sormuras/bach/internal/StringSupport.java
@@ -1,5 +1,7 @@
 package com.github.sormuras.bach.internal;

+import java.net.URI;
+import java.nio.file.Path;
 import java.util.List;
 import java.util.stream.Collectors;

<|current_version|>
package com.github.sormuras.bach.internal;

import java.net.URI;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;

public interface StringSupport {
  static String join(List<String> strings) {
    return strings.stream().map(StringSupport::firstLine).collect(Collectors.joining(" "));
  }

  static String firstLine(String string) {
    var lines = string.lines().toList();
    var size = lines.size();
    return size <= 1 ? string : lines.get(0) + "[...%d lines]".formatted(size);
  }

  record Property(String key, String value) {}

  static Property parseProperty(String string) {
    return StringSupport.parseProperty(string, '=');
  }

  static Property parseProperty(String string, char separator) {
    int index = string.indexOf(separator);
    if (index < 0) {
      var message = "Expected a `KEY%sVALUE` string, but got: %s".formatted(separator, string);
      throw new IllegalArgumentException(message);
    }
    var key = string.substring(0, index);
    var value = string.substring(index + 1);
    return new Property(key, value);
  }
}

<|next_version|>
package com.github.sormuras.bach.internal;

import java.net.URI;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;

public interface StringSupport {
  static String join(List<String> strings) {
    return strings.stream().map(StringSupport::firstLine).collect(Collectors.joining(" "));
  }

  static String firstLine(String string) {
    var lines = string.lines().toList();
    var size = lines.size();
    return size <= 1 ? string : lines.get(0) + "[...%d lines]".formatted(size);
  }

  static String parseFileName(String string) {
    var path = string.indexOf(':') > 0 ? URI.create(string).getPath() : string;
    return Path.of(path).getFileName().toString();
  }

  record Property(String key, String value) {}

  static Property parseProperty(String string) {
    return StringSupport.parseProperty(string, '=');
  }

  static Property parseProperty(String string, char separator) {
    int index = string.indexOf(separator);
    if (index < 0) {
      var message = "Expected a `KEY%sVALUE` string, but got: %s".formatted(separator, string);
      throw new IllegalArgumentException(message);
    }
    var key = string.substring(0, index);
    var value = string.substring(index + 1);
    return new Property(key, value);
  }
}


Check that command is not null before saving.

--- core-java-sample/src/main/java/org/spine3/server/storage/filesystem/FileSystemCommandStorage.java
+++ core-java-sample/src/main/java/org/spine3/server/storage/filesystem/FileSystemCommandStorage.java
@@ -23,10 +23,15 @@
 import org.spine3.server.storage.CommandStorage;
 import org.spine3.server.storage.CommandStoreRecord;

+import static com.google.common.base.Preconditions.checkNotNull;
+
 public class FileSystemCommandStorage extends CommandStorage {

     @Override
     protected void write(CommandStoreRecord record) {
+        checkNotNull(record, "CommandRecord shouldn't be null.");
         Helper.write(record);
     }
+
+
 }

<|original_code|>
/*
 * Copyright 2015, TeamDev Ltd. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package org.spine3.server.storage.filesystem;

import org.spine3.server.storage.CommandStorage;
import org.spine3.server.storage.CommandStoreRecord;

public class FileSystemCommandStorage extends CommandStorage {

    @Override
    protected void write(CommandStoreRecord record) {
        Helper.write(record);
    }
}

<|edits_diff|>
--- core-java-sample/src/main/java/org/spine3/server/storage/filesystem/FileSystemCommandStorage.java
+++ core-java-sample/src/main/java/org/spine3/server/storage/filesystem/FileSystemCommandStorage.java
@@ -23,10 +23,13 @@
 import org.spine3.server.storage.CommandStorage;
 import org.spine3.server.storage.CommandStoreRecord;

+import static com.google.common.base.Preconditions.checkNotNull;
+
 public class FileSystemCommandStorage extends CommandStorage {

     @Override
     protected void write(CommandStoreRecord record) {
+        checkNotNull(record, "CommandRecord shouldn't be null.");
         Helper.write(record);
     }
 }
<|current_version|>
/*
 * Copyright 2015, TeamDev Ltd. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package org.spine3.server.storage.filesystem;

import org.spine3.server.storage.CommandStorage;
import org.spine3.server.storage.CommandStoreRecord;

import static com.google.common.base.Preconditions.checkNotNull;

public class FileSystemCommandStorage extends CommandStorage {

    @Override
    protected void write(CommandStoreRecord record) {
        checkNotNull(record, "CommandRecord shouldn't be null.");
        Helper.write(record);
    }
}

<|next_version|>
/*
 * Copyright 2015, TeamDev Ltd. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package org.spine3.server.storage.filesystem;

import org.spine3.server.storage.CommandStorage;
import org.spine3.server.storage.CommandStoreRecord;

import static com.google.common.base.Preconditions.checkNotNull;

public class FileSystemCommandStorage extends CommandStorage {

    @Override
    protected void write(CommandStoreRecord record) {
        checkNotNull(record, "CommandRecord shouldn't be null.");
        Helper.write(record);
    }

}


Fix up a parse error

Fix up a parse error

The non-generic ParseQueryAdapter class fails when results are read due
to a cast error:

    java.lang.ClassCastException: com.parse.ParseObject cannot be cast to org.ashanet.typedef.Event
    	at org.ashanet.adapter.EventListAdapter.getItemView(EventListAdapter.java:20)
    	at com.parse.ParseQueryAdapter.getView(ParseQueryAdapter.java:546)
    	at android.widget.AbsListView.obtainView(AbsListView.java:2033)
    	at android.widget.ListView.makeAndAddView(ListView.java:1772)
    	at android.widget.ListView.fillDown(ListView.java:672)
    	at android.widget.ListView.fillFromTop(ListView.java:732)
        ...

This is because the type parameter was not registered.  Register it in
the Application class.

--- src/org/ashanet/AshaNetApp.java
+++ src/org/ashanet/AshaNetApp.java
@@ -8,6 +8,7 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.LineNumberReader;
+import org.ashanet.typedef.Event;
 import org.ashanet.typedef.Project;

 public class AshaNetApp extends Application {
@@ -40,5 +41,6 @@

     private void registerClasses() {
         ParseObject.registerSubclass(Project.class);
+        ParseObject.registerSubclass(Event.class);
     }
 }

<|original_code|>
package org.ashanet;

import android.app.Application;
import android.content.res.Resources;
import android.util.Log;
import com.parse.Parse;
import com.parse.ParseObject;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import org.ashanet.typedef.Project;

public class AshaNetApp extends Application {

    public String parseAppId;

    @Override
    public void onCreate() {
        super.onCreate();
        LineNumberReader lnr = new LineNumberReader
            (new InputStreamReader
             (getResources().openRawResource(R.raw.keys)));

        registerClasses();

        String parseClientKey;

        try {
            parseAppId = lnr.readLine();
            parseClientKey = lnr.readLine();

            Parse.initialize(this, parseAppId, parseClientKey);
            Log.d("DEBUG", "Successfully initialized");
        }
        catch (IOException ioe) {
            Log.e("DEBUG", "Failed to read keys", ioe);
        }
    }

    private void registerClasses() {
        ParseObject.registerSubclass(Project.class);
    }
}

<|edits_diff|>
--- src/org/ashanet/AshaNetApp.java
+++ src/org/ashanet/AshaNetApp.java
@@ -8,6 +8,7 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.LineNumberReader;
+import org.ashanet.typedef.Event;
 import org.ashanet.typedef.Project;

 public class AshaNetApp extends Application {
<|current_version|>
package org.ashanet;

import android.app.Application;
import android.content.res.Resources;
import android.util.Log;
import com.parse.Parse;
import com.parse.ParseObject;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import org.ashanet.typedef.Event;
import org.ashanet.typedef.Project;

public class AshaNetApp extends Application {

    public String parseAppId;

    @Override
    public void onCreate() {
        super.onCreate();
        LineNumberReader lnr = new LineNumberReader
            (new InputStreamReader
             (getResources().openRawResource(R.raw.keys)));

        registerClasses();

        String parseClientKey;

        try {
            parseAppId = lnr.readLine();
            parseClientKey = lnr.readLine();

            Parse.initialize(this, parseAppId, parseClientKey);
            Log.d("DEBUG", "Successfully initialized");
        }
        catch (IOException ioe) {
            Log.e("DEBUG", "Failed to read keys", ioe);
        }
    }

    private void registerClasses() {
        ParseObject.registerSubclass(Project.class);
    }
}

<|next_version|>
package org.ashanet;

import android.app.Application;
import android.content.res.Resources;
import android.util.Log;
import com.parse.Parse;
import com.parse.ParseObject;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import org.ashanet.typedef.Event;
import org.ashanet.typedef.Project;

public class AshaNetApp extends Application {

    public String parseAppId;

    @Override
    public void onCreate() {
        super.onCreate();
        LineNumberReader lnr = new LineNumberReader
            (new InputStreamReader
             (getResources().openRawResource(R.raw.keys)));

        registerClasses();

        String parseClientKey;

        try {
            parseAppId = lnr.readLine();
            parseClientKey = lnr.readLine();

            Parse.initialize(this, parseAppId, parseClientKey);
            Log.d("DEBUG", "Successfully initialized");
        }
        catch (IOException ioe) {
            Log.e("DEBUG", "Failed to read keys", ioe);
        }
    }

    private void registerClasses() {
        ParseObject.registerSubclass(Project.class);
        ParseObject.registerSubclass(Event.class);
    }
}


Add access to list of elements

Add access to list of elements

--- src/main/java/com/grayben/riskExtractor/htmlScorer/ScoredText.java
+++ src/main/java/com/grayben/riskExtractor/htmlScorer/ScoredText.java
@@ -1,6 +1,7 @@
 package com.grayben.riskExtractor.htmlScorer;

 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;

 public class ScoredText {
@@ -44,4 +45,8 @@
         }
 		text.add(st);
 	}
+
+	public List<ScoredTextElement> getList(){
+        return Collections.unmodifiableList(this.text);
+    }
 }

<|original_code|>
package com.grayben.riskExtractor.htmlScorer;

import java.util.ArrayList;
import java.util.List;

public class ScoredText {
	private List<ScoredTextElement> text;

	public ScoredText() {
		super();
		text = new ArrayList<>();
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		for (ScoredTextElement element : text) {
			sb.append(element.getTextElement());
			sb.append(" ");
		}
		return sb.toString().trim();
	}

	public void add(ScoredTextElement st) {
        if(st.getScores() == null){
            throw new NullPointerException(
                    "param.getScores() must not be null"
            );
        }
        if(st.getScores().isEmpty()){
            throw new IllegalArgumentException(
                    "param.getScores() must not be empty"
            );
        }
        if(st.getTextElement() == null){
            throw new NullPointerException(
                    "param.getTextElement() must not be null"
            );
        }
        if(st.getTextElement().isEmpty()){
            throw new IllegalArgumentException(
                    "param.getTextElement() must not be empty"
            );
        }
		text.add(st);
	}
}

<|edits_diff|>
--- src/main/java/com/grayben/riskExtractor/htmlScorer/ScoredText.java
+++ src/main/java/com/grayben/riskExtractor/htmlScorer/ScoredText.java
@@ -1,6 +1,7 @@
 package com.grayben.riskExtractor.htmlScorer;

 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;

 public class ScoredText {
<|current_version|>
package com.grayben.riskExtractor.htmlScorer;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class ScoredText {
	private List<ScoredTextElement> text;

	public ScoredText() {
		super();
		text = new ArrayList<>();
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		for (ScoredTextElement element : text) {
			sb.append(element.getTextElement());
			sb.append(" ");
		}
		return sb.toString().trim();
	}

	public void add(ScoredTextElement st) {
        if(st.getScores() == null){
            throw new NullPointerException(
                    "param.getScores() must not be null"
            );
        }
        if(st.getScores().isEmpty()){
            throw new IllegalArgumentException(
                    "param.getScores() must not be empty"
            );
        }
        if(st.getTextElement() == null){
            throw new NullPointerException(
                    "param.getTextElement() must not be null"
            );
        }
        if(st.getTextElement().isEmpty()){
            throw new IllegalArgumentException(
                    "param.getTextElement() must not be empty"
            );
        }
		text.add(st);
	}
}

<|next_version|>
package com.grayben.riskExtractor.htmlScorer;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class ScoredText {
	private List<ScoredTextElement> text;

	public ScoredText() {
		super();
		text = new ArrayList<>();
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		for (ScoredTextElement element : text) {
			sb.append(element.getTextElement());
			sb.append(" ");
		}
		return sb.toString().trim();
	}

	public void add(ScoredTextElement st) {
        if(st.getScores() == null){
            throw new NullPointerException(
                    "param.getScores() must not be null"
            );
        }
        if(st.getScores().isEmpty()){
            throw new IllegalArgumentException(
                    "param.getScores() must not be empty"
            );
        }
        if(st.getTextElement() == null){
            throw new NullPointerException(
                    "param.getTextElement() must not be null"
            );
        }
        if(st.getTextElement().isEmpty()){
            throw new IllegalArgumentException(
                    "param.getTextElement() must not be empty"
            );
        }
		text.add(st);
	}

	public List<ScoredTextElement> getList(){
        return Collections.unmodifiableList(this.text);
    }
}