method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
33c56b7e-86f8-43f0-86e4-c91bf0ab0d2f | 3 | private boolean htaccessGranted( URI requestURI,
HTTPHeaders headers,
HypertextAccessFile htaccess,
File directory,
Map<String,BasicType> additionalSettings,
Map<String,BasicType> optionalReturnSettings,
Environment<String,BasicType> session )
throws IOException,... |
fd26604a-ad42-446e-8ca0-6d09e03a78a5 | 4 | public boolean mouseIn(int mx, int my)
{
if (xpos <= mx && mx <= xpos + width && ypos <= my
&& my <= ypos + height)
return true;
return false;
} |
ed6399ba-52ad-4cd2-b869-711ab8210238 | 9 | private int HuffmanValue(int table[],int temp[], int index[], InputStream in) throws IOException{
int code, input ,mask=0xFFFF;
if(index[0]<8){
temp[0] <<= 8;
input = get8(in);
if(input==0xFF){
marker=get8(in);
if(marker!=0) marker_index=9;
}
temp[... |
e2f27ab0-170c-4663-b825-98d1b51a3d0f | 9 | public String searchANDdescribe() {
StringBuilder result = new StringBuilder();
for(K k : this) {
if(k.getClass().equals(PapaBuilding.class)){
result.append(((PapaBuilding) k).getAttributes());
}else if(k.getClass().equals(PapaBicho.class)){
result.append(((PapaBicho) k).getAttributes());
}else if(... |
2acc69b2-99a6-4394-b334-c8e1979a8f30 | 7 | private void toggleRemoveSelection(TreePath path) {
Stack stack = new Stack();
TreePath parent = path.getParentPath();
while (parent != null && !isPathSelected(parent)) {
stack.push(parent);
parent = parent.getParentPath();
}
if (parent != null) {
stack.push(parent);
} else {
super.removeSelecti... |
db9cdb67-7e5a-40d4-af15-589aad30b5e2 | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Municipality)) {
return false;
}
Municipality other = (Municipality) object;
if ((this.municipalityID == null &... |
767b4ede-af34-48cd-bebf-3168aa9d9f1d | 0 | public void setFirstName(String firstName) {
this.firstName = firstName;
} |
a217fd21-4e90-468c-ab0c-36d26b18283f | 2 | private void promote(Position pos) {
if (board.getFieldAt(pos) == Board.BLACK_REGULAR_PIECE) {
board.changeFieldAt(pos, Board.BLACK_KING);
} else if (board.getFieldAt(pos) == Board.WHITE_REGULAR_PIECE) {
board.changeFieldAt(pos, Board.WHITE_KING);
}
} |
c9cd299c-3bc6-4e75-b31f-056a60af6bf7 | 6 | public void checkPairs( Hand hand, Hand handP, String name ) {
ArrayList<Card> alC = hand.getCards();
for (int i = 0; i < alC.size(); i++) {
Card checker = alC.get(i);
for (int n = 0; n < alC.size(); n++ ) {
if ( n != i && checker.equals( alC.get(n)) ) {
Card type = alC.get( n );
Syste... |
c4429e7d-7d21-45f1-9192-b083612304ff | 7 | public void keyTyped(KeyEvent e) {
if (e.getKeyChar() == 127) {
sim.doDelete();
return;
}
if (e.getKeyChar() > ' ' && e.getKeyChar() < 127) {
Class c = sim.shortcuts[e.getKeyChar()];
if (c == null) {
return;
}
... |
6e9e73e7-996f-4827-aa77-b5dfa5587168 | 9 | public Paint getGradientePaint(){
int x1=0, x2=getWidth(), y1=0, y2=getHeight();
switch (gradiente){
case HORIZONTAL:
x1=getWidth()/2;
y1=0;
x2=getWidth()/2;
y2=getHeight();
return new GradientPaint(x1,y1,colorPr... |
816a20f2-6ec2-41b6-91bf-dea28c382ad6 | 4 | private void rotate()
{
//orient++;
if (orient%4==0)
{
litPositions=new int[][]
{{0,1,0},
{0,1,0},
{0,1,1}};
}
if (orient%4==1)
{
litPositions=new int[][]
{{0,0,0},
{1,1,1},
{1,0,0}};
}
if (orient%4==2)
{
litPositions=new int[][]
... |
ade94b79-4d34-4f5e-bdfb-a65cf3638463 | 0 | NonTerminal(HashSet<Token.Kind> tokenSet)
{
firstSet.addAll(tokenSet);
} |
30eb9175-b770-43f2-8520-ba529ece5f86 | 4 | public List<Message> getMessageList( long cvs_id, int person, int page_size, int offset ){
List<Message> list = new ArrayList<Message>();
PersonInfoHandler handler = null;
try{
ResultSet result = dao_list.getMessageList(cvs_id, person, page_size, offset);
handler = new PersonInfoHandler();
if( !handler.i... |
f1141946-301c-4e86-af34-1593ac57eb55 | 6 | @Override
public boolean execute(RuleExecutorParam param) {
Rule rule = param.getRule();
List<String> values = Util.getValue(param, rule);
if (values == null || values.isEmpty()) {
return false;
}
boolean retValue = true;
for (String value : values) {
String compareValue = rule.getValue();
if (rul... |
9564ea57-ce8b-4ffd-8b84-e859eddf9815 | 2 | private void nextNonce() {
for(int i = 0; i < NONCE_SIZE; i++) {
byte b = nonce[i];
if(b == Byte.MAX_VALUE) {
nonce[i] = Byte.MIN_VALUE;
} else {
nonce[i] = ++b;
return;
}
}
} |
ca0d7bc6-27b3-4b76-878c-a751d076e9e8 | 0 | public State hasChosenItemsState() {
return hasChosenItemsState;
} |
4547711d-fdb4-4673-b149-563c3f18aa71 | 4 | public int DisplayWinners() {
int TotalWinners = winners.size();
do {
if (TotalWinners == 1) {
System.out.println("Player " + winners.get(0).getPlayerid()
+ " has won the game!");
TotalWinners--;
} else if (TotalWinners == 2) {
System.out.println("Player " + winners.get(0).getPlayerid()
... |
f8390a8c-f9e8-4f28-a3cb-0be2b408c278 | 7 | public void testCode() {
int count = 0;
boolean success;
do {
count++;
success = TaskManager.DoTask(new SimpleAbstractTask("MESSAGE TASK") {
/**
*
*/
private static final long serialVersionUID = -354957472036892394L;
@Override
public synchronized void executeTask() {
for (... |
bf8f2293-9db1-41a2-857f-77ad277bc3bd | 1 | private String[] toPathArray(String path) {
if (path.charAt(0) == '/') path = path.substring(1);
return path.split("/");
} |
7fe11270-6c7c-49b8-b374-9ba5b38731d3 | 3 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String form = "";
HttpSession sesion = request.getSession();
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-... |
1872f103-d854-46b6-8ff3-3e5b5b1ed2de | 9 | public FloatElement[] getSortedSimilarWordsByDelta(String word) throws Exception{
int index = model1.index(word);
FloatElement[] similarWords = new FloatElement[model1.sizeOfVocabulary];
//float invalid = -10;
for (int i=0; i<model1.sizeOfVocabulary; i++){
float pmi1 = 0;
float pmi2 = 0;
floa... |
75c0a62b-0e81-41a2-b806-25123ae71cf2 | 2 | public void testPropertyCompareToDayOfMonth() {
MonthDay test1 = new MonthDay(TEST_TIME1);
MonthDay test2 = new MonthDay(TEST_TIME2);
assertEquals(true, test1.dayOfMonth().compareTo(test2) < 0);
assertEquals(true, test2.dayOfMonth().compareTo(test1) > 0);
assertEquals(true, test1... |
400d95d9-0566-4b8e-a4ec-dc2ccfee71e2 | 7 | public void chat() {
// Get username
System.out.println("Enter a username:");
System.out.print(">");
// Get chat message
try(BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in))){
String fromUser = stdIn.readLine();
bow.setUserName(fromUser);
System.out.println("You may... |
78ff0f39-e592-4252-ba0e-2f9e3df90538 | 0 | @Test
public void resolve() {
String [] numbers={
"37107287533902102798797998220837590246510135740250",
"46376937677490009712648124896970078050417018260538",
"74324986199524741059474233309513058123726617309629",
"91942213363574161572522430563301811072406154908250",
"230675882075393461711719803104210... |
7884804c-32cd-4686-a951-0c15d8e5621f | 5 | @Override
protected void setCompletion(final HTTPCompletion completion) {
super.setCompletion(new HTTPCompletion() {
@Override
public void failure(URLRequest request, Throwable t) {
if (completion != null) {
completion.failure(request, t);
... |
733669c2-5db9-40ce-8627-ef209b9b24fe | 1 | public void initAscii()
{
for(char i=0 ; i<256 ; i++)
tableAscii.add(i);
} |
f077f857-e8b4-489c-b833-7e50e11b132c | 8 | @Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Tree)) {
return false;
}
final Tree<?> other = (Tree<?>) obj;
if (rootNode == null) {
if (other.rootNode != null) {
return false;
}
} else i... |
896501e5-f88f-4351-9fda-59398407ef37 | 4 | @Override
public void componentResized(ComponentEvent e)
{
if(e.getComponent() == null || e.getComponent() instanceof JFrame == false)
return;
JFrame frame = (JFrame)e.getComponent();
Container contentPane = frame.getContentPane();
... |
54241df2-0578-42c9-af9c-9bab87c75370 | 1 | private void init() {
statsFile = new File("stats.txt");
date = new Date();
jLabel1 = new JLabel();
this.setBackground(Color.black);
initLeaderBoards();
setBackLabel();
resetLayout();
//saveStats();
try {
loadStats();
} catch... |
f604ee55-a688-4e60-a5c2-cab7982ef79d | 9 | static Playlist playlistFromElement(DomElement e) {
if (e == null)
return null;
Playlist p = new Playlist();
if (e.hasChild("id"))
p.id = Integer.parseInt(e.getChildText("id"));
p.title = e.getChildText("title");
if (e.hasChild("size"))
p.size = Integer.parseInt(e.getChildText("size"));
p.creator =... |
35ae9a51-36e4-4c3f-b022-ff7d5b2ac03b | 8 | void updateVelocity(double t)
{
double dx, dy;
if (Math.abs(getVelocity()[0] + (force.getX()/getMass())*t) < .6) //Breaks physics by limiting velocity. Might not actually do anything...
dx = getVelocity()[0] + (force.getX()/getMass())*t;
else
dx = getVelocity... |
d20713d1-976d-4d31-9180-38619e906ede | 4 | public void dragCard(String ID, int newx, int newy) {
for (Object e : table.getComponents()) {
if ((e.getClass().equals(TCard.class)
|| e.getClass().equals(Token.class))
&&((TCard) e).getID().equals(ID)) {
((TCard) e).setCardPosition(newx, newy... |
c541e1c2-1e0d-4a50-bb7b-c99d28d97887 | 6 | public void update(float delta) {
if (startTime < 0) {
startTime = System.currentTimeMillis();
} else if (time + delta < length / 1000) {
time += delta;
}
if (endTime < 0 && System.currentTimeMillis() - startTime > length) {
endTime = System.currentTimeMillis();
}
if (System.currentTimeMillis() - e... |
3bbfd025-626d-4e02-9e37-906b719ce299 | 7 | private void initNameTileFontMenu(Color bg) {
this.nametextTilePanel = new JPanel();
this.nametextTilePanel.setBackground(bg);
this.nametextTilePanel.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
String initFontTmp = this.skin.getNametextZoomedFont();
int initFontSizeTm... |
f098cd7f-23d0-41ce-b579-006818d11555 | 1 | public boolean decryptSerializedTable(){
String smartcard="verysecurepassword";
try {
File f = new File(TABLE_FILE);
File fe = new File(ENCRYPTED_TABLE_FILE);
f.createNewFile();
fe.createNewFile();
FileInputStream fis = new FileInputStream(ENCRYPTED_TABLE_FILE);
FileOutputStream fos = new ... |
d427275b-d02f-49ae-99f0-b7ddbfdc50d0 | 3 | public void mouseClick(MouseEvent e){
if(e.getButton() == MouseEvent.BUTTON1){
if(data.orientation == 0){
menu.show(this, 0, TabButton.BUTTON_ACTIVE_HEIGHT);
}
else if(data.orientation == 1){
menu.show(this, 0, -menu.getHeight());
}... |
fd7be1a7-698c-4181-8f1d-d1c16703d2c0 | 6 | protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out) {
while (in.remaining() > 0) {
if (out.remaining() < 1) {
return CoderResult.OVERFLOW;
}
final char c = in.get();
if (c >= 0 && c < 256 && IDENT_PDF_DOC_ENCODING_MAP[c]) {
... |
8fff9502-fd82-49bd-a422-26b4ecec94fc | 6 | private static void assertNum(int totalCounts,
List<List<Double>> dataPointsUnnormalized) throws Exception
{
int sum = 0;
for (int x = 0; x < dataPointsUnnormalized.size(); x++)
for (int y = 0; y < dataPointsUnnormalized.get(x).size(); y++)
sum += dataPointsUnnormalized.get(x).get(y);
if (totalCounts... |
dfaf676d-19a0-457f-a465-510c9f7fcbfe | 3 | public File getFile(String lfn, int resID)
{
if (lfn == null || resID == -1) {
return null;
}
// sends a request to the RC
int eventTag = DataGridTags.FILE_REQUEST;
sendEvent(eventTag, lfn, resID);
// waiting for a response from the resource
Sim_... |
d2490b09-670a-4bd4-a5f0-5e9a0d015ac8 | 2 | private void serverNameTMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_serverNameTMouseReleased
int index = serverNameT.getSelectedRow();
if(index>=0){
String server = (String)serverNameT.getModel().getValueAt(index, 0);
serverConfigTF.setText(server);
... |
66d7eb24-42a3-4a7b-a1bf-710a49b3c103 | 2 | public void createDestinationDirectories() {
File projectObfuscatedDir = new File(destinationDir);
projectObfuscatedDir.mkdir();
for (File directory : projectFiles) {
if (directory.isDirectory()) {
String n = destinationDir + "/" + directory.getAbsolutePath().substring(sourceDir.length());
File newDire... |
29dfaa0e-bc06-479d-aeaa-411e83aaa63c | 5 | public void onDisconnect() {
GUIMain.add_line(DarkIRC.AppLang.getString("quit_msg"));
while (!isConnected()) {
try {
reconnect();
Thread.sleep(3000L);
for (int i = 0; i... |
8da240bb-2182-4496-9e91-dfda6e0bc974 | 3 | *@param nivel
**/
public void showMeMoney(beansMiembro miembro, int nivel){
String tab = appMiembro.getLines(nivel);
System.out.println(tab+"----------------------------------");
System.out.println(tab+"| "+miembro.getNick()+" Tus datos monetarios son:");
System.out.println(tab+"------------------------------... |
1ecc942d-c1ba-4263-bf8f-b934bfdb9db9 | 3 | @Override
public ArrayList<String> getEffectSprites(){
ArrayList<String> result = new ArrayList<String>();
if(stype!=null) result.add(stype);
if(stypeCount!=null) result.add(stypeCount);
if(estype!=null) result.add(estype);
return result;
} |
ab6f9d2a-d696-467d-8a1e-04a8a0122733 | 3 | public SimulationResultsHolder runSimulation() {
resultsHolder = new SimulationResultsHolder();
resultsHolder.addFlyReleaseInfo(fr.toString());
for (int i = 1; i<=numberOfDays; i++) {
System.err.println("Running simulation for day " + i + "...");
double totalProbForDay = 0;
int numberOfFlies = 0;
Iter... |
bbc54900-3497-4fb1-9af9-0cc8cb01ff62 | 8 | private String makeCode(){
String c=((ComboText)command.getSelectedItem()).getValue();
if(c.equals("MAKE")){
return logoObj.getText()+"=addons.logo("+makeW.getValue()+","+makeH.getValue()+"); "
+ logoObj.getText()+".setClosedCanvas("+closedCanvas.isSelected()+");";
... |
977b1047-6d69-4877-8e71-12ca25cd4cd9 | 6 | @Override
public void update( float delta )
{
SphereCollider spheres[] = new SphereCollider[6];
spheres[0] = new SphereCollider( player.getTransform().getPos(), 150 );
spheres[1] = new SphereCollider( player.getTransform().getPos(), 100 );
spheres[2] = new SphereCollider( player.getTransform().getPos(), 75 );... |
adc3a758-0d8c-40c7-9764-54d9ac358c61 | 2 | public Repl(Class<? extends Visitor<S, T>> vClass) {
this.interp = null;
evalClass = vClass;
try {
interp = evalClass.newInstance();
} catch (InstantiationException | IllegalAccessException ie) {
System.err.println(ie.getMessage());
System.err.println(... |
cf51ffe3-e370-408a-bef3-047678aa319e | 3 | public List getAll() throws SQLException {
Session session = null;
List list = new ArrayList();
try {
session = HibernateUtil.getInstance().openSession();
list = session.createCriteria(EmployeeModel.class).list();
} catch (Exception e) {
JOptionPane.s... |
2a547033-01ea-4211-8348-a55936b246cc | 5 | public String toString () {
if (size == 0) return "{}";
StringBuilder buffer = new StringBuilder(32);
buffer.append('{');
K[] keyTable = this.keyTable;
int[] valueTable = this.valueTable;
int i = keyTable.length;
while (i-- > 0) {
K key = keyTable[i];
if (key == null) continue;
buffer.append(key)... |
6b9a5975-4a3f-425d-86f9-85eed83f6777 | 8 | private void calcDeriv(){
if(this.numerDiffFlag){
// Numerical differentiation using delta and interpolation
this.cs = new CubicSpline(this.x, this.y);
double[] xjp1 = new double[this.nPoints];
double[] xjm1 = new double[this.nPoints];
... |
d774ea63-b18d-4890-bdb5-3ed866be4b79 | 4 | public Candlestick constroiCandleParaData(Calendar data,
List<Negocio> negocios) {
if(negocios.isEmpty())
return new Candlestick(0,0,0,0,0,data);
double maximo = negocios.get(0).getPreco();
double minimo = negocios.get(0).getPreco();
double volume = 0;
for (Negocio negocio : negocios) {
v... |
72f69d18-188e-4cd4-8d4c-bdef58713fcb | 7 | @Override
public void appliquerReglesLocalesDeValidation(String[] categoriesReconnues) {
//Validation de la date pour cycle. La date est valide entre 1er
//avril 2012 et 1er avril 2014. Le reste n'est pas valide.
Date dateMinConv = new Date();
Date dateMaxCo... |
11063363-93f1-426e-a3ef-9b338593068e | 1 | @Override
public void setState(Map<String, Object> state) {
this.state = state;
this.showInfoArea(state);
this.showHistoryArea(state);
this.showFeedbackArea(state);
this.updateMessageArea("");
this.input = "";
this.inputInfoArea.clear();
this.enableClicks = false;
currentState = (S... |
33cd7c5b-f87f-47a9-8131-5f0221290134 | 1 | @Override
public void update() {
for(Particle p:particles){
p.update();
}
} |
72f560ae-501a-4b25-801c-bfafa3239379 | 4 | public static void sobreescribirFichero(Map<String,Cliente> array){
try{
FileWriter fichero=new FileWriter("src/Ficheros/Clientes.txt");
PrintWriter pw=new PrintWriter(fichero);
float aux_cuenta_corriente=0, aux_cuenta_ahorro=0, aux_penalizacion=0;
Iterator it=array.entrySet().iterator();
w... |
001916e4-f4ff-4d13-a8fa-4975de6153dc | 6 | static final ItemDefinition itemDefinitionForID(int i) {
ItemDefinition itemDefinition = (ItemDefinition) Class13.itemDefinitionNodes.getObjectForID(i);
if (itemDefinition != null) {
return itemDefinition;
}
byte abyte0[] = Class142_Sub10.aClass73_3362.method774(Class77.metho... |
581ad9ad-a797-4ad8-8f35-e0d7dce1d34c | 5 | private void cleanup() {
try
{
if (this.inputListener.isAlive())
{
this.inputListener.interrupt();
}
if (!this.socket.isInputShutdown())
{
this.socket.getInputStream().close();
}
... |
01f3ae3e-62b3-45a0-b4f2-c3bc0381cdfe | 0 | public void addNodeAfter(int item)
{
link = new IntNode(item, link);
} |
2f46d397-f04c-4d20-8210-5ca386cb4ed2 | 9 | private static Moves performCleanupStep2(BotState state, Moves movesSoFar) {
Moves out = new Moves();
boolean meaningfulMovePresent = false;
for (AttackTransferMove attackTransferMove : movesSoFar.attackTransferMoves) {
if (!attackTransferMove.getToRegion().getPlayerName().equals(state.getMyPlayerName())) {
... |
8422dcba-9fb1-46b3-9aac-3112dbbe3968 | 7 | static private final boolean cvc(int i)
{ if (i < 2 || !cons(i) || cons(i-1) || !cons(i-2)) return false;
{ int ch = b[i];
if (ch == 'w' || ch == 'x' || ch == 'y') return false;
}
return true;
} |
8f598617-339d-4540-ac5b-cb1178a0374e | 7 | public Shell open(Display display) {
// Load the images
Class<HoverHelp> clazz = HoverHelp.class;
try {
if (images == null) {
images = new Image[imageLocations.length];
for (int i = 0; i < imageLocations.length; ++i) {
InputStream stream = clazz.getResourceAsStream(imageLocations[i]);
... |
9e053ae1-b4c3-4186-a20f-1492b19f924c | 5 | public void addPlugin(JPanel panel, PluginArea placement){
if(panel != null){
panel.setBackground(Constants.GUI_BACKGROUND);
if(placement == PluginArea.SEARCH){
this.topPanel.add(panel, BorderLayout.EAST);
} else {
if(placement == PluginArea.LEFT_TOP){
this.layers[0].stopAndRemove();
this.... |
9a4ccd1c-95bf-4da4-80ea-38e889a72063 | 8 | public static void main(String[] args) throws Throwable{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
Comparator<int[]> comp = new Comparator<int[]>() {
public int compare(int[] o1, int[] o2) {
if(o1[0]<o2[0])return -1;
if(o1[0]>o2[0])return 1;
return -1;
}
};
Stri... |
5be4907c-6afc-463b-bd4b-b49c310a9f24 | 7 | public static Stella_Object accessMarkerTableSlotValue(MarkerTable self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Logic.SYM_LOGIC_TEST_TABLE) {
if (setvalueP) {
self.testTable = ((HashTable)(value));
}
else {
value = self.testTable;
}
}
... |
60aa0d5b-6dc8-41a4-93a7-06fd613f89f6 | 5 | public Object match(final String path) {
if (rules.containsKey(path)) {
return rules.get(path);
}
int n = path.lastIndexOf('/');
for (Iterator it = lpatterns.iterator(); it.hasNext();) {
String pattern = (String) it.next();
if (path.substring(n).endsWith(pattern)) {
return rules.get(patter... |
e3466c72-8e26-4189-9387-2e514cc9b899 | 5 | @Override
public long[] run(String query) {
FUNCTION_NAME = "PRM";
query = query.toUpperCase();
boolean state = true;
SQLParser parser = new SQLParser();
state &= parser.parse(query + ".txt"); // file name
wrieteGlobalInfoToHDFS(parser);
long[] time = new long[4];
long startTime = new Date().getTim... |
df030563-114e-463b-b7f5-8f539370f3c3 | 6 | @Override
public void getInput() {
int selection = -1;
boolean isValid = false;
do {
this.displayMenu();
Scanner input = SnakeWithPartner.getInFile();
do {
try {
selection = input.nextInt();
isValid ... |
e87260fd-01e9-4a9a-88e1-48ea8e09846e | 3 | @Action(name = "hcomponent.handler.onkeydown.invoke", args = { "undefined" })
public void onKeyDownInvoke(Updates updates, String[] args, String param) {
HComponent<?> html = (HComponent<?>) Session.getCurrent().get(
"_hcomponent.object." + param);
if (html.getOnKeyDownListener() != null)
Session.getCurrent... |
639db4ca-8973-4adb-991a-4ed7d1cd22dd | 1 | private boolean jj_3R_87() {
if (jj_scan_token(INTEGER_LITERAL)) return true;
return false;
} |
7d051f62-8b95-400e-a6de-eed0528dbe75 | 5 | public static String getTruncatedPathName(String pathNameString, String truncationString) {
// we keep info thru the first directory
// then separator..separator
// then filename
// if just two separators in pathname, we do nothing
// c:\foo.txt
// one separator, do nothing
// c:\moo\foo.txt
//... |
84d387a4-6359-4d3e-a133-f02d46ee0843 | 1 | @Test
public void executeScenario() throws UnknownHostException {
logger_.info("[Repair Scenario 4 Start] Peer on \"1\" repairs subtree on \"0\"");
Injector injector = ScenarioSharedState.getInjector();
localPeerContextInit(injector);
LocalPeerContext context = injector.getInstance(... |
14e68607-57c9-4bec-b37e-e5cd2a1055c6 | 2 | @Override
public GetGameModelResponse getGameModel(int version, String cookie) {
ArrayList<Pair<String,String>> requestHeaders = new ArrayList<Pair<String,String>>();
requestHeaders.add(new Pair<String,String>(COOKIE_STR, cookie));
ICommandResponse response = this.clientCommunicator.executeCommand(RequestType.GE... |
1521a2c2-108c-4722-8d75-2224f2a766ac | 6 | @Override
public void perform(CommandSender sender, String[] args) {
if (args.length < 3)
{
inform(sender, "Usage: /give <player> <badge>");
}
Player player = Bukkit.getPlayerExact(args[1]);
try
{
badge = Badge.fromInt(Integer.parseInt(args[2]));
}
catch (NumberFormatException e)
{
badge ... |
1225be2b-2b3d-42de-9327-d0f4c0682f8d | 2 | private void validateVertex(int v) {
if (v < 0 || v >= V)
throw new IndexOutOfBoundsException("vertex " + v + " is not between 0 and " + (V-1));
} |
92304d07-869d-4f9d-94b3-c5558ff57b7d | 3 | void begin() {
while(true){
if(toDo.isEmpty() == true){
toDo.addAll(done);
toDo.add(new DefaultState(as));
done.clear();
}
if(toDo.peek() == null){
toDo.remove();
}
else{
toDo.peek().show();
done.add(toDo.poll().next());
}
}
} |
ec85de06-e480-4bcf-8922-cd164e342f5b | 5 | public void filter(byte[] samples, int offset, int length) {
if (source == null || listener == null) {
// nothing to filter - return
return;
}
// calculate the listener's distance from the sound source
float dx = (source.getX() - listener.getX());
float ... |
91c898a0-3f0e-41b3-986a-2eebfd30eaae | 0 | public static void main(String[] args) {
new _6_Initialization();
} |
1f5ef34f-c35a-4662-bce5-c14557526784 | 2 | public final void startup(CmdLine cmdLine) {
if (mHasStarted) {
System.err.println(getClass().getSimpleName() + ".startup(...) may only be called once."); //$NON-NLS-1$
} else {
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
configureApplication(cmdLine);
LaunchProxy.... |
72a44337-ffe3-425e-97af-fddf67830f1f | 7 | @Override
public String process(HttpServletRequest request)
throws MissingRequiredParameter {
String password = request.getParameter("password");
String name = request.getParameter("name");
String surname = request.getParameter("surname");
String email = request.getParameter("email");
int idtipo = 3;
... |
ee2cbca1-1299-46d8-846f-66ca5e5e1f45 | 0 | public static void main(String[] args) {
DotThis dt = new DotThis();
Inner dti = dt.inner();
dti.outer().f();
} |
7792dbbe-50f9-459c-8ac2-c068f1ea61a1 | 1 | public static boolean isValidName(String name) {
if (name == null) {
return false;
}
return name.length() > 3;
} |
c2cfd361-a67d-4a67-9248-fea91893844f | 8 | public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Starting Threads");
System.out.println("*******************************************");
Thread.yield();
final ArrayList<Integer> _al;
ArrayList<Integer> _bl = new ArrayList<Integer>();
for(int index = 0; index<1... |
0868f59d-9d7e-4aec-b7aa-226b2568ac0b | 2 | public boolean filter(List<String> allowedFrameElements){
boolean result = false;
Iterator<String> iter = frameElements.keySet().iterator();
while (iter.hasNext()) {
if(allowedFrameElements.contains(iter.next())){
result = true;
}else{
iter.remove();
}
}
return result;
} |
f3c7a0b5-d723-491d-b891-60a3c3101b8a | 2 | @Test
public void testCustomUserAgentParsing() {
// Test limited to the big browser families. As Camino can not be detected any longer, the second best match is Firefox3 (a child of Firefox).
for (String agentString : camino2) {
assertEquals(Browser.FIREFOX3, Browser.parseUserAgentString(agentString,Arrays.asLi... |
3421d2c7-3292-48fa-9d49-59817ca207c9 | 4 | public void addStudent(Student student) throws IllegalArgumentException {
// Student names must be unique. This is because of a bug in JComboBox where
// getSelectedIndex() returns the first index that contains the name of
// the selected item: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4133743
// I ... |
49678b26-10c5-4308-bce1-08f22eae27ec | 9 | public static String getPrimitiveName(char c) {
switch (c) {
case 'B':
return "byte";
case 'C':
return "char";
case 'D':
return "double";
case 'F':
return "float";
case 'I':
return "int";
case 'J':
... |
cfc2bb6b-7c9a-4727-a66e-56f5894f2943 | 3 | @SuppressWarnings("unchecked")
@Override
public double getScore(Object userAnswer) {
if (userAnswer == null)
return 0;
String ans = (String) userAnswer;
ArrayList<String> trueAns = (ArrayList<String>) answer;
for (int i = 0; i < trueAns.size(); i++) {
if (trueAns.get(i).equals(ans))
return score;
... |
c2d883f6-24fc-4067-a99f-122d0d6aeb1d | 4 | protected void handleObject(Object obj) {
if (obj == null)
return;
if (associatedMethods.get(obj.getClass()) == null)
return;
try {
associatedMethods.get(obj.getClass()).invoke(this, obj);
} catch (IllegalAccessException e) {
e.printStackTr... |
5e0941f9-e8a2-4327-942a-8b9edd0c3ec5 | 6 | public void updateMailToAndCc(String to, String cc) {
Address[] receiverAddress = createAddressFromStandardString(to);
if (receiverAddress == null) {
//如果没有设置收件人,则直接发送给发件人
try {
receiverAddress = mMailMessage.getFrom();
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.print... |
f7509117-a0ca-4ac5-a273-9b40fbba2216 | 7 | @SuppressWarnings("rawtypes")
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
Player player = (Player) sender;
ChatColor blue = ChatColor.AQUA;
ChatColor gold = ChatColor.GOLD;
if (player.hasPermission("skeptermod.usecommand.smclear")
|| (player.isOp())); {... |
26258c51-51be-4a83-af1c-cb26699588c1 | 5 | public void checkNext() {
if (this.proceedToNext()) {
this.cardBot.sendMessage("##cah", Colors.BOLD + "All players have submitted their cards." + Colors.NORMAL + " Time for " + this.czar.getName() + " to pick the winning card.");
this.cardBot.sendMessage("##cah", this.blackCard.getColore... |
d9222829-bf1f-4f1e-87c1-e62e19bf60dc | 4 | public void draw(Graphics g)
{
printLEDNumbers();
if (isAlive && !isPaused)
{
advance();
}
else if (isAlive && isPaused)
{
g.setColor(Color.red);
g.drawString("PAUSED", 200, 40);
}
else
{
g.setColor(Color.red);
g.drawString("GAME OVER (press 'N' for new game)", 200, 40);
}
//board.... |
f5c80bbb-0c72-49e0-8dee-cdcfd395efca | 3 | public void removeSetting(String key) {
if (getValue(key).equals("null"))
return;
synchronized(settings) {
for (int i = 0; i < settings.size(); i++) {
if (settings.get(i).split("=")[0].trim().equalsIgnoreCase(key)) {
settings.remove(i);
break;
}
}
}
} |
82a7d155-91cb-40ee-9cd6-c5e07cb4e9fa | 3 | @SuppressWarnings("resource")
@Override
public JsonObject getData() {
JsonObject json = new JsonObject();
checkFile(config.getPath());
File file = new File(this.config.getPath());
try {
if(file.isFile()){
json = read(file);
}else{
json = readFiles();
}
} catch (FileNotFoundExc... |
30e69993-b037-4d71-a059-5c9d17ac9dc5 | 9 | @Deprecated
public static String eventuallyRemoveStartingAndEndingDoubleQuote(String s) {
if (s.length() > 1 && isDoubleQuote(s.charAt(0)) && isDoubleQuote(s.charAt(s.length() - 1))) {
return s.substring(1, s.length() - 1);
}
if (s.startsWith("(") && s.endsWith(")")) {
return s.substring(1, s.length() - 1)... |
333950aa-0f10-4596-bbfc-a35e529b06d7 | 9 | List<Equipo> getEquipos(String categoriaId, String deporteId) {
List<Equipo> listaEquipos=null;
String tituloDeporte="deporteId";
Map<String, Equipo> mapaEquipos = new HashMap();
Categoria categoria = torneos.getCategoria(categoriaId);
String tituloCategoria = categoria... |
a1c39487-3206-4b79-b306-813b6c168c76 | 7 | public void doSave() {
UserBean userBean = (UserBean) BeanHelper.getBean("userBean");
//load unitate into hashmap
List<Unitate> unitateList = userBean.getUser().getSirues().getUnitateList();
HashMap<String, Long> siruesMap = new HashMap<>();
HashMap<Long, Integer> countMap = ne... |
e6d7ccdd-18c7-41bb-a950-144091278868 | 5 | @Override
protected Void doInBackground() {
final int BUFFER_SIZE = 2048;
BufferedInputStream bis = null;
ByteArrayOutputStream baos;
String prefix = ConfigManager.getInstance().getClientPrefix();
String addr = ConfigManager.getInstance().getProperties().getProperty("update... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.