buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
protected void onComponentTag(final ComponentTag tag) { // must be attached to <input type="radio" .../> tag checkComponentTag(tag, "input"); checkComponentTagAttribute(tag, "type", "radio"); RadioGroup group = (RadioGroup)findParent(RadioGroup.class); if (group == null) { throw new WicketRuntimeExce...
protected void onComponentTag(final ComponentTag tag) { // must be attached to <input type="radio" .../> tag checkComponentTag(tag, "input"); checkComponentTagAttribute(tag, "type", "radio"); RadioGroup group = (RadioGroup)findParent(RadioGroup.class); if (group == null) { throw new WicketRuntimeExce...
public boolean matches(ResolvedTypeX onType) { if (munger == null) throw new RuntimeException("huh: " + this); return munger.matches(onType); }
public boolean matches(ResolvedTypeX onType) { if (munger == null) throw new RuntimeException("huh: " + this); return munger.matches(onType, aspectType); }
public boolean matches(ResolvedTypeX matchType) { //??? this matches many more types than are needed return !matchType.isInterface(); } }
public boolean matches(ResolvedTypeX matchType, ResolvedTypeX aspectType) { //??? this matches many more types than are needed return !matchType.isInterface(); } }
public JPopupMenu createPopupMenu() { JPopupMenu pop = new JPopupMenu(); JMenu addMenu = new JMenu(JMeterUtils.getResString("add")); // $NON-NLS-1$ addMenu.add(MenuFactory.makeMenu(MenuFactory.THREADS, ActionNames.ADD)); addMenu.add(MenuFactory.makeMenu(MenuFactory.FRAGMENTS, ActionN...
public JPopupMenu createPopupMenu() { JPopupMenu pop = new JPopupMenu(); JMenu addMenu = new JMenu(JMeterUtils.getResString("add")); // $NON-NLS-1$ addMenu.add(MenuFactory.makeMenu(MenuFactory.THREADS, ActionNames.ADD)); addMenu.add(MenuFactory.makeMenu(MenuFactory.FRAGMENTS, ActionN...
public JPopupMenu createPopupMenu() { JPopupMenu pop = new JPopupMenu(); pop.add(MenuFactory.makeMenus(new String[] { MenuFactory.CONTROLLERS, MenuFactory.CONFIG_ELEMENTS, MenuFactory.TIMERS, MenuFactory.PRE_PROCESSORS, ...
public JPopupMenu createPopupMenu() { JPopupMenu pop = new JPopupMenu(); pop.add(MenuFactory.makeMenus(new String[] { MenuFactory.CONTROLLERS, MenuFactory.CONFIG_ELEMENTS, MenuFactory.TIMERS, MenuFactory.PRE_PROCESSORS, ...
public aspect DeclareEoW { declare warning : @args(@MyAnnotation) : "@args is not allowed in declares..."; }
public aspect DeclareEoW { declare warning : @args(MyAnnotation) : "@args is not allowed in declares..."; }
public aspect AtTargetAspect { before(): call(* *(..)) && @target(@MyAnnotation) { System.err.println("advice running"); } }
public aspect AtTargetAspect { before(): call(* *(..)) && @target(MyAnnotation) { System.err.println("advice running"); } }
private static final String type = JMeterUtils.getPropDefault("mode", MODE_STANDARD); // $NON-NLS-1$ /** * Checks for the Jmeter property mode and returns the required class. * * @param listener * @return the appropriate class. Standard Jmeter functionality, * hold_samples unti...
private static final String type = JMeterUtils.getPropDefault("mode", MODE_STANDARD); // $NON-NLS-1$ /** * Checks for the Jmeter property mode and returns the required class. * * @param listener * @return the appropriate class. Standard Jmeter functionality, * hold_samples unti...
public void testMessage() { String input = "input"; Throwable thrown = null; ISourceLocation sl = null; Class exClass = null; String descriptor = "Message"; // for make(...) IMessage.Kind kind = IMessage.INFO; // -- kind variants roundTrip(input, kind...
public void testMessage() { String input = "input"; Throwable thrown = null; ISourceLocation sl = null; Class exClass = null; String descriptor = "Message"; // for make(...) IMessage.Kind kind = IMessage.INFO; // -- kind variants roundTrip(input, kind...
public void run(String[] args, IMessageHolder holder) { if (LangUtil.isEmpty(args)) { args = new String[] { "-help" }; } else if (Arrays.asList(args).contains("-version")) { System.out.println("AspectJ Compiler " + Version.text); System.out.println(); return; ...
public void run(String[] args, IMessageHolder holder) { if (LangUtil.isEmpty(args)) { args = new String[] { "-help" }; } else if (Arrays.asList(args).contains("-version")) { System.out.println("AspectJ Compiler " + Version.text); System.out.println(); return; ...
protected void execP4Command(String command, P4Handler handler) throws BuildException { try { Commandline commandline = new Commandline(); commandline.setExecutable("p4"); //Check API for these - it's how CVS does it... if (P4Port != null && P4Port.length() ...
protected void execP4Command(String command, P4Handler handler) throws BuildException { try { Commandline commandline = new Commandline(); commandline.setExecutable("p4"); //Check API for these - it's how CVS does it... if (P4Port != null && P4Port.length() ...
private void scandir(File dir, TokenizedPath path, boolean fast, String[] newfiles, LinkedList directoryNamesFollowed) { String vpath = path.toString(); if (vpath.length() > 0 && !vpath.endsWith(File.separator)) { vpath += File.separator; } // av...
private void scandir(File dir, TokenizedPath path, boolean fast, String[] newfiles, LinkedList directoryNamesFollowed) { String vpath = path.toString(); if (vpath.length() > 0 && !vpath.endsWith(File.separator)) { vpath += File.separator; } // av...
protected void checkOptions() throws BuildException { if (tofile == null) { throw new BuildException("'tofile' attribute must be set."); } // check coverage home if (getHome() == null || !getHome().isDirectory()) { throw new BuildException("Invalid home direc...
protected void checkOptions() throws BuildException { if (tofile == null) { throw new BuildException("'tofile' attribute must be set."); } // check coverage home if (getHome() == null || !getHome().isDirectory()) { throw new BuildException("Invalid home direc...
protected void checkOptions() throws BuildException { if (tofile == null) { throw new BuildException("'tofile' attribute must be set."); } if (snapshot == null) { throw new BuildException("'snapshot' attribute must be set."); } if (getHome() == null) {...
protected void checkOptions() throws BuildException { if (tofile == null) { throw new BuildException("'tofile' attribute must be set."); } if (snapshot == null) { throw new BuildException("'snapshot' attribute must be set."); } if (getHome() == null) {...
protected void checkOptions() throws BuildException { // check coverage home if (getHome() == null || !getHome().isDirectory()) { throw new BuildException("Invalid home directory. Must point to JProbe home directory"); } File jar = findJar("coverage/coverage.jar"); ...
protected void checkOptions() throws BuildException { // check coverage home if (getHome() == null || !getHome().isDirectory()) { throw new BuildException("Invalid home directory. Must point to JProbe home directory"); } File jar = findCoverageJar(); if (!jar.exis...
public void detach(final RequestCycle requestCycle) { // detach the page if it was updated if (markupIdToComponent.size() > 0) { final Component component = markupIdToComponent.values().iterator().next(); final Page page = (Page)component.findParent(Page.class); if (page != null) { page.detach()...
public void detach(final RequestCycle requestCycle) { // detach the page if it was updated if (markupIdToComponent.size() > 0) { final Component component = markupIdToComponent.values().iterator().next(); final Page page = component.findParent(Page.class); if (page != null) { page.detach(); }...
public SessionData[] getLiveSessions() { SessionData[] sessions = (SessionData[])liveSessions.values().toArray(new SessionData[0]); Arrays.sort(sessions); return sessions; }
public SessionData[] getLiveSessions() { SessionData[] sessions = liveSessions.values().toArray(new SessionData[0]); Arrays.sort(sessions); return sessions; }
protected boolean isPortletContextAvailable(FilterConfig config) throws ServletException { boolean detectPortletContext = false; // search for portlet detection boolean in various places String parameter = config.getInitParameter(DETECT_PORTLET_CONTEXT); // search filter parameter if (parameter != null) ...
protected boolean isPortletContextAvailable(FilterConfig config) throws ServletException { boolean detectPortletContext = false; // search for portlet detection boolean in various places String parameter = config.getInitParameter(DETECT_PORTLET_CONTEXT); // search filter parameter if (parameter != null) ...
private boolean isPageMounted(Class<? extends Page> pageClass) { RequestCycle cycle = RequestCycle.get(); CharSequence path = getRequestCodingStrategy().pathForTarget( new BookmarkablePageRequestTarget(pageClass)); return path != null; }
private boolean isPageMounted(Class<? extends Page> pageClass) { RequestCycle.get(); CharSequence path = getRequestCodingStrategy().pathForTarget( new BookmarkablePageRequestTarget(pageClass)); return path != null; }
private void fillFields(Class<?> cls) { if (cls == null) { return; } Field[] fields = cls.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field field = fields[i]; field.setAccessible(true); if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifi...
private void fillFields(Class<?> cls) { if (cls == null) { return; } Field[] fields = cls.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field field = fields[i]; field.setAccessible(true); if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifi...
private void checkFields(Object obj, ObjectStreamClass desc) { int numFields; try { numFields = ((Integer)GET_NUM_OBJ_FIELDS_METHOD.invoke(desc, (Object[])null)).intValue(); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new...
private void checkFields(Object obj, ObjectStreamClass desc) { int numFields; try { numFields = ((Integer)GET_NUM_OBJ_FIELDS_METHOD.invoke(desc, (Object[])null)).intValue(); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new...
public Object formComponent(IFormVisitorParticipant formComponent) { FormComponent<?> component = (FormComponent<?>)formComponent; if (getParametersForNextRequest().containsKey(component.getInputName()) == false) { getParametersForNextRequest().put(component.getInputName(), new Strin...
public Object formComponent(IFormVisitorParticipant formComponent) { FormComponent<?> component = (FormComponent<?>)formComponent; if (getParametersForNextRequest().containsKey(component.getInputName()) == false) { getParametersForNextRequest().put(component.getInputName(), new Strin...
private Result(boolean failed) { this.failed = failed; this.message = ""; }
private Result(boolean failed) { this.failed = failed; message = ""; }
public void testFind() { WicketTester tester = new WicketTester(); Page page = new SimpleTestPage(); Component panel = page.get("testPanel"); assertNotNull(panel); MarkupStream markupStream = new MarkupFragmentFinder().find(panel); assertNotNull(markupStream); panel = page.get("testPanel:baseSpan"); ...
public void testFind() { new WicketTester(); Page page = new SimpleTestPage(); Component panel = page.get("testPanel"); assertNotNull(panel); MarkupStream markupStream = new MarkupFragmentFinder().find(panel); assertNotNull(markupStream); panel = page.get("testPanel:baseSpan"); assertNotNull(panel); ...
public void testLenientPackageResourceMatching() throws Exception { final SharedResources sharedResources = Application.get().getSharedResources(); Resource invalidResource = new PackageResource(PackageResourceTest.class, "packaged3.txt", Locale.ENGLISH, null); assertNotNull( "resource packaged3.txt SHOUL...
public void testLenientPackageResourceMatching() throws Exception { Application.get().getSharedResources(); Resource invalidResource = new PackageResource(PackageResourceTest.class, "packaged3.txt", Locale.ENGLISH, null); assertNotNull( "resource packaged3.txt SHOULD be available as a packaged resource ev...
public MyPage() { boolean sessionInvalid = Session.get().isSessionInvalidated(); MySession sess = MySession.get(); if (sess.getName() != null) { Session.get().invalidateNow(); throw new RestartResponseException(getClass()); // throw new AbortException(); } }
public MyPage() { Session.get().isSessionInvalidated(); MySession sess = MySession.get(); if (sess.getName() != null) { Session.get().invalidateNow(); throw new RestartResponseException(getClass()); // throw new AbortException(); } }
public String getEmail() { return this.email; }
public String getEmail() { return email; }
public void test() throws ParseException { final Time start = Time.now(); // TODO Post 1.2: Bug: Eelco mentioned this test fails on his computer // from time to time. I have seen this and it's very weird -- Jonathan // Assert.assertTrue(Time.now().after(start) || Time.now().equals(start)); final Time birt...
public void test() throws ParseException { Time.now(); // TODO Post 1.2: Bug: Eelco mentioned this test fails on his computer // from time to time. I have seen this and it's very weird -- Jonathan // Assert.assertTrue(Time.now().after(start) || Time.now().equals(start)); final Time birthday = Time.parseDa...
public XPCOMObject (int[] argCounts) { int /*long*/[] callbackAddresses = new int /*long*/[argCounts.length]; synchronized (Callbacks) { for (int i = 0, length = argCounts.length; i < length; i++){ if ((Callbacks[i][argCounts[i]]) == null) { Callbacks[i][argCounts[i]] = new Callback (getClass (), "callback"+...
public XPCOMObject (int[] argCounts) { int /*long*/[] callbackAddresses = new int /*long*/[argCounts.length]; synchronized (Callbacks) { for (int i = 0, length = argCounts.length; i < length; i++){ if ((Callbacks[i][argCounts[i]]) == null) { Callbacks[i][argCounts[i]] = new Callback (getClass (), "callback"+...
public final int size() { return size; } /** * @param id * The page id to create an attribute for * @return The session attribute for the given page (for replication of * state) */ String attributeForId(final int id) { return attributePrefix() + id; } /** * @return The attri...
public final int size() { return size; } /** * @param id * The page id to create an attribute for * @return The session attribute for the given page (for replication of * state) */ String attributeForId(final int id) { return attributePrefix() + id; } /** * @return The attri...
public String getWorkflowFileName() { return "/workflow/incrementalcallback.mwe"; }
public String getWorkflowFileName() { return "/resources/workflow/incrementalcallback.mwe"; }
public String getWorkflowFileName() { return "/workflow/incrementalfacade.mwe"; }
public String getWorkflowFileName() { return "/resources/workflow/incrementalfacade.mwe"; }
public void resolveStatements() { if (binding == null || ignoreFurtherInvestigation) return; ClassScope upperScope = (ClassScope)scope.parent; //!!! safety modifiers = binding.modifiers = checkAndSetModifiers(modifiers, upperScope); if (kind == AdviceKind.AfterThrowing && extraArgument != null) { ...
public void resolveStatements() { if (binding == null || ignoreFurtherInvestigation) return; ClassScope upperScope = (ClassScope)scope.parent; //!!! safety modifiers = binding.modifiers = checkAndSetModifiers(modifiers, upperScope); if (kind == AdviceKind.AfterThrowing && extraArgument != null) { ...
public final Serializable getMetaData(final MetaDataKey key) { return key.get(metaData); } /** * @return The attribute prefix for this page map */ final String attributePrefix() {
public final Serializable getMetaData(final MetaDataKey key) { return (Serializable)key.get(metaData); } /** * @return The attribute prefix for this page map */ final String attributePrefix() {
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...
protected static final List ecfProperties = Arrays.asList(new String[] { // ECF properties org.eclipse.ecf.remoteservice.Constants.OBJECTCLASS, org.eclipse.ecf.remoteservice.Constants.SERVICE_ID, RemoteConstants.DISCOVERY_DEFAULT_SERVICE_NAME_PREFIX, RemoteConstants.DISCOVERY_NAMING_AUTHORITY, Remote...
protected static final List ecfProperties = Arrays.asList(new String[] { // ECF properties org.eclipse.ecf.remoteservice.Constants.OBJECTCLASS, org.eclipse.ecf.remoteservice.Constants.SERVICE_ID, RemoteConstants.DISCOVERY_DEFAULT_SERVICE_NAME_PREFIX, RemoteConstants.DISCOVERY_NAMING_AUTHORITY, Remote...
protected RangeToken parseCharacterClass(boolean useNrange) throws ParseException { this.setContext(S_INBRACKETS); this.next(); // '[' boolean nrange = false; boolean wasDecoded = false; // used to detect if the last - was escaped. RangeToken ...
protected RangeToken parseCharacterClass(boolean useNrange) throws ParseException { this.setContext(S_INBRACKETS); this.next(); // '[' boolean nrange = false; boolean wasDecoded = false; // used to detect if the last - was escaped. RangeToken ...
public final Object visit(final ISyntaxElement ele) { Object result = null; if (result == null && ele instanceof BooleanOperation) { result = visitBooleanOperation((BooleanOperation) ele); } if (result == null && ele instanceof Cast) { result = visitCast((Cast) ele); } if (result == null && ele insta...
public final Object visit(final ISyntaxElement ele) { Object result = null; if (ele instanceof BooleanOperation) { result = visitBooleanOperation((BooleanOperation) ele); } if (result == null && ele instanceof Cast) { result = visitCast((Cast) ele); } if (result == null && ele instanceof ConstructorC...
protected void invokeInternal2(WorkflowContext ctx, ProgressMonitor monitor, Issues issues) { };
protected void invokeInternal2(WorkflowContext ctx, ProgressMonitor monitor, Issues issues) { }
private enum AnalysationIssueSeverity { WARNING, ERROR };
private enum AnalysationIssueSeverity { WARNING, ERROR }
public void exposeType(UnresolvedType typeToExpose) { if (typeToExpose == ResolvedType.MISSING) return; if (typeToExpose.isParameterizedType() || typeToExpose.isRawType()) { if (typeToExpose instanceof ResolvedType) { typeToExpose = ((ResolvedType)typeToExpose).getGenericType(); } else { typeToExpose...
public void exposeType(UnresolvedType typeToExpose) { if (typeToExpose == ResolvedType.MISSING) return; if (typeToExpose.isParameterizedType() || typeToExpose.isRawType()) { if (typeToExpose instanceof ResolvedType) { typeToExpose = ((ResolvedType)typeToExpose).getGenericType(); } else { typeToExpose...
public void testIterator() { int abstractPublic = Modifier.ABSTRACT | Modifier.PUBLIC; ResolvedType iter = world.getCoreType(UnresolvedType.forRawTypeNames("java.util.Iterator")); modifiersTest(iter, abstractPublic | Modifier.INTERFACE); fieldsTest(iter, ResolvedMember.NONE); ...
public void testIterator() { int abstractPublic = Modifier.ABSTRACT | Modifier.PUBLIC; ResolvedType iter = world.getCoreType(UnresolvedType.forRawTypeName("java.util.Iterator")); modifiersTest(iter, abstractPublic | Modifier.INTERFACE); fieldsTest(iter, ResolvedMember.NONE); ...
public void setUseTimestamp(boolean v) { if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { useTimestamp = v; } }
public void setUseTimestamp(boolean v) { if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { useTimestamp = v; } }
protected void touch() throws BuildException { if (file != null) { if (!file.exists()) { log("Creating " + file, Project.MSG_INFO); try { fileUtils.createNewFile(file); } catch (IOException ioe) { throw new B...
protected void touch() throws BuildException { if (file != null) { if (!file.exists()) { log("Creating " + file, Project.MSG_INFO); try { fileUtils.createNewFile(file); } catch (IOException ioe) { throw new B...
public void testNewPageClassPageParameters() { assertEquals(MyPage0.class, factory.newPage(MyPage0.class, (PageParameters)null).getClass()); // MyPage0: no constructor at all assertEquals(MyPage0.class, factory.newPage(MyPage0.class, new PageParameters()).getClass()); // MyPage1 has only a default construct...
public void testNewPageClassPageParameters() { assertEquals(MyPage0.class, factory.newPage(MyPage0.class, (PageParameters)null).getClass()); // MyPage0: no constructor at all assertEquals(MyPage0.class, factory.newPage(MyPage0.class, new PageParameters()).getClass()); // MyPage1 has only a default construct...
protected void setUp() throws Exception { super.setUp(); application.getApplication().getPageSettings().addComponentResolver(new ScopedComponentResolver()); }
protected void setUp() throws Exception { super.setUp(); tester.getApplication().getPageSettings().addComponentResolver(new ScopedComponentResolver()); }
public void testDateField() { RequestCycle cycle = application.createRequestCycle();
public void testDateField() { RequestCycle cycle = tester.createRequestCycle();
public void test_1() throws Exception { executeTest(TestPage.class, "TestPage_ExpectedResult-1.html"); TestPage page = (TestPage)application.getLastRenderedPage(); executedListener(TestPage.class, page.get("link"), "TestPage_ExpectedResult-2.html"); }
public void test_1() throws Exception { executeTest(TestPage.class, "TestPage_ExpectedResult-1.html"); TestPage page = (TestPage)tester.getLastRenderedPage(); executedListener(TestPage.class, page.get("link"), "TestPage_ExpectedResult-2.html"); }
public void testPagedTable() throws Exception { executeTest(IncrementalTableNavigationPage.class, "IncrementalTableNavigationPage_ExpectedResult_1.html"); Page page = application.getLastRenderedPage(); Link link = (Link)page.get("nextNext"); executedListener(IncrementalTableNavigationPage.class, link, "Incre...
public void testPagedTable() throws Exception { executeTest(IncrementalTableNavigationPage.class, "IncrementalTableNavigationPage_ExpectedResult_1.html"); Page page = tester.getLastRenderedPage(); Link link = (Link)page.get("nextNext"); executedListener(IncrementalTableNavigationPage.class, link, "Incrementa...
public void testRenderHomePage_12() throws Exception { executeTest(HeaderSectionPage_12.class, "HeaderSectionPageExpectedResult_12.html"); PackageResource res = (PackageResource) application.getApplication().getSharedResources().get("wicket.markup.parser.filter.sub.HeaderSectionBorder/cborder.css"); as...
public void testRenderHomePage_12() throws Exception { executeTest(HeaderSectionPage_12.class, "HeaderSectionPageExpectedResult_12.html"); PackageResource res = (PackageResource) tester.getApplication().getSharedResources().get("wicket.markup.parser.filter.sub.HeaderSectionBorder/cborder.css"); assertN...
public Resource getResource(String name) { File f = FILE_UTILS.resolveFile(basedir, name); return new Resource(name, f.exists(), f.lastModified(), f.isDirectory()); }
public Resource getResource(String name) { File f = FILE_UTILS.resolveFile(basedir, name); return new Resource(name, f.exists(), f.lastModified(), f.isDirectory(), f.length()); }
public void testPr117882_2() { // AjdeInteractionTestbed.VERBOSE=true; // AjdeInteractionTestbed.configureBuildStructureModel(true); initialiseProject("PR117882_2"); build("PR117882_2"); checkWasFullBuild(); alter("PR117882_2","inc1"); build("PR117882_2"); checkWasntFullBuild(); // checkCompileWeaveCoun...
public void testPr117882_2() { // AjdeInteractionTestbed.VERBOSE=true; // AjdeInteractionTestbed.configureBuildStructureModel(true); initialiseProject("PR117882_2"); build("PR117882_2"); checkWasFullBuild(); alter("PR117882_2","inc1"); build("PR117882_2"); checkWasntFullBuild(); checkCompileWeaveCount(1,...
private List changes = new ArrayList(); void componentAdded(Component component) { changes.add(new Add(component)); } void componentModelChangeImpending(Component component) { changes.add(new ModelChange(component)); } void componentRemoved(Component component) { changes.add(new Remove(component)); ...
private List changes = new ArrayList(); void componentAdded(Component component) { changes.add(new Add(component)); } void componentModelChangeImpending(Component component) { changes.add(new ModelChange(component)); } void componentRemoved(Component component) { changes.add(new Remove(component)); ...
if (text != null) return text.charAt ((int)/*64*/offset); // TODO /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Ecl...
if (text != null) return text.charAt ((int)/*64*/offset); // TODO /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Ecl...
private void unpackGenericSignature() { if (unpackedGenericSignature) return; unpackedGenericSignature = true; String gSig = method.getGenericSignature(); if (gSig != null) { Signature.MethodTypeSignature mSig = new GenericSignatureParser().parseAsMethodSignature(method.getGenericSignature()); if...
private void unpackGenericSignature() { if (unpackedGenericSignature) return; unpackedGenericSignature = true; String gSig = method.getGenericSignature(); if (gSig != null) { Signature.MethodTypeSignature mSig = new GenericSignatureParser().parseAsMethodSignature(method.getGenericSignature()); if...
public void testWICKET_891() { tester.setupRequestAndResponse(); tester.getWicketSession().setLocale(new Locale("nl")); LocalizedMessagePage page = new LocalizedMessagePage(); tester.startPage(page); tester.processRequestCycle(); tester.setupRequestAndResponse(); tester.getServletRequest().setRequest...
public void testWICKET_891() { tester.setupRequestAndResponse(); tester.getWicketSession().setLocale(new Locale("nl")); LocalizedMessagePage page = new LocalizedMessagePage(); tester.startPage(page); tester.processRequestCycle(); tester.setupRequestAndResponse(); tester.getServletRequest().setRequest...
public Settings getSettings() { if (!settingsAccessible) { throw new WicketRuntimeException( "Use Application.init() method for configuring youre application object"); } if (settings == null) { settings = new Settings(this); } return settings; }
public Settings getSettings() { if (!settingsAccessible) { throw new WicketRuntimeException( "Use Application.init() method for configuring your application object"); } if (settings == null) { settings = new Settings(this); } return settings; }
private void doDeclareParents(DeclareParents declareParents, SourceTypeBinding sourceType) { List newParents = declareParents.findMatchingNewParents(factory.fromEclipse(sourceType)); if (!newParents.isEmpty()) { for (Iterator i = newParents.iterator(); i.hasNext(); ) { ResolvedTypeX parent = (ResolvedTypeX)...
private void doDeclareParents(DeclareParents declareParents, SourceTypeBinding sourceType) { List newParents = declareParents.findMatchingNewParents(factory.fromEclipse(sourceType),false); if (!newParents.isEmpty()) { for (Iterator i = newParents.iterator(); i.hasNext(); ) { ResolvedTypeX parent = (Resolved...
public boolean accept(File dir1, String name) { if (name.endsWith(".java")) { foundJavaFile = true; return false; } File d = new File(dir1, name); if (d.isDirectory()) { return true; } return false; } }); if (foundJ...
public boolean accept(File dir1, String name) { if (name.endsWith(".java")) { foundJavaFile = true; return false; } File d = new File(dir1, name); if (d.isDirectory()) { return true; } return false; } }); if (foundJ...
public final static String DEFAULT_TASK = "default"; }
public static final String DEFAULT_TASK = "default"; }
public void execute() throws BuildException { StringBuffer commandLine = new StringBuffer(); int result = 0; // first off, make sure that we've got a command and a vssdir ... if (getVsspath() == null) { String msg = "vsspath attribute must be set!"; throw new...
public void execute() throws BuildException { StringBuffer commandLine = new StringBuffer(); int result = 0; // first off, make sure that we've got a command and a vssdir ... if (getVsspath() == null) { String msg = "vsspath attribute must be set!"; throw new...
public int getTextLimit () { checkWidget (); int hwndText = OS.GetDlgItem (handle, CBID_EDIT); if (hwndText == 0) return LIMIT; return OS.SendMessage (hwndText, OS.EM_GETLIMITTEXT, 0, 0); }
public int getTextLimit () { checkWidget (); int hwndText = OS.GetDlgItem (handle, CBID_EDIT); if (hwndText == 0) return LIMIT; return OS.SendMessage (hwndText, OS.EM_GETLIMITTEXT, 0, 0) & 0x7FFFFFFF; }
public Expression<Class<? extends X>> type() { return new Expressions.Type<X>(this); }
public Expression<Class<? extends X>> type() { return new Expressions.Type<Class<? extends X>>(this); }
protected ResourceReference getResourceReference(Class<?> scope, String name, Locale locale, String style, String variation, boolean strict, boolean createIfNotFound) { Key key = new Key(scope.getName(), name, locale, style, variation); ResourceReference res = map.get(key); if (strict) { if (res == null)...
protected ResourceReference getResourceReference(Class<?> scope, String name, Locale locale, String style, String variation, boolean strict, boolean createIfNotFound) { Key key = new Key(scope.getName(), name, locale, style, variation); ResourceReference res = map.get(key); if (strict) { if (res == null ...
private void redirectTo(Url url, RequestCycle requestCycle) { WebResponse response = (WebResponse)requestCycle.getResponse(); String relativeUrl = requestCycle.getUrlRenderer().renderUrl(url); response.reset(); response.sendRedirect(relativeUrl); }
private void redirectTo(Url url, RequestCycle requestCycle) { WebResponse response = (WebResponse)requestCycle.getResponse(); String relativeUrl = requestCycle.getUrlRenderer().renderUrl(url); // response.reset(); response.sendRedirect(relativeUrl); }
public String toString () { return "Event {type=" + type + ",widget=" + widget + ",x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ }
public String toString () { return "Event {type=" + type + " " + widget + " time=" + time + " data=" + data + " x=" + x + " y=" + y + " width=" + width + " height=" + height + " detail=" + detail + "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ }
public Decorations (Composite parent, int style) { super (parent, checkStyle (style)); } static int checkStyle (int style) { if ((style & SWT.NO_TRIM) != 0) { style &= ~(SWT.CLOSE | SWT.TITLE | SWT.MIN | SWT.MAX | SWT.RESIZE | SWT.BORDER); } if ((style & (SWT.MENU | SWT.MIN | SWT.MAX | SWT.CLOSE)) != 0) { styl...
public Decorations (Composite parent, int style) { super (parent, checkStyle (style)); } static int checkStyle (int style) { if ((style & SWT.NO_TRIM) != 0) { style &= ~(SWT.CLOSE | SWT.TITLE | SWT.MIN | SWT.MAX | SWT.RESIZE | SWT.BORDER); } if ((style & (SWT.MENU | SWT.MIN | SWT.MAX | SWT.CLOSE)) != 0) { styl...
public void setProject(Project project) { this.project = project; }
protected Location location = Location.UNKNOWN_LOCATION; /** * Sets the project object of this task. This method is used by * project when a task is added to it so that the task has * access to the functions of the project. It should not be used * for any other purpose. * * @param...
package org.apache.antlib.vfile.selectors; /* * 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.apach...
package org.apache.antlib.vfile.selectors; /* * 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.apach...
package org.apache.myrmidon.framework.conditions; /* * 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...
package org.apache.myrmidon.framework.conditions; /* * 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...
protected final CharSequence getEventHandler() { return getCallbackScript(new AppendingStringBuffer("wicketAjaxPost('").append( getCallbackUrl(false)).append( "', wicketSerialize(document.getElementById('" + getComponent().getMarkupId() + "'))"), null, null); }
protected final CharSequence getEventHandler() { return getCallbackScript(new AppendingStringBuffer("wicketAjaxPost('").append( getCallbackUrl(false)).append( "', wicketSerialize(Wicket.$('" + getComponent().getMarkupId() + "'))"), null, null); }
access = "protected"; } if (_log.isWarnEnabled()) _log.warn(_loc.get("enhance-adddefaultconst", type, access)); } }
access = "protected"; } if (!_meta.getDescribedType().isInterface() && _log.isWarnEnabled()) _log.warn(_loc.get("enhance-adddefaultconst", type, access)); } }
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 setResizable (boolean resizable) { checkWidget (); this.resizable = resizable; } void setSortDirection (int direction) { if (OS.COMCTL32_MAJOR >= 6) { int index = parent.indexOf (this); if (index == -1) return; int /*long*/ hwnd = parent.handle; int /*long*/ hwndHeader = OS.SendMessage (hwnd, OS...
public void setResizable (boolean resizable) { checkWidget (); this.resizable = resizable; } void setSortDirection (int direction) { if (OS.COMCTL32_MAJOR >= 6) { int index = parent.indexOf (this); if (index == -1) return; int /*long*/ hwnd = parent.handle; int /*long*/ hwndHeader = OS.SendMessage (hwnd, OS...
public static Map<IMethod, Map<String, Boolean>> getMethodMap(IType type, Java2WSDataModel model) { Map<IMethod, Map<String, Boolean>> methodMap = new HashMap<IMethod, Map<String, Boolean>>(); try { IMethod[] methods = type.getMethods(); for (IMethod method : methods) { ...
public static Map<IMethod, Map<String, Boolean>> getMethodMap(IType type, Java2WSDataModel model) { Map<IMethod, Map<String, Boolean>> methodMap = new HashMap<IMethod, Map<String, Boolean>>(); try { IMethod[] methods = type.getMethods(); for (IMethod method : methods) { ...
public void setData (String key, Object value) { checkWidget(); if (key == null) error (SWT.ERROR_NULL_ARGUMENT); int index = 1; Object [] table = null; if ((state & KEYED_DATA) != 0) { table = (Object []) data; while (index < table.length) { if (key.equals (table [index])) break; index += 2; } } if ...
public void setData (String key, Object value) { checkWidget(); if (key == null) error (SWT.ERROR_NULL_ARGUMENT); int index = 1; Object [] table = null; if ((state & KEYED_DATA) != 0) { table = (Object []) data; while (index < table.length) { if (key.equals (table [index])) break; index += 2; } } if ...
protected void setupDiscovery() throws Exception { try { socontainer = ContainerFactory .getDefault().makeContainer(DISCOVERY_CONTAINER); discovery = (IDiscoveryContainer) socontainer .getAdapter(IDiscoveryContainer.class); if (discovery != null) { setupDiscoveryContainer(discovery); socon...
protected void setupDiscovery() throws Exception { try { socontainer = ContainerFactory .getDefault().makeContainer(DISCOVERY_CONTAINER); discovery = (IDiscoveryContainer) socontainer .getAdapter(IDiscoveryContainer.class); if (discovery != null) { setupDiscoveryContainer(discovery); socon...
protected void registerServer(ISharedObjectContainer cont) throws URISyntaxException { DiscoveryStartup.registerService(cont.getConfig().getID().toURI()); }
protected void registerServer(ISharedObjectContainer cont) throws URISyntaxException { DiscoveryStartup.registerService(cont.getID().toURI()); }
public synchronized ISharedData subscribe(ID id, ISubscriptionCallback callback) throws ECFException { Agent agent = (Agent) container.getSharedObjectManager() .getSharedObject(id); if (agent == null) return null; // TODO should we throw? if (callback != null) callback.dataSubscribed(agent, contain...
public synchronized ISharedData subscribe(ID id, ISubscriptionCallback callback) throws ECFException { Agent agent = (Agent) container.getSharedObjectManager() .getSharedObject(id); if (agent == null) return null; // TODO should we throw? if (callback != null) callback.dataSubscribed(agent, contain...
public static final void main(String[] args) throws Exception { ISharedObjectContainerConfig config = new SOContainerConfig(IDFactory .getDefault().makeGUID()); TCPClientSOContainer container = new TCPClientSOContainer(config); // now join group ID serverID = IDFactor...
public static final void main(String[] args) throws Exception { ISharedObjectContainerConfig config = new SOContainerConfig(IDFactory .getDefault().makeGUID()); TCPClientSOContainer container = new TCPClientSOContainer(config); // now join group ID serverID = IDFactor...
protected ID getGroupID() { ISharedObjectContext context = getContext(); if (context == null) { return null; } else return context.getGroupID(); }
protected ID getGroupID() { ISharedObjectContext context = getContext(); if (context == null) { return null; } else return context.getConnectedID(); }
public final void onComponentTag(final ComponentTag tag) { final ValueMap attributes = tag.getAttributes(); final String attributeValue = "javascript:validate('" + getCallbackUrl() + "', '" + formComponent.getInput() + "', this);"; attributes.put(getEventName(), attributeValue); }
public final void onComponentTag(final ComponentTag tag) { final ValueMap attributes = tag.getAttributes(); final String attributeValue = "javascript:validate('" + getCallbackUrl() + "', '" + formComponent.getInputName() + "', this);"; attributes.put(getEventName(), attributeValue); }
transient private static Logger log = LoggingManager.getLoggerForClass(); JMenu fileMenu; JMenuItem file_save_as; JMenuItem file_load; JMenuItem file_merge; JMenuItem file_exit; JMenuItem file_close; JMenu editMenu; JMenu edit_add; //JMenu edit_add_submenu; JMenuItem edit_rem...
transient private static Logger log = LoggingManager.getLoggerForClass(); JMenu fileMenu; JMenuItem file_save_as; JMenuItem file_load; JMenuItem file_merge; JMenuItem file_exit; JMenuItem file_close; JMenu editMenu; JMenu edit_add; //JMenu edit_add_submenu; JMenuItem edit_rem...
public void drawBackground(GC gc, int x, int y, int width, int height, int offsetX, int offsetY) { checkWidget (); if (gc == null) error (SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); Control control = findBackgroundControl (); if (control != null) { NSRect rect = new NSRect...
public void drawBackground(GC gc, int x, int y, int width, int height, int offsetX, int offsetY) { checkWidget (); if (gc == null) error (SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); Control control = findBackgroundControl (); if (control != null) { NSRect rect = new NSRect...
public static void main(String[] argv) { Integer two = 2; Integer four= 4; System.err.println("min(2,4)=>"+ new Utils().min(two,four)); System.err.println("max(2,4)=>"+new Utils().max(two,four)); } } aspect X { <T extends Number> T Utils.max(T first,T second) { if (first>second) return first...
public static void main(String[] argv) { Integer two = 2; Integer four= 4; System.err.println("min(2,4)=>"+ new Utils().min(two,four)); System.err.println("max(2,4)=>"+new Utils().max(two,four)); } } aspect X { <T extends Number> T Utils.max(T first,T second) { if (first.intValue()>second.in...
public static void main(String[] argv) { Integer two = 2; Integer four= 4; System.err.println("min(2,4)=>"+ Utils.min(two,four)); System.err.println("max(2,4)=>"+Utils.max(two,four)); } } aspect X { static <T extends Number> T Utils.max(T first,T second) { if (first>second) return first; els...
public static void main(String[] argv) { Integer two = 2; Integer four= 4; System.err.println("min(2,4)=>"+ Utils.min(two,four)); System.err.println("max(2,4)=>"+Utils.max(two,four)); } } aspect X { static <T extends Number> T Utils.max(T first,T second) { if (first.intValue()>second.intValu...
public void sendPostData(URLConnection connection, HTTPSampler sampler) throws IOException { // If filename was specified then send the post using multipart syntax String filename = sampler.getFileField(); if ((filename != null) && (filename.trim().length() > 0)) { OutputStream out = connection.getOutp...
public void sendPostData(URLConnection connection, HTTPSampler sampler) throws IOException { // If filename was specified then send the post using multipart syntax String filename = sampler.getFilename(); if ((filename != null) && (filename.trim().length() > 0)) { OutputStream out = connection.getOutpu...
private static void appendContentSpec(XMLContentSpec.Provider provider, StringPool stringPool, XMLContentSpec contentSpec, StringBuffer str, boole...
private static void appendContentSpec(XMLContentSpec.Provider provider, StringPool stringPool, XMLContentSpec contentSpec, StringBuffer str, boole...
protected boolean isFatalException(int subtype, SQLException ex) { int errorCode = ex.getErrorCode(); if ((subtype == StoreException.LOCK || subtype == StoreException.QUERY) && errorCode <= 30000) { return false; } return super.isFatalException(subtype, ex); ...
public boolean isFatalException(int subtype, SQLException ex) { int errorCode = ex.getErrorCode(); if ((subtype == StoreException.LOCK || subtype == StoreException.QUERY) && errorCode <= 30000) { return false; } return super.isFatalException(subtype, ex); ...
protected boolean isFatalException(int subtype, SQLException ex) { // SQL State of IX000 is a general purpose Informix error code // category, so only return Boolean.TRUE if we match SQL Codes // recoverable = Boolean.FALSE; if ((subtype == StoreException.LOCK && ex.getError...
public boolean isFatalException(int subtype, SQLException ex) { // SQL State of IX000 is a general purpose Informix error code // category, so only return Boolean.TRUE if we match SQL Codes // recoverable = Boolean.FALSE; if ((subtype == StoreException.LOCK && ex.getErrorCod...
public boolean compile(String configFile, BuildProgressMonitor progressMonitor, boolean buildModel) { if (configFile == null) { Ajde.getDefault().getErrorHandler().handleError( "Tried to build null config file." ); } init(); try { AjBuildConfig buildConfig = genBuildConfig(configFile); buildCo...
public boolean compile(String configFile, BuildProgressMonitor progressMonitor, boolean buildModel) { if (configFile == null) { Ajde.getDefault().getErrorHandler().handleError( "Tried to build null config file." ); } init(); try { AjBuildConfig buildConfig = genBuildConfig(configFile); buildCo...
private void initializeProject() { Vector listeners = project.getBuildListeners(); final int count = properties.size(); for (int i = 0; i < count; i++) { newProject.addBuildListener((BuildListener)listeners.elementAt(i)); } if (output != null) { try {...
private void initializeProject() { Vector listeners = project.getBuildListeners(); final int count = listeners.size(); for (int i = 0; i < count; i++) { newProject.addBuildListener((BuildListener)listeners.elementAt(i)); } if (output != null) { try { ...
public void run() { if (styledText == null) return; int i; long start = System.currentTimeMillis(); for (i = 0; i < lineCount; i++) { if (lineHeight[i] == -1 || lineWidth[i] == -1) { calculate(i, 1); if (System.currentTimeMillis() - start > IDLE_TIME) break; } } if (i < lineCount) ...
public void run() { if (styledText == null) return; int i; long start = System.currentTimeMillis(); for (i = 0; i < lineCount; i++) { if (lineHeight[i] == -1 || lineWidth[i] == -1) { calculate(i, 1); if (System.currentTimeMillis() - start > IDLE_TIME) break; } } if (i < lineCount) ...
public IRemoteServiceContainer selectConsumerContainer( EndpointDescription endpointDescription) { trace("selectConsumerContainers", "endpointDescription=" + endpointDescription); //$NON-NLS-1$ // Get the endpointID ID endpointID = IDUtil.createContainerID(endpointDescription); String[] remoteSupportedCon...
public IRemoteServiceContainer selectConsumerContainer( EndpointDescription endpointDescription) { trace("selectConsumerContainers", "endpointDescription=" + endpointDescription); //$NON-NLS-1$ // Get the endpointID ID endpointID = IDUtil.createID(endpointDescription); String[] remoteSupportedConfigs = nu...
public static String list(final File keystore, final String storePass) throws IOException { final File workingDir = keystore.getParentFile(); final SystemCommand nativeCommand = new SystemCommand(workingDir, null); final List<String> arguments = new ArrayList<String>(); arguments.add...
private static void keytool(String command, File keystore, String password, String alias, InputStream input, OutputStream output, String ... parameters) throws IOException { final File workingDir = keystore.getParentFile(); final SystemCommand nativeCommand = new SystemComman...
public void error(Collection/* <String> */resourceKeys, Map/* <String,String> */args) { final Map fullArgs = new HashMap(args.size() + 4); fullArgs.putAll(args); if (!fullArgs.containsKey("input")) { fullArgs.put("input", getInput()); } if (!fullArgs.containsKey("name")) { fullArgs.put("name", get...
public final void error(Collection/* <String> */resourceKeys, Map/* <String,String> */args) { final Map fullArgs = new HashMap(args.size() + 4); fullArgs.putAll(args); if (!fullArgs.containsKey("input")) { fullArgs.put("input", getInput()); } if (!fullArgs.containsKey("name")) { fullArgs.put("name...
private boolean compareServiceProperties(IServiceProperties p1, IServiceProperties p2) { if (p1.asProperties().size() != p2.asProperties().size()) return false; for (final Enumeration e = p1.getPropertyNames(); e.hasMoreElements();) { final String key = (String) e.nextElement(); final Object o1 = p1.getPr...
private boolean compareServiceProperties(IServiceProperties p1, IServiceProperties p2) { if (p1.size() != p2.size()) return false; for (final Enumeration e = p1.getPropertyNames(); e.hasMoreElements();) { final String key = (String) e.nextElement(); final Object o1 = p1.getProperty(key); final Object o...
protected void onComponentTag(final ComponentTag tag) { super.onComponentTag(tag); if (isLinkEnabled() == false) { disableLink(tag); } else if (getDefaultModel() != null) { Object hrefValue = getDefaultModelObject(); if (hrefValue != null) { String url = hrefValue.toString(); if (con...
protected void onComponentTag(final ComponentTag tag) { super.onComponentTag(tag); if (isLinkEnabled() == false) { disableLink(tag); } else if (getDefaultModel() != null) { Object hrefValue = getDefaultModelObject(); if (hrefValue != null) { String url = hrefValue.toString(); if (con...
public String getComponentPath() { if (componentPath != null) { return componentPath; } else { return component.getPath(); } }
public String getComponentPath() { if (componentPath != null) { return componentPath; } else { return component.getPageRelativePath(); } }
public Url mapHandler(final IRequestHandler requestHandler) { if (requestHandler instanceof BookmarkablePageRequestHandler) { // simple bookmarkable URL with no page instance information BookmarkablePageRequestHandler handler = (BookmarkablePageRequestHandler)requestHandler; if (!checkPageClass(handler....
public Url mapHandler(final IRequestHandler requestHandler) { if (requestHandler instanceof BookmarkablePageRequestHandler) { // simple bookmarkable URL with no page instance information BookmarkablePageRequestHandler handler = (BookmarkablePageRequestHandler)requestHandler; if (!checkPageClass(handler....