method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
abacdfd7-bfa1-4183-ab03-0856345569ab | 2 | @Override
public int hashCode() {
int result = key != null ? key.hashCode() : 0;
result = 31 * result + (value != null ? value.hashCode() : 0);
return result;
} |
5b24fc2f-0aa0-42fc-b710-a4a8520691ff | 1 | public void visit_istore(final Instruction inst) {
stackHeight -= 1;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
} |
3ca81e22-5609-4ee3-9623-76daccfa1d56 | 5 | @Override
public void handle(KeyEvent keyEvent) {
KeyCode code = keyEvent.getCode();
if (keyEvent.isShortcutDown()) {
if (code.getName().equals("P")) {
BoardPage bp = new BoardPage("New page", 4, 4);
pagesPane.getTabs().add(bp);
} else if (cod... |
41327a7b-c5a7-48b8-8979-77c3f6468445 | 7 | public void run() {
String[] args = new String[2];
if (main.list.getSelectedValues().size() > 0) {
if (main.list.getPictures().length != main.list.getSelectedValues().size()) {
int response = JOptionPane.showConfirmDialog(main.list, main.mes.getString("Generator.23"), main.me... |
123b24a0-3253-408f-832c-752367d7bf2e | 4 | @Override
public void deserialize(Buffer buf) {
livingUID = buf.readInt();
if (livingUID < 0)
throw new RuntimeException("Forbidden value on livingUID = " + livingUID + ", it doesn't respect the following condition : livingUID < 0");
livingPosition = buf.readUByte();
if (... |
e98eb358-d0b5-4216-95fb-797f7b1519a8 | 9 | @Override
public SymbolInfo Execute(RuntimeContext cont) throws Exception {
SymbolInfo m_cond = cond.Evaluate(cont);
if ((m_cond == null) || (m_cond.Type != TypeInfo.TYPE_BOOL)) {
return null;
}
SymbolInfo ret = null;
if (m_cond.BoolValue == true) {
fo... |
59c94b2a-439b-47f8-ae8f-729743a062ac | 8 | public void map(LongWritable key, Text value, OutputCollector<Text, IntWritable> output,Reporter reporter)
throws IOException {
String line = value.toString();
String[] words = line.split(",");
int flag = 0, i = 0;
for(i=0;i<MAX_RULE && flag==0;i++)
{
... |
486b28e8-2d8c-4129-bb91-2119661bcca3 | 9 | public boolean processEvent(Sim_event ev){
int src_id = -1;
Message msg = null;
Message respMsg = null;
if (responder == null){
System.out.println("No responder to deal with auction messages!");
return false;
}
switch ( ev.get_tag()... |
231e4f70-8ecc-424a-acea-d8476f48c457 | 7 | void createResidueHydrogenBond(int indexAminoGroup, int indexCarbonylGroup,
BitSet bsA, BitSet bsB) {
short order;
int aminoBackboneHbondOffset = indexAminoGroup - indexCarbonylGroup;
if (debugHbonds)
Logger.debug("aminoBackboneHbondOffset=" +
... |
af72f6f7-6120-4e39-868e-4c64f409248c | 2 | private void add_to_list(String ch) {
for (int i = 0; i < mylist.size(); i++) {
if (ch.equals(((data) mylist.get(i)).getChar())) {
((data) mylist.get(i)).increment();
return;
}
}
mylist.add(new data(ch));
} |
4fd07d19-6508-4fd0-bf60-6a90a5af64fa | 4 | public String getLocalTime(){
try {
in=new BufferedReader(new FileReader(new File("hosts")));
String line;
while((line=in.readLine())!=null){
if(line.contains(TIMEMARKLOCAL)){
localtime=line.substring(TIMEMARKLOCAL.length()+1);
localtime=localtime.substring(0,localtime.indexOf(' '));
}
}... |
3498cb93-10e7-4625-964f-00e8d258dfed | 7 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Venda other = (Venda) obj;
if (this.codigo != other.codigo) {
return false;
}
... |
f50d5856-f103-4c3c-8b9a-de8d6893222b | 9 | private byte filterPLO(int i, int i2, int i3) {
int res = 0;
if ( i > 0 && i2 > 0 && i2 < biHeight - 1) {
int l = getIntVal(i - 1, i2 + 1, i3);
int d = getIntVal(i, i2 - 1, i3);
int ld = getIntVal(i - 1, i2, i3);
if (ld >= l && ld >= d) {
if (l > d) { res = d; } else { res = l; }... |
3fc991b5-215f-402c-923a-290179170cdb | 6 | private List<Class<?>> getAllClassesFromClass(Class<?> cl) {
List<Class<?>> list = new ArrayList<Class<?>>();
list.add(cl);
if(cl.getSuperclass() != null &&
cl.getSuperclass().getPackage().getName().startsWith("com.paynova.api.client")) {
list.addAll(getAllClassesFromClass(cl.getSuperclass()));
}
retu... |
7b991941-e5ed-490a-b758-d2545d8179d2 | 8 | public static void main(String[] args) {
// TODO code application logic here
final JFrame frame = new JFrame("ImgPanel Test Frame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
SetupDialog setupDialog = new SetupDialog(frame);
System.out.println("setupDialog filename "... |
2699e58f-b397-492b-a20b-e3f2f81403f2 | 9 | public boolean spawnPet(int itemId, boolean deleteItem) {
Pets pets = Pets.forId(itemId);
if (pets == null) {
return false;
}
if (player.getPet() != null || player.getFamiliar() != null) {
player.getPackets().sendGameMessage("You already have a follower.");
return true;
}
if (!hasRequirements(pets... |
6cb9c551-1344-459a-9641-4b4991579aab | 8 | public static RankType parseRanking(String rankInput) {
rankInput = rankInput.toLowerCase();
switch (rankInput) {
case "high":
case "hi":
case "h":
return RankType.HI;
case "medium":
case "med":
case "m":
return RankType.MED;
case "low":
case "l":
return RankType.LO;
default:
... |
b829f4f6-47ae-4c4e-bd25-aeb5fa006057 | 6 | public static void main(String[] args) {
ObjectInputStream entrada=null;
ObjectOutputStream salida=null;
try{
System.out.println("Iniciando Servidor...");
ServerSocket elSocket= new ServerSocket(6666);
System.out.println("Escuchando en el puerto 6666");
cliente=elSocket.accept();
System.out.printl... |
5a33884b-8099-40df-be22-6ba1886d9581 | 6 | public boolean updateGameBoxscore(Sport sport, String scheduleID) {
if (scheduleID==null) return false;
String request = null;
switch(sport) {
case NBA: case NHL:
request = "http://api.sportsdatallc.org/" + sport.getName() + "-" + access_level + sport.getVersion() + "/games/" + scheduleID + "/boxscore.x... |
9d5dad7a-883f-48ff-9824-3cab3ed49299 | 6 | public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
... |
ce2879d8-3a7b-4bc4-bab1-6b058c80e187 | 3 | public void copyDirectory(File srcDir, File dstDir) throws IOException {
if (srcDir.isDirectory()) {
if (!dstDir.exists()) {
dstDir.mkdir();
}
String[] children = srcDir.list();
for (int i=0; i<children.length; i++) {
... |
437c15cb-edf0-4db1-8e43-192075bba14c | 0 | private FileUtils() {
} |
89eadade-510d-491b-a932-7f033ef8a934 | 3 | public Class<?> genericsType(Class<?> superClazz) {
if (genericsTypes(superClazz).length == 0) {
return Object.class;
}
return genericsTypes(superClazz)[0];
} |
854f305f-5e4f-412a-8345-236246dbc1d9 | 2 | public static String[] allLowerCase(String... strings){
String[] tmp = new String[strings.length];
for(int idx=0;idx<strings.length;idx++){
if(strings[idx] != null){
tmp[idx] = strings[idx].toLowerCase();
}
}
return tmp;
} |
ce249690-4e9a-4b23-b2aa-1ffca9332f23 | 2 | @Override
protected Duration available() {
Interval outer = new Interval(period.getEnd().minusWeeks(1), period.getEnd());
Duration aDay = new Duration(24 * hoursToMillis);
int overtime = intervals.countDurationInterval(outer, aDay, max);
Duration dayMax;
if (overtime < 2) ... |
2a28a631-2c51-44d8-b9f9-f128801a0bdf | 4 | private void CreateRoot() {
DocumentBuilderFactory docFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder docBuilder;
File b = new File(XMLParser.path + "/root.xml");
if (b.exists())
return;
try {
docBuilder = docFactory.newDocumentBuilder();
// root elements
Document doc = docBu... |
cb233fb4-7354-45b4-aa34-e75bc5b417cf | 3 | public static void main(String args[]){
int cnt = 0;
Random rand = new Random();
while(cnt < 25){
int a = rand.nextInt(56);
if(cnt == 0){
randlist[cnt] = a;
cnt++;
}
else{
if(isExist(a, cnt)){
randlist[cnt] = a;
cnt++;
}
}
}
printContent();
} |
fd02ace2-340a-4556-828a-e1405d5d8096 | 1 | public boolean isCurrent() {
DockContainer dc = getDockContainer();
return dc != null && dc.getCurrentDockable() == mDockable;
} |
8d15713a-cb5f-4746-af80-c0adbea6a23c | 4 | public static boolean isWhitespace(int c){
return c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r';
} |
9c95fc56-7f98-4d62-92de-7fafe0296531 | 6 | public boolean validCellRef(String cellRef) {
boolean valid = false;
String numbers = "0123456789";
String letters = "ABCDEFGH";
if(cellRef.length() == 2)
{
if(letters.indexOf(cellRef.substring(0, 1)) >= 0)
{
if(numbers.indexOf(cellRef.substring(1, 2)) >= 0)
{
valid = true;
}
}
... |
3393ca9c-7eec-40eb-8525-884bfb90001c | 7 | public void append(Object parameter)
{
if(parameter == null)
return;
if(parameter instanceof byte[])
{
byte byteArrarParameter[] = (byte[])parameter;
for(int i = 0; i < byteArrarParameter.length; i++)
{
buffer[++dataSize] = byteArrarParameter[i];
size++;
}
}
else if(parameter instance... |
6758f381-8a2f-4812-b030-dc6c90a33127 | 4 | public synchronized static void updateTaskCompleted(String taskID, String recipientID) {
XStream xstream = new XStream(new DomDriver());
Task[] allTasks = new Task[0];
try {
File file = new File((String) Server.prop.get("taskFilePath"));
allTasks = (Task[]) xstream.fromXML(file);
for (Task task : all... |
2723637c-5922-416b-a843-428fd65f6914 | 2 | @Override
public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String[] args) {
Player p = (Player) sender;
String pName = p.getName();
if(args.length != 0) return false;
if(PlayerChat.plugin.getConfig().getBoolean("ModChat.Enabled", true)) {
ModChat.putModChat(p, pName);
retu... |
80e8dfb5-bfd4-4df1-979a-330ea555c766 | 7 | public void RenderTile(int xp, int yp, Tile tile) {
xp -= xOffset;
yp -= yOffset;
for (int y = 0; y < tile.sprite.SIZE; y++) {
int ya = y + yp;
for (int x = 0; x < tile.sprite.SIZE; x++) {
int xa = x + xp;
if (xa < -tile.sprite.SIZE || xa >= width || ya < 0
|| ya >= height)
break;
if ... |
38b87d26-2265-4dc8-af3a-dc513b4db82a | 7 | public final boolean isNumericType() {
switch (id) {
case TypeIds.T_int:
case TypeIds.T_float:
case TypeIds.T_double:
case TypeIds.T_short:
case TypeIds.T_byte:
case TypeIds.T_long:
case TypeIds.T_char:
return true;
default:
return false;
}
} |
81367b6a-74ff-480f-b204-c4ef663c0658 | 8 | @Override
public void caseAClassdecl(AClassdecl node)
{
for(int i=0;i<indent;i++) System.out.print(" ");
indent++;
System.out.println("(ClassDeclSimpe");
inAClassdecl(node);
if(node.getClasstag() != null)
{
node.getClasstag().apply(this);
}
if(n... |
89f31848-38aa-470d-bb99-df765052413d | 0 | public void setKing(Position position, boolean color){
board[position.getY()][position.getX()]= new King(color);
} |
19fdb453-0607-4df4-9e1e-e0ffdbd8c296 | 1 | public byte[] readCluster(int clusterNum) {
byte[] bytesOfCluster = new byte[BPB_BytsPerSec];
int firstByteOfCluster = (clusterNum + firstDataSector - 2) * BPB_BytsPerSec;
for (int i = firstByteOfCluster; i < firstByteOfCluster + BPB_BytsPerSec; i++) {
bytesOfCluster[i-firstByteOfClu... |
e1408eae-978e-42af-8117-70b6dae1c680 | 1 | public void testConstructor_ObjectStringEx4() throws Throwable {
try {
new YearMonth("10:20:30.040+14:00");
fail();
} catch (IllegalArgumentException ex) {
// expected
}
} |
03f645fc-def6-4bdc-9f6c-9c4eff845859 | 1 | public MidiPlayer() {
try {
sequencer = MidiSystem.getSequencer();
sequencer.open();
sequencer.addMetaEventListener(this);
}
catch ( MidiUnavailableException ex) {
sequencer = null;
}
} |
0ed67375-b3f0-48ee-8d22-9eeccb5ef25d | 7 | public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof XYBoxAndWhiskerRenderer)) {
return false;
}
if (!super.equals(obj)) {
return false;
}
XYBoxAndWhiskerRenderer that = (XYBoxAndWhiskerRend... |
3ff7e9f0-b907-43c5-b5a0-9774f4b35d2d | 6 | public static void printTypes(Type[] types, String pre, String sep, String suf, boolean isDefinition) {
if (pre.equals(" extends ") && Arrays.equals(types, new Type[] { Object.class })) {
return;
}
if (types.length > 0) {
System.out.print(pre);
}
for (int ... |
70fec094-6b71-4f75-9b8e-773eac67adfd | 7 | public List<List<Rate>> getAllGameCombinationWithSure() {
if (sourceGameList == null || sourceGameList.size() == 0) {
return null;
}
Game gameSureGame = null;
for (Game game : sourceGameList) {
if (game.isSure()) {
gameSureGame = game;
System.out.println("breaking");
break;
}
System.o... |
d4c42610-c5ed-4df1-94af-e70511bff016 | 5 | private void callSmoothZoom(double mouseX, double mouseY, int wheelRotation) {
final double coordX = mouseX;
final double coordY = mouseY;
if (wheelRotation < 0) {
if (timerDoneOut != 0) {
timerDoneOut = 0;
timer.cancel();
timer.purge()... |
b93d2317-5400-4d88-bf8c-7cb20357ae54 | 3 | public ModelingEngine(Library library, Scheme scheme, SignalBundle signals, String diagrams, String logs) throws ModelingException {
if(library == null) {
throw new ModelingException(0x11);
} else {
this.library = library;
}
if(scheme == null) {
throw ... |
620b7c2a-2419-45d6-9a7a-60951cf5cf10 | 8 | private String handleCreate(String cmd) {
String[] arg = cmd.split("\\s+");
if (arg.length == 1) {
return " usage: new [param | dim | array]\n";
}
if (arg[1].startsWith("p")) { // create param
if (arg.length < 3) {
return " usage: new... |
349d270e-6045-4b6d-94d5-bd2c784d810e | 2 | public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
int hundredth = (orientation == SwingConstants.VERTICAL ?
getParent().getHeight() : getParent().getWidth()) / 100;
return (hundredth == 0 ? 1 : hundredth);
} |
f886b420-83fe-4f56-84ff-6fabe3d74a13 | 9 | public String splitIndex(String s){
String x[]=s.split(",");
String title="";
for(int i=0;i<x.length;i++){ //finding index of name and address
if(x[i].contains("name")){
name_index=i;
}
if(x[i].contains("address")){
addr... |
10ca2045-af3a-4109-8d30-733b2590fe9d | 9 | public static void main (String argv[]) {
// create scanner that reads from standard input
Scanner scanner = new Scanner(System.in);
if (argv.length > 2) {
System.err.println("Usage: java Main " + "[-d]");
System.exit(1);
}
// if commandline option -d is provided, debug the scanner
if (argv.length ==... |
e1ec6f28-e467-4ebd-a585-246298567c20 | 6 | public Inicio() {
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
... |
d8224638-668c-42f2-91c7-e49204bc9124 | 9 | public String getMessage() {
if (!specialConstructor) {
return super.getMessage();
}
String expected = "";
int maxSize = 0;
for (int i = 0; i < expectedTokenSequences.length; i++) {
if (maxSize < expectedTokenSequences[i].length) {
maxSize ... |
b4712b45-ffc4-404f-96b4-6cd5ea44a7f9 | 7 | public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
if(snakeGame.isStarted()) {
if(snakeGame.isPause()) {
drawPauseMenu(g2);
} else if(snakeGame.isPause() == false) {
drawCurrentGame(g2);
}
} else if(snakeGame.isFinishedBlink1()){
dr... |
9d39edc3-c0d6-4a19-8793-1a6de7dd960c | 2 | public static BigDecimal String2BigDecimal(String str)
{
BigDecimal bigDecimal = null;
if (str != null && str.trim().length() != 0)
{
bigDecimal = new BigDecimal(str);
}
return bigDecimal;
} |
3749ec04-0efb-40f8-b817-71465dd351d5 | 4 | public static void order()
{
int[] array={3,2,4,1,5,7,6,8,9};
int length=array.length;
for (int i = 0; i < length-1; i++)
{
for(int j=0;j<i;j++)
{
if(array[j+1]<array[j])
{
int temp=array[j];
array[j]=array[j+1];
array[j+1]=temp;
}
... |
2a2a6d3a-5a75-4549-9320-0032a8b4bd2f | 5 | private void playerChecker() {
CollisionResults results = new CollisionResults();
Vector3f ppos = playerData.getPosition();
Vector3f pdir = playerData.getDirection();
Ray ray = new Ray(ppos, pdir);
rootNode.collideWith(ray, results);
for (int i = 0; i < results.size(); i++) {
float dist = results.getColl... |
39473a40-a213-4651-b26b-af2063b5eb68 | 9 | public static boolean isValid(ArrayList<Binding> bindings) {
WebServer.logDebug("Called isValid with " + bindings.toString());
HashMap<String, Integer> CompletelyReservedPorts = new HashMap<String, Integer>();
for (int i = 0; i < bindings.size(); i++) {
if (bindings.get(i).domain.eq... |
72dd1a71-7d14-4511-ab79-4d11e752648c | 2 | private static void create() throws Exception
{
Gui.progressBar.setValue(85);
FileWriter fileWriter = new FileWriter(newFile);
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
for (int i = 1; i < 141; ++i)
{
bufferedWriter.write(ConfigTextFilter.splitString[i]);
bufferedWriter.ne... |
36df0847-8c59-4928-a41a-2ee547a0b16a | 8 | protected void ressource(){ // s'il n'y a plus d'arbre sur le terrain alors j'en refait !
if (this.nb_arbre < this.nb_arbre_min){
Random r = new Random();
int valeur ;
int valeur2 ;
for (int i = 0 ; i < this.nb_arbre_max ; i++){
valeur = r.nextInt(this.longueur);
valeur2... |
9f780aa3-9917-4923-ab66-103b37d19091 | 2 | public static void main(String[] args) {
int i;
float inputs06[] = {
20, 22, 21, 24, 24, 23, 25, 26, 20, 24,
26, 26, 25, 27, 28, 27, 29, 27, 25, 24
};
float inputs10[] = {
20, 22, 24, 25, 23, 26, 28, 26, 29, 27... |
56806b92-ad90-4d1b-9199-c45c282a9abb | 7 | private boolean ValidarPaciente(Paciente p) throws ObjetoNuloException,
ValorInvalidoException {
if (p == null) {
throw new ObjetoNuloException("Paciente nulo");
}
/*
* if (p.getId() == null || p.getId() < 0) { throw new
* ValorInvalidoException( "o identificador do paciente é invalido!"); }
*/
... |
c0b495d1-1237-4c46-b663-e4710d97078f | 0 | public String getConsumerKey() {
return consumerKey;
} |
fed20587-3e54-48df-96d4-73fa2bbac024 | 1 | public void accept() throws IOException {
// Get a new channel for the connection request
SocketChannel sChannel = _ssChannel.accept();
// If serverSocketChannel is non-blocking, sChannel may be null
if (sChannel != null) {
SocketAddress address = sChannel.socket().getRemoteSocketAddress();
System.out.p... |
779df592-b13f-4068-9698-1bb84294cc96 | 6 | public static Object[][] readXML(String path) {
try {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory
.newDocumentBuilder();
Document doc = documentBuilder.parse(path);
Element item = null;
NodeLis... |
c0f9fe42-58aa-4b50-8257-629cdcb7dbfa | 6 | public static void main (String[] args){
Date[] fecha;
JSONParser parser = new JSONParser();
Espectaculo espectaculo;
/**
* Se leen los datos del archivo JSON. El archivo contiene lo necesario para la simulación.
*/
try {
JSONObject escenario = (JS... |
8a768f47-5c35-41f4-8a2b-246bc759aa46 | 6 | public String[] getPlayImage() {
String[] r = new String[6];
switch (playFrameCounter) {
case 0:
r[0] = " ;~~,__ ";
r[1] = ":-....,-------'`-'._.'";
r[2] = " `-,,, , ,'~~' ";
r[3] = " ; ,'~.__; / ";
r[4] = " :| :| ";
r[5] = " `-' `-' ";
... |
33292931-39e9-4658-bb92-9dc466128829 | 4 | public void runFileCopyClient() {
long startTime = System.currentTimeMillis();
//init Socket
try {
socket = new DatagramSocket();
} catch (SocketException e) {
System.out.println("Have Problem with init Socket");
e.printStackTrace();
}
... |
7cdd9fb1-9ecb-4a70-bbbc-69aec08d42e0 | 0 | public void teste(){
} |
ac7b3750-b296-418b-8dbf-d4a870b6c7ab | 7 | public long skip(long amount) throws IOException {
if (amount < 0) {
throw new IllegalArgumentException();
}
synchronized (lock) {
if (isClosed()) {
throw new IOException("Reader is closed"); //$NON-NLS-1$
}
if (amount < 1) {
... |
e75bb1be-5554-4f31-bdfe-09c4d0a446c1 | 3 | public boolean cambiarestadoSeriales(entidadPrestamo datosPrestmo) {
conectarse();
boolean retornarObj = false;
String regser = "update tbl_seriales set Estado = ? where Seriales = ?";
ArrayList seriales_recorrer = datosPrestmo.getSeriales();
String estado = datosPrestmo.getEst... |
ebe0301f-df61-41c1-8b61-8c4436c1325b | 8 | public void setDireccao(char novaDireccao)
{
if( (this.direccao == 'u' && novaDireccao == 'd') ||
(this.direccao == 'd' && novaDireccao == 'u') ||
(this.direccao == 'l' && novaDireccao == 'r') ||
(this.direccao == 'r' && novaDireccao == 'l') )
{
return;
}
this.direccao = novaDireccao;
} |
7c1232c3-2812-4ae7-8519-311f04dad99e | 3 | @Override
public Class getColumnClass(int column) {
Class returnValue;
if ((column >= 0) && (column < getColumnCount())) {
if (getValueAt(0, column) == null) {
return String.class;
}
returnValue = getValueAt(0, column).getClass();
} else {
... |
117dd660-c389-43c3-967f-7c41af40543b | 8 | public static void main(String[] args) throws BadStateMachineSpecification, InvalidEventException, InterruptedException {
ExecutorService pool = Executors.newFixedThreadPool(4);
FSMThreadPoolFacade<PerformanceEnum>[] concurrentFSM = new FSMThreadPoolFacade[FSMS];
CountDownLatch latch = new CountDo... |
4757376a-19af-4881-af28-89b40c5d3180 | 3 | public static void premain( String agentArgs, Instrumentation inst ) throws Exception
{
InputStream input = findConfiguration( agentArgs );
if (input == null)
{
throw new IOException( "The specified configuration was not found on the file-system in the current-working-directory, inside an... |
128f08e2-3eb6-435a-9463-bc1cc4e01471 | 9 | public static TestCase getTestCase(HashMap<String, String> row)
{
TestCase tc = new TestCase();
if(row!=null && row.size() > 0)
{
if(row.containsKey("TESTCASE"))
tc.setTestCaseNumber(row.get("TESTCASE"));
if(row.containsKey("TYPE"))
tc.setType(row.get("TYPE"));
if(row.containsKey("SOURCEORG"))
... |
0bec69b7-00fd-4198-826c-ea413f5c77e5 | 4 | public void saveValues() {
FileWriter fw;
try {
fw = new FileWriter(configFile);
} catch (IOException e) {
e.printStackTrace();
System.err.println("Critical error attempting to save the server configuration. Stopping the server...");
System.exit(0);
return;
}
PrintWriter pw = new PrintWriter(fw... |
b92fab23-0c8b-4d0e-8736-63dbb1ce904a | 8 | private void checkLocation(WorldLocation l) {
if (!checkedLocations.contains(l)) {
if (l.getTile().canItemAlgorithmPass()) {
newLocations.add(l);
if (possibleItems.contains(l)) {
itemLocations.add(l);
}
} else if (l.getM... |
3d238546-16da-4543-8547-bbd4182b9d1f | 6 | public void discoverChildren() {
if(!this.storeFile.exists())
return;
try {
BufferedReader in=new BufferedReader(new FileReader(storeFile));
String line;
while((line=in.readLine())!=null) {
if(line.length()==0) // skip empty lines
continue;
if(line.charAt(0)=='#') // skip comment lines
... |
663fd3d0-918b-4078-9df9-838e5bf2f011 | 4 | public com.novativa.www.ws.streamsterapi.Position[] getPositions() throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[1]);
... |
d80d272f-6760-4a16-9135-f1004d710b16 | 7 | private static void readStuFile(String stuFileName) {
try {
EasyReader input = new EasyReader(stuFileName);
if (input.bad()) {
System.err.println("Can't open " + stuFileName);
System.exit(1);
}
Vector lineOfWords = new Vector();
String tmpWord = "";
input.readLine(); // Gets rid of column ... |
f3af0f98-29b4-47f9-8fd7-753266262f3c | 2 | public void deleteByUserNameAndParticipantName(String userName, String participantName) {
EntityManager em = PersistenceManager.createEntityManager();
try {
em.getTransaction().begin();
List<Openchatroom> ochrs = em.createNamedQuery("Openchatroom.GetByUserAndParticipant", Openchatroom.class)
.setPara... |
f2f1918f-1f42-4ff2-8301-49ec23223dd6 | 4 | private Zyg genZygote(int n)
{
String bin = convertBin(n,l);
String[] b = new String[g.length];
//This is the symbolic binary permutation.
for(int i=0;i<g.length;i++)
{ b[i] = bin.substring(i,i+1); }
//this is going to be the list of characters that will... |
7c60f566-c3cd-4074-b45d-a6a165dd728d | 5 | public void jugar() {
if (MiSistema.turno == 0) {
if (Domino.listaTablero.size() == 0) {//De de tirar un par
this.empezarDoble();
} else {
this.heuristica1();
}
}
if (Domino.listaTablero.size() != 0) {
... |
1c64c206-c9b0-4cf1-bf2e-354c3ac9af71 | 8 | public static ArrayList sentenceSplit(ArrayList arraylist, String s)
{
ArrayList arraylist1 = new ArrayList();
int i = s.length();
if(i == 0)
{
arraylist1.add("");
return arraylist1;
}
ArrayList arraylist2 = new ArrayList();
for(Iterato... |
3329e58f-5a0f-4da5-b405-171c0299ebb6 | 0 | public void setDescription(String lastName) {
this.description = lastName;
} |
7a5417c5-31b6-4b93-a031-37fa43676b44 | 4 | LabFactoryProperties()
{
final InputStream rsFromContext = Thread.currentThread().getContextClassLoader().getResourceAsStream(RESOURCE_FACTORY);
if ( rsFromContext != null ) {
LOGGER.trace("Resource found in Thread Context");
}
final InputStream resourceStream = (rsFromContext==null) ? ClassLoader.getSystemCla... |
d6659404-b8d7-44a1-bda0-033b9a1f36ab | 9 | public boolean printCheck(boolean trim, int xoldpoint, int xnewpoint, int yoldpoint, int ynewpoint){
boolean btest2=true;
if(trim){
if(xoldpoint<xBot)btest2=false;
if(xoldpoint>xTop)btest2=false;
if(xnewpoint<xBot)btest2=false;
if(xnewpoint>xTo... |
f67c8002-740d-4948-b5e2-befc598f627f | 2 | public static Shader buildShader(final String shaderFile, final ShaderType shaderType)
{
try
{
final ByteBuffer fileBuffer = FileReader.readFile(shaderFile);
final int shaderID = glCreateShader(shaderType.getShaderTypeID());
glShaderSource(shaderID, fileBuffer);
glCompileShader(shaderID);
if (glGe... |
e4250a9f-89c8-4d64-887c-aa0a1cc9f0d5 | 0 | public void setView(FindReplaceResultsDialog view) {
this.view = view;
} |
b7e95605-978b-481e-92f7-3ea514f74847 | 2 | public boolean isHidden(Component component) {
if (component instanceof DockTab) {
return mHidden.contains(component);
}
if (component == this) {
return !hasHidden();
}
return false;
} |
78b5a169-b7bf-4a8e-b213-f34d371f9f1a | 4 | public void removePath(final Block callerBlock, final Block returnBlock) {
for (int i = 0; i < paths.size(); i++) {
final Block[] path = (Block[]) paths.get(i);
if ((path[0] == callerBlock) && (path[1] == returnBlock)) {
if (FlowGraph.DEBUG) {
System.out.println("removing path " + path[0] + " -> "
... |
1cdc5146-03c5-497c-b285-136047cf9260 | 2 | private static ArrayList<HashMap<String, String>> getExs(String attribute,
String vk, ArrayList<HashMap<String, String>> examples) {
ArrayList<HashMap<String, String>> exs = new ArrayList<HashMap<String, String>>();
for (HashMap<String, String> example : examples) {
if (example.get(attribute).equals(vk)) {
... |
7a5d63ae-4e52-4d1a-9d57-cf7f102f27c8 | 1 | public void pausePaallePois() {
if (this.pause) {
this.pause = false;
} else {
this.pause = true;
}
} |
d2df6d6e-187d-44b0-9a90-1570c1607360 | 2 | public static void main(String args[]){
System.out.println("Input the values");
Scanner sc=new Scanner(System.in);
int lowerLimit=0;
int upperLimit=0;
int length;
int target[] = null;
int dest[] = null;
ArrayList arr=null;
//while(sc.hasNext()){
lowerLimit=sc.nextInt();
upperLimit=sc.nextInt();
... |
f87bc6da-534b-4934-a6e2-95f021186713 | 1 | public void deleteInformations(String[] code)
{
for (int i = 0; i < code.length; i++)
deleteInformation(code[i]);
updateSize();
notifyZElement();
} |
86c50bab-02ec-450c-a4f6-e0f8ec1e35d5 | 1 | public void update(int delta){
updateOval(delta);
updateMovement();
if(seenButtonTime>0){
seenButtonTime -= delta*0.01f;
}else{
seenButtonTime = 30;
}
} |
c5d5f030-8578-4203-841b-4b68c7bdfb17 | 1 | private static URL __getWsdlLocation() {
if (AQUARIUSPUBLISHSERVICE_EXCEPTION!= null) {
throw AQUARIUSPUBLISHSERVICE_EXCEPTION;
}
return AQUARIUSPUBLISHSERVICE_WSDL_LOCATION;
} |
c3ddcce5-8898-404c-b99c-3ef132ee4090 | 1 | public String getEntityPublicId(String ename)
{
Object entity[] = (Object[]) entityInfo.get(ename);
if (entity == null) {
return null;
} else {
return (String) entity[1];
}
} |
b711e122-49eb-4fce-a78f-5563293554b4 | 6 | public TreeMap<Integer, Integer> getPowersOfTwoDecomposition(BigInteger x) {
// Special Cases
if (x.compareTo(BigInteger.ZERO) == 0) {
return null;
}
TreeMap<Integer, Integer> result = new TreeMap<Integer, Integer>();
if (x.compareTo(BigInteger.ONE) == 0) {
... |
5a9f7abd-8d94-4834-a332-d4223f38168b | 9 | public void readFunction(Element function) throws MaltChainedException {
boolean hasSubFunctions = function.getAttribute("hasSubFunctions").equalsIgnoreCase("true");
boolean hasFactory = false;
if (function.getAttribute("hasFactory").length() > 0) {
hasFactory = function.getAttribute("hasFactory").equalsIgn... |
65931f16-af63-45de-bde3-db714822ef71 | 7 | @Override
public Integer insert(TipoUsuarioBeans tipouser) throws DAOException {
PreparedStatement pst = null;
ResultSet generatedKeys = null;
try {
pst = con.prepareStatement(sql.getString("INSERT_USUARIO"),
Statement.RETURN_GENERATED_KEYS);
pst.setInt(1, tipouser.getId_tipo());
pst.setS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.