buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public static RemoteViews buildRemoteViews(Context context, int appWidgetId) {
// Here we setup the intent which points to the StackViewService
// which will provide the views for this collection.
Intent intent = new Intent(context, ListWidgetService.class);
intent.putExtra(AppWidge... | public static RemoteViews buildRemoteViews(Context context, int appWidgetId) {
// Here we setup the intent which points to the StackViewService
// which will provide the views for this collection.
Intent intent = new Intent(context, ListWidgetService.class);
intent.putExtra(AppWidge... |
public void update(boolean requestRelease) {
double now = Timer.getFPGATimestamp();
if(now - lastReleaseTime > RELEASE_DELAY.get()) {
this.requestRelease = !this.requestRelease ? true : this.requestRelease;
}
if(requestRelease) {
//Record the... | public void update(boolean requestShot) {
double now = Timer.getFPGATimestamp();
if(requestShot && now - lastReleaseTime > RELEASE_DELAY.get()) {
requestRelease = !requestRelease ? true : requestRelease;
}
if(requestRelease) {
//Record the ti... |
public Format[] getSupportedOutputFormats(Format in)
{
if (in == null)
{
return new Format[]{new AudioFormat(AudioFormat.ALAW)};
}
if (matches(in, inputFormats) == null)
{
return new Format[1];
}
if (! (in instanceof AudioFormat)... | public Format[] getSupportedOutputFormats(Format in)
{
if (in == null)
{
return new Format[]{new AudioFormat("ALAW")};
}
if (matches(in, inputFormats) == null)
{
return new Format[1];
}
if (! (in instanceof AudioFormat))
... |
public static void main(String args[]) {
try{
BufferedReader rd =new BufferedReader(new FileReader(chromium_log));
wt=new BufferedWriter(new FileWriter(output_file));
String line=null, log="";
while((line=rd.readLine())!=null){
if(line.startsWith... | public static void main(String args[]) {
try{
BufferedReader rd =new BufferedReader(new FileReader(chromium_log));
wt=new BufferedWriter(new FileWriter(output_file));
String line=null, log="";
while((line=rd.readLine())!=null){
if(line.startsWith... |
private void exportEditor(){
try {
ZipInputStream zis = new ZipInputStream(getResource("editor.zip"));
ZipEntry entry = null;
File outputDir = new File(getDataFolder(),"editor");
while((entry = zis.getNextEntry()) != null)
{
File outputFile = new File(outputDir,entry.getName(... | private void exportEditor(){
try {
ZipInputStream zis = new ZipInputStream(getResource("editor.zip"));
ZipEntry entry = null;
File outputDir = new File(getDataFolder(),"editor");
while((entry = zis.getNextEntry()) != null)
{
File outputFile = new File(outputDir,entry.getName(... |
public boolean supports(TherianContext context, Convert<?, ? super Iterator> convert) {
if (!super.supports(context, convert) || convert.getSourcePosition().getValue() instanceof Iterator<?>) {
return false;
}
final Convert<?, Iterable> toIterable = Convert.to(Iterable.class, con... | public boolean supports(TherianContext context, Convert<?, ? super Iterator> convert) {
if (!super.supports(context, convert) || convert.getSourcePosition().getValue() instanceof Iterator<?>) {
return false;
}
final Convert<?, Iterable> toIterable = Convert.to(Iterable.class, con... |
public static void cmd(String name, Object ...args) {
if (name.equals("start")) {
if (file != null) {
file.close();
}
try {
file = new PrintWriter(new FileWriter(String.format("%d.avy", fileIndex++)));
} catch (IOException e) {
// TODO: do something with the exception
return;
}
... | public static void cmd(String name, Object ...args) {
if (name.equals("start")) {
if (file != null) {
file.close();
}
try {
file = new PrintWriter(new FileWriter(String.format("%d.avy", fileIndex++)));
} catch (IOException e) {
// TODO: do something with the exception
return;
}
... |
private void initExtraRules(RuleHolder rule, RuleList extraRules) {
Set<String> tags = rule.getChangeableTags();
Set<String> moreTags = new HashSet<String>();
do {
for (String t : tags) {
String match = t + '=';
for (Map.Entry<String, RuleList> ent : rules.entrySet()) {
if (ent.getKey().startsWi... | private void initExtraRules(RuleHolder rule, RuleList extraRules) {
Set<String> tags = rule.getChangeableTags();
Set<String> moreTags = new HashSet<String>();
do {
for (String t : tags) {
String match = t + '=';
for (Map.Entry<String, RuleList> ent : rules.entrySet()) {
if (ent.getKey().startsWi... |
private void registerHandlers() {
// Create service
registerHandler("/gateway/v1/configurations", new RequestHandler("POST") {
@Override
protected String handleRequest(HttpServletRequest request, HttpServletResponse response, String authToken, byte[] body) throws ServiceBrokerException {
return serviceBr... | private void registerHandlers() {
// Create service
registerHandler("/gateway/v1/configurations", new RequestHandler("POST") {
@Override
protected String handleRequest(HttpServletRequest request, HttpServletResponse response, String authToken, byte[] body) throws ServiceBrokerException {
return serviceBr... |
public Class<?> loadClass(String name, boolean resolve)
throws ClassNotFoundException {
try {
return super.loadClass(name, resolve);
} catch (ClassNotFoundException e) {
for (LocalClassLoader cl : getChildren()) {
try {
return c... | public Class<?> loadClass(String name, boolean resolve)
throws ClassNotFoundException {
try {
synchronized (this) {
return super.loadClass(name, resolve);
}
} catch (ClassNotFoundException e) {
for (LocalClassLoader cl : getChildren()) ... |
private void submitRequest(StudyGrantRequest sgr, String psCodeTiers, boolean firstSending) {
Map<String, Object> model = new HashMap<String, Object>();
String requestData = null;
if (!firstSending) {
try {
requestData = edemandeClient.chargerDemande(psCodeTiers, ... | private void submitRequest(StudyGrantRequest sgr, String psCodeTiers, boolean firstSending) {
Map<String, Object> model = new HashMap<String, Object>();
String requestData = null;
if (!firstSending) {
try {
requestData = edemandeClient.chargerDemande(psCodeTiers, ... |
public void pasteData(PrimitiveDeepCopy pasteBuffer, Layer source, ActionEvent e) {
/* Find the middle of the pasteBuffer area */
double maxEast = -1E100, minEast = 1E100, maxNorth = -1E100, minNorth = 1E100;
for (PrimitiveData data : pasteBuffer.getAll()) {
if (data instanceof ... | public void pasteData(PrimitiveDeepCopy pasteBuffer, Layer source, ActionEvent e) {
/* Find the middle of the pasteBuffer area */
double maxEast = -1E100, minEast = 1E100, maxNorth = -1E100, minNorth = 1E100;
for (PrimitiveData data : pasteBuffer.getAll()) {
if (data instanceof ... |
public Value preg_replace(Env env, Regexp []regexpList,
Value replacement, Value subject,
long limit, Value countRef)
{
if (_isPassthru) {
return RegexpModule.preg_replace(env, regexpList, replacement,
subject, ... | public Value preg_replace(Env env, Regexp []regexpList,
Value replacement, Value subject,
long limit, Value countRef)
{
return null;
/*
if (_isPassthru) {
return RegexpModule.preg_replace(env, regexpList, replacement,
... |
public RelationListDialog() {
super(tr("Relations"), "relationlist", tr("Open a list of all relations."), KeyEvent.VK_R, 150);
displaylist.setCellRenderer(new OsmPrimitivRenderer());
displaylist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
displaylist.addMouseListener(new MouseAdapter(){
@Override... | public RelationListDialog() {
super(tr("Relations"), "relationlist", tr("Open a list of all relations."), KeyEvent.VK_R, 150);
displaylist.setCellRenderer(new OsmPrimitivRenderer());
displaylist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
displaylist.addMouseListener(new MouseAdapter(){
@Override... |
protected CallStat[] getCallStatOrderedBy(int type) {
TreeSet<CallStat> values;
Comparator comparator;
switch (type) {
case CALL_STAT_MAP_TYPE_MIN:
comparator = new Comparator<CallStat>() {
public int compare(CallStat lhs, CallStat rhs) {
... | protected CallStat[] getCallStatOrderedBy(int type) {
TreeSet<CallStat> values;
Comparator comparator;
switch (type) {
case CALL_STAT_MAP_TYPE_MIN:
comparator = new Comparator<CallStat>() {
public int compare(CallStat lhs, CallStat rhs) {
... |
public void receiveResult(JSONArray jArray) {
if (jArray == null) {
listItems.add("I failed :(");
} else {
Log.d(TAG, jArray.toString());
for (int i=0; i<jArray.length(); i++) {
JSONObject obj = null;
try {
obj = (JSONObject) jArray.get(i);
switch (DBCase) {
case 2:
listIt... | public void receiveResult(JSONArray jArray) {
if (jArray == null) {
listItems.add("I failed :(");
} else {
Log.d(TAG, jArray.toString());
for (int i=0; i<jArray.length(); i++) {
JSONObject obj = null;
try {
obj = (JSONObject) jArray.get(i);
switch (DBCase) {
case 2:
listIt... |
private String getLine(String filename, int lineno) {
RelativeFile file = new RelativeFile(filename);
if (!file.isFile() || !file.canRead()) {
// XXX: We should run through sys.path until the filename is found
return null;
}
PyFile pyFile;
try {
... | private String getLine(String filename, int lineno) {
RelativeFile file = new RelativeFile(filename);
if (!file.isFile() || !file.canRead()) {
// XXX: We should run through sys.path until the filename is found
return null;
}
PyFile pyFile;
try {
... |
public int compareTo(Player arg0) {
double res1 = 0;
for(Iterator<CompanyResult> resit = resultList.iterator(); resit.hasNext();){
res1 += resit.next().profit;
}
double res2 = 0;
for(Iterator<CompanyResult> resit2 = arg0.resultList.iterator(); resit2.hasNext();){
res2 += resit2.next().profit;
}
... | public int compareTo(Player arg0) {
double res1 = 0;
for(Iterator<CompanyResult> resit = resultList.iterator(); resit.hasNext();){
res1 += resit.next().profit;
}
double res2 = 0;
for(Iterator<CompanyResult> resit2 = arg0.resultList.iterator(); resit2.hasNext();){
res2 += resit2.next().profit;
}
... |
public void a1() {}
| public void a1() {
throw new RuntimeException();
}
|
public synchronized void waitForEndOfExecution() throws RemoteConnectionException, CancelException {
/*
* Block until the execution finishes or is canceled.
*/
if (!finished && !cancelled) {
try {
this.wait();
} catch (InterruptedException e) {
return;
}
}
if (wasCanceled()) {
throw n... | public synchronized void waitForEndOfExecution() throws RemoteConnectionException, CancelException {
/*
* Block until the execution finishes or is canceled.
*/
while (!finished && !cancelled) {
try {
this.wait();
} catch (InterruptedException e) {
// Ignore spurious interrupts
}
}
if (wa... |
private V3DGuiComponent generateUpgradePane(final Upgrade upgrade) {
V3DContainer pane = new V3DContainer();
pane.setSize(320, 150);
V3DGuiRectangle upgradeRect = new V3DGuiRectangle();
upgradeRect.setyAlignment(GuiYAlignment.TOP);
upgradeRect.setPosition(0, 0);
... | private V3DGuiComponent generateUpgradePane(final Upgrade upgrade) {
V3DContainer pane = new V3DContainer();
pane.setSize(320, 150);
V3DGuiRectangle upgradeRect = new V3DGuiRectangle();
upgradeRect.setyAlignment(GuiYAlignment.TOP);
upgradeRect.setPosition(0, 0);
... |
public void OnPlayerEntityInteract(PlayerInteractEntityEvent event) {
Entity e = event.getRightClicked();
Player p = event.getPlayer();
if(Armoryenabled.get(p) != null){ if(Armoryenabled.get(p)) {
if(e.getType().equals(EntityType.ZOMBIE)) {
ItemStack i = p.getItemInHand();
Zombie z = (Zombie) e;
if(EMA... | public void OnPlayerEntityInteract(PlayerInteractEntityEvent event) {
Entity e = event.getRightClicked();
Player p = event.getPlayer();
if(Armoryenabled.get(p) != null){ if(Armoryenabled.get(p)) {
if(e.getType().equals(EntityType.ZOMBIE)) {
ItemStack i = p.getItemInHand();
Zombie z = (Zombie) e;
if(EMA... |
private void loadAccountList() {
View accountsLabel = mContentView.findViewById(R.id.accounts_label);
LinearLayout contents = (LinearLayout)mContentView.findViewById(R.id.accounts);
Context context = getActivity();
AccountManager mgr = AccountManager.get(context);
Account[]... | private void loadAccountList() {
View accountsLabel = mContentView.findViewById(R.id.accounts_label);
LinearLayout contents = (LinearLayout)mContentView.findViewById(R.id.accounts);
Context context = getActivity();
AccountManager mgr = AccountManager.get(context);
Account[]... |
private static String getValueWithTerm(POI poi, Locale lang, String tag) {
if (poi == null)
return null;
Locale descriptionLang;
Locale poiLang = parseLocale(poi.getLang());
String defaultValue = null;
List<POIBaseType> descriptions = poi.getDescription();
for (POIBaseType description : descriptions) ... | private static String getValueWithTerm(POI poi, Locale lang, String tag) {
if (poi == null)
return null;
Locale descriptionLang;
Locale poiLang = parseLocale(poi.getLang());
String defaultValue = null;
List<POIBaseType> descriptions = poi.getDescription();
for (POIBaseType description : descriptions) ... |
public void testNatureContentTypeAssociation() {
IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
IContentType baseType = contentTypeManager.getContentType("org.eclipse.core.tests.resources.nature_associated_1");
IContentType derivedType = contentTypeManager.getContentType("org.eclipse.... | public void testNatureContentTypeAssociation() {
IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
IContentType baseType = contentTypeManager.getContentType("org.eclipse.core.tests.resources.nature_associated_1");
IContentType derivedType = contentTypeManager.getContentType("org.eclipse.... |
public void run() {
if (online) {
try {
Packet packet = new Packet(ClientRequest.GETFRIENDS);
packet.addData("session", Minecraft.getMinecraft().session.sessionId);
packetSender.sendPacket(packet);
String... | public void run() {
if (online) {
try {
Packet packet = new Packet(ClientRequest.GETFRIENDS);
packet.addData("session", Minecraft.getMinecraft().session.sessionId);
packetSender.sendPacket(packet);
String... |
public void doFilter(ServletRequest requestObj, ServletResponse responseObj, FilterChain chain) throws IOException,
ServletException
{
StringBuffer sb = null;
long startTime = System.currentTimeMillis();
// bind some preferences as "current"
Boolean curRemoteUser = (Boolean) ThreadLocalManager.get(CURRENT... | public void doFilter(ServletRequest requestObj, ServletResponse responseObj, FilterChain chain) throws IOException,
ServletException
{
StringBuffer sb = null;
long startTime = System.currentTimeMillis();
// bind some preferences as "current"
Boolean curRemoteUser = (Boolean) ThreadLocalManager.get(CURRENT... |
public boolean create(File input, File output)
{
m_lastThumbnail = null;
try
{
if (! checkThumbnailSupport())
{
// We cannot create it with the right permissions from Java
log("Thumbnail directory does not exist: " + input);
... | public boolean create(File input, File output)
{
m_lastThumbnail = null;
try
{
log("File: " + input);
URI uri = FileUtils.getURI(input);
log("URI: " + uri);
String md5 = getMD5(uri.toString());
if (m_verbose)
log... |
public GUIApplicationTerminalWindow(GUIDesktopPanel desktop, String appName){
super(desktop, appName);
this.setMaximizable(false);
this.setResizable(false);
jobRunning = false;
multipleObserverEvents = false;
terminalField = new JTextArea("");
terminalField.setEditable(false);
terminalField.setCaretCo... | public GUIApplicationTerminalWindow(GUIDesktopPanel desktop, String appName) {
super(desktop, appName);
this.setMaximizable(false);
this.setResizable(false);
jobRunning = false;
multipleObserverEvents = false;
terminalField = new JTextArea("");
terminalField.setEditable(false);
terminalField.setCaretC... |
public static List<String> ArgParser(String args) {
//First, we have to tokenize the strings. Since we can have quoted arguments, we can't simply split on spaces.
List<String> arguments = new ArrayList<String>();
StringBuilder buf = new StringBuilder();
boolean state_in_single_quote = false;
boolean state_in... | public static List<String> ArgParser(String args) {
//First, we have to tokenize the strings. Since we can have quoted arguments, we can't simply split on spaces.
List<String> arguments = new ArrayList<String>();
StringBuilder buf = new StringBuilder();
boolean state_in_single_quote = false;
boolean state_in... |
protected void close( boolean isLastLine ) throws BirtException
{
// TODO support specified height/width/alignment
int contentWidth = currentIP;
if ( lineCount == 1 )
{
if ( specifiedWidth > contentWidth )
{
contentWidth = specifiedWidth;
}
}
setContentWidth( contentWidth );
int height = 0;... | protected void close( boolean isLastLine ) throws BirtException
{
// TODO support specified height/width/alignment
int contentWidth = currentIP;
if ( lineCount == 1 )
{
if ( specifiedWidth > contentWidth )
{
contentWidth = specifiedWidth;
}
}
setContentWidth( contentWidth );
int height = 0;... |
protected void copyTransients( Object source, Object destination )
{
( (CRepository) destination ).setExternalConfiguration( ( (CRepository) source ).getExternalConfiguration() );
( (CRepository) destination ).externalConfigurationImple = ( (CRepository) source ).externalConfigurationImple;
... | protected void copyTransients( Object source, Object destination )
{
( (CRepository) destination ).setExternalConfiguration( ( (CRepository) source ).getExternalConfiguration() );
( (CRepository) destination ).externalConfigurationImple = ( (CRepository) source ).externalConfigurationImple;
... |
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (mViewPager == null) {
return;
}
final int count = mViewPager.getAdapter().getCount();
if (count == 0) {
return;
}
//Calculate views bounds
ArrayList<RectF> bound... | protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (mViewPager == null) {
return;
}
final int count = mViewPager.getAdapter().getCount();
if (count == 0) {
return;
}
//Calculate views bounds
ArrayList<RectF> bound... |
private void construct() {
String html = ICON_HTML_OPEN + icon;
if (!isEnabled()) {
html += ICON_DISABLED;
}
if (text.length() == 0) {
html += ICON_HTML_ICONONLY + ICON_HTML_CLOSE;
} else {
html += ICON_HTML_CLOSE + text;
}
SafeHtmlBuilder builder = new SafeHtmlBuilder();
builder.appendHtml... | private void construct() {
String html = ICON_HTML_OPEN + icon;
if (!isEnabled()) {
html += ICON_DISABLED;
}
if (text.length() == 0) {
html += ICON_HTML_ICONONLY + ICON_HTML_CLOSE;
super.removeStyleName("gwt-Button-WithIconText");
} else {
html += ICON_HTML_CLOSE + text;
super.addStyleName(... |
public void save(File toFile) throws IOException {
// Since File.renameTo doesn't tell you anything about why it failed, we test
// for some common reasons for failure ahead of time and give a bit more info
if (!this.file.exists()) {
throw new IOException
("Some t... | public void save(File toFile) throws IOException {
// Since File.renameTo doesn't tell you anything about why it failed, we test
// for some common reasons for failure ahead of time and give a bit more info
if (!this.file.exists()) {
throw new IOException
("Some t... |
public void testJson() throws Exception {
Map<String, String> attr = new HashMap<String, String>();
attr.put("key", "value");
DiscoveryNode n = new DiscoveryNode("thename", "theid", new InetSocketTransportAddress("thehost", 3234), attr);
FabricDiscovery.ESNode node = new FabricDiscov... | public void testJson() throws Exception {
Map<String, String> attr = new HashMap<String, String>();
attr.put("key", "value");
DiscoveryNode n = new DiscoveryNode("thename", "theid", new InetSocketTransportAddress("thehost", 3234), attr);
FabricDiscovery.ESNode node = new FabricDiscov... |
protected Control createDialogArea( Composite parent )
{
Composite composite = ( Composite ) super.createDialogArea( parent );
GridData gd = new GridData( GridData.FILL_BOTH );
gd.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH ) * 3 / 2;
gd... | protected Control createDialogArea( Composite parent )
{
Composite composite = ( Composite ) super.createDialogArea( parent );
GridData gd = new GridData( GridData.FILL_BOTH );
gd.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH ) * 3 / 2;
gd... |
private static synchronized void ensureAutoHandler() {
if (auto != null) { return; }
auto = new Thread() {
@Override public void run() {
final int timeout = 4;
int t = timeout;
while (!pending.isEmpty() && (t=timeout) == timeout || t-- > 0) {
for (Iterator<ObjectProcessor> it = pending.keySet()... | private static synchronized void ensureAutoHandler() {
if (auto != null) { return; }
auto = new Thread() {
@Override public void run() {
final int timeout = 4;
int t = timeout;
while (!pending.isEmpty() && (t=timeout) == timeout || t-- > 0) {
for (Iterator<ObjectProcessor> it = pending.keySet()... |
public ArrayList<Bonus> getBruteBonus(int id) throws IOException {
Writer w = new WriterClient(this.socket.getOutputStream());
System.out.println("Client send: " + (byte) Protocol.GET_BRUTE_BONUS + " [GET_BRUTE_BONUS] " + id);
w.writeDiscriminant(Protocol.GET_BRUTE_BONUS);
w.writeInt(id);
w.send();
R... | public ArrayList<Bonus> getBruteBonus(int id) throws IOException {
Writer w = new WriterClient(this.socket.getOutputStream());
System.out.println("Client send: " + (byte) Protocol.GET_BRUTE_BONUS + " [GET_BRUTE_BONUS] " + id);
w.writeDiscriminant(Protocol.GET_BRUTE_BONUS);
w.writeInt(id);
w.send();
R... |
public void test(TestHarness harness)
{
int i;
i = Integer.parseInt("0");
harness.check(i, 0);
i = Integer.parseInt("1");
harness.check(i, 1);
i = Integer.parseInt("000");
harness.check(i, 0);
i = Integer.parseInt("007");
harness.check(i, 7);
i = Integer.parseInt("-0");
... | public void test(TestHarness harness)
{
int i;
i = Integer.parseInt("0");
harness.check(i, 0);
i = Integer.parseInt("1");
harness.check(i, 1);
i = Integer.parseInt("000");
harness.check(i, 0);
i = Integer.parseInt("007");
harness.check(i, 7);
i = Integer.parseInt("-0");
... |
private boolean checkIfModifiedJob(BuildResultTriggerInfo configuredTriggerJobInfo,
BuildResultTriggerContext oldContext,
BuildResultTriggerContext newContext,
XTriggerLog log) throws XTriggerExcepti... | private boolean checkIfModifiedJob(BuildResultTriggerInfo configuredTriggerJobInfo,
BuildResultTriggerContext oldContext,
BuildResultTriggerContext newContext,
XTriggerLog log) throws XTriggerExcepti... |
private void checkForChangingTags(TaggedImage taggedImg) {
if (firstTags_ == null) {
firstTags_ = taggedImg.tags;
} else {
Iterator<String> keys = taggedImg.tags.keys();
while (keys.hasNext()) {
String key = keys.next();
try {
if (!firstTa... | private void checkForChangingTags(TaggedImage taggedImg) {
if (firstTags_ == null) {
firstTags_ = taggedImg.tags;
} else {
Iterator<String> keys = taggedImg.tags.keys();
while (keys.hasNext()) {
String key = keys.next();
try {
if (!firstTa... |
public void init() {
setDensity();
appOnAttachedToWindow();
mySlotView = (MyCardSlotViewGroup)findViewById(R.id.myslotview);
///TurnCount初期化
mtxtTurnCnt = new TextView(this);
mtxtTurnCnt.setTextColor(Color.rgb(246, 196, 5));
mtxtTurnCnt.setText("Turn : 0");
mySlotView.addView(mtxtTurnCnt);
... | public void init() {
setDensity();
appOnAttachedToWindow();
mySlotView = (MyCardSlotViewGroup)findViewById(R.id.myslotview);
///TurnCount初期化
mtxtTurnCnt = new TextView(this);
mtxtTurnCnt.setTextColor(Color.rgb(246, 196, 5));
mtxtTurnCnt.setText("Turn : 0");
mySlotView.addView(mtxtTurnCnt);
... |
public @ResponseBody APIResponse addTorrent(@RequestPart("file") MultipartFile file) {
try {
if (file.getName().endsWith(".torrent")) {
controller.addTorrent(getUser(), file.getName(), file.getInputStream());
return APIResponse.createSuccessfulResponse();
} else {
return APIResponse.createErrorResp... | public @ResponseBody APIResponse addTorrent(@RequestPart("file") MultipartFile file) {
try {
String filename = file.getOriginalFilename();
if (filename.endsWith(".torrent")) {
controller.addTorrent(getUser(), filename, file.getInputStream());
return APIResponse.createSuccessfulResponse();
} else {
... |
protected String getAssertionsFMLRepresentation(FMLRepresentationContext context) {
if (getDataAssertions().size() > 0) {
StringBuffer sb = new StringBuffer();
for (DataPropertyAssertion a : getDataAssertions()) {
sb.append(" " + a.getOntologyProperty().getName() + " = " + a.getValue().toString() + ";" + ... | protected String getAssertionsFMLRepresentation(FMLRepresentationContext context) {
if (getDataAssertions().size() > 0) {
StringBuffer sb = new StringBuffer();
for (DataPropertyAssertion a : getDataAssertions()) {
if (a.getOntologyProperty() != null) {
sb.append(" " + a.getOntologyProperty().getName(... |
public Collection<Pair<String, ? extends IAction>> create(PathwayGraph pathway, Object sender) {
final AddPathwayEvent event = new AddPathwayEvent(pathway, EEmbeddingID.PATHWAY_LEVEL1);
event.setSender(sender);
List<Pair<String, ? extends IAction>> actions = new ArrayList<>();
actions.add(Pair.make("Show " + ... | public Collection<Pair<String, ? extends IAction>> create(PathwayGraph pathway, Object sender) {
final AddPathwayEvent event = new AddPathwayEvent(pathway, EEmbeddingID.PATHWAY_LEVEL1);
event.setSender(sender);
List<Pair<String, ? extends IAction>> actions = new ArrayList<>();
actions.add(Pair.make("Show " + ... |
public int doStartTag() throws JspException {
if (url == null) {
log.warn("URL came through as NULL to PortletTag - this is a big problem");
url = "";
}
if (id == null)
id = "";
try {
if (url.equals(""))
pageContext.getOut().print("Every portlet must be defined with a URI");
else {
... | public int doStartTag() throws JspException {
if (url == null) {
log.warn("URL came through as NULL to PortletTag - this is a big problem");
url = "";
}
if (id == null)
id = "";
try {
if (url.equals(""))
pageContext.getOut().print("Every portlet must be defined with a URI");
else {
... |
public List<Rule> getRulesModifiedAfter(String timestamp, String who, String customRestrict) throws ParseException {
Date date = ArchiveUtils.getDate(timestamp);
String ruleWhereQuery = "from Rule rule where ";
if (customRestrict != null) {
ruleWhereQuery += customRestrict;
... | public List<Rule> getRulesModifiedAfter(String timestamp, String who, String customRestrict) throws ParseException {
Date date = (timestamp != null ? ArchiveUtils.getDate(timestamp) : null);
String ruleWhereQuery = "from Rule rule where ";
if (customRestrict != null) {
ruleWhe... |
public void mouseClicked(MouseEvent event, StateRenderer2D source) {
final StateRenderer2D renderer = source;
final Point2D mousePoint = event.getPoint();
if (delegate != null) {
if (event.getClickCount() == 2) {
delegate.setActive(false, source);
... | public void mouseClicked(MouseEvent event, StateRenderer2D source) {
final StateRenderer2D renderer = source;
final Point2D mousePoint = event.getPoint();
if (delegate != null) {
if (event.getClickCount() == 2) {
delegate.setActive(false, source);
... |
public void onUpdate(float pSecondsElapsed) {
Body playerBody = mPlayer.getBody();
float x = mPlayer.getBodyPositionX(true);
float y = mPlayer.getBodyPositionY(true);
float rollMovement = PLAYER_ROLL_SPEED * pSecondsElapsed;
if (moveUp == true) {
if (y > rollToPosition) {
playerBody.setTransfor... | public void onUpdate(float pSecondsElapsed) {
Body playerBody = mPlayer.getBody();
float x = mPlayer.getBodyPositionX(true);
float y = mPlayer.getBodyPositionY(true);
float rollMovement = PLAYER_ROLL_SPEED * pSecondsElapsed;
if (moveUp == true) {
if (y - rollMovement > rollToPosition) {
playerB... |
private void processArgument() {
String argument = arguments[argumentIndex];
FOR : for (characterIndex = 1; characterIndex < argument.length(); characterIndex++) {
switch (argument.charAt(characterIndex)) {
case 'h' :
main.printUsage();
... | private void processArgument() {
String argument = arguments[argumentIndex];
FOR : for (characterIndex = 1; characterIndex < argument.length(); characterIndex++) {
switch (argument.charAt(characterIndex)) {
case 'h' :
main.printUsage();
... |
public List<DataNode> getYoutubeTracks(DataNode parent) {
List<DataNode> list = new LinkedList<>();
search = search.replace(' ', '+');
String searchUrl = "http://www.youtube.com/results?search_query="
+ search;
try {
URL u = new URL(searchUrl);
InputStream is = u.openConnection().getInputStream();
... | public List<DataNode> getYoutubeTracks(DataNode parent) {
List<DataNode> list = new LinkedList<>();
search = search.replace(' ', '+');
String searchUrl = "http://www.youtube.com/results?search_query="
+ search;
try {
URL u = new URL(searchUrl);
InputStream is = u.openConnection().getInputStream();
... |
public static List<String> parseResponseForProducers(Reader response){
ObjectMapper mapper = new ObjectMapper();
List<String> outputs = new ArrayList<String>();
try {
JsonNode rootNode = mapper.readTree(response);
JsonNode producers = rootNode.path("data").path("producers");
Iterator<JsonNode> prod... | public static List<String> parseResponseForProducers(Reader response){
ObjectMapper mapper = new ObjectMapper();
List<String> outputs = new ArrayList<String>();
try {
JsonNode rootNode = mapper.readTree(response);
JsonNode producers = rootNode.path("data").path("producers");
Iterator<JsonNode> prod... |
public FormulaEventAnalysis(Formula f) {
formula = f;
dependence = ArrayListMultimap.create();
//FormulaTraverser.traverse(formula, new FormulaAnalyser());
queries = new HashSet<Formula>();
Conjunction c = ((Conjunction) formula).flatten();
Vector<Formula> necessary = new Vector<Formula>(c.getNoFormulas... | public FormulaEventAnalysis(Formula f) {
formula = f;
dependence = ArrayListMultimap.create();
//FormulaTraverser.traverse(formula, new FormulaAnalyser());
queries = new HashSet<Formula>();
Conjunction c = ((Conjunction) formula).flatten();
Vector<Formula> necessary = new Vector<Formula>(c.getNoFormulas... |
public HiveConnection(String uri, Properties info) throws SQLException {
if (!uri.startsWith(URI_PREFIX)) {
throw new SQLException("Invalid URL: " + uri, "08S01");
}
// remove prefix
uri = uri.substring(URI_PREFIX.length());
// If uri is not specified, use local mode.
if (uri.isEmpty()... | public HiveConnection(String uri, Properties info) throws SQLException {
if (!uri.startsWith(URI_PREFIX)) {
throw new SQLException("Invalid URL: " + uri, "08S01");
}
// remove prefix
uri = uri.substring(URI_PREFIX.length());
// If uri is not specified, use local mode.
if (uri.isEmpty()... |
private void rebuildTransitions() {
List<IEvent> events = dao.getEventsForSubscription(id);
if (events == null) {
return;
}
SubscriptionState nextState = null;
String nextPlanName = null;
String nextPhaseName = null;
String nextPriceList = null;
... | private void rebuildTransitions() {
List<IEvent> events = dao.getEventsForSubscription(id);
if (events == null) {
return;
}
SubscriptionState nextState = null;
String nextPlanName = null;
String nextPhaseName = null;
String nextPriceList = null;
... |
public void deleteImage(String key) {
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
UploadedImageDao dao = new UploadedImageDao();
UploadedImage image = dao.get(key);
if(image.getOwnerId() == user.getUserId()) {
dao.delete(key);
}
}
| public void deleteImage(String key) {
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
UploadedImageDao dao = new UploadedImageDao();
UploadedImage image = dao.get(key);
if(image.getOwnerId().equals(user.getUserId())) {
dao.delete(key);
}
}
|
public String toDisplay(P option) {
return option.toString();
}
| public String toDisplay(P option) {
return option == null ? null : option.toString();
}
|
public List<Component> defineComponents() {
List<Component> all = new ArrayList<Component>();
all.add(C(Bucket.class, String.class.getName(), LocalStringBucket.class) //
.is(PER_LOOKUP) //
.req(MessagePathBuilder.class));
all.add(C(Bucket.class, MessageTree.class.getName(), LocalMessageBucket.cl... | public List<Component> defineComponents() {
List<Component> all = new ArrayList<Component>();
all.add(C(Bucket.class, String.class.getName(), LocalStringBucket.class) //
.is(PER_LOOKUP) //
.req(MessagePathBuilder.class));
all.add(C(Bucket.class, MessageTree.class.getName(), LocalMessageBucket.cl... |
private void parseCommandLineArguments(String[] args)
{
try
{
Options options = new Options();
options.addOption(new Option("h","help",false,"Shows this help"));
options.addOption(new Option("U","nfsp",true,"Path to directory with UCSC files."));
options.addOption(new Option("S","serialize... | private void parseCommandLineArguments(String[] args)
{
try
{
Options options = new Options();
options.addOption(new Option("h","help",false,"Shows this help"));
options.addOption(new Option("U","nfsp",true,"Path to directory with UCSC files."));
options.addOption(new Option("S","serialize... |
public void testSingleThreadExecutorService() {
// Get the execution service instance
IExecutor executor = Executors.newExecutor("org.eclipse.tcf.te.runtime.concurrent.executors.singleThreaded"); //$NON-NLS-1$
assertNotNull("Failed to get executor instance!", executor); //$NON-NLS-1$
assertTrue("Executor not i... | public void testSingleThreadExecutorService() {
// Get the execution service instance
IExecutor executor = Executors.newExecutor("org.eclipse.tcf.te.runtime.concurrent.executors.singleThreaded"); //$NON-NLS-1$
assertNotNull("Failed to get executor instance!", executor); //$NON-NLS-1$
assertTrue("Executor not i... |
public Map<String, String> generateTaskConfigMap(@NotNull final ActionParametersMap params,
@Nullable final TaskDefinition previousTaskDefinition) {
Map<String, String> config = super.generateTaskConfigMap(params, previousTaskDefinition);
taskConfiguratorHelper.populateTaskConfigMapWithActionParameters(config... | public Map<String, String> generateTaskConfigMap(@NotNull final ActionParametersMap params,
@Nullable final TaskDefinition previousTaskDefinition) {
Map<String, String> config = super.generateTaskConfigMap(params, previousTaskDefinition);
taskConfiguratorHelper.populateTaskConfigMapWithActionParameters(config... |
private TestInitInfo setUp() throws ResourceException, ProtocolException {
initBundles();
//clear resource repo
List<IResource> resources = resourceManager.listResources();
for (IResource resource : resources){
if (resource.getState().equals(ILifecycle.State.ACTIVE))
resourceManager.stopResource(r... | private TestInitInfo setUp() throws ResourceException, ProtocolException {
initBundles();
//clear resource repo
List<IResource> resources = resourceManager.listResources();
for (IResource resource : resources){
if (resource.getState().equals(ILifecycle.State.ACTIVE))
resourceManager.stopResource(r... |
Map<String, Object> getFormVariables() {
Map<String, Object> map = new HashMap<String, Object>();
Iterator keys = jsonBody.keys();
String key, typeKey, type;
String[] keyPair;
Object value;
while (keys.hasNext()) {
key = (String) keys.next();
keyPair = key.split("... | Map<String, Object> getFormVariables() {
Map<String, Object> map = new HashMap<String, Object>();
Iterator keys = jsonBody.keys();
String key, typeKey, type;
String[] keyPair;
Object value;
while (keys.hasNext()) {
key = (String) keys.next();
keyPair = key.split("... |
public static void main(String[] args) throws IOException {
// RPi external I2C bus
final I2CBus piExtBus = I2CFactory.getInstance(1);
// Default address for MD25 board
final I2CDevice md25 = piExtBus.getDevice(0x58);
int revision = md25.read(MD25.REG_REVISION);
System.out.print("MD25 revision " + re... | public static void main(String[] args) throws IOException {
// RPi external I2C bus
final I2CBus piExtBus = I2CFactory.getInstance(1);
// Default address for MD25 board
final I2CDevice md25 = piExtBus.getDevice(0x58);
int revision = md25.read(MD25.REG_REVISION);
System.out.print("MD25 revision " + re... |
public void build(boolean encrypt){
field = new GF2mField(8, POLYNOMIAL);
System.out.println(field);
int i,c,cur = 1;
gInv[0] = -1;
for(i=0; i<AES_FIELD_SIZE; i++){
g[i] = cur;
gInv[cur] = i;
cur = field.mult(cur, GENERATOR);
}
... | public void build(boolean encrypt){
field = new GF2mField(8, POLYNOMIAL);
System.out.println(field);
int i,c,cur = 1;
gInv[0] = -1;
for(i=0; i<AES_FIELD_SIZE; i++){
g[i] = cur;
gInv[cur] = i;
cur = field.mult(cur, GENERATOR);
}
... |
public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
{
if (args.length < 1)
{
user.sendMessage("§cUsage: /" + commandLabel + " [list|item] <player>");
return;
}
User target = user;
if (args.length > 1 && user.isAuthorized("essentials.u... | public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
{
if (args.length < 1)
{
user.sendMessage("§cUsage: /" + commandLabel + " [list|item] <player>");
return;
}
User target = user;
if (args.length > 1 && user.isAuthorized("essentials.u... |
public void reduce(WritableComparable key, Iterator values,
OutputCollector output, Reporter reporter)
throws IOException {
CrawlDatum highest = null;
CrawlDatum old = null;
byte[] signature = null;
float scoreIncrement = 0.0f;
while (values.hasNext()) {
CrawlDatum... | public void reduce(WritableComparable key, Iterator values,
OutputCollector output, Reporter reporter)
throws IOException {
CrawlDatum highest = null;
CrawlDatum old = null;
byte[] signature = null;
float scoreIncrement = 0.0f;
while (values.hasNext()) {
CrawlDatum... |
public void onRightClick(final PlayerInteractEvent e)
{
if ((e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction()
.equals(Action.RIGHT_CLICK_BLOCK))
&& e.getPlayer().getItemInHand().getType()
.equals(Material.WRITTEN_BOOK))
{
... | public void onRightClick(final PlayerInteractEvent e)
{
if ((e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction()
.equals(Action.RIGHT_CLICK_BLOCK))
&& e.getPlayer().getItemInHand().getType()
.equals(Material.WRITTEN_BOOK))
{
... |
public void lookupByNameYieldsMoreThanOneMatches() throws TaxonPropertyLookupServiceException {
// this species has two matches http://eol.org/27383107 and http://eol.org/209714, first is picked
assertThat(lookupPageIdByScientificName("Copadichromis insularis"), is("EOL:27383107"));
// bel... | public void lookupByNameYieldsMoreThanOneMatches() throws TaxonPropertyLookupServiceException {
// this species has two matches http://eol.org/27383107 and http://eol.org/209714, first is picked
assertThat(lookupPageIdByScientificName("Copadichromis insularis"), is("EOL:209714"));
// below... |
public void onTalkToNpc(Player player, final Npc npc) {
if(!DataConversions.inArray(boatMen, npc.getID())) {
return;
}
if(npc.getID() == 163) {
player.informOfNpcMessage(new ChatMessage(npc, "G'day sailor, would you like a free trip to Port Sarim", player));
player.setBusy(true);
world.getDelayedEven... | public void onTalkToNpc(Player player, final Npc npc) {
if(!DataConversions.inArray(boatMen, npc.getID())) {
return;
}
if(npc.getID() == 163) {
player.informOfNpcMessage(new ChatMessage(npc, "G'day sailor, would you like a free trip to Port Sarim", player));
player.setBusy(true);
world.getDelayedEven... |
public Zone getZone(String zoneName){
// add zone to the hashmap if it isn't found
if (!zones.containsKey(zoneName))
zones.put(zoneName, new Zone(zoneName));
return zones.get(zoneName);
}
| public Zone getZone(String zoneName){
// if a zone is not in the map, throw an exception
// we don't instantiate because we don't know the type
// of Zone (can be Region or Town)
if (!zones.containsKey(zoneName))
throw new IllegalArgumentException();
return zones.... |
public void execute(String commandString, Session sess)
throws IOException
{
if (sess.isAuthenticated())
{
sess.sendResponse("503 Refusing any other AUTH command.");
return;
}
AuthenticationHandlerFactory authFactory = sess.getServer().getAuthenticationHandlerFactory();
if (authFactory == null)
... | public void execute(String commandString, Session sess)
throws IOException
{
if (sess.isAuthenticated())
{
sess.sendResponse("503 Refusing any other AUTH command.");
return;
}
AuthenticationHandlerFactory authFactory = sess.getServer().getAuthenticationHandlerFactory();
if (authFactory == null)
... |
private String convertToPerl5RegularExpression(String pattern)
throws NullPointerException, ParseException {
char[] contents = pattern.toCharArray();
int size = contents.length;
FastStringBuffer buffer = new FastStringBuffer(size * 2);
char prevChar = (char) 0;
for (int i= 0; i < s... | private String convertToPerl5RegularExpression(String pattern)
throws NullPointerException, ParseException {
char[] contents = pattern.toCharArray();
int size = contents.length;
FastStringBuffer buffer = new FastStringBuffer(size * 2);
char prevChar = (char) 0;
for (int i= 0; i < s... |
public void initBillTable() {
while (getView().getBillTable().getColumnCount() > 0) {
getView().getBillTable().removeColumn(0);
}
// Creates bulletin column
TextColumn<Bill> bulletinColumn = new TextColumn<Bill>() {
@Override
public String getValue(Bill bill) {
return bill.getBulletinNumber();
... | public void initBillTable() {
while (getView().getBillTable().getColumnCount() > 0) {
getView().getBillTable().removeColumn(0);
}
// Creates bulletin column
TextColumn<Bill> bulletinColumn = new TextColumn<Bill>() {
@Override
public String getValue(Bill bill) {
return bill.getBulletinNumber();
... |
public void writeInternal(Device device, XCalendar component) throws java.io.IOException {
final String idComponent = component.getName();
final String idValue = idComponent + "val";
final String idButton = idComponent + "btn";
final String idContainer = idComponent + "con";
... | public void writeInternal(Device device, XCalendar component) throws java.io.IOException {
final String idComponent = component.getName();
final String idValue = idComponent + "val";
final String idButton = idComponent + "btn";
final String idContainer = idComponent + "con";
... |
Object getService() {
if ((useCount > 0) || (factory == null)) {
useCount++;
return cachedService;
}
if (Debug.DEBUG && Debug.DEBUG_SERVICES) {
Debug.println("getService[factory=" + registration.getBundle() + "](" + context.getBundleImpl() + "," + registration + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON... | Object getService() {
if ((useCount > 0) || (factory == null)) {
useCount++;
return cachedService;
}
if (Debug.DEBUG && Debug.DEBUG_SERVICES) {
Debug.println("getService[factory=" + registration.getBundle() + "](" + context.getBundleImpl() + "," + registration + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON... |
public void check(final SimpleString address, final CheckType checkType, final ServerSession session) throws Exception
{
if (securityEnabled)
{
if (trace) { log.trace("checking access permissions to " + address); }
if (checkCached(address, checkType))
{
// OK... | public void check(final SimpleString address, final CheckType checkType, final ServerSession session) throws Exception
{
if (securityEnabled)
{
if (trace) { log.trace("checking access permissions to " + address); }
if (checkCached(address, checkType))
{
// OK... |
public void bench() {
ModelCompare compare = new DefaultModelCompare();
long before = System.currentTimeMillis();
KMFContainer root = loader.loadModelFromStream(this.getClass().getClassLoader().getResourceAsStream("jedModel.json")).get(0);
KMFContainer root2 = loader.loadModelFr... | public void bench() {
ModelCompare compare = new DefaultModelCompare();
long before = System.currentTimeMillis();
KMFContainer root = loader.loadModelFromStream(this.getClass().getClassLoader().getResourceAsStream("jedModel.json")).get(0);
KMFContainer root2 = loader.loadModelFr... |
public static void main(String[] args)
{
//FRAME SETUP
JFrame frame = new JFrame("Team 4 WIFI Simulator");
frame.setLayout(new BorderLayout());
//LEFT AND RIGHT PANEL DECLRATION AND SETUP
final JPanel leftPanel = new JPanel();
leftPanel.setLayout(new Bo... | public static void main(String[] args)
{
//FRAME SETUP
JFrame frame = new JFrame("Team 4 WIFI Simulator");
frame.setLayout(new BorderLayout());
//LEFT AND RIGHT PANEL DECLRATION AND SETUP
final JPanel leftPanel = new JPanel();
leftPanel.setLayout(new Bo... |
protected void doService(HttpRequest req, HttpResponse res,
HttpContext context) throws HttpException, IOException {
boolean authorized = false;
if (req.containsHeader("Cookie")) {
Header[] headers = req.getHeaders("Cookie");
for (Header h : headers) {
String cookie = h.getValue();
if (sessionStor... | protected void doService(HttpRequest req, HttpResponse res,
HttpContext context) throws HttpException, IOException {
boolean authorized = false;
if (req.containsHeader("Cookie")) {
Header[] headers = req.getHeaders("Cookie");
for (Header h : headers) {
String cookie = h.getValue();
String key = co... |
public EightToCarRobustnessBatch(Class<?>[] mainClasses) {
int counter = 0;
for(int ci=0; ci<mainClasses.length; ci++) {
// Efficiency experiments, 0% failure risk, varying packet loss
if(!EightToCarSettings.SKIP_EFFICIENCY)
for(float risk = EightToCarSettings... | public EightToCarRobustnessBatch(Class<?>[] mainClasses) {
int counter = 0;
for(int ci=0; ci<mainClasses.length; ci++) {
// Efficiency experiments, 0% failure risk, varying packet loss
if(!EightToCarSettings.SKIP_EFFICIENCY)
for(float risk = EightToCarSettings... |
public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException {
XContentParser parser = parseContext.parser();
MapperService.SmartNameFieldMappers smartNameFieldMappers;
Boolean cache = null;
String filterName = null;
String currentFieldName =... | public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException {
XContentParser parser = parseContext.parser();
MapperService.SmartNameFieldMappers smartNameFieldMappers;
Boolean cache = null;
String filterName = null;
String currentFieldName =... |
protected void extras(long itemId, long createdAt) {
super.extras(itemId, createdAt);
TodorooCursor<Metadata> tagMetadata = metadataDao.query(Query.select(Metadata.PROPERTIES)
.where(Criterion.and(MetadataCriteria.byTaskAndwithKey(itemId, TaskToTagMetadata.KEY), Metadata.DELETION_DAT... | protected void extras(long itemId, long createdAt) {
super.extras(itemId, createdAt);
TodorooCursor<Metadata> tagMetadata = metadataDao.query(Query.select(Metadata.PROPERTIES)
.where(Criterion.and(MetadataCriteria.byTaskAndwithKey(itemId, TaskToTagMetadata.KEY), Metadata.DELETION_DAT... |
public void upcomingActivityRetrieveMySQL()
{
Connection connection = null;
PreparedStatement pStatement = null;
ResultSet resultSet = null;
Properties props = new Properties();
FileInputStream inStream = null;
try
{
inStream = new FileInputStream("/usr/local/mysql/database.properties");
pr... | public void upcomingActivityRetrieveMySQL()
{
Connection connection = null;
PreparedStatement pStatement = null;
ResultSet resultSet = null;
Properties props = new Properties();
FileInputStream inStream = null;
try
{
inStream = new FileInputStream("/usr/local/mysql/database.properties");
pr... |
public void actionPerformed( ActionEvent event ) {
try {
// String ourdir = "/home/user/persist/workspace/Test/";
String ourdir = playerObjects.getCSAI().getAIDirectoryPath();
System.out.println( textarea.getText() );
new File( ourdir + "src-console" + File... | public void actionPerformed( ActionEvent event ) {
try {
// String ourdir = "/home/user/persist/workspace/Test/";
String ourdir = playerObjects.getCSAI().getAIDirectoryPath();
System.out.println( textarea.getText() );
new File( ourdir + "src-console" + File... |
public boolean add(String w, int tagPosition) {
for (int i = 0; i < data.length; i++) {
if (!w.equals("") && data[i].equals(SPACE)) {
data[i] = w;
count++;
tag[i] = tagPosition;
notifyDataSetChanged();
if (count == data.length)
return false;
return true;
}
}
return false;
}
| public boolean add(String w, int tagPosition) {
for (int i = 0; i < data.length; i++) {
if (count == data.length)
return false;
if (!w.equals("") && data[i].equals(SPACE)) {
data[i] = w;
count++;
tag[i] = tagPosition;
notifyDataSetChanged();
return true;
}
}
return false;
}
|
public void testCAforIncludeTaglibInInenerNodes() throws Throwable {
IFile file = (IFile) TestUtil.getComponentPath("JBIDE/6922/jbide6922.xhtml", //$NON-NLS-1$
JsfAllTests.IMPORT_JSF_20_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
JSPMultiPageEditor multiPageEditor =... | public void testCAforIncludeTaglibInInenerNodes() throws Throwable {
IFile file = (IFile) TestUtil.getComponentPath("JBIDE/6922/jbide6922.xhtml", //$NON-NLS-1$
JsfAllTests.IMPORT_JSF_20_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
JSPMultiPageEditor multiPageEditor =... |
public void create () {
stage = new Stage();
Gdx.input.setInputProcessor(stage);
final TextureRegion region = new TextureRegion(new Texture("data/badlogic.jpg"));
final Actor actor = new Actor() {
public void draw (SpriteBatch batch, float parentAlpha) {
Color color = getColor();
batch.setColor(col... | public void create () {
stage = new Stage();
Gdx.input.setInputProcessor(stage);
final TextureRegion region = new TextureRegion(new Texture("data/badlogic.jpg"));
final Actor actor = new Actor() {
public void draw (SpriteBatch batch, float parentAlpha) {
Color color = getColor();
batch.setColor(col... |
protected Properties readProperties(final Context _context)
throws IOException
{
final Properties props = new Properties();
props.load(new FileInputStream("src/org/mxupdate/mapping.properties"));
return props;
}
| protected Properties readProperties(final Context _context)
throws IOException
{
final Properties props = new Properties();
props.load(new FileInputStream("src/main/resources/org/mxupdate/mapping.properties"));
return props;
}
|
public void movePartstoStand(int nest, int stand, int[] pos, int[] indexes)
{
if (isMovePartstoStand)
{
flag = true;
boolean f = true;
if (!probot.isMoving())
{
if (stands.get(stand).getKit() != null){
Part[] p = new Part[4];
... | public void movePartstoStand(int nest, int stand, int[] pos, int[] indexes)
{
if (isMovePartstoStand)
{
flag = true;
boolean f = true;
if (!probot.isMoving())
{
if (stands.get(stand).getKit() != null){
Part[] p = new Part[4];
... |
public void drawButton (Minecraft mc, int mouseX, int mouseY)
{
if (this.visible)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int yTexPos = this.enabled ? 3 : 32;
int ySize = this.enabled ? 28 : 32;
int xOffset = this.id == 2 ? 0 : 1;
m... | public void drawButton (Minecraft mc, int mouseX, int mouseY)
{
if (this.visible)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int yTexPos = this.enabled ? 3 : 32;
int ySize = this.enabled ? 28 : 32;
int xOffset = this.id == 2 ? 0 : 1;
m... |
public static void addDataViews( DetailViewer dv, final Ndx ndx )
throws IOException{
Requirements req = new Requirements( AccessMode.READ )
.setRandom( true );
final NDArray image =
NDArrays.toRequiredArray( Ndxs.getMaskedImage( ndx ), req );
... | public static void addDataViews( DetailViewer dv, final Ndx ndx )
throws IOException{
Requirements req = new Requirements( AccessMode.READ )
.setRandom( true );
final NDArray image =
NDArrays.toRequiredArray( Ndxs.getMaskedImage( ndx ), req );
... |
private void processButtonTouch( boolean touched, int xLocation, int yLocation,
long timeElapsed, int pid )
{
// Determine the index of the button that was pressed
int index = touched
? mTouchMap.getButtonPress( xLocation, yLocation )
: mPointerMap.get... | private void processButtonTouch( boolean touched, int xLocation, int yLocation,
long timeElapsed, int pid )
{
// Determine the index of the button that was pressed
int index = touched
? mTouchMap.getButtonPress( xLocation, yLocation )
: mPointerMap.get... |
public int nextSetBit(int i) {
int x = i / 64;
long w = data[x];
w >>>= (i % 64);
if (w != 0) {
return i + Long.numberOfTrailingZeros(w);
}
++x;
for (; x < data.length; ++x) {
if (data[x] != 0) {
return x * 64 + Long.numberOfTrailingZeros(data[x]);
}
}
ret... | public int nextSetBit(int i) {
int x = i / 64;
if(x>=data.length) return -1;
long w = data[x];
w >>>= (i % 64);
if (w != 0) {
return i + Long.numberOfTrailingZeros(w);
}
++x;
for (; x < data.length; ++x) {
if (data[x] != 0) {
return x * 64 + Long.numberOfTrailingZer... |
public ValueFactory<String, Type<String>> geValueFactory() {
return new ValueFactory<String, Type<String>>() {
@Override
public Value<String, ? extends Type<String>> create(final String value) {
return SymbolValue.from(value);
}
@Override
public Value<String, ? extends Type<String>> fromQ(... | public ValueFactory<String, Type<String>> geValueFactory() {
return new ValueFactory<String, Type<String>>() {
@Override
public Value<String, ? extends Type<String>> create(final String value) {
return SymbolValue.from(value);
}
@Override
public Value<String, ? extends Type<String>> fromQ(... |
public CommonViewerAdvisor(Composite parent, ISynchronizePageConfiguration configuration) {
super(configuration);
final CommonViewer viewer = CommonViewerAdvisor.createViewer(parent, configuration, this);
TeamUI.getTeamContentProviderManager().addPropertyChangeListener(this);
configuration.addPropertyChangeLis... | public CommonViewerAdvisor(Composite parent, ISynchronizePageConfiguration configuration) {
super(configuration);
final CommonViewer viewer = CommonViewerAdvisor.createViewer(parent, configuration, this);
TeamUI.getTeamContentProviderManager().addPropertyChangeListener(this);
configuration.addPropertyChangeLis... |
protected void injectLdifs( DirectoryService service, InheritableSettings settings )
{
List<String> ldifs = new ArrayList<String>();
List<String> ldifFiles = new ArrayList<String>();
// First inject the LDIF files if any
ldifFiles = settings.getLdifFiles( ldifFiles );
... | protected void injectLdifs( DirectoryService service, InheritableSettings settings )
{
List<String> ldifs = new ArrayList<String>();
List<String> ldifFiles = new ArrayList<String>();
// First inject the LDIF files if any
ldifFiles = settings.getLdifFiles( ldifFiles );
... |
public void shouldExecute() throws Exception {
ReviewContext reviewContext = ReviewContextTestUtils.createReviewContext("review={id=45}; user={login=paul}; params={comment.text=Hello world}");
action.execute(reviewContext);
verify(reviewDao).findById(45L);
verify(userFinder).findByLogin("paul");
... | public void shouldExecute() throws Exception {
ReviewContext reviewContext = ReviewContextTestUtils.createReviewContext("review={id=45}; user={login=paul}; params={comment.text=Hello world}");
action.execute(reviewContext);
verify(reviewDao).findById(45L);
verify(userFinder).findByLogin("paul");
... |
public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
// Map color profile NCNAME to src from declarations/color-profile element
String colorProfileName = args[3].getString();
String colorName = args[4].getString();
Declaration... | public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
// Map color profile NCNAME to src from declarations/color-profile element
String colorProfileName = args[3].getString();
String colorName = args[4].getString();
Declaration... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.