id
int64 1
194k
| buggy
stringlengths 23
37.5k
| fixed
stringlengths 6
37.4k
|
---|---|---|
193,101 | scene.walls.updateMap();
}
}
public static void updateMap( int cell ) {
if (scene != null) {
<BUG>scene.tiles.updateMapCell( cell );
scene.terrainFeatures.updateMapCell( cell );</BUG>
scene.walls.updateMapCell( cell );
scene.fog.updateFogCell( cell );
scene.wallBlocking.updateMapCell( cell );
| scene.walls.updateMap();
}
}
public static void updateMap( int cell ) {
if (scene != null) {
scene.tiles.updateMapCell( cell );
scene.visualGrid.updateMapCell( cell );
scene.terrainFeatures.updateMapCell( cell );
scene.walls.updateMapCell( cell );
scene.fog.updateFogCell( cell );
scene.wallBlocking.updateMapCell( cell );
|
193,102 |
private static final int BTN_HEIGHT = 20;
</BUG>
private static final int GAP_TINY = 2;
<BUG>private static final int GAP_SML = 5;
private static final int GAP_LRG = 12;
private ScreenTab screen;
private UITab ui;</BUG>
private AudioTab audio;
| import com.watabou.noosa.RenderedText;
import com.watabou.noosa.audio.Music;
import com.watabou.noosa.audio.Sample;
public class WndSettings extends WndTabbed {
private static final int WIDTH = 112;
private static final int HEIGHT = 138;
private static final int SLIDER_HEIGHT = 24;
private static final int BTN_HEIGHT = 18;
private static final int GAP_TINY = 2;
private static final int GAP_SML = 6;
private static final int GAP_LRG = 18;
private DisplayTab display;
private UITab ui;
private AudioTab audio;
|
193,103 | protected void onClick() {
super.onClick();
if (checked()) {
checked(!checked());
ShatteredPixelDungeon.scene().add(new WndOptions(
<BUG>Messages.get(ScreenTab.class, "saver"),
Messages.get(ScreenTab.class, "saver_desc"),
Messages.get(ScreenTab.class, "okay"),
Messages.get(ScreenTab.class, "cancel")) {
</BUG>
@Override
| protected void onClick() {
super.onClick();
if (checked()) {
checked(!checked());
ShatteredPixelDungeon.scene().add(new WndOptions(
Messages.get(DisplayTab.class, "saver"),
Messages.get(DisplayTab.class, "saver_desc"),
Messages.get(DisplayTab.class, "okay"),
Messages.get(DisplayTab.class, "cancel")) {
@Override
|
193,104 | });
} else {
ShatteredPixelDungeon.powerSaver(checked());
}
}
<BUG>};
chkSaver.setRect( 0, chkImmersive.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT );
</BUG>
chkSaver.checked(ShatteredPixelDungeon.powerSaver());
<BUG>if (PixelScene.maxScreenZoom >= 2) add(chkSaver);
RedButton btnOrientation = new RedButton( ShatteredPixelDungeon.landscape() ?</BUG>
Messages.get(this, "portrait")
| });
} else {
ShatteredPixelDungeon.powerSaver(checked());
}
}
};
if (PixelScene.maxScreenZoom >= 2) {
chkSaver.setRect(0, scale.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
chkSaver.checked(ShatteredPixelDungeon.powerSaver());
add(chkSaver);
}
RedButton btnOrientation = new RedButton( ShatteredPixelDungeon.landscape() ?
Messages.get(this, "portrait")
|
193,105 | Game.scene().add(new WndSettings());
}
});
}
};
<BUG>chkFont.setRect(0, slots.bottom() + GAP_SML, WIDTH, BTN_HEIGHT);
</BUG>
chkFont.checked(!ShatteredPixelDungeon.classicFont());
add(chkFont);
}
| Game.scene().add(new WndSettings());
}
});
}
};
chkFont.setRect(0, chkImmersive.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
chkFont.checked(!ShatteredPixelDungeon.classicFont());
add(chkFont);
|
193,106 | protected void onClick() {
super.onClick();
ShatteredPixelDungeon.music(!checked());
}
};
<BUG>musicMute.setRect(0, musicVol.bottom() + GAP_SML, WIDTH, BTN_HEIGHT);
</BUG>
musicMute.checked(!ShatteredPixelDungeon.music());
add(musicMute);
OptionSlider SFXVol = new OptionSlider(Messages.get(this, "sfx_vol"), "0", "10", 0, 10) {
| protected void onClick() {
super.onClick();
ShatteredPixelDungeon.music(!checked());
}
};
musicMute.setRect(0, musicVol.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
musicMute.checked(!ShatteredPixelDungeon.music());
add(musicMute);
OptionSlider SFXVol = new OptionSlider(Messages.get(this, "sfx_vol"), "0", "10", 0, 10) {
|
193,107 | public static final String KEY_FLIPTAGS = "flip_tags";
public static final String KEY_BARMODE = "toolbar_mode";
public static final String KEY_LANG = "language";
public static final String KEY_CLASSICFONT = "classic_font";
public static final String KEY_INTRO = "intro";
<BUG>public static final String KEY_BRIGHTNESS = "brightness";
public static final String KEY_VERSION = "version";</BUG>
private SharedPreferences prefs;
private SharedPreferences get() {
if (prefs == null) {
| public static final String KEY_FLIPTAGS = "flip_tags";
public static final String KEY_BARMODE = "toolbar_mode";
public static final String KEY_LANG = "language";
public static final String KEY_CLASSICFONT = "classic_font";
public static final String KEY_INTRO = "intro";
public static final String KEY_BRIGHTNESS = "brightness";
public static final String KEY_GRID = "visual_grid";
public static final String KEY_VERSION = "version";
private SharedPreferences prefs;
private SharedPreferences get() {
if (prefs == null) {
|
193,108 | import org.mule.api.MessagingException;
import org.mule.api.ThreadSafeAccess;
import org.mule.api.config.MuleProperties;
import org.mule.api.transport.MessageTypeNotSupportedException;
import org.mule.transport.AbstractMessageAdapter;
<BUG>import java.util.Enumeration;
import javax.jms.Destination;</BUG>
import javax.jms.JMSException;
import javax.jms.Message;
public class JmsMessageAdapter extends AbstractMessageAdapter
| import org.mule.api.MessagingException;
import org.mule.api.ThreadSafeAccess;
import org.mule.api.config.MuleProperties;
import org.mule.api.transport.MessageTypeNotSupportedException;
import org.mule.transport.AbstractMessageAdapter;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
public class JmsMessageAdapter extends AbstractMessageAdapter
|
193,109 | public Object getPayload()
{
return jmsMessage;
}
private void setMessage(Object message) throws MessagingException
<BUG>{
if (message instanceof Message)</BUG>
{
this.jmsMessage = (Message) message;
}
| public Object getPayload()
{
return jmsMessage;
}
private void setMessage(Object message) throws MessagingException
{
Map props = new HashMap();
if (message instanceof Message)
{
this.jmsMessage = (Message) message;
}
|
193,110 | try
{
String value = this.jmsMessage.getJMSCorrelationID();
if (value != null)
{
<BUG>setProperty(JmsConstants.JMS_CORRELATION_ID, value);
}</BUG>
}
catch (JMSException e)
| try
{
String value = this.jmsMessage.getJMSCorrelationID();
if (value != null)
{
props.put(JmsConstants.JMS_CORRELATION_ID, value);
props.put(MuleProperties.MULE_CORRELATION_ID_PROPERTY, value);
}
}
catch (JMSException e)
|
193,111 | try
{
Destination value = this.jmsMessage.getJMSDestination();
if (value != null)
{
<BUG>setProperty(JmsConstants.JMS_DESTINATION, value);
</BUG>
}
}
catch (JMSException e)
| try
{
String value = this.jmsMessage.getJMSCorrelationID();
if (value != null)
{
props.put(JmsConstants.JMS_CORRELATION_ID, value);
props.put(MuleProperties.MULE_CORRELATION_ID_PROPERTY, value);
}
}
catch (JMSException e)
|
193,112 | try
{
String value = this.jmsMessage.getJMSMessageID();
if (value != null)
{
<BUG>setProperty(JmsConstants.JMS_MESSAGE_ID, value);
}</BUG>
}
catch (JMSException e)
| try
{
String value = this.jmsMessage.getJMSCorrelationID();
if (value != null)
{
props.put(JmsConstants.JMS_CORRELATION_ID, value);
props.put(MuleProperties.MULE_CORRELATION_ID_PROPERTY, value);
}
}
catch (JMSException e)
|
193,113 | try
{
Destination value = this.jmsMessage.getJMSReplyTo();
if (value != null)
{
<BUG>setProperty(JmsConstants.JMS_REPLY_TO, value);
}</BUG>
}
catch (JMSException e)
| try
{
String value = this.jmsMessage.getJMSCorrelationID();
if (value != null)
{
props.put(JmsConstants.JMS_CORRELATION_ID, value);
props.put(MuleProperties.MULE_CORRELATION_ID_PROPERTY, value);
}
}
catch (JMSException e)
|
193,114 | try
{
String value = this.jmsMessage.getJMSType();
if (value != null)
{
<BUG>setProperty(JmsConstants.JMS_TYPE, value);
</BUG>
}
}
catch (JMSException e)
| try
{
String value = this.jmsMessage.getJMSCorrelationID();
if (value != null)
{
props.put(JmsConstants.JMS_CORRELATION_ID, value);
props.put(MuleProperties.MULE_CORRELATION_ID_PROPERTY, value);
}
}
catch (JMSException e)
|
193,115 | public String setWindow() {
return "";
</BUG>
}
<BUG>public String deleteWindow() {
return "";
}
public String setFrame() {
return "";
}</BUG>
}
| String windowHandle = (String) utils
.request("GET", DriverCommand.WINDOW_HANDLE, jsonObj);
driver.setWindowHandle(windowHandle);
|
193,116 | private Utils utils = new Utils();
public Session(MacacaDriver driver) {
this.driver = driver;
}
public void createSession(JSONObject jsonObj) throws Exception {
<BUG>JSONObject response = (JSONObject) utils.postRequest(DriverCommand.CREATE_SESSION, jsonObj);
</BUG>
String sessionId = (String) response.get("sessionId");
<BUG>this.driver.setSessionId(sessionId);
}</BUG>
public void delSession() throws Exception {
| private Utils utils = new Utils();
public Session(MacacaDriver driver) {
this.driver = driver;
}
public void createSession(JSONObject jsonObj) throws Exception {
JSONObject response = (JSONObject) utils.request("POST", DriverCommand.CREATE_SESSION, jsonObj);
String sessionId = (String) response.get("sessionId");
this.driver.setSessionId(sessionId);
this.driver.setCapabilities(response);
}
|
193,117 | public static final String CLICK_ELEMENT = SESSION + "/element/:elementId/click";
public static final String SWIPE = SESSION + "/element/:elementId/swipe";
public static final String GET_ELEMENT_TEXT = SESSION + "/element/:elementId/text";
public static final String IS_ELEMENT_DISPLAYED = SESSION + "/element/:elementId/displayed";
public static final String CLEAR_ELEMENT = SESSION + "/element/:elementId/clear";
<BUG>public static final String GET_ELEMENT_ATTRIBUTE = SESSION + "/element/e:lementId/attribute/name";
public static final String GET_ELEMENT_VALUE_OF_CSS_PROPERTY = SESSION + "/element/:elementId/css/propertyName";
</BUG>
public static final String TOUCH_CLICK = SESSION + "/touch/click";
| public static final String CLICK_ELEMENT = SESSION + "/element/:elementId/click";
public static final String SWIPE = SESSION + "/element/:elementId/swipe";
public static final String GET_ELEMENT_TEXT = SESSION + "/element/:elementId/text";
public static final String IS_ELEMENT_DISPLAYED = SESSION + "/element/:elementId/displayed";
public static final String CLEAR_ELEMENT = SESSION + "/element/:elementId/clear";
public static final String GET_ELEMENT_ATTRIBUTE = SESSION + "/element/:elementId/attribute/:name";
public static final String GET_ELEMENT_VALUE_OF_CSS_PROPERTY = SESSION + "/element/:elementId/css/:propertyName";
public static final String TOUCH_CLICK = SESSION + "/touch/click";
|
193,118 | private Window window = new Window(driver);
private Url url = new Url(driver);
private Element element = new Element(driver);
private Source source = new Source(driver);
private ScreenShot screenshot = new ScreenShot(driver);
<BUG>public void initDriver(JSONObject jsonObj) throws Exception {
session.createSession(jsonObj);
}</BUG>
public void quit() throws Exception {
| private Window window = new Window(driver);
private Url url = new Url(driver);
private Element element = new Element(driver);
private Source source = new Source(driver);
private ScreenShot screenshot = new ScreenShot(driver);
public MacacaClient initDriver(JSONObject jsonObj) throws Exception {
session.createSession(jsonObj);
return this;
}
public void quit() throws Exception {
|
193,119 | private Utils utils = new Utils();
public Url(MacacaDriver driver) {
this.driver = driver;
}
public void url(JSONObject jsonObj) throws Exception {
<BUG>utils.postRequest(DriverCommand.URL.replace(":sessionId", driver.getSessionId()), jsonObj);
}</BUG>
public void getUrl(JSONObject jsonObj) throws Exception {
<BUG>utils.postRequest(DriverCommand.URL.replace(":sessionId", driver.getSessionId()), jsonObj);
}</BUG>
public void forward(JSONObject jsonObj) throws Exception {
| private Utils utils = new Utils();
public Url(MacacaDriver driver) {
this.driver = driver;
}
public void url(JSONObject jsonObj) throws Exception {
jsonObj.put("sessionId", driver.getSessionId());
utils.request("POST", DriverCommand.URL, jsonObj);
}
public void getUrl(JSONObject jsonObj) throws Exception {
jsonObj.put("sessionId", driver.getSessionId());
utils.request("POST", DriverCommand.URL, jsonObj);
}
|
193,120 | package macaca.client;
public class MacacaDriver {
private String sessionId;
private String windowHandle;
private String elementId;
<BUG>private String context;
public String getContext() {</BUG>
return context;
}
public void setContext(String context) {
| package macaca.client;
import com.alibaba.fastjson.JSONObject;
public class MacacaDriver {
private String sessionId;
private String windowHandle;
private String elementId;
private String context;
private JSONObject capabilities;
public String getContext() {
return context;
}
public void setContext(String context) {
|
193,121 | elements = (JSONArray) utils
<BUG>.postRequest(DriverCommand.FIND_ELEMENTS.replace(":sessionId", driver.getSessionId()), jsonObj);
return elements;</BUG>
}
public void swipe(JSONObject jsonObj) throws Exception {
<BUG>utils.postRequest(DriverCommand.SWIPE.replace(":sessionId", driver.getSessionId()), jsonObj);
}</BUG>
public void flick(JSONObject jsonObj) throws Exception {
<BUG>utils.postRequest(DriverCommand.TOUCH_FLICK.replace(":sessionId", driver.getSessionId()), jsonObj);
}</BUG>
public void tap(JSONObject jsonObj) throws Exception {
| elements = (JSONArray) utils
.postRequest(DriverCommand.FIND_ELEMENTS, jsonObj);
return elements;
}
public void swipe(JSONObject jsonObj) throws Exception {
jsonObj.put("sessionId", driver.getSessionId());
utils.postRequest(DriverCommand.SWIPE, jsonObj);
}
public void flick(JSONObject jsonObj) throws Exception {
jsonObj.put("sessionId", driver.getSessionId());
utils.postRequest(DriverCommand.TOUCH_FLICK, jsonObj);
}
|
193,122 | }
if (prevCast != null) {
context.put(ExpressionCompiler.PRE_CAST, prevCast);
}
}
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException)t;
else
throw new RuntimeException(t);</BUG>
}
| }
}
result += parmString;
}
if (prevCast != null) {
context.put(ExpressionCompiler.PRE_CAST, prevCast);
}
}
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
}
|
193,123 | } else
result += value;
context.put("_currentChain", result);
}
}
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException)t;
else
throw new RuntimeException(t);</BUG>
}
| } else
result += value;
context.put("_currentChain", result);
}
}
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
}
|
193,124 | context.setCurrentType(Boolean.TYPE);
return result;
} catch (NullPointerException e) {
e.printStackTrace();
throw new UnsupportedCompilationException("evaluation resulted in null expression.");
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException)t;
else
throw new RuntimeException(t);</BUG>
}
| context.setCurrentType(Boolean.TYPE);
return result;
} catch (NullPointerException e) {
e.printStackTrace();
throw new UnsupportedCompilationException("evaluation resulted in null expression.");
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
|
193,125 | result += ")";
context.setCurrentObject(target);
context.setCurrentType(Object.class);
} catch (NullPointerException e) {
throw new UnsupportedCompilationException("evaluation resulted in null expression.");
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException)t;
else
throw new RuntimeException(t);</BUG>
}
| result += ")";
context.setCurrentObject(target);
context.setCurrentType(Object.class);
} catch (NullPointerException e) {
throw new UnsupportedCompilationException("evaluation resulted in null expression.");
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
}
|
193,126 | result += "if(" + first + "){";
result += second;
result += "; } ";
context.setCurrentObject(target);
context.setCurrentType(Object.class);
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException)t;
else
throw new RuntimeException(t);</BUG>
}
| result += "if(" + first + "){";
result += second;
result += "; } ";
context.setCurrentObject(target);
context.setCurrentType(Object.class);
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
}
|
193,127 | result += " : ";
result += (mismatched ? " ($w) " : "") + second;
result += ")";
context.setCurrentObject(target);
context.setCurrentType(Boolean.TYPE);
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException) t;
else
throw new RuntimeException(t);</BUG>
}
| result += " : ";
result += (mismatched ? " ($w) " : "") + second;
result += ")";
context.setCurrentObject(target);
context.setCurrentType(Boolean.TYPE);
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
}
|
193,128 | result += first;
result += " : ";
result += second;
context.setCurrentObject(target);
context.setCurrentType(Boolean.TYPE);
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException) t;
else
throw new RuntimeException(t);</BUG>
}
| result += first;
result += " : ";
result += second;
context.setCurrentObject(target);
context.setCurrentType(Boolean.TYPE);
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
}
|
193,129 | context.setCurrentType(Boolean.TYPE);
return result;
} catch (NullPointerException e) {
e.printStackTrace();
throw new UnsupportedCompilationException("evaluation resulted in null expression.");
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException)t;
else
throw new RuntimeException(t);</BUG>
}
| context.setCurrentType(Boolean.TYPE);
return result;
} catch (NullPointerException e) {
e.printStackTrace();
throw new UnsupportedCompilationException("evaluation resulted in null expression.");
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
|
193,130 | result = pa.getSourceAccessor(context, context.getCurrentObject(), srcString);
_getterClass = context.getCurrentType();
}
}
}
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException)t;
else
throw new RuntimeException(t);</BUG>
}
| result = pa.getSourceAccessor(context, context.getCurrentObject(), srcString);
_getterClass = context.getCurrentType();
}
}
}
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
}
|
193,131 | }
_getterClass = context.getCurrentType();
}
}
}
<BUG>} catch (Throwable t) {
if (UnsupportedCompilationException.class.isInstance(t))
throw (UnsupportedCompilationException)t;
else
throw new RuntimeException(t);</BUG>
}
| }
}
}
} catch (Throwable t)
{
throw OgnlOps.castToRuntime(t);
}
if (m != null)
{
_getterClass = m.getReturnType();
context.setCurrentType(m.getReturnType());
context.setCurrentAccessor(OgnlRuntime.getCompiler().getSuperOrInterfaceClass(m, m.getDeclaringClass()));
}
|
193,132 | import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.util.Progressable;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AFileSystem extends FileSystem {</BUG>
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
| import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.util.Progressable;
import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
|
193,133 | public void initialize(URI name, Configuration conf) throws IOException {
super.initialize(name, conf);
uri = URI.create(name.getScheme() + "://" + name.getAuthority());
workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri,
this.getWorkingDirectory());
<BUG>String accessKey = conf.get(ACCESS_KEY, null);
String secretKey = conf.get(SECRET_KEY, null);
</BUG>
String userInfo = name.getUserInfo();
| public void initialize(URI name, Configuration conf) throws IOException {
super.initialize(name, conf);
uri = URI.create(name.getScheme() + "://" + name.getAuthority());
workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri,
this.getWorkingDirectory());
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null));
String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
String userInfo = name.getUserInfo();
|
193,134 | } else {
accessKey = userInfo;
}
}
AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain(
<BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey),
new InstanceProfileCredentialsProvider(),
new S3AAnonymousAWSCredentialsProvider()
);</BUG>
bucket = name.getHost();
| } else {
accessKey = userInfo;
}
}
AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain(
new BasicAWSCredentialsProvider(accessKey, secretKey),
new InstanceProfileCredentialsProvider(),
new AnonymousAWSCredentialsProvider()
);
bucket = name.getHost();
|
193,135 |
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT));
</BUG>
s3 = new AmazonS3Client(credentials, awsConf);
<BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS);
partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (partSize < 5 * 1024 * 1024) {
| new InstanceProfileCredentialsProvider(),
new AnonymousAWSCredentialsProvider()
);
bucket = name.getHost();
ClientConfiguration awsConf = new ClientConfiguration();
awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS)));
awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP);
awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES)));
awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)));
s3 = new AmazonS3Client(credentials, awsConf);
maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS));
partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE));
partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
|
193,136 | if (partSizeThreshold < 5 * 1024 * 1024) {
<BUG>LOG.error(MIN_MULTIPART_THRESHOLD + " must be at least 5 MB");
</BUG>
partSizeThreshold = 5 * 1024 * 1024;
}
<BUG>String cannedACLName = conf.get(CANNED_ACL, DEFAULT_CANNED_ACL);
</BUG>
if (!cannedACLName.isEmpty()) {
cannedACL = CannedAccessControlList.valueOf(cannedACLName);
} else {
| if (partSizeThreshold < 5 * 1024 * 1024) {
LOG.error(NEW_MIN_MULTIPART_THRESHOLD + " must be at least 5 MB");
partSizeThreshold = 5 * 1024 * 1024;
}
String cannedACLName = conf.get(NEW_CANNED_ACL, conf.get(OLD_CANNED_ACL, DEFAULT_CANNED_ACL));
if (!cannedACLName.isEmpty()) {
cannedACL = CannedAccessControlList.valueOf(cannedACLName);
} else {
|
193,137 | cannedACL = null;
}
if (!s3.doesBucketExist(bucket)) {
throw new IOException("Bucket " + bucket + " does not exist");
}
<BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART);
long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE);
</BUG>
if (purgeExistingMultipart) {
| cannedACL = null;
}
if (!s3.doesBucketExist(bucket)) {
throw new IOException("Bucket " + bucket + " does not exist");
}
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART));
long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
if (purgeExistingMultipart) {
|
193,138 | import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AOutputStream extends OutputStream {</BUG>
private OutputStream backupStream;
private File backupFile;
private boolean closed;
| import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
private OutputStream backupStream;
private File backupFile;
private boolean closed;
|
193,139 | this.client = client;
this.progress = progress;
this.fs = fs;
this.cannedACL = cannedACL;
this.statistics = statistics;
<BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (conf.get(BUFFER_DIR, null) != null) {
| this.client = client;
this.progress = progress;
this.fs = fs;
this.cannedACL = cannedACL;
this.statistics = statistics;
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
if (conf.get(BUFFER_DIR, null) != null) {
|
193,140 | import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import io.swagger.matchers.SerializationMatchers;
import io.swagger.models.ArrayModel;
import io.swagger.models.ModelImpl;
<BUG>import io.swagger.models.RefModel;
import io.swagger.models.parameters.BodyParameter;</BUG>
import io.swagger.models.parameters.HeaderParameter;
import io.swagger.models.parameters.Parameter;
import io.swagger.models.parameters.PathParameter;
| import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import io.swagger.matchers.SerializationMatchers;
import io.swagger.models.ArrayModel;
import io.swagger.models.ModelImpl;
import io.swagger.models.RefModel;
import io.swagger.models.Swagger;
import io.swagger.models.parameters.BodyParameter;
import io.swagger.models.parameters.HeaderParameter;
import io.swagger.models.parameters.Parameter;
import io.swagger.models.parameters.PathParameter;
|
193,141 | import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.IntegerProperty;
import io.swagger.models.properties.RefProperty;
import io.swagger.models.properties.StringProperty;
import io.swagger.util.Json;
<BUG>import com.fasterxml.jackson.databind.ObjectMapper;
import org.testng.annotations.Test;</BUG>
import java.io.IOException;
import java.util.Arrays;
public class ParameterSerializationTest {
| import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.IntegerProperty;
import io.swagger.models.properties.RefProperty;
import io.swagger.models.properties.StringProperty;
import io.swagger.util.Json;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.util.Yaml;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.Arrays;
public class ParameterSerializationTest {
|
193,142 | package io.swagger.models.parameters;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
<BUG>import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.slf4j.Logger;</BUG>
import org.slf4j.LoggerFactory;
import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.BaseIntegerProperty;
| package io.swagger.models.parameters;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.models.properties.DoubleProperty;
import io.swagger.models.properties.FloatProperty;
import io.swagger.models.properties.IntegerProperty;
import io.swagger.models.properties.LongProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.BaseIntegerProperty;
|
193,143 | import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.BaseIntegerProperty;
import io.swagger.models.properties.BooleanProperty;
import io.swagger.models.properties.DecimalProperty;
import io.swagger.models.properties.Property;
<BUG>import io.swagger.models.properties.StringProperty;
import java.util.List;</BUG>
@JsonPropertyOrder({ "name", "in", "description", "required", "type", "items", "collectionFormat", "default", "maximum",
"exclusiveMaximum", "minimum", "exclusiveMinimum", "maxLength", "minLength", "pattern", "maxItems", "minItems",
"uniqueItems", "multipleOf" })
| import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.BaseIntegerProperty;
import io.swagger.models.properties.BooleanProperty;
import io.swagger.models.properties.DecimalProperty;
import io.swagger.models.properties.Property;
import io.swagger.models.properties.StringProperty;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@JsonPropertyOrder({ "name", "in", "description", "required", "type", "items", "collectionFormat", "default", "maximum",
"exclusiveMaximum", "minimum", "exclusiveMinimum", "maxLength", "minLength", "pattern", "maxItems", "minItems",
"uniqueItems", "multipleOf" })
|
193,144 | String getFormat();
void setFormat(String format);
String getCollectionFormat();
void setCollectionFormat(String collectionFormat);
List<String> getEnum();
<BUG>void setEnum(List<String> _enum);
Integer getMaxLength();</BUG>
void setMaxLength(Integer maxLength);
Integer getMinLength();
void setMinLength(Integer minLength);
| String getFormat();
void setFormat(String format);
String getCollectionFormat();
void setCollectionFormat(String collectionFormat);
List<String> getEnum();
void setEnum(List<String> _enum);
List<Object> getEnumValue();
void setEnumValue(List<?> enumValue);
Integer getMaxLength();
void setMaxLength(Integer maxLength);
Integer getMinLength();
void setMinLength(Integer minLength);
|
193,145 | return choiceList.getSelectedObjects();
}
public String[] getItems() {
String[] items = new String[choiceList.getItemCount()];
for (int i = 0; i < items.length; i++) {
<BUG>items[i] = (String) choiceList.getItemAt(i);
}</BUG>
return items;
}
public String getLabel() {
| return choiceList.getSelectedObjects();
}
public String[] getItems() {
String[] items = new String[choiceList.getItemCount()];
for (int i = 0; i < items.length; i++) {
items[i] = choiceList.getItemAt(i);
}
return items;
}
public String getLabel() {
|
193,146 | double[][] data = new double[size][count];
int s = 0;
int cpt = 0;
for (BarGraph bar : eltList) {
if (bar.getChkBox().isSelected()) {
<BUG>int col = model.findColumn((String) columnsList.getItemAt(cpt));
for (int idx=0; idx < count; idx++) {</BUG>
data[s][idx] = ((Number)model.getValueAt(idx,col)).doubleValue();
}
s++;
| double[][] data = new double[size][count];
int s = 0;
int cpt = 0;
for (BarGraph bar : eltList) {
if (bar.getChkBox().isSelected()) {
int col = model.findColumn(columnsList.getItemAt(cpt));
for (int idx=0; idx < count; idx++) {
data[s][idx] = ((Number)model.getValueAt(idx,col)).doubleValue();
}
s++;
|
193,147 | @Override
public void afterExecute(Bus handler, SingleResponse<Relationship> result) {
if (result.hasData()) {
handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData()));
} else if (result.hasException()) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, "Unable to update friendship", result.getException());
}</BUG>
}
| @Override
public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
193,148 | MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
DebugLog.w(LOGTAG, null, e);
|
193,149 | for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
DebugLog.w(LOGTAG, null, e);
}
|
193,150 | import de.vanita5.twittnuker.receiver.NotificationReceiver;
import de.vanita5.twittnuker.service.LengthyOperationsService;
import de.vanita5.twittnuker.util.ActivityTracker;
import de.vanita5.twittnuker.util.AsyncTwitterWrapper;
import de.vanita5.twittnuker.util.DataStoreFunctionsKt;
<BUG>import de.vanita5.twittnuker.util.DataStoreUtils;
import de.vanita5.twittnuker.util.ImagePreloader;</BUG>
import de.vanita5.twittnuker.util.InternalTwitterContentUtils;
import de.vanita5.twittnuker.util.JsonSerializer;
import de.vanita5.twittnuker.util.NotificationManagerWrapper;
| import de.vanita5.twittnuker.receiver.NotificationReceiver;
import de.vanita5.twittnuker.service.LengthyOperationsService;
import de.vanita5.twittnuker.util.ActivityTracker;
import de.vanita5.twittnuker.util.AsyncTwitterWrapper;
import de.vanita5.twittnuker.util.DataStoreFunctionsKt;
import de.vanita5.twittnuker.util.DataStoreUtils;
import de.vanita5.twittnuker.util.DebugLog;
import de.vanita5.twittnuker.util.ImagePreloader;
import de.vanita5.twittnuker.util.InternalTwitterContentUtils;
import de.vanita5.twittnuker.util.JsonSerializer;
import de.vanita5.twittnuker.util.NotificationManagerWrapper;
|
193,151 | final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, ignore);
}</BUG>
}
| final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
DebugLog.w(LOGTAG, null, ignore);
}
|
193,152 | import de.vanita5.twittnuker.annotation.CustomTabType;
import de.vanita5.twittnuker.library.MicroBlog;
import de.vanita5.twittnuker.library.MicroBlogException;
import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus;
import de.vanita5.twittnuker.library.twitter.model.Status;
<BUG>import de.vanita5.twittnuker.fragment.AbsStatusesFragment;
import org.mariotaku.sqliteqb.library.AllColumns;</BUG>
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
| import de.vanita5.twittnuker.annotation.CustomTabType;
import de.vanita5.twittnuker.library.MicroBlog;
import de.vanita5.twittnuker.library.MicroBlogException;
import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus;
import de.vanita5.twittnuker.library.twitter.model.Status;
import de.vanita5.twittnuker.fragment.AbsStatusesFragment;
import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
|
193,153 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
Location location = null;
|
193,154 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
Utils.closeSilently(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
193,155 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBackgroundImage(fileBody, tile);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
Utils.closeSilently(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
193,156 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
return twitter.updateProfileImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
Utils.closeSilently(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
193,157 | import java.util.List;
import java.util.Map.Entry;
import javax.inject.Singleton;
import okhttp3.Dns;
@Singleton
<BUG>public class TwidereDns implements Constants, Dns {
</BUG>
private static final String RESOLVER_LOGTAG = "TwittnukerDns";
private final SharedPreferences mHostMapping;
private final SharedPreferencesWrapper mPreferences;
| import java.util.List;
import java.util.Map.Entry;
import javax.inject.Singleton;
import okhttp3.Dns;
@Singleton
public class TwidereDns implements Dns, Constants {
private static final String RESOLVER_LOGTAG = "TwittnukerDns";
private final SharedPreferences mHostMapping;
private final SharedPreferencesWrapper mPreferences;
|
193,158 | private List<InetAddress> resolveInternal(final String originalHost, final String host, final int depth,
final boolean useResolver) throws IOException, SecurityException {
final TimingLogger logger = new TimingLogger(RESOLVER_LOGTAG, "resolve");
final List<InetAddress> fromAddressString = fromAddressString(originalHost, host);
if (fromAddressString != null) {
<BUG>if (BuildConfig.DEBUG) {</BUG>
addLogSplit(logger, host, "valid ip address", depth);
dumpLog(logger, fromAddressString);
<BUG>}</BUG>
return fromAddressString;
| private List<InetAddress> resolveInternal(final String originalHost, final String host, final int depth,
final boolean useResolver) throws IOException, SecurityException {
final TimingLogger logger = new TimingLogger(RESOLVER_LOGTAG, "resolve");
final List<InetAddress> fromAddressString = fromAddressString(originalHost, host);
if (fromAddressString != null) {
addLogSplit(logger, host, "valid ip address", depth);
dumpLog(logger, fromAddressString);
return fromAddressString;
|
193,159 | if (useResolver) {
addLogSplit(logger, host, "start /etc/hosts resolve", depth);
final List<InetAddress> fromSystemHosts = fromSystemHosts(host);
addLogSplit(logger, host, "end /etc/hosts resolve", depth);
if (fromSystemHosts != null) {
<BUG>if (BuildConfig.DEBUG) {</BUG>
dumpLog(logger, fromSystemHosts);
<BUG>}</BUG>
return fromSystemHosts;
}
| if (useResolver) {
addLogSplit(logger, host, "start /etc/hosts resolve", depth);
final List<InetAddress> fromSystemHosts = fromSystemHosts(host);
addLogSplit(logger, host, "end /etc/hosts resolve", depth);
if (fromSystemHosts != null) {
dumpLog(logger, fromSystemHosts);
return fromSystemHosts;
}
|
193,160 | dumpLog(logger, fromDefault);
<BUG>}</BUG>
return fromDefault;
}
<BUG>private void dumpLog(final TimingLogger logger, @NonNull List<InetAddress> addresses) {
Log.v(RESOLVER_LOGTAG, "Resolved " + addresses);</BUG>
logger.dumpToLog();
}
<BUG>private void addLogSplit(final TimingLogger logger, String host, String message, int depth) {
final StringBuilder sb = new StringBuilder();</BUG>
for (int i = 0; i < depth; i++) {
| dumpLog(logger, fromDefault);
return fromDefault;
}
private void dumpLog(final TimingLogger logger, @NonNull List<InetAddress> addresses) {
if (BuildConfig.DEBUG) return;
Log.v(RESOLVER_LOGTAG, "Resolved " + addresses);
logger.dumpToLog();
}
private void addLogSplit(final TimingLogger logger, String host, String message, int depth) {
if (BuildConfig.DEBUG) return;
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < depth; i++) {
|
193,161 | package org.onosproject.sdxl3;
<BUG>import com.google.common.collect.ImmutableList;
import org.apache.felix.scr.annotations.Activate;</BUG>
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
| package org.onosproject.sdxl3;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
|
193,162 | import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.intent.Constraint;
import org.onosproject.net.intent.Key;
import org.onosproject.net.intent.MultiPointToSinglePointIntent;
import org.onosproject.net.intent.constraint.PartialFailureConstraint;
<BUG>import org.onosproject.routing.FibListener;
import org.onosproject.routing.FibUpdate;</BUG>
import org.onosproject.routing.IntentSynchronizationService;
<BUG>import org.onosproject.routing.RoutingService;</BUG>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<BUG>import java.util.Collection;</BUG>
import java.util.HashSet;
| import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.intent.Constraint;
import org.onosproject.net.intent.Key;
import org.onosproject.net.intent.MultiPointToSinglePointIntent;
import org.onosproject.net.intent.constraint.PartialFailureConstraint;
import org.onosproject.routing.IntentSynchronizationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashSet;
|
193,163 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected IntentSynchronizationService intentSynchronizer;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected CoreService coreService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
<BUG>protected RoutingService routingService;
</BUG>
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected SdxL3PeerService peerService;
<BUG>private final InternalFibListener fibListener = new InternalFibListener();
private static final int PRIORITY_OFFSET = 100;</BUG>
private static final int PRIORITY_MULTIPLIER = 5;
| @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected InterfaceService interfaceService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected IntentSynchronizationService intentSynchronizer;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected CoreService coreService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected RouteService routeService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected SdxL3PeerService peerService;
private final InternalRouteListener routeListener = new InternalRouteListener();
private final InternalInterfaceListener interfaceListener = new InternalInterfaceListener();
private static final int PRIORITY_OFFSET = 100;
private static final int PRIORITY_MULTIPLIER = 5;
|
193,164 | private final Map<IpPrefix, MultiPointToSinglePointIntent> routeIntents
= new ConcurrentHashMap<>();
private ApplicationId appId;
@Activate
public void activate() {
<BUG>appId = coreService.getAppId(SdxL3.SDX_L3_APP);
routingService.addFibListener(fibListener);
routingService.start();</BUG>
}
| private final Map<IpPrefix, MultiPointToSinglePointIntent> routeIntents
= new ConcurrentHashMap<>();
private ApplicationId appId;
@Activate
public void activate() {
appId = coreService.getAppId(SdxL3.SDX_L3_APP);
interfaceService.addListener(interfaceListener);
routeService.addListener(routeListener);
}
|
193,165 | GL11.glDisable (GL11.GL_TEXTURE_2D);
GL11.glDisable (GL11.GL_TEXTURE_GEN_S);
GL11.glDisable (GL11.GL_TEXTURE_GEN_T);
GL11.glShadeModel (GL11.GL_FLAT);
GL11.glEnable (GL11.GL_DEPTH_TEST);
<BUG>GL11.glDepthFunc (GL11.GL_LESS);
for( BrLight light : lights ) {</BUG>
light.enable();
}
| GL11.glDisable (GL11.GL_TEXTURE_2D);
GL11.glDisable (GL11.GL_TEXTURE_GEN_S);
GL11.glDisable (GL11.GL_TEXTURE_GEN_T);
GL11.glShadeModel (GL11.GL_FLAT);
GL11.glEnable (GL11.GL_DEPTH_TEST);
GL11.glDepthFunc (GL11.GL_LEQUAL);
GL11.glEnable (GL11.GL_CULL_FACE);
GL11.glCullFace (GL11.GL_BACK);
GL11.glMatrixMode (GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
for( BrLight light : lights ) {
light.enable();
}
|
193,166 | GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glColor4f(1,1,1,1);
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(0).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
<BUG>GL11.glNormal3f(0f, 0f, 1f);
</BUG>
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Left
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Right
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, SkyboxUnit); // Top Right
| GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glColor4f(1,1,1,1);
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(0).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
GL11.glNormal3f(0f, 0f, -1f);
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Left
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Right
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, SkyboxUnit); // Top Right
|
193,167 | GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, SkyboxUnit); // Top Left
GL11.glEnd();
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(1).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
<BUG>GL11.glNormal3f(1f, 0f, 0f);
</BUG>
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Left
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Right
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, SkyboxUnit); // Top Right
| GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, SkyboxUnit); // Top Left
GL11.glEnd();
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(1).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
GL11.glNormal3f(-1f, 0f, 0f);
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Left
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Right
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, SkyboxUnit); // Top Right
|
193,168 | GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Left;
GL11.glEnd();
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(2).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
<BUG>GL11.glNormal3f(0f, 0f, -1f);
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Right</BUG>
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Right
GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Left
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Left
| GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Left;
GL11.glEnd();
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(2).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
GL11.glNormal3f(0f, 0f, 1f);
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Right
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Right
GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Left
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Left
|
193,169 | GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Left
GL11.glEnd();
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(3).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
<BUG>GL11.glNormal3f(-1f, 0f, 0f);
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Right</BUG>
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Right
GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, SkyboxUnit); // Top Left
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Left
| GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Left
GL11.glEnd();
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(3).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
GL11.glNormal3f(1f, 0f, 0f);
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Bottom Right
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Right
GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, SkyboxUnit); // Top Left
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Left
|
193,170 | GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Left
GL11.glEnd();
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(4).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
<BUG>GL11.glNormal3f(0f, -1f, 0f);
GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Left</BUG>
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, SkyboxUnit); // Bottom Left
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, SkyboxUnit); // Bottom Right
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Right
| GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Left
GL11.glEnd();
clampToEdge();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures.get(4).getTextureID());
GL11.glBegin(GL11.GL_QUADS);
GL11.glNormal3f(0f, 1f, 0f);
GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Left
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, SkyboxUnit, SkyboxUnit); // Bottom Left
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, SkyboxUnit); // Bottom Right
GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, SkyboxUnit, -SkyboxUnit); // Top Right
|
193,171 | GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Top Left
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Left
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Right
GL11.glEnd();
GL11.glPopAttrib();
<BUG>GL11.glPopMatrix();
}</BUG>
private void clampToEdge() {
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);
| GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, -SkyboxUnit); // Top Left
GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3f( SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Left
GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex3f(-SkyboxUnit, -SkyboxUnit, SkyboxUnit); // Bottom Right
GL11.glEnd();
GL11.glPopAttrib();
GL11.glPopMatrix();
GL11.glDepthMask( false );
GL11.glEnable( GL11.GL_DEPTH_TEST );
GL11.glEnable (GL11.GL_CULL_FACE);
GL11.glCullFace (GL11.GL_BACK);
}
private void clampToEdge() {
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);
|
193,172 | ArrayList<Hotel> hotels = new ArrayList<Hotel>();
for(ProtectedRegion r : WorldGuardManager.getRegions(w)){
String id = r.getId();
if(id.matches("hotel-\\w+$")){
String name = id.replaceFirst("hotel-", "");
<BUG>Hotel hotel = new Hotel(w,name);
</BUG>
hotels.add(hotel);
}
}
| ArrayList<Hotel> hotels = new ArrayList<Hotel>();
for(ProtectedRegion r : WorldGuardManager.getRegions(w)){
String id = r.getId();
if(id.matches("hotel-\\w+$")){
String name = id.replaceFirst("hotel-", "");
Hotel hotel = new Hotel(w, name);
hotels.add(hotel);
}
}
|
193,173 | for(World w : worlds)
hotels.addAll(getHotelsInWorld(w));
return hotels;
}
public static ArrayList<Hotel> getHotelsOwnedBy(UUID uuid){
<BUG>ArrayList<Hotel> hotels = getAllHotels();
for(Hotel hotel : hotels){
if(!hotel.isOwner(uuid))
hotels.remove(hotel);
}
hotels.trimToSize();
return hotels;
</BUG>
}
| for(World w : worlds)
hotels.addAll(getHotelsInWorld(w));
return hotels;
}
public static ArrayList<Hotel> getHotelsOwnedBy(UUID uuid){
ArrayList<Hotel> hotels = getAllHotels();
ArrayList<Hotel> owned = new ArrayList<Hotel>();
for(Hotel hotel : hotels){
if(hotel.isOwner(uuid))
owned.add(hotel);
}
return owned;
}
|
193,174 | import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.UUID;
import org.bukkit.Bukkit;
<BUG>import org.bukkit.Location;
import org.bukkit.World;</BUG>
import org.bukkit.block.Block;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
| import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
|
193,175 | private World world;
private String name;
public YamlConfiguration hconfig;
public Hotel(World world, String name){
this.world = world;
<BUG>this.name = name;
this.hconfig = getHotelConfig();</BUG>
}
public Hotel(String name){
this.name = name;
| private World world;
private String name;
public YamlConfiguration hconfig;
public Hotel(World world, String name){
this.world = world;
this.name = name.toLowerCase();
this.hconfig = getHotelConfig();
}
public Hotel(String name){
this.name = name;
|
193,176 | }
public boolean isInCreationMode(UUID uuid){
</BUG>
return HotelsConfigHandler.getInventoryFile(uuid).exists();
}
<BUG>public void hotelSetup(String hotelName, CommandSender s){
</BUG>
Player p = (Player) s;
if(hotelName.contains("-")){ p.sendMessage(Mes.mes("chat.creationMode.invalidChar")); return; }
if(Mes.hasPerm(p, "hotels.create")){ p.sendMessage(Mes.mes("chat.noPermission")); return; }
| }
public static boolean isInCreationMode(UUID uuid){
return HotelsConfigHandler.getInventoryFile(uuid).exists();
}
public static void hotelSetup(String hotelName, CommandSender s){
Player p = (Player) s;
if(hotelName.contains("-")){ p.sendMessage(Mes.mes("chat.creationMode.invalidChar")); return; }
if(Mes.hasPerm(p, "hotels.create")){ p.sendMessage(Mes.mes("chat.noPermission")); return; }
|
193,177 | Selection sel = getWorldEdit().getSelection(p);
Hotel hotel = new Hotel(p.getWorld(), hotelName);
if(hotel.exists()){ p.sendMessage(Mes.mes("chat.creationMode.hotelCreationFailed")); return; }
if(sel==null){ p.sendMessage(Mes.mes("chat.creationMode.noSelection")); return; }
int ownedHotels = HotelsAPI.getHotelsOwnedBy(p.getUniqueId()).size();
<BUG>int maxHotels = plugin.getConfig().getInt("settings.max_hotels_owned");
</BUG>
if(ownedHotels>maxHotels && !Mes.hasPerm(p, "hotels.create.admin")){
p.sendMessage((Mes.mes("chat.commands.create.maxHotelsReached")).replaceAll("%max%", String.valueOf(maxHotels))); return;
}
| Selection sel = getWorldEdit().getSelection(p);
Hotel hotel = new Hotel(p.getWorld(), hotelName);
if(hotel.exists()){ p.sendMessage(Mes.mes("chat.creationMode.hotelCreationFailed")); return; }
if(sel==null){ p.sendMessage(Mes.mes("chat.creationMode.noSelection")); return; }
int ownedHotels = HotelsAPI.getHotelsOwnedBy(p.getUniqueId()).size();
int maxHotels = HotelsConfigHandler.getconfigyml().getInt("settings.max_hotels_owned");
if(ownedHotels>maxHotels && !Mes.hasPerm(p, "hotels.create.admin")){
p.sendMessage((Mes.mes("chat.commands.create.maxHotelsReached")).replaceAll("%max%", String.valueOf(maxHotels))); return;
}
|
193,178 | else{
p.sendMessage(Mes.mes("chat.creationMode.selectionInvalid")); return; }
hotel.create(r, p);
Bukkit.getPluginManager().callEvent(new HotelCreateEvent(hotel)); //Call HotelCreateEvent
}
<BUG>public void roomSetup(String hotelName,int roomNum,Player p){
</BUG>
Selection sel = getWorldEdit().getSelection(p);
World world = p.getWorld();
Hotel hotel = new Hotel(world, hotelName);
| else{
p.sendMessage(Mes.mes("chat.creationMode.selectionInvalid")); return; }
hotel.create(r, p);
Bukkit.getPluginManager().callEvent(new HotelCreateEvent(hotel)); //Call HotelCreateEvent
}
public static void roomSetup(String hotelName, int roomNum, Player p){
Selection sel = getWorldEdit().getSelection(p);
World world = p.getWorld();
Hotel hotel = new Hotel(world, hotelName);
|
193,179 | Selection sel = getWorldEdit().getSelection(p);
World world = p.getWorld();
Hotel hotel = new Hotel(world, hotelName);
if(!hotel.exists()){ p.sendMessage(Mes.mes("chat.creationMode.rooms.fail")); return; }
Room room = new Room(hotel, roomNum);
<BUG>if(room.exists()){ p.sendMessage(Mes.mes("chat.creationMode.rooms.alreadyExists")); return; }
ProtectedRegion pr = hotel.getRegion();</BUG>
if(sel==null){ p.sendMessage(Mes.mes("chat.creationMode.noSelection")); return; }
if((sel instanceof Polygonal2DSelection) && (pr.containsAny(((Polygonal2DSelection) sel).getNativePoints()))||
((sel instanceof CuboidSelection) && (pr.contains(sel.getNativeMinimumPoint()) && pr.contains(sel.getNativeMaximumPoint())))){
| Selection sel = getWorldEdit().getSelection(p);
World world = p.getWorld();
Hotel hotel = new Hotel(world, hotelName);
if(!hotel.exists()){ p.sendMessage(Mes.mes("chat.creationMode.rooms.fail")); return; }
Room room = new Room(hotel, roomNum);
if(room.exists()){ p.sendMessage(Mes.mes("chat.creationMode.rooms.alreadyExists")); return; }
RoomCreateEvent rce = new RoomCreateEvent(room);
Bukkit.getPluginManager().callEvent(rce);// Call RoomCreateEvent
if(rce.isCancelled()) return;
ProtectedRegion pr = hotel.getRegion();
if(sel==null){ p.sendMessage(Mes.mes("chat.creationMode.noSelection")); return; }
if((sel instanceof Polygonal2DSelection) && (pr.containsAny(((Polygonal2DSelection) sel).getNativePoints()))||
((sel instanceof CuboidSelection) && (pr.contains(sel.getNativeMinimumPoint()) && pr.contains(sel.getNativeMaximumPoint())))){
|
193,180 | r = new ProtectedPolygonalRegion("Hotel-"+hotelName+"-"+room, points, minY, maxY);
}
else{
p.sendMessage(Mes.mes("chat.creationMode.selectionInvalid")); return; }
room.createRegion(r, p);
<BUG>Bukkit.getPluginManager().callEvent(new RoomCreateEvent(room));// Call RoomCreateEvent</BUG>
}
else
p.sendMessage(Mes.mes("chat.creationMode.rooms.notInHotel"));
}
<BUG>public void resetInventoryFiles(CommandSender s){
</BUG>
Player p = ((Player) s);
| r = new ProtectedPolygonalRegion("Hotel-"+hotelName+"-"+room, points, minY, maxY);
}
else{
p.sendMessage(Mes.mes("chat.creationMode.selectionInvalid")); return; }
room.createRegion(r, p);
}
else
p.sendMessage(Mes.mes("chat.creationMode.rooms.notInHotel"));
}
public static void resetInventoryFiles(CommandSender s){
Player p = ((Player) s);
|
193,181 | UUID playerUUID = p.getUniqueId();
File invFile = HotelsConfigHandler.getInventoryFile(playerUUID);
if(invFile.exists())
invFile.delete();
}
<BUG>public void saveInventory(CommandSender s){
</BUG>
Player p = ((Player) s);
UUID playerUUID = p.getUniqueId();
PlayerInventory pinv = p.getInventory();
| UUID playerUUID = p.getUniqueId();
File invFile = HotelsConfigHandler.getInventoryFile(playerUUID);
if(invFile.exists())
invFile.delete();
}
public static void saveInventory(CommandSender s){
Player p = ((Player) s);
UUID playerUUID = p.getUniqueId();
PlayerInventory pinv = p.getInventory();
|
193,182 | package org.literacyapp.model.contributor;
import java.util.Calendar;
<BUG>import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;</BUG>
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
| package org.literacyapp.model.contributor;
import java.util.Calendar;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
|
193,183 | import javax.persistence.Temporal;</BUG>
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.literacyapp.model.BaseEntity;
import org.literacyapp.model.Contributor;
<BUG>@Entity
public class ContributorEvent extends BaseEntity {
</BUG>
@NotNull
@ManyToOne
| package org.literacyapp.model.contributor;
import java.util.Calendar;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.literacyapp.model.BaseEntity;
import org.literacyapp.model.Contributor;
@MappedSuperclass
public abstract class ContributorEvent extends BaseEntity {
@NotNull
@ManyToOne
|
193,184 | import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
<BUG>import org.literacyapp.dao.ContentCreationEventDao;</BUG>
import org.literacyapp.model.Contributor;
import org.literacyapp.model.content.Allophone;
<BUG>import org.literacyapp.model.contributor.ContentCreationEvent;</BUG>
import org.literacyapp.model.enums.Environment;
| import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
import org.literacyapp.model.Contributor;
import org.literacyapp.model.content.Allophone;
import org.literacyapp.model.enums.Environment;
|
193,185 | @RequestMapping("/content/allophone/create")
public class AllophoneCreateController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
<BUG>@Autowired
private ContentCreationEventDao contentCreationEventDao;</BUG>
@Autowired
private MessageSource messageSource;
@RequestMapping(method = RequestMethod.GET)
| @RequestMapping("/content/allophone/create")
public class AllophoneCreateController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
@Autowired
private MessageSource messageSource;
@RequestMapping(method = RequestMethod.GET)
|
193,186 | package org.literacyapp.web.content.allophone;
<BUG>import java.net.URLEncoder;</BUG>
import java.util.Calendar;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
<BUG>import org.literacyapp.dao.ContentCreationEventDao;</BUG>
import org.literacyapp.model.Contributor;
| package org.literacyapp.web.content.allophone;
import java.util.Calendar;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
import org.literacyapp.model.Contributor;
|
193,187 | import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
<BUG>import org.literacyapp.dao.ContentCreationEventDao;</BUG>
import org.literacyapp.model.Contributor;
import org.literacyapp.model.content.Allophone;
<BUG>import org.literacyapp.model.contributor.ContentCreationEvent;
import org.literacyapp.model.enums.Environment;
import org.literacyapp.model.enums.Team;
import org.literacyapp.util.SlackApiHelper;
import org.literacyapp.web.context.EnvironmentContextLoaderListener;</BUG>
import org.springframework.beans.factory.annotation.Autowired;
| import org.apache.log4j.Logger;
import org.literacyapp.dao.AllophoneDao;
import org.literacyapp.model.Contributor;
import org.literacyapp.model.content.Allophone;
import org.springframework.beans.factory.annotation.Autowired;
|
193,188 | @RequestMapping("/content/allophone/edit")
public class AllophoneEditController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
<BUG>@Autowired
private ContentCreationEventDao contentCreationEventDao;</BUG>
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(Model model, @PathVariable Long id) {
logger.info("handleRequest");
| @RequestMapping("/content/allophone/edit")
public class AllophoneEditController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(Model model, @PathVariable Long id) {
logger.info("handleRequest");
|
193,189 | import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/content")
public class MainContentController {
private final Logger logger = Logger.getLogger(getClass());
<BUG>@Autowired
private ContentCreationEventDao contentCreationEventDao;</BUG>
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(
HttpServletRequest request,
| import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/content")
public class MainContentController {
private final Logger logger = Logger.getLogger(getClass());
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(
HttpServletRequest request,
|
193,190 | final Survey shouldBeNull = api.getPeople().getSurveyIfAvailable();
assertNull(shouldBeNull);
mExpectations.expect(
"https://decide.mixpanel.com/decide?version=1&lib=android&token=TEST+TOKEN+testSurveyChecks&distinct_id=DECIDE+CHECKS+ID+1" + mAppProperties,
"{" +
<BUG>"\"notifications\":[{\"body\":\"Hook me up, yo!\",\"title\":\"Tranya?\",\"message_id\":1781,\"image_url\":\"http://mixpanel.com/Balok.jpg\",\"cta\":\"I'm Down!\",\"cta_url\":\"http://www.mixpanel.com\",\"id\":119911,\"type\":\"mini\",\"style\":\"dark\"}]," +
"\"surveys\":[{\"collections\":[{\"id\":3319,\"name\":\"All users 2\"}],\"id\":397,\"questions\":[{\"prompt\":\"prompt text\",\"extra_data\":{},\"type\":\"text\",\"id\":457}],\"name\":\"Demo survey\"}]," +</BUG>
"\"event_bindings\": [{\"event_name\":\"EVENT NAME\",\"path\":[{\"index\":0,\"view_class\":\"com.android.internal.policy.impl.PhoneWindow.DecorView\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarOverlayLayout\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarContainer\"}],\"target_activity\":\"ACTIVITY\",\"event_type\":\"EVENT TYPE\"}]" +
"}"
);
| final Survey shouldBeNull = api.getPeople().getSurveyIfAvailable();
assertNull(shouldBeNull);
mExpectations.expect(
"https://decide.mixpanel.com/decide?version=1&lib=android&token=TEST+TOKEN+testSurveyChecks&distinct_id=DECIDE+CHECKS+ID+1" + mAppProperties,
"{" +
"\"notifications\":[{\"id\": 119911, \"message_id\": 4321, \"type\": \"takeover\", \"body\": \"Hook me up, yo!\", \"body_color\": 4294901760, \"title\": null, \"title_color\": 4278255360, \"image_url\": \"http://mixpanel.com/Balok.jpg\", \"bg_color\": 3909091328, \"close_color\": 4294967295, \"extras\": {\"image_fade\": true},\"buttons\": [{\"text\": \"Button!\", \"text_color\": 4278190335, \"bg_color\": 4294967040, \"border_color\": 4278255615, \"cta_url\": \"hellomixpanel://deeplink/howareyou\"}, {\"text\": \"Button 2!\", \"text_color\": 4278190335, \"bg_color\": 4294967040, \"border_color\": 4278255615, \"cta_url\": \"hellomixpanel://deeplink/howareyou\"}]}]," +
"\"surveys\":[{\"collections\":[{\"id\":3319,\"name\":\"All users 2\"}],\"id\":397,\"questions\":[{\"prompt\":\"prompt text\",\"extra_data\":{},\"type\":\"text\",\"id\":457}],\"name\":\"Demo survey\"}]," +
"\"event_bindings\": [{\"event_name\":\"EVENT NAME\",\"path\":[{\"index\":0,\"view_class\":\"com.android.internal.policy.impl.PhoneWindow.DecorView\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarOverlayLayout\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarContainer\"}],\"target_activity\":\"ACTIVITY\",\"event_type\":\"EVENT TYPE\"}]" +
"}"
);
|
193,191 | assertNull(api.getPeople().getSurveyIfAvailable());
assertNull(api.getPeople().getNotificationIfAvailable());
mExpectations.expect(
"https://decide.mixpanel.com/decide?version=1&lib=android&token=TEST+TOKEN+testSurveyChecks&distinct_id=DECIDE+CHECKS+ID+1" + mAppProperties,
"{" +
<BUG>"\"notifications\":[{\"body\":\"b\",\"title\":\"t\",\"message_id\":1111,\"image_url\":\"http://mixpanel.com/Balok.jpg\",\"cta\":\"c1\",\"cta_url\":\"http://www.mixpanel.com\",\"id\":3333,\"type\":\"mini\",\"style\":\"dark\"}]," +
"\"surveys\":[{\"collections\":[{\"id\":3319,\"name\":\"n\"}],\"id\":8888,\"questions\":[{\"prompt\":\"p\",\"extra_data\":{},\"type\":\"text\",\"id\":457}],\"name\":\"N2\"}]," +</BUG>
"\"event_bindings\": [{\"event_name\":\"EVENT NAME\",\"path\":[{\"index\":0,\"view_class\":\"com.android.internal.policy.impl.PhoneWindow.DecorView\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarOverlayLayout\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarContainer\"}],\"target_activity\":\"ACTIVITY\",\"event_type\":\"EVENT TYPE\"}]" +
"}"
);
| assertNull(api.getPeople().getSurveyIfAvailable());
assertNull(api.getPeople().getNotificationIfAvailable());
mExpectations.expect(
"https://decide.mixpanel.com/decide?version=1&lib=android&token=TEST+TOKEN+testSurveyChecks&distinct_id=DECIDE+CHECKS+ID+1" + mAppProperties,
"{" +
"\"notifications\":[{\"id\": 3333, \"message_id\": 4321, \"type\": \"takeover\", \"body\": \"Hook me up, yo!\", \"body_color\": 4294901760, \"title\": null, \"title_color\": 4278255360, \"image_url\": \"http://mixpanel.com/Balok.jpg\", \"bg_color\": 3909091328, \"close_color\": 4294967295, \"extras\": {\"image_fade\": true},\"buttons\": [{\"text\": \"Button!\", \"text_color\": 4278190335, \"bg_color\": 4294967040, \"border_color\": 4278255615, \"cta_url\": \"hellomixpanel://deeplink/howareyou\"}, {\"text\": \"Button 2!\", \"text_color\": 4278190335, \"bg_color\": 4294967040, \"border_color\": 4278255615, \"cta_url\": \"hellomixpanel://deeplink/howareyou\"}]}]," +
"\"surveys\":[{\"collections\":[{\"id\":3319,\"name\":\"n\"}],\"id\":8888,\"questions\":[{\"prompt\":\"p\",\"extra_data\":{},\"type\":\"text\",\"id\":457}],\"name\":\"N2\"}]," +
"\"event_bindings\": [{\"event_name\":\"EVENT NAME\",\"path\":[{\"index\":0,\"view_class\":\"com.android.internal.policy.impl.PhoneWindow.DecorView\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarOverlayLayout\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarContainer\"}],\"target_activity\":\"ACTIVITY\",\"event_type\":\"EVENT TYPE\"}]" +
"}"
);
|
193,192 | assertNull(api.getPeople().getSurveyIfAvailable());
assertNull(api.getPeople().getNotificationIfAvailable());
mExpectations.expect(
"https://decide.mixpanel.com/decide?version=1&lib=android&token=TEST+TOKEN+testSurveyChecks&distinct_id=DECIDE+CHECKS+ID+1" + mAppProperties,
"{" +
<BUG>"\"notifications\":[{\"body\":\"b\",\"title\":\"t\",\"message_id\":1111,\"image_url\":\"http://mixpanel.com/Balok.jpg\",\"cta\":\"c1\",\"cta_url\":\"http://www.mixpanel.com\",\"id\":3333,\"type\":\"mini\",\"style\":\"dark\"}]," +
"\"surveys\":[{\"collections\":[{\"id\":3319,\"name\":\"n\"}],\"id\":8888,\"questions\":[{\"prompt\":\"p\",\"extra_data\":{},\"type\":\"text\",\"id\":457}],\"name\":\"N2\"}]," +</BUG>
"\"event_bindings\": [{\"event_name\":\"EVENT NAME\",\"path\":[{\"index\":0,\"view_class\":\"com.android.internal.policy.impl.PhoneWindow.DecorView\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarOverlayLayout\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarContainer\"}],\"target_activity\":\"ACTIVITY\",\"event_type\":\"EVENT TYPE\"}]" +
"}"
);
| assertNull(api.getPeople().getSurveyIfAvailable());
assertNull(api.getPeople().getNotificationIfAvailable());
mExpectations.expect(
"https://decide.mixpanel.com/decide?version=1&lib=android&token=TEST+TOKEN+testSurveyChecks&distinct_id=DECIDE+CHECKS+ID+1" + mAppProperties,
"{" +
"\"notifications\":[{\"id\": 3333, \"message_id\": 4321, \"type\": \"takeover\", \"body\": \"Hook me up, yo!\", \"body_color\": 4294901760, \"title\": null, \"title_color\": 4278255360, \"image_url\": \"http://mixpanel.com/Balok.jpg\", \"bg_color\": 3909091328, \"close_color\": 4294967295, \"extras\": {\"image_fade\": true},\"buttons\": [{\"text\": \"Button!\", \"text_color\": 4278190335, \"bg_color\": 4294967040, \"border_color\": 4278255615, \"cta_url\": \"hellomixpanel://deeplink/howareyou\"}, {\"text\": \"Button 2!\", \"text_color\": 4278190335, \"bg_color\": 4294967040, \"border_color\": 4278255615, \"cta_url\": \"hellomixpanel://deeplink/howareyou\"}]}]," +
"\"surveys\":[{\"collections\":[{\"id\":3319,\"name\":\"n\"}],\"id\":8888,\"questions\":[{\"prompt\":\"p\",\"extra_data\":{},\"type\":\"text\",\"id\":457}],\"name\":\"N2\"}]," +
"\"event_bindings\": [{\"event_name\":\"EVENT NAME\",\"path\":[{\"index\":0,\"view_class\":\"com.android.internal.policy.impl.PhoneWindow.DecorView\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarOverlayLayout\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarContainer\"}],\"target_activity\":\"ACTIVITY\",\"event_type\":\"EVENT TYPE\"}]" +
"}"
);
|
193,193 | editor.putString("people_distinct_id", "Present Before Construction");
editor.commit();
mExpectations.expect(
"https://decide.mixpanel.com/decide?version=1&lib=android&token=TEST+IDENTIFIED+ON+CONSTRUCTION&distinct_id=Present+Before+Construction" + mAppProperties,
"{" +
<BUG>"\"notifications\":[{\"body\":\"b\",\"title\":\"t\",\"message_id\":1111,\"image_url\":\"http://mixpanel.com/Balok.jpg\",\"cta\":\"c1\",\"cta_url\":\"http://www.mixpanel.com\",\"id\":3333,\"type\":\"mini\",\"style\":\"dark\"}]," +
"\"surveys\":[{\"collections\":[{\"id\":3319,\"name\":\"n\"}],\"id\":8888,\"questions\":[{\"prompt\":\"p\",\"extra_data\":{},\"type\":\"text\",\"id\":457}],\"name\":\"N2\"}]," +</BUG>
"\"event_bindings\": [{\"event_name\":\"EVENT NAME\",\"path\":[{\"index\":0,\"view_class\":\"com.android.internal.policy.impl.PhoneWindow.DecorView\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarOverlayLayout\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarContainer\"}],\"target_activity\":\"ACTIVITY\",\"event_type\":\"EVENT TYPE\"}]" +
"}"
);
| editor.putString("people_distinct_id", "Present Before Construction");
editor.commit();
mExpectations.expect(
"https://decide.mixpanel.com/decide?version=1&lib=android&token=TEST+IDENTIFIED+ON+CONSTRUCTION&distinct_id=Present+Before+Construction" + mAppProperties,
"{" +
"\"notifications\":[{\"id\": 3333, \"message_id\": 4321, \"type\": \"takeover\", \"body\": \"Hook me up, yo!\", \"body_color\": 4294901760, \"title\": null, \"title_color\": 4278255360, \"image_url\": \"http://mixpanel.com/Balok.jpg\", \"bg_color\": 3909091328, \"close_color\": 4294967295, \"extras\": {\"image_fade\": true},\"buttons\": [{\"text\": \"Button!\", \"text_color\": 4278190335, \"bg_color\": 4294967040, \"border_color\": 4278255615, \"cta_url\": \"hellomixpanel://deeplink/howareyou\"}, {\"text\": \"Button 2!\", \"text_color\": 4278190335, \"bg_color\": 4294967040, \"border_color\": 4278255615, \"cta_url\": \"hellomixpanel://deeplink/howareyou\"}]}]," +
"\"surveys\":[{\"collections\":[{\"id\":3319,\"name\":\"n\"}],\"id\":8888,\"questions\":[{\"prompt\":\"p\",\"extra_data\":{},\"type\":\"text\",\"id\":457}],\"name\":\"N2\"}]," +
"\"event_bindings\": [{\"event_name\":\"EVENT NAME\",\"path\":[{\"index\":0,\"view_class\":\"com.android.internal.policy.impl.PhoneWindow.DecorView\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarOverlayLayout\"},{\"index\":0,\"view_class\":\"com.android.internal.widget.ActionBarContainer\"}],\"target_activity\":\"ACTIVITY\",\"event_type\":\"EVENT TYPE\"}]" +
"}"
);
|
193,194 | private LocalBroadcastManager mLocalBroadcastManager;
private String mActiveDownloadUrlString;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
<BUG>setContentView(R.layout.activity_app_details2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);</BUG>
toolbar.setTitle(""); // Nice and clean toolbar
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
| private LocalBroadcastManager mLocalBroadcastManager;
private String mActiveDownloadUrlString;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.app_details2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(""); // Nice and clean toolbar
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
193,195 | .inflate(R.layout.app_details2_screenshots, parent, false);
return new ScreenShotsViewHolder(view);
} else if (viewType == VIEWTYPE_WHATS_NEW) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_whatsnew, parent, false);
<BUG>return new WhatsNewViewHolder(view);
} else if (viewType == VIEWTYPE_LINKS) {</BUG>
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_links, parent, false);
return new ExpandableLinearLayoutViewHolder(view);
| .inflate(R.layout.app_details2_screenshots, parent, false);
return new ScreenShotsViewHolder(view);
} else if (viewType == VIEWTYPE_WHATS_NEW) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_whatsnew, parent, false);
return new WhatsNewViewHolder(view);
} else if (viewType == VIEWTYPE_DONATE) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_donate, parent, false);
return new DonateViewHolder(view);
} else if (viewType == VIEWTYPE_LINKS) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_links, parent, false);
return new ExpandableLinearLayoutViewHolder(view);
|
193,196 | import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContextBuilder;
public class HttpClientBuilder {
private CloseableHttpClient closeableHttpClient;
private CloseableHttpResponse closeableHttpResponse;
<BUG>private OnError onError = new DefaultOnError();
public HttpClientBuilder client() {</BUG>
try {
RequestConfig defaultRequestConfig = RequestConfig.custom().setConnectTimeout(10000).build();
SSLContextBuilder builder = new SSLContextBuilder();
| import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContextBuilder;
public class HttpClientBuilder {
private CloseableHttpClient closeableHttpClient;
private CloseableHttpResponse closeableHttpResponse;
private OnError onError;
public HttpClientBuilder(OnError onError) {
this.onError = onError;
}
public HttpClientBuilder client() {
try {
RequestConfig defaultRequestConfig = RequestConfig.custom().setConnectTimeout(10000).build();
SSLContextBuilder builder = new SSLContextBuilder();
|
193,197 | package com.blade;
<BUG>import java.io.InputStream;
import java.text.ParseException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.Filter;
import javax.servlet.http.HttpServlet;
import com.blade.config.ApplicationConfig;
</BUG>
import com.blade.embedd.EmbedServer;
| package com.blade;
import com.blade.config.Configuration;
import com.blade.embedd.EmbedServer;
|
193,198 | private Routers routers = new Routers();
private RouteBuilder routeBuilder;
private int port = Const.DEFAULT_PORT;
private String contextPath = Const.DEFAULT_CONTEXTPATH;
private Boolean enableServer = false;
<BUG>private Set<Class<? extends Plugin>> plugins;
private Map<Class<? extends Filter>, String[]> filters = new HashMap<Class<? extends Filter>, String[]>(8);
private Map<Class<? extends HttpServlet>, String[]> servlets = new HashMap<Class<? extends HttpServlet>, String[]>(8);
private Config config;</BUG>
private EmbedServer embedServer;
| private Routers routers = new Routers();
private RouteBuilder routeBuilder;
private int port = Const.DEFAULT_PORT;
private String contextPath = Const.DEFAULT_CONTEXTPATH;
private Boolean enableServer = false;
private Set<Class<? extends Plugin>> plugins;
private Map<Class<? extends Filter>, String[]> filters = CollectionKit.newHashMap(8);
private Map<Class<? extends HttpServlet>, String[]> servlets = CollectionKit.newHashMap(8);
private EmbedServer embedServer;
|
193,199 | private Map<Class<? extends Filter>, String[]> filters = new HashMap<Class<? extends Filter>, String[]>(8);
private Map<Class<? extends HttpServlet>, String[]> servlets = new HashMap<Class<? extends HttpServlet>, String[]>(8);
private Config config;</BUG>
private EmbedServer embedServer;
private Blade() {
<BUG>this.config = new Config();
this.applicationConfig = new ApplicationConfig();
this.plugins = new HashSet<Class<? extends Plugin>>();</BUG>
this.routeBuilder = new RouteBuilder(this.routers);
| private Routers routers = new Routers();
private RouteBuilder routeBuilder;
private int port = Const.DEFAULT_PORT;
private String contextPath = Const.DEFAULT_CONTEXTPATH;
private Boolean enableServer = false;
private Set<Class<? extends Plugin>> plugins;
private Map<Class<? extends Filter>, String[]> filters = CollectionKit.newHashMap(8);
private Map<Class<? extends HttpServlet>, String[]> servlets = CollectionKit.newHashMap(8);
private EmbedServer embedServer;
private Blade() {
this.configuration = new Configuration();
this.plugins = CollectionKit.newHashSet();
this.routeBuilder = new RouteBuilder(this.routers);
|
193,200 | }
<BUG>public static final Blade $(String location) {
Assert.notEmpty(location);</BUG>
Blade blade = BladeHolder.$;
<BUG>blade.config.add(location);
return blade;</BUG>
}
public void init() {
if (!this.isInit) {
this.isInit = true;
| }
public static Blade $() {
return BladeHolder.$;
}
public static Blade $(String location) {
Assert.notEmpty(location);
Blade blade = BladeHolder.$;
blade.loadAppConf(location);
return blade;
}
public void init() {
if (!this.isInit) {
this.isInit = true;
|
Subsets and Splits