buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public Document getMetaData(IDPConfig config) throws RuntimeException {
//Return as text/xml
try {
Crypto crypto = CertsUtils.createCrypto(config.getCertificate());
ByteArrayOutputStream bout = new ByteArrayOutputStream(4096);
Writer stre... | public Document getMetaData(IDPConfig config) throws RuntimeException {
//Return as text/xml
try {
Crypto crypto = CertsUtils.createCrypto(config.getCertificate());
ByteArrayOutputStream bout = new ByteArrayOutputStream(4096);
Writer stre... |
public void connect(TreeLinkNode root) {
// Start typing your Java solution below
// DO NOT write main() function
TreeLinkNode parent = root;
TreeLinkNode nextParent = null;
while(parent != null && nextParent != null) {
while(parent != null) {
if(p... | public void connect(TreeLinkNode root) {
// Start typing your Java solution below
// DO NOT write main() function
TreeLinkNode parent = root;
TreeLinkNode nextParent = null;
while(parent != null || nextParent != null) {
while(parent != null) {
if(p... |
public Graph(League l, Team t) {
if (l == null || t == null)
return;
// Number of team nodes is one less than total number of teams.
// The team nodes do not include the team being tested for elimination.
int teamTotal = l.getTeams().length;
// The r-combination of teamTotal for length 2 is the number of ... | public Graph(League l, Team t) {
if (l == null || t == null)
return;
// Number of team nodes is one less than total number of teams.
// The team nodes do not include the team being tested for elimination.
int teamTotal = l.getTeams().length;
// The r-combination of teamTotal for length 2 is the number of ... |
public List<AppointmentBlockData> getAppointmentBlocks(String fromDate, String toDate, Integer locationId)
throws ParseException {
List<AppointmentBlock> appointmentBlockList = new ArrayList<AppointmentBlock>();
List<AppointmentBlockData> appointmentBlockDatalist = new ArrayList<AppointmentBlockData>();
... | public List<AppointmentBlockData> getAppointmentBlocks(String fromDate, String toDate, Integer locationId)
throws ParseException {
List<AppointmentBlock> appointmentBlockList = new ArrayList<AppointmentBlock>();
List<AppointmentBlockData> appointmentBlockDatalist = new ArrayList<AppointmentBlockData>();
... |
protected void onPostExecute(Void result) {
super.onPostExecute(result);
Medicine medicine = new Medicine();
try {
medicine.setBrandName(json.getString("brandName"));
medicine.setDrug(json.getString("drug"));
medicine.setConcentration(json.getString("concentration"));
medicine.setForm(json.getStri... | protected void onPostExecute(Void result) {
super.onPostExecute(result);
Medicine medicine = new Medicine();
try {
medicine.setBrandName(json.getString("brandName"));
medicine.setDrug(json.getString("drug"));
medicine.setConcentration(json.getString("concentration"));
medicine.setForm(json.getStri... |
public void actionPerformed(final ActionEvent e) {
if (e.getActionCommand().equals("Cancel")) {
if (dcc.getType() == DCCSend.TransferType.SEND) {
button.setText("Resend");
} else {
button.setText("Close Window");
}
status.setTex... | public void actionPerformed(final ActionEvent e) {
if (e.getActionCommand().equals("Cancel")) {
if (dcc.getType() == DCCSend.TransferType.SEND) {
button.setText("Resend");
} else {
button.setText("Close Window");
}
status.setTex... |
public static <T> T getBean(Class<T> beanType) {
final Bean<T> bean = (Bean<T>) beanManager.getBeans(beanType).iterator().next();
final CreationalContext<T> ctx = beanManager.createCreationalContext(bean);
return (T) beanManager.getReference(bean, bean.getClass(), ctx);
}
| public static <T> T getBean(Class<T> beanType) {
final Bean<T> bean = (Bean<T>) beanManager.getBeans(beanType).iterator().next();
final CreationalContext<T> ctx = beanManager.createCreationalContext(bean);
return (T) beanManager.getReference(bean, beanType, ctx);
}
|
public void toggleWatchpoints(final IWorkbenchPart part, final ISelection finalSelection) {
Job job = new Job("Toggle Watchpoints") { //$NON-NLS-1$
protected IStatus run(IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
... | public void toggleWatchpoints(final IWorkbenchPart part, final ISelection finalSelection) {
Job job = new Job("Toggle Watchpoints") { //$NON-NLS-1$
protected IStatus run(IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
... |
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
if (Core.isServer()) {
if( itemStack.getTagCompound() == null ) {
itemStack.setTagCompound( new NBTTagCompound( ));
itemStack.getTagCompound().setInteger("Delay", 10);
}
NBTTagCompoun... | public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
if (Core.isServer()) {
if( itemStack.getTagCompound() == null ) {
itemStack.setTagCompound( new NBTTagCompound( ));
itemStack.getTagCompound().setInteger("Delay", 10);
}
NBTTagCompoun... |
public void addCraftingRecipes()
{
Ic2Recipes.addCraftingRecipe(new ItemStack(LogisticsPipes.ModuleItem, 1, ItemModule.ELECTRICMANAGER), new Object[] { "CGD", "rBr", "DrC",
Character.valueOf('C'), Items.getItem("electronicCircuit"),
Character.valueOf('D'), Items.getItem("reBattery"),
... | public void addCraftingRecipes()
{
Ic2Recipes.addCraftingRecipe(new ItemStack(LogisticsPipes.ModuleItem, 1, ItemModule.ELECTRICMANAGER), new Object[] { "CGD", "rBr", "DrC",
Character.valueOf('C'), Items.getItem("electronicCircuit"),
Character.valueOf('D'), Items.getItem("reBattery"),
... |
public static Statement getStatementFrom(String statement) throws InvalidStatementException {
if (Method.isValid(statement)) {
return Method.getStatementFrom(statement);
} else if (Declaration.isValid(statement)) {
return Declaration.getStatementFrom(statement);
} els... | public static Statement getStatementFrom(String statement) throws InvalidStatementException {
if (Method.isValid(statement)) {
return Method.getStatementFrom(statement);
} else if (IfStatement.isValid(statement)) {
return IfStatement.getStatementFrom(statement);
} els... |
public AddCauseEvent(Cause cause, String causeFrom) {
super("addcauseevent");
this.causeTo = Long.toString(cause.id);
this.text = cause.name.replaceAll(">", ">").replaceAll("<", "<").replaceAll("&", "&");
this.causeFrom = causeFrom;
this.creatorId = cause.creatorId == null ? null : Long.toString(ca... | public AddCauseEvent(Cause cause, String causeFrom) {
super("addcauseevent");
this.causeTo = Long.toString(cause.id);
this.text = cause.name.replaceAll("&", "&").replaceAll(">", ">").replaceAll("<", "<");
this.causeFrom = causeFrom;
this.creatorId = cause.creatorId == null ? null : Long.toString(ca... |
public List<TaskAction> getActionsForTask(Context context, long taskId) {
List<TaskAction> result = new ArrayList<TaskAction>();
if(taskId == -1)
return result;
Task task = PluginServices.getTaskService().fetchById(taskId, Task.ID, Task.TITLE, Task.NOTES);
if (task == nu... | public List<TaskAction> getActionsForTask(Context context, long taskId) {
List<TaskAction> result = new ArrayList<TaskAction>();
if(taskId == -1)
return result;
Task task = PluginServices.getTaskService().fetchById(taskId, Task.ID, Task.TITLE, Task.NOTES);
if (task == nu... |
private Icon generateIconFromState(final ObjectTreeNode node) {
Icon result = null;
if (node != null) {
final MetaObject baulastMO = node.getMetaObject(false);
if (baulastMO != null) {
final CidsBean baulastBean = baulastMO.getBean();
result = ... | private Icon generateIconFromState(final ObjectTreeNode node) {
Icon result = null;
if (node != null) {
final MetaObject baulastMO = node.getMetaObject(false);
if (baulastMO != null) {
final CidsBean baulastBean = baulastMO.getBean();
result = ... |
private static Image[] playerRrunningRightSprite()
{
Image[] img = new Image[8];
img[0] = CommunityGame.loader.getImageByName("playerAnimationRun.png").getSubImage(0, 0, 32, 64);
img[1] = CommunityGame.loader.getImageByName("playerAnimationRun.png").getSubImage(32, 0, 32, 64);
img[2] = CommunityGame.loader... | private static Image[] playerRrunningRightSprite()
{
Image[] img = new Image[8];
img[0] = CommunityGame.loader.getAnimationByName("playerRunningRight.png").getSubImage(0, 0, 32, 64);
img[1] = CommunityGame.loader.getAnimationByName("playerRunningRight.png").getSubImage(32, 0, 32, 64);
img[2] = CommunityGam... |
public static @Nullable ClBraced findSexpAtCaret(@NotNull Editor editor, boolean previous) {
Project project = editor.getProject();
if (project == null) { return null; }
VirtualFile vfile = FileDocumentManager.getInstance().getFile(editor.getDocument());
if (vfile == null) return null;
PsiFile ... | public static @Nullable ClBraced findSexpAtCaret(@NotNull Editor editor, boolean previous) {
Project project = editor.getProject();
if (project == null) { return null; }
VirtualFile vfile = FileDocumentManager.getInstance().getFile(editor.getDocument());
if (vfile == null) return null;
PsiFile ... |
public Control createContents(Composite parent) {
Composite client = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
layout.numColumns = 3;
layout.marginWidth = layout.marginHeight = 0;
client.setLayout(layout);
client.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composi... | public Control createContents(Composite parent) {
Composite client = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
layout.numColumns = 3;
layout.marginWidth = layout.marginHeight = 0;
client.setLayout(layout);
client.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composi... |
public BContact(String displayName, long id, Date bDay, String lookupKey, String photoId, DateIntegrity integrity) {
super(displayName, id, lookupKey, photoId);
this.bDay = bDay;
this.integrity = integrity;
tempCalendar.setTime(bDay);
bDaySort = SHORT_FORMAT.format(this.bDay);
nextYear = bDaySort.co... | public BContact(String displayName, long id, Date bDay, String lookupKey, String photoId, DateIntegrity integrity) {
super(displayName, id, lookupKey, photoId);
this.bDay = bDay;
this.integrity = integrity;
tempCalendar.setTime(bDay);
bDaySort = SHORT_FORMAT.format(this.bDay);
nextYear = bDaySort.co... |
protected void remoteCdxServerQuery(CDXQuery query, AuthToken authToken, CDXToSearchResultWriter resultWriter) throws IOException, AccessControlException
{
HTTPSeekableLineReader reader = null;
//Do local access/url validation check
String urlkey = selfRedirFilter.getCanonicalizer().urlStringToKey(query.getU... | protected void remoteCdxServerQuery(CDXQuery query, AuthToken authToken, CDXToSearchResultWriter resultWriter) throws IOException, AccessControlException
{
HTTPSeekableLineReader reader = null;
//Do local access/url validation check
String urlkey = selfRedirFilter.getCanonicalizer().urlStringToKey(query.getU... |
protected void createCustomAttributeLayout(Composite composite) {
RepositoryTaskAttribute attribute = this.taskData.getAttribute(BugzillaReportElement.DEPENDSON.getKeyString());
if (attribute != null && !attribute.isReadOnly()) {
Label label = createLabel(composite, attribute);
GridDataFactory.fillDefaults(... | protected void createCustomAttributeLayout(Composite composite) {
RepositoryTaskAttribute attribute = this.taskData.getAttribute(BugzillaReportElement.DEPENDSON.getKeyString());
if (attribute != null && !attribute.isReadOnly()) {
Label label = createLabel(composite, attribute);
GridDataFactory.fillDefaults(... |
protected final Control createDialogArea(final Composite parent) {
getShell().setText(MYLAR_NOTIFICATION_LABEL);
form = toolkit.createForm(parent);
form.getBody().setLayout(new GridLayout());
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(MYLAR_NOTIFICATION_LA... | protected final Control createDialogArea(final Composite parent) {
getShell().setText(MYLAR_NOTIFICATION_LABEL);
form = toolkit.createForm(parent);
form.getBody().setLayout(new GridLayout());
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(MYLAR_NOTIFICATION_LA... |
private Object autoCreatePropertyIfPossible(BeanWrapper bean, String propertyName, Object propertyValue) {
propertyName = PropertyAccessorUtils.canonicalPropertyName(propertyName);
int currentKeyStart = propertyName.indexOf(PropertyAccessor.PROPERTY_KEY_PREFIX_CHAR);
int currentKeyEnd = pro... | private Object autoCreatePropertyIfPossible(BeanWrapper bean, String propertyName, Object propertyValue) {
propertyName = PropertyAccessorUtils.canonicalPropertyName(propertyName);
int currentKeyStart = propertyName.indexOf(PropertyAccessor.PROPERTY_KEY_PREFIX_CHAR);
int currentKeyEnd = pro... |
public void evaluate(final ICompiledExpression expression, final IRuntimeContext context, final IJavaThread thread, final IEvaluationListener listener) {
Thread evaluationThread= new Thread(new Runnable() {
public void run() {
fEvaluationCancelled= false;
fEvaluationComplete= false;
EvaluationResult ... | public void evaluate(final ICompiledExpression expression, final IRuntimeContext context, final IJavaThread thread, final IEvaluationListener listener) {
Thread evaluationThread= new Thread(new Runnable() {
public void run() {
fEvaluationCancelled= false;
fEvaluationComplete= false;
EvaluationResult ... |
public void testOriginateAsync() throws Exception
{
final String source;
//source = "SIP/1301";
source = "Local/1313@from-local";
server.originateToExtensionAsync(source, "from-local", "1399", 1, timeout,
new CallerId("AJ Test Call", "08003301000"), null,
... | public void testOriginateAsync() throws Exception
{
final String source;
//source = "SIP/1313";
source = "Local/1313@from-local/n";
server.originateToExtensionAsync(source, "from-local", "1399", 1, timeout,
new CallerId("AJ Test Call", "08003301000"), null,
... |
public JComponent makeViewer(ViewableContainer container)
{
if (container instanceof RootPaneContainer) {
rpc = (RootPaneContainer)container;
} else {
rpc = NearInfinity.getInstance();
}
int tileCount = decoder.info().tileCount();
// 1. creating top panel
// 1.1. creating label... | public JComponent makeViewer(ViewableContainer container)
{
if (container instanceof RootPaneContainer) {
rpc = (RootPaneContainer)container;
} else {
rpc = NearInfinity.getInstance();
}
int tileCount = decoder.info().tileCount();
int defaultColumns = Math.min(tileCount, DEFAULT_COL... |
public GATKSAMRecord(SAMRecord record, boolean useOriginalBaseQualities, byte defaultBaseQualities) {
super(null); // it doesn't matter - this isn't used
if ( record == null )
throw new IllegalArgumentException("The SAMRecord argument cannot be null");
mRecord = record;
... | public GATKSAMRecord(SAMRecord record, boolean useOriginalBaseQualities, byte defaultBaseQualities) {
super(null); // it doesn't matter - this isn't used
if ( record == null )
throw new IllegalArgumentException("The SAMRecord argument cannot be null");
mRecord = record;
... |
public static void sell(final ItemStack itemStack, final Items item, Player player, final ItemStorageHolder region) {
player.getInventory().removeItem(itemStack);
ForeignCollection<PlayerOwns> playerList = region.getOwners();
boolean isOwner = false;
for(PlayerOwns player1 : player... | public static void sell(final ItemStack itemStack, final Items item, Player player, final ItemStorageHolder region) {
player.getInventory().removeItem(itemStack);
ForeignCollection<PlayerOwns> playerList = region.getOwners();
boolean isOwner = false;
for(PlayerOwns player1 : player... |
public void run() {
try {
//SunToolkit.createNewAppContext();
//System.out.println("Current app context " + AppContext.getAppContext());
ExecutionEngine ee = new EE();
ExecutorTask task = ee.execute("prim", new R(), IOProvider.getDefault().getIO("... | public void run() {
try {
//SunToolkit.createNewAppContext();
//System.out.println("Current app context " + AppContext.getAppContext());
ExecutionEngine ee = new EE();
ExecutorTask task = ee.execute("prim", new R(), IOProvider.getDefault().getIO("... |
public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
try {
monitor.beginTask("", 100); //$NON-NLS-1$
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription des = mngr.create... | public void createProject(IProject project, boolean defaults, boolean onFinish, IProgressMonitor monitor) throws CoreException {
try {
monitor.beginTask("", 100); //$NON-NLS-1$
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription des = mngr.create... |
public void update(GameContainer container, StateBasedGame game, int delta)
throws SlickException {
super.update(container, game, delta);
// Balle balle;
// if (deplacementAuto < 230 && deplacementAutoDroite) {
// applyForce(100, getVelY());
// deplacementAuto++;
// } else {
// deplacementAutoDroite = fa... | public void update(GameContainer container, StateBasedGame game, int delta)
throws SlickException {
super.update(container, game, delta);
// Balle balle;
// if (deplacementAuto < 230 && deplacementAutoDroite) {
// applyForce(100, getVelY());
// deplacementAuto++;
// } else {
// deplacementAutoDroite = fa... |
public void print(String line) {
while(!line.isEmpty()) {
if (matcher.match(line)) {
int begin = matcher.begin(line);
int end = matcher.end(begin, line);
System.out.print(line.substring(0, begin));
System.out.print("\u001B[1;31m" + ... | public void print(String line) {
while(!line.isEmpty()) {
if (matcher.match(line)) {
int begin = matcher.begin(line);
if (begin == -1) {
break;
}
int end = matcher.end(begin, line);
System.out.pri... |
protected void process(Entity e) {
Renderable r = (Renderable)e.getComponent(Renderable.class);
if (e.hasComponent(Transform.class)) {
Transform t = (Transform)e.getComponent(Transform.class);
Vector2 pos = Convert.metersToPixels(t.getPosition().cpy());
float angle = t.getRotation();
//H... | protected void process(Entity e) {
Renderable r = (Renderable)e.getComponent(Renderable.class);
if (e.hasComponent(Transform.class)) {
Transform t = (Transform)e.getComponent(Transform.class);
Vector2 pos = Convert.metersToPixels(t.getPosition().cpy());
float angle = t.getRotation();
//H... |
public Course getCourse(@PathParam("id") Short id) {
// TypedQuery<Course> q = em.createQuery("Select c from Course c where c.id = :id", Course.class);
// q.setParameter("id", id);
// return q.getSingleResult();
// testdata
Course retVal = new Course("Fagnavn")... | public Course getCourse(@PathParam("id") Short id) {
// TypedQuery<Course> q = em.createQuery("Select c from Course c where c.id = :id", Course.class);
// q.setParameter("id", id);
// return q.getSingleResult();
// testdata
Course retVal = new Course("Fagnavn")... |
private @Nullable VirtualMachine toVirtualMachine(@Nullable Node node) throws CloudException, InternalException {
if( node == null ) {
return null;
}
HashMap<String,String> properties = new HashMap<String,String>();
VirtualMachine server = new VirtualMachine();
No... | private @Nullable VirtualMachine toVirtualMachine(@Nullable Node node) throws CloudException, InternalException {
if( node == null ) {
return null;
}
HashMap<String,String> properties = new HashMap<String,String>();
VirtualMachine server = new VirtualMachine();
No... |
protected ArtifactEdit(IProject aProject, boolean toAccessAsReadOnly, boolean forCreate, String projectType, Map editModelParams) throws IllegalArgumentException {
if (aProject == null || !aProject.isAccessible())
throw new IllegalArgumentException("Invalid project: " + aProject);
ModuleCoreNature nature = Mo... | protected ArtifactEdit(IProject aProject, boolean toAccessAsReadOnly, boolean forCreate, String projectType, Map editModelParams) throws IllegalArgumentException {
if (aProject == null || !aProject.isAccessible())
throw new IllegalArgumentException("Invalid project: " + aProject);
ModuleCoreNature nature = Mo... |
public void testSqlEscaping() throws Exception {
VirtualTable vt = new VirtualTable("test", "%param1%");
vt.setEscapeSql(true);
vt.addParameter(new VirtualTableParameter("param1", "default_value", new RegexpValidator(".*")));
String singleQuote = vt.expandParameters(new Hints(
... | public void testSqlEscaping() throws Exception {
VirtualTable vt = new VirtualTable("test", "%param1%");
vt.setEscapeSql(true);
vt.addParameter(new VirtualTableParameter("param1", "default_value", new RegexpValidator(".*")));
String singleQuote = vt.expandParameters(new Hints(
... |
public final void testItemDisplayBuildings()
throws ParserConfigurationException, IOException, SAXException
{
String fldName = "item_display";
createIxInitVars("buildingTests.mrc");
assertDisplayFieldProperties(fldName);
assertFieldMultiValued(fldName);
// APPLIEDPHY ignored for building facet, but n... | public final void testItemDisplayBuildings()
throws ParserConfigurationException, IOException, SAXException
{
String fldName = "item_display";
createIxInitVars("buildingTests.mrc");
assertDisplayFieldProperties(fldName);
assertFieldMultiValued(fldName);
// APPLIEDPHY ignored for building facet, but n... |
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.mylar.tests");
ErrorLogger.setDumpErrors(true);
MylarIdePlugin.getDefault().setResourceMonitoringEnabled(false);
// TODO: the order of these tests matters, but shouldn't
//$JUnit-BEGI... | public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.mylar.tests");
ErrorLogger.setDumpErrors(true);
MylarIdePlugin.getDefault().setResourceMonitoringEnabled(false);
// TODO: the order of these tests matters, but shouldn't
//$JUnit-BEGI... |
private void serialize(final DBNode node) throws IOException {
final FTPosData ft = node instanceof FTPosNode ? ((FTPosNode) node).ft : null;
final Data data = node.data;
int p = node.pre;
int k = data.kind(p);
if(k == Data.ATTR) SERATTR.thrwSerial(node);
boolean doc = false;
final TokenS... | private void serialize(final DBNode node) throws IOException {
final FTPosData ft = node instanceof FTPosNode ? ((FTPosNode) node).ft : null;
final Data data = node.data;
int p = node.pre;
int k = data.kind(p);
if(k == Data.ATTR) SERATTR.thrwSerial(node);
boolean doc = false;
final TokenS... |
private ValidationResponse crossValidateRepoTargetPrivilege( CRepoTargetPrivilege settings )
{
ValidationResponse vr = new SecurityValidationResponse();
CRepositoryTarget target = nexusConfiguration.readRepositoryTarget( settings.getRepositoryTargetId() );
// Invalid ta... | private ValidationResponse crossValidateRepoTargetPrivilege( CRepoTargetPrivilege settings )
{
ValidationResponse vr = new SecurityValidationResponse();
CRepositoryTarget target = nexusConfiguration.readRepositoryTarget( settings.getRepositoryTargetId() );
// Invalid ta... |
protected String doInBackground(String... input) {
try
{
if ( input.length != 2 )
return "Bad request";
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(new HttpGet("http://andrew.lobos.me/cans/check.php?data="+input[0]+"&name="+input[1]));
Statu... | protected String doInBackground(String... input) {
try
{
if ( input.length != 2 )
return "Bad request";
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(new HttpGet("http://andrew.lobos.me/cans/check.php?data="+input[0]+"&name="+input[1]));
Statu... |
static void initializeDrawbridgeState ()
{
drawbridgeState[Block.stone.blockID] = 1;
drawbridgeState[Block.grass.blockID] = 1;
drawbridgeState[Block.dirt.blockID] = 1;
drawbridgeState[Block.cobblestone.blockID] = 1;
drawbridgeState[Block.bedrock.blockID] = 2;
draw... | static void initializeDrawbridgeState ()
{
drawbridgeState[Block.stone.blockID] = 1;
drawbridgeState[Block.grass.blockID] = 1;
drawbridgeState[Block.dirt.blockID] = 1;
drawbridgeState[Block.cobblestone.blockID] = 1;
drawbridgeState[Block.bedrock.blockID] = 2;
draw... |
public void computeExtractionStats() {
includeNotExtracted = true;
TablePrettyPrinter printer = TablePrettyPrinter.getTablePrettyPrinter(EXTRACTION_STATS_FILE);
if (libraries == null) {
logger.info("Loading libraries...");
populateLibraries();
}
logger.info("Computing stats for " + lib... | public void computeExtractionStats() {
includeNotExtracted = true;
TablePrettyPrinter printer = TablePrettyPrinter.getTablePrettyPrinter(EXTRACTION_STATS_FILE);
if (libraries == null) {
logger.info("Loading libraries...");
populateLibraries();
}
logger.info("Computing stats for " + lib... |
public Scene onCreateScene() {
this.mEngine.registerUpdateHandler(new FPSLogger());
final Scene scene = new Scene();
/*
* User Interface HUD At each corner of the screen, will display
* player's information Include number of credits There will be a button
* to roll dice and turn number will be disp... | public Scene onCreateScene() {
this.mEngine.registerUpdateHandler(new FPSLogger());
final Scene scene = new Scene();
/*
* User Interface HUD At each corner of the screen, will display
* player's information Include number of credits There will be a button
* to roll dice and turn number will be disp... |
static void readInputFiles(FastByIDMap<FastIDSet> knownItemIDs,
FastByIDMap<FastByIDFloatMap> rbyRow,
FastByIDMap<FastByIDFloatMap> rbyColumn,
File inputDir) throws IOException {
FilenameFilter csvFilter = new PatternFilenameF... | static void readInputFiles(FastByIDMap<FastIDSet> knownItemIDs,
FastByIDMap<FastByIDFloatMap> rbyRow,
FastByIDMap<FastByIDFloatMap> rbyColumn,
File inputDir) throws IOException {
FilenameFilter csvFilter = new PatternFilenameF... |
public void upload(loci.visbio.data.Dataset data,
String server, String username, String password)
{
try {
OMEWriter writer = new OMEWriter();
BufferedImageWriter biWriter = new BufferedImageWriter(writer);
ServiceFactory factory = new ServiceFactory();
OMEXMLService service =
... | public void upload(loci.visbio.data.Dataset data,
String server, String username, String password)
{
try {
OMEWriter writer = new OMEWriter();
BufferedImageWriter biWriter = new BufferedImageWriter(writer);
ServiceFactory factory = new ServiceFactory();
OMEXMLService service =
... |
public static void enhance(final NetcdfDataset dataset, final Writer writer, final String query) {
MockGetCapP = null;
xmlString = null;
EventTime =null;
isMultiTime = false;
isMultiObsProperties = false;
//get the extent of the Netcdf file Lat/lon/time
Exten... | public static void enhance(final NetcdfDataset dataset, final Writer writer, final String query) {
MockGetCapP = null;
xmlString = null;
EventTime =null;
isMultiTime = false;
isMultiObsProperties = false;
//get the extent of the Netcdf file Lat/lon/time
Exten... |
public void actionPerformed(ActionEvent e) {
String name;
try {
name = FileUtil.getFile("Export Vizmaper as property file", FileUtil.SAVE,
new CyFileFilter[] { }).toString();
} catch (Exception exp) {
// this is because the selection was canceled
return;
}
if (!name.end... | public void actionPerformed(ActionEvent e) {
String name;
try {
name = FileUtil.getFile("Export Vizmap property file", FileUtil.SAVE,
new CyFileFilter[] { }).toString();
} catch (Exception exp) {
// this is because the selection was canceled
return;
}
if (!name.endsWith... |
public static void contructResumeView(Activity context, GetView getView, Programme programme) {
ImageLoader imageLoader = new ImageLoader(context.getApplicationContext());
ImageView icon = (ImageView) getView.findViewById(R.id.programme_resume_icon);
ImageView rating = (ImageView) getView.f... | public static void contructResumeView(Activity context, GetView getView, Programme programme) {
ImageLoader imageLoader = new ImageLoader(context.getApplicationContext());
ImageView icon = (ImageView) getView.findViewById(R.id.programme_resume_icon);
ImageView rating = (ImageView) getView.f... |
public void run() {
sLog.info("Online Sectioning Logger is up.");
try {
iActive = true;
try {
iOut = new PrintWriter(new FileWriter(new File(ApplicationProperties.getDataFolder(), "sectioning.log"), true));
} catch (IOException e) {
sLog.warn("Unable to create sectioning log: " + e.getMessage(), e... | public void run() {
sLog.info("Online Sectioning Logger is up.");
try {
iActive = true;
while (true) {
try {
sleep(60000);
} catch (InterruptedException e) {
}
List<OnlineSectioningLog.Action> actionsToSave = null;
synchronized (iActions) {
if (!iActions.isEmpty()) {
actio... |
public boolean addContact(String username, String inetAddress) {
InetAddress ip = null;
boolean hasErrors = true;
// do some validation
if(username.isEmpty() || inetAddress.isEmpty()) {
view.setError(I18n.get("ch9k.core", "error_fill_all_fields"));
} else {
... | public boolean addContact(String username, String inetAddress) {
InetAddress ip = null;
boolean hasErrors = true;
// do some validation
if(username.isEmpty() || inetAddress.isEmpty()) {
view.setError(I18n.get("ch9k.core", "error_fill_all_fields"));
} else {
... |
public void fill(CoolBar coolBar, int index) {
if (checkDisposed()) { return; }
if (coolItem == null && coolBar != null) {
ToolBar oldToolBar = toolBarManager.getControl();
ToolBar toolBar = toolBarManager.createControl(coolBar);
if ((oldToolBar != null) && (!old... | public void fill(CoolBar coolBar, int index) {
if (checkDisposed()) { return; }
if (coolItem == null && coolBar != null) {
ToolBar oldToolBar = toolBarManager.getControl();
ToolBar toolBar = toolBarManager.createControl(coolBar);
if ((oldToolBar != null) && (oldT... |
public void process(Node result, Element tag, TemplateProcessor processor) {
JSONObject person = getValueFromTag(tag, PERSON_ATTR, processor, JSONObject.class);
if (person == null) {
return;
}
JSONObject name = person.optJSONObject("name");
if (name == null) {
return;
}
String... | public void process(Node result, Element tag, TemplateProcessor processor) {
JSONObject person = getValueFromTag(tag, PERSON_ATTR, processor, JSONObject.class);
if (person == null) {
return;
}
JSONObject name = person.optJSONObject("name");
if (name == null) {
return;
}
String... |
public void draw(Graphics2D g)
{
if(gameEntity.getOwner() == null)
{
g.setColor(DEFAULT_CITY_COLOUR);
}
else
{
g.setColor(Color.CYAN);
}
g.fillOval(CITY_DIAMETER * -2, CITY_DIAMETER * -2, CITY_DIAMETER, CITY_DIAMETER);
}
| public void draw(Graphics2D g)
{
if(gameEntity.getOwner() == null)
{
g.setColor(DEFAULT_CITY_COLOUR);
}
else
{
g.setColor(Color.CYAN);
}
g.fillOval(-CITY_DIAMETER / 2, -CITY_DIAMETER / 2, CITY_DIAMETER, CITY_DIAMETER);
}
|
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
if(extras == null) {
setResult(Activity.RESULT_CANCELED);
finish();
return;
}
mPin = (StampPin)extras.getParcelable(ConstantValue.ExtrasStampPin);
boo... | @Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
if(extras == null) {
setResult(Activity.RESULT_CANCELED);
finish();
return;
}
mPin = (StampPin)extras.getParcelable(ConstantValue.ExtrasStampPin);
boo... |
public AttributesDescriptor[] getAttributeDescriptors()
{
return new AttributesDescriptor[]{
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.keyword"), JetHighlightingColors.KEYWORD),
new AttributesDescriptor(JetBundle.message("options.idea.attribute.descriptor.builtin.anno... | public AttributesDescriptor[] getAttributeDescriptors()
{
return new AttributesDescriptor[]{
new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.keyword"), JetHighlightingColors.KEYWORD),
new AttributesDescriptor(JetBundle.message("options.idea.attribute.descriptor.builtin.anno... |
public Integer getBalance(String player) {
if (!hasAccount(player.toLowerCase())) {
createAccount(player.toLowerCase());
}
try {
String sql = "SELECT `balance_xp` FROM `bc_accounts` WHERE `player_name` = ?";
PreparedStatement preparedUpdateStatement = conn.prepareStatement(sql);
... | public Integer getBalance(String player) {
if (!hasAccount(player.toLowerCase())) {
createAccount(player.toLowerCase());
}
try {
String sql = "SELECT `balance_xp` FROM `bc_accounts` WHERE `player_name` = ?";
PreparedStatement preparedUpdateStatement = conn.prepareStatement(sql);
... |
private int readImpl(ByteBuffer buffer, long position) throws IOException {
// buffer.checkWritable(); // TODO ByteBuffer.checkWritable() is
// protected
checkOpen();
checkReadable();
if (!buffer.hasRemaining()) {
return 0;
}
int bytesRead = 0;
boolean completed = false;
try {
begin();
try {... | private int readImpl(ByteBuffer buffer, long position) throws IOException {
if(buffer.isReadOnly()) {
throw new IllegalArgumentException("read-only buffer");
}
checkOpen();
checkReadable();
if (!buffer.hasRemaining()) {
return 0;
}
int bytesRead = 0;
boolean completed = false;
try {
begin();... |
public void run() {
try {
if (isClosed.get()) return;
if (log.isDebugEnabled()) {
Set<String> keys = connectionsPool.keySet();
for (String s : keys) {
log.debug("Entry count for : {} : {}", s, connectio... | public void run() {
try {
if (isClosed.get()) return;
if (log.isDebugEnabled()) {
Set<String> keys = connectionsPool.keySet();
for (String s : keys) {
log.debug("Entry count for : {} : {}", s, connectio... |
private void createComposite (Composite parent) {
optEditors = new ArrayList<String>();
optStrings = new ArrayList<IParameters>();
optMoreInfo = new ArrayList<String>();
writers = new ArrayList<String>();
// XLIFF options
optEditors.add("net.sf.okapi.steps.rainbowkit.xliff.Options");
optStrings.add(creat... | private void createComposite (Composite parent) {
optEditors = new ArrayList<String>();
optStrings = new ArrayList<IParameters>();
optMoreInfo = new ArrayList<String>();
writers = new ArrayList<String>();
// XLIFF options
optEditors.add("net.sf.okapi.steps.rainbowkit.xliff.Options");
optStrings.add(creat... |
private Database(DatabaseConfig config, int openMode) throws IOException {
config.mEventListener = mEventListener = SafeEventListener.makeSafe(config.mEventListener);
final File baseFile = config.mBaseFile;
final File[] dataFiles = config.dataFiles();
int pageSize = config.mPageSiz... | private Database(DatabaseConfig config, int openMode) throws IOException {
config.mEventListener = mEventListener = SafeEventListener.makeSafe(config.mEventListener);
final File baseFile = config.mBaseFile;
final File[] dataFiles = config.dataFiles();
int pageSize = config.mPageSiz... |
public static void main(String[] args) throws Exception {
String organism ;
String db ;
String method ;
File srcDir;
File destDir;
boolean filtering = true;
Properties p = INIConfiguration.getConfiguration();
OptionParser parser = new OptionParser();
parser.accepts("srcSBGN", "Name of the SBGN f... | public static void main(String[] args) throws Exception {
String organism ;
String db ;
String method ;
File srcDir;
File destDir;
boolean filtering = true;
Properties p = INIConfiguration.getConfiguration();
OptionParser parser = new OptionParser();
parser.accepts("srcSBGN", "Name of the SBGN f... |
void _add( Node node , State state ){
if ( node == null || state == null )
throw new RuntimeException( "can't be null" );
// --- blocking ----
if ( node instanceof RootNode ){
_assertOne( node );
_add( node.childNodes().get(0) , state );... | void _add( Node node , State state ){
if ( node == null || state == null )
throw new RuntimeException( "can't be null" );
// --- blocking ----
if ( node instanceof RootNode ){
_assertOne( node );
_add( node.childNodes().get(0) , state );... |
public boolean runAutomated(AutomatedInstallData idata, XMLElement panelRoot)
{
try
{
ProcessPanelWorker worker = new ProcessPanelWorker(idata, this);
worker.run();
return this.worker.getResult();
}
catch (IOException e)
{... | public boolean runAutomated(AutomatedInstallData idata, XMLElement panelRoot)
{
try
{
ProcessPanelWorker worker = new ProcessPanelWorker(idata, this);
worker.run();
return worker.getResult();
}
catch (IOException e)
{
... |
public void loadAttributesInternal(CyAttributes cyAttrs, Reader fileIn)
throws IOException {
badDecode = false;
try {
final BufferedReader reader;
if (fileIn instanceof BufferedReader) {
reader = (BufferedReader) fileIn;
} else {
reader = new BufferedReader(fileIn);
}
String attributeN... | public void loadAttributesInternal(CyAttributes cyAttrs, Reader fileIn)
throws IOException {
badDecode = false;
boolean guessedAttrType = false; // We later set this to true if we have to guess the attribute type.
try {
final BufferedReader reader;
if (fileIn instanceof BufferedReader) {
reader = ... |
protected Resource loadFile(QName name) {
if (nocache.contains(name)) {
return null;
}
Source source = ext.sourceLoader().classSource(name);
if (source == null)
return null;
String packageName = name.qualifier() != null ? name.qualifi... | protected Resource loadFile(QName name) {
if (nocache.contains(name)) {
return null;
}
Source source = ext.sourceLoader().classSource(name);
if (source == null)
return null;
String packageName = name.qualifier() != null ? name.qualifi... |
public Dialog onCreateDialog(Bundle savedInstanceState) {
final ContentResolver resolver = getActivity().getContentResolver();
final OnClickListener okListener = new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
final P... | public Dialog onCreateDialog(Bundle savedInstanceState) {
final ContentResolver resolver = getActivity().getContentResolver();
final OnClickListener okListener = new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
final P... |
public GroupReferenceBox() {
suggestions = new DefaultSuggestionDisplay();
textBox = new NpTextBox();
oracle = new AccountGroupSuggestOracle();
suggestBox = new SuggestBox( //
new RPCSuggestOracle(oracle), //
textBox, //
suggestions);
initWidget(suggestBox);
suggestBox... | public GroupReferenceBox() {
suggestions = new DefaultSuggestionDisplay();
textBox = new NpTextBox();
oracle = new AccountGroupSuggestOracle();
suggestBox = new SuggestBox( //
new RPCSuggestOracle(oracle), //
textBox, //
suggestions);
initWidget(suggestBox);
textBox.ad... |
public void createViewersForCurrentEpitope()
{
contentPane.removeAll();
sequencePanels.clear();
StructureModel model = AppBase.sgetModel();
if (model.getStructures() == null)
return;
for (Structure struc : model.getStructures())
{
final ... | public void createViewersForCurrentEpitope()
{
// use invokeLater causes:
// Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
//at org.rcsb.lx.ui.SequenceStructureTitlePanel.heightForWidth(SequenceStructureTitlePanel.java:111)
// javax.swing.SwingUtilities.invokeLater(new... |
private static void classSetUp()
{
mdStruct = MdStructDAO.newInstance();
mdStruct.setValue(MdStructInfo.PACKAGE, pack);
mdStruct.setValue(MdStructInfo.NAME, "TestStruct");
mdStruct.setStructValue(MdStructInfo.DISPLAY_LABEL, MdAttributeLocalInfo.DEFAULT_LOCALE, "Test Struct");
mdStruct.apply();
... | private static void classSetUp()
{
mdStruct = MdStructDAO.newInstance();
mdStruct.setValue(MdStructInfo.PACKAGE, pack);
mdStruct.setValue(MdStructInfo.NAME, "TestStruct");
mdStruct.setStructValue(MdStructInfo.DISPLAY_LABEL, MdAttributeLocalInfo.DEFAULT_LOCALE, "Test Struct");
mdStruct.apply();
... |
protected IContentAssistService getService(IProject project) {
ServiceModelManager manager = ServiceModelManager.getInstance();
IServiceConfiguration config = manager.getActiveConfiguration(project);
if (config == null) {
return null;
}
IService service = manager.getService(IRDTServiceConstants.SERVICE_C_... | protected IContentAssistService getService(IProject project) {
ServiceModelManager manager = ServiceModelManager.getInstance();
if(!manager.isConfigured(project))
return null;
IServiceConfiguration config = manager.getActiveConfiguration(project);
if (config == null) {
return null;
}
IService service... |
private Thread getSockedListenerThread() {
if (sockedListenerThread == null) {
Thread listenerThread = new Thread(UDPTransport.class.getSimpleName() + ": Listener Thread "
+ this.hashCode()) {
byte[] sBuffer = new byte[maxBufferSize];
String mu... | private Thread getSockedListenerThread() {
if (sockedListenerThread == null) {
Thread listenerThread = new Thread(UDPTransport.class.getSimpleName() + ": Listener Thread "
+ this.hashCode()) {
byte[] sBuffer = new byte[maxBufferSize];
String mu... |
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
if (is_animating) return false;
if (is_waiting) return false;
x0 = event.getX();
y0 = event.getY();
if (y0 < ylower) {
if (STATE_GESTURE_ONLY == main_state) {
run();
return false;
... | public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
if (is_animating) return false;
if (is_waiting) return false;
x0 = event.getX();
y0 = event.getY();
if (y0 < ylower) {
if (STATE_GESTURE_ONLY == main_state) {
run();
return false;
... |
private BvhNode createTree(int left, int right) {
// TODO(B): fill in this function.
// int i, j;
// ==== Step 1 ====
// Find out the BIG bounding box enclosing all the surfaces in the range [left, right)
// and store them in minB and maxB.
// Hint: To find the bounding box for each surface, use getMinBoun... | private BvhNode createTree(int left, int right) {
// TODO(B): fill in this function.
// int i, j;
// ==== Step 1 ====
// Find out the BIG bounding box enclosing all the surfaces in the range [left, right)
// and store them in minB and maxB.
// Hint: To find the bounding box for each surface, use getMinBoun... |
public void handleEvent(Event event) {
switch (event.type) {
case SWT.Activate:
case SWT.MouseWheel:
if (fAdditionalInfoController == null)
return;
if (event.widget == fShell || event.widget == fTable || event.widget == fScrollbar)
return;
if (fAdditionalInfoController.getInternalAcc... | public void handleEvent(Event event) {
switch (event.type) {
case SWT.Activate:
case SWT.MouseWheel:
if (fAdditionalInfoController == null)
return;
if (event.widget == fShell || event.widget == fTable || event.widget == fScrollbar)
return;
if (fAdditionalInfoController.getInternalAcc... |
private Map<String, Object> processRequest( Map<String, Object> model, String sourceId, Integer index, SortOrderEnum sortOrderEnum, String sortItem) throws Exception{
List<Activity> activities = new ArrayList<Activity>();
if (sourceId == null) {
activities = activityDao.getAll();
... | private Map<String, Object> processRequest( Map<String, Object> model, String sourceId, Integer index, SortOrderEnum sortOrderEnum, String sortItem) throws Exception{
List<Activity> activities = new ArrayList<Activity>();
if (sourceId == null) {
activities = activityDao.getAll();
... |
public OI() {
shootingButton.whenPressed(new TuneShooter());
firingButton.whenPressed(new Feed());
firstDisable.whenPressed(new StopAll());
secondDisable.whenPressed(new StopAll());
thirdDisable.whenPressed(new StopAll());
firstDisableAlt.whenPressed... | public OI() {
shootingButton.whenPressed(new TuneShooter());
firingButton.whenPressed(new Feed());
firstDisable.whenPressed(new StopAll());
secondDisable.whenPressed(new StopAll());
thirdDisable.whenPressed(new StopAll());
firstDisableAlt.whenPressed... |
public static <T extends JPASupport> T edit(Object o, String name, Map<String, String[]> params) {
try {
BeanWrapper bw = new BeanWrapper(o.getClass());
bw.bind(name, o.getClass(), params, "", o);
// relations
Set<Field> fields = new HashSet<Field>();
... | public static <T extends JPASupport> T edit(Object o, String name, Map<String, String[]> params) {
try {
BeanWrapper bw = new BeanWrapper(o.getClass());
bw.bind(name, o.getClass(), params, "", o);
// relations
Set<Field> fields = new HashSet<Field>();
... |
static boolean compare(
TemplateModel leftValue, Expression leftExp,
int operator, String operatorString,
TemplateModel rightValue, Expression rightExp,
Expression defaultBlamed,
boolean typeMismatchMeansNotEqual,
boolean leftNullReturnsFalse, ... | static boolean compare(
TemplateModel leftValue, Expression leftExp,
int operator, String operatorString,
TemplateModel rightValue, Expression rightExp,
Expression defaultBlamed,
boolean typeMismatchMeansNotEqual,
boolean leftNullReturnsFalse, ... |
public void runHandleMessage(PircBot bot, String channel, String sender, String message) {
sender = sender.toLowerCase();
String[] splitMsg = message.split(" ", 3);
if(splitMsg[0].equals(getCommandName())) {
if(splitMsg.length == 3) {
// Add the tell message
... | public void runHandleMessage(PircBot bot, String channel, String sender, String message) {
String[] splitMsg = message.split(" ", 3);
if(splitMsg[0].equals(getCommandName())) {
if(splitMsg.length == 3) {
// Add the tell message
// - [command] [target user]... |
public void testHelloWorld() throws Exception {
assertTrue(Jsoup.connect("http://localhost:18080/maven-vbox-plugin-example").get().html().contains("Hello World"));
}
| public void testHelloWorld() throws Exception {
assertTrue(Jsoup.connect("http://192.168.56.2:8080/maven-vbox-plugin-example").get().html().contains("Hello World"));
}
|
public static FSModel getFSModel(final IPeerModel peerModel) {
Runnable runnable = new Runnable() {
@Override
public void run() {
if (peerModel != null) {
FSModel model = (FSModel) peerModel.getProperty(FSMODEL_KEY);
if (model == null) {
model = new FSModel(peerModel);
peerMod... | public static FSModel getFSModel(final IPeerModel peerModel) {
final AtomicReference<FSModel> model = new AtomicReference<FSModel>();
Runnable runnable = new Runnable() {
@Override
public void run() {
if (peerModel != null) {
model.set((FSModel) peerModel.getProperty(FSMODEL_KEY));
if (model.ge... |
public static void main(String[] args){
if (args.length < 4){
System.out.println("Usage: TopEmoticonsCalculator " +
"<relevance_filter_root> " +
"<input_table_name>" +
"<HDFS_output_file_path> " +
"<page_size> " +
... | public static void main(String[] args){
if (args.length < 4){
System.out.println("Usage: TopEmoticonsCalculator " +
"<relevance_filter_root> " +
"<input_table_name> " +
"<HDFS_output_file_path> " +
"<page_size> " +
... |
public String append(int ari, String text, int currentIndent, String separatorWhenExisting) {
VerseState as = map.get(ari);
boolean isNew = false;
if (as == null) {
as = new VerseState();
as.text = "";
map.put(ari, as);
isNew = true;
}
boolean writtenParaMarker = false;
if (currentIndent ... | public String append(int ari, String text, int currentIndent, String separatorWhenExisting) {
VerseState as = map.get(ari);
boolean isNew = false;
if (as == null) {
as = new VerseState();
as.text = "";
map.put(ari, as);
isNew = true;
}
boolean writtenParaMarker = false;
if (currentIndent ... |
private void openConnection(Conversation conversation) throws MessageFormatException, IOException {
Request request = conversation.getRequest();
boolean ssl = request.isSsl();
String host = request.getHost();
if (host == null)
throw new MessageFormatException("Host is not set, don't know where to connect to... | private void openConnection(Conversation conversation) throws MessageFormatException, IOException {
Request request = conversation.getRequest();
boolean ssl = request.isSsl();
String host = request.getHost();
if (host == null)
throw new MessageFormatException("Host is not set, don't know where to connect to... |
protected boolean loadValue(String key, String value)
{
if (super.loadValue(key, value)) {
return true;
}
if (key.equals("dailyPricesCalculation")) { dailyPricesCalculation = value; return true; }
if (key.equals("economyPlugin")) { economyPlugin = value; return true; }
if (key.equals("shopDamagedItems"))... | protected boolean loadValue(String key, String value)
{
if (super.loadValue(key, value)) {
return true;
}
if (key.equals("dailyPricesCalculation")) { dailyPricesCalculation = value; return true; }
if (key.equals("economyPlugin")) { economyPlugin = value; return true; }
if (key.equals("shopDamagedItems"))... |
public void send(SMSTransmission transmission) throws SmsException, IOException
{
User user = (User) SMSession.INSTANCE.getLoggedInUser();
try
{
// The message that you want to send.
String msg = transmission.getMessage().expandBody(user, transmission.getContact()).toString();
// International number... | public void send(SMSTransmission transmission) throws SmsException, IOException
{
User user = (User) SMSession.INSTANCE.getLoggedInUser();
try
{
// The message that you want to send.
String msg = transmission.getMessage().expandBody(user, transmission.getContact()).toString();
// International number... |
public AdvancedPasswordBox() {
mainPanel.add(placeholder);
placeholder.setWidth("100%");
mainPanel.add(passwordBox);
passwordBox.setWidth("100%");
passwordBox.setVisible(false);
placeholder.addFocusHandler(new FocusHandler() {
@Overri... | public AdvancedPasswordBox() {
mainPanel.add(placeholder);
placeholder.setWidth("100%");
mainPanel.add(passwordBox);
passwordBox.setWidth("100%");
passwordBox.setVisible(false);
placeholder.addFocusHandler(new FocusHandler() {
@Overri... |
public String parse(CharSequence text) throws ParseException {
switch (text.length()) {
case 9:
text = text.subSequence(0, 5) + "-" + text.subSequence(5, 9);
// Fall-though intentional
case 5:
case 10:
if (PATTERN.test(text.toString())) {
retur... | public String parse(CharSequence text) throws ParseException {
switch (text.length()) {
case 9:
text = text.subSequence(0, 5) + "-" + text.subSequence(5, 9);
// Fall-though intentional
// CHECKSTYLE_OFF
case 5:
// Fall-through intentional
case 10... |
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player _player) {
if(packet.channel.equals(BetterAnvil.channel) && _player instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer)_player;
ContainerRepairBA container = (ContainerRepairBA)player.openContainer;
... | public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player _player) {
if(packet.channel.equals(BetterAnvil.channel) && _player instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer)_player;
if(!(player.openContainer instanceof ContainerRepairBA)) return;
ContainerRepair... |
private static void handleCommand(String command) {
if (command.equals("")) {
} else if (command.equals(EXIT_CMD)) {
output("Communicator will exit.\n");
stopCommunicator = true;
} else if (command.equals("?") || command.equals("help")) {
helpScreen();
... | private static void handleCommand(String command) {
if (command.equals("")) {
} else if (command.equals(EXIT_CMD)) {
output("Communicator will exit.\n");
stopCommunicator = true;
} else if (command.equals("?") || command.equals("help")) {
helpScreen();
... |
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_calculate);
// if compile date over 1 year ago, show warning text
TextView tvWarning = (TextView) findViewById(R.id.textViewWarning);
String warning = "";
try {
long compilationDateTim... | public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_calculate);
// if compile date over 1 year ago, show warning text
TextView tvWarning = (TextView) findViewById(R.id.textViewWarning);
String warning = "";
try {
long compilationDateTim... |
public static String connect(String serverHostname) throws IOException {
String nextHost = null;
Socket echoSocket = null;
PrintWriter out = null;
BufferedReader in = null;
try {
echoSocket = new Socket(serverHostname, port);
out = new PrintWriter(ech... | public static String connect(String serverHostname) throws IOException {
String nextHost = null;
Socket echoSocket = null;
PrintWriter out = null;
BufferedReader in = null;
try {
echoSocket = new Socket(serverHostname, port);
out = new PrintWriter(ech... |
public CodeTag() {
SyntaxHighlighter syntaxHighlighter = new SyntaxHighlighter(new CommandExecutor(),
CodeOutputType.KINDLE_HTML, true, new CodeCache(CodeOutputType.HTML));
htmlCodeTag = new HtmlAndKindleCodeTag(syntaxHighlighter);
}
| public CodeTag() {
SyntaxHighlighter syntaxHighlighter = new SyntaxHighlighter(new CommandExecutor(),
CodeOutputType.KINDLE_HTML, false, new CodeCache(CodeOutputType.HTML));
htmlCodeTag = new HtmlAndKindleCodeTag(syntaxHighlighter);
}
|
private void initTaskList() {
for (World world : worlds) {
String name = world.getName();
tasks.put(name + ".cart", new TaskContainer((Runnable) new CartTask(world), (long) (ECConfig.getDouble(name + ".cart.inittime", 0.5D)*20*60),
(long) (ECConfig.getDouble(name + ".cart.time", 5D)*20*60), ECConfig.getBo... | private void initTaskList() {
for (World world : worlds) {
if (world == null) {
Tools.debugMsg("World was null, contueing loop for other worlds if there are any in the list....");
continue;
}
String name = world.getName();
tasks.put(name + ".cart", new TaskContainer((Runnable) new CartTask(world)... |
private void initComponents() {
jButton1 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
setDefaultCloseOperation(javax.swing... | private void initComponents() {
jButton1 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
setDefaultCloseOperation(javax.swing... |
public void run() {
HttpService httpService = new HttpService(this.processor,
new DefaultConnectionReuseStrategy(),
this.responseFactory,
this.resolver,
this.params);
while(connection.isOpen()) {
try {
// set the remote address in the context so we ca... | public void run() {
HttpService httpService = new HttpService(this.processor,
new DefaultConnectionReuseStrategy(),
this.responseFactory,
this.resolver,
this.params);
while(connection.isOpen()) {
try {
// set the remote address in the context so we ca... |
public void run() {
try {
System.out.println("In thread for check position");
this.distConfig = DistConfig.get_Instance();
// Get the input stream for the client
BufferedReader inStream = new BufferedReader (
new Input... | public void run() {
try {
System.out.println("In thread for check position");
this.distConfig = DistConfig.get_Instance();
// Get the input stream for the client
BufferedReader inStream = new BufferedReader (
new Input... |
public void addToVector(byte[] originalForm, double weight, Vector data) {
int probes = getProbes();
String name = getName();
for (int i = 0; i < probes; i++) {
int n = hashForProbe(originalForm, data.size(), name, i);
if(isTraceEnabled()){
trace((byte[]) null, n);
... | public void addToVector(byte[] originalForm, double weight, Vector data) {
int probes = getProbes();
String name = getName();
for (int i = 0; i < probes; i++) {
int n = hashForProbe(originalForm, data.size(), name, i);
if(isTraceEnabled()){
trace(name, n);
}
... |
private IStatus saveState(final IMemento memento) {
MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.Workbench_problemsSaving, null);
// Save the version number.
memento.putString(IWorkbenchConstants.TAG_VERSION, VERSION_STRING[1]);
// Save how many plug-ins were loaded ... | private IStatus saveState(final IMemento memento) {
MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.Workbench_problemsSaving, null);
// Save the version number.
memento.putString(IWorkbenchConstants.TAG_VERSION, VERSION_STRING[1]);
// Save how many plug-ins were loaded ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.