rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
if ( umaskCmd != null ) { mkdirCmd = umaskCmd + "; " + mkdirCmd; } | public void put( File source, String destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( destination ); firePutInitiated( resource, source ); if ( !source.exists() ) { throw new Trans... | |
String q1 = SystemGlobals.getSql("GenericModel.selectByLimit"); String q2 = SystemGlobals.getSql("PostModel.selectAllByTopicByLimit"); PreparedStatement p = JForum.getConnection().prepareStatement(q1 + " " + count + " " + q2, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); p.setInt(1, topicId); | String top = SystemGlobals.getSql("GenericModel.selectByLimit"); PreparedStatement p = JForum.getConnection().prepareStatement(top + " " + count + " " + SystemGlobals.getSql("PostModel.selectAllByTopicByLimit1") + " " + top + " " + startFrom + " " + SystemGlobals.getSql("PostModel.selectAllByTopicByLimit2"), ResultSe... | public List selectAllByTopicByLimit(int topicId, int startFrom, int count) throws Exception { List l = new ArrayList(); String q1 = SystemGlobals.getSql("GenericModel.selectByLimit"); String q2 = SystemGlobals.getSql("PostModel.selectAllByTopicByLimit"); PreparedStatement p = JForum.getConnection().prepareStatem... |
if (website != null && !website.toLowerCase().startsWith("http: | if (website != null && !"".equals(website) && !website.toLowerCase().startsWith("http: | public static List saveUser(int userId) throws Exception { UserModel um = DataAccessDriver.getInstance().newUserModel(); User u = um.selectById(userId); String username = JForum.getRequest().getParameter("username"); if (username != null) { u.setUsername(username); } u.setId(userId); u.setEmail(JForum.get... |
assertEquals(1, self.getEmailAddresses().length); assertEquals(this.pers.getEmail(), self.getEmailAddresses()[0]); | assertEquals(1, self.getEmailAddresses().size()); assertEquals(this.pers.getEmail(), self.getEmailAddresses().get(0)); | public void testGetSelf() throws Exception { Self self = this.pers.getAccountMgr().getSelf(); assertEquals(this.pers.getId(), self.getId()); assertEquals(this.pers.getName(), self.getName()); assertEquals(1, self.getEmailAddresses().length); assertEquals(this.pers.getEmail(), self.getEmailAddresses()[0]); assert... |
ITypedRegion partition = document.getPartition(offset); | ITypedRegion partition = SchemeTextUtilities.getPartition(document, offset); | public static void addSections(IDocument document, List nodes) throws BadLocationException, BadPositionCategoryException { Position position; int offset = 0; int documentLength = document.getLength(); while (offset < documentLength) { ITypedRegion partition = document.getPartition(offset); ... |
this.available = Backend.instance().getListMgr().getAvailableFilters(this.listId); this.enabled = Backend.instance().getListMgr().getEnabledFilters(this.listId); | Filters filters = Backend.instance().getListMgr().getFilters(this.listId); this.getCtx().setModel(filters); | public void execute() throws Exception { this.available = Backend.instance().getListMgr().getAvailableFilters(this.listId); this.enabled = Backend.instance().getListMgr().getEnabledFilters(this.listId); } |
decl.setContext(context); | public JExpression analyse(CExpressionContext context) throws PositionedError { TypeFactory factory = context.getTypeFactory(); context = new CExpressionContext(context, context.getEnvironment()); prefix = prefix.analyse(context); check( context, prefix.getTy... | |
robocode.util.Utils.centerShow(editor, console); | Utils.centerShow(editor, console); | public void compile(String fileName) { if (fileName.indexOf(" ") >= 0) { fileName = "\"" + fileName + "\""; } ConsoleDialog console; if (editor != null) { console = new ConsoleDialog(editor, "Compiling", false); } else { console = new ConsoleDialog(); } console.setSize(500, 400); console.setText("Compili... |
checked=true; | public CSourceMethod checkInterface(CClassContext context) throws PositionedError { FjClassContext caesarContext = (FjClassContext) context; CBinaryTypeContext typeContext = new CBinaryTypeContext( context.getClassReader(), context.getTypeFactory(), context, typeVariables, (modifiers & ACC_STATIC)... | |
if(thisOuterChain.length == 1 && contextOuterChain.length==2) { System.out.println("stop here"); } | public CaesarTypeNode getTypeInContextOf(CaesarTypeNode n) { // top level class, no redefinition possible if(enclosedBy.size() == 0) return this; List l1 = new LinkedList(); List l2 = new LinkedList(); // generated lists genOuterList(l1); n.genOuterList(l2); ... | |
oDatabaseId = poLine.substring(i + 1).trim(); | oDatabaseId = poLine.substring(i + 1); while(true){ try{ poLine = oContents.readLine(); if(poLine.startsWith("Searching")){ break; }else{ oDatabaseId = oDatabaseId.concat(poLine); } }catch(java.io.IOException x){ System.err.println(x.getMessage()); System.err.println("File read interrupted"); } } | private void interpret(String poLine) throws SAXException { if (iState == IN_HEADER) { //accumulate header information //things that can end header section //start of summmary section //start of detail section //start of trailer when there are no hits ... |
RolesRepository.clear(); | public void insertSave() throws Exception { Forum f = new Forum(); f.setDescription(this.request.getParameter("description")); f.setIdCategories(this.request.getIntParameter("categories_id")); f.setName(this.request.getParameter("forum_name")); f.setModerated("1".equals(this.request.getParameter("moderate"))); ... | |
public void delete() throws Exception | public void delete() | public void delete() throws Exception { if (!SessionFacade.isLogged()) { this.setTemplateName(ViewCommon.contextToLogin()); return; } String ids[] = this.request.getParameterValues("id"); if (ids != null && ids.length > 0) { PrivateMessage[] pm = new PrivateMessage[ids.length]; User u = new User(); u... |
public void findUser() throws Exception | public void findUser() | public void findUser() throws Exception { boolean showResult = false; String username = this.request.getParameter("username"); if (username != null && !username.equals("")) { List namesList = DataAccessDriver.getInstance().newUserDAO().findByName(username, false); this.context.put("namesList", namesList); sho... |
public void inbox() throws Exception | public void inbox() | public void inbox() throws Exception { if (!SessionFacade.isLogged()) { this.setTemplateName(ViewCommon.contextToLogin()); return; } User user = new User(); user.setId(SessionFacade.getUserSession().getUserId()); List pmList = DataAccessDriver.getInstance().newPrivateMessageDAO().selectFromInbox(user); t... |
public void list() throws Exception | public void list() | public void list() throws Exception { this.inbox(); } |
public void quote() throws Exception | public void quote() | public void quote() throws Exception { if (!SessionFacade.isLogged()) { this.setTemplateName(ViewCommon.contextToLogin()); return; } int id = this.request.getIntParameter("id"); PrivateMessage pm = new PrivateMessage(); pm.setId(id); pm = DataAccessDriver.getInstance().newPrivateMessageDAO().selectById(p... |
public void read() throws Exception | public void read() | public void read() throws Exception { if (!SessionFacade.isLogged()) { this.setTemplateName(ViewCommon.contextToLogin()); return; } int id = this.request.getIntParameter("id"); PrivateMessage pm = new PrivateMessage(); pm.setId(id); pm = DataAccessDriver.getInstance().newPrivateMessageDAO().selectById(... |
public void reply() throws Exception | public void reply() | public void reply() throws Exception { if (!SessionFacade.isLogged()) { this.setTemplateName(ViewCommon.contextToLogin()); return; } int id = this.request.getIntParameter("id"); PrivateMessage pm = new PrivateMessage(); pm.setId(id); pm = DataAccessDriver.getInstance().newPrivateMessageDAO().selectById(p... |
public void review() throws Exception | public void review() | public void review() throws Exception { this.read(); this.setTemplateName(TemplateKeys.PM_READ_REVIEW); } |
public void send() throws Exception | public void send() | public void send() throws Exception { if (!SessionFacade.isLogged()) { this.setTemplateName(ViewCommon.contextToLogin()); return; } User user = DataAccessDriver.getInstance().newUserDAO().selectById( SessionFacade.getUserSession().getUserId()); ViewCommon.prepareUserSignature(user); this.sendFormCommon(... |
public void sendSave() throws Exception | public void sendSave() | public void sendSave() throws Exception { if (!SessionFacade.isLogged()) { this.setTemplateName(ViewCommon.contextToLogin()); return; } UserDAO userDao = DataAccessDriver.getInstance().newUserDAO(); String toUserIdStr = this.request.getParameter("toUserId"); String toUsername = this.request.getParameter("... |
public void sendTo() throws Exception | public void sendTo() | public void sendTo() throws Exception { if (!SessionFacade.isLogged()) { this.setTemplateName(ViewCommon.contextToLogin()); return; } User user = DataAccessDriver.getInstance().newUserDAO().selectById( SessionFacade.getUserSession().getUserId()); int userId = this.request.getIntParameter("user_id"); if... |
public void sentbox() throws Exception | public void sentbox() | public void sentbox() throws Exception { if (!SessionFacade.isLogged()) { this.setTemplateName(ViewCommon.contextToLogin()); return; } User user = new User(); user.setId(SessionFacade.getUserSession().getUserId()); List pmList = DataAccessDriver.getInstance().newPrivateMessageDAO().selectFromSent(user); ... |
protected void join(JCompilationUnit cunit) { | public void join(JCompilationUnit cunit) { | protected void join(JCompilationUnit cunit) { try { cunit.join(this); } catch (PositionedError e) { reportTrouble(e); } } |
msg.getTextParts()); | msg.getTextParts(), attachments); | protected MailData makeMailData(Mail raw, boolean showEmail) { try { InternetAddress addy = raw.getFromAddress(); SubEthaMessage msg = new SubEthaMessage(this.mailSession, raw.getContent()); return new MailData( raw.getId(), raw.getSubject(), showEmail ? addy.getAddress() : null, addy.getP... |
ITypedRegion partition = document.getPartition(command.offset); | ITypedRegion partition = SchemeTextUtilities.getPartition(document, command.offset); | public void customizeDocumentCommand(IDocument document, DocumentCommand command) { if (command.text.length() != 0) return; if (command.length != 1) return; try { ITypedRegion partition = document.getPartition(command.offset); if (partition.getType() ... |
ResidueList rl = residueListForLabel(label); alphaList.add(rl.alphabet()); if(length == -1) { length = rl.length(); } else { if(rl.length() != length) { | try { ResidueList rl = residueListForLabel(label); alphaList.add(rl.alphabet()); if(length == -1) { length = rl.length(); } else { if(rl.length() != length) { throw new IllegalArgumentException( "All ResidueLists must be the same length (" + length + "), not " + rl.length() ); } } } catch (NoSuchElementException nsee) ... | public SimpleAlignment(Map labelToResList) throws IllegalArgumentException { this.labels = Collections.unmodifiableList(new ArrayList(labelToResList.keySet())); this.labelToResidueList = labelToResList; length = -1; List alphaList = new ArrayList(); for(Iterator li = labels.iterator(); li.hasNext()... |
"All ResidueLists must be the same length (" + length + "), not " + rl.length() | "The residue list associated with " + label + " is null" | public SimpleAlignment(Map labelToResList) throws IllegalArgumentException { this.labels = Collections.unmodifiableList(new ArrayList(labelToResList.keySet())); this.labelToResidueList = labelToResList; length = -1; List alphaList = new ArrayList(); for(Iterator li = labels.iterator(); li.hasNext()... |
} else { throw new BioError(nsee, "Something is screwey - map is lieing about key/values"); | public SimpleAlignment(Map labelToResList) throws IllegalArgumentException { this.labels = Collections.unmodifiableList(new ArrayList(labelToResList.keySet())); this.labelToResidueList = labelToResList; length = -1; List alphaList = new ArrayList(); for(Iterator li = labels.iterator(); li.hasNext()... | |
System.out.println(":foo"); | public void foo(String s) { result.append(":foo"); System.out.println(":foo"); } | |
transferEvent.getResource() + | transferEvent.getResource().getName() + | public void transferStarted( final TransferEvent transferEvent ) { timestamp = transferEvent.getTimestamp(); transfer = 0; if( transferEvent.getRequestType() == TransferEvent.REQUEST_GET ) { final String message = "Downloading: " + transferEve... |
if (mReplInput.checkError()) { try { mInstance.terminate(); } catch (DebugException exception) { } } | public void write(String input) throws IOException { mReplInput.print(input); } | |
ftp.makeDirectory( dirs[i] ); | boolean dirChanged = ftp.changeWorkingDirectory( dirs[i] ); | public void fillOutputData( OutputData outputData ) throws TransferFailedException { OutputStream os; Resource resource = outputData.getResource(); try { String[] dirs = PathUtils.dirnames( resource.getName() ); for ( int i = 0; i < dirs.length; i++ ) ... |
boolean dirChanged = ftp.changeWorkingDirectory( dirs[i] ); | if ( !dirChanged ) { boolean success = ftp.makeDirectory( dirs[i] ); if ( success ) { if ( permissions != null && permissions.getGroup() != null ) { ftp.sendSiteCommand( "CHGRP " + permissions.getGroup() ); } if ( permissions != null && permissions.getDirectoryMode() != null ) { ftp.sendSiteCommand( "CHMOD " + per... | public void fillOutputData( OutputData outputData ) throws TransferFailedException { OutputStream os; Resource resource = outputData.getResource(); try { String[] dirs = PathUtils.dirnames( resource.getName() ); for ( int i = 0; i < dirs.length; i++ ) ... |
ftp.changeWorkingDirectory( ".." ); | if ( !ftp.changeWorkingDirectory( ".." ) ) { throw new TransferFailedException( "Unable to return to the base directory" ); } | public void fillOutputData( OutputData outputData ) throws TransferFailedException { OutputStream os; Resource resource = outputData.getResource(); try { String[] dirs = PathUtils.dirnames( resource.getName() ); for ( int i = 0; i < dirs.length; i++ ) ... |
+ "/testProvider/testFactory/connection-10/session-0/browser-0[source=mockQueue]" + CR | + "/testProvider/testFactory/connection-10/session-0/browser-0[(source mockQueue)]" + CR | public void testRecurseListingAddsSessionListings() { StringWriter sw = new StringWriter(); String expectedOutput = createSomeSessions(); addDefaultTestBrowser(); expectedOutput = expectedOutput + CR + "/testProvider/testFactory/connection-10/session-1" + CR ... |
return null; /* LOCAL VARIABLES NOT USED | public final LocalVariableInfo[] getLocalVariableInfos() { return null; /* LOCAL VARIABLES NOT USED if (locals.size() == 0) { return null; } Vector compress = new Vector(); Enumeration stacks = locals.elements(); while (stacks.hasMoreElements()) { Stack current = (Stack)stacks.nextEleme... | |
LOCAL VARIABLES NOT USED */ | public final LocalVariableInfo[] getLocalVariableInfos() { return null; /* LOCAL VARIABLES NOT USED if (locals.size() == 0) { return null; } Vector compress = new Vector(); Enumeration stacks = locals.elements(); while (stacks.hasMoreElements()) { Stack current = (Stack)stacks.nextEleme... | |
super(); | public FileSelector( boolean directoriesOnly ) { this.directoriesOnly = directoriesOnly; initComponents(); } | |
public static void main( String[] args ) { | public static void main( final String[] args ) { | public static void main( String[] args ) { FileSelector fs = new FileSelector( true ); JFrame f = new JFrame(); f.setSize( 640, 480 ); JScrollPane scrollPane = new JScrollPane(); scrollPane.setViewportView( fs ); f.getContentPane().add( scrollPane ); f.setVisible( tr... |
String subjectID = (String) subHitData.get("HitId"); | String subjectID = (String) hitData.get("subjectId"); | private Homology makeHomology() throws BioException { subHitData.putAll(resultData); subHitData.putAll(hitData); if (tokenParser == null) { String identifier; // Try explicit sequence type first if (subHitData.containsKey("hitSequenceType")) ... |
Integer.valueOf(rank), Integer.valueOf(this.rank) | new Integer(rank), new Integer(this.rank) | public void setRank(int rank) throws ChangeVetoException { if(!this.hasListeners(RichFeature.RANK)) { this.rank = rank; } else { ChangeEvent ce = new ChangeEvent( this, RichFeature.RANK, Integer.valueOf(rank), ... |
temp.append((String) key); | temp.append(key.toString()); | private String sequenceBufferCreator(Object key, Object value) { StringBuffer temp = new StringBuffer(); if (value == null) { // FIXME: (kj) unsafe cast to String temp.append((String) key); } else if (value instanceof ArrayList) { Iterator iter = ((ArrayL... |
temp.append((String) key + " " + iter.next()); | temp.append(key.toString() + " " + iter.next()); | private String sequenceBufferCreator(Object key, Object value) { StringBuffer temp = new StringBuffer(); if (value == null) { // FIXME: (kj) unsafe cast to String temp.append((String) key); } else if (value instanceof ArrayList) { Iterator iter = ((ArrayL... |
} | private String sequenceBufferCreator(Object key, Object value) { StringBuffer temp = new StringBuffer(); if (value == null) { // FIXME: (kj) unsafe cast to String temp.append((String) key); } else if (value instanceof ArrayList) { Iterator iter = ((ArrayL... | |
public PrivateMessage selectById(PrivateMessage pm) throws Exception | public PrivateMessage selectById(PrivateMessage pm) | public PrivateMessage selectById(PrivateMessage pm) throws Exception { PreparedStatement p = null; p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PrivateMessageModel.selectById"), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); p.setInt(1, pm.getId()); R... |
p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PrivateMessageModel.selectById"), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); p.setInt(1, pm.getId()); ResultSet rs = null; rs = p.executeQuery(); if (rs.next()) { pm = this.getPm(rs); } rs.close(); p.close(); retu... | ResultSet rs = null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PrivateMessageModel.selectById"), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); p.setInt(1, pm.getId()); rs = p.executeQuery(); if (rs.next()) { pm = this.getPm(rs); } return pm; } catch (SQ... | public PrivateMessage selectById(PrivateMessage pm) throws Exception { PreparedStatement p = null; p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PrivateMessageModel.selectById"), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); p.setInt(1, pm.getId()); R... |
if (o instanceof CLineError){ | if (!(o instanceof CWarning)) { | private void checkErrors(MessageDescription[] expected){ List errors = new LinkedList(); for (Iterator iter = positionedErrorList.iterator(); iter.hasNext();) { Object o = iter.next(); if (o instanceof CLineError){ errors.add(o); } } Positi... |
assertTrue("No errors found.", found.length > 0); assertTrue("Less/more errors than expected.", expected.length == found.length); for (int i = 0; i < found.length; i++) { assertTrue("Unexpected error occured.", expected[i] == found[i].getFormattedMessage().getDescription() ); | if(found.length == 0) fail("No errors found : "+getId()+" : "+getDescription()); if(expected.length != found.length) fail("More ("+errors.size()+") errors found than expected: "+getId()+" : "+getDescription()); for (int i = 0; i < found.length; i++) { if(!(expected[i] == found[i].getFormattedMessage().getDescription(... | private void checkErrors(MessageDescription[] expected){ List errors = new LinkedList(); for (Iterator iter = positionedErrorList.iterator(); iter.hasNext();) { Object o = iter.next(); if (o instanceof CLineError){ errors.add(o); } } Positi... |
mail.getReplies().clear(); | public Long deleteMail(Long mailId) throws NotFoundException, PermissionException { Mail mail = this.getMailFor(mailId, Permission.DELETE_ARCHIVES); // Make all the children belong to the parent Mail parent = mail.getParent(); if (parent != null) parent.getReplies().remove(mail); for (Mail child: mail.get... | |
boundingBox = new Rectangle2D.Float(); | boundingBox = new BoundingRectangle(); | public RobotPeer(RobotClassManager robotClassManager, RobotRepositoryManager robotManager, long fileSystemQuota) { super(); this.robotClassManager = robotClassManager; robotThreadManager = new RobotThreadManager(this); robotFileSystemManager = new RobotFileSystemManager(this, fileSystemQuota); eventManager = new ... |
synchronized (this) { inCollision = false; } | inCollision = false; | public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an... |
RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); | RobotPeer r = battle.getRobots().elementAt(i); | public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an... |
synchronized (this) { | public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an... | |
inCollision = true; | velocity = 0; | public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an... |
} if (inCollision) { velocity = 0; setEnergy(energy - Rules.ROBOT_HIT_DAMAGE); | this.setEnergy(energy - Rules.ROBOT_HIT_DAMAGE); r.setEnergy(r.energy - Rules.ROBOT_HIT_DAMAGE); r.statistics.damagedByRamming(Rules.ROBOT_HIT_DAMAGE); this.inCollision = true; | public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an... |
r.setEnergy(r.energy - Rules.ROBOT_HIT_DAMAGE); r.statistics.damagedByRamming(Rules.ROBOT_HIT_DAMAGE); if (r.energy == 0 && !r.isDead) { r.setDead(true); statistics.scoreKilledEnemyRamming(i); | if (r.energy == 0) { if (!r.isDead) { r.setDead(true); statistics.scoreKilledEnemyRamming(i); } | public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an... |
robotState = ROBOT_STATE_HIT_ROBOT; | public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an... | |
} eventManager.add(new HitRobotEvent(r.getName(), normalRelativeAngle(angle - heading), r.energy, atFault)); r.eventManager.add( new HitRobotEvent(getName(), normalRelativeAngle(PI + angle - r.heading), energy, false)); | eventManager.add( new HitRobotEvent(r.getName(), normalRelativeAngle(angle - heading), r.energy, atFault)); r.eventManager.add( new HitRobotEvent(getName(), normalRelativeAngle(PI + angle - r.heading), energy, false)); | public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an... |
if (inCollision) { robotState = ROBOT_STATE_HIT_ROBOT; } | public void checkRobotCollision() { synchronized (this) { inCollision = false; } for (int i = 0; i < battle.getRobots().size(); i++) { RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); if (!(r == null || r == this || r.isDead) && boundingBox.intersects(r.boundingBox)) { // Bounce back double an... | |
double fixx = 0, fixy = 0, angle = 0; | double fixx = 0.0, fixy = 0.0; double angle = 0.0; | public void checkWallCollision() { boolean hitWall = false; double fixx = 0, fixy = 0, angle = 0; if (boundingBox.getX() + boundingBox.width > battleField.getBoundingBox().getX() + battleField.getBoundingBox().getWidth()) { hitWall = true; fixx = battleField.getBoundingBox().getX() + battleField.getBoundingB... |
if (boundingBox.getX() + boundingBox.width | if (boundingBox.x + boundingBox.width | public void checkWallCollision() { boolean hitWall = false; double fixx = 0, fixy = 0, angle = 0; if (boundingBox.getX() + boundingBox.width > battleField.getBoundingBox().getX() + battleField.getBoundingBox().getWidth()) { hitWall = true; fixx = battleField.getBoundingBox().getX() + battleField.getBoundingB... |
eventManager.add(new HitWallEvent(angle)); | public void checkWallCollision() { boolean hitWall = false; double fixx = 0, fixy = 0, angle = 0; if (boundingBox.getX() + boundingBox.width > battleField.getBoundingBox().getX() + battleField.getBoundingBox().getWidth()) { hitWall = true; fixx = battleField.getBoundingBox().getX() + battleField.getBoundingB... | |
public Rectangle2D.Float getBoundingBox() { | public BoundingRectangle getBoundingBox() { | public Rectangle2D.Float getBoundingBox() { return boundingBox; } |
public Arc2D.Double getScanArc() { | public Arc2D getScanArc() { | public Arc2D.Double getScanArc() { return scanArc; } |
public synchronized void initialize(double x, double y, double heading) { | public void initialize(double x, double y, double heading) { | public synchronized void initialize(double x, double y, double heading) { isDead = false; isWinner = false; this.x = lastX = x; this.y = lastY = y; this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; acceleration = 0; velocity = 0; if (isTeamLeader() ... |
this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; | this.heading = gunHeading = radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; | public synchronized void initialize(double x, double y, double heading) { isDead = false; isWinner = false; this.x = lastX = x; this.y = lastY = y; this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; acceleration = 0; velocity = 0; if (isTeamLeader() ... |
acceleration = 0; velocity = 0; | acceleration = velocity = 0; | public synchronized void initialize(double x, double y, double heading) { isDead = false; isWinner = false; this.x = lastX = x; this.y = lastY = y; this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; acceleration = 0; velocity = 0; if (isTeamLeader() ... |
gunHeat = 3; distanceRemaining = 0; turnRemaining = 0; gunTurnRemaining = 0; radarTurnRemaining = 0; | distanceRemaining = turnRemaining = gunTurnRemaining = radarTurnRemaining = 0; | public synchronized void initialize(double x, double y, double heading) { isDead = false; isWinner = false; this.x = lastX = x; this.y = lastY = y; this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; acceleration = 0; velocity = 0; if (isTeamLeader() ... |
isStopped = false; | isStopped = scan = halt = inCollision = false; | public synchronized void initialize(double x, double y, double heading) { isDead = false; isWinner = false; this.x = lastX = x; this.y = lastY = y; this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; acceleration = 0; velocity = 0; if (isTeamLeader() ... |
scan = false; | public synchronized void initialize(double x, double y, double heading) { isDead = false; isWinner = false; this.x = lastX = x; this.y = lastY = y; this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; acceleration = 0; velocity = 0; if (isTeamLeader() ... | |
halt = false; | public synchronized void initialize(double x, double y, double heading) { isDead = false; isWinner = false; this.x = lastX = x; this.y = lastY = y; this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; acceleration = 0; velocity = 0; if (isTeamLeader() ... | |
inCollision = false; setCallCount = 0; getCallCount = 0; skippedTurns = 0; | setCallCount = getCallCount = skippedTurns = 0; | public synchronized void initialize(double x, double y, double heading) { isDead = false; isWinner = false; this.x = lastX = x; this.y = lastY = y; this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; acceleration = 0; velocity = 0; if (isTeamLeader() ... |
isAdjustGunForBodyTurn = false; isAdjustRadarForGunTurn = false; adjustRadarForBodyTurn = false; adjustRadarForBodyTurnSet = false; | isAdjustGunForBodyTurn = isAdjustRadarForGunTurn = isAdjustRadarForBodyTurn = isAdjustRadarForBodyTurnSet = false; | public synchronized void initialize(double x, double y, double heading) { isDead = false; isWinner = false; this.x = lastX = x; this.y = lastY = y; this.heading = this.gunHeading = this.radarHeading = lastHeading = lastGunHeading = lastRadarHeading = heading; acceleration = 0; velocity = 0; if (isTeamLeader() ... |
public boolean intersectsLine(Rectangle2D.Float r, double x1, double y1, double x2, double y2) { | public boolean intersectsLine(BoundingRectangle r, double x1, double y1, double x2, double y2) { | public boolean intersectsLine(Rectangle2D.Float r, double x1, double y1, double x2, double y2) { int out1, out2; if ((out2 = r.outcode(x2, y2)) == 0) { return true; } while ((out1 = r.outcode(x1, y1)) != 0) { log("testing: " + x1 + "," + y1); if ((out1 & out2) != 0) { return false; } if ((out1 & (Rect... |
x += r.width; | x += r.getWidth(); | public boolean intersectsLine(Rectangle2D.Float r, double x1, double y1, double x2, double y2) { int out1, out2; if ((out2 = r.outcode(x2, y2)) == 0) { return true; } while ((out1 = r.outcode(x1, y1)) != 0) { log("testing: " + x1 + "," + y1); if ((out1 & out2) != 0) { return false; } if ((out1 & (Rect... |
y += r.height; | y += r.getHeight(); | public boolean intersectsLine(Rectangle2D.Float r, double x1, double y1, double x2, double y2) { int out1, out2; if ((out2 = r.outcode(x2, y2)) == 0) { return true; } while ((out1 = r.outcode(x1, y1)) != 0) { log("testing: " + x1 + "," + y1); if ((out1 & out2) != 0) { return false; } if ((out1 & (Rect... |
return adjustRadarForBodyTurn; | return isAdjustRadarForBodyTurn; | public boolean isAdjustRadarForBodyTurn() { return adjustRadarForBodyTurn; } |
return duplicate; | return isDuplicate; | public boolean isDuplicate() { return duplicate; } |
return ioRobot; | return isIORobot; | public boolean isIORobot() { return ioRobot; } |
public synchronized boolean say(String text) { | public boolean say(String text) { | public synchronized boolean say(String text) { if (sayTextPeer == null) { sayTextPeer = new TextPeer(); } if (sayTextPeer.isReady()) { if (text.length() > 100) { return false; } sayTextPeer.setText(getVeryShortName() + ": " + text); sayTextPeer.setX((int) x); sayTextPeer.setY((int) y); sayTextPee... |
RobotPeer r = (RobotPeer) battle.getRobots().elementAt(i); | RobotPeer r = battle.getRobots().elementAt(i); | public void scan() { if (isDroid) { return; } double startAngle = lastRadarHeading; double scanRadians = radarHeading - lastRadarHeading; // Check if we passed through 360 if (scanRadians < -PI) { scanRadians = 2 * PI + scanRadians; } else if (scanRadians > PI) { scanRadians = scanRadians - 2 * PI; } ... |
adjustRadarForBodyTurn = newAdjustRadarForBodyTurn; adjustRadarForBodyTurnSet = true; | isAdjustRadarForBodyTurn = newAdjustRadarForBodyTurn; isAdjustRadarForBodyTurnSet = true; | public synchronized void setAdjustRadarForBodyTurn(boolean newAdjustRadarForBodyTurn) { adjustRadarForBodyTurn = newAdjustRadarForBodyTurn; adjustRadarForBodyTurnSet = true; } |
if (!adjustRadarForBodyTurnSet) { adjustRadarForBodyTurn = newAdjustRadarForGunTurn; | if (!isAdjustRadarForBodyTurnSet) { isAdjustRadarForBodyTurn = newAdjustRadarForGunTurn; | public synchronized void setAdjustRadarForGunTurn(boolean newAdjustRadarForGunTurn) { isAdjustRadarForGunTurn = newAdjustRadarForGunTurn; if (!adjustRadarForBodyTurnSet) { adjustRadarForBodyTurn = newAdjustRadarForGunTurn; } } |
public synchronized void setBattle(Battle newBattle) { | public void setBattle(Battle newBattle) { | public synchronized void setBattle(Battle newBattle) { battle = newBattle; } |
public synchronized void setBattleField(BattleField newBattleField) { | public void setBattleField(BattleField newBattleField) { | public synchronized void setBattleField(BattleField newBattleField) { battleField = newBattleField; } |
public synchronized void setBodyColor(Color color) { | public void setBodyColor(Color color) { | public synchronized void setBodyColor(Color color) { bodyColor = color; } |
public synchronized void setBulletColor(Color color) { | public void setBulletColor(Color color) { | public synchronized void setBulletColor(Color color) { bulletColor = color; } |
public synchronized void setCheckFileQuota(boolean newCheckFileQuota) { | public void setCheckFileQuota(boolean newCheckFileQuota) { | public synchronized void setCheckFileQuota(boolean newCheckFileQuota) { out.println("CheckFileQuota on"); checkFileQuota = newCheckFileQuota; } |
teammate.energy -= 30; | teammate.setEnergy(teammate.energy - 30); | public synchronized void setDead(boolean dead) { if (dead) { battle.resetInactiveTurnCount(10.0); if (!this.isDead) { eventManager.add(new DeathEvent()); if (this.isTeamLeader()) { for (int i = 0; i < teamPeer.size(); i++) { RobotPeer teammate = teamPeer.elementAt(i); if (!teammate.isDead && t... |
sBullet.hitVictim = true; | sBullet.hasHitVictim = true; | public synchronized void setDead(boolean dead) { if (dead) { battle.resetInactiveTurnCount(10.0); if (!this.isDead) { eventManager.add(new DeathEvent()); if (this.isTeamLeader()) { for (int i = 0; i < teamPeer.size(); i++) { RobotPeer teammate = teamPeer.elementAt(i); if (!teammate.isDead && t... |
public synchronized void setDroid(boolean droid) { | public void setDroid(boolean droid) { | public synchronized void setDroid(boolean droid) { this.isDroid = droid; } |
duplicate = true; | isDuplicate = true; | public synchronized void setDuplicate(int count) { duplicate = true; String countString = " (" + (count + 1) + ')'; name = getRobotClassManager().getClassNameManager().getFullClassNameWithVersion() + countString; shortName = getRobotClassManager().getClassNameManager().getUniqueShortClassNameWithVersion() + coun... |
name = getRobotClassManager().getClassNameManager().getFullClassNameWithVersion() + countString; shortName = getRobotClassManager().getClassNameManager().getUniqueShortClassNameWithVersion() + countString; nonVersionedName = getRobotClassManager().getClassNameManager().getFullClassName() + countString; | NameManager cnm = getRobotClassManager().getClassNameManager(); name = cnm.getFullClassNameWithVersion() + countString; shortName = cnm.getUniqueShortClassNameWithVersion() + countString; nonVersionedName = cnm.getFullClassName() + countString; | public synchronized void setDuplicate(int count) { duplicate = true; String countString = " (" + (count + 1) + ')'; name = getRobotClassManager().getClassNameManager().getFullClassNameWithVersion() + countString; shortName = getRobotClassManager().getClassNameManager().getUniqueShortClassNameWithVersion() + coun... |
public synchronized void setGunColor(Color color) { | public void setGunColor(Color color) { | public synchronized void setGunColor(Color color) { gunColor = color; } |
this.ioRobot = ioRobot; | this.isIORobot = ioRobot; | public synchronized void setIORobot(boolean ioRobot) { this.ioRobot = ioRobot; } |
public final void setMove(double distance) { | public final synchronized void setMove(double distance) { | public final void setMove(double distance) { if (energy == 0) { return; } synchronized (this) { distanceRemaining = distance; acceleration = 0; if (distance == 0) { moveDirection = 0; } else if (distance > 0) { moveDirection = 1; } else { moveDirection = -1; } slowingDown = false; } } |
synchronized (this) { distanceRemaining = distance; acceleration = 0; if (distance == 0) { moveDirection = 0; } else if (distance > 0) { moveDirection = 1; } else { moveDirection = -1; } slowingDown = false; | distanceRemaining = distance; acceleration = 0; if (distance == 0) { moveDirection = 0; } else if (distance > 0) { moveDirection = 1; } else { moveDirection = -1; | public final void setMove(double distance) { if (energy == 0) { return; } synchronized (this) { distanceRemaining = distance; acceleration = 0; if (distance == 0) { moveDirection = 0; } else if (distance > 0) { moveDirection = 1; } else { moveDirection = -1; } slowingDown = false; } } |
slowingDown = false; | public final void setMove(double distance) { if (energy == 0) { return; } synchronized (this) { distanceRemaining = distance; acceleration = 0; if (distance == 0) { moveDirection = 0; } else if (distance > 0) { moveDirection = 1; } else { moveDirection = -1; } slowingDown = false; } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.