buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public void execute() throws TaskException { Commandline commandLine = new Commandline(); Project aProj = getProject(); int result = 0; // Default the viewpath to basedir if it is not specified if( getViewPath() == null ) { setViewPath( aProj....
public void execute() throws TaskException { Commandline commandLine = new Commandline(); Project aProj = getProject(); int result = 0; // Default the viewpath to basedir if it is not specified if( getViewPath() == null ) { setViewPath( getBas...
public void execute() throws TaskException { Commandline commandLine = new Commandline(); Project aProj = getProject(); int result = 0; // Default the viewpath to basedir if it is not specified if( getViewPath() == null ) { setViewPath( aProj....
public void execute() throws TaskException { Commandline commandLine = new Commandline(); Project aProj = getProject(); int result = 0; // Default the viewpath to basedir if it is not specified if( getViewPath() == null ) { setViewPath( getBas...
protected int run( Commandline cmd ) throws TaskException { try { Project aProj = getProject(); Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); exe.setAntRun( aProj ); exe.setWorkingDirectory( ...
protected int run( Commandline cmd ) throws TaskException { try { Project aProj = getProject(); Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); exe.setAntRun( aProj ); exe.setWorkingDirectory( ...
protected void prepareExecutor() throws TaskException { // default directory to the project's base directory File dir = _owner.getProject().getBaseDir(); ExecuteStreamHandler handler = new LogStreamHandler( _owner, Proj...
protected void prepareExecutor() throws TaskException { // default directory to the project's base directory File dir = _owner.getBaseDirectory(); ExecuteStreamHandler handler = new LogStreamHandler( _owner, Project.MSG...
public void process( String line ) { if( util.match( "/Change/", line ) ) { //Remove any non-numerical chars - should leave the change number line = util.substitute( "s/[^0-9]//g", line ); ...
public void process( String line ) { if( util.match( "/Change/", line ) ) { //Remove any non-numerical chars - should leave the change number line = util.substitute( "s/[^0-9]//g", line ); ...
public void process( String line ) { log( "P4Counter retrieved line \"" + line + "\"", Project.MSG_VERBOSE ); try { value = Integer.parseInt( line ); my...
public void process( String line ) { log( "P4Counter retrieved line \"" + line + "\"", Project.MSG_VERBOSE ); try { value = Integer.parseInt( line ); se...
protected int runCmd( Commandline cmd, ExecuteStreamHandler out ) throws TaskException { try { Project aProj = getProject(); Execute exe = new Execute( out ); exe.setAntRun( aProj ); exe.setWorkingDirectory( aProj.getBaseDir() ); ...
protected int runCmd( Commandline cmd, ExecuteStreamHandler out ) throws TaskException { try { Project aProj = getProject(); Execute exe = new Execute( out ); exe.setAntRun( aProj ); exe.setWorkingDirectory( getBaseDirectory() ); ...
protected String[] getParameters() throws TaskException { Vector v = new Vector(); if( format != null ) { v.addElement( "-format=" + format ); } if( type != null ) { v.addElement( "-type=" + type ); } if( percent != ...
protected String[] getParameters() throws TaskException { Vector v = new Vector(); if( format != null ) { v.addElement( "-format=" + format ); } if( type != null ) { v.addElement( "-type=" + type ); } if( percent != ...
protected int run( Commandline cmd ) throws TaskException { try { Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WAR...
protected int run( Commandline cmd ) throws TaskException { try { Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WAR...
public String[] listFiles( TaskContext context ) throws TaskException;
String[] listFiles( TaskContext context ) /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache....
public OptionalPackage getOptionalPackage( Extension extension ); }
OptionalPackage getOptionalPackage( Extension extension ); /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ p...
private void printEntry(final PrintWriter output, final CVSEntry entry) { output.println("\t<entry>"); output.println("\t\t<date>" + c_outputDate.format(entry.getDate()) + "</date>"); output.println("\t\t<time>" + c_outputTime.format(entry.getDate()) + "</time>"); ...
private void printEntry(final PrintWriter output, final CVSEntry entry) { output.println("\t<entry>"); output.println("\t\t<date>" + c_outputDate.format(entry.getDate()) + "</date>"); output.println("\t\t<time>" + c_outputTime.format(entry.getDate()) + "</time>"); ...
private static void printTargets(Project project, Vector names, Vector descriptions, String heading, int maxlen) { // now, start printing the targets and their descriptions String lSep = System.getProperty("line.separator"); ...
private static void printTargets(Project project, Vector names, Vector descriptions, String heading, int maxlen) { // now, start printing the targets and their descriptions String lSep = System.getProperty("line.separator"); ...
protected BasicParserConfiguration(SymbolTable symbolTable) { this(null, null); } // <init>(SymbolTable)
protected BasicParserConfiguration(SymbolTable symbolTable) { this(symbolTable, null); } // <init>(SymbolTable)
public boolean validateDrop(IRosterItem rosterItem, int operation, TransferData transferType) { // TODO Auto-generated method stub System.out.println("RosterViewerDropTargetText.validateDrop("+rosterItem+","+operation+","+transferType+")"); if (rosterItem != null && rosterItem instanceof IRosterEntry) return ...
public boolean validateDrop(IRosterItem rosterItem, int operation, TransferData transferType) { // TODO Auto-generated method stub System.out.println("RosterViewerDropTargetText.validateDrop("+rosterItem+","+operation+","+transferType+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ if (rosterIte...
public void addSubResult(SampleResult subResult) { String tn = getThreadName(); if (tn.length()==0) Thread.currentThread().getName();//TODO do this more efficiently subResult.setThreadName(tn); if (subResults == null) { subResults = new ArrayList(); } subResults.add(subResult); setElapsed(...
public void addSubResult(SampleResult subResult) { String tn = getThreadName(); if (tn.length()==0) tn=Thread.currentThread().getName();//TODO do this more efficiently subResult.setThreadName(tn); if (subResults == null) { subResults = new ArrayList(); } subResults.add(subResult); setElaps...
public void setTablength(int tlength) throws BuildException { if (tlength < 2 || (tlength % 2) != 0) { throw new BuildException("tablength must be a positive power of 2", location); } tablength = tlength; }
public void setTablength(int tlength) throws BuildException { if (tlength < 2 || (tlength & (tlength-1)) == 0) { throw new BuildException("tablength must be a positive power of 2", location); } tablength = tlength; }
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if ((style & SWT.SEPARATOR) != 0) { if ((style & SWT.HORIZONTAL) != 0) { width = DEFAULT_WIDTH; height = 3; } else { width = 3; height = DEFAULT_HEIGHT; } } else { if (isImage && image !=...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if ((style & SWT.SEPARATOR) != 0) { if ((style & SWT.HORIZONTAL) != 0) { width = DEFAULT_WIDTH; height = 3; } else { width = 3; height = DEFAULT_HEIGHT; } } else { if (isImage && image !=...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if (txnObject == 0) { Rect rect = new Rect (); OS.GetBestControlRect (handle, rect, null); width = rect.right - rect.left; height = rect.bottom - rect.top; } else { if (OS.VERSION >= 0x1030) { i...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if (txnObject == 0) { Rect rect = new Rect (); OS.GetBestControlRect (handle, rect, null); width = rect.right - rect.left; height = rect.bottom - rect.top; } else { if (OS.VERSION >= 0x1030) { i...
private void performAction(final ActionEvent e) { String actionCommand = e.getActionCommand(); try { try { GuiPackage.getInstance().updateCurrentGui(); } catch (Exception err){ log.error("performAction(" + actionCommand + ") updateCurrentGui() ...
private void performAction(final ActionEvent e) { String actionCommand = e.getActionCommand(); try { try { GuiPackage.getInstance().updateCurrentGui(); } catch (Exception err){ log.error("performAction(" + actionCommand + ") updateCurrentGui() ...
public MarkupContainer(final String id) { super(id); }
public MarkupContainer(final String id) { this(id, null); }
public WebMarkupContainer(final String id) { super(id); }
public WebMarkupContainer(final String id) { this(id, null); }
public WebMarkupContainerWithAssociatedMarkup(final String id) { super(id); }
public WebMarkupContainerWithAssociatedMarkup(final String id) { this(id, null); }
public String toString() { StringBuffer str = new StringBuffer(); appendTypeInfo(str); return str.toString(); } void appendTypeInfo(StringBuffer str) { String contentType[] = {"EMPTY", "SIMPLE", "MIXED", "ELEMENT"}; String derivedBy[] = {"EMPTY", "EXTENSION", "RESTRI...
public String toString() { StringBuffer str = new StringBuffer(); appendTypeInfo(str); return str.toString(); } void appendTypeInfo(StringBuffer str) { String contentType[] = {"EMPTY", "SIMPLE", "ELEMENT", "MIXED"}; String derivedBy[] = {"EMPTY", "EXTENSION", "RESTRI...
private void notifyListeners(List listeners, SampleResult result) { SampleEvent event = new SampleEvent(result, controller.getPropertyAsString(TestElement.NAME)); notifier.notifyListeners(event, listeners); }
private void notifyListeners(List listeners, SampleResult result) { SampleEvent event = new SampleEvent(result, threadGroup.getName()); notifier.notifyListeners(event, listeners); }
public static <T> AjType<T> getAjType(Class<T> fromClass) { if (ajTypes.containsKey(fromClass)) { WeakReference<AjType<T>> weakRefToAjType = (WeakReference<AjType<T>>) ajTypes.get(fromClass); AjType<T> theAjType = weakRefToAjType.get(); if (theAjType != null) { return theAjType; } else { ...
public static <T> AjType<T> getAjType(Class<T> fromClass) { if (ajTypes.containsKey(fromClass)) { WeakReference<AjType> weakRefToAjType = ajTypes.get(fromClass); AjType<T> theAjType = weakRefToAjType.get(); if (theAjType != null) { return theAjType; } else { theAjType = new AjTypeImpl<T>...
public void write(Element element, Writer out, int indent, String indentWith) throws IOException { // Write indent characters for (int i = 0; i < indent; i++) { out.write(indentWith); } // Write element out.write("<"); out....
public void write(Element element, Writer out, int indent, String indentWith) throws IOException { // Write indent characters for (int i = 0; i < indent; i++) { out.write(indentWith); } // Write element out.write("<"); out....
public DocumentFragmentImpl(DocumentImpl ownerDoc) { super(ownerDoc, null, null); }
public DocumentFragmentImpl(DocumentImpl ownerDoc) { super(ownerDoc, null); }
public DocumentImpl(boolean grammarAccess) { super(null,null,null); ownerDocument = this; allowGrammarAccess = grammarAccess; }
public DocumentImpl(boolean grammarAccess) { super(null,null); ownerDocument = this; allowGrammarAccess = grammarAccess; }
public void execute() throws TaskException { if( filename == null ) throw new TaskException( "No filename specified" ); getProject().log( "setting a recorder for name " + filename, Project.MSG_DEBUG ); // get the recorder entry Reco...
public void execute() throws TaskException { if( filename == null ) throw new TaskException( "No filename specified" ); log( "setting a recorder for name " + filename, Project.MSG_DEBUG ); // get the recorder entry RecorderEntry rec...
public String getClassLoaderName() { return ((loader!=null)?loader.getClass().getName()+"@"+Integer.toHexString(loader.hashCode()):"null"); }
public String getClassLoaderName() { return ((loader!=null)?loader.getClass().getName()+"@"+Integer.toHexString(System.identityHashCode(loader)):"null"); }
protected Object formatObj(Object obj) { /* These classes have a safe implementation of toString() */ if (obj == null || obj instanceof String || obj instanceof Number || obj instanceof Boolean || obj instanceof Exception || obj instanceof Character || obj instanceof Class...
protected Object formatObj(Object obj) { /* These classes have a safe implementation of toString() */ if (obj == null || obj instanceof String || obj instanceof Number || obj instanceof Boolean || obj instanceof Exception || obj instanceof Character || obj instanceof Class...
public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); Combo combo = new Combo (shell, SWT.READ_ONLY); combo.setItems (new String [] {"A", "B", "C"}); combo.setSize (200, 200); shell.pack (); shell.open (); while (!shell.isDisposed ()) { if (!display.re...
public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); Combo combo = new Combo (shell, SWT.READ_ONLY); combo.setItems (new String [] {"Alpha", "Bravo", "Charlie"}); combo.setSize (200, 200); shell.pack (); shell.open (); while (!shell.isDisposed ()) { i...
protected void normalizeDocument(CoreDocumentImpl document, DOMConfigurationImpl config) { fDocument = document; fConfiguration = config; fAllWhitespace = false; fNamespaceValidation = false; String xmlVersion = fDocument.getXmlVersion(); String sche...
protected void normalizeDocument(CoreDocumentImpl document, DOMConfigurationImpl config) { fDocument = document; fConfiguration = config; fAllWhitespace = false; fNamespaceValidation = false; String xmlVersion = fDocument.getXmlVersion(); String sche...
public int getViewSize() { int size = this.viewSize; // If model object (list view) == null and viewSize has not been // deliberately changed, than size = 0. Object modelObject = getModelObject(); if ((modelObject == null) && (viewSize == Integer.MAX_VALUE)) { size = 0; } else if (modelObject inst...
public int getViewSize() { int size = this.viewSize; // If model object (list view) == null and viewSize has not been // deliberately changed, than size = 0. Object modelObject = getModelObject(); if ((modelObject == null) && (viewSize == Integer.MAX_VALUE)) { size = 0; } else if (modelObject inst...
protected void fireChatMessage(ID fromID, ID threadID, Type type, String subject, String body, Map properties) { fireMessageEvent(new ChatMessageEvent(fromID, new ChatMessage(threadID, createMessageType(type), subject, body, properties))); }
protected void fireChatMessage(ID fromID, ID threadID, Type type, String subject, String body, Map properties) { fireMessageEvent(new ChatMessageEvent(fromID, new ChatMessage(fromID, threadID, createMessageType(type), subject, body, properties))); }
public void testParseBadPattern() { PatternParser p = new PatternParser("@@Foo"); try { AnnotationTypePattern bad = p.maybeParseAnnotationPattern(); fail("ParserException expected"); } catch(ParserException pEx) { assertEquals("expected name pattern",pEx.getMessage()); } }
public void testParseBadPattern() { PatternParser p = new PatternParser("@@Foo"); try { AnnotationTypePattern bad = p.maybeParseAnnotationPattern(); fail("ParserException expected"); } catch(ParserException pEx) { assertEquals("name pattern",pEx.getMessage()); } }
public void populateItem(Item cellItem, String componentId, IModel rowModel) { cellItem.add(new Label(cellItem, componentId, new PropertyModel(rowModel, property))); }
public void populateItem(Item cellItem, String componentId, IModel rowModel) { new Label(cellItem, componentId, new PropertyModel(rowModel, property)); }
public void populateItem(Item item, String componentId, IModel model) { item.add(new Label(item, componentId, createLabelModel(model))); }
public void populateItem(Item item, String componentId, IModel model) { new Label(item, componentId, createLabelModel(model)); }
protected void addItems(Iterator items) { while (items.hasNext()) { add((Item)items.next()); } }
protected void addItems(Iterator items) { while (items.hasNext()) { ((Item)items.next()).reattach(); } }
protected boolean handleMultiPart() { if (multiPart) { // Change the request to a multipart web request so parameters are // parsed out correctly try { final WebRequest multipartWebRequest = ((WebRequest)getRequest()).newMultipartWebRequest(getMaxSize()); getRequestCycle().setRequest(multipart...
protected boolean handleMultiPart() { if (multiPart && !((WebRequest)getRequest()).isAjax()) { // Change the request to a multipart web request so parameters are // parsed out correctly try { final WebRequest multipartWebRequest = ((WebRequest)getRequest()).newMultipartWebRequest(getMaxSize()); ...
public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String label = "<no message>"; String detail = null; IMessage.Kind kind = IMessage.ERROR; if (value instanceof IMessage) { IMessa...
public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String label = "<no message>"; String detail = null; IMessage.Kind kind = IMessage.ERROR; if (value instanceof IMessage) { IMessa...
protected void populateItem(final ListItem<Access> listItem) { final Access access = listItem.getModelObject(); IPageMapEntry entry = pageMap.getEntry(access.getId()); PageParameters parameters = new PageParameters(); parameters.put("pageId", "" + entry.getNumericId()); parameters.put("pageMap...
protected void populateItem(final ListItem<Access> listItem) { final Access access = listItem.getModelObject(); IPageMapEntry entry = pageMap.getEntry(access.getId()); PageParameters parameters = new PageParameters(); parameters.put("pageId", "" + entry.getNumericId()); parameters.put("pageMap...
public void onClick(AjaxRequestTarget target) { setResponsePage(getPage().rollbackPage(1)); } });
public void onClick(AjaxRequestTarget target) { setResponsePage(getPage()); } });
public void add(Duration duration) { /* * Extracted from * http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes * to ensure implemented properly. See spec for definitions of methods * used in algorithm. * * Given a dateTime S and a duratio...
public void add(Duration duration) { /* * Extracted from * http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes * to ensure implemented properly. See spec for definitions of methods * used in algorithm. * * Given a dateTime S and a duratio...
public final MarkupElement nextTag() throws ParseException { // Get next tag. Null, if no more tag available final ComponentTag tag = (ComponentTag)getParent().nextTag(); if (tag == null) { return tag; } // Only xml tags not already identified as Wicket components will be // considered for autolinki...
public final MarkupElement nextTag() throws ParseException { // Get next tag. Null, if no more tag available final ComponentTag tag = (ComponentTag)getParent().nextTag(); if (tag == null) { return tag; } // Only xml tags not already identified as Wicket components will be // considered for autolinki...
public AllTestsSuite() { super("All Vex Test Suites"); //$NON-NLS-1$ addTest(VEXCoreTestSuite.suite()); // addTest(VexUiTestSuite.suite()); addTestSuite(IconTest.class); addTestSuite(ResourceTrackerTest.class); addTestSuite(FindReplaceTargetTest.class); }
public AllTestsSuite() { super("All Vex Test Suites"); //$NON-NLS-1$ addTest(VEXCoreTestSuite.suite()); // addTest(VexUiTestSuite.suite()); // addTestSuite(IconTest.class); addTestSuite(ResourceTrackerTest.class); addTestSuite(FindReplaceTargetTest.class); }
public Rectangle computeTrim (int x, int y, int width, int height) { checkWidget (); if (OS.HIVIEW) { CGRect oldBounds = new CGRect (), bounds = oldBounds; OS.HIViewGetFrame (handle, oldBounds); int MIN_SIZE = 100; if (oldBounds.width < MIN_SIZE || oldBounds.height < MIN_SIZE) { OS.HIViewSetDrawingEnabled ...
public Rectangle computeTrim (int x, int y, int width, int height) { checkWidget (); if (OS.HIVIEW) { CGRect oldBounds = new CGRect (), bounds = oldBounds; OS.HIViewGetFrame (handle, oldBounds); int MIN_SIZE = 100; if (oldBounds.width < MIN_SIZE || oldBounds.height < MIN_SIZE) { OS.HIViewSetDrawingEnabled ...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if ((style & SWT.SEPARATOR) != 0) { if ((style & SWT.HORIZONTAL) != 0) { width = DEFAULT_WIDTH; height = 3; } else { width = 3; height = DEFAULT_HEIGHT; } } else { if (isImage && image !=...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if ((style & SWT.SEPARATOR) != 0) { if ((style & SWT.HORIZONTAL) != 0) { width = DEFAULT_WIDTH; height = 3; } else { width = 3; height = DEFAULT_HEIGHT; } } else { if (isImage && image !=...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; int width, height; int layoutWidth = layout.getWidth (); //TEMPORARY CODE if (wHint == 0) { layout.setWidth (1); Rectangle rec...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; int width, height; int layoutWidth = layout.getWidth (); //TEMPORARY CODE if (wHint == 0) { layout.setWidth (1); Rectangle rec...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int [] outMetric = new int [1]; OS.GetThemeMetric (OS.kThemeMetricNormalProgressBarThickness, outMetric); int width = 0, height = 0; if ((style & SWT.HORIZONTAL) != 0) { height = outMetric [0]; width = height * 10; } else { wi...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int [] outMetric = new int [1]; OS.GetThemeMetric (OS.kThemeMetricNormalProgressBarThickness, outMetric); int width = 0, height = 0; if ((style & SWT.HORIZONTAL) != 0) { height = outMetric [0]; width = height * 10; } else { wi...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if ((style & SWT.HORIZONTAL) != 0) { width += DEFAULT_WIDTH; height += 5; } else { width += 5; height += DEFAULT_HEIGHT; } if (wHint != SWT.DEFAULT) width = wHint; if (hHint != SWT.DEFAULT) height = ...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if ((style & SWT.HORIZONTAL) != 0) { width += DEFAULT_WIDTH; height += 5; } else { width += 5; height += DEFAULT_HEIGHT; } if (wHint != SWT.DEFAULT) width = wHint; if (hHint != SWT.DEFAULT) height = ...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int [] outMetric = new int [1]; OS.GetThemeMetric (OS.kThemeMetricScrollBarWidth, outMetric); int width = 0, height = 0; if ((style & SWT.HORIZONTAL) != 0) { height = outMetric [0]; width = height * 10; } else { width = outMet...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int [] outMetric = new int [1]; OS.GetThemeMetric (OS.kThemeMetricScrollBarWidth, outMetric); int width = 0, height = 0; if ((style & SWT.HORIZONTAL) != 0) { height = outMetric [0]; width = height * 10; } else { width = outMet...
public void cut () { checkWidget(); if ((style & SWT.READ_ONLY) != 0) return; boolean cut = true; char [] oldText = null; Point oldSelection = getSelection (); if (hooks (SWT.Verify) || filters (SWT.Verify)) { if (oldSelection.x != oldSelection.y) { oldText = getEditText (oldSelection.x, oldSelection.y - 1, ...
public void cut () { checkWidget(); if ((style & SWT.READ_ONLY) != 0) return; boolean cut = true; char [] oldText = null; Point oldSelection = getSelection (); if (hooks (SWT.Verify) || filters (SWT.Verify)) { if (oldSelection.x != oldSelection.y) { oldText = getEditText (oldSelection.x, oldSelection.y - 1, ...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = wHint, height = hHint; if (wHint == SWT.DEFAULT) width = 0x7FFFFFFF; if (hHint == SWT.DEFAULT) height = 0x7FFFFFFF; int [] result = layout (width, height, false); Point extent = new Point (result [1], result [2]); if (w...
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = wHint, height = hHint; if (wHint == SWT.DEFAULT) width = 0x7FFFFFFF; if (hHint == SWT.DEFAULT) height = 0x7FFFFFFF; int [] result = layout (width, height, false); Point extent = new Point (result [1], result [2]); if (w...
public Regexp newRegexp(Project p) throws BuildException { String systemDefault = null; if (p == null) { systemDefault = System.getProperty("ant.regexp.regexpimpl"); } else { systemDefault = (String) p.getProperties().get("ant.regexp.regexpimpl"); } ...
public Regexp newRegexp(Project p) throws BuildException { String systemDefault = null; if (p == null) { systemDefault = System.getProperty("ant.regexp.regexpimpl"); } else { systemDefault = p.getProperty("ant.regexp.regexpimpl"); } if (system...
public RegexpMatcher newRegexpMatcher(Project p) throws BuildException { String systemDefault = null; if (p == null) { systemDefault = System.getProperty("ant.regexp.regexpimpl"); } else { systemDefault = (String) p.getProperties().get("ant.regexp.regexpimpl")...
public RegexpMatcher newRegexpMatcher(Project p) throws BuildException { String systemDefault = null; if (p == null) { systemDefault = System.getProperty("ant.regexp.regexpimpl"); } else { systemDefault = p.getProperty("ant.regexp.regexpimpl"); } ...
public void execute() throws BuildException { if (null == alias) { throw new BuildException("alias attribute must be set"); } if (null == storepass) { throw new BuildException("storepass attribute must be set"); } if (null == dname && null == expand...
public void execute() throws BuildException { if (null == alias) { throw new BuildException("alias attribute must be set"); } if (null == storepass) { throw new BuildException("storepass attribute must be set"); } if (null == dname && null == expand...
void aspectSettings( Parameters parameters, Configuration[] children ) /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE file...
void aspectSettings( Parameters parameters, Configuration[] children ) /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE file...
private JPanel createTableButtonPanel(String addCommand, String deleteCommand) { JPanel buttonPanel = new JPanel(); JButton addButton = new JButton(JMeterUtils.getResString("add")); addButton.setActionCommand(ADD_INCLUDE); addButton.addActionListener(this); buttonPanel.add(a...
private JPanel createTableButtonPanel(String addCommand, String deleteCommand) { JPanel buttonPanel = new JPanel(); JButton addButton = new JButton(JMeterUtils.getResString("add")); addButton.setActionCommand(addCommand); addButton.addActionListener(this); buttonPanel.add(ad...
protected void writeDOMTree(Document doc, File file) throws IOException { OutputStream out = null; PrintWriter wri = null; try { out = new FileOutputStream( file ); wri = new PrintWriter(new OutputStreamWriter(out, "UTF8")); wri.write("<?xml version=\"1.0\...
protected void writeDOMTree(Document doc, File file) throws IOException { OutputStream out = null; PrintWriter wri = null; try { out = new FileOutputStream( file ); wri = new PrintWriter(new OutputStreamWriter(out, "UTF8")); wri.write("<?xml version=\"1.0\...
public boolean equals(IdentityConstraint id) { boolean areEqual = fIdentityConstraintName.equals(id.fIdentityConstraintName); if(!areEqual) return false; areEqual = fSelector.toString().equals(id.fSelector.toString()); if(!areEqual) return false; areEqual = (fFieldCount == id...
public boolean equals(IdentityConstraint id) { boolean areEqual = fIdentityConstraintName.equals(id.fIdentityConstraintName); if(!areEqual) return false; areEqual = fSelector.toString().equals(id.fSelector.toString()); if(!areEqual) return false; areEqual = (fFieldCount == id...
public ProjectAnalyzer(final IJavaProject project) { super(Messages.ProjectAnalyzer_AnalysingPrompt + project.getProject().getProject().getName()); // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=268516 setRule(project.getSchedulingRule()); this.project = project; }
public ProjectAnalyzer(final IJavaProject project) { super(Messages.ProjectAnalyzer_AnalysingPrompt + project.getProject().getProject().getName()); // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=268516 setRule(project.getProject().getWorkspace().getRoot()); this.project = project; }
public void setText (String string) { checkWidget (); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); TCHAR buffer = new TCHAR (getCodePage (), string, true); OS.SetWindowText (handle, buffer); } int widgetStyle () { /* * Bug in Windows. When GetDCEx () is called with DCX_INTERSECTUPDATE, * the HDC that i...
public void setText (String string) { checkWidget (); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); TCHAR buffer = new TCHAR (getCodePage (), string, true); OS.SetWindowText (handle, buffer); } int widgetStyle () { /* * Bug in Windows. When GetDCEx () is called with DCX_INTERSECTUPDATE, * the HDC that i...
List<IStringResourceLoader> getStringResourceLoaders(); package wicket.settings; import java.util.List; import java.util.Locale; import wicket.IResourceFactory; import wicket.Localizer; import wicket.model.IModel; import wicket.resource.IPropertiesFactory; import wicket.resource.loader.IStringResourceLoader; import ...
List<IStringResourceLoader> getStringResourceLoaders(); package wicket.settings; import java.util.List; import java.util.Locale; import wicket.IResourceFactory; import wicket.Localizer; import wicket.model.IModel; import wicket.resource.IPropertiesFactory; import wicket.resource.loader.IStringResourceLoader; import ...
public void initialize(DataCacheManager manager) { if (_schedule != null && !"".equals(_schedule)) { DataCacheScheduler scheduler = manager.getDataCacheScheduler(); if (scheduler != null) scheduler.scheduleEviction(this, _schedule); } // Cast here rath...
public void initialize(DataCacheManager manager) { if (_schedule != null && !"".equals(_schedule)) { ClearableScheduler scheduler = manager.getClearableScheduler(); if (scheduler != null) scheduler.scheduleEviction(this, _schedule); } // Cast here rath...
public void create (Composite parent, int style) { String className = "SWTWebViewDelegate"; //$NON-NLS-1$ if (OS.objc_lookUpClass(className) == 0) { Class safariClass = this.getClass(); Callback3 = new Callback(safariClass, "browserProc", 3); //$NON-NLS-1$ int /*long*/ proc3 = Callback3.getAddress(); if (proc...
public void create (Composite parent, int style) { String className = "SWTWebViewDelegate"; //$NON-NLS-1$ if (OS.objc_lookUpClass(className) == 0) { Class safariClass = this.getClass(); Callback3 = new Callback(safariClass, "browserProc", 3); //$NON-NLS-1$ int /*long*/ proc3 = Callback3.getAddress(); if (proc...
public void setVisible (boolean visible) { checkWidget (); if (drawCount != 0) { if (((state & HIDDEN) == 0) == visible) return; } else { if (visible == OS.IsWindowVisible (handle)) return; } /* * Feature in Windows. When ShowWindow() is called used to hide * a window, Windows attempts to give focus to th...
public void setVisible (boolean visible) { checkWidget (); if (drawCount != 0) { if (((state & HIDDEN) == 0) == visible) return; } else { if (visible == OS.IsWindowVisible (handle)) return; } /* * Feature in Windows. When ShowWindow() is called used to hide * a window, Windows attempts to give focus to th...
public void clearAll (boolean all) { checkWidget (); clearAll (null, all); } void clearCustomWidths (TreeItem item) { item.customWidth = -1; for (int i = 0; i < item.itemCount; i++) { clearCustomWidths (items[i]); } }
public void clearAll (boolean all) { checkWidget (); clearAll (null, all); } void clearCustomWidths (TreeItem item) { item.customWidth = -1; for (int i = 0; i < item.itemCount; i++) { clearCustomWidths (item.items[i]); } }
public boolean isCached () { return false; } })); final ExecutionContext initCtx = BackendFacade.createExecutionContext (fdc, ts); final ExpressionBase body = new InvocationOnObjectExpression ("myFunction", new ArrayList<ExpressionBas...
public boolean isCached () { return false; } })); final ExecutionContext initCtx = BackendFacade.createExecutionContext (fdc, ts, true); final ExpressionBase body = new InvocationOnObjectExpression ("myFunction", new ArrayList<Express...
public static ExecutionContext createEmptyExecutionContext () { final BackendTypesystem ts = new CompositeTypesystem (); return BackendFacade.createExecutionContext (new FunctionDefContextFactory (ts).create(), ts); }
public static ExecutionContext createEmptyExecutionContext () { final BackendTypesystem ts = new CompositeTypesystem (); return BackendFacade.createExecutionContext (new FunctionDefContextFactory (ts).create(), ts, true); }
protected void runTest() throws Throwable { if (getName().equals("test_ConstructorLorg_eclipse_swt_graphics_DeviceII")) test_ConstructorLorg_eclipse_swt_graphics_DeviceII(); else if (getName().equals("test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_io_InputStream")) test_ConstructorLorg_eclipse_swt_graphics_Dev...
protected void runTest() throws Throwable { if (getName().equals("test_ConstructorLorg_eclipse_swt_graphics_DeviceII")) test_ConstructorLorg_eclipse_swt_graphics_DeviceII(); else if (getName().equals("test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_io_InputStream")) test_ConstructorLorg_eclipse_swt_graphics_Dev...
protected String getPath(String fileName) { String urlPath; String pluginPath = System.getProperty("PLUGIN_PATH"); if (verbose) { System.out.println("PLUGIN_PATH <"+pluginPath+">"); } if (pluginPath == null) { URL url = getClass().getClassLoader().getResource(fileName); if (url == null) { fail("URL == n...
protected String getPath(String fileName) { String urlPath; String pluginPath = System.getProperty("PLUGIN_PATH"); if (verbose) { System.out.println("PLUGIN_PATH <"+pluginPath+">"); } if (pluginPath == null) { URL url = getClass().getClassLoader().getResource(fileName); if (url == null) { fail("URL == n...
private UnresolvedType[] getTypesForMemberParameterization() { UnresolvedType[] parameters = null; if (isParameterizedType()) { parameters = getTypeParameters(); } else if (isRawType()){ // raw type, use upper bounds of type variables on generic type TypeVariable[] tvs = getGenericType().getTypeVariabl...
private UnresolvedType[] getTypesForMemberParameterization() { UnresolvedType[] parameters = null; if (isParameterizedType()) { parameters = getTypeParameters(); } else if (isRawType()){ // raw type, use upper bounds of type variables on generic type TypeVariable[] tvs = getGenericType().getTypeVariabl...
public final void linkClicked() { String param = AbstractTreeNodeLink.REQUEST_PARAMETER_LINK_ID; // TODO Shouldn't this be getRequestString() now? String linkId = ((HttpRequest)getRequestCycle().getRequest()).getParameter(param); AbstractTreeNodeLink link = (AbstractTreeNodeLink) li...
public final void linkClicked() { String param = AbstractTreeNodeLink.REQUEST_PARAMETER_LINK_ID; // TODO Shouldn't this be getRequestString() now? String linkId = ((HttpRequest)getRequest()).getParameter(param); AbstractTreeNodeLink link = (AbstractTreeNodeLink) links.get(linkId); ...
protected void handleXMPPMessage(Packet aPacket) { try { if (aPacket instanceof IQ) { handleIQMessage((IQ) aPacket); } else if (aPacket instanceof Message) { handleChatMessage((Message) aPacket); } else if (aPacket instanceof Presence) { handlePresenceMessage((Presence) aPacket); } else { ...
protected void handleXMPPMessage(Packet aPacket) { try { if (aPacket instanceof IQ) { handleIQMessage((IQ) aPacket); } else if (aPacket instanceof Message) { handleChatMessage((Message) aPacket); } else if (aPacket instanceof Presence) { handlePresenceMessage((Presence) aPacket); } else { ...
public void setYear (int year) { checkWidget (); SYSTEMTIME systime = new SYSTEMTIME (); int msg = (style & SWT.CALENDAR) != 0 ? OS.MCM_GETCURSEL : OS.DTM_GETSYSTEMTIME; OS.SendMessage (handle, msg, 0, systime); msg = (style & SWT.CALENDAR) != 0 ? OS.MCM_SETCURSEL : OS.DTM_SETSYSTEMTIME; systime.wYear = (short)ye...
public void setYear (int year) { checkWidget (); SYSTEMTIME systime = new SYSTEMTIME (); int msg = (style & SWT.CALENDAR) != 0 ? OS.MCM_GETCURSEL : OS.DTM_GETSYSTEMTIME; OS.SendMessage (handle, msg, 0, systime); msg = (style & SWT.CALENDAR) != 0 ? OS.MCM_SETCURSEL : OS.DTM_SETSYSTEMTIME; systime.wYear = (short)ye...
public void run() { if (isDisposed() || html == null) return; int charCount = html.length(); char[] chars = new char[charCount]; html.getChars(0, charCount, chars, 0); html = null; int byteCount = OS.WideCharToMultiByte(OS.CP_UTF8, 0, chars, charCount, null, 0, nul...
public void run() { if (isDisposed() || html == null) return; int charCount = html.length(); char[] chars = new char[charCount]; html.getChars(0, charCount, chars, 0); html = null; int byteCount = OS.WideCharToMultiByte(OS.CP_UTF8, 0, chars, charCount, null, 0, nul...
protected String getRandomFileName() { if (this.getXmlPathLoc() != null) { File src = new File(this.getXmlPathLoc()); if (src.isDirectory() && src.list() != null) { File [] fileList = src.listFiles(new JMeterFileFilter(new String[] { ".xml" })); File one = fileList[RANDOM.nextInt(fileList.length)]; ...
protected String getRandomFileName() { if (this.getXmlPathLoc() != null) { File src = new File(this.getXmlPathLoc()); if (src.isDirectory() && src.list() != null) { File [] fileList = src.listFiles(new JMeterFileFilter(new String[] { ".xml" }, false)); File one = fileList[RANDOM.nextInt(fileList.length...
public void onDetach() { if (cleanupFeedbackMessagesOnDetach) { if (Session.exists()) { Session.get().cleanupFeedbackMessages(); } } try { onEndRequest(); listeners.onEndRequest(this); } catch (RuntimeException e) { log.error("Exception occurred during onAfterRequest", e); } ...
public void onDetach() { if (cleanupFeedbackMessagesOnDetach) { if (Session.exists()) { Session.get().cleanupFeedbackMessages(); } } try { onEndRequest(); listeners.onEndRequest(this); } catch (RuntimeException e) { log.error("Exception occurred during onEndRequest", e); } ...
public static Object convert(Object value, Class<?> toType) { if (value == null) { value = ""; } else if (toType.isAssignableFrom(value.getClass())) { return value; } else if (toType.equals(float.class) || toType.equals(Float.class)) { return new Float(get...
public static Object convert(Object value, Class<?> toType) { if (value == null) { value = ""; } else if (toType.isAssignableFrom(value.getClass())) { return value; } else if (toType.equals(float.class) || toType.equals(Float.class)) { return new Float(get...
private ICompilationUnit getCompilationUnit(IMarker marker) { IResource resource = marker.getResource(); if (resource instanceof IFile && resource.isAccessible()) { IJavaElement javaElement = JavaCore.create((IFile) resource); if (javaElement instanceof ICompilationUnit) { return (ICompilationUnit) javaE...
private ICompilationUnit getCompilationUnit(IMarker marker) { IResource resource = marker.getResource(); if (resource instanceof IFile && resource.isAccessible()) { IJavaElement javaElement = JavaCore.create((IFile) resource); if (javaElement != null && javaElement instanceof ICompilationUnit) { return (...
public boolean getScrollableTracksViewportWidth() { return true; }
public boolean getScrollableTracksViewportWidth() { return false; }
public ApacheLicenceHeaderTest() { // addHeaders = true; htmlIgnore = new String[] { /* * .html in test is very test specific and a license header would confuse and make it * unclear what the test is about. */ "src/test/java", /* * See NOTICE.txt */ "src/main/java/org/apache/wicket/util/dif...
public ApacheLicenceHeaderTest() { // addHeaders = true; htmlIgnore = new String[] { /* * .html in test is very test specific and a license header would confuse and make it * unclear what the test is about. */ "src/test/java", /* * See NOTICE.txt */ "src/main/java/org/apache/wicket/util/dif...
public void getClipping (Region region) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (region == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); if (region.isDisposed()) SWT.error (SWT.ERROR_INVALID_ARGUMENT); int gdipGraphics = data.gdipGraphics; if (gdipGraphics != 0) { Gdip.Graphics_SetPixelOffsetMo...
public void getClipping (Region region) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (region == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); if (region.isDisposed()) SWT.error (SWT.ERROR_INVALID_ARGUMENT); int gdipGraphics = data.gdipGraphics; if (gdipGraphics != 0) { Gdip.Graphics_SetPixelOffsetMo...
private void checkServiceInfo(final ServiceInfo serviceInfo) { final String serviceName = serviceInfo.getName(); if (serviceName == null) throw new ECFRuntimeException(Messages.JMDNSDiscoveryContainer_SERVICE_NAME_NOT_NULL); } IServiceInfo createIServiceInfoFromServiceInfo(final ServiceInfo serviceInfo) thro...
private void checkServiceInfo(final ServiceInfo serviceInfo) { final String serviceName = serviceInfo.getName(); if (serviceName == null) throw new ECFRuntimeException(Messages.JMDNSDiscoveryContainer_SERVICE_NAME_NOT_NULL); } IServiceInfo createIServiceInfoFromServiceInfo(final ServiceInfo serviceInfo) thro...
package org.apache.ant.convert.engine; /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE file. */ package org.apache.ant.con...
package org.apache.ant.convert.engine; /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE file. */ package org.apache.ant.con...
import org.apache.ant.convert.engine.ConverterEngine; /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE file. */ package org...
import org.apache.ant.convert.engine.ConverterEngine; /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE file. */ package org...
public IResourceCachingStrategy get() { return application.getResourceSettings().getResourceCachingStrategy(); } }; }
public IResourceCachingStrategy get() { return application.getResourceSettings().getCachingStrategy(); } }; }
protected void internalInit() { super.internalInit(); // set page and session store providers setSessionStoreProvider(new MockSessionStoreProvider()); setPageManagerProvider(new MockPageManagerProvider()); // for test cases we usually want stable resource names getResourceSettings().setResourceCachingSt...
protected void internalInit() { super.internalInit(); // set page and session store providers setSessionStoreProvider(new MockSessionStoreProvider()); setPageManagerProvider(new MockPageManagerProvider()); // for test cases we usually want stable resource names getResourceSettings().setCachingStrategy(N...
public void writeData(Attributes attributes) { attributes.getResponse().write(bytes); } }); } catch (IOException e) { log.debug(e.getMessage(), e); return sendResourceError(resourceResponse, 500, "Unable to read resource stream"); } catch (ResourceStreamNotFoundException ...
public void writeData(Attributes attributes) { attributes.getResponse().write(bytes); } }); } catch (IOException e) { log.debug(e.getMessage(), e); return sendResourceError(resourceResponse, 500, "Unable to read resource stream"); } catch (ResourceStreamNotFoundException ...
public void processResponse(AbstractResource.ResourceResponse response) { response.setCacheDurationToMaximum(); response.setCacheScope(WebResponse.CacheScope.PUBLIC); } }
public void decorateResponse(AbstractResource.ResourceResponse response) { response.setCacheDurationToMaximum(); response.setCacheScope(WebResponse.CacheScope.PUBLIC); } }
void decorateResponse(AbstractResource.ResourceResponse response); /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to Yo...
void decorateResponse(AbstractResource.ResourceResponse response); /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to Yo...
public void processResponse(AbstractResource.ResourceResponse response) { } }
public void decorateResponse(AbstractResource.ResourceResponse response) { } }
public String getErrorMessage() { if ( !getFileName().endsWith("."+extension) ) return Messages.NewOAWResourcePage_Error+extension; return null; }
public String getErrorMessage() { if ( !getFileName().endsWith("."+extension) ) return Messages.NewExtXptResourceWizardPage_Error+extension; return null; }
protected UrlRenderer newUrlRenderer() { // All URLs will be rendered relative to current request (can be overridden afterwards) return new UrlRenderer(getRequest().getClientUrl(), getRequest().getPrefixToContextPath()); }
protected UrlRenderer newUrlRenderer() { // All URLs will be rendered relative to current request (can be overridden afterwards) return new UrlRenderer(getRequest()); }
public BaseChannelConfig(ID id, IChannelListener listener, Map properties) { if (id == null) throw new NullPointerException("id cannot be null"); this.id = id; this.listener = listener; this.properties = properties; }
public BaseChannelConfig(ID id, IChannelListener listener, Map properties) { if (id == null) throw new NullPointerException(Messages.BaseChannelConfig_ID_Not_Null); this.id = id; this.listener = listener; this.properties = properties; }
GlobalParamContext getGlobalParamContext (); /* Copyright (c) 2008 Arno Haase. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contr...
GlobalParamContext getGlobalParamContext (); /* Copyright (c) 2008 Arno Haase. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contr...
public ExpressionBase convert (Expression expr) { if (expr instanceof BooleanLiteral) return new LiteralExpression ("true".equals (((Literal) expr).getLiteralValue().getValue()), getSourcePos (expr)); if (expr instanceof IntegerLiteral) return new LiteralExpression (new Long ...
public ExpressionBase convert (Expression expr) { if (expr instanceof BooleanLiteral) return new LiteralExpression ("true".equals (((Literal) expr).getLiteralValue().getValue()), getSourcePos (expr)); if (expr instanceof IntegerLiteral) return new LiteralExpression (new Long ...
public boolean isRedirect() { final String[] REDIRECT_CODES = { "301", "302", "303" }; // NOT 304! String code = getResponseCode(); for (int i = 0; i < REDIRECT_CODES.length; i++) { if (REDIRECT_CODES[i].equals(code)) { return true; } } ...
public boolean isRedirect() { final String[] REDIRECT_CODES = { "301", "302", "303" }; // NOT 304! String code = getResponseCode(); for (int i = 0; i < REDIRECT_CODES.length; i++) { if (REDIRECT_CODES[i].equals(code)) { return true; } } ...