buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public void paintComponent(Graphics g) {
if (image==null) return;
Rectangle r=g.getClipBounds();
int w=image.getWidth();
int h=image.getHeight();
for (int x=r.x/w; x<(r.x+r.width); x+=w) {
for (int y=r.y/h; y<(r.y+r.height); y+=h) {
g.drawImage(image, x, y, null);
}
}
}
| public void paintComponent(Graphics g) {
if (image==null) return;
Rectangle r=g.getClipBounds();
int w=image.getWidth();
int h=image.getHeight();
for (int x=(r.x/w)*w; x<(r.x+r.width); x+=w) {
for (int y=(r.y/h)*h; y<(r.y+r.height); y+=h) {
g.drawImage(image, x, y, null);
}
}
}
|
protected void call(__ParameterList params, __Body body) {
final HttpServletRequest request = Helper.getCurrentRequest();
final String name = (String) params.getDefault();
String value = "";
if (request!= null){
for (final Cookie cookie: request.get... | protected void call(__ParameterList params, __Body body) {
final HttpServletRequest request = Helper.getCurrentRequest();
final String name = (String) params.getDefault();
String value = "";
if (request != null && request.getCookies() != null){
for ... |
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
serverObjects prop = new serverObjects();
plasmaSwitchboard sb = (plasmaSwitchboard)env;
if (post != null && post.containsKey("words"))
prop.put("error_words", wikiCode.replaceHT... | public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
serverObjects prop = new serverObjects();
plasmaSwitchboard sb = (plasmaSwitchboard)env;
if (post != null && post.containsKey("words"))
prop.put("error_words", wikiCode.replaceHT... |
public AStarPath calculatePath(Position startPos, Position targetPos, int occupyingEntityID)
{
// TODO Plankton: Add support for different heuristic priorities
// TODO Plankton: Take entity size into account when calculating path
// TODO Plankton: Use threads or something to not "freeze" the game when calculati... | public AStarPath calculatePath(Position startPos, Position targetPos, int occupyingEntityID)
{
// TODO Plankton: Add support for different heuristic priorities
// TODO Plankton: Take entity size into account when calculating path
// TODO Plankton: Use threads or something to not "freeze" the game when calculati... |
public void processRequest(RequestEvent requestEvent) {
SipProvider sipProvider = (SipProvider)requestEvent.getSource();
ServerTransaction transaction = requestEvent.getServerTransaction();
Request request = requestEvent.getRequest();
try {
if(logger.isInfoEnabled()) {
logger.info("Got a request even... | public void processRequest(RequestEvent requestEvent) {
SipProvider sipProvider = (SipProvider)requestEvent.getSource();
ServerTransaction transaction = requestEvent.getServerTransaction();
Request request = requestEvent.getRequest();
try {
if(logger.isInfoEnabled()) {
logger.info("Got a request even... |
private static List<Question> copyQuestions(List<Question> origin, Category newCategory) {
List<Question> copy = new ArrayList<Question>();
for (Question question : origin) {
Question copiedQuestion = new Question();
copiedQuestion.constraintText = question.constraintText;
... | private static List<Question> copyQuestions(List<Question> origin, Category newCategory) {
List<Question> copy = new ArrayList<Question>();
for (Question question : origin) {
Question copiedQuestion = new Question();
copiedQuestion.constraintText = question.constraintText;
... |
public static byte[] mergeTwoKmer(int preK, byte[] kmerPre, int nextK,
byte[] kmerNext) {
int byteNum = Kmer.getByteNumFromK(preK + nextK);
byte[] mergedKmer = new byte[byteNum];
int i = 1;
for (; i <= kmerPre.length; i++) {
mergedKmer[byteNum - i] = kmerPre[kmerPre.length - i];
}
i--;
if (preK % 4... | public static byte[] mergeTwoKmer(int preK, byte[] kmerPre, int nextK,
byte[] kmerNext) {
int byteNum = Kmer.getByteNumFromK(preK + nextK);
byte[] mergedKmer = new byte[byteNum];
int i = 1;
for (; i <= kmerPre.length; i++) {
mergedKmer[byteNum - i] = kmerPre[kmerPre.length - i];
}
if ( i > 1){
i--... |
private void execute() {
HttpResponse response;
try {
response = client.execute(request, context);
Logger.debug(LOG_TAG, "Response: " + response.getStatusLine().toString());
} catch (ClientProtocolException e) {
delegate.handleHttpProtocolException(e);
return;
} catch (IOExcept... | private void execute() {
HttpResponse response;
try {
response = client.execute(request, context);
Logger.debug(LOG_TAG, "Response: " + response.getStatusLine().toString());
} catch (ClientProtocolException e) {
delegate.handleHttpProtocolException(e);
return;
} catch (IOExcept... |
protected void initSipStack() throws LifecycleException {
try {
if(logger.isDebugEnabled()) {
logger.debug("Initializing SIP stack");
}
// This simply puts HTTP and SSL port numbers in JVM properties menat to be read by jsip ha when sending heart beats with Node description.
StaticServiceH... | protected void initSipStack() throws LifecycleException {
try {
if(logger.isDebugEnabled()) {
logger.debug("Initializing SIP stack");
}
// This simply puts HTTP and SSL port numbers in JVM properties menat to be read by jsip ha when sending heart beats with Node description.
StaticServiceH... |
private void getBookmark(Image image, IngestImageWorkerController controller) {
FileManager fileManager = currentCase.getServices().getFileManager();
List<FsContent> bookmarkFiles = null;
try {
bookmarkFiles = fileManager.findFiles(image, "Bookmarks", "Chrome");
... | private void getBookmark(Image image, IngestImageWorkerController controller) {
FileManager fileManager = currentCase.getServices().getFileManager();
List<FsContent> bookmarkFiles = null;
try {
bookmarkFiles = fileManager.findFiles(image, "Bookmarks", "Chrome");
... |
public Map<String, List<? extends BaseDto>> listPlaceMarks(
@RequestParam(value = "country", defaultValue = "") String country,
@RequestParam(value = "id", defaultValue = "") String surveyedLocaleId) {
final Map<String, List<? extends BaseDto>> response = new HashMap<String, List<? extends BaseDto>>();
fina... | public Map<String, List<PlacemarkDto>> listPlaceMarks(
@RequestParam(value = "country", defaultValue = "") String country,
@RequestParam(value = "id", defaultValue = "") String surveyedLocaleId) {
final Map<String, List<PlacemarkDto>> response = new HashMap<String, List<PlacemarkDto>>();
final List<Placemar... |
public SQLiteDialect() {
registerColumnType(Types.BIT, "integer");
registerColumnType(Types.TINYINT, "tinyint");
registerColumnType(Types.SMALLINT, "smallint");
registerColumnType(Types.INTEGER, "integer");
registerColumnType(Types.BIGINT, "bigint");
registerColumnType(Types.FLOAT, "float");
registerColu... | public SQLiteDialect() {
registerColumnType(Types.BIT, "integer");
registerColumnType(Types.TINYINT, "tinyint");
registerColumnType(Types.SMALLINT, "smallint");
registerColumnType(Types.INTEGER, "integer");
registerColumnType(Types.BIGINT, "bigint");
registerColumnType(Types.FLOAT, "float");
registerColu... |
public native void render()/*-{
var vspiderchart = this;
function theta(angle) {
return Math.PI * ((angle + 90)/180);
}
function createRule(angle, labelText) {
var axis = vis.add($wnd.pv.Line).data($wnd.pv.range(2));
axis.left(func... | public native void render()/*-{
var vspiderchart = this;
function theta(angle) {
return Math.PI * ((angle + 90)/180);
}
function createRule(angle, labelText) {
var axis = vis.add($wnd.pv.Line).data($wnd.pv.range(2));
axis.left(func... |
public static String findPattern(String name, String dir, String[] nameList) {
if (dir == null) dir = ""; // current directory
else if (!dir.equals("") && !dir.endsWith(File.separator)) {
dir += File.separator;
}
// compile list of numerical blocks
int len = name.length();
int bound = (... | public static String findPattern(String name, String dir, String[] nameList) {
if (dir == null) dir = ""; // current directory
else if (!dir.equals("") && !dir.endsWith(File.separator)) {
dir += File.separator;
}
// compile list of numerical blocks
int len = name.length();
int bound = (... |
private Node delete(Node x, Key key) {
if (x == null) return null;
int cmp = key.compareTo(x.key);
// Search for the key.
if (cmp < 0) delete(x.left, key);
else if (cmp > 0) delete(x.right, key);
else {
// Case 1: no right child.
// You can do the same thing when there is no l... | private Node delete(Node x, Key key) {
if (x == null) return null;
int cmp = key.compareTo(x.key);
// Search for the key.
if (cmp < 0) x.left = delete(x.left, key);
else if (cmp > 0) x.right = delete(x.right, key);
else {
// Case 1: no right child.
// You can do the same thing... |
private void processJAXPSchemaSource(Hashtable locationPairs) throws IOException {
fJAXPProcessed = true;
if (fJAXPSource == null) {
return;
}
Class componentType = fJAXPSource.getClass().getComponentType();
XMLInputSource xis = null;
String sid =... | private void processJAXPSchemaSource(Hashtable locationPairs) throws IOException {
fJAXPProcessed = true;
if (fJAXPSource == null) {
return;
}
Class componentType = fJAXPSource.getClass().getComponentType();
XMLInputSource xis = null;
String sid =... |
public void testConfigureProblemSeverity() throws CoreException {
util.checkPrpposal(tckProject,
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NonStaticProducerBroken.java",
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NonStaticProducerBroken.new",
CDIValidationErrorManager.MESSAGE_ID_AT... | public void testConfigureProblemSeverity() throws CoreException {
util.checkPrpposal(tckProject,
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NonStaticProducerBroken.java",
"JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NonStaticProducerBroken.qfxresult",
CDIValidationErrorManager.MESSAGE... |
public String run(String runName, String environmentName) throws ClientException {
synchronized(log) {
String validationReportHtml = null;
boolean wasActiveTx = false;
try {
// Init
RepositoryManager mgr = Framework.getService(RepositoryManager.class);
Repository rep... | public String run(String runName, String environmentName) throws ClientException {
synchronized(log) {
String validationReportHtml = null;
boolean wasActiveTx = false;
try {
// Init
RepositoryManager mgr = Framework.getService(RepositoryManager.class);
Repository rep... |
public static void main(String [] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
int t,n;
//System.out.println(line);
t = Integer.parseInt(line);
for(int i=0;i<t;++i)
{
line = br.readLine();
n ... | public static void main(String [] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
int t,n;
//System.out.println(line);
t = Integer.parseInt(line.trim());
for(int i=0;i<t;++i)
{
line = br.readLine();
... |
public static void main(String[] args)
{
String dbname;
Properties props=new Properties();
Properties fileprops=new Properties();
boolean dotransactions=true;
int threadcount=1;
int nodecount=1;
int target=0;
boolean status=false;
String label="";
//parse arguments
int argindex=0;
if (args.l... | public static void main(String[] args)
{
String dbname;
Properties props=new Properties();
Properties fileprops=new Properties();
boolean dotransactions=true;
int threadcount=1;
int nodecount=1;
int target=0;
boolean status=false;
String label="";
//parse arguments
int argindex=0;
if (args.l... |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Player player = (Player) sender;
World world = player.getWorld();
if(commandLabel.equalsIgnoreCase("smite")) {
if(args.length == 0) {
Block targetblock = player.getTargetBlock(null, 20);
Lo... | public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Player player = (Player) sender;
World world = player.getWorld();
if(commandLabel.equalsIgnoreCase("smite")) {
if(args.length == 0) {
Block targetblock = player.getTargetBlock(null, 50);
Lo... |
public Construct exec(Target t, Environment env, Construct... args) throws ConfigRuntimeException {
MCPlayer p = env.getEnv(CommandHelperEnvironment.class).GetPlayer();
MCLocation loc;
int dist;
List<String> types = new ArrayList<String>();
if (!(args[0] instanceof CArray)) {
throw new ConfigRunt... | public Construct exec(Target t, Environment env, Construct... args) throws ConfigRuntimeException {
MCPlayer p = env.getEnv(CommandHelperEnvironment.class).GetPlayer();
MCLocation loc;
int dist;
List<String> types = new ArrayList<String>();
if (!(args[0] instanceof CArray)) {
throw new ConfigRunt... |
public void bindList(final EObject theobject, final EStructuralFeature thefeature) {
if (!(theobject.eGet(thefeature) instanceof EList<?>)) {
return;
}
// Class<?> clazz = thefeature.getEType().getInstanceClass();
// if (!EObject.class.isAssignableFrom(clazz)) {
// return;
// }
setBusinessObject(theobje... | public void bindList(final EObject theobject, final EStructuralFeature thefeature) {
if (!(theobject.eGet(thefeature) instanceof EList<?>)) {
return;
}
// Class<?> clazz = thefeature.getEType().getInstanceClass();
// if (!EObject.class.isAssignableFrom(clazz)) {
// return;
// }
setBusinessObject(theobje... |
public void setBytes(byte[] buff, short offset, short length) {
if (data == null) {
switch (memoryType) {
case JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT:
data = JCSystem.makeTransientByteArray(length, JCSystem.CLEAR_ON_DESELECT);
break;
... | public void setBytes(byte[] buff, short offset, short length) {
if (data == null || data.length != length) {
switch (memoryType) {
case JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT:
data = JCSystem.makeTransientByteArray(length, JCSystem.CLEAR_ON_DESELECT);
... |
private Composite createForm(Composite parent, EMFDataBindingContext context, IObservableValue master, boolean isImport) {
CTabFolder folder = new CTabFolder(parent, SWT.BOTTOM);
CTabItem item = new CTabItem(folder, SWT.NONE);
item.setText(Messages.ModelTooling_Common_TabDefault);
parent = createScrollableCo... | private Composite createForm(Composite parent, EMFDataBindingContext context, IObservableValue master, boolean isImport) {
CTabFolder folder = new CTabFolder(parent, SWT.BOTTOM);
CTabItem item = new CTabItem(folder, SWT.NONE);
item.setText(Messages.ModelTooling_Common_TabDefault);
parent = createScrollableCo... |
public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
// Check if player is affected
if (!player.hasPermission("cookme.safe")) {
// Check for raw food & right clicking
if (((event.getMaterial() == Material.RAW_BEEF) || (event.getMaterial() == Material.RAW_CHICKEN) || ... | public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
// Check if player is affected
if (!player.hasPermission("cookme.safe")) {
// Check for raw food & right clicking
if (((event.getMaterial() == Material.RAW_BEEF) || (event.getMaterial() == Material.RAW_CHICKEN) || ... |
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player send;
if(!(sender instanceof Player)){
sender.sendMessage(title + ChatColor.RED + "Player context is required!");
return true;
}
send = (Player) sender;
... | public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player send;
if(!(sender instanceof Player)){
sender.sendMessage(title + ChatColor.RED + "Player context is required!");
return true;
}
send = (Player) sender;
... |
public final hudson.remoting.Future<RSP> callAsync(final Channel channel) throws IOException {
response=null;
channel.pendingCalls.put(id,this);
channel.send(this);
return new hudson.remoting.Future<RSP>() {
private volatile boolean cancelled;
public boole... | public final hudson.remoting.Future<RSP> callAsync(final Channel channel) throws IOException {
response=null;
channel.pendingCalls.put(id,this);
channel.send(this);
return new hudson.remoting.Future<RSP>() {
private volatile boolean cancelled;
public boole... |
public Object execute(Evaluator evaluator, UserDefinedFunction.Argument[] arguments) {
java.sql.Connection conn = null;
List<Map<String, String>> dimensions = new ArrayList<Map<String, String>>();
ResultSet rs;
String column_names = new String("");
String table_name, query;
... | public Object execute(Evaluator evaluator, UserDefinedFunction.Argument[] arguments) {
java.sql.Connection conn = null;
List<Map<String, String>> dimensions = new ArrayList<Map<String, String>>();
ResultSet rs;
String column_names = new String("");
String table_name, query;
... |
public void sessionDestroyed(HttpSessionEvent se) {
logger.trace("Session destroyed");
try {
HttpSession s = se.getSession();
BroadcasterFactory factory = BroadcasterFactory.getDefault();
if (factory != null) {
for (Broadcaster b : factory.lookupAll... | public void sessionDestroyed(HttpSessionEvent se) {
logger.trace("Session destroyed");
try {
HttpSession s = se.getSession();
if (BroadcasterFactory.getDefault() != null) {
for (Broadcaster b : BroadcasterFactory.getDefault().lookupAll()) {
... |
private Reply performRequest(SimpleFieldSet fields, Bucket data, String... targetMessages) throws PluginException {
@SuppressWarnings("synthetic-access")
Reply reply = new Reply();
for (String targetMessage : targetMessages) {
replies.put(targetMessage, reply);
}
replies.put("Error", reply);
synchronize... | private Reply performRequest(SimpleFieldSet fields, Bucket data, String... targetMessages) throws PluginException {
@SuppressWarnings("synthetic-access")
Reply reply = new Reply();
for (String targetMessage : targetMessages) {
replies.put(targetMessage, reply);
}
replies.put("Error", reply);
synchronize... |
public void onEntityDeath(EntityDeathEvent event){
if(event.getEntity() instanceof Player){
Player player = (Player) event.getEntity();
EntityDamageEvent e = player.getLastDamageCause();
if(e!=null){
if(e.getCause().equals(EntityDamageEvent.DamageCause.PRO... | public void onEntityDeath(EntityDeathEvent event){
if(event.getEntity() instanceof Player){
Player player = (Player) event.getEntity();
EntityDamageEvent e = player.getLastDamageCause();
if(e!=null){
if(e.getCause().equals(EntityDamageEvent.DamageCause.PRO... |
public TaskBuilder initTasks(final InitStrategy initStrategy) {
TaskBuilder builder;
if (!pluginListed) {
builder = new TaskGraphBuilder() {
List<File> archives;
Collection<String> bundledPlugins;
{
Handle loadBundledPl... | public TaskBuilder initTasks(final InitStrategy initStrategy) {
TaskBuilder builder;
if (!pluginListed) {
builder = new TaskGraphBuilder() {
List<File> archives;
Collection<String> bundledPlugins;
{
Handle loadBundledPl... |
private static Object[] getAuthenticatedConnection(
String service, String host, String username, byte[] hashedPassword, int port)
throws IOException {
Object returnArray[] = new Object[3];
boolean success = false;
InetSocketAddress addr = new InetSocketAddress(host, port);
... | private static Object[] getAuthenticatedConnection(
String service, String host, String username, byte[] hashedPassword, int port)
throws IOException {
Object returnArray[] = new Object[3];
boolean success = false;
InetSocketAddress addr = new InetSocketAddress(host, port);
... |
public Evento(final int claveAlarma, int claveSonido, final Boolean fuerte, Activity val) {
contexto = val.getApplicationContext();
this.claveAlarma = claveAlarma;
this.claveSonido = claveSonido;
this.fuerte = fuerte;
if(handler==null){
handler = new Handler() {
@Override
public void handleMessage... | public Evento(final int claveAlarma, int claveSonido, final Boolean fuerte, Activity val) {
contexto = val.getApplicationContext();
this.claveAlarma = claveAlarma;
this.claveSonido = claveSonido;
this.fuerte = fuerte;
if(handler==null){
handler = new Handler() {
@Override
public void handleMessage... |
public Object suspend(CometServletResponseImpl response, CometSessionImpl session, HttpServletRequest request) throws IOException {
assert !Thread.holdsLock(response);
if (session == null) {
try {
synchronized (response) {
while (!response.isTerminated()) {
long heartBeatTime = response.getHea... | public Object suspend(CometServletResponseImpl response, CometSessionImpl session, HttpServletRequest request) throws IOException {
assert !Thread.holdsLock(response);
if (session == null) {
try {
synchronized (response) {
while (!response.isTerminated()) {
long heartBeatTime = response.getHea... |
public static MindIcon create(String name) {
return new MindIcon(name,
name + ".png",
ResourceBundles.getText(String.format(DESC_KEY, name)));
}
| public static MindIcon create(String name) {
final String description = name.indexOf('/') > 0 ? "" : ResourceBundles.getText(String.format(DESC_KEY, name));
return new MindIcon(name, name + ".png", description);
}
|
public UsageParam(String in) {
this.param = in;
for(int i = 0; i < in.length()/2; i++) {
String token = in.substring(i,i+2);
if("Wo".equals(token))
wood++;
else if("Gn".equals(token))
grain++;
else if("Sh".equals(token))
sheep++;
else if("Cl".equals(token))
clay++;
else if("Pt".eq... | public UsageParam(String in) {
this.param = in;
for(int i = 0; i < in.length()/2; i++) {
String token = in.substring(i*2,i*2+2);
if("Wo".equals(token))
wood++;
else if("Gn".equals(token))
grain++;
else if("Sh".equals(token))
sheep++;
else if("Cl".equals(token))
clay++;
else if("Pt... |
private void refillInferredDoIt() {
if (!getOWLModelManager().getReasoner().isConsistent()) {
return;
}
Set<OWLClass> clses = getReasoner().getSuperClasses(getRootObject(), true).getFlattened();
clses.remove(getRootObject());
for (OWLClass cls : clses) {
... | private void refillInferredDoIt() {
if (!getOWLModelManager().getReasoner().isConsistent()) {
return;
}
Set<OWLClass> clses = getReasoner().getSuperClasses(getRootObject(), true).getFlattened();
clses.remove(getRootObject());
for (OWLClass cls : clses) {
... |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession();
Clients client = (Clients) session.getAttribute("client");
if(client==null){
Object obj = new Object();
obj = "<p style='color:red'>*Your... | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession();
Clients client = (Clients) session.getAttribute("client");
if(client==null){
Object obj = new Object();
obj = "<p style='color:red'>*Your... |
public DBObject getMappedObject() {
String idKey = null;
if (null != entity) {
idKey = entity.getIdProperty().getName();
} else if (query.containsField("id")) {
idKey = "id";
} else if (query.containsField("_id")) {
idKey = "_id";
}
DBObject newDbo = new BasicDBObject();
for (String key : query... | public DBObject getMappedObject() {
String idKey = null;
if (null != entity && null != entity.getIdProperty()) {
idKey = entity.getIdProperty().getName();
} else if (query.containsField("id")) {
idKey = "id";
} else if (query.containsField("_id")) {
idKey = "_id";
}
DBObject newDbo = new BasicDBO... |
public boolean checkout(AbstractBuild build, Launcher launcher,
FilePath workspace, BuildListener listener, File changelogFile) throws IOException, InterruptedException {
PrintStream log = listener.getLogger();
changelogFilename = changelogFile.getAbsolutePath();
boolean wipeBe... | public boolean checkout(AbstractBuild build, Launcher launcher,
FilePath workspace, BuildListener listener, File changelogFile) throws IOException, InterruptedException {
PrintStream log = listener.getLogger();
changelogFilename = changelogFile.getAbsolutePath();
boolean wipeBe... |
public void testCreateNonStandardSchema() throws SeException, IOException,
UnavailableArcSDEConnectionException {
Command<Void> createCommand = new Command<Void>() {
@Override
public Void execute(ISession session, SeConnection connection) throws SeException,
... | public void testCreateNonStandardSchema() throws SeException, IOException,
UnavailableArcSDEConnectionException {
Command<Void> createCommand = new Command<Void>() {
@Override
public Void execute(ISession session, SeConnection connection) throws SeException,
... |
public void checkStepMatching(Step step) {
final Counter counter = new Counter();
String description = step.getDescription().substring(step.getDescription().indexOf(' ') + 1);
matcher.findMatches(description, new JavaAnnotationMatcher.Command() {
public void match(String annotationValue, IMethod method) {
... | public void checkStepMatching(Step step) {
final Counter counter = new Counter();
String description = step.getDescription().substring(step.getDescription().indexOf(' ') + 1);
matcher.findMatches(description, new JavaAnnotationMatcher.Command() {
public void match(String annotationValue, IMethod method) {
... |
public static RequestResult extractFrom(ClientResponse clientResponse) {
final int status = clientResponse.getStatus();
final URI location = clientResponse.getLocation();
final String data = clientResponse.hasEntity() ? clientResponse.getEntity(String.class) : null;
clientResponse.cl... | public static RequestResult extractFrom(ClientResponse clientResponse) {
final int status = clientResponse.getStatus();
final URI location = clientResponse.getLocation();
final String data = status != Response.Status.NO_CONTENT.getStatusCode() ? clientResponse.getEntity(String.class) : null;
... |
public void doNotifyCommit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
requirePOST();
// compute the affected paths
Set<String> affectedPath = new HashSet<String>();
String line;
BufferedReader r = new BufferedReader(req.getReader());
... | public void doNotifyCommit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
requirePOST();
// compute the affected paths
Set<String> affectedPath = new HashSet<String>();
String line;
BufferedReader r = new BufferedReader(req.getReader());
... |
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
String sortOrder, String limit) {
ensureDefaultAccount();
final SQLiteDatabase db = mOpenHelper.getReadableDatabase();
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
String gro... | public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
String sortOrder, String limit) {
ensureDefaultAccount();
final SQLiteDatabase db = mOpenHelper.getReadableDatabase();
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
String gro... |
public void statusChanged(GramJob job) {
myLogger.debug("job status changed to " + job.getStatus());
statuses.put(job.getIDAsString(), job.getStatus());
errors.put(job.getIDAsString(), job.getError());
}
| public void statusChanged(GramJob job) {
int jobStatus = job.getStatus();
String jobId = job.getIDAsString();
myLogger.debug("job status changed to " + jobStatus);
statuses.put(jobId, jobStatus);
errors.put(jobId, job.getError());
... |
private String escapeURI(String unescapedURI) {
// Remove starting and ending whitespace
String escapedURI = unescapedURI.trim();
//Replace space with %20
escapedURI = escapedURI.replaceAll(" ", "%20");
//strip linebreaks
escapedURI = escapedURI.replaceAll("\n", "");
//'Remove starting "\" o... | private String escapeURI(String unescapedURI) {
// Remove starting and ending whitespace
String escapedURI = unescapedURI.trim();
//Replace space with %20
escapedURI = escapedURI.replaceAll(" ", "%20");
//strip linebreaks
escapedURI = escapedURI.replaceAll("\n", "");
//'Remove starting "\" o... |
public static void selectElementInEditor(R4ECompareEditorInput aInput) {
//NOTE: This is a dirty hack that involves accessing class and field we shouldn't, but that's
// the only way to select the current position in the compare editor. Hopefully this code can
// be removed later when the Eclipse compa... | public static void selectElementInEditor(R4ECompareEditorInput aInput) {
//NOTE: This is a dirty hack that involves accessing class and field we shouldn't, but that's
// the only way to select the current position in the compare editor. Hopefully this code can
// be removed later when the Eclipse compa... |
private void synchronize() {
entityManager.clear();
final String bundleCharacterSet = PropertiesUtil.getProperty("translation-site", "bundle-character-set");
final String[] prefixes = PropertiesUtil.getProperty("translation-site", "bundle-path-prefixes").split(",");
for (final Stri... | private void synchronize() {
entityManager.clear();
final String bundleCharacterSet = PropertiesUtil.getProperty("translation-site", "bundle-character-set");
final String[] prefixes = PropertiesUtil.getProperty("translation-site", "bundle-path-prefixes").split(",");
for (final Stri... |
public void convert() throws Exception {
File work = new File("target");
File bam = TestHelper.createTempFileFrom(Sam2WigTest.class, "sample.bam");
File bai = TestHelper.createTempFileFrom(Sam2WigTest.class, "sample.bam.bai", new File(bam + ".bai"));
File out = FileUtil.createTempFile(work, "output", ".wig");... | public void convert() throws Exception {
File work = new File("target");
File bam = TestHelper.createTempFileFrom(Sam2WigTest.class, "sample.bam");
File bai = TestHelper.createTempFileFrom(Sam2WigTest.class, "sample.bam.bai", new File(bam + ".bai"));
File out = FileUtil.createTempFile(work, "output", ".wig");... |
public void shortenUrls(final ShortenedUrlCallback callback) {
final JRSessionData sessionData = JRSessionData.getInstance();
try {
// todo invoke when the activity object is created (or maybe when publish is called?)
List<String> emptyList = new ArrayList<String>();
... | public void shortenUrls(final ShortenedUrlCallback callback) {
final JRSessionData sessionData = JRSessionData.getInstance();
try {
// todo invoke when the activity object is created (or maybe when publish is called?)
List<String> emptyList = new ArrayList<String>();
... |
public void onPlayerJoin (PlayerJoinEvent event)
{
Player player = event.getPlayer();
String prefix = plugin.getChat().getPlayerPrefix(player);
if (prefix != null && !prefix.isEmpty())
{
prefix = prefix.substring(0, 2).replace('&', '§');
}
player... | public void onPlayerJoin (PlayerJoinEvent event)
{
Player player = event.getPlayer();
String prefix = plugin.getChat().getPlayerPrefix(player);
if (prefix != null && !prefix.isEmpty())
{
String playerName = player.getName();
String name = playerName;
... |
public AbstractDetailsJPanel create(AppliedRuleController appliedRuleController, String ruleTypeKey){
//Rules on the Contents of a module
if (ruleTypeKey.equals(InterfaceConventionJPanel.ruleTypeKey)){
interfaceConventionJPanel = new InterfaceConventionJPanel(appliedRuleController);
return interfaceConvention... | public AbstractDetailsJPanel create(AppliedRuleController appliedRuleController, String ruleTypeKey){
//Rules on the Contents of a module
if (ruleTypeKey.equals(InterfaceConventionJPanel.ruleTypeKey)){
interfaceConventionJPanel = new InterfaceConventionJPanel(appliedRuleController);
return interfaceConvention... |
public static Entity convert(DatastoreEntity<?> dsEntity){
if(dsEntity == null) return null;
String kind = dsEntity.getClass().getSimpleName();
Entity entity = null;
if(dsEntity.hasDatastoreKey()){
Object key = dsEntity.getDatastoreKey();
if(... | public static Entity convert(DatastoreEntity<?> dsEntity){
if(dsEntity == null) return null;
String kind = dsEntity.getClass().getSimpleName();
Entity entity = null;
if(dsEntity.hasDatastoreKey()){
Object key = dsEntity.getDatastoreKey();
if(... |
public void annotate(@NotNull PsiElement psiElement, @NotNull final AnnotationHolder annotationHolder) {
psiElement.accept(new ErlangVisitor() {
@Override
public void visitQVar(@NotNull ErlangQVar o) {
setHighlighting(o, annotationHolder, ErlangSyntaxHighlighter.VARIABLES);
if (inDefin... | public void annotate(@NotNull PsiElement psiElement, @NotNull final AnnotationHolder annotationHolder) {
psiElement.accept(new ErlangVisitor() {
@Override
public void visitQVar(@NotNull ErlangQVar o) {
setHighlighting(o, annotationHolder, ErlangSyntaxHighlighter.VARIABLES);
if (inDefin... |
public Set<StructureSchematic> getSchematics()
{
return new HashSet<StructureSchematic>()
{
{
// Clickable block.
add(new StructureSchematic(0, 0, 2, new ArrayList<StructureBlockData>()
{
{
add(new StructureBlockData(Material.SMOOTH_BRICK, (byte) 3));
}
}));
// Everything e... | public Set<StructureSchematic> getSchematics()
{
return new HashSet<StructureSchematic>()
{
{
// Clickable block.
add(new StructureSchematic(0, 0, 2, new ArrayList<StructureBlockData>()
{
{
add(new StructureBlockData(Material.SMOOTH_BRICK, (byte) 3));
}
}));
// Everything e... |
public void processOptions(String[] args) throws FileNotFoundException {
Options options = new Options();
options.addOption(OptionBuilder
.withLongOpt("description")
.withDescription("Display a description to identify this grabber")
.create())
.addOption(OptionBuilder
... | public void processOptions(String[] args) throws FileNotFoundException {
Options options = new Options();
options.addOption(OptionBuilder
.withLongOpt("description")
.withDescription("Display a description to identify this grabber")
.create())
.addOption(OptionBuilder
... |
public HealthCheck create(final ServiceContext context) {
return new HealthCheck("Database Connection") {
@Override
protected Result check() throws Exception {
Dbms dbms = null;
try {
// TODO add timeout
dbms = (... | public HealthCheck create(final ServiceContext context) {
return new HealthCheck("Database Connection") {
@Override
protected Result check() throws Exception {
Dbms dbms = null;
try {
// TODO add timeout
dbms = (... |
public void startTickRun(int stage, long delta) throws InterruptedException {
switch (stage) {
case 0: {
//Add or remove entities
if(!spawnQueue.isEmpty()) {
SpoutEntity e;
while ((e = (SpoutEntity)spawnQueue.poll()) != null) {
this.allocate(e);
EntitySpawnEvent event = new EntitySpa... | public void startTickRun(int stage, long delta) throws InterruptedException {
switch (stage) {
case 0: {
//Add or remove entities
if(!spawnQueue.isEmpty()) {
SpoutEntity e;
while ((e = (SpoutEntity)spawnQueue.poll()) != null) {
this.allocate(e);
EntitySpawnEvent event = new EntitySpa... |
public static void main(String[] args) {
new ClassPathXmlApplicationContext("errorHandlingDemo.xml", PartyDemo.class);
System.out.println("hit any key to stop");
try {
System.in.read();
}
catch (IOException e) {
throw new RuntimeException(e);
}
System.exit(0);
}
| public static void main(String[] args) {
new ClassPathXmlApplicationContext("errorHandlingDemo.xml", PartyDemo.class);
System.out.println("### Hit ENTER to stop ###");
try {
System.in.read();
}
catch (IOException e) {
throw new RuntimeException(e);
}
System.exit(0);
}
|
private void processEvent(final ThreadContext tCtx, final int event, final String file, final int line0,
final String methodName, final IRubyObject klass, DebugContextPair contexts) {
// one-based; jruby by default passes zero-based
int line = line0 + 1;
hookCount++;
Rub... | private void processEvent(final ThreadContext tCtx, final int event, final String file, final int line0,
final String methodName, final IRubyObject klass, DebugContextPair contexts) {
// one-based; jruby by default passes zero-based
int line = line0 + 1;
hookCount++;
Rub... |
public String toString() {
StringBuilder sb = new StringBuilder();
for (URI uri : getDefaultRemoveGraphs()) {
sb.append("DELETE FROM ");
appendURI(sb, uri);
}
sb.append("INSERT INTO ");
appendURI(sb, getDefaultInsertGraph());
for (URI uri : getDefaultGraphs()) {
sb.append("USING ");
appendURI(s... | public String toString() {
StringBuilder sb = new StringBuilder();
for (URI uri : getDefaultRemoveGraphs()) {
sb.append("DELETE FROM ");
appendURI(sb, uri);
}
if (getDefaultInsertGraph() != null) {
sb.append("INSERT INTO ");
appendURI(sb, getDefaultInsertGraph());
}
for (URI uri : getDefaultGra... |
public int doEndTag() throws JspException {
try {
set("href", buildUrl());
writeOpenTag(getPageContext().getOut(), "a");
String body = getBodyContentAsString();
if (body != null) {
getPageContext().getOut().write(body.trim());
}
... | public int doEndTag() throws JspException {
try {
set("href", buildUrl());
writeOpenTag(getPageContext().getOut(), "a");
String body = getBodyContentAsString();
if (body == null) {
body = get("href");
}
if (body != null)... |
protected void startToolL(final IProgressMonitor monitor) throws CoreException {
fRjsId = RjsComConfig.registerClientComHandler(fRjs);
fRjs.initClient(getTool(), this, fRjsProperties, fRjsId);
try {
final Map<String, Object> data = new HashMap<String, Object>();
final IToolEventHandler loginHandler = getEv... | protected void startToolL(final IProgressMonitor monitor) throws CoreException {
fRjsId = RjsComConfig.registerClientComHandler(fRjs);
fRjs.initClient(getTool(), this, fRjsProperties, fRjsId);
try {
final Map<String, Object> data = new HashMap<String, Object>();
final IToolEventHandler loginHandler = getEv... |
public ConfigLoader()
{
new Settings().getTest();
}
| public ConfigLoader()
{
new Settings();
}
|
public void drawString(String s, int x, int y) {
if (s == null || s.length() == 0)
return;
java.awt.FontMetrics metrics = getGraphics2D().getFontMetrics();
int stringLength = metrics.stringWidth(s);
Dimension swtStringSize = TEXT_UTILITIES.getStringExtents(s, swtGraphics.getFont());
float xpos = x + tr... | public void drawString(String s, int x, int y) {
if (s == null || s.length() == 0)
return;
java.awt.FontMetrics metrics = getGraphics2D().getFontMetrics();
int stringLength = metrics.stringWidth(s);
Dimension swtStringSize = TEXT_UTILITIES.getStringExtents(s, swtGraphics.getFont());
float xpos = x + tr... |
public String getImages() {
try {
List listeners = StatSummarizer.instance().getListeners();
TreeSet ordered = new TreeSet(new AlphaComparator());
ordered.addAll(listeners);
// go to some trouble to see if we have the data for the combined bw graph
... | public String getImages() {
try {
List listeners = StatSummarizer.instance().getListeners();
TreeSet ordered = new TreeSet(new AlphaComparator());
ordered.addAll(listeners);
// go to some trouble to see if we have the data for the combined bw graph
... |
public GPPScannerExtensionConfiguration() {
addMacro("__null", "0"); //$NON-NLS-1$//$NON-NLS-2$
addKeyword(Keywords.cRESTRICT, IToken.t_restrict);
addKeyword(Keywords.c_COMPLEX, IToken.t__Complex);
addKeyword(Keywords.c_IMAGINARY, IToken.t__Imaginary);
}
| public GPPScannerExtensionConfiguration() {
addMacro("__null", "0"); //$NON-NLS-1$//$NON-NLS-2$
addKeyword(Keywords.c_COMPLEX, IToken.t__Complex);
addKeyword(Keywords.c_IMAGINARY, IToken.t__Imaginary);
}
|
public static void main(String[] args) {
while(true)
{
//input and conversion
int choice = Integer.parseInt(JOptionPane.showInputDialog(null, "Please enter the question number: (0 to quit)", "Loop Assigment", JOptionPane.QUESTION_MESSAGE));
//switch statement
switch (choice)
{
case 0:
Syst... | public static void main(String[] args) {
while(true)
{
//input and conversion
int choice = Integer.parseInt(JOptionPane.showInputDialog(null, "Please enter the question number: (0 to quit)", "Loop Assigment", JOptionPane.QUESTION_MESSAGE));
//switch statement
switch (choice)
{
case 0:
Syst... |
public void customize() {
newScript(CUSTOMIZING)
.failOnNonZeroResultCode()
.body.append(
format("cp -R %s/brooklyn-%s/{bin,conf} .", getInstallDir(), getVersion()),
"mkdir -p ./lib/")
.execute();
... | public void customize() {
newScript(CUSTOMIZING)
.failOnNonZeroResultCode()
.body.append(
format("cp -R %s/brooklyn-%s/{bin,conf} .", getInstallDir(), getVersion()),
"mkdir -p ./lib/")
.execute();
... |
private void initComponents() {
searchAppsLabel = new javax.swing.JLabel();
installFromFileButton = new javax.swing.JButton();
filterTextField = new javax.swing.JTextField();
descriptionSplitPane = new javax.swing.JSplitPane();
tagsSplitPane = new javax.swing.JSplitPane();
... | private void initComponents() {
searchAppsLabel = new javax.swing.JLabel();
installFromFileButton = new javax.swing.JButton();
filterTextField = new javax.swing.JTextField();
descriptionSplitPane = new javax.swing.JSplitPane();
tagsSplitPane = new javax.swing.JSplitPane();
... |
public void start(String host, int port) {
try {
gui.show();
connection.connect(host, port);
gui.setLabel(connection.read().toString());
} catch (Exception e) {
logger.error("Connection with \"" + host + ":" + port + "\" Error: " + e.getMessage());
gui.setLabel(e.toString());
}
}
| public void start(String host, int port) {
try {
gui.show();
connection.connect(host, port);
gui.setLabel(connection.read().toString());
} catch (Exception e) {
logger.error("Connection with \"" + host + ":" + port + "\" Error: " + e.getMessage());
gui.setLabel("Connection with \"" + host + ":" + po... |
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_task);
// Allow Action bar icon to act as a button
ActionBar action_bar = getSupportActionBar();
action_bar.setHomeButtonEnabled(true);
... | protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_task);
// Allow Action bar icon to act as a button
ActionBar action_bar = getSupportActionBar();
action_bar.setHomeButtonEnabled(true);
... |
public Point2D getAcceleration(PhysicalObject object) {
double d = distance();
double f = Math.abs(RIGOR * (d - LENGTH));
double theta = Math.atan2(getY2() - getY1(), getX2() - getX1());
int direction = object == left_object ? 1 : -1;
int invert = d < LENGTH ? -1 : 1;
... | public Point2D getAcceleration(PhysicalObject object) {
double d = distance();
double f = Math.abs(RIGOR * (d - LENGTH));
double theta = Math.atan2(getY2() - getY1(), getX2() - getX1());
int invert = d < LENGTH ? -1 : 1;
int direction;
if (object == left_object)
... |
public List<CompletionInformation> tryAutoCompletion(int line,
int charPositionInLine) {
Token tokenToComplete = compiler.getLexer().getTokenByNumbers(line,
charPositionInLine);
if (tokenToComplete != null
&& ((tokenToComplete.getLine() < line || (tokenToComplete
.getCharPositionInLine() + tokenT... | public List<CompletionInformation> tryAutoCompletion(int line,
int charPositionInLine) {
Token tokenToComplete = compiler.getLexer().getTokenByNumbers(line,
charPositionInLine);
if (tokenToComplete != null
&& ((tokenToComplete.getLine() < line || (tokenToComplete
.getCharPositionInLine() + tokenT... |
public Movie(MovieDetail detail) {
this.id = detail.movieid;
this.title = detail.title;
this.year = detail.year;
this.director = detail.director;
this.runtime = Integer.toString(detail.runtime);
this.genres = detail.genre;
this.rating = detail.rating;
this.localPath = "";
this.filename = detail.file;... | public Movie(MovieDetail detail) {
this.id = detail.movieid;
this.title = detail.title;
this.year = detail.year;
this.director = detail.director;
// runtime is in minutes
this.runtime = Integer.toString(detail.runtime / 60);
this.genres = detail.genre;
this.rating = detail.rating;
this.localPath = ""... |
private registrationWindow() {
this.registrationWindowFrame= new JFrame();
this.wellcomeLogo = new JLabel(new ImageIcon(getClass().getResource("textlogo.png")));
this.wellcomeLabel1 = new JLabel("Please Enter your personal data");
this.nickNameLabel = new JLabel("Nickname");
this.nickNameTextField = ... | private registrationWindow() {
this.registrationWindowFrame= new JFrame();
this.wellcomeLogo = new JLabel(new ImageIcon(getClass().getResource("textlogo.png")));
this.wellcomeLabel1 = new JLabel("Please Enter your personal data");
this.nickNameLabel = new JLabel("Nickname");
this.nickNameTextField = ... |
private static void renderStoneHUD(Minecraft minecraft, EntityPlayer player, ItemStack stack, float partialTicks) {
float overlayScale = ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE;
float blockScale = overlayScale / 2;
float overlayOpacity = ConfigurationSettings.TARGET_BLOCK_OVERLAY_O... | private static void renderStoneHUD(Minecraft minecraft, EntityPlayer player, ItemStack stack, float partialTicks) {
float overlayScale = ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE;
float blockScale = overlayScale / 2;
float overlayOpacity = ConfigurationSettings.TARGET_BLOCK_OVERLAY_O... |
public void analyze(Log log, SymbolTable table, Subroutine owner, boolean inLoop) {
type = Type.NUMBER;
String lexeme = getLexeme();
try {
if (lexeme.contains("^")) {
lexeme = lexeme.replaceAll("(x|\\xd7)10\\^", "E");
}
value = Double.value... | public void analyze(Log log, SymbolTable table, Subroutine owner, boolean inLoop) {
type = Type.NUMBER;
String lexeme = getLexeme();
try {
if (lexeme.contains("^")) {
lexeme = lexeme.replaceAll("(x|\\xd7)10\\^", "E");
}
value = Double.value... |
void getSQL(final StringBuffer sb, final List<Object> bindings, final SqlContext context) {
final DB_TYPE dbType = context==null ? null : context.dbType;
switch (dbType) {
case MYSQL: sb.append(mysql==null ? "" : mysql); break;
case SQLSERVER: sb.append(sqlserver==null ? "" : sqlserver); break;
case H... | void getSQL(final StringBuffer sb, final List<Object> bindings, final SqlContext context) {
final DB_TYPE dbType = context==null ? null : context.dbType;
if (dbType != null) {
switch (dbType) {
case MYSQL: sb.append(mysql==null ? "" : mysql); break;
case SQLSERVER: sb.append(sqlserver==null ? "" : ... |
public void handleChannelMsg(Command c, Bais msg) {
switch(c) {
case ChannelPlayers: {
int numPlayers = msg.readInt();
for(int i = 0; i < numPlayers; i++) {
addPlayer(netServ.players.get(msg.readInt()));
}
break;
} case JoinChannel: {
int pid = msg.readInt();
if (pid == netServ.my... | public void handleChannelMsg(Command c, Bais msg) {
switch(c) {
case ChannelPlayers: {
int numPlayers = msg.readInt();
for(int i = 0; i < numPlayers; i++) {
addPlayer(netServ.players.get(msg.readInt()));
}
break;
} case JoinChannel: {
int pid = msg.readInt();
if (pid == netServ.my... |
private Bitmap getWidgetPreview(AppWidgetProviderInfo info,
int cellHSpan, int cellVSpan, int cellWidth, int cellHeight) {
// Load the preview image if possible
String packageName = info.provider.getPackageName();
Drawable drawable = null;
Bitmap preview = null;
... | private Bitmap getWidgetPreview(AppWidgetProviderInfo info,
int cellHSpan, int cellVSpan, int cellWidth, int cellHeight) {
// Load the preview image if possible
String packageName = info.provider.getPackageName();
Drawable drawable = null;
Bitmap preview = null;
... |
protected void printAttributeValue(String text) {
int length = text.length();
for (int j = 0; j < length; j++) {
char c = text.charAt(j);
switch (c) {
case '"':
fPrinter.print(""");
break;
... | protected void printAttributeValue(String text) {
int length = text.length();
for (int j = 0; j < length; j++) {
char c = text.charAt(j);
switch (c) {
case '"':
fPrinter.print(""");
break;
... |
public void run() throws InterruptedException {
System.out.println("Discovering Hudson master");
// wait until we get the ACK back
while(true) {
try {
List<Candidate> candidates = new ArrayList<Candidate>();
for (DatagramPacket recv : discover()) ... | public void run() throws InterruptedException {
System.out.println("Discovering Hudson master");
// wait until we get the ACK back
while(true) {
try {
List<Candidate> candidates = new ArrayList<Candidate>();
for (DatagramPacket recv : discover()) ... |
public synchronized void insertLine(int l, int n, boolean scrollDown) {
l = checkBounds(l, 0, height - 1);
char cbuf[][] = null;
int abuf[][] = null;
int offset = 0;
int oldBase = screenBase;
int newScreenBase = screenBase;
int newWindowBase = windowBase;
int newBufSize = bufSize;
... | public synchronized void insertLine(int l, int n, boolean scrollDown) {
l = checkBounds(l, 0, height - 1);
char cbuf[][] = null;
int abuf[][] = null;
int offset = 0;
int oldBase = screenBase;
int newScreenBase = screenBase;
int newWindowBase = windowBase;
int newBufSize = bufSize;
... |
static public User getUser(HttpServletRequest request) {
String accessToken = request.getParameter("access_token");
if (accessToken == null) {
return null;
} else {
try {
URL url = new URL(
"https://www.googleapis.com/oauth2/v1/... | static public User getUser(HttpServletRequest request) {
String accessToken = request.getParameter("access_token");
if (accessToken == null) {
return null;
} else {
try {
URL url = new URL(
"https://www.googleapis.com/oauth2/v1/... |
public Object start(IApplicationContext appContext) {
try {
appContext.applicationRunning();
initializeProxySupport();
advisor = createInstallContext();
//fetch description of what to install
InstallDescription description = null;
try {
description = computeInstallDescription();
startRequir... | public Object start(IApplicationContext appContext) {
try {
appContext.applicationRunning();
initializeProxySupport();
advisor = createInstallContext();
//fetch description of what to install
InstallDescription description = null;
try {
description = computeInstallDescription();
startRequir... |
public List<Point> GetNeighbours(Grid grid, GridCell.Profile cellProfile, Point position) {
List<Point> potentialNeighbours = cellProfile.GetNeighbours(position);
List<Point> neighbours = new ArrayList<Point>();
for(Point p : potentialNeighbours) {
int x = position.x + p... | public List<Point> GetNeighbours(Grid grid, GridCell.Profile cellProfile, Point position) {
List<Point> potentialNeighbours = cellProfile.GetNeighbours(position);
List<Point> neighbours = new ArrayList<Point>();
for(Point p : potentialNeighbours) {
int x = position.x + p... |
public void fromJSON(JSONObject jsonObject) throws JSONException {
if (jsonObject != null) {
this.delegate = jsonObject;
Method[] methods = getClass().getDeclaredMethods();
for (Method method : methods) {
if (method.getParameterTypes().length == 1 && metho... | public void fromJSON(JSONObject jsonObject) throws JSONException {
if (jsonObject != null) {
this.delegate = jsonObject;
Method[] methods = getClass().getDeclaredMethods();
for (Method method : methods) {
if (method.getParameterTypes().length == 1 && metho... |
private void testGadget(URI gadget, JSONArray testResults,
Map<MessageTypeInt, Integer> errorCount)
throws IOException, UriCallbackException {
String[] argv = {
"-o", "/tmp/xx",
"-p", "xx",
"--css_prop_schema",
"resource:///com/google/caja/lang/css/... | private void testGadget(URI gadget, JSONArray testResults,
Map<MessageTypeInt, Integer> errorCount)
throws IOException, UriCallbackException {
String[] argv = {
"-o", "/tmp/xx",
"--css_prop_schema",
"resource:///com/google/caja/lang/css/css-extensions.json"... |
public void setNodeSelection(ProjectTreeNode node) {
if (selectedNode != node) {
selectedNode = node;
menuNode = node;
selectedProjectNode = (ProjectNode) getNodeOfClass(node, ProjectNode.class);
boolean subNode = false;
if (node instanceof DataSet... | public void setNodeSelection(ProjectTreeNode node) {
if (selectedNode != node) {
selectedNode = node;
menuNode = node;
selectedProjectNode = (ProjectNode) getNodeOfClass(node, ProjectNode.class);
boolean subNode = false;
if (node instanceof DataSet... |
public AtmosphereGuiceServlet(boolean isFilter, boolean autoDetectHandlers) {
framework = new AtmosphereFramework(isFilter, autoDetectHandlers) {
/**
* Install Guice event if other extension has been already installed.
*
* @param sc {@link javax.servlet.Se... | public AtmosphereGuiceServlet(boolean isFilter, boolean autoDetectHandlers) {
framework = new AtmosphereFramework(isFilter, autoDetectHandlers) {
/**
* Install Guice event if other extension has been already installed.
*
* @param sc {@link javax.servlet.Se... |
public List<Contact> getAllContactByString(String string, String userId) {
// TODO Auto-generated method stub
System.out.println("search contact "+userId+" count = "+count+" string = "+string);
ArrayList<Contact> values = db.get(userId);
ArrayList<Contact> result = new ArrayList<Contact>();
boolean fla... | public List<Contact> getAllContactByString(String string, String userId) {
// TODO Auto-generated method stub
//System.out.println("search contact "+userId+" count = "+count+" string = "+string);
ArrayList<Contact> values = db.get(userId);
ArrayList<Contact> result = new ArrayList<Contact>();
boolean f... |
private void bindArgs(SQLiteStatement stmt, Object[] args, FieldType[] argFieldTypes) throws SQLException {
if (args == null) {
return;
}
for (int i = 0; i < args.length; i++) {
Object arg = args[i];
if (arg == null) {
stmt.bindNull(i);
} else {
switch (argFieldTypes[i].getSqlType()) {
c... | private void bindArgs(SQLiteStatement stmt, Object[] args, FieldType[] argFieldTypes) throws SQLException {
if (args == null) {
return;
}
for (int i = 0; i < args.length; i++) {
Object arg = args[i];
if (arg == null) {
stmt.bindNull(i + 1);
} else {
switch (argFieldTypes[i].getSqlType()) {
... |
public GeneralPath icon(int h, boolean drawArmor, Color color)
{
// We do everything on a scale of 20 pixels. We scale up the path later if the height is > 20.
//BufferedImage unitImage = new BufferedImage(h, h, BufferedImage.TYPE_INT_ARGB);
GeneralPath unitOutline = new GeneralPath... | public GeneralPath icon(int h, boolean drawArmor, Color color)
{
// We do everything on a scale of 20 pixels. We scale up the path later if the height is > 20.
//BufferedImage unitImage = new BufferedImage(h, h, BufferedImage.TYPE_INT_ARGB);
GeneralPath unitOutline = new GeneralPath... |
public List<LaporanPeminjamanDto> dataLaporanPeminjaman(String mode, Date mulai, Date sampai){
List<LaporanPeminjamanDto> result = new ArrayList<LaporanPeminjamanDto>();
if(mode.equalsIgnoreCase("PEMINJAMAN")){
List<PeminjamanDetail> detailPeminjamans = transaksiService.getTrans... | public List<LaporanPeminjamanDto> dataLaporanPeminjaman(String mode, Date mulai, Date sampai){
List<LaporanPeminjamanDto> result = new ArrayList<LaporanPeminjamanDto>();
if(mode.equalsIgnoreCase("PEMINJAMAN")){
List<PeminjamanDetail> detailPeminjamans = transaksiService.getTrans... |
public PersonMainAttributes(Map<String, List<String>> attributeMap) {
mail = attributeMap.get(USER_ATTRIBUTE_MAIL) == null ? null : attributeMap.get(USER_ATTRIBUTE_MAIL).get(0);
displayName = attributeMap.get(USER_ATTRIBUTE_DISPLAY_NAME) == null ? null : attributeMap.get(USER_ATTRIBUTE_DISPLAY_NAME).get(0);
... | public PersonMainAttributes(Map<String, List<String>> attributeMap) {
mail = attributeMap.get(USER_ATTRIBUTE_MAIL) == null ? null : attributeMap.get(USER_ATTRIBUTE_MAIL).get(0);
displayName = attributeMap.get(USER_ATTRIBUTE_DISPLAY_NAME) == null ? null : attributeMap.get(USER_ATTRIBUTE_DISPLAY_NAME).get(0);
... |
private synchronized void deleteDuplicateObjects() {
synchronized(mPuzzleStore) { // Needed for deleteWithoutCommit(Identity)
synchronized(mFetcher) { // Needed for deleteWithoutCommit(Identity)
synchronized(mSubscriptionManager) { // Needed for deleteWithoutCommit(Identity)
synchronized(Persistent.transaction... | private synchronized void deleteDuplicateObjects() {
synchronized(mPuzzleStore) { // Needed for deleteWithoutCommit(Identity)
synchronized(mFetcher) { // Needed for deleteWithoutCommit(Identity)
synchronized(mSubscriptionManager) { // Needed for deleteWithoutCommit(Identity)
synchronized(Persistent.transaction... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.