buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public Fraction(String fraction) {
if (!fraction.contains("/")) {
this.numerator = new BigInteger(fraction);
this.denominator = BigInteger.ONE;
} else {
int j = 0;
boolean afterSlash = false;
for (int i = 0; i < fraction.length(); i++) {
if (fraction.charAt(i) == '/') {
afterSlash = true;... | public Fraction(String fraction) {
if (!fraction.contains("/")) {
this.numerator = new BigInteger(fraction);
this.denominator = BigInteger.ONE;
} else {
int j = 0;
boolean afterSlash = false;
for (int i = 0; i < fraction.length(); i++) {
if (fraction.charAt(i) == '/') {
afterSlash = true;... |
FromAddressGeneratorProvider(@GerritServerConfig final Config cfg,
@GerritPersonIdent final PersonIdent myIdent,
final AccountCache accountCache) {
final String from = cfg.getString("sendemail", null, "from");
final Address srvAddr = toAddress(myIdent);
if (from == null || "MIXED".equalsIgno... | FromAddressGeneratorProvider(@GerritServerConfig final Config cfg,
@GerritPersonIdent final PersonIdent myIdent,
final AccountCache accountCache) {
final String from = cfg.getString("sendemail", null, "from");
final Address srvAddr = toAddress(myIdent);
if (from == null || "MIXED".equalsIgno... |
public final void testWrite() throws Exception {
// read catalog
String catalogFile = "/data/catalog1.xml";
URL catalogUrl = TestPlugin.getDefault().getBundle().getEntry(
catalogFile);
assertNotNull(catalogUrl);
URL resolvedURL = Platform.resolve(catalogUrl);
Catalog testCatalog = (Catalog) getCatalo... | public final void testWrite() throws Exception {
// read catalog
String catalogFile = "/data/catalog1.xml";
URL catalogUrl = TestPlugin.getDefault().getBundle().getEntry(
catalogFile);
assertNotNull(catalogUrl);
URL resolvedURL = Platform.resolve(catalogUrl);
Catalog testCatalog = (Catalog) getCatalo... |
public static void setUp() throws Exception {
String url = StringUtils.getDerbyUrl("memory:testdb", "", "");
url.replace("create=false", "create=true");
connection = DBConnectionManager.getConnection(url);
config = Configuration.getConfiguration("", "", RESOURCE_DATABASE_PATH,
RESOURCE_DRIVER_NAME, RESOUR... | public static void setUp() throws Exception {
String url = StringUtils.getDerbyUrl("memory:testdb", "", "");
url = url.replace("create=false", "create=true");
connection = DBConnectionManager.getConnection(url);
config = Configuration.getConfiguration("", "", RESOURCE_DATABASE_PATH,
RESOURCE_DRIVER_NAME, ... |
public void send(final String subject, final String content, final String... recipients) {
Validate.notBlank(subject);
Validate.notBlank(content);
Validate.notNull(recipients);
Validate.notEmpty(recipients);
logger.debug("sending message to " + recipients.toString());
Properties props = new Propertie... | public void send(final String subject, final String content, final String... recipients) {
Validate.notBlank(subject);
Validate.notBlank(content);
Validate.notNull(recipients);
Validate.notEmpty(recipients);
logger.debug("sending message to " + recipients.toString());
Properties props = new Propertie... |
public void updateData ( final DataItemValue value )
{
final long now = System.currentTimeMillis ();
logger.debug ( "receiving data at: " + now );
if ( dataReceiver != null )
{
dataReceiver.submit ( new Runnable () {
public void run ()
... | public void updateData ( final DataItemValue value )
{
final long now = System.currentTimeMillis ();
logger.debug ( "receiving data at: " + now );
if ( dataReceiver != null )
{
dataReceiver.submit ( new Runnable () {
public void run ()
... |
private void registerScannedPorts(int PortType)
{
String[] CandidateDeviceNames;
if (debug)
System.out.println("scanning device directory "+deviceDirectory+" for ports of type "+PortType);
if(osName.toLowerCase().indexOf("windows") != -1 )
{
String[] temp = { "COM1", "COM2","COM3","COM4" };
/*FIXME U... | private void registerScannedPorts(int PortType)
{
String[] CandidateDeviceNames;
if (debug)
System.out.println("scanning device directory "+deviceDirectory+" for ports of type "+PortType);
if(osName.toLowerCase().indexOf("windows") != -1 )
{
String[] temp = { "COM1", "COM2","COM3","COM4" };
/*FIXME U... |
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
onNewIntent(getIntent());
final ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setDisplayShowTitleEnabled(false);
... | public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEna... |
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args[0] == null) {
if (sender instanceof Player) {
Player player = (Player) sender;
fixMobs(player.getWorld());
player.sendMessage(ChatColor.GREEN + "Mobs Fixed!");
}
} else {
if (Bukkit.getWorld... | public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args[0].isEmpty()) {
if (sender instanceof Player) {
Player player = (Player) sender;
fixMobs(player.getWorld());
player.sendMessage(ChatColor.GREEN + "Mobs Fixed!");
}
} else {
if (Bukkit.getWor... |
protected void finish() {
// set some static properties
Prop.language = get(LANG);
Prop.langkeys = is(LANGKEYS);
Prop.debug = is(DEBUG);
System.setProperty("http.proxyHost", get(PROXYHOST));
System.setProperty("http.proxyPort", Integer.toString(num(PROXYPORT)));
System.setProperty("http.no... | protected void finish() {
// set some static properties
Prop.language = get(LANG);
Prop.langkeys = is(LANGKEYS);
Prop.debug = is(DEBUG);
final String ph = get(PROXYHOST);
final String pp = Integer.toString(num(PROXYPORT));
System.setProperty("http.proxyHost", ph);
System.setProperty("h... |
public void executeJavascript(Context ctx, Global global) {
global.put("__dirname", global, Context.toString(jshintModule.getPath()));
Function require = (Function)global.get("require", global);
Object jshintRequire = require.call(ctx,global,global,new String [] {"jshint"});
NativeO... | public void executeJavascript(Context ctx, Global global) {
global.put("__dirname", global, Context.toString(jshintModule.getPath()));
Function require = (Function)global.get("require", global);
Object jshintRequire = require.call(ctx,global,global,new String [] {"jshint"});
NativeO... |
public PacketFilterComposite(Composite parent, FormData formData, final PacketViewer packetViewer) {
super(parent, SWT.NONE);
setLayoutData(formData);
Layout layout = new GridLayout(4, false);
setLayout(layout);
GridData gridDataCompControls = new GridData(SWT.FILL, SWT.FILL, true, false);
gridDataCompCont... | public PacketFilterComposite(Composite parent, FormData formData, final PacketViewer packetViewer) {
super(parent, SWT.NONE);
setLayoutData(formData);
Layout layout = new GridLayout(4, false);
setLayout(layout);
GridData gridDataCompControls = new GridData(SWT.FILL, SWT.FILL, true, false);
gridDataCompCont... |
public void onPlayerLogin(final PlayerLoginEvent event) {
if (event.getResult() == PlayerLoginEvent.Result.ALLOWED) {
final String playerName = event.getPlayer().getName();
final String playerIp = event.getAddress().getHostAddress();
if (punishmentDb.isNickBanned(playerName)) {
final Punishment ban = pu... | public void onPlayerLogin(final PlayerLoginEvent event) {
if (event.getResult() == PlayerLoginEvent.Result.ALLOWED) {
final String playerName = event.getPlayer().getName();
final String playerIp = event.getAddress().getHostAddress();
if (punishmentDb.isNickBanned(playerName)) {
final Punishment ban = pu... |
public void run() {
// Create game window...
int ups = 0;
app.setIgnoreRepaint(true);
app.setUndecorated(true);
// Sätter muspekaren till ett hårkors
app.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
// Add ESC listener to quit...
app.addKeyListener(new KeyAdapter() {
public vo... | public void run() {
// Create game window...
int ups = 0;
app.setIgnoreRepaint(true);
app.setUndecorated(true);
// Sätter muspekaren till ett hårkors
app.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
// Add ESC listener to quit...
app.addKeyListener(new KeyAdapter() {
public vo... |
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
// Save details
this.client = client;
id = uidl.getId();
// Ensure correct implementation
if (client.updateComponent(this, uidl, false)) {
return;
}
if (uidl.hasAttribute("erro... | public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
// Save details
this.client = client;
id = uidl.getId();
// Ensure correct implementation
if (client.updateComponent(this, uidl, false)) {
return;
}
if (uidl.hasAttribute("erro... |
int pos_int_const()
{
int y = unary_expr.pos_int_const();
if( mult_expr != null )
{
int z = mult_expr.pos_int_const();
if( operator.equals( "*" ) )
y *= z;
else if( operator.equals( "/" ) )
y /= z;
else if( o... | int pos_int_const()
{
int y = unary_expr.pos_int_const();
if( mult_expr != null )
{
int z = mult_expr.pos_int_const();
if( operator.equals( "*" ) )
{
y = z * y;
}
else if( operator.equals( "/" ) )
{
... |
public EditItemPane() {
pane = new JPanel();
pane.setLayout(new MigLayout("debug, flowy", "[][][grow][]",
"[][][][][][]"));
JLabel lblItemId_1 = new JLabel("Item ID");
pane.add(lblItemId_1, "cell 0 0,alignx right");
itemIdField = new JTextField();
itemIdField.setEditable(false);
pane.add(itemIdFiel... | public EditItemPane() {
pane = new JPanel();
pane.setLayout(new MigLayout("debug, flowy", "[][][grow][]",
"[][][][][][]"));
JLabel lblItemId_1 = new JLabel("Item ID");
pane.add(lblItemId_1, "cell 0 0,alignx right");
itemIdField = new JTextField();
itemIdField.setEditable(false);
pane.add(itemIdFiel... |
private void onEntityDamageCore(EntityDamageEvent event) {
if (event.isCancelled() || plugin.getConfigManager().getProperties().disabledWorlds.contains(event.getEntity().getWorld().getName()))
return;
if (ignoreNextDamageEventBecauseBukkitCallsTwoEventsGRRR) {
ignoreNextDama... | private void onEntityDamageCore(EntityDamageEvent event) {
if (event.isCancelled() || plugin.getConfigManager().getProperties().disabledWorlds.contains(event.getEntity().getWorld().getName()))
return;
if (ignoreNextDamageEventBecauseBukkitCallsTwoEventsGRRR) {
ignoreNextDama... |
protected Control createContents( Composite parent )
{
Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
// enable/disable certificate validation
Preferences preferences = ConnectionCorePlugin.getDefault().getPluginPreferences();
boolean validateCertif... | protected Control createContents( Composite parent )
{
Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
// enable/disable certificate validation
Preferences preferences = ConnectionCorePlugin.getDefault().getPluginPreferences();
boolean validateCertif... |
public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
// still under development. too early to put into production
if (!ENABLED) return null;
MarkupText.SubText t = text.findToken(Pattern.compile("^[^:]+(?=:)"));
if (t!=null)
t.addMarkup(0,t.... | public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
// still under development. too early to put into production
if (!ENABLED) return null;
MarkupText.SubText t = text.findToken(Pattern.compile(".*(?=:)"));
if (t!=null)
t.addMarkup(0,t.leng... |
public void addAdditionalKinetics(Kinetics p_kinetics, int red) {
if (finalized)
return;
if (p_kinetics == null)
return;
if (kinetics == null){
kinetics[0] = p_kinetics;
structure.redundancy = 1;
}
else {
boolean kineticsAlreadyPresent = false;
for (int numKinetics=0; numKinetics<kinetics.l... | public void addAdditionalKinetics(Kinetics p_kinetics, int red) {
if (finalized)
return;
if (p_kinetics == null)
return;
if (kinetics == null){
kinetics = new Kinetics[1];
kinetics[0] = p_kinetics;
structure.redundancy = 1;
}
else {
boolean kineticsAlreadyPresent = false;
for (int numKin... |
public void run()
{
boolean[] barr = new boolean[2]; // scratch boolean
while ( !m_stopped ) {
QueueElem elem;
Object[] args;
try {
elem = m_queue.take();
} catch ( InterruptedException ie ) {
Utils.logf( "interrupt... | public void run()
{
boolean[] barr = new boolean[2]; // scratch boolean
while ( !m_stopped ) {
QueueElem elem;
Object[] args;
try {
elem = m_queue.take();
} catch ( InterruptedException ie ) {
Utils.logf( "interrupt... |
protected void initFile(String id) throws FormatException, IOException {
if (!checkSuffix(id, "hdr")) {
String headerFile = id.substring(0, id.lastIndexOf(".")) + ".hdr";
if (!new Location(headerFile).exists()) {
headerFile = id.substring(0, id.lastIndexOf(".")) + ".HDR";
if (!new Loca... | protected void initFile(String id) throws FormatException, IOException {
if (!checkSuffix(id, "hdr")) {
String headerFile = id.substring(0, id.lastIndexOf(".")) + ".hdr";
if (!new Location(headerFile).exists()) {
headerFile = id.substring(0, id.lastIndexOf(".")) + ".HDR";
if (!new Loca... |
public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Getting cron info...");
runAppCfg("cron_info");
}
| public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Getting cron info...");
runAppCfg("cron_info", appDir);
}
|
public void set(String name, String description){
this.id = STATIC_ID;
STATIC_ID++;
this.name = name;
this.description = description;
this.type = "Component";
this.mappedSUunits = new ArrayList<SoftwareUnitDefinition>();
this.mappedRegExSUunits = new ArrayList<SoftwareUnitRegExDefinition>();
this.subMo... | public void set(String name, String description){
this.id = STATIC_ID;
STATIC_ID++;
this.name = name;
this.description = description;
this.type = "Component";
this.mappedSUunits = new ArrayList<SoftwareUnitDefinition>();
this.mappedRegExSUunits = new ArrayList<SoftwareUnitRegExDefinition>();
this.subMo... |
public static void main(String args[]) throws IOException
{
Context cx = Context.enter();
try {
Scriptable scope = cx.initStandardObjects();
// Add a global variable "out" that is a JavaScript reflection
// of System.out
Object jsOut = Context.jav... | public static void main(String args[]) throws IOException
{
Context cx = Context.enter();
try {
Scriptable scope = cx.initStandardObjects();
// Add a global variable "out" that is a JavaScript reflection
// of System.out
Object jsOut = Context.jav... |
public void launch(AppInfo appInfo) throws Exception
{
logger.debug("Launching java runtime");
XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("/etc/spring_java.xml", getClass()));
// Configure server port
int port = Configuration.getInstance().getAppServerPort();
logger.debug("Configuri... | public void launch(AppInfo appInfo) throws Exception
{
logger.debug("Launching java runtime");
XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("/etc/spring_java.xml", getClass()));
// Configure server port
int port = Configuration.getInstance().getAppServerPort();
logger.debug("Configuri... |
public AssertionStatus assertResponse( MessageExchange messageExchange, SubmitContext context )
{
AssertionStatus oldStatus = assertionStatus;
AssertionError[] oldErrors = getErrors();
ImageIcon oldIcon = getIcon();
if( isDisabled() )
{
assertionStatus = AssertionStatus.UNKNOWN;
assertionErrors = nul... | public AssertionStatus assertResponse( MessageExchange messageExchange, SubmitContext context )
{
AssertionStatus oldStatus = assertionStatus;
AssertionError[] oldErrors = getErrors();
ImageIcon oldIcon = getIcon();
if( isDisabled() )
{
assertionStatus = AssertionStatus.UNKNOWN;
assertionErrors = nul... |
public ArrayList<String> run(IrcMessage message, String command) {
clearResponses();
String[] params = message.body.split("#");
if (params.length < 2) {
System.err.println("Can't parse the ticket id from the message");
return responses;
}
BugzillaProxy bz = new BugzillaProxy(BZ_URL);
try {
bz.con... | public ArrayList<String> run(IrcMessage message, String command) {
clearResponses();
String[] params = message.body.split("#");
if (params.length < 2) {
System.err.println("Can't parse the ticket id from the message");
return responses;
}
BugzillaProxy bz = new BugzillaProxy(BZ_URL);
try {
bz.con... |
public static void main(String[] args) {
// TODO code application logic here
// Create log
Log log = new Log();
log.setLogName("Server-side application");
buildAllObjects();
// server connection instance, listen on port 5555
Connection server = new Connecti... | public static void main(String[] args) {
// TODO code application logic here
// Create log
Log log = new Log();
log.setLogName("Server-side application");
buildAllObjects();
// server connection instance, listen on port 5555
Connection server = new Connecti... |
public Segment[] interprete(InterpretableSegment segment) {
if (segment.isURL()) {
String user = segment.getUser();
String content = segment.getContent();
logger.debug("file " + content);
URL url = segment.getURL();
String name = url.getFile();
if (name == null || name.isEmpty()) {
name = "imag... | public Segment[] interprete(InterpretableSegment segment) {
if (segment.isURL()) {
String user = segment.getUser();
String content = segment.getContent();
logger.debug("file " + content);
URL url = segment.getURL();
String name = url.getFile();
if (name == null || name.isEmpty()) {
name = "imag... |
public Object invokeMethod(String name, Object obj) {
Object[] args = obj.getClass().isArray() ? (Object[])obj : new Object[]{obj};
if(isCriteriaConstructionMethod(name, args)) {
if(this.criteria != null) {
throwRuntimeException( new IllegalArgumentException("c... | public Object invokeMethod(String name, Object obj) {
Object[] args = obj.getClass().isArray() ? (Object[])obj : new Object[]{obj};
if(isCriteriaConstructionMethod(name, args)) {
if(this.criteria != null) {
throwRuntimeException( new IllegalArgumentException("c... |
public Map<String, String> getOfferTypesCreateNew() {
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
ObjectProperty op =
wdf.getObjectPropertyDao().getObjectPropertyByURI(editConfig.getPredicateUri());
Individual sub =
wdf.getIndividualDao().getIndividualByURI(editConfig.getSubjectUri... | public Map<String, String> getOfferTypesCreateNew() {
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
ObjectProperty op =
wdf.getObjectPropertyDao().getObjectPropertyByURI(editConfig.getPredicateUri());
Individual sub =
wdf.getIndividualDao().getIndividualByURI(editConfig.getSubjectUri... |
private void addUnfinishedSubmissions(Division division) throws SQLException, WingException
{
// User's WorkflowItems
WorkspaceItem[] unfinishedItems = WorkspaceItem.findByEPerson(context,context.getCurrentUser());
SupervisedItem[] supervisedItems = SupervisedItem.findbyEPerson(context, conte... | private void addUnfinishedSubmissions(Division division) throws SQLException, WingException
{
// User's WorkflowItems
WorkspaceItem[] unfinishedItems = WorkspaceItem.findByEPerson(context,context.getCurrentUser());
SupervisedItem[] supervisedItems = SupervisedItem.findbyEPerson(context, conte... |
private static List<Geometry> fetchRelationCoors(Relation relation) {
List<Geometry> coordinateList = new ArrayList<Geometry>();
int j = 0;
for (RelationMember relationMember : relation.getMembers()) {
// only care about outer roles (maybe inner too?)
if (!relationMember.getMemberRole().equal... | private static List<Geometry> fetchRelationCoors(Relation relation) {
List<Geometry> coordinateList = new ArrayList<Geometry>();
for (RelationMember relationMember : relation.getMembers()) {
// only care about outer roles. Some ways are not tagged...
if (!relationMember.getMemberRole().equalsIgno... |
public static String[] signWrite(String s) {
// Create array to hold the lines, and initialise with empty strings
String[] lines = new String[4];
int currentLine = 0;
for (int i = 0; i < 4; i++) lines[i] = "";
// Split the message into strings on whitespace
String[] words = s.split("\\s");
// Loop ... | public static String[] signWrite(String s) {
// Create array to hold the lines, and initialise with empty strings
String[] lines = new String[4];
int currentLine = 0;
for (int i = 0; i < 4; i++) lines[i] = "";
// Split the message into strings on whitespace
String[] words = s.split("\\s");
// Loop ... |
TCFNodeExecContext(TCFNode parent, final String id) {
super(parent, id);
children_exec = new TCFChildrenExecContext(this);
children_stack = new TCFChildrenStackTrace(this);
children_regs = new TCFChildrenRegisters(this);
children_exps = new TCFChildrenExpressions(this);
... | TCFNodeExecContext(TCFNode parent, final String id) {
super(parent, id);
children_exec = new TCFChildrenExecContext(this);
children_stack = new TCFChildrenStackTrace(this);
children_regs = new TCFChildrenRegisters(this);
children_exps = new TCFChildrenExpressions(this);
... |
public void run() {
DecodedAudioData audioData = null;
try {
audioData = AudioDecoder.getSamples(track.getFilepath(), 135);
} catch (FileNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} ca... | public void run() {
DecodedAudioData audioData = null;
try {
audioData = AudioDecoder.getSamples(track.getFilepath(), 135);
} catch (FileNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} ca... |
private void processCreate(Class<?> clazz, RemoteProxy createAnn, Container container)
{
Class<? extends Creator> creator = createAnn.creator();
String creatorClass = creator.getName();
Map<String, String> creatorParams = getParamsMap(createAnn.creatorParams());
ScriptScope scope... | private void processCreate(Class<?> clazz, RemoteProxy createAnn, Container container)
{
Class<? extends Creator> creator = createAnn.creator();
String creatorClass = creator.getName();
Map<String, String> creatorParams = getParamsMap(createAnn.creatorParams());
ScriptScope scope... |
public void writeTo(OpenSearchDescriptor t,
Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException,
... | public void writeTo(OpenSearchDescriptor t,
Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException,
... |
public void doUpdate(TrafficCollector commandObject) {
log.debug("doUpdate() <<<<");
DBProxy proxy = DBProxyFactory.getDBProxy();
Connection con = null;
try{
con = proxy.getConnection();
PreparedStatement ipst = con.prepareStatement("insert into aggreg(dat, ci... | public void doUpdate(TrafficCollector commandObject) {
log.debug("doUpdate() <<<<");
DBProxy proxy = DBProxyFactory.getDBProxy();
Connection con = null;
try{
con = proxy.getConnection();
PreparedStatement ipst = con.prepareStatement("insert into aggreg(dat, ci... |
public static String format(final Format format, final Geopoint gp)
{
final double latSigned = gp.getLatitude();
final double lonSigned = gp.getLongitude();
final double lat = Math.abs(latSigned);
final double lon = Math.abs(lonSigned);
final double latFloor = Math.floor(... | public static String format(final Format format, final Geopoint gp)
{
final double latSigned = gp.getLatitude();
final double lonSigned = gp.getLongitude();
final double lat = Math.abs(latSigned);
final double lon = Math.abs(lonSigned);
final double latFloor = Math.floor(... |
public void handle(ComponentEventRequestParameters parameters) throws IOException
{
Page activePage = cache.get(parameters.getActivePageName());
final Holder<Boolean> resultProcessorInvoked = Holder.create();
resultProcessorInvoked.put(false);
ComponentEventResultProcessor inte... | public void handle(ComponentEventRequestParameters parameters) throws IOException
{
Page activePage = cache.get(parameters.getActivePageName());
final Holder<Boolean> resultProcessorInvoked = Holder.create();
resultProcessorInvoked.put(false);
ComponentEventResultProcessor inte... |
public void serialize(DigitalObject obj, OutputStream out, String encoding)
throws ObjectIntegrityException, StreamIOException,
UnsupportedEncodingException {
m_characterEncoding=encoding;
StringBuffer buf1=new StringBuffer();
buf1.append("test");
byte[] temp=... | public void serialize(DigitalObject obj, OutputStream out, String encoding)
throws ObjectIntegrityException, StreamIOException,
UnsupportedEncodingException {
m_characterEncoding=encoding;
StringBuffer buf1=new StringBuffer();
buf1.append("test");
byte[] temp=... |
public void resolveInheritance( XmlDefinitionsSet definitionsSet )
throws NoSuchDefinitionException
{
// Already done, or not needed ?
if( isVisited || !isExtending() )
return;
if( debug)
System.out.println( "Resolve definition for child name='"
+ getName(... | public void resolveInheritance( XmlDefinitionsSet definitionsSet )
throws NoSuchDefinitionException
{
// Already done, or not needed ?
if( isVisited || !isExtending() )
return;
if( debug)
System.out.println( "Resolve definition for child name='"
+ getName(... |
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
if (qName.equals("config")) {
// nothing to do
} else if (qName.equals("include")) {
String includeFileName = attributes.getValue("fi... | public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
if (qName.equals("config")) {
// nothing to do
} else if (qName.equals("include")) {
String includeFileName = attributes.getValue("fi... |
protected void init0() throws SQLException {
// [#1324] The ALL_ARGUMENTS.DEFAULTED column is available in Oracle 11g
// only. This feature should thus be deactivated for older versions
Field<String> defaulted = is11g()
? ALL_ARGUMENTS.DEFAULTED
: inline("N");
Result<Re... | protected void init0() throws SQLException {
// [#1324] The ALL_ARGUMENTS.DEFAULTED column is available in Oracle 11g
// only. This feature should thus be deactivated for older versions
Field<String> defaulted = is11g()
? ALL_ARGUMENTS.DEFAULTED
: inline("N");
Result<Re... |
public static List<List<Stop>> findDuplicateStops(BigInteger agencyId) {
// !!! need to autodetect proper SRID for UTM Zone
Query q = Stop.em().createNativeQuery("SELECT s1_id, s2_id, dist FROM " +
"(SELECT s1.id as s1_id, s2.id as s2_id, st_distance(transform(s1.location, 32614), transform(... | public static List<List<Stop>> findDuplicateStops(BigInteger agencyId) {
// !!! need to autodetect proper SRID for UTM Zone
Query q = Stop.em().createNativeQuery("SELECT s1_id, s2_id, dist FROM " +
"(SELECT s1.id as s1_id, s2.id as s2_id, st_distance(transform(s1.location, 32614), transform(... |
private void initListeners() {
btnStartSn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
GameData g = GameData.getCurrentGame();
if (g.getAllContestants().size() == 0) {
JOptionPane
.showMessageDialog(null,
"This will be a borin... | private void initListeners() {
btnStartSn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
GameData g = GameData.getCurrentGame();
if (g.getAllContestants().size() == 0) {
JOptionPane
.showMessageDialog(null,
"This will be a borin... |
public static BufferedImage resizeImage(WikiImage wikiImage, int maxDimension) throws Exception {
File imageFile = new File(Environment.getValue(Environment.PROP_FILE_DIR_FULL_PATH), wikiImage.getUrl());
BufferedImage original = ImageUtil.loadImage(imageFile);
maxDimension = calculateImageIncrement(maxDimension)... | public static BufferedImage resizeImage(WikiImage wikiImage, int maxDimension) throws Exception {
File imageFile = new File(Environment.getValue(Environment.PROP_FILE_DIR_FULL_PATH), wikiImage.getUrl());
BufferedImage original = ImageUtil.loadImage(imageFile);
maxDimension = calculateImageIncrement(maxDimension)... |
public void execute(ITransaction transaction, HttpServletRequest req,
HttpServletResponse resp) throws IOException, LockFailedException {
LOG.trace("-- " + this.getClass().getName());
if (_readOnly) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return;
}
... | public void execute(ITransaction transaction, HttpServletRequest req,
HttpServletResponse resp) throws IOException, LockFailedException {
LOG.trace("-- " + this.getClass().getName());
if (_readOnly) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return;
}
... |
private Set<FileInfo> resolveFiles(List<String> files, boolean serveOnly) {
if (files != null) {
Set<FileInfo> resolvedFiles = new LinkedHashSet<FileInfo>();
for (String f : files) {
f = pathRewriter.rewrite(f);
boolean isPatch = f.startsWith("patch");
if (isPatch) {
... | private Set<FileInfo> resolveFiles(List<String> files, boolean serveOnly) {
if (files != null) {
Set<FileInfo> resolvedFiles = new LinkedHashSet<FileInfo>();
for (String f : files) {
f = pathRewriter.rewrite(f);
boolean isPatch = f.startsWith("patch");
if (isPatch) {
... |
public void execute()
throws MojoExecutionException, MojoFailureException {
Log log = getLog();
if ( files == null ) {
log.debug( "No files configured." );
return;
}
File basedir = project.getBasedir();
for ( Copy copy : fi... | public void execute()
throws MojoExecutionException, MojoFailureException {
Log log = getLog();
if ( files == null ) {
log.debug( "No files configured." );
return;
}
File basedir = project.getBasedir();
for ( Copy copy : fi... |
public SearchForm<T> parse() throws FormValidationException {
checkValidity();
try{
pageInt = Integer.parseInt(page);
} catch (NumberFormatException e) {
page = "1";
pageInt = 1;
}
try{
amountInt = Integer.parseInt(amount);
} catch (NumberFormatException e) {
amount = "25";
amountInt =... | public SearchForm<T> parse() throws FormValidationException {
checkValidity();
try{
pageInt = Integer.parseInt(page);
} catch (NumberFormatException e) {
page = "1";
pageInt = 1;
}
try{
amountInt = Integer.parseInt(amount);
} catch (NumberFormatException e) {
amount = "25";
amountInt =... |
public void testAddingAndGettingAndRemovingParticipant() {
MeetMeRoomAdapter r = new MeetMeRoomAdapter();
String id = "testParticipant";
IParticipant p = new MeetMeUserAdapter();
p.setId(id);
r.addParticipant(p);
assertEquals("Room should have participant", true, r.hasParticipant(id));
Participant p1 = r... | public void testAddingAndGettingAndRemovingParticipant() {
MeetMeRoomAdapter r = new MeetMeRoomAdapter();
String id = "testParticipant";
IParticipant p = new MeetMeUserAdapter();
p.setId(id);
r.addParticipant(p);
assertEquals("Room should have participant", true, r.hasParticipant(id));
// Participant p1 =... |
public void analyze() {
final String head = bType.getHead();
final String anchor = getAnchor();
final String normalizedAnchor = getNormalizedAnchor();
final List<Long> ancestorIds = new ArrayList<Long>();
if (parent != null) {
for (final long ancestorId : parent.getAncestors()) {
ancestorIds.add(anc... | public void analyze() {
final String head = bType.getHead();
final String anchor = getAnchor();
final String normalizedAnchor = getNormalizedAnchor();
final List<Long> ancestorIds = new ArrayList<Long>();
if (parent != null) {
for (final long ancestorId : parent.getAncestors()) {
ancestorIds.add(anc... |
public void connect(final String server, final int port, final String password,
final boolean ssl, final Identity profile) {
assert(profile != null);
synchronized(myState) {
switch (myState) {
case RECONNECT_WAIT:
reconnectTimer.cancel();
... | public void connect(final String server, final int port, final String password,
final boolean ssl, final Identity profile) {
assert(profile != null);
synchronized(myState) {
switch (myState) {
case RECONNECT_WAIT:
reconnectTimer.cancel();
... |
public RepositoryResponse postTaskData(TaskRepository repository,
TaskData taskData, Set<TaskAttribute> oldAttributes,
IProgressMonitor monitor) throws CoreException {
String taskId = taskData.getTaskId();
Issue issue = createIssue(taskData);
RepositoryId repo = GitHub.getRepository(repository.getRepositor... | public RepositoryResponse postTaskData(TaskRepository repository,
TaskData taskData, Set<TaskAttribute> oldAttributes,
IProgressMonitor monitor) throws CoreException {
String taskId = taskData.getTaskId();
Issue issue = createIssue(taskData);
RepositoryId repo = GitHub.getRepository(repository.getRepositor... |
public void actionPerformed(ActionEvent ae) {
try {
String command = ae.getActionCommand();
// commands for multiple selections:
TreePath[] paths = this.getSelectionPaths();
if (null != paths && paths.length > 1) {
if (command.equals("Reverse layer Z coords")) {
// check that all layers belong ... | public void actionPerformed(ActionEvent ae) {
try {
String command = ae.getActionCommand();
// commands for multiple selections:
TreePath[] paths = this.getSelectionPaths();
if (null != paths && paths.length > 1) {
if (command.equals("Reverse layer Z coords")) {
// check that all layers belong ... |
public void setLastResponse(SIPTransaction transaction,
SIPResponse sipResponse) {
this.callIdHeader = sipResponse.getCallId();
final int statusCode = sipResponse.getStatusCode();
if (statusCode == 100) {
if (logger.isLoggingEnabled())
logger
... | public void setLastResponse(SIPTransaction transaction,
SIPResponse sipResponse) {
this.callIdHeader = sipResponse.getCallId();
final int statusCode = sipResponse.getStatusCode();
if (statusCode == 100) {
if (logger.isLoggingEnabled())
logger
... |
public void run() {
/* Call Register Activity when session is not established */
SharedPreferences prefs = getSharedPreferences("MyPref", MODE_PRIVATE);
boolean saved = prefs.getBoolean(MyPref.KEY_SESSION, false);
if(saved == false)
{
Intent intent = new Intent();
startActivity(intent.setClass(... | public void run() {
/* Call Register Activity when session is not established */
SharedPreferences prefs = getSharedPreferences("MyPref", MODE_PRIVATE);
boolean saved = prefs.getBoolean(MyPref.KEY_SESSION, false);
if(saved == false)
{
Intent intent = new Intent();
startActivity(intent.setClass(... |
public void testJsonEncoding() throws Exception {
String objectName = "org.apache.cxf:bus.id=rest-cxf515624438,type=Bus.Service.Endpoint,service=\"{http://rest.fuse.quickstarts.jboss.org/}CustomerService\",port=\"CustomerService\",instance.id=1776063910";
String expectedValue = "org.apache.cxf:bus.i... | public void testJsonEncoding() throws Exception {
String objectName = "org.apache.cxf:bus.id=rest-cxf515624438,type=Bus.Service.Endpoint,service=\"{http://rest.fuse.quickstarts.jboss.org/}CustomerService\",port=\"CustomerService\",instance.id=1776063910";
String expectedValue = "\"org.apache.cxf:bus... |
protected void populateFields(HttpServletRequest req) throws Exception {
if (req.getParameter(LOCALE_ID_PARAM) != null) {
try {
setSurveyedLocaleId(new Long(req.getParameter(LOCALE_ID_PARAM)));
} catch (Exception e) {
// swallow
}
}
if (req.getParameter(SURVEY_INSTANCE_ID_PARAM) != null) {
tr... | protected void populateFields(HttpServletRequest req) throws Exception {
if (req.getParameter(LOCALE_ID_PARAM) != null) {
try {
setSurveyedLocaleId(new Long(req.getParameter(LOCALE_ID_PARAM)));
} catch (Exception e) {
// swallow
}
}
if (req.getParameter(SURVEY_INSTANCE_ID_PARAM) != null) {
tr... |
public void init(int nodes) throws DBException {
try {
synchronized (syncObject) {
if(infinispanManager == null){
infinispanManager = new DefaultCacheManager("ispn.xml");
String table = "usertable";
globalCache = infinispanManager.getCache(table);
tm=globalCache.getAdvancedCache()... | public void init(int nodes) throws DBException {
try {
synchronized (syncObject) {
if(infinispanManager == null){
infinispanManager = new DefaultCacheManager("ispn.xml");
String table = "usertable";
globalCache = infinispanManager.getCache(table);
tm=globalCache.getAdvancedCache()... |
public void onInventoryClick(InventoryClickEvent event) {
Player p = Bukkit.getPlayer(event.getWhoClicked().getName());
Inventory inv = event.getInventory();
ItemStack oncur = p.getItemOnCursor();
ItemStack current = event.getCurrentItem();
int rs = event.getRawSlot();
InventoryView view = event.getView();... | public void onInventoryClick(InventoryClickEvent event) {
Player p = Bukkit.getPlayer(event.getWhoClicked().getName());
Inventory inv = event.getInventory();
ItemStack oncur = p.getItemOnCursor();
ItemStack current = event.getCurrentItem();
int rs = event.getRawSlot();
InventoryView view = event.getView();... |
protected NameClass getNameClass( String namespace, XMLSchemaSchema currentSchema ) {
// we have to get currentSchema through parameter because
// this method is also used while back-patching, and
// reader.currentSchema points to the invalid schema in that case.
final XMLSchemaReader reader = (XMLSchemaReade... | protected NameClass getNameClass( String namespace, XMLSchemaSchema currentSchema ) {
// we have to get currentSchema through parameter because
// this method is also used while back-patching, and
// reader.currentSchema points to the invalid schema in that case.
final XMLSchemaReader reader = (XMLSchemaReade... |
CmdLineManager(final String[] args) {
parser = new OptionParser();
help =
parser.acceptsAll(asList("h", "?", "help"),
"Shows this help message.");
version =
parser.accepts("version","Prints the program version.");
// TODO:... | CmdLineManager(final String[] args) {
parser = new OptionParser();
help =
parser.acceptsAll(asList("h", "?", "help"),
"Shows this help message.");
version =
parser.accepts("version","Prints the program version.");
// TODO:... |
public OMElement serializeSpecificMediator(Mediator m) {
if (!(m instanceof ClassMediator)) {
handleException("Unsupported mediator passed in for serialization : " + m.getType());
}
ClassMediator mediator = (ClassMediator) m;
OMElement clazz = fac.createOMElement("class"... | public OMElement serializeSpecificMediator(Mediator m) {
if (!(m instanceof ClassMediator)) {
handleException("Unsupported mediator passed in for serialization : " + m.getType());
}
ClassMediator mediator = (ClassMediator) m;
OMElement clazz = fac.createOMElement("class"... |
public void onEnable() {
// Get the server
Server = getServer();
// Lib Directory
(new File("lib" + File.separator)).mkdir();
(new File("lib" + File.separator)).setWritable(true);
(new File("lib" + File.separator)).setExecutable(true);
// Plugin Directory
... | public void onEnable() {
// Get the server
Server = getServer();
// Lib Directory
(new File("lib" + File.separator)).mkdir();
(new File("lib" + File.separator)).setWritable(true);
(new File("lib" + File.separator)).setExecutable(true);
// Plugin Directory
... |
public void update() throws UpdateException {
Entity config = getConfig();
if (config.getProperty("version") == null) {
addConfigVersion();
}
config = getConfig();
for (UpdateTask task : tasks) {
if (config.getProperty("version").equals(task.getFromVersion())) {
task.update();
config.setPropert... | public void update() throws UpdateException {
if (getConfig().getProperty("version") == null) {
addConfigVersion();
}
for (UpdateTask task : tasks) {
if (getConfig().getProperty("version").equals(task.getFromVersion())) {
task.update();
Entity config = getConfig();
config.setProperty("version",... |
public ComputeConfigurationTask(Value<LatentSemanticIndex> index) {
super("Multidimensional scaling...", index);
this.previousConfiguration = new Configuration();
}
| public ComputeConfigurationTask(Value<LatentSemanticIndex> index) {
super("Computing map layout...", index);
this.previousConfiguration = new Configuration();
}
|
private static WindowsBuzzerBinding windows() throws IOException {
Process server = null;
log.log(Level.INFO, "Entering BuzzerBindingFactory.windows()");
try {
server = Runtime.getRuntime().exec("./glue.exe");
} catch (IOException e) {
log.log(Level.SEVERE, "Error creating glue.exe", e);
throw e;
}
... | private static WindowsBuzzerBinding windows() throws IOException {
Process server = null;
log.log(Level.INFO, "Entering BuzzerBindingFactory.windows()");
try {
server = Runtime.getRuntime().exec("./glue.exe");
} catch (IOException e) {
log.log(Level.SEVERE, "Error creating glue.exe", e);
throw e;
}
... |
public boolean doTrade(IInventory fakeInv, int inputMinSlot, int inputMaxSlot,
int outputMinSlot, int outputMaxSlot) throws TradeException {
if (fakeInv == null) { throw new TradeException(1, "Invalid inventory",
new NullPointerException()); }
HashMap<ItemStackMapKey, Integer> tradeInputs = new HashMap<Item... | public boolean doTrade(IInventory fakeInv, int inputMinSlot, int inputMaxSlot,
int outputMinSlot, int outputMaxSlot) throws TradeException {
if (fakeInv == null) { throw new TradeException(1, "Invalid inventory",
new NullPointerException()); }
HashMap<ItemStackMapKey, Integer> tradeInputs = new HashMap<Item... |
public void synchronizeIssues(int filterId, List<IssueData> newIssues, String oldIssueTrackerUrl, Handle sourceHandle) throws Exception {
Map<String, AccountData> ourUsers = new HashMap<>();
for ( AccountData ourUser : getUsers() )
ourUsers.put(ourUser.getName(), ourUser);
AccountData thisUser = checkNo... | public void synchronizeIssues(int filterId, List<IssueData> newIssues, String oldIssueTrackerUrl, Handle sourceHandle) throws Exception {
Map<String, AccountData> ourUsers = new HashMap<>();
for ( AccountData ourUser : getUsers() )
ourUsers.put(ourUser.getName(), ourUser);
AccountData thisUser = checkNo... |
protected Table getChoicesTable(IWContext iwc) throws RemoteException {
Table table = new Table();
table.setWidth(getWidth());
table.setCellpadding(getCellpadding());
table.setCellspacing(getCellspacing());
table.setColumns(6);
table.setRowColor(1, getHeaderColor());
int column = 1;
int row = 1;
C... | protected Table getChoicesTable(IWContext iwc) throws RemoteException {
Table table = new Table();
table.setWidth(getWidth());
table.setCellpadding(getCellpadding());
table.setCellspacing(getCellspacing());
table.setColumns(6);
table.setRowColor(1, getHeaderColor());
int column = 1;
int row = 1;
C... |
private void createActions() {
deleteModuleAction = new Action() {
public void run() {
if (MessageDialog.openConfirm(new Shell(), Messages.ServerDialogHeading, Messages.DeleteModuleConfirm)) {
Thread t = new Thread() { public void run() {
try {
IServerWorkingCopy server = selection.server.c... | private void createActions() {
deleteModuleAction = new Action() {
public void run() {
if (MessageDialog.openConfirm(new Shell(), Messages.ServerDialogHeading, Messages.DeleteModuleConfirm)) {
Thread t = new Thread() { public void run() {
try {
IServerWorkingCopy server = selection.server.c... |
public void startElement(String uri, String localName,
String qName, Attributes attributes)
throws SAXException {
boolean dump = false;
XmlKeyword key = xmlKeywords.get(localName);
// System.out.print("<" + key.name());
this.attribut... | public void startElement(String uri, String localName,
String qName, Attributes attributes)
throws SAXException {
boolean dump = false;
XmlKeyword key = xmlKeywords.get(localName);
// System.out.print("<" + key.name());
this.attribut... |
public static byte[] getFileContent(Project project, VirtualFile root, String revisionOrBranch, String relativePath) throws VcsException {
BinaryHandler h = new BinaryHandler(project, root, Command.SHOW);
h.setRemote(true);
h.setSilent(true);
File temp;
try {
temp = FileUtil.createTempFile(... | public static byte[] getFileContent(Project project, VirtualFile root, String revisionOrBranch, String relativePath) throws VcsException {
BinaryHandler h = new BinaryHandler(project, root, Command.SHOW);
h.setRemote(true);
h.setSilent(true);
File temp;
try {
temp = FileUtil.createTempFile(... |
void readit(InputStream is, String map, String params)
throws IOException, VisADException {
// read the ASCII file, using commas as field separators
// first line is a header line
ff = null;
field = null;
if (debug) System.out.println("#### Text Adapter v2.x runn... | void readit(InputStream is, String map, String params)
throws IOException, VisADException {
// read the ASCII file, using commas as field separators
// first line is a header line
ff = null;
field = null;
if (debug) System.out.println("#### Text Adapter v2.x runn... |
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException{
/**
* Set up properties of your new object
* After finalizing objects, they are accessible
* through Cloud Storage with the URL:
* http://commondatastorage.googleapis.com/my_bucket/my_object
... | public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException{
/**
* Set up properties of your new object
* After finalizing objects, they are accessible
* through Cloud Storage with the URL:
* http://commondatastorage.googleapis.com/my_bucket/my_object
... |
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Tracer.debug(LOG_TAG, "onCreate");
/*
* Get reference to views
*/
mIconFeedback = (ImageView) findViewById(R.id.ic_user_feedback... | protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Tracer.debug(LOG_TAG, "onCreate");
/*
* Get reference to views
*/
mIconFeedback = (ImageView) findViewById(R.id.ic_user_feedback... |
public static Object getRandomValue(Class type) {
/*
* String and Character types
*/
if (type.equals(String.class)) {
return RandomStringUtils.randomAlphabetic(10);
}
if (type.equals(Character.TYPE) || type.equals(Character.class)) {
return ... | public static Object getRandomValue(Class type) {
/*
* String and Character types
*/
if (type.equals(String.class)) {
return RandomStringUtils.randomAlphabetic(10);
}
if (type.equals(Character.TYPE) || type.equals(Character.class)) {
return ... |
private void processLine(String s) throws IOException {
if (s==null) return ;
if (s.length()==0) return;
String[] parts=s.split(" ");
parts=removeEmpty(parts);
if ("#".equals(parts[0])) return;
if ("v".equals(parts[0])){
addVertextoList(parts);
... | private void processLine(String s) throws IOException {
if (s==null) return ;
if (s.length()==0) return;
String[] parts=s.split(" ");
parts=removeEmpty(parts);
if ("#".equals(parts[0])) return;
if ("v".equals(parts[0])){
addVertextoList(parts);
... |
public void onPlayerInteract (final PlayerInteractEvent event){
if (! plugin.isEnabled() ) return;
if ( event.isCancelled() ) return;
Block block = event.getClickedBlock();
ItemStack toolUsed = null;
if (event.getItem() != null){
toolUsed = event.getItem().clone();
toolUsed.setAmount(1);
}
... | public void onPlayerInteract (final PlayerInteractEvent event){
if (! plugin.isEnabled() ) return;
if ( event.isCancelled() ) return;
Block block = event.getClickedBlock();
ItemStack toolUsed = null;
if (event.getItem() != null){
toolUsed = event.getItem().clone();
toolUsed.setAmount(1);
}
... |
public Vector getSubconceptCodes(String scheme, String version, String code) { //throws LBException{
Vector v = new Vector();
try {
//EVSApplicationService lbSvc = new RemoteServerUtil().createLexBIGService();
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
... | public Vector getSubconceptCodes(String scheme, String version, String code) { //throws LBException{
Vector v = new Vector();
try {
//EVSApplicationService lbSvc = new RemoteServerUtil().createLexBIGService();
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
... |
public static boolean isAppiableForYear(final int year, final SimplifiedProcedureProcess simplifiedProcedureProcess) {
final TreeSet<ActivityLog> logs = new TreeSet<ActivityLog>(WorkflowLog.COMPARATOR_BY_WHEN_REVERSED);
for (WorkflowLog log : simplifiedProcedureProcess.getExecutionLogsSet()) {
logs.add((Acti... | public static boolean isAppiableForYear(final int year, final SimplifiedProcedureProcess simplifiedProcedureProcess) {
final TreeSet<ActivityLog> logs = new TreeSet<ActivityLog>(WorkflowLog.COMPARATOR_BY_WHEN_REVERSED);
for (WorkflowLog log : simplifiedProcedureProcess.getExecutionLogs(ActivityLog.class)) {
... |
@Override public List<QlockWord> getTime(int minute, int hour) {
if (hour > 12) {
hour -= 12;
}
if (hour <= 0) {
hour += 12;
}
if (minute > 60) {
minute -= 60;
hour++;
}
if (minute < 0) {
minute += 6... | @Override public List<QlockWord> getTime(int minute, int hour) {
if (hour > 12) {
hour -= 12;
}
if (hour <= 0) {
hour += 12;
}
if (minute > 60) {
minute -= 60;
hour++;
}
if (minute < 0) {
minute += 6... |
static boolean shortcutExists(Context context, String title, Intent intent) {
final ContentResolver cr = context.getContentResolver();
Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI,
new String[] { "title", "intent" }, "title=? and intent=?",
new String[] { title,... | static boolean shortcutExists(Context context, String title, Intent intent) {
final ContentResolver cr = context.getContentResolver();
Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI,
new String[] { "title", "intent" }, "title=? and intent=?",
new String[] { title,... |
public boolean answer()
{
_console.println(FormattedConsole.OutputLevel.HEADING, "----" + _id + "----");
//TODO: test
List<Directive> loadList = getLoadModuleList();
for (Directive directive : loadList)
{
String[] arguments = directive.getValue().trim().split("( |\t)*");
if(arguments == null || argume... | public boolean answer()
{
_console.println(FormattedConsole.OutputLevel.HEADING, "----" + _id + "----");
//TODO: test
List<Directive> loadList = getLoadModuleList();
for (Directive directive : loadList)
{
String[] arguments = directive.getValue().trim().split("[ \t]+");
if(arguments == null || argumen... |
public int execute(SQLSession session, String cmd, String param) {
try {
if ("autocommit-on".equals(cmd)) {
session.getConnection().setAutoCommit(true);
System.err.println("set autocommit on");
}
else if ("autocommit-off".equals(cmd)) {
session.getConnection().setAutoCommit(false);
Sys... | public int execute(SQLSession session, String cmd, String param) {
try {
if ("autocommit-on".equals(cmd)) {
/*
* due to a bug in Sybase, we have to close the
* transaction first before setting autcommit.
* This is probably a save choice to do.... |
public void onReceive(Context context, Intent intent) {
if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
Log.v(TAG, "Intent received: " + intent);
}
String action = intent.getAction();
if (action.equals(Mms.Intents.CONTENT_CHANGED_ACTION)) {
Uri changed... | public void onReceive(Context context, Intent intent) {
if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) {
Log.v(TAG, "Intent received: " + intent);
}
String action = intent.getAction();
if (action.equals(Mms.Intents.CONTENT_CHANGED_ACTION)) {
Uri changed... |
public LoginPanel(SessionId session, TimadorusWebApp entryIn) {
super();
this.entry = entryIn;
setUser(new User());
logincounter = 0;
setupHistory();
userBox.addFocusHandler(new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
userBox.setText("");
... | public LoginPanel(SessionId session, TimadorusWebApp entryIn) {
super();
this.entry = entryIn;
setUser(new User());
logincounter = 0;
setupHistory();
userBox.addFocusHandler(new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
userBox.setText("");
... |
@Override protected void render(Block html) {
html.
div("#header.ui-widget").
div("#user").
_("Logged in as: "+ request().getRemoteUser())._().
div("#logo").
img("/static/hadoop-st.png")._().
h1($(TITLE))._();
}
| @Override protected void render(Block html) {
String loggedIn = "";
if (request().getRemoteUser() != null) {
loggedIn = "Logged in as: " + request().getRemoteUser();
}
html.
div("#header.ui-widget").
div("#user").
_(loggedIn)._().
div("#logo").
img("/st... |
static boolean authenticate(String username, String password) {
User user = User.find("byMunchkinId", username.toLowerCase()).first();
return user != null
&& user.password.equals(Crypto.passwordHash(password));
}
| static boolean authenticate(String username, String password) {
User user = User.find("byMunchkinId", username.toUpperCase().trim()).first();
return user != null
&& user.password.equals(Crypto.passwordHash(password));
}
|
public void run() {
Game.gamemode = Gamemode.NETWORK;
while (true) {
if (this.out_queue.isEmpty() == false) {
this.sendCommand();
}
try {
String command = this.inStream.readLine();
Input in = null;
if (command.startsWith("input:")) {
in = new Input();
command = command.replace("... | public void run() {
Game.gamemode = Gamemode.NETWORK;
while (true) {
if (this.out_queue.isEmpty() == false) {
this.sendCommand();
}
try {
String command = this.inStream.readLine();
Input in = null;
if (command.startsWith("input:")) {
in = new Input();
command = command.replace("... |
public synchronized final void get(final WindowCursor curs,
final WindowedFile wp, final int id) throws IOException {
int idx = binarySearch(wp, id);
if (0 <= idx) {
final ByteWindow<?> w = windows[idx];
if ((curs.handle = w.get()) != null) {
w.lastAccessed = ++accessClock;
curs.window = w;
re... | public synchronized final void get(final WindowCursor curs,
final WindowedFile wp, final int id) throws IOException {
int idx = binarySearch(wp, id);
if (0 <= idx) {
final ByteWindow<?> w = windows[idx];
if ((curs.handle = w.get()) != null) {
w.lastAccessed = ++accessClock;
curs.window = w;
re... |
public SimpleUrlHandlerMapping bristlebackHandlerMappings() {
Map<String, BristlebackHttpHandler> mappings = new HashMap<>();
mappings.put(SERVLET_MAPPING, bristlebackHttpHandler());
SimpleUrlHandlerMapping handlerMapping = new SimpleUrlHandlerMapping();
handlerMapping.setUrlMap(mappings);
retur... | public SimpleUrlHandlerMapping bristlebackHandlerMappings() {
Map<String, BristlebackHttpHandler> mappings = new HashMap<String, BristlebackHttpHandler>();
mappings.put(SERVLET_MAPPING, bristlebackHttpHandler());
SimpleUrlHandlerMapping handlerMapping = new SimpleUrlHandlerMapping();
handlerMapping.s... |
public static Element constructObsOfferingNodes(ObservationOffering offering,Document document) {
//Create the observation offering
Element obsOfferingEl = document.createElement("ObservationOffering");
//add the station ID to the created element
obsOfferingEl.setAttribute("gml:id", ... | public static Element constructObsOfferingNodes(ObservationOffering offering,Document document) {
//Create the observation offering
Element obsOfferingEl = document.createElement("ObservationOffering");
//add the station ID to the created element
obsOfferingEl.setAttribute("gml:id", ... |
public CacheManifestImpl()
{
ApplicationCacheHandler.addApplicationCacheHandler(new ApplicationCacheEvent.Handler()
{
@Override
public void onCacheEvent(ApplicationCacheEvent event)
{
switch (event.getEventType())
{
case onDownloading:
... | public CacheManifestImpl()
{
ApplicationCacheHandler.addApplicationCacheHandler(new ApplicationCacheEvent.Handler()
{
@Override
public void onCacheEvent(ApplicationCacheEvent event)
{
switch (event.getEventType())
{
case onDownloading:
... |
public LaunchedProcess launch(final LaunchContext context) throws IOException {
Session session = context.getSession();
ObjectMapper mapper = new ObjectMapper();
final File extractDir = createExtractDir();
JavaProcessBuilder builder = new JavaProcessBuilder();
ReleaseManifest... | public LaunchedProcess launch(final LaunchContext context) throws IOException {
Session session = context.getSession();
ObjectMapper mapper = new ObjectMapper();
final File extractDir = createExtractDir();
JavaProcessBuilder builder = new JavaProcessBuilder();
ReleaseManifest... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.