buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public void resolve(BlockScope upperScope) { // use the scope that will hold the init declarations scope = new BlockScope(upperScope); this.elementVariable.resolve(scope); // collection expression can see itemVariable TypeBinding elementType = this.elementVariable.type.resolvedType; TypeBinding collectionTyp...
public void resolve(BlockScope upperScope) { // use the scope that will hold the init declarations scope = new BlockScope(upperScope); this.elementVariable.resolve(scope); // collection expression can see itemVariable TypeBinding elementType = this.elementVariable.type.resolvedType; TypeBinding collectionTyp...
public String toString() { return "Classpath for jar file "/*nonNLS*/ + zipFile; }
public String toString() { return "Classpath for jar file " + zipFile; //$NON-NLS-1$ }
protected void append(LoggingEvent event) { event.prepareForSerialization(); // Extract location info now. Later it might not be possible. event.getLocationInformation(); synchronized (model) { model.add(event); } }
protected void append(LoggingEvent event) { event.prepareForDeferredProcessing(); // Extract location info now. Later it might not be possible. event.getLocationInformation(); synchronized (model) { model.add(event); } }
private static final String HOSTNAME_REGEXP = "^[a-zA-Z0-9]+\\.[a-zA-Z0-9\\.]+\\.[a-zA-Z]{2,4}+$", DOTTED_IPV4_REGEXP =
private static final String HOSTNAME_REGEXP = "^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-\\.]+\\.[a-zA-Z]{2,4}+$", DOTTED_IPV4_REGEXP =
public StringBuffer print(int tab, StringBuffer output) { printIndent(tab, output); output.append('<');//$NON-NLS-1$ int max = typeParameters.length - 1; for (int j = 0; j < max; j++) { typeParameters[j].print(0, output); output.append(", ");//$NON-NLS-1$ } typeParameters[max].print(0, output); out...
public StringBuffer print(int tab, StringBuffer output) { printIndent(tab, output); output.append('<'); int max = typeParameters.length - 1; for (int j = 0; j < max; j++) { typeParameters[j].print(0, output); output.append(", ");//$NON-NLS-1$ } typeParameters[max].print(0, output); output.append('>...
public JavaWorkspaceScope() { JavaCore javaCore = JavaCore.getJavaCore(); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); for (int i = 0, length = projects.length; i < length; i++) { IProject project = projects[i]; if (project.isAccessible()) { try { this.add(javaCore.create(...
public JavaWorkspaceScope() { JavaCore javaCore = JavaCore.getJavaCore(); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); for (int i = 0, length = projects.length; i < length; i++) { IProject project = projects[i]; if (project.isAccessible()) { try { this.add(javaCore.create(...
private void validateTree() { if (tree == null) { tree = new TreeMap(); for (int i = 0; i < keySequenceBindings.length; i++) { Iterator iterator = keySequenceBindings[i].iterator(); while (iterator.hasNext()) { IKeySequenceBindingDefinition keySequenceBindingDefinition = (IKeySequenceBindi...
private void validateTree() { if (tree == null) { tree = new TreeMap(); for (int i = 0; i < keySequenceBindings.length; i++) { Iterator iterator = keySequenceBindings[i].iterator(); while (iterator.hasNext()) { IKeySequenceBindingDefinition keySequenceBindingDefinition = (IKeySequenceBindi...
public int sourceEnd() { return invocationSite.sourceStart(); } }; MethodBinding[] moreSpecific = new MethodBinding[visibleSize]; int count = 0; for (int level = 0, max = VARARGS_COMPATIBLE; level <= max; level++) { nextVisible : for (int i = 0; i < visibleSize; i++) { if (compatibilityLevels[i] != le...
public int sourceEnd() { return invocationSite.sourceStart(); } }; MethodBinding[] moreSpecific = new MethodBinding[visibleSize]; int count = 0; for (int level = 0, max = VARARGS_COMPATIBLE; level <= max; level++) { nextVisible : for (int i = 0; i < visibleSize; i++) { if (compatibilityLevels[i] != le...
public CompletionScanner(boolean assertMode) { super(false, false, false, assertMode); }
public CompletionScanner(boolean assertMode) { super(false /*comment*/, false /*whitespace*/, false /*nls*/, assertMode /*assert*/, null /*todo*/); }
public void actionPerformed(ActionEvent evt) { EditFolderDialog dialog = new EditFolderDialog("New Folder"); dialog.showDialog(); String name; if (dialog.success() == true) { // ok pressed name = dialog.getName(); try { FolderCommandReference[] r = (FolderCommandReference[]) frameControlle...
public void actionPerformed(ActionEvent evt) { EditFolderDialog dialog = new EditFolderDialog("New Folder"); dialog.showDialog(); String name; if (dialog.success()) { // ok pressed name = dialog.getName(); try { FolderCommandReference[] r = (FolderCommandReference[]) frameController ...
protected void showMenu(PartPane pane) { pane.showPaneMenu(); }
protected void showMenu(PartPane pane) { pane.showSystemMenu(); }
public void setAttribute(String s,Object o) { attributes.put(s,o); System.out.println(s+":"+o); }
public void setAttribute(String s,Object o) { attributes.put(s,o); // System.out.println(s+":"+o); }
protected void insertAfter(IContributionManager mgr, String refId, IContributionItem item) { IContributionItem refItem = findInsertionPoint(refId, actionSetId, mgr, true); if (refItem != null) { mgr.insertAfter(refItem.getId(), item); } else { WorkbenchPlugin.log("Reference item " + refId + " not fou...
protected void insertAfter(IContributionManager mgr, String refId, IContributionItem item) { IContributionItem refItem = findInsertionPoint(refId, actionSetId, mgr, true); if (refItem != null) { mgr.insertAfter(refItem.getId(), item); } else { WorkbenchPlugin.log("Reference item " + refId + " not fou...
public String getRawParentPath() { return configurationElement == null ? null : configurationElement.getAttribute(IWorkbenchRegistryConstants.ATT_PARENT); }
public String getRawParentPath() { return configurationElement == null ? null : configurationElement.getAttribute(IWorkbenchRegistryConstants.ATT_PARENT_CATEGORY); }
public boolean equals(Object object) { if (this == object) { return true; } if (object instanceof WorkingSet) { WorkingSet workingSet = (WorkingSet) object; return Util.equals(workingSet.getLabel(), getLabel()) && Util.equals(workingSet...
public boolean equals(Object object) { if (this == object) { return true; } if (object instanceof WorkingSet) { WorkingSet workingSet = (WorkingSet) object; return Util.equals(workingSet.getName(), getName()) && Util.equals(workingSet.g...
* N.B. This constructor is package-private. * </p> * * @param ast the AST that is to own this node */ FieldDeclaration(AST ast) { super(ast); } /* (omit javadoc for this method) * Method declared on ASTNode. * @since 3.0 */ final List internalStructuralPropertiesForType(int apiLevel) { return ...
* N.B. This constructor is package-private. * </p> * * @param ast the AST that is to own this node */ FieldDeclaration(AST ast) { super(ast); } /* (omit javadoc for this method) * Method declared on ASTNode. * @since 3.0 */ final List internalStructuralPropertiesForType(int apiLevel) { return ...
public void resetAnyExceptionHandlers() { if (this.anyExceptionLabelsCount > 0) { this.anyExceptionLabels = NO_EXCEPTION_HANDLER; this.anyExceptionLabelsCount = 0; } } }
public void resetStateForCodeGeneration() { if (this.anyExceptionLabelsCount > 0) { this.anyExceptionLabels = NO_EXCEPTION_HANDLER; this.anyExceptionLabelsCount = 0; } } }
this.binding = privateBinding; } } else { if (this.binding.declaringClass == null) { this.binding.declaringClass = allocatedType; } scope.problemReporter().invalidConstructor(this, this.binding); return this.resolvedType; } } if (isMethodUseDeprecated(this.binding, scope)) { scope.pro...
this.binding = privateBinding; } } else { if (this.binding.declaringClass == null) { this.binding.declaringClass = allocatedType; } scope.problemReporter().invalidConstructor(this, this.binding); return this.resolvedType; } } if (isMethodUseDeprecated(this.binding, scope, true)) { sco...
public void analyseCode( ClassScope classScope, InitializationFlowContext staticInitializerFlowContext, FlowInfo flowInfo) { if (this.ignoreFurtherInvestigation) return; try { ExceptionHandlingFlowContext clinitContext = new ExceptionHandlingFlowContext( staticInitializerFlowContext.parent, ...
public void analyseCode( ClassScope classScope, InitializationFlowContext staticInitializerFlowContext, FlowInfo flowInfo) { if (this.ignoreFurtherInvestigation) return; try { ExceptionHandlingFlowContext clinitContext = new ExceptionHandlingFlowContext( staticInitializerFlowContext.parent, ...
public static void main(String argv[]) { if(argv.length == 1) init(argv[0]); else Usage("Wrong number of arguments."); sample(); } static void Usage(String msg) { System.err.println(msg); System.err.println( "Usage: java " + XTest.class.getName() + "configFile"); ...
public static void main(String argv[]) { if(argv.length == 1) init(argv[0]); else Usage("Wrong number of arguments."); sample(); } static void Usage(String msg) { System.err.println(msg); System.err.println( "Usage: java " + XTest.class.getName() + "configFile"); ...
protected void executeOperation() throws JavaModelException { beginTask(Util.bind("operation.createUnitProgress"/*nonNLS*/), 2); JavaElementDelta delta = newJavaElementDelta(); ICompilationUnit unit = getCompilationUnit(); IPackageFragment pkg = (IPackageFragment) getParentElement(); IContainer folder = (IContaine...
protected void executeOperation() throws JavaModelException { beginTask(Util.bind("operation.createUnitProgress"), 2); //$NON-NLS-1$ JavaElementDelta delta = newJavaElementDelta(); ICompilationUnit unit = getCompilationUnit(); IPackageFragment pkg = (IPackageFragment) getParentElement(); IContainer folder = (ICont...
public StringBuffer printBody(int indent, StringBuffer output) { output.append(" {"); //$NON-NLS-1$ if (memberTypes != null) { for (int i = 0; i < memberTypes.length; i++) { if (memberTypes[i] != null) { output.append('\n'); memberTypes[i].print(indent + 1, output); } } } if (fields !=...
public StringBuffer printBody(int indent, StringBuffer output) { output.append(" {"); //$NON-NLS-1$ if (memberTypes != null) { for (int i = 0; i < memberTypes.length; i++) { if (memberTypes[i] != null) { output.append('\n'); memberTypes[i].print(indent + 1, output); } } } if (fields !=...
public PropPanelStereotype() { super("Stereotype", _stereotypeIcon ,2); Class mclass = MStereotype.class; addCaption(Argo.localize("UMLMenu", "label.name"),1,0,0); addField(nameField,1,0,0); addCaption(Argo.localize("UMLMenu", "label.base-class"),2,0,0); JComboBox baseClass = new UMLMetacla...
public PropPanelStereotype() { super("Stereotype", _stereotypeIcon ,2); Class mclass = MStereotype.class; addCaption(Argo.localize("UMLMenu", "label.name"),1,0,0); addField(nameField,1,0,0); addCaption(Argo.localize("UMLMenu", "label.base-class"),2,0,0); JComboBox baseClass = new UMLMetacla...
public String getQueryString() { StringBuffer sb = new StringBuffer(100); try { Intake intake = new Intake(); Group ir = intake.get("Report").mapTo(this); String INTAKE = "intake-grp"; char EQUALS = '='; char AMP = '&'; String repKey = ir...
public String getQueryString() { StringBuffer sb = new StringBuffer(100); try { Intake intake = new Intake(); Group ir = intake.get("Report").mapTo(this); String INTAKE = "intake-grp"; char EQUALS = '='; char AMP = '&'; String repKey = ir...
protected void compile(String[] argv) { // decode command line arguments try { configure(argv); if (showProgress) System.out.print(Main.bind("progress.compiling"/*nonNLS*/)); for (int i = 0; i < repetitions; i++){ globalProblemsCount = 0; globalErrorsCount = 0; globalWarningsCount = 0; lineCount =...
protected void compile(String[] argv) { // decode command line arguments try { configure(argv); if (showProgress) System.out.print(Main.bind("progress.compiling"/*nonNLS*/)); for (int i = 0; i < repetitions; i++){ globalProblemsCount = 0; globalErrorsCount = 0; globalWarningsCount = 0; lineCount =...
private void buildMenusAndToolbarsFor(CustomizeActionBars customizeActionBars, ActionSetDescriptor actionSetDesc) { String id = actionSetDesc.getId(); ActionSetActionBars bars = new ActionSetActionBars( customizeActionBars, id); PluginActionSetBuilder builder = new PluginActionSetB...
private void buildMenusAndToolbarsFor(CustomizeActionBars customizeActionBars, ActionSetDescriptor actionSetDesc) { String id = actionSetDesc.getId(); ActionSetActionBars bars = new ActionSetActionBars( customizeActionBars, window, id); PluginActionSetBuilder builder = new PluginAc...
protected Object createArgumentReference(char[] name, int dim, boolean isVarargs, Object typeRef, long[] dimPositions, long argNamePos) throws InvalidInputException { try { MethodRefParameter argument = this.ast.newMethodRefParameter(); ASTNode node = (ASTNode) typeRef; int argStart = node.getStartPosition(...
protected Object createArgumentReference(char[] name, int dim, boolean isVarargs, Object typeRef, long[] dimPositions, long argNamePos) throws InvalidInputException { try { MethodRefParameter argument = this.ast.newMethodRefParameter(); ASTNode node = (ASTNode) typeRef; int argStart = node.getStartPosition(...
public void generateCode( BlockScope currentScope, CodeStream codeStream, boolean valueRequired) { int pc = codeStream.position; BranchLabel falseLabel, endifLabel; if (this.constant != Constant.NotAConstant) { // inlined value if (valueRequired) { codeStream.generateConstant(this.constant, t...
public void generateCode( BlockScope currentScope, CodeStream codeStream, boolean valueRequired) { int pc = codeStream.position; BranchLabel falseLabel, endifLabel; if (this.constant != Constant.NotAConstant) { // inlined value if (valueRequired) { codeStream.generateConstant(this.constant, t...
public void begin(ExecutionContext ec, String name, Attributes attributes) { // Let us forget about previous errors (in this object) inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); try { logger.debug("About to instantiate layout of type [" + className + "]"); ...
public void begin(ExecutionContext ec, String name, Attributes attributes) { // Let us forget about previous errors (in this object) inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); try { logger.debug("About to instantiate layout of type [" + className + "]"); ...
public static final Icon DEFAULT_ICON = ImageLoader .getImageIcon("trayicon.png");
public static final Icon DEFAULT_ICON = ImageLoader .getMiscIcon("trayicon.png");
WorkbenchWindowConfigurer winConfigurer = page.getUnprotectedWindow().getWindowConfigurer(); dropTarget = new DropTarget(getControl(), DND.DROP_DEFAULT | DND.DROP_COPY); dropTarget.setTransfer(winConfigurer.getTransfers()); if (winConfigurer.getDropTargetListener() != null) { dropTarget.addDropListen...
private void addDropSupport() { if (dropTarget == null) { WorkbenchWindowConfigurer winConfigurer = ((WorkbenchWindow) page.getWorkbenchWindow()).getWindowConfigurer(); dropTarget = new DropTarget(getControl(), DND.DROP_DEFAULT | DND.DROP_COPY); dropTarget.setTransfer(winConfigurer.getTransfers()); if...
public StringBuffer printStatement(int indent, StringBuffer output) { printIndent(indent, output); if (qualification != null) qualification.printExpression(0, output).append('.'); if (typeArguments != null) { output.append('<');//$NON-NLS-1$ int max = typeArguments.length - 1; for (int j = 0; j < max; ...
public StringBuffer printStatement(int indent, StringBuffer output) { printIndent(indent, output); if (qualification != null) qualification.printExpression(0, output).append('.'); if (typeArguments != null) { output.append('<'); int max = typeArguments.length - 1; for (int j = 0; j < max; j++) { ty...
public void generateCode(BlockScope currentScope, CodeStream codeStream) { try { if ((this.bits & IsReachable) == 0) { return; } int pc = codeStream.position; // prepare the labels and constants this.breakLabel.initialize(codeStream); CaseLabel[] caseLabels = new CaseLabel[this.caseCount];...
public void generateCode(BlockScope currentScope, CodeStream codeStream) { try { if ((this.bits & IsReachable) == 0) { return; } int pc = codeStream.position; // prepare the labels and constants this.breakLabel.initialize(codeStream); CaseLabel[] caseLabels = new CaseLabel[this.caseCount];...
public void resolve() { if (binding == null) { ignoreFurtherInvestigation = true; return; } try { if ((this.bits & UndocumentedEmptyBlockMASK) != 0) { this.scope.problemReporter().undocumentedEmptyBlock(this.bodyStart-1, this.bodyEnd+1); } // check superclass & interfaces if (binding.super...
public void resolve() { if (binding == null) { ignoreFurtherInvestigation = true; return; } try { if ((this.bits & UndocumentedEmptyBlockMASK) != 0) { this.scope.problemReporter().undocumentedEmptyBlock(this.bodyStart-1, this.bodyEnd+1); } // check superclass & interfaces if (binding.super...
public boolean accept(File dir, String name) { if (name.endsWith(extension)) { return true; } return false; } });
public boolean accept(File dir, String name) { if (name.toLowerCase().endsWith(extension)) { return true; } return false; } });
public void actionPerformed(ActionEvent e) { super.actionPerformed(e); Object source = e.getSource(); MClassifier oldClassifier = null; MClassifier newClassifier = null; MAssociationEnd end = null; if (source instanceof UMLComboBox2) { UMLComboBox2 box = (...
public void actionPerformed(ActionEvent e) { super.actionPerformed(e); Object source = e.getSource(); MClassifier oldClassifier = null; MClassifier newClassifier = null; MAssociationEnd end = null; if (source instanceof UMLComboBox2) { UMLComboBox2 box = (...
public void selectionChanged(SelectionChangedEvent evt) { if (((TreeSelectionChangedEvent)evt).getSelected().length > 0) { FolderTreeNode folder = ((TreeSelectionChangedEvent)evt).getSelected()[0]; if (folder != null) { FolderItem item = folder.getFolderItem(); if (item.get("property", "accessrigh...
public void selectionChanged(SelectionChangedEvent evt) { if (((TreeSelectionChangedEvent)evt).getSelected().length > 0) { FolderTreeNode folder = ((TreeSelectionChangedEvent)evt).getSelected()[0]; if (folder != null && folder instanceof Folder) { FolderItem item = folder.getFolderItem(); if (item...
public void testParse() { IMAPResponse r = new IMAPResponse("testdata"); ListInfo listInfo = new ListInfo(); listInfo.parse(r); }
public void testParse() { IMAPResponse r = new IMAPResponse("testdata"); ListInfo listInfo = new ListInfo(); //listInfo.parse(r); }
protected int executeInsert( PreparedStatement ps, EntityEnterpriseContext ctx ) throws SQLException { int rows = ps.executeUpdate(); ResultSet results = null; try { Connection conn = ps.getConnection(); results = conn.prepareStatement( SQL ).executeQuery(); ...
protected int executeInsert(int paramIndex, PreparedStatement ps, EntityEnterpriseContext ctx ) throws SQLException { int rows = ps.executeUpdate(); ResultSet results = null; try { Connection conn = ps.getConnection(); results = conn.prepareStatement( SQL ).executeQue...
private static final Integer MULTIPLE_KEY = new Integer(0);
public String toString() { StringBuffer sb = new StringBuffer(50); sb.append('{').append(super.toString()).append('('); if (getModuleId() != null) { sb.append(getModuleId()); } sb.append(':'); if (getIssueTypeId() != null) { ...
public String getKeyTextForCommand(String command) throws IllegalArgumentException { String text = null; Sequence sequence = getKeyMachine().getFirstSequenceForCommand(command); if (sequence != null) text = KeySupport.formatSequence(sequence); return text != null ? text : Util.ZERO_LENGTH_STRING; ...
public String getKeyTextForCommand(String command) throws IllegalArgumentException { String text = null; Sequence sequence = getKeyMachine().getFirstSequenceForCommand(command); if (sequence != null) text = KeySupport.formatSequence(sequence, true); return text != null ? text : Util.ZERO_LENGTH_STR...
protected void executeOperation() throws JavaModelException { try { beginTask(Util.bind("workingCopy.commit"), 2); //$NON-NLS-1$ CompilationUnit workingCopy = (CompilationUnit)getCompilationUnit(); IFile resource = (IFile)workingCopy.getResource(); ICompilationUnit primary = workingCopy.getPrimary(); ...
protected void executeOperation() throws JavaModelException { try { beginTask(Util.bind("workingCopy.commit"), 2); //$NON-NLS-1$ CompilationUnit workingCopy = (CompilationUnit)getCompilationUnit(); IFile resource = (IFile)workingCopy.getResource(); ICompilationUnit primary = workingCopy.getPrimary(); ...
public void run() { if (workbenchWindow == null) { // action has been disposed return; } IWorkbenchPage page = workbenchWindow.getActivePage(); if (page != null) { ((WorkbenchPage) page).closeAllPerspectives(); } }
public void run() { if (workbenchWindow == null) { // action has been disposed return; } IWorkbenchPage page = workbenchWindow.getActivePage(); if (page != null) { page.closeAllPerspectives(true, true); } }
public ProfileChooserDialog() throws HeadlessException { super((JFrame)null, GlobalResourceLoader.getString(RESOURCE_PATH, "profiles", "title"), true); initComponents(); layoutComponents(); pack(); setLocationRelativeTo(null); se...
public ProfileChooserDialog() throws HeadlessException { super((JFrame)null, GlobalResourceLoader.getString(RESOURCE_PATH, "profiles", "chooser.title"), true); initComponents(); layoutComponents(); pack(); setLocationRelativeTo(null); ...
public static void createProblemType(TypeDeclaration typeDeclaration, CompilationResult unitResult) { SourceTypeBinding typeBinding = typeDeclaration.binding; ClassFile classFile = new CodeSnippetClassFile(typeBinding, null, true); // inner attributes if (typeBinding.isMemberType()) classFile.recordEnclosingType...
public static void createProblemType(TypeDeclaration typeDeclaration, CompilationResult unitResult) { SourceTypeBinding typeBinding = typeDeclaration.binding; ClassFile classFile = new CodeSnippetClassFile(typeBinding, null, true); // inner attributes if (typeBinding.isMemberType()) classFile.recordEnclosingType...
public void innerCopy(MailboxInterface destFolder, Object[] uids) throws Exception { if (getObservable() != null) getObservable().setMax(uids.length); for (int i = 0; i < uids.length; i++) { // skip this message, if it doesn't exist in source folder if ( exists(uids[i]) == false ) continue; Obje...
public void innerCopy(MailboxInterface destFolder, Object[] uids) throws Exception { if (getObservable() != null) getObservable().setMax(uids.length); for (int i = 0; i < uids.length; i++) { // skip this message, if it doesn't exist in source folder if ( exists(uids[i]) == false ) continue; Obje...
static public void assertEquals(String message, boolean expected, boolean actual) { assertEquals(message, new Boolean(expected), new Boolean(actual)); }
static public void assertEquals(String message, boolean expected, boolean actual) { assertEquals(message, Boolean.valueOf(expected), Boolean.valueOf(actual)); }
public String getActiveAcceleratorConfigurationId() { return ((Workbench) PlatformUI.getWorkbench()).getActiveAcceleratorConfiguration().getId(); }
public String getActiveAcceleratorConfigurationId() { return ((Workbench) PlatformUI.getWorkbench()).getActiveAcceleratorConfiguration().getLabel().getId(); }
public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) { int pc = codeStream.position; if (valueRequired) codeStream.aload_0(); codeStream.recordPositionsFrom(pc, this); }
public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) { int pc = codeStream.position; if (valueRequired) codeStream.aload_0(); codeStream.recordPositionsFrom(pc, this.sourceStart); }
public void run() { if (DEBUG) System.err.println(" forced remove"); if (ji.remove()) relayout(true, true); } }); } }
public void run() { if (DEBUG) System.err.println(" forced remove"); if (!list.isDisposed() && ji.remove()) relayout(true, true); } }); } }
public boolean startExternalEditor(AbstractEditorController EditCtrl) throws IOException { /* * *20030906, karlpeder* Method signature changed to take an * AbstractEditorController (instead of an TextEditorView) as parameter * since the view is no longer directly available */ MimeHeader myHeader = new ...
public boolean startExternalEditor(AbstractEditorController EditCtrl) throws IOException { /* * *20030906, karlpeder* Method signature changed to take an * AbstractEditorController (instead of an TextEditorView) as parameter * since the view is no longer directly available */ MimeHeader myHeader = new ...
protected ShowInAction(IWorkbenchWindow window, IViewDescriptor desc) { super(desc.getLabel()); setImageDescriptor(desc.getImageDescriptor()); WorkbenchHelp.setHelp(this, IHelpContextIds.SHOW_IN_ACTION); this.window = window; this.desc = desc; }
protected ShowInAction(IWorkbenchWindow window, IViewDescriptor desc) { super(desc.getLabel()); setImageDescriptor(desc.getImageDescriptor()); WorkbenchHelp.setHelp(this, IWorkbenchHelpContextIds.SHOW_IN_ACTION); this.window = window; this.desc = desc; }
public void addView(String viewId) { if (pageLayout.checkPartInLayout(viewId)) return; try { IViewDescriptor descriptor = viewFactory.getViewRegistry().find( viewId); if (WorkbenchActivityHelper.filterItem(descriptor)) { //crea...
public void addView(String viewId) { if (pageLayout.checkPartInLayout(viewId)) return; try { IViewDescriptor descriptor = viewFactory.getViewRegistry().find( viewId); if (WorkbenchActivityHelper.filterItem(descriptor)) { //crea...
public Message() { this(Header.randomID()); }
public Message() { this(-1); }
protected void consumeTypeImportOnDemandDeclarationName() { // TypeImportOnDemandDeclarationName ::= 'import' Name '.' '*' /* push an ImportRef build from the last name stored in the identifier stack. */ int index; /* no need to take action if not inside assist identifiers */ if ((index = indexOfAssistIdentifi...
protected void consumeTypeImportOnDemandDeclarationName() { // TypeImportOnDemandDeclarationName ::= 'import' Name '.' '*' /* push an ImportRef build from the last name stored in the identifier stack. */ int index; /* no need to take action if not inside assist identifiers */ if ((index = indexOfAssistIdentifi...
public static void updatePerspective(IConfigurationElement configElement) { // Do not change perspective if the configuration element is // not specified. if (configElement == null) return; AbstractUIPlugin uiPlugin = (AbstractUIPlugin) Platform.getPlugin(PlatformUI.PLUGIN_ID); // Retrieve the new proje...
public static void updatePerspective(IConfigurationElement configElement) { // Do not change perspective if the configuration element is // not specified. if (configElement == null) return; AbstractUIPlugin uiPlugin = (AbstractUIPlugin) Platform.getPlugin(PlatformUI.PLUGIN_ID); // Retrieve the new proje...
private Object[] computeNonJavaResources(JavaProject project) { // determine if src == project and/or if bin == project IPath projectPath = project.getProject().getFullPath(); boolean srcIsProject = false; boolean binIsProject = false; try { IClasspathEntry[] classpath = project.getExpandedClasspath(tr...
private Object[] computeNonJavaResources(JavaProject project) { // determine if src == project and/or if bin == project IPath projectPath = project.getProject().getFullPath(); boolean srcIsProject = false; boolean binIsProject = false; try { IClasspathEntry[] classpath = project.getExpandedClasspath(tr...
public AssistParser(ProblemReporter problemReporter, boolean assertMode) { super(problemReporter, false, assertMode); }
public AssistParser(ProblemReporter problemReporter, boolean assertMode) { super(problemReporter, true, assertMode); }
public void generateMethodInfoHeader(MethodBinding methodBinding, int accessFlags) { // check that there is enough space to write all the bytes for the method info corresponding // to the @methodBinding this.methodCount++; // add one more method if (this.contentsOffset + 10 >= this.contents.length) { resize...
public void generateMethodInfoHeader(MethodBinding methodBinding, int accessFlags) { // check that there is enough space to write all the bytes for the method info corresponding // to the @methodBinding this.methodCount++; // add one more method if (this.contentsOffset + 10 >= this.contents.length) { resize...
public FlowInfo analyseCode( BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { // initialize break and continue labels breakLabel = new BranchLabel(); continueLabel = new BranchLabel(); // process the element variable and collection this.collection.checkNPE(currentScope, flowConte...
public FlowInfo analyseCode( BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { // initialize break and continue labels breakLabel = new BranchLabel(); continueLabel = new BranchLabel(); // process the element variable and collection this.collection.checkNPE(currentScope, flowConte...
public CancelAction(AbstractFrameController controller) { super( controller, GlobalResourceLoader.getString(null, null, "menu_file_cancel")); // small icon for JMenuItem setSmallIcon(ImageLoader.getSmallImageIcon("stock_stop-16.png")); // big icon for JToolBar setLargeIcon(ImageLoader.getImageIcon(...
public CancelAction(AbstractFrameController controller) { super( controller, GlobalResourceLoader.getString(null, null, "menu_file_cancel")); // small icon for JMenuItem setSmallIcon(ImageLoader.getSmallImageIcon("stock_stop-16.png")); // big icon for JToolBar setLargeIcon(ImageLoader.getImageIcon(...
private TypeBinding getTypeFromSignature(String typeSignature, Scope scope) { TypeBinding assignableTypeBinding = null; TypeVariableBinding[] typeVariables = Binding.NO_TYPE_VARIABLES; ReferenceContext referenceContext = scope.referenceContext(); if (referenceContext instanceof AbstractMethodDeclaration) { ...
private TypeBinding getTypeFromSignature(String typeSignature, Scope scope) { TypeBinding assignableTypeBinding = null; TypeVariableBinding[] typeVariables = Binding.NO_TYPE_VARIABLES; ReferenceContext referenceContext = scope.referenceContext(); if (referenceContext instanceof AbstractMethodDeclaration) { ...
protected IMAPCache() { File configDir = Config.getInstance().getConfigDirectory(); cache = new StreamCache(new File(configDir, "imap_cache")); ShutdownManager.getShutdownManager().register(this); }
protected IMAPCache() { File configDir = Config.getInstance().getConfigDirectory(); cache = new StreamCache(new File(configDir, "imap_cache")); ShutdownManager.getInstance().register(this); }
protected void executeOperation() throws JavaModelException { if (this.progressMonitor != null){ if (this.progressMonitor.isCanceled()) throw new OperationCanceledException(); this.progressMonitor.beginTask(Util.bind("element.reconciling"), 2); //$NON-NLS-1$ } CompilationUnit workingCopy = getWorkin...
protected void executeOperation() throws JavaModelException { if (this.progressMonitor != null){ if (this.progressMonitor.isCanceled()) throw new OperationCanceledException(); this.progressMonitor.beginTask(Util.bind("element.reconciling"), 2); //$NON-NLS-1$ } CompilationUnit workingCopy = getWorkin...
public void execute(ContextManager cm) throws TomcatException { // Find Ajp12 connector int portInt=8007; Enumeration enum=cm.getConnectors(); while( enum.hasMoreElements() ) { Object con=enum.nextElement(); if( con instanceof PoolTcpConnector ) { PoolTcpConnector tcpCon=(PoolTcpConnector) co...
public void execute(ContextManager cm) throws TomcatException { // Find Ajp12 connector int portInt=8007; Enumeration enum=cm.getConnectors(); while( enum.hasMoreElements() ) { Object con=enum.nextElement(); if( con instanceof PoolTcpConnector ) { PoolTcpConnector tcpCon=(PoolTcpConnector) co...
public static char[] getResourceContentsAsCharArray(IFile file, String encoding) throws JavaModelException { // Get file length // workaround https://bugs.eclipse.org/bugs/show_bug.cgi?id=130736 by using java.io.File if possible IPath location = file.getLocation(); long length; if (location == null) { /...
public static char[] getResourceContentsAsCharArray(IFile file, String encoding) throws JavaModelException { // Get file length // workaround https://bugs.eclipse.org/bugs/show_bug.cgi?id=130736 by using java.io.File if possible IPath location = file.getLocation(); long length; if (location == null) { /...
public IntroAction(IWorkbenchWindow window) { super(IntroMessages.getString("Intro.action_text")); //$NON-NLS-1$ if (window == null) { throw new IllegalArgumentException(); } this.workbenchWindow = window; window.addPageListener(pageListener); }
public IntroAction(IWorkbenchWindow window) { super(IntroMessages.Intro_action_text); if (window == null) { throw new IllegalArgumentException(); } this.workbenchWindow = window; window.addPageListener(pageListener); }
public boolean predicate(Object dm, Designer dsgr) { if (!(dm instanceof MMClass)) return NO_PROBLEM; MMClass cls = (MMClass) dm; Vector ends = cls.getAssociationEnd(); if (ends == null || ends.size() > 1) return NO_PROBLEM; AssociationEnd myEnd = (AssociationEnd) ends.elementAt(0); IAssociati...
public boolean predicate(Object dm, Designer dsgr) { if (!(dm instanceof MMClass)) return NO_PROBLEM; MMClass cls = (MMClass) dm; Vector ends = cls.getAssociationEnd(); if (ends == null || ends.size() != 1) return NO_PROBLEM; AssociationEnd myEnd = (AssociationEnd) ends.elementAt(0); IAssociat...
public boolean supportsAddFolder(IMailFolder newFolder) { return true; } }
public boolean supportsAddFolder(String newFolderType) { return true; } }
public int postRequest(Request rreq, Response rres ) { //if( rreq.getContext() != ctx ) return; // throw log( "Recycling " + rreq ); HttpServletRequest req=(HttpServletRequest)rreq.getFacade(); if( ! (req instanceof HttpServletRequestFacade)) return 0; ((HttpServletRequestFacade)req).recycle(); // re...
public int postRequest(Request rreq, Response rres ) { //if( rreq.getContext() != ctx ) return; // throw // log( "Recycling " + rreq ); HttpServletRequest req=(HttpServletRequest)rreq.getFacade(); if( ! (req instanceof HttpServletRequestFacade)) return 0; ((HttpServletRequestFacade)req).recycle(); //...
if (aType.isProtected()) { // rewrite protected into public accessFlags |= AccPublic; } // clear all bits that are illegal for a class or an interface accessFlags &= ~( AccStrictfp | AccProtected | AccPrivate | AccStatic | AccSynchronized | AccNative); // set the AccSu...
if (aType.isProtected()) { // rewrite protected into public accessFlags |= AccPublic; } // clear all bits that are illegal for a class or an interface accessFlags &= ~( AccStrictfp | AccProtected | AccPrivate | AccStatic | AccSynchronized | AccNative); // set the AccSu...
public ThemeDescriptor(String id) { this.id = id; } /** * Add a color override to this descriptor. * * @param definition the definition to add */ void add(ColorDefinition definition) { if (colors.contains(definition)) { return; } colors.add(definition);...
public ThemeDescriptor(String id) { this.id = id; } /** * Add a color override to this descriptor. * * @param definition the definition to add */ void add(ColorDefinition definition) { if (colors.contains(definition)) { colors.remove(definition); } colo...
public ASTRewriteFormatter(NodeInfoStore placeholders, RewriteEventStore eventStore, Map options, String lineDelimiter) { this.placeholders= placeholders; this.eventStore= eventStore; if (options == null) { options= JavaCore.getOptions(); } options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, ...
public ASTRewriteFormatter(NodeInfoStore placeholders, RewriteEventStore eventStore, Map options, String lineDelimiter) { this.placeholders= placeholders; this.eventStore= eventStore; if (options == null) { options= JavaCore.getOptions(); } options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, ...
public SIGRecord(Name name, short dclass, int ttl, int covered, int alg, int origttl, Date expire, Date timeSigned, int footprint, Name signer, byte [] signature) { this(name, dclass, ttl); this.covered = (short) covered; this.alg = (byte) alg; this.labels = name.labels(); this.origttl = origttl; this.expir...
public SIGRecord(Name name, short dclass, int ttl, int covered, int alg, int origttl, Date expire, Date timeSigned, int footprint, Name signer, byte [] signature) { this(name, dclass, ttl); this.covered = (short) covered; this.alg = (byte) alg; this.labels = name.labels(); this.origttl = origttl; this.expir...
public void save(IProgressMonitor progress, boolean force) throws JavaModelException { // determine if saving is required if (isReadOnly() || this.file == null) { return; } if (!hasUnsavedChanges()) return; // use a platform operation to update the resource contents try { String encoding = null; try ...
public void save(IProgressMonitor progress, boolean force) throws JavaModelException { // determine if saving is required if (isReadOnly() || this.file == null) { return; } if (!hasUnsavedChanges()) return; // use a platform operation to update the resource contents try { String encoding = null; try ...
public Rectangle displayBox() { Enumeration k = points(); Rectangle r = new Rectangle((Point) k.nextElement()); while (k.hasMoreElements()) { r.add((Point) k.nextElement()); } return r; }
public Rectangle displayBox() { Enumeration k = points(); Rectangle r = new Rectangle(); while (k.hasMoreElements()) { r.add((Point) k.nextElement()); } return r; }
public String toString(int tab){ /* slow code */ String s = tabString(tab); s = s + "default : " ; return s;}
public String toString(int tab){ /* slow code */ String s = tabString(tab); s = s + "default : "/*nonNLS*/ ; return s;}
public String getServerInfo() { return contextM.getServerInfo(); }
public String getServerInfo() { return context.getEngineHeader(); }
public void selectionChanged(SelectionChangedEvent e) { if (((TreeSelectionChangedEvent) e).getSelected().length > 0) { AbstractFolder folder = ((TreeSelectionChangedEvent) e).getSelected()[0]; if (folder != null) { FolderItem item = folder.getFolderItem(); ...
public void selectionChanged(SelectionChangedEvent e) { if (((TreeSelectionChangedEvent) e).getSelected().length > 0) { AbstractFolder folder = ((TreeSelectionChangedEvent) e).getSelected()[0]; if (folder != null) { FolderItem item = folder.getConfiguration(); ...
public ShowViewMenu(IWorkbenchWindow window, String id) { super(id); this.window = window; WorkbenchHelp.setHelp(showDlgAction, IHelpContextIds.SHOW_VIEW_OTHER_ACTION); }
public ShowViewMenu(IWorkbenchWindow window, String id) { super(id); this.window = window; WorkbenchHelp.setHelp(showDlgAction, IWorkbenchHelpContextIds.SHOW_VIEW_OTHER_ACTION); }
protected IAnnotation enterAnnotation( org.eclipse.jdt.internal.compiler.ast.Annotation annotation, AnnotatableInfo parentInfo, JavaElement parentHandle) { if (annotation instanceof CompletionOnMarkerAnnotationName) { if (hasEmptyName(annotation.type, assistNode)) { super.enterAnnotation(annotation, ...
protected IAnnotation enterAnnotation( org.eclipse.jdt.internal.compiler.ast.Annotation annotation, AnnotatableInfo parentInfo, JavaElement parentHandle) { if (annotation instanceof CompletionOnMarkerAnnotationName) { if (hasEmptyName(annotation.type, this.assistNode)) { super.enterAnnotation(annotat...
public void run(EachTestNotifier context) { context.fireTestStarted(); try { fNext.evaluate(); } catch (AssumptionViolatedException e) { context.addFailedAssumption(e); } catch (Throwable e) { context.addFailure(e); } finally { context.fireTestFinished(); } }
public void run(EachTestNotifier context) { context.fireTestStarted(); try { fNext.evaluate(); } catch (AssumptionViolatedException e) { context.fireTestIgnored(); } catch (Throwable e) { context.addFailure(e); } finally { context.fireTestFinished(); } }
protected static IDropActionDelegate getPluginAdapter(PluginTransferData data) throws CoreException { IPluginRegistry registry = Platform.getPluginRegistry(); String adapterName = data.getExtensionId(); IExtensionPoint xpt = registry.getExtensionPoint(PlatformUI.PLUGIN_ID, IWorkbenchConstants.PL_DROP_ACTIONS); I...
protected static IDropActionDelegate getPluginAdapter(PluginTransferData data) throws CoreException { IExtensionRegistry registry = Platform.getExtensionRegistry(); String adapterName = data.getExtensionId(); IExtensionPoint xpt = registry.getExtensionPoint(PlatformUI.PLUGIN_ID, IWorkbenchConstants.PL_DROP_ACTION...
public Name getTarget() { return target; } void rrToWire(DataByteOutputStream out, Compression c, boolean canonical) { if (target == null) return; if (type == Type.DNAME) target.toWire(out, null, canonical); else target.toWire(out, c, canonical); }
public Name getTarget() { return target; } void rrToWire(DNSOutput out, Compression c, boolean canonical) { if (target == null) return; if (type == Type.DNAME) target.toWire(out, null, canonical); else target.toWire(out, c, canonical); }
protected int oBufferCount = 0; static final byte CRLF[]= { (byte)'\r', (byte)'\n' }; Log loghelper = new Log("tc_log", this);
protected int oBufferCount = 0; static final byte CRLF[]= { (byte)'\r', (byte)'\n' }; Log loghelper = Log.getLog("tc_log", this);
private void sweepContributions(IMenuManager mgr) { if (mgr == null) return; final IMenuService menuService = (IMenuService) part.getSite() .getService(IMenuService.class); InternalMenuService realService = (InternalMenuService) menuService; IContributionItem[] items = mgr.getItems(); for (int i = 0...
private void sweepContributions(IMenuManager mgr) { if (mgr == null) return; final IMenuService menuService = (IMenuService) part.getSite() .getService(IMenuService.class); InternalMenuService realService = (InternalMenuService) menuService; IContributionItem[] items = mgr.getItems(); for (int i = 0...
public void setLoggerRepository(LoggerRepository repository) throws IllegalStateException { if(repository == null) { throw new IllegalArgumentException("repository argument cannot be null"); } if(this.repository != null) { this.repository = repository; } else { throw new IllegalState...
public void setLoggerRepository(LoggerRepository repository) throws IllegalStateException { if(repository == null) { throw new IllegalArgumentException("repository argument cannot be null"); } if(this.repository == null) { this.repository = repository; } else { throw new IllegalState...
public void open() throws IOException { if (!opened) { summary= new IndexSummary(); numFiles= 0; numWords= 0; blockNum= 1; firstInBlock= true; firstIndexBlock= true; firstFileListBlock= true; indexOut= new SafeRandomAccessFile(this.indexFile, "rw"); opened= true; } }
public void open() throws IOException { if (!opened) { summary= new IndexSummary(); numFiles= 0; numWords= 0; blockNum= 1; firstInBlock= true; firstIndexBlock= true; firstFileListBlock= true; indexOut= new SafeRandomAccessFile(this.indexFile, "rw"/*nonNLS*/); opened= true; } }
public TypeBinding resolveType(BlockScope scope) { // Answer the signature type of the field. // constants are propaged when the field is final // and initialized with a (compile time) constant // regular receiver reference receiverType = receiver.resolveType(scope); if (receiverType == null){ constant = Not...
public TypeBinding resolveType(BlockScope scope) { // Answer the signature type of the field. // constants are propaged when the field is final // and initialized with a (compile time) constant // regular receiver reference receiverType = receiver.resolveType(scope); if (receiverType == null){ constant = Not...
static private void failNotEquals(String message, Object expected, Object actual) { throw new ComparisonFailure(message, expected.toString(), actual.toString()); }
static private void failNotEquals(String message, Object expected, Object actual) { throw new ComparisonFailure(message, expected == null ? "null" : expected.toString(), actual == null ? "null" : actual.toString()); }
* N.B. This constructor is package-private. * </p> * * @param ast the AST that is to own this node */ BodyDeclaration(AST ast) { super(ast); if (ast.API_LEVEL >= AST.LEVEL_3_0) { this.modifiers = new ASTNode.NodeList(internalModifiers2Property()); } }
* N.B. This constructor is package-private. * </p> * * @param ast the AST that is to own this node */ BodyDeclaration(AST ast) { super(ast); if (ast.apiLevel >= AST.LEVEL_3_0) { this.modifiers = new ASTNode.NodeList(internalModifiers2Property()); } }
protected void matchReportReference(AstNode reference, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { // need accurate match to be able to open on type ref if (accuracy == IJavaSearchResultCollector.POTENTIAL_MATCH) return; // element that references the type must be included in t...
protected void matchReportReference(AstNode reference, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { // need accurate match to be able to open on type ref if (accuracy == IJavaSearchResultCollector.POTENTIAL_MATCH) return; // element that references the type must be included in t...
public AnonymousFileSource(File directory) { if (!directory.exists()) { directory.mkdirs(); } else if (!directory.isDirectory()) { throw new IllegalArgumentException("Directory arguments should be a directory."); } fDirectory = directory; }
public AnonymousFileSource(File directory) { if (!directory.exists()) { directory.mkdirs(); } else if (!directory.isDirectory()) { throw new IllegalArgumentException("Directory arguments should be a directory."/*nonNLS*/); } fDirectory = directory; }
public void widgetSelected(SelectionEvent e) { ToolItem toolItem = (ToolItem) perspectiveBarMenu.getData(); if (toolItem != null && !toolItem.isDisposed()) { ActionContributionItem item = (ActionContributionItem) toolItem.getData(); SetPagePerspectiveAction action = (SetPagePerspectiveAction) ...
public void widgetSelected(SelectionEvent e) { ToolItem toolItem = (ToolItem) perspectiveBarMenu.getData(); if (toolItem != null && !toolItem.isDisposed()) { ActionContributionItem item = (ActionContributionItem) toolItem.getData(); SetPagePerspectiveAction action = (SetPagePerspectiveAction) ...
protected void saveMessage( String rawString, WorkerStatusController worker, Folder destFolder) throws Exception { destFolder.addMessage(rawString, worker); counter++; worker.setDisplayText("Importing messages: " + getCount()); }
protected void saveMessage( String rawString, WorkerStatusController worker, Folder destFolder) throws Exception { destFolder.addMessage(rawString); counter++; worker.setDisplayText("Importing messages: " + getCount()); }
public void testComparisonErrorMessage() { ComparisonFailure failure= new ComparisonFailure("a", "b", "c"); assertEquals("a: expected:<b> but was:<c>", failure.getMessage()); }
public void testComparisonErrorMessage() { ComparisonFailure failure= new ComparisonFailure("a", "b", "c"); assertEquals("a expected:<b> but was:<c>", failure.getMessage()); }
public int getNextToken() throws InvalidInputException { this.wasAcr = false; if (diet) { jumpOverMethodBody(); diet = false; return currentPosition > source.length ? TokenNameEOF : TokenNameRBRACE; } try { while (true) { //loop for jumping over comments withoutUnicodePtr = 0; //start with a new toke...
public int getNextToken() throws InvalidInputException { this.wasAcr = false; if (diet) { jumpOverMethodBody(); diet = false; return currentPosition > source.length ? TokenNameEOF : TokenNameRBRACE; } try { while (true) { //loop for jumping over comments withoutUnicodePtr = 0; //start with a new toke...
private RunNotifier fNotifier;
private static Computer defaultComputer() { return new Computer(); } }
public static String filterStack(String stack) { if (!getPreference("filterstack").equals("true") || fgFilterStack == false) return stack; StringWriter sw= new StringWriter(); PrintWriter pw= new PrintWriter(sw); StringReader sr= new StringReader(stack); BufferedReader br= new BufferedReader(sr); ...
public static String filterStack(String stack) { if (!getPreference("filterstack").equals("true") || fgFilterStack == false) return stack; StringWriter sw= new StringWriter(); PrintWriter pw= new PrintWriter(sw); StringReader sr= new StringReader(stack); BufferedReader br= new BufferedReader(sr); ...
public void resolve(BlockScope scope, boolean warn) { LocalVariableBinding variableBinding = scope.findVariable(this.token); if (variableBinding != null && variableBinding.isValidBinding() && variableBinding.isArgument) { this.binding = variableBinding; return; } if (warn) { try { MethodScope m...
public void resolve(BlockScope scope, boolean warn) { LocalVariableBinding variableBinding = scope.findVariable(this.token); if (variableBinding != null && variableBinding.isValidBinding() && ((variableBinding.tagBits & TagBits.IsArgument) != 0)) { this.binding = variableBinding; return; } if (warn) {...