id
int64
file_name
string
file_path
string
content
string
size
int64
language
string
extension
string
total_lines
int64
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
repo_name
string
repo_stars
int64
repo_forks
int64
repo_open_issues
int64
repo_license
string
repo_extraction_date
string
exact_duplicates_redpajama
bool
near_duplicates_redpajama
bool
exact_duplicates_githubcode
bool
exact_duplicates_stackv2
bool
exact_duplicates_stackv1
bool
near_duplicates_githubcode
bool
near_duplicates_stackv1
bool
near_duplicates_stackv2
bool
length
int64
1,319,952
TestWrappedLocal1.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/SurroundWithWorkSpace/SurroundWithTests/trycatch_out/TestWrappedLocal1.java
package trycatch_out; import java.io.File; import java.net.MalformedURLException; public class TestWrappedLocal1 { public void foo() { File file= null; /*[*/int i; try { i = 10; file.toURL();/*]*/ } catch (MalformedURLException e) { } i= 20; } }
273
Java
.java
15
15.4
38
0.677291
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
273
1,318,534
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test34/in/A.java
package p; public class A{ public static final int i= 0; }
60
Java
.java
4
13.75
30
0.75
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
60
1,320,037
TestSimple1.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/SurroundWithWorkSpace/SurroundWithTests/trycatch17_out/TestSimple1.java
package trycatch17_out; import java.io.FileNotFoundException; import java.io.InterruptedIOException; class TestSimple1 { void foo(int a) { try { /*[*/if (a < 10) throw new FileNotFoundException(); else throw new InterruptedIOException();/*]*/ } catch (FileNotFoundException | InterruptedIOException e) { } } }
333
Java
.java
14
21.142857
62
0.735849
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
333
1,316,263
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractInterface/testConstant82/out/A.java
package p; class A implements I { public static final int Y= 0; } class Test{ void f(){ int i= I.X; i= A.Y; } }
118
Java
.java
10
10.2
30
0.642202
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
118
1,311,709
ChangeTypeRefactoringContribution.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.core.manipulation/refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/ChangeTypeRefactoringContribution.java
/******************************************************************************* * Copyright (c) 2006, 2011 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.internal.corext.refactoring.scripting; import java.util.Map; import org.eclipse.core.runtime.CoreException; import org.eclipse.ltk.core.refactoring.Refactoring; import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; import org.eclipse.ltk.core.refactoring.RefactoringStatus; import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor; import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory; import org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments; import org.eclipse.jdt.internal.corext.refactoring.structure.ChangeTypeRefactoring; /** * Refactoring contribution for the extract interface refactoring. * * @since 3.2 */ public final class ChangeTypeRefactoringContribution extends JavaUIRefactoringContribution { @Override public Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) throws CoreException { JavaRefactoringArguments arguments= new JavaRefactoringArguments(descriptor.getProject(), retrieveArgumentMap(descriptor)); return new ChangeTypeRefactoring(arguments, status); } @Override public RefactoringDescriptor createDescriptor() { return RefactoringSignatureDescriptorFactory.createGeneralizeTypeDescriptor(); } @Override public RefactoringDescriptor createDescriptor(String id, String project, String description, String comment, Map<String, String> arguments, int flags) { return RefactoringSignatureDescriptorFactory.createGeneralizeTypeDescriptor(project, description, comment, arguments, flags); } }
2,162
Java
.java
43
48.325581
153
0.779252
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
true
true
true
true
true
true
true
2,162
4,601,871
CardView.java
ahmetkeles0_Bus-Ticket-Booking-Andriod-App/app/src/main/java/android/support/v7/widget/CardView.java
package android.support.v7.widget; import android.content.Context; import android.util.AttributeSet; import android.view.View; public class CardView extends View { public CardView(Context context) { this(context, null); } public CardView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public CardView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } }
462
Java
.java
15
26.333333
72
0.726862
ahmetkeles0/Bus-Ticket-Booking-Andriod-App
2
0
0
GPL-3.0
9/5/2024, 12:18:57 AM (Europe/Amsterdam)
false
false
false
true
false
false
true
true
462
525,512
ArticleService.java
373675032_molihub/src/service/ArticleService.java
package service; import domain.Article; import domain.ArticleToShow; import domain.Comment; import java.util.List; /** * 文章业务层接口 * * @User MOTI * @Time 2019/8/6 23:14 */ public interface ArticleService { /** * 添加文章 * * @param article */ void addArticle(Article article); /** * 分页获得所有的文章 * * @return */ List<ArticleToShow> getAllArticleByLimit(int pageNow); /** * 分页获得我的文章 * @param user_id * @param pageNow * @return */ List<ArticleToShow> getMyArticleByLimit(int user_id,int pageNow); /** * 分页获得他人的文章 * @param user_id * @param pageNow * @return */ List<ArticleToShow> getOtherArticleByLimit(int user_id,int pageNow); /** * 根据文章ID获得文章 * * @param articleId * @return */ ArticleToShow getArticleById(int articleId); /** * 获得我的文章 * @param article_id * @return */ Article getMyArticleById(int article_id); /** * 获得总页数,每页10个文章 * * @return */ int getPageNum(); /** * 获得我的文章总页数 * * @return */ int getMyPageNum(int user_id); /** * 获得他人文章的总页数 * @param user_id * @return */ int getOtherPageNum(int user_id); /** * 添加评论 * * @param comment */ void addComment(Comment comment); /** * 获得所有的评论 * * @return */ List<Comment> getAllComments(int article_id); /** * 获得文章的评论数 * * @param article_id * @return */ int getCommentsCount(int article_id); /** * 阅读文章阅读数加1 * * @param article_id */ void addArticleReadCount(int article_id); /** * 添加喜欢文章 * * @param user_id * @param article_id */ void addLike(int user_id, int article_id); /** * 删除喜欢文章 * * @param user_id * @param article_id */ void deleteLike(int user_id, int article_id); /** * 是不是已经是喜欢的文章 * * @param user_id * @param article_id */ boolean isLiked(int user_id, int article_id); /** * 获得文章的点赞数 * * @param article_id * @return */ int getLikeCount(int article_id); /** * 根据用户ID分页获得文章 * @param user_id * @return */ List<ArticleToShow> getAllArticleByUserId(int user_id); /** * 根据文章类别分页获得文章 * @param kind * @return */ List<ArticleToShow> getAllArticleByKind(String kind); /** * 根据文章标题分页获得文章 * @param title * @return */ List<ArticleToShow> getAllArticleByTitle(String title); /** * 根据文章标题获得我的文章 * @param title * @return */ List<ArticleToShow> getMyArticleByTitle(int user_id,String title); /** * 根据文章标题获得我的文章 * @param title * @return */ List<ArticleToShow> getOtherArticleByTitle(int user_id,String title); /** * 获得阅读排行榜文章(10个) * @return */ List<ArticleToShow> getTopByRead(); /** * 获得我的文章阅读排行榜文章(5个) * @return */ List<ArticleToShow> getMyTopByRead(int user_id); /** * 获得人气排行榜 * @return */ List<ArticleToShow> getTopLike(); /** * 更新文章的标签 * @param tag * @param article_id */ void updateArticleTag(String tag,int article_id); /** * 根据标签获得全部文章 * @param tag * @param user_id * @return */ List<ArticleToShow> getMyArticlesByTag(String tag, int user_id); /** * 根据标签获得他人的公开文章 * @param tag * @param user_id * @return */ List<ArticleToShow> getOtherArticlesByTag(String tag, int user_id); /** * 根据标签获得全部文章 * @param kind * @param user_id * @return */ List<ArticleToShow> getMyArticlesByKind(String kind, int user_id); /** * 根据标签获得全部文章 * @param kind * @param user_id * @return */ List<ArticleToShow> getOtherArticlesByKind(String kind, int user_id); /** * 删除文章 * @param article_id */ void deleteArticle(int article_id); /** * 更新文章 * @param article */ void updateArticle(Article article); /** * 修改用户名后要修改评论表用户名 * @param newName * @param oldName */ void updateComment(String newName,String oldName); /** * 根据文章id获得作者id * @param article_id * @return */ int getUserIdByArticleId(int article_id); /** * 获得我的文章的总数 * @param user_id * @return */ int getMyArticleCount(int user_id); /** * 获得他人的文章的总数 * @param user_id * @return */ int getOtherArticleCount(int user_id); }
5,323
Java
.java
236
14.177966
73
0.570096
373675032/molihub
165
39
3
GPL-3.0
9/4/2024, 7:07:37 PM (Europe/Amsterdam)
false
false
false
true
false
false
false
true
4,669
1,318,141
TestBodyUpdate.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testBodyUpdate/out/TestBodyUpdate.java
package p; import java.security.Permission; class s { int i(){return 5;} } public class TestBodyUpdate extends s{ Permission p; public static class FooParameter { public Permission p; public String s; public int i; public FooParameter(Permission p, String s, int i) { this.p = p; this.s = s; this.i = i; } } public void foo(FooParameter parameterObject){ int i = parameterObject.i; String s = parameterObject.s; i=i(); s=new s().i()+""; i+=super.i(); this.p=parameterObject.p; } }
523
Java
.java
26
17.5
54
0.697154
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
523
1,320,071
Util.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractInterface18/testLambda1/in/Util.java
package p; interface SAM1 { X apply(X x1); } interface SAM2 { X apply(X x1); } interface SAM3 { X apply(X x1); } interface SAM4 { X apply(X x1); } class A { X map(X x) { return null; } } class B extends A { @Override X map(X x) { return x; } } class Util { static SAM1 lambda1 = (x) -> { return x; }; static SAM2 lambda2 = x -> x; static SAM3 lambda3 = (X x) -> { return x; }; static SAM4 lambda4 = (X x) -> x; static A a; void f1(X x1) { // only change here x1.m1(); } void f2(X x2) { x2.m2(); } void f_via_A(X x1) { a.map(x1).m2(); } void f_via_lambda1(X x1) { lambda1.apply(x1).m2(); } void f_via_lambda2(X x1) { lambda2.apply(x1).m2(); } void f_via_lambda3(X x1) { lambda3.apply(x1).m2(); } void f_via_lambda4(X x1) { lambda4.apply(x1).m2(); } }
822
Java
.java
56
12.392857
36
0.61126
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
false
true
true
false
true
true
822
1,317,211
SomeOtherClass.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/RenameType/testSimilarElements13/out/SomeOtherClass.java
package p; /** * Local variables: Prefix "pm", Suffix "_pm" * Parameters: Prefix "lv", Suffix "_lv" * */ public class SomeOtherClass { public void foo1(SomeOtherClass pmSomeOtherClass) { SomeOtherClass lvSomeOtherClass; SomeOtherClass lvSomeOtherClass_lv; SomeOtherClass someOtherClass_lv; SomeOtherClass pmSomeOtherClass_pm; // wrong prefixes, but rename anyway. } public void foo2(SomeOtherClass pmSomeOtherClass_pm) { } public void foo3(SomeOtherClass someOtherClass_pm) { } }
507
Java
.java
18
25.666667
75
0.78125
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
507
1,317,052
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/RenameTypeParameter/testFail3/in/A.java
package p; class A<T,S>{ private int f; private String g; }
61
Java
.java
5
11
18
0.719298
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
61
1,316,043
SwitchCaseUpdates.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testSwitchCaseUpdates/out/SwitchCaseUpdates.java
package p; public class SwitchCaseUpdates { private SwitchCaseUpdatesParameter parameterObject = new SwitchCaseUpdatesParameter(); private void foo() { switch (parameterObject.getTest()) { case 5: parameterObject.setTest(7); break; case 7: parameterObject.setTest(5); } } }
290
Java
.java
11
23.909091
87
0.776978
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
290
4,060,495
HypercubeTest.java
heniancheng_FRODO/src/frodo2/solutionSpaces/hypercube/tests/HypercubeTest.java
/* FRODO: a FRamework for Open/Distributed Optimization Copyright (C) 2008-2013 Thomas Leaute, Brammert Ottens & Radoslaw Szymanek FRODO is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FRODO is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. How to contact the authors: <http://frodo2.sourceforge.net/> */ package frodo2.solutionSpaces.hypercube.tests; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.TreeMap; import frodo2.solutionSpaces.Addable; import frodo2.solutionSpaces.AddableInteger; import frodo2.solutionSpaces.AddableReal; import frodo2.solutionSpaces.BasicUtilitySolutionSpace; import frodo2.solutionSpaces.BasicUtilitySolutionSpace.Iterator; import frodo2.solutionSpaces.UtilitySolutionSpace; import frodo2.solutionSpaces.UtilitySolutionSpace.ProjOutput; import frodo2.solutionSpaces.hypercube.BasicHypercube; import frodo2.solutionSpaces.hypercube.Hypercube; import frodo2.solutionSpaces.hypercube.ScalarBasicHypercube; import frodo2.solutionSpaces.hypercube.ScalarHypercube; import junit.extensions.RepeatedTest; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** A class used to test the Hypercube class * * @author Ouaret Nacereddine, Thomas Leaute, Radoslaw Szymanek * @todo change every test in the following manner. If it fails, log the arguments and information * what has failed so the test can be repeated. */ public class HypercubeTest extends TestCase { /** * Variables are used to determine whether infinite values are allowed */ public enum Infinity {/** * No infinity is used */ NONE, /** * plus infinity is used */ PLUS_INFINITY, /** * min infinity is used */ MIN_INFINITY}; /** * This variable is used to make sure that one does not mix plus infinity and * min infinity in the testing */ public static Infinity inf = Infinity.NONE; /** * This variable is used to choose between maximising and minimising during the tests */ public boolean maximize; /** Contructor that returns a TestCase consisting of a single test method * @param name the name of the method to be used */ public HypercubeTest(String name) { super(name); } /** * @see junit.framework.TestCase#setUp() */ public void setUp() { // Randomly choose whether we should maximize or minimize maximize = Math.random() > 0.5; if(Math.random() < 0.2) { if(maximize) { inf = Infinity.NONE; } else { inf = Infinity.PLUS_INFINITY; } } else if (Math.random() < 0.2) { if(!maximize) { inf = Infinity.NONE; } else { inf = Infinity.MIN_INFINITY; } } else { inf = Infinity.NONE; } } /** Builds up a test suite * @author Thomas Leaute * @return a TestSuite in which randomized test methods are run multiple times, and others only once */ public static Test suite() { TestSuite testSuite = new TestSuite ("Tests for the Hypercube class"); TestSuite suiteTmp = new TestSuite ("Tests for the method testSaveAsXMLRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testSaveAsXMLRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests that a hypercube is always equal to its clone"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testEqualClonesRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests that a hypercube is equivalent to itself with reordered variables"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testEquivalentRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testJoinRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testJoinRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testApplyJoinRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testApplyJoinRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testProjectionRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testProjectionRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testBlindProjectRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testBlindProjectRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testApplyProjectRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testApplyProjectRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testProjOutputRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testProjOutputRandom"), 50000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testProjOutputRandom2"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testProjOutputRandom2"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testSliceRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testSliceRandom"), 5000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testApplySliceRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testApplySliceRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testSplittingRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testSplittingRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testChangeVariablesOrderRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testChangeVariablesOrderRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testApplyChangeVariablesOrderRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testApplyChangeVariablesOrderRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testGetUtility"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testGetUtility"), 1000)); testSuite.addTest(suiteTmp); testSuite.addTest(new HypercubeTest ("testProjection")); suiteTmp = new TestSuite ("Tests for the method testSerializationRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testSerializationRandom"), 20)); testSuite.addTest(suiteTmp); testSuite.addTest(new HypercubeTest ("testSerializationNullHypercube")); testSuite.addTest(new HypercubeTest ("testUnion")); suiteTmp = new TestSuite ("Tests for the method testProjectAllRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testProjectAllRandom"), 20)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testSmartJoinRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testSmartJoinRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testSmartMultiplyRandom"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testSmartMultiplyRandom"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method testExpectation"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testExpectation"), 2000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method compose"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testCompose"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method sample"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testSample"), 100)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method consensus with weighted samples"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testConsensusWeighted"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method consensusExpect with weighted samples"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testConsensusWeightedExpect"), 1000)); testSuite.addTest(suiteTmp); suiteTmp = new TestSuite ("Tests for the method iterator that takes in a list of variables"); suiteTmp.addTest(new RepeatedTest (new HypercubeTest ("testIterator"), 1000)); testSuite.addTest(suiteTmp); return testSuite; } /** Tests the saving to XML functionality */ public void testSaveAsXMLRandom() { Hypercube< AddableInteger, AddableInteger > h1 = random_hypercube(); h1.saveAsXML("test_save.xml"); Hypercube< AddableInteger, AddableInteger > h2 = new Hypercube<AddableInteger, AddableInteger>("test_save.xml"); assertTrue(h2.equals(h1)); } /** Tests that a hypercube is equal to a clone of itself */ public void testEqualClonesRandom() { Hypercube< AddableInteger, AddableInteger > h1 = random_hypercube(); Hypercube< AddableInteger, AddableInteger > h2 = h1.clone(); assertTrue (h1.equals(h2)); } /** Tests that a hypercube is equivalent to itself with reordered variables */ public void testEquivalentRandom() { Hypercube< AddableInteger, AddableInteger > h1 = random_hypercube(); // Choose a random new order for the variables in h1 ArrayList<String> newOrder = new ArrayList<String> (Arrays.asList(h1.getVariables())); String[] newOrder2 = new String[newOrder.size()]; for (int i = 0; i < newOrder2.length; i++) newOrder2[i] = newOrder.remove((int)(newOrder.size() * Math.random())); assertTrue (h1.equivalent(h1.changeVariablesOrder(newOrder2))); } /**This method creates random number of hypercubes and then first join the hypercubes with one call of the join method. * then join the hypercube two by two and compare the two results. */ @SuppressWarnings("unchecked") public void testJoinRandom() { String[] total_variables = new String[12]; for(int i=0;i<12;i++) total_variables[i] = "X"+i; int number_of_hypercube = 1 + (int) ( Math.random() * 5 ); Hypercube< AddableInteger, AddableInteger >[] hypercubes = new Hypercube[number_of_hypercube]; Hypercube< AddableInteger, AddableInteger > h1 = random_hypercube(); for(int i=0;i<number_of_hypercube;i++){ hypercubes[i] = random_hypercube(); } UtilitySolutionSpace<AddableInteger, AddableInteger> h2 = h1.join(hypercubes); //----------------------------------------------------------------------// //join the hypercubes 2 by 2 UtilitySolutionSpace<AddableInteger, AddableInteger> h3 = h1; for(int i=0;i<number_of_hypercube;i++){ h3 = h3.join(hypercubes[i], total_variables); } assertTrue(h2.equals(h3)); //join using the second implementation of the join operation h3 = h1; for(int i=0;i<number_of_hypercube;i++){ h3 = (Hypercube<AddableInteger, AddableInteger>) h3.join(hypercubes[i], total_variables); } assertTrue(h2.equals(h3)); } /** This method creates two random hypercubes change the variables order of the second hypercube so that * the variables order of the two hypercubes is not necessarily consistent, then joins these two hypercubes * by using join and applyJoin methods, and compares the two outputs */ public void testApplyJoinRandom() { Hypercube<AddableInteger, AddableInteger> h1 = random_hypercube(); Hypercube<AddableInteger, AddableInteger> h2 = random_hypercube(); ArrayList<String> tmp = new ArrayList<String>(); String[] variables = h2.getVariables(); int length = variables.length; int index; while(tmp.size()<length){ index = (int)(Math.random()*length); if(!tmp.contains(variables[index])) tmp.add(variables[index]); } String[] variables2 = new String[length]; System.arraycopy(tmp.toArray(), 0, variables2, 0, length); h2 = (Hypercube<AddableInteger, AddableInteger>)h2.changeVariablesOrder(variables2); Hypercube<AddableInteger, AddableInteger> h3 = (Hypercube<AddableInteger, AddableInteger>) h1.clone().join(h2.clone()); Hypercube<AddableInteger, AddableInteger> h4 = (Hypercube<AddableInteger, AddableInteger>) h1.applyJoin(h2); assertTrue(h3.equivalent(h4)); } /**This method creates two random hypercubes and an array of random variables obtained from the variables of each hypercube. * then it projects from the two hypercubes the two random arrays of variables and joins the resulting hypercubes. * It compares the result obtained with the one obtained if the join operation is done first. */ public void testProjectionRandom() { String[] total_variables = new String[12]; for(int i=0;i<12;i++) total_variables[i] = "X"+i; Hypercube<AddableInteger, AddableInteger> h1, h2; String[] variables1, variables2; // Loop until we get a proper random test case while (true) { h1 = random_hypercube(); //h1.saveAsXML("save00.xml"); h2 = random_hypercube(); //h2.saveAsXML("save01.xml"); String[] variables3 = Hypercube.sub( h1.getVariables(), h2.getVariables() ); String[] variables4 = Hypercube.sub( h2.getVariables(), h1.getVariables() ); //projected out variables must not be shared between the two hypercubes if( (variables3.length == 0) || (variables4.length == 0) ) continue; variables1 = sub_variables( variables3 ); variables2 = sub_variables( variables4 ); if( (variables3.length != variables1.length) && (variables4.length != variables2.length) ) break; } String[] variables = union(variables1, variables2, total_variables); //project then join the two hypercubes UtilitySolutionSpace<AddableInteger, AddableInteger> h3 = ((Hypercube<AddableInteger, AddableInteger>)h2.project( variables2, maximize ).getSpace()).join( (Hypercube<AddableInteger, AddableInteger>)h1.project( variables1, maximize ).getSpace(), total_variables ); //join then project the two hypercubes UtilitySolutionSpace<AddableInteger, AddableInteger> h4 = h1.join( h2, total_variables ).project( variables, maximize ).getSpace(); assertTrue( h3.equals(h4) ); //this time use the second implementation of the join UtilitySolutionSpace<AddableInteger, AddableInteger> h5 = ((Hypercube<AddableInteger, AddableInteger>) h2.project( variables2, maximize ).getSpace()).join( (Hypercube<AddableInteger, AddableInteger>) h1.project( variables1, maximize ).getSpace(), total_variables ); UtilitySolutionSpace<AddableInteger, AddableInteger> h6 = ((Hypercube<AddableInteger, AddableInteger>) h1.join( h2, total_variables ).project( variables1, maximize ).getSpace()).project( variables2, maximize ).getSpace(); assertTrue( h5.equals(h6) ); assertTrue( h4.equals(h5) ); } /** This method creates a random hypercube and a random array of variables, then checks that the result of the projection of these variables out of the hypercube * by using project and applyProject is the same */ public void testApplyProjectRandom() { Hypercube<AddableInteger, AddableInteger> h1 = random_hypercube(); String[] variables_names = sub_variables(h1.getVariables()); ProjOutput<AddableInteger,AddableInteger> projOutput = h1.project(variables_names, maximize); ProjOutput<AddableInteger,AddableInteger> projOutput2 = h1.clone().applyProject(variables_names, maximize); // Check the spaces assertTrue(projOutput.space.equals(projOutput2.space)); // Check the optimal assignments this.verifyProjection(h1, projOutput, variables_names); this.verifyProjection(h1, projOutput2, variables_names); } /** This method tests that the projection method (taking a list of variables) computes the correct optimal assignments * @author Thomas Leaute */ public void testProjOutputRandom () { Hypercube<AddableInteger, AddableInteger> hypercube = random_hypercube(); // Randomly choose variables to project ArrayList<String> varsTmp = new ArrayList<String> (hypercube.getNumberOfVariables()); String[] hypercubeVars = hypercube.getVariables(); for (String var : hypercubeVars) { if (Math.random() > 0.5) { varsTmp.add(var); } } String[] vars = varsTmp.toArray(new String[0]); verifyProjection (hypercube, hypercube.project(vars, maximize), vars); } /** This method tests that the projection method (taking a number of variables) computes the correct optimal assignments * @author Thomas Leaute */ public void testProjOutputRandom2 () { Hypercube<AddableInteger, AddableInteger> hypercube = random_hypercube(); // Randomly choose the number of variables to project out int nbrVars = (int) ((hypercube.getNumberOfVariables() + 1) * Math.random()); // Build up the list of variables projected out String[] vars = new String[nbrVars]; int nbrVarsKept = hypercube.getNumberOfVariables() - nbrVars; for (int i = 0; i < nbrVars; i++) { vars[i] = hypercube.getVariable(i + nbrVarsKept); } verifyProjection (hypercube, hypercube.project(nbrVars, maximize), vars); } /** Verifies the output of the projection method * @param hypercube the initial hypercube * @param projOutput the result of the projection * @param vars the variables projected out */ private void verifyProjection (Hypercube<AddableInteger, AddableInteger> hypercube, UtilitySolutionSpace.ProjOutput<AddableInteger, AddableInteger> projOutput, String[] vars) { assertTrue (Arrays.asList(vars).equals(Arrays.asList(projOutput.getVariables()))); Hypercube<AddableInteger, AddableInteger> hypercubeProj = (Hypercube<AddableInteger, AddableInteger>) projOutput.getSpace(); int nbrVars = vars.length; if (nbrVars == 0) { // no variables projected out assertTrue (hypercubeProj.equivalent(hypercube)); assertTrue (((BasicHypercube<AddableInteger, ArrayList<AddableInteger>>)projOutput.getAssignments()).isNull()); } else { long nbrAssignments = projOutput.getAssignments().getNumberOfSolutions(); for (long i = 0; i < nbrAssignments; i++) { ArrayList<AddableInteger> assignment = projOutput.getAssignments().getUtility(i); AddableInteger[][] sub_domains = new AddableInteger[nbrVars][]; for (int j = 0; j < nbrVars; j++) { AddableInteger[] val = { assignment.get(j) }; sub_domains[j] = val; } BasicHypercube<AddableInteger, AddableInteger> slice = (BasicHypercube<AddableInteger, AddableInteger>)hypercube.slice(vars, sub_domains); assertTrue (slice.getUtility(i).equals(hypercubeProj.getUtility(i))); } } } /** This method creates two random hypercubes, performs a slice on them, and them joins the two sliced hypercubes. * It compares the result with the one obtained if the join is performed first. */ public void testSliceRandom(){ String[] total_variables = new String[12]; for(int i=0;i<12;i++) total_variables[i] = "X"+i; Hypercube<AddableInteger, AddableInteger> h1, h2; ArrayList<String> slicedVars = new ArrayList<String> (); ArrayList< AddableInteger[] > slicingDoms = new ArrayList< AddableInteger[] > (); // Loop until we get a proper test case while (true) { h1 = random_hypercube(); h2 = random_hypercube(); // Choose a random list of variables to slice over slicedVars.clear(); for (String var : total_variables) if (Math.random() > 0.5) slicedVars.add(var); // Compute the slicing subdomain for each sliced variable // The restrictions are that if the variable is contained in one hypercube, its slicing domain must be a subset of the one in the hypercube, // and furthermore the slicing domain must not be empty. slicingDoms.clear(); List<String> h1Vars = Arrays.asList(h1.getVariables()); List<String> h2Vars = Arrays.asList(h2.getVariables()); boolean ok = true; for (String var : slicedVars) { if (h1Vars.contains(var)) { if (h2Vars.contains(var)) { // Both hypercubes contain the variable; its slicing domain must be a subset of its domains in the two hypercubes AddableInteger[] dom = intersection(h1.getDomain(var), h2.getDomain(var)); if (dom.length == 0) { ok = false; break; } slicingDoms.add(dom); } else // only h1 contains the variable slicingDoms.add(h1.getDomain(var)); } else if (h2Vars.contains(var)) { // only h2 contains the variable slicingDoms.add(h2.getDomain(var)); } else // neither h1 nor h2 contains the variable; the domain doesn't matter slicingDoms.add(new AddableInteger[] {new AddableInteger(0), new AddableInteger(1), new AddableInteger(3)}); } if (!ok) // one slicing variable has non-intersecting domains in the two hypercubes continue; // Now, randomly reduce the sizes of the slicing domains for (int i = 0; i < slicingDoms.size(); i++) { ArrayList<AddableInteger> subdom = new ArrayList<AddableInteger> (); AddableInteger[] dom = slicingDoms.get(i); for (AddableInteger val : dom) if (Math.random() > 0.75) subdom.add(val); if (subdom.isEmpty()) // we don't want empty slicing domains subdom.add(dom[0]); slicingDoms.set(i, (AddableInteger[]) subdom.toArray(new AddableInteger[subdom.size()])); } // We got a proper test case break; } String[] variables = (String[]) slicedVars.toArray(new String[slicedVars.size()]); AddableInteger[][] sub_domains = (AddableInteger[][]) slicingDoms.toArray(new AddableInteger[slicingDoms.size()][]); // Slice then join Hypercube<AddableInteger, AddableInteger> h1Slice = (Hypercube<AddableInteger, AddableInteger>)h1.slice(variables, sub_domains); Hypercube<AddableInteger, AddableInteger> h2Slice = (Hypercube<AddableInteger, AddableInteger>)h2.slice(variables, sub_domains); Hypercube<AddableInteger, AddableInteger> h3 = (Hypercube<AddableInteger, AddableInteger>) h2Slice.join( h1Slice, total_variables); // Join then slice Hypercube<AddableInteger, AddableInteger> h4 = (Hypercube<AddableInteger, AddableInteger>)h2.join(h1, total_variables).slice( variables, sub_domains ); assertTrue(h3.equals(h4)); } /** * Creates one random hypercube and tests if slice and applySlice return the same output */ public void testApplySliceRandom(){ String[] total_variables = new String[12]; for(int i=0;i<12;i++) total_variables[i] = "X"+i; Hypercube<AddableInteger, AddableInteger> h1; ArrayList<String> slicedVars = new ArrayList<String> (); ArrayList< AddableInteger[] > slicingDoms = new ArrayList< AddableInteger[] > (); h1 = random_hypercube(); // Choose a random list of variables to slice over for (String var : total_variables) if (Math.random() > 0.5) slicedVars.add(var); // Compute the slicing subdomain for each sliced variable // The restrictions are that if the variable is contained in one hypercube, its slicing domain must be a subset of the one in the hypercube, // and furthermore the slicing domain must not be empty. List<String> h1Vars = Arrays.asList(h1.getVariables()); for (String var : slicedVars) { if (h1Vars.contains(var)) { slicingDoms.add(h1.getDomain(var)); } else slicingDoms.add(new AddableInteger[] {new AddableInteger(0), new AddableInteger(1), new AddableInteger(3)}); } // Now, randomly reduce the sizes of the slicing domains for (int i = 0; i < slicingDoms.size(); i++) { ArrayList<AddableInteger> subdom = new ArrayList<AddableInteger> (); AddableInteger[] dom = slicingDoms.get(i); for (AddableInteger val : dom) if (Math.random() > 0.75) subdom.add(val); if (subdom.isEmpty()) // we don't want empty slicing domains subdom.add(dom[0]); slicingDoms.set(i, (AddableInteger[]) subdom.toArray(new AddableInteger[subdom.size()])); } String[] variables = (String[]) slicedVars.toArray(new String[slicedVars.size()]); AddableInteger[][] sub_domains = (AddableInteger[][]) slicingDoms.toArray(new AddableInteger[slicingDoms.size()][]); Hypercube<AddableInteger, AddableInteger> h1Slice = (Hypercube<AddableInteger, AddableInteger>)h1.slice(variables, sub_domains); Hypercube<AddableInteger, AddableInteger> h2Slice = (Hypercube<AddableInteger, AddableInteger>)h1.applySlice(variables, sub_domains); assertTrue(h1Slice.equals(h2Slice)); } /**this method creates a random hypercube. then project the hypercube into a random a set of its variables and split the resulting hypercube * then it compare the result with the one obtained when splitting first */ public void testSplittingRandom() { Hypercube<AddableInteger, AddableInteger> h1; String[] variables; // Loop until we get a proper test case while (true) { h1 = random_hypercube(); variables = sub_variables(h1.getVariables()); if( variables.length != h1.getVariables().length) break; } AddableInteger max = null; for( int i = 0; i < h1.getNumberOfSolutions(); i++ ) { AddableInteger v = h1.getUtility(i); if( max == null ) max = v; else if( max.compareTo( v ) > 0 ) max = v; } AddableInteger threshold = new AddableInteger( ( int )( max.intValue() * 0.5 ) ); //combine projection and splitting Hypercube<AddableInteger, AddableInteger> h3 = ((Hypercube<AddableInteger, AddableInteger>)h1.project( variables, true ).getSpace()).split( threshold, true ); Hypercube<AddableInteger, AddableInteger> h4 = (Hypercube<AddableInteger, AddableInteger>)h1.split( threshold, true ).project( variables, true ).getSpace(); assertTrue(h3.equals(h4)); } /** Tests changing the order of variables */ public void testChangeVariablesOrderRandom() { Hypercube<AddableInteger, AddableInteger> h1 = random_hypercube(); ArrayList<String> tmp = new ArrayList<String>(); String[] variables = h1.getVariables(); int length = variables.length; int index; while(tmp.size()<length){ index = (int)(Math.random()*length); if(!tmp.contains(variables[index])) tmp.add(variables[index]); } String[] variables2 = new String[length]; System.arraycopy(tmp.toArray(), 0, variables2, 0, length); Hypercube<AddableInteger, AddableInteger> h2 = (Hypercube<AddableInteger, AddableInteger>)h1.changeVariablesOrder(variables2); Hypercube<AddableInteger, AddableInteger> h3 = (Hypercube<AddableInteger, AddableInteger>)h2.changeVariablesOrder(variables); assertTrue(h1.equivalent(h2)); assertTrue(h1.equals(h3)); } /** * creates a random hypercube and tests whether changeVariablesOrder and applyChangeVariablesOrder return the same output */ public void testApplyChangeVariablesOrderRandom() { Hypercube<AddableInteger, AddableInteger> h = random_hypercube(); ArrayList<String> tmp = new ArrayList<String>(); String[] variables = h.getVariables(); int length = variables.length; int index; while(tmp.size()<length){ index = (int)(Math.random()*length); if(!tmp.contains(variables[index])) tmp.add(variables[index]); } String[] variables2 = tmp.toArray(new String[length]); Hypercube<AddableInteger, AddableInteger> h1 = (Hypercube<AddableInteger, AddableInteger>)h.clone(); h1.applyChangeVariablesOrder(variables2); Hypercube<AddableInteger, AddableInteger> h2 = (Hypercube<AddableInteger, AddableInteger>)h1.changeVariablesOrder(variables); assertTrue(h.equivalent(h1)); assertTrue(h.equals(h2)); } /** This method creates a random hypercube, then gets all its utilities values and store them in a new arrray, * and finally checks this array is identical to the utilities array of the original hypercube */ public void testGetUtility(){ Hypercube<AddableInteger, AddableInteger> h = random_hypercube(); String[] variables = h.getVariables(); int number_of_variables = variables.length; AddableInteger[] variables_values = new AddableInteger[number_of_variables]; AddableInteger[][] domains = h.getDomains(); AddableInteger[] domain; long number_of_utilities = h.getNumberOfSolutions(); assert number_of_utilities < Integer.MAX_VALUE : "Too many solutions"; AddableInteger[] results = new AddableInteger[(int) number_of_utilities]; int[] indexes = new int[number_of_variables]; int index_to_increment = number_of_variables - 1; int index; for(int i = 0 ; i < number_of_utilities ; i++){ for(int j = number_of_variables - 1; j >= 0; j--){ index = indexes[ j ]; domain = domains[ j ]; //the current value of the jth variable variables_values[ j ] = domain[ index ]; //increment or not the value index of this variable if(j == index_to_increment){ index = ( index + 1 ) % domain.length; indexes[ j ] = index; // when a whole loop over all values of this variable is done, increment also the next variable which //is previous to this one in order if(index == 0) index_to_increment--; else index_to_increment = number_of_variables - 1; } } results[ i ] = h.getUtility( variables, variables_values ); } for(int i = 0 ; i < number_of_utilities ; i++){ assertTrue(results[i].equals(h.getUtility(i))); } } /** Computes a random sublist of the input list of variables * @param variables list of variables * @return a random sublist of variables */ private String[] sub_variables(String[] variables){ if (variables.length == 0) return new String[0]; ArrayList<String> sub_variables_tmp = new ArrayList<String>(); String[] sub_variables; while(sub_variables_tmp.size() == 0) { for(String v : variables){ if( (Math.random()<0.4) && !sub_variables_tmp.contains(v) ) { sub_variables_tmp.add(v); } } } sub_variables = new String[sub_variables_tmp.size()]; System.arraycopy(sub_variables_tmp.toArray(), 0, sub_variables, 0, sub_variables_tmp.size()); return sub_variables; } /** @return a random hypercube */ public static Hypercube<AddableInteger, AddableInteger> random_hypercube() { return random_hypercube(0.1); } /** * @param prob for any given utility, the probability that it be infinite * @return random hypercube * @todo This implementation is too restrictive (imposes an order on variables, values...). */ public static Hypercube<AddableInteger, AddableInteger> random_hypercube(double prob){ return random_hypercube(prob, AddableInteger.class); } /** * @param <U> the class used for utility values * @param prob for any given utility, the probability that it be infinite * @param utilClass the class used for utility values * @return random hypercube * @todo This implementation is too restrictive (imposes an order on variables, values...). */ public static < U extends Addable<U> > Hypercube<AddableInteger, U> random_hypercube(double prob, Class<U> utilClass){ String variable_name; int domain_size; //pick a random number of variables int number_variables = 2 + (int)(4*Math.random()); String[] variables_names = new String[number_variables]; AddableInteger[][] variables_domains = new AddableInteger[number_variables][]; //set random domains for the variables int shift = (int)(5*Math.random()); int number_of_utility_values = 1; for(int j=0;j<number_variables;j++){ variable_name = "X"+(j+shift); variables_names[j] = variable_name; domain_size = 2 + (int)(3*Math.random()); variables_domains[j] = new AddableInteger[domain_size]; for(int k=0;k<domain_size;k++){ variables_domains[j][k] = new AddableInteger (k); } number_of_utility_values *= domain_size; } U infeasibleUtil = null; try { if (inf == Infinity.PLUS_INFINITY) infeasibleUtil = utilClass.newInstance().getPlusInfinity(); else infeasibleUtil = utilClass.newInstance().getMinInfinity(); } catch (Exception e) { fail(); } @SuppressWarnings("unchecked") U[] utility_values = (U[]) Array.newInstance(utilClass, number_of_utility_values); for(int j=0;j<number_of_utility_values;j++){ if(inf != Infinity.NONE && Math.random() < prob) { utility_values[j] = infeasibleUtil; } else { utility_values[j] = infeasibleUtil.fromString(Integer.toString((int) (20 * Math.random()))); } } return new Hypercube<AddableInteger, U>(variables_names,variables_domains,utility_values, infeasibleUtil); } /** * @param number_variables number of variables of the generated Hypercube will contain * @param domain_size number of values that the domains of the variables of the Hypercube * @param redundancy redundancy in the array of utilities (between 0 - 100) * @param shift the number starting with which the variables should be named (Xshift, X(shift+1)...) * @return a random hypercube, with some random utilities set to -1 */ public static Hypercube <AddableInteger, AddableInteger> random_hypercube (int number_variables, int domain_size, int redundancy, int shift) { return random_hypercube (number_variables, domain_size, redundancy, shift, null, AddableInteger.class); } /** * @param number_variables number of variables of the generated Hypercube will contain * @param domain_size number of values that the domains of the variables of the Hypercube * @param redundancy redundancy in the array of utilities (between 0 - 100) * @param shift the number starting with which the variables should be named (Xshift, X(shift+1)...) * @param infeasibleUtil the infeasible utility * @return a random hypercube, with some random utilities set to -1 */ public static Hypercube <AddableInteger, AddableInteger> random_hypercube (int number_variables, int domain_size, int redundancy, int shift, AddableInteger infeasibleUtil) { return random_hypercube (number_variables, domain_size, redundancy, shift, infeasibleUtil, AddableInteger.class); } /** * @param <U> the type of utility values * @param number_variables number of variables of the generated Hypercube will contain * @param domain_size number of values that the domains of the variables of the Hypercube * @param redundancy redundancy in the array of utilities (between 0 - 100) * @param shift the number starting with which the variables should be named (Xshift, X(shift+1)...) * @param infeasibleUtil the infeasible utility * @param utilClass the type of utility values * @return a random hypercube, with some random utilities set to -1 */ @SuppressWarnings("unchecked") public static < U extends Addable<U> > Hypercube <AddableInteger, U> random_hypercube (int number_variables, int domain_size, int redundancy, int shift, U infeasibleUtil, Class<U> utilClass) { int first_value; //array of the variables of the Hypercube String[] variables_names = new String[number_variables]; //array of the domains of the variables AddableInteger[][] variables_domains = new AddableInteger[number_variables][]; //array of the utility values U[] utility_values; //counter of number of utilities that the Hypercube must contain int number_of_utilities = 1; /// variables names and their domains /// for(int j=0;j<number_variables;j++){ //name of the variable variables_names[j] = "X"+(j+shift); //fill the domain of the variable variables_domains[j] = new AddableInteger[domain_size]; first_value = (int)Math.random()*domain_size; for(int k=0;k<domain_size;k++){ variables_domains[j][k] = new AddableInteger (first_value + k); } //increase the counter number_of_utilities *= domain_size; } /// array of utilities /// int nb = (int) (number_of_utilities * redundancy / 100); utility_values = (U[]) Array.newInstance(utilClass, number_of_utilities); U utilInstance = null; try { utilInstance = utilClass.newInstance(); } catch (Exception e) { fail(); } for(int j=0;j<number_of_utilities;j++){ utility_values[j] = utilInstance.fromString(Integer.toString( (int)(Math.random()*nb) )); } return new Hypercube<AddableInteger, U>(variables_names,variables_domains,utility_values, infeasibleUtil); } /** Computes the union of two lists, respecting the input total order on the elements * @param array1 the first list * @param array2 the second list * @param total_variables the desired total order on the elements * @return union of the two input lists */ private String[] union( String[] array1, String[] array2 , String[] total_variables) { int array1_size = array1.length; int array2_size = array2.length; int index = 0, index1 = 0, index2 = 0; String v1, v2, v; String[] union_tmp = new String[ array1_size + array2_size ]; boolean not_found; int index3 = 0; while( ( index1 < array1_size ) || ( index2 < array2_size ) ) { v = total_variables[index3]; not_found = true; if( index1 < array1_size ) { v1 = array1[ index1 ]; if( v.equals( v1 )) { union_tmp[ index ] = v1; not_found = false; index1++; index++; } } if( index2 < array2_size ) { v2 = array2[ index2 ]; if(v.equals(v2)) { if( not_found ) { union_tmp[ index ] = v2; index++; } index2++; } } index3++; } if(index == 0) return null; String[] union = new String[index]; System.arraycopy(union_tmp, 0, union, 0, index); return union; } /** Computes the intersection of two lists * @param <T> the type of the elements in the lists * @param array1 the first list * @param array2 the second list * @return the intersection of the two lists */ @SuppressWarnings("unchecked") private < T extends Comparable<T> > T[] intersection( T[] array1, T[] array2 ) { int array1_size = array1.length; int array2_size = array2.length; int index = 0, index1 = 0, index2 = 0; T v1, v2; Class<?> classOfT = array1.getClass().getComponentType(); T[] intersection_tmp = (T[]) Array.newInstance(classOfT, Math.min( array1_size, array2_size ) ); while( ( index1 < array1_size ) && ( index2 < array2_size ) ) { v1 = array1[ index1 ]; v2 = array2[ index2 ]; if( v1.compareTo(v2) == 0 ) { index1 ++; index2 ++; intersection_tmp[ index ] = v1; index++; } else { if( v1.compareTo(v2) < 0 ) index1++; else index2++; } } if( index == 0 ) return (T[]) Array.newInstance(classOfT, 0); T[] intersection = (T[]) Array.newInstance(classOfT, index); System.arraycopy(intersection_tmp, 0, intersection, 0, index); return intersection; } /** Tests the projection methods on a simple example */ public void testProjection () { Hypercube<AddableInteger, AddableInteger> in = new Hypercube<AddableInteger, AddableInteger> ("src/frodo2/solutionSpaces/hypercube/tests/files/proj_1_in.xml"); UtilitySolutionSpace.ProjOutput<AddableInteger, AddableInteger> proj = in.project(1, true); Hypercube<AddableInteger, AddableInteger> out = new Hypercube<AddableInteger, AddableInteger> ("src/frodo2/solutionSpaces/hypercube/tests/files/proj_1_out.xml"); assertTrue(out.equals(proj.getSpace())); proj = in.project("X3", true); assertTrue(out.equals(proj.getSpace())); in = new Hypercube<AddableInteger, AddableInteger> ("src/frodo2/solutionSpaces/hypercube/tests/files/proj_2_in.xml"); proj = in.project("X1", false); out = new Hypercube<AddableInteger, AddableInteger> ("src/frodo2/solutionSpaces/hypercube/tests/files/proj_2_out.xml"); assertTrue(out.equals(proj.getSpace())); } /** Tests the serialization of a random hypercube * @author Thomas Leaute * @throws IOException if unable to create the pipes, or an I/O error occurs when deserializing the hypercube * @throws ClassNotFoundException should never happen */ @SuppressWarnings("unchecked") public void testSerializationRandom() throws IOException, ClassNotFoundException { // Thread used to write an object to a stream class StreamWriter extends Thread { private ObjectOutputStream out; private Object obj; /** Constructor * @param out the output stream * @param obj the object to be written */ public StreamWriter (ObjectOutputStream out, Object obj) { this.out = out; this.obj = obj; start(); } public void run() { try { out.writeObject(obj); } catch (IOException e) { e.printStackTrace(); } } } Hypercube<AddableInteger, AddableInteger> h1 = random_hypercube(); // Create connected piped streams PipedOutputStream pipedOut = new PipedOutputStream (); PipedInputStream pipedIn = new PipedInputStream (pipedOut); ObjectOutputStream objOut = new ObjectOutputStream (pipedOut); ObjectInputStream objIn = new ObjectInputStream (pipedIn); // Send the hypercube through the output stream new StreamWriter (objOut, h1); // Read the hypercube from the input stream Hypercube<AddableInteger, AddableInteger> h2 = (Hypercube<AddableInteger, AddableInteger>) objIn.readObject(); objIn.close(); // Check the hypercubes are equal assertTrue (h1.equals(h2)); } /** * Method to test the serialization of the NULL hypercube */ @SuppressWarnings("unchecked") public void testSerializationNullHypercube() { // Thread used to write an object to a stream class StreamWriter extends Thread { private ObjectOutputStream out; private Object obj; /** Constructor * @param out the output stream * @param obj the object to be written */ public StreamWriter (ObjectOutputStream out, Object obj) { this.out = out; this.obj = obj; start(); } public void run() { try { out.writeObject(obj); } catch (IOException e) { e.printStackTrace(); } } } Hypercube<AddableInteger, AddableInteger> h1 = (Hypercube<AddableInteger, AddableInteger>)Hypercube.NullHypercube.NULL; try { // Create connected piped streams PipedOutputStream pipedOut = new PipedOutputStream (); PipedInputStream pipedIn = new PipedInputStream (pipedOut); ObjectOutputStream objOut = new ObjectOutputStream (pipedOut); ObjectInputStream objIn = new ObjectInputStream (pipedIn); // Send the hypercube through the output stream new StreamWriter (objOut, h1); // Read the hypercube from the input stream Hypercube<AddableInteger, AddableInteger> h2 = (Hypercube<AddableInteger, AddableInteger>) objIn.readObject(); objIn.close(); // Check the hypercubes are equal assertTrue (h1.equals(h2)); } catch (IOException e) { fail(e.toString()); /// @bug objIn might not be closed } catch (ClassNotFoundException e) { fail(e.toString()); } } /** Tests the union() method * @author Thomas Leaute */ public void testUnion () { String[] a1 = {}; String[] b1 = {}; String[] c1 = {}; assertTrue(Arrays.equals(Hypercube.union(a1, b1), c1)); String[] a2 = {"1", "2"}; String[] b2 = {}; String[] c2 = {"1", "2"}; assertTrue(Arrays.equals(Hypercube.union(a2, b2), c2)); String[] a3 = {"1", "2", "3"}; String[] b3 = {"0", "2", "4"}; String[] c3 = {"0", "1", "2", "4", "3"}; assertTrue(Arrays.equals(Hypercube.union(a3, b3), c3)); String[] a4 = {"1", "2", "3"}; String[] b4 = {"0", "3", "1"}; String[] c4 = {"0", "1", "2", "3"}; assertTrue(Arrays.equals(Hypercube.union(a4, b4), c4)); String[] a5 = {"1", "5", "6", "0", "2"}; String[] b5 = {"1", "8", "5", "0", "6", "3"}; String[] c5 = {"1", "8", "5", "6", "0", "3", "2"}; assertTrue(Arrays.equals(Hypercube.union(a5, b5), c5)); } /** Tests the projection method when all variables are projected out * @author Thomas Leaute */ public void testProjectAllRandom () { Hypercube<AddableInteger, AddableInteger> hypercube = random_hypercube(); // Compute the optimal utility AddableInteger opt = hypercube.getUtility(0); for (int i = 0; i < hypercube.getNumberOfSolutions(); i++) { AddableInteger val = hypercube.getUtility(i); if ((maximize && val.compareTo(opt) > 0) || (! maximize && val.compareTo(opt) < 0)) { opt = val; } } // Test one projection method UtilitySolutionSpace.ProjOutput<AddableInteger, AddableInteger> proj = hypercube.project(hypercube.getNumberOfVariables(), maximize); assertTrue(new ScalarHypercube<AddableInteger, AddableInteger> (opt, null, new AddableInteger [0].getClass()).equivalent(proj.getSpace())); assertTrue (Arrays.asList(proj.getVariables()).equals(Arrays.asList(hypercube.getVariables()))); assertTrue(opt.compareTo(hypercube.getUtility(proj.getAssignments().getUtility(0).toArray(new AddableInteger[0]))) == 0); // Test the other projection method proj = hypercube.project(hypercube.getVariables(), maximize); assertTrue(new ScalarHypercube<AddableInteger, AddableInteger> (opt, null, new AddableInteger [0].getClass()).equivalent(proj.getSpace())); assertTrue (Arrays.asList(proj.getVariables()).equals(Arrays.asList(hypercube.getVariables()))); assertTrue(opt.compareTo(hypercube.getUtility(proj.getAssignments().getUtility(0).toArray(new AddableInteger[0]))) == 0); } /** Tests blindProject() * @author Thomas Leaute */ public void testBlindProjectRandom () { Hypercube<AddableInteger, AddableInteger> hypercube = random_hypercube(); // Randomly pick variables to project out ArrayList<String> candidates = new ArrayList<String> (Arrays.asList(hypercube.getVariables())); for (java.util.Iterator<String> iter = candidates.iterator(); iter.hasNext(); ) { iter.next(); if (Math.random() < .5) iter.remove(); } String[] varsOut = candidates.toArray(new String [candidates.size()]); assertTrue (hypercube + "\n.blindProject(" + Arrays.toString(varsOut) + ", " + maximize + ") = \n" + hypercube.blindProject(varsOut, maximize) + "\n!=\n" + hypercube.project(varsOut, maximize).space, hypercube.blindProject(varsOut, maximize).equivalent(hypercube.project(varsOut, maximize).space)); } /** Tests the additive join method that automatically computes the variable ordering */ public void testSmartJoinRandom () { this.testSmartJoinRandom(true); } /** Tests the multiplicative join method that automatically computes the variable ordering */ public void testSmartMultiplyRandom () { this.testSmartJoinRandom(false); } /** Tests the join method that automatically computes the variable ordering * @author Thomas Leaute * @param addition \c true if utilities should be added, \c false if they should be multiplied */ public void testSmartJoinRandom ( boolean addition ) { Hypercube<AddableInteger, AddableInteger> h1 = random_hypercube(); Hypercube<AddableInteger, AddableInteger> h2 = random_hypercube(); String[] variables1 = h1.getVariables(); String[] variables2 = h2.getVariables(); // Choose an order on all variables String[] onlyIn1 = Hypercube.sub(variables1, variables2); String[] onlyIn2 = Hypercube.sub(variables2, variables1); String[] inBoth = Hypercube.sub(variables1, onlyIn1); String[] order1 = new String[onlyIn1.length + inBoth.length]; System.arraycopy(onlyIn1, 0, order1, 0, onlyIn1.length); System.arraycopy(inBoth, 0, order1, onlyIn1.length, inBoth.length); String[] order2 = new String[onlyIn2.length + inBoth.length]; System.arraycopy(onlyIn2, 0, order2, 0, onlyIn2.length); System.arraycopy(inBoth, 0, order2, onlyIn2.length, inBoth.length); String[] totalOrder = new String[onlyIn1.length + onlyIn2.length + inBoth.length]; System.arraycopy(onlyIn1, 0, totalOrder, 0, onlyIn1.length); System.arraycopy(onlyIn2, 0, totalOrder, onlyIn1.length, onlyIn2.length); System.arraycopy(inBoth, 0, totalOrder, onlyIn1.length + onlyIn2.length, inBoth.length); // Re-order hypercubes and compute join UtilitySolutionSpace<AddableInteger, AddableInteger> h1New = h1.changeVariablesOrder(order1); UtilitySolutionSpace<AddableInteger, AddableInteger> h2New = h2.changeVariablesOrder(order2); // Compute the join and compare with the result of the smart join if (addition) { UtilitySolutionSpace<AddableInteger, AddableInteger> join = h1New.join(h2New, totalOrder); assertTrue(join.equivalent(h1.join(h2))); } else { // First offset all utility values by 1 to make sure they are all > 0, which avoids 0 * INF ScalarHypercube<AddableInteger, AddableInteger> one = new ScalarHypercube<AddableInteger, AddableInteger> (new AddableInteger (1), null, new AddableInteger [0].getClass()); h1New = h1New.join(one); h2New = h2New.join(one); h1 = (Hypercube<AddableInteger, AddableInteger>) h1.join(one); h2 = (Hypercube<AddableInteger, AddableInteger>) h2.join(one); UtilitySolutionSpace<AddableInteger, AddableInteger> join = h1New.multiply(h2New, totalOrder); assertTrue(join.equivalent(h1.multiply(h2))); } } /** Tests the expectation operation * @author Thomas Leaute */ public void testExpectation () { Hypercube<AddableInteger, AddableReal> utilSpace = null, probSpace = null; String[] randVars = null; ArrayList< AddableInteger[] > domains = null; HashMap< String, UtilitySolutionSpace<AddableInteger, AddableReal> > distributions = null; boolean valid = false; while (!valid) { // loop until we get a valid test case utilSpace = random_hypercube(0, AddableReal.class); distributions = new HashMap< String, UtilitySolutionSpace<AddableInteger, AddableReal> > (); probSpace = random_hypercube(1, 2 + (int)(3*Math.random()), 10000, (int)(5*Math.random()), null, AddableReal.class); AddableReal sum = new AddableReal(0.0); for (Iterator<AddableInteger, AddableReal> iter = probSpace.iterator(); iter.hasNext(); ) sum = sum.add(iter.nextUtility()); assert sum.doubleValue() > 0.0; for (Iterator<AddableInteger, AddableReal> iter = probSpace.iterator(); iter.hasNext(); ) iter.setCurrentUtility(iter.nextUtility().divide(sum)); distributions.put(probSpace.getVariable(0), probSpace); // With some probability, introduce a second random variable if (Math.random() > 0.3) { probSpace = random_hypercube(1, 2 + (int)(3*Math.random()), 10000, (int)(5*Math.random()), null, AddableReal.class); sum = new AddableReal(0.0); for (Iterator<AddableInteger, AddableReal> iter = probSpace.iterator(); iter.hasNext(); ) sum = sum.add(iter.nextUtility()); assert sum.doubleValue() > 0.0; for (Iterator<AddableInteger, AddableReal> iter = probSpace.iterator(); iter.hasNext(); ) iter.setCurrentUtility(iter.nextUtility().divide(sum)); distributions.put(probSpace.getVariable(0), probSpace); } randVars = new String [distributions.size()]; domains = new ArrayList< AddableInteger[] > (); int i = 0; for (UtilitySolutionSpace<AddableInteger, AddableReal> prob : distributions.values()) { randVars[i++] = prob.getVariable(0); domains.add(prob.getDomain(0)); } valid = true; // If a random variable is contained in the utilSpace, its domain must be a superset of the one in the probSpace for (i = 0; i < randVars.length; i++) { String var = randVars[i]; AddableInteger[] dom = domains.get(i); AddableInteger[] dom2 = utilSpace.getDomain(var); if (dom2 != null) { // the random variable is contained in the hypercube if (Hypercube.sub(dom, dom2).length > 0) { // The random variable can take values that are not in the corresponding domain in the utilSpace // Try another test case valid = false; break; } } } } // Compute the expectation UtilitySolutionSpace<AddableInteger, AddableReal> expectation = utilSpace.expectation(distributions); // Recompute the expectation in a different (memory-inefficient) way: fist multiply, then slice, then join UtilitySolutionSpace<AddableInteger, AddableReal> product = utilSpace; for (UtilitySolutionSpace<AddableInteger, AddableReal> prod : distributions.values()) product = product.multiply(prod); UtilitySolutionSpace<AddableInteger, AddableReal> expectation2 = new ScalarHypercube<AddableInteger, AddableReal> (new AddableReal (0), null, new AddableInteger [0].getClass()); // Re-order the random variables and their domains so that their order is consistent with the order in product TreeMap<Integer, Integer> treeMap = new TreeMap<Integer, Integer> (); int end = product.getNumberOfVariables(); for (int i = 0; i < randVars.length; i++) { String var = randVars[i]; int pos = product.getIndex(var); if (pos < 0) { // the variable is absent from product treeMap.put(end++, i); } else treeMap.put(pos, i); } ArrayList<String> randVars2 = new ArrayList<String> (randVars.length); ArrayList< AddableInteger[] > domains2 = new ArrayList< AddableInteger[] > (domains.size()); for (Integer varIndex : treeMap.values()) { randVars2.add(randVars[varIndex]); domains2.add(domains.get(varIndex)); } randVars = randVars2.toArray(randVars); domains = domains2; // Initialize the current assignments to the random variables int[] valIndexes = new int [randVars.length]; // indexes of the current variable assignments AddableInteger[][] assignments = new AddableInteger[randVars.length][]; for (int i = 0; i < randVars.length; i++) assignments[i] = new AddableInteger[] {domains.get(i)[0]}; // Go through all combinations of assignments to the random variables while (true) { // Slice the hypercube over the current assignment, and join with expectation2 UtilitySolutionSpace<AddableInteger, AddableReal> slice = product.slice(randVars, assignments); expectation2 = expectation2.join(slice); // Move to the next assignment for the random variables int varIndex = 0; for ( ; varIndex < randVars.length; varIndex++) { // Check if we have exhausted all values in the domain of the varIndex'th variable AddableInteger[] dom = domains.get(varIndex); if (valIndexes[varIndex] == dom.length - 1) { // Reset the variable to its first domain value, and increment the next variable valIndexes[varIndex] = 0; assignments[varIndex] = new AddableInteger [] { dom[0] }; } else { // increment the value for this variable valIndexes[varIndex]++; assignments[varIndex] = new AddableInteger [] { dom[ valIndexes[varIndex] ] }; break; } } if (varIndex >= randVars.length) // we have exhausted all combinations break; } // Compare the two expectations solution-wise, with some error margin assertEquals(expectation + " != " + expectation2, expectation.getNumberOfVariables(), expectation2.getNumberOfVariables()); Iterator<AddableInteger, AddableReal> iter = expectation.iterator(); assertTrue (iter.getCurrentSolution() != null); Iterator<AddableInteger, AddableReal> iter2 = expectation2.iterator(expectation.getVariables()); Iterator<AddableInteger, AddableReal> iter3 = expectation.resolve().iterator(expectation.getVariables()); assertEquals (expectation.getNumberOfSolutions(), iter.getNbrSolutions()); AddableReal util = null; for (int i = 0; iter.hasNext(); i++) { util = iter.nextUtility(); assertTrue (i + "\n" + expectation, util != null); assertTrue (util + " != " + iter2.getCurrentUtility() + "\n" + expectation + " != " + expectation2, util != null && util.equals(iter2.nextUtility(), 1E-6)); assertTrue (util + " != " + iter3.getCurrentUtility() + "\n" + expectation + " != " + expectation.resolve(), util.equals(iter3.nextUtility(), 1E-6)); } } /** Tests the composition method */ @SuppressWarnings("unchecked") public void testCompose () { // Generate a random hypercube Hypercube<AddableInteger, AddableInteger> hypercube = random_hypercube(); String[] initVars = hypercube.getVariables(); // Randomly generate the variables the substitution depends on Hypercube<AddableInteger, AddableInteger> tmp = random_hypercube(); String[] varsInSubst = tmp.getVariables(); int nbrUtilsSubst = 1; AddableInteger[][] domsInSubst = new AddableInteger[varsInSubst.length][]; for (int i = 0; i < varsInSubst.length; i++) { AddableInteger[] dom = hypercube.getDomain(varsInSubst[i]); if (dom == null) dom = tmp.getDomain(varsInSubst[i]); domsInSubst[i] = dom; nbrUtilsSubst *= dom.length; } // Randomly choose variables to substitute (they must not be in varsInSubst) HashSet<String> varsOutTmp = new HashSet<String> (); for (int i = (int) (5 * Math.random()); i >= 0; i--) { String var = "X" + (int) (15 * Math.random()); while (tmp.getDomain(var) != null) // must not be in varsInSubst var = "X" + (int) (15 * Math.random()); varsOutTmp.add(var); } String[] varsOut = varsOutTmp.toArray(new String [varsOutTmp.size()]); AddableInteger[][] domsOut = new AddableInteger[varsOut.length][]; boolean hasOneVarOut = false; for (int i = 0; i < varsOut.length; i++) { AddableInteger[] dom = hypercube.getDomain(varsOut[i]); if (dom != null) { domsOut[i] = dom; hasOneVarOut = true; } else domsOut[i] = new AddableInteger[] { new AddableInteger(1), new AddableInteger(2) }; // (must not include -100) } // Fill in the utility array of the random substitution ArrayList<AddableInteger>[] utilsSubst = (ArrayList<AddableInteger>[]) new ArrayList[nbrUtilsSubst]; for (int i = 0; i < nbrUtilsSubst; i++) { ArrayList<AddableInteger> newValues = new ArrayList<AddableInteger> (varsOut.length); for (int j = 0; j < varsOut.length; j++) { // With some low probability, choose a value that is outside the variable's domain if (Math.random() < 0.1) newValues.add(new AddableInteger (-100)); else { AddableInteger[] dom = domsOut[j]; newValues.add( dom[ (int) (dom.length * Math.random()) ] ); } } utilsSubst[i] = newValues; } // Instantiate the substitution BasicHypercube< AddableInteger, ArrayList<AddableInteger> > substitution; if (varsInSubst.length == 0) { // the substitution is constant substitution = new ScalarBasicHypercube< AddableInteger, ArrayList<AddableInteger> > (utilsSubst[0], null); } else substitution = new BasicHypercube< AddableInteger, ArrayList<AddableInteger> > (varsInSubst, domsInSubst, utilsSubst, null); // Compute the composition // Its variables are (initVars U varsInSubst) \ varsOut BasicUtilitySolutionSpace<AddableInteger, AddableInteger> composition = hypercube.compose(varsOut, substitution); // If no variable is substituted, the result should be equivalent to the input if (! hasOneVarOut) { assertTrue (composition.equivalent(hypercube)); return; } // Re-order the composition, putting all variables in varsInSubst first (in the same order) String[] newCompOrder = new String[composition.getNumberOfVariables()]; System.arraycopy(varsInSubst, 0, newCompOrder, 0, varsInSubst.length); String[] varsInCompNotInSubst = Hypercube.sub(composition.getVariables(), varsInSubst); System.arraycopy(varsInCompNotInSubst, 0, newCompOrder, varsInSubst.length, varsInCompNotInSubst.length); composition = composition.changeVariablesOrder(newCompOrder); int nbrUtilsInCompNotInSubst = 1; for (String var : varsInCompNotInSubst) nbrUtilsInCompNotInSubst *= composition.getDomain(var).length; // Grow the initial hypercube with variables in varsInSubst \ initVars (if there are such variables) String[] varsInSubstNotInHyper = Hypercube.sub(varsInSubst, initVars); if (varsInSubstNotInHyper.length != 0) { AddableInteger[][] domsInSubstNotInHyper = new AddableInteger[varsInSubstNotInHyper.length][]; int nbrUtilsInSubstNotInHyper = 1; for (int i = 0; i < varsInSubstNotInHyper.length; i++) { AddableInteger[] dom = substitution.getDomain(varsInSubstNotInHyper[i]); domsInSubstNotInHyper[i] = dom; nbrUtilsInSubstNotInHyper *= dom.length; } AddableInteger[] utilsInSubstNotInHyper = new AddableInteger[nbrUtilsInSubstNotInHyper]; Arrays.fill(utilsInSubstNotInHyper, new AddableInteger(0)); hypercube = (Hypercube<AddableInteger, AddableInteger>) hypercube.join( new Hypercube<AddableInteger, AddableInteger> (varsInSubstNotInHyper, domsInSubstNotInHyper, utilsInSubstNotInHyper, null)); } AddableInteger infeasibleUtil = null; if (inf == Infinity.PLUS_INFINITY) infeasibleUtil = AddableInteger.PlusInfinity.PLUS_INF; else infeasibleUtil = AddableInteger.MinInfinity.MIN_INF; // Loop over all possible assignments to varsInSubst ext: for (int i = 0; i < varsInSubst.length; i++) { // Slice the hypercube over the ith substitution ArrayList<AddableInteger> newValues = utilsSubst[i]; AddableInteger[][] newDoms = new AddableInteger[varsOut.length][1]; for (int j = 0; j < varsOut.length; j++) { // Get the substitution value for the jth variable AddableInteger val = newValues.get(j); // Check if this substitution value is in the domain of the variable AddableInteger[] dom = hypercube.getDomain(varsOut[j]); if (dom != null && ! Arrays.asList(dom).contains(val)) { // Check that all utilities corresponding to this substitution are infeasible for (int k = nbrUtilsInCompNotInSubst * i; k < nbrUtilsInCompNotInSubst * (i+1); k++) assertTrue (composition.getUtility(k) + " != " + infeasibleUtil, composition.getUtility(k).equals(infeasibleUtil)); continue ext; } newDoms[j] = new AddableInteger[] { val }; } BasicUtilitySolutionSpace<AddableInteger,AddableInteger> slice = hypercube.slice(varsOut, newDoms); // Re-order the slice, using the same order as in the composition slice = slice.changeVariablesOrder(newCompOrder); // Check that, given the ith substitution, composition and slice agree on all utilities as a function of varsInCompNotInSubst for (int j = nbrUtilsInCompNotInSubst * i; j < nbrUtilsInCompNotInSubst * (i+1); j++) assertTrue (slice.getUtility(j) + " != " + composition.getUtility(j), slice.getUtility(j).equals(composition.getUtility(j))); } } /** Test for the sample(int) method */ public void testSample () { // Generate a random probability space int nbrProbs = 3; double[] probsTmp = new double[nbrProbs]; double sum = 0.0; for (int i = 0; i < nbrProbs; i++) { probsTmp[i] = Math.random(); sum += probsTmp[i]; } AddableReal[] probs = new AddableReal[nbrProbs]; for (int i = 0; i < nbrProbs; i++) probs[i] = new AddableReal (probsTmp[i] / sum); AddableInteger[] vals = new AddableInteger[nbrProbs]; for (int i = 0; i < nbrProbs; i++) vals[i] = new AddableInteger (i); Hypercube<AddableInteger, AddableReal> probSpace = new Hypercube<AddableInteger, AddableReal> (new String[] {"var"}, new AddableInteger[][] {vals}, probs, AddableReal.PlusInfinity.PLUS_INF); // Sample the probability space int nbrSamples = nbrProbs * 10000; Map<AddableInteger, Double> samples = probSpace.sample(nbrSamples); // Normalize the weights for (Map.Entry<AddableInteger, Double> entry : samples.entrySet()) entry.setValue(entry.getValue() / nbrSamples); // Check that the frequencies look approximately correct for (int i = 0; i < nbrProbs; i++) assertTrue (probs[i].equals(new AddableReal (samples.get(vals[i])), 0.01)); } /** Tests the consensus() operation with weighted samples */ public void testConsensusWeighted () { this.testConsensusWeighted(false); } /** Tests the consensusExpect() operation with weighted samples */ public void testConsensusWeightedExpect () { this.testConsensusWeighted(true); } /** Tests the consensus() operation with weighted samples * @param expect whether to compose the consensus operation with the expectation operation */ private void testConsensusWeighted (final boolean expect) { Hypercube<AddableInteger, AddableReal> h1 = random_hypercube(0.1, AddableReal.class); // Choose one variable to be projected out (most probably, one of the hypercube's variables) String varOut = "X" + (int)(7 * Math.random()); if (Math.random() > 0.1) varOut = h1.getVariable((int) (Math.random() * h1.getNumberOfVariables())); // Choose random variables ArrayList<String> randVars = new ArrayList<String> (); for (int i = 0; i < 9; i++) if (Math.random() > 0.3) randVars.add("X" + i); randVars.remove(varOut); // Choose random distributions HashMap< String, UtilitySolutionSpace<AddableInteger, AddableReal> > distributions = new HashMap< String, UtilitySolutionSpace<AddableInteger, AddableReal> > (); for (String randVar : randVars) { AddableInteger[] dom = h1.getDomain(randVar); if (dom == null) dom = new AddableInteger[] { new AddableInteger (0), new AddableInteger (1), new AddableInteger (2) }; AddableReal[] probs = new AddableReal [dom.length]; double norm = 0.0; for (int i = 0; i < dom.length; i++) { double prob = Math.random(); norm += prob; probs[i] = new AddableReal(prob); } AddableReal div = new AddableReal (1/norm); for (int i = 0; i < dom.length; i++) probs[i] = probs[i].multiply(div); distributions.put(randVar, new Hypercube<AddableInteger, AddableReal> (new String[] {randVar}, new AddableInteger[][] {dom}, probs, null)); } // Perform the normal consensus operation ProjOutput<AddableInteger, AddableReal> projOutput1 = expect ? h1.consensusExpect(varOut, distributions, maximize) : h1.consensus(varOut, distributions, maximize); // Check the variables in the projOutput if (h1.getDomain(varOut) != null) { assertTrue (Arrays.asList(projOutput1.getVariables()).equals(Arrays.asList(new String[] { varOut }))); } else assertTrue (projOutput1.getVariables().length == 0); // Check that the conditional optimal assignments are consistent with the first output UtilitySolutionSpace<AddableInteger, AddableReal> composition = h1.compose(new String[] { varOut }, projOutput1.assignments); if (expect) composition = composition.expectation(distributions); assertTrue (composition + " != " + projOutput1.space + "\ndistributions: " + distributions + "\nvar out: " + varOut, composition.getNumberOfVariables() == projOutput1.space.getNumberOfVariables()); Iterator<AddableInteger, AddableReal> iter1 = composition.iterator(); Iterator<AddableInteger, AddableReal> iter2 = projOutput1.space.iterator(composition.getVariables()); while (iter1.hasNext()) assertTrue (iter1.getCurrentUtility() + " != " + iter2.getCurrentUtility() + "\n" + composition + " != " + projOutput1.space, iter1.nextUtility() != null && iter1.getCurrentUtility().equals(iter2.nextUtility(), 1E-6)); // Perform the advanced consensus operation ProjOutput<AddableInteger, AddableReal> projOutput2 = h1.consensusAllSols(varOut, distributions, maximize); BasicUtilitySolutionSpace< AddableInteger, ArrayList<AddableInteger> > sol = projOutput2.assignments; // Check the variables in the projOutput if (h1.getDomain(varOut) != null) { assertTrue (Arrays.asList(projOutput2.getVariables()).equals(Arrays.asList(new String[] { varOut }))); } else assertTrue (projOutput2.getVariables().length == 0); // Check that the conditional optimal assignments are consistent with the first output assertTrue (h1.compose(new String[] { varOut }, sol).equivalent(projOutput2.space)); // Check the correctness of the conditional optimal assignments if (h1.getDomain(varOut) == null) { assertTrue (sol == Hypercube.NullHypercube.NULL); return; } // Compute the joint probability of the random variables UtilitySolutionSpace<AddableInteger, AddableReal> probs = new ScalarHypercube<AddableInteger, AddableReal> (new AddableReal(1.0), null, new AddableInteger [0].getClass()); for (String randVar : h1.getVariables()) { UtilitySolutionSpace<AddableInteger, AddableReal> prob = distributions.get(randVar); if (prob != null) probs = probs.multiply(prob); } // Reorder the variables in probs to match the order in h1 ArrayList<String> newOrder = new ArrayList<String> (); for (String var : h1.getVariables()) if (probs.getDomain(var) != null) newOrder.add(var); String[] newOrderArray = newOrder.toArray(new String [newOrder.size()]); probs = probs.changeVariablesOrder(newOrderArray); // Initialize the current assignments to the remaining variables int nbrRemainingVars = sol.getNumberOfVariables(); int[] valIndexes = new int [nbrRemainingVars]; // indexes of the current variable assignments AddableInteger[][] assignments = new AddableInteger [nbrRemainingVars][]; for (int i = 0; i < nbrRemainingVars; i++) assignments[i] = new AddableInteger[] { sol.getDomain(i)[0] }; // Go through all combinations of assignments to the remaining variables while (true) { // Slice h1 over the current assignments, if any variable remains UtilitySolutionSpace<AddableInteger, AddableReal> h1Sliced = h1; if (nbrRemainingVars != 0) h1Sliced = h1.slice(sol.getVariables(), assignments); // Look up the chosen value AddableInteger chosen = sol.slice(sol.getVariables(), assignments).getUtility(0).get(0); // For each scenario, compute the optimal utility UtilitySolutionSpace<AddableInteger, AddableReal> optUtil = h1Sliced.blindProject(varOut, maximize).resolve(); // For each possible value of varOut, compute the number of (weighted) times it is optimal HashMap<AddableInteger, AddableReal> counts = new HashMap<AddableInteger, AddableReal> (); for (AddableInteger val : h1.getDomain(varOut)) counts.put(val, new AddableReal (0.0)); for (AddableInteger val : h1.getDomain(varOut)) { // Slice h1Sliced over varOut = val BasicUtilitySolutionSpace<AddableInteger, AddableReal> h1Sliced2 = h1Sliced.slice(varOut, val); // For each scenario, if val is optimal, increment its counter with the probability of the scenario for (int i = 0; i < h1Sliced2.getNumberOfSolutions(); i++) if (optUtil.getUtility(i).equals(h1Sliced2.getUtility(i))) counts.put(val, counts.get(val).add(probs.getUtility(i))); } // Check that the chosen value has the highest counter AddableReal chosenCount = counts.get(chosen); for (Map.Entry<AddableInteger, AddableReal> entry : counts.entrySet()) assertTrue (chosen + "'s count " + chosenCount + " < " + entry.getKey() + "'s count " + entry.getValue(), entry.getValue().compareTo(chosenCount) <= 0); // Move to the next assignment for the remaining variables int varIndex = 0; for ( ; varIndex < nbrRemainingVars; varIndex++) { // Check if we have exhausted all values in the domain of the varIndex'th variable AddableInteger[] dom = sol.getDomain(varIndex); if (valIndexes[varIndex] == dom.length - 1) { // Reset the variable to its first domain value, and increment the next variable valIndexes[varIndex] = 0; assignments[varIndex] = new AddableInteger[] { dom[0] }; } else { // increment the value for this variable valIndexes[varIndex]++; assignments[varIndex] = new AddableInteger[] { dom[ valIndexes[varIndex] ] }; break; } } if (varIndex >= nbrRemainingVars) // we have exhausted all combinations break; } } /** Test for the iterator() method that takes in a list of variables not necessarily containing all the space's variables */ public void testIterator () { Hypercube<AddableInteger, AddableInteger> hyper = random_hypercube(); Hypercube<AddableInteger, AddableInteger> tmp = random_hypercube(); String[] inputVars = tmp.getVariables(); Iterator<AddableInteger, AddableInteger> iter = hyper.iterator(inputVars, tmp.getDomains()); // Check that the order of variables is consistent with the input order String[] iterVars = iter.getVariablesOrder(); for (int i = 0; i < inputVars.length; i++) assertTrue (inputVars[i].equals(iterVars[i])); /// @todo Further tests could be useful. } }
72,728
Java
.java
1,471
45.241332
267
0.73178
heniancheng/FRODO
2
0
0
AGPL-3.0
9/5/2024, 12:01:34 AM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
72,728
4,593,138
Cuboid.java
cjw0621_Growing-Java/Java_Master_Course/Section6/PoolAreaChallenge/src/Cuboid.java
public class Cuboid extends Rectangle { private double height; public Cuboid(double width, double length, double height) { super(width, length); if(height < 0) { this.height=0; } else { this.height = height; } } public double getHeight() { return height; } public double getVolume(){ return getArea() * this.height; } }
427
Java
.java
17
17.823529
63
0.575682
cjw0621/Growing-Java
2
0
0
GPL-3.0
9/5/2024, 12:18:32 AM (Europe/Amsterdam)
false
false
false
true
false
false
true
true
427
1,315,593
Test.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/UseSupertypeWherePossible/testNew6/out/Test.java
package p; import java.util.ArrayList; import java.util.List; class Test{ void test(){ Object a= new A(); List list= new ArrayList(1); list.add(a); } }
161
Java
.java
10
14.2
30
0.706667
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
161
1,315,739
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/UseSupertypeWherePossible/testNew0/out/A.java
package p; //use Object class A{ } class Test{ void test(){ Object a= new A(); } }
86
Java
.java
9
8.222222
20
0.653846
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
86
2,593,083
Timing.java
JPortal-system_system/jdk12-06222165c35f/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Timing.java
/* * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package jdk.nashorn.internal.runtime; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.LongAdder; import java.util.function.Function; import java.util.function.Supplier; import jdk.nashorn.internal.codegen.CompileUnit; import jdk.nashorn.internal.runtime.logging.DebugLogger; import jdk.nashorn.internal.runtime.logging.Loggable; import jdk.nashorn.internal.runtime.logging.Logger; /** * Simple wallclock timing framework */ @Logger(name="time") public final class Timing implements Loggable { private DebugLogger log; private TimeSupplier timeSupplier; private final boolean isEnabled; private final long startTime; private static final String LOGGER_NAME = Timing.class.getAnnotation(Logger.class).name(); /** * Instantiate singleton timer for ScriptEnvironment * @param isEnabled true if enabled, otherwise we keep the instance around * for code brevity and "isEnabled" checks, but never instantiate anything * inside it */ public Timing(final boolean isEnabled) { this.isEnabled = isEnabled; this.startTime = System.nanoTime(); } /** * Get the log info accumulated by this Timing instance * @return log info as one string */ public String getLogInfo() { assert isEnabled(); return timeSupplier.get(); } /** * Get the log info accumulated by this Timing instance * @return log info as and array of strings, one per line */ public String[] getLogInfoLines() { assert isEnabled(); return timeSupplier.getStrings(); } /** * Check if timing is enabled * @return true if timing is enabled */ boolean isEnabled() { return isEnabled; } /** * When timing, this can be called to register a new module for timing * or add to its accumulated time * * @param module module name * @param durationNano duration to add to accumulated time for module, in nanoseconds. */ public void accumulateTime(final String module, final long durationNano) { if (isEnabled()) { ensureInitialized(Context.getContextTrusted()); timeSupplier.accumulateTime(module, durationNano); } } private DebugLogger ensureInitialized(final Context context) { //lazy init, as there is not necessarily a context available when //a ScriptEnvironment gets initialize if (isEnabled() && log == null) { log = initLogger(context); if (log.isEnabled()) { this.timeSupplier = new TimeSupplier(); Runtime.getRuntime().addShutdownHook( new Thread() { @Override public void run() { //System.err.println because the context and the output streams may be gone //when the shutdown hook executes final StringBuilder sb = new StringBuilder(); for (final String str : timeSupplier.getStrings()) { sb.append('['). append(Timing.getLoggerName()). append("] "). append(str). append('\n'); } System.err.print(sb); } }); } } return log; } static String getLoggerName() { return LOGGER_NAME; } @Override public DebugLogger initLogger(final Context context) { return context.getLogger(this.getClass()); } @Override public DebugLogger getLogger() { return log; } /** * Takes a duration in nanoseconds, and returns a string representation of it rounded to milliseconds. * @param durationNano duration in nanoseconds * @return the string representing the duration in milliseconds. */ public static String toMillisPrint(final long durationNano) { return Long.toString(TimeUnit.NANOSECONDS.toMillis(durationNano)); } final class TimeSupplier implements Supplier<String> { private final Map<String, LongAdder> timings = new ConcurrentHashMap<>(); private final LinkedBlockingQueue<String> orderedTimingNames = new LinkedBlockingQueue<>(); private final Function<String, LongAdder> newTimingCreator = s -> { orderedTimingNames.add(s); return new LongAdder(); }; String[] getStrings() { final List<String> strs = new ArrayList<>(); final BufferedReader br = new BufferedReader(new StringReader(get())); String line; try { while ((line = br.readLine()) != null) { strs.add(line); } } catch (final IOException e) { throw new RuntimeException(e); } return strs.toArray(new String[0]); } @Override public String get() { final long t = System.nanoTime(); long knownTime = 0L; int maxKeyLength = 0; int maxValueLength = 0; for (final Map.Entry<String, LongAdder> entry : timings.entrySet()) { maxKeyLength = Math.max(maxKeyLength, entry.getKey().length()); maxValueLength = Math.max(maxValueLength, toMillisPrint(entry.getValue().longValue()).length()); } maxKeyLength++; final StringBuilder sb = new StringBuilder(); sb.append("Accumulated compilation phase timings:\n\n"); for (final String timingName: orderedTimingNames) { int len; len = sb.length(); sb.append(timingName); len = sb.length() - len; while (len++ < maxKeyLength) { sb.append(' '); } final long duration = timings.get(timingName).longValue(); final String strDuration = toMillisPrint(duration); len = strDuration.length(); for (int i = 0; i < maxValueLength - len; i++) { sb.append(' '); } sb.append(strDuration). append(" ms\n"); knownTime += duration; } final long total = t - startTime; return sb.append("\nTotal runtime: "). append(toMillisPrint(total)). append(" ms (Non-runtime: "). append(toMillisPrint(knownTime)). append(" ms ["). append((int)(knownTime * 100.0 / total)). append("%])"). append("\n\nEmitted compile units: "). append(CompileUnit.getEmittedUnitCount()). append("\nCompile units installed as named classes: "). append(Context.getNamedInstalledScriptCount()). append("\nCompile units installed as anonymous classes: "). append(Context.getAnonymousInstalledScriptCount()). toString(); } private void accumulateTime(final String module, final long duration) { timings.computeIfAbsent(module, newTimingCreator).add(duration); } } }
9,035
Java
.java
216
31.532407
112
0.607939
JPortal-system/system
7
2
1
GPL-3.0
9/4/2024, 9:49:36 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
9,035
61,461
WorldLoadEvent.java
Luohuayu_CatServer/src/main/java/org/bukkit/event/world/WorldLoadEvent.java
package org.bukkit.event.world; import org.bukkit.World; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; /** * Called when a World is loaded */ public class WorldLoadEvent extends WorldEvent { private static final HandlerList handlers = new HandlerList(); public WorldLoadEvent(@NotNull final World world) { super(world); } @NotNull @Override public HandlerList getHandlers() { return handlers; } @NotNull public static HandlerList getHandlerList() { return handlers; } }
574
Java
.java
22
21.863636
66
0.725777
Luohuayu/CatServer
1,967
211
97
LGPL-3.0
9/4/2024, 7:04:55 PM (Europe/Amsterdam)
false
false
false
true
true
false
true
true
574
1,317,091
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/RenameType/test33/in/A.java
package p; class A extends Exception{ } class C{ C() throws A {}; }
70
Java
.java
6
10.333333
26
0.6875
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
70
1,317,627
A_test5_in.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/AbstractField/can/A_test5_in.java
//abstract and make private package p; class A{ public int f; void m(){ f= f; } } class B{ int m(){ A a= new A(); a.f= a.f; return a.f; } }
152
Java
.java
15
8.333333
27
0.586957
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
152
4,546,468
GlobalPathType.java
javst_halo-school/src/main/java/run/halo/app/model/enums/GlobalPathType.java
package run.halo.app.model.enums; /** * Global path type. * * @author ryanwang * @date 2020-02-01 */ public enum GlobalPathType implements ValueEnum<Integer> { /** * Relative path. */ RELATIVE(0), /** * Absolute path. */ ABSOLUTE(1); private final Integer value; GlobalPathType(Integer value) { this.value = value; } @Override public Integer getValue() { return value; } }
491
Java
.java
25
13.92
59
0.579295
javst/halo-school
2
0
0
GPL-3.0
9/5/2024, 12:16:52 AM (Europe/Amsterdam)
false
false
false
true
true
false
true
true
491
3,811,227
Edge.java
eclipse_org_eclipse_emf_diffmerge_core/tests/org.eclipse.emf.diffmerge.tests.elements/src/org/eclipse/emf/diffmerge/tests/elements/Elements/Edge.java
/********************************************************************* * Copyright (c) 2010-2019 Thales Global Services S.A.S. * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 * which is available at https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Thales Global Services S.A.S. - initial API and implementation **********************************************************************/ package org.eclipse.emf.diffmerge.tests.elements.Elements; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Edge</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link org.eclipse.emf.diffmerge.tests.elements.Elements.Edge#getTarget <em>Target</em>}</li> * <li>{@link org.eclipse.emf.diffmerge.tests.elements.Elements.Edge#getSource <em>Source</em>}</li> * </ul> * </p> * * @see org.eclipse.emf.diffmerge.tests.elements.Elements.ElementsPackage#getEdge() * @model * @generated */ public interface Edge extends NamedElement { /** * Returns the value of the '<em><b>Target</b></em>' reference. * It is bidirectional and its opposite is '{@link org.eclipse.emf.diffmerge.tests.elements.Elements.Node#getIncoming <em>Incoming</em>}'. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Target</em>' reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Target</em>' reference. * @see #setTarget(Node) * @see org.eclipse.emf.diffmerge.tests.elements.Elements.ElementsPackage#getEdge_Target() * @see org.eclipse.emf.diffmerge.tests.elements.Elements.Node#getIncoming * @model opposite="incoming" required="true" * @generated */ Node getTarget(); /** * Sets the value of the '{@link org.eclipse.emf.diffmerge.tests.elements.Elements.Edge#getTarget <em>Target</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Target</em>' reference. * @see #getTarget() * @generated */ void setTarget(Node value); /** * Returns the value of the '<em><b>Source</b></em>' reference. * It is bidirectional and its opposite is '{@link org.eclipse.emf.diffmerge.tests.elements.Elements.Node#getOutgoing <em>Outgoing</em>}'. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Source</em>' reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Source</em>' reference. * @see #setSource(Node) * @see org.eclipse.emf.diffmerge.tests.elements.Elements.ElementsPackage#getEdge_Source() * @see org.eclipse.emf.diffmerge.tests.elements.Elements.Node#getOutgoing * @model opposite="outgoing" required="true" * @generated */ Node getSource(); /** * Sets the value of the '{@link org.eclipse.emf.diffmerge.tests.elements.Elements.Edge#getSource <em>Source</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Source</em>' reference. * @see #getSource() * @generated */ void setSource(Node value); } // Edge
3,317
Java
.java
83
37.036145
140
0.653036
eclipse/org.eclipse.emf.diffmerge.core
3
7
19
EPL-2.0
9/4/2024, 11:43:41 PM (Europe/Amsterdam)
false
false
false
true
false
false
false
true
3,317
4,080,675
ConstantDefRefValidator.java
catedrasaes-umu_idl4emf/org.csu.idl.idlmm/src/org/csu/idl/idlmm/validation/ConstantDefRefValidator.java
/** * * $Id$ */ package org.csu.idl.idlmm.validation; import org.csu.idl.idlmm.Constant; /** * A sample validator interface for {@link org.csu.idl.idlmm.ConstantDefRef}. * This doesn't really do anything, and it's not a real EMF artifact. * It was generated by the org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can be extended. * This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. */ public interface ConstantDefRefValidator { boolean validate(); boolean validateConstant(Constant value); }
587
Java
.java
16
34.875
135
0.778169
catedrasaes-umu/idl4emf
2
2
0
LGPL-3.0
9/5/2024, 12:02:16 AM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
587
4,474,758
GetMineWithProfiles.java
GeoscienceAustralia_FSDF-Metadata-Tool/services/src/main/java/org/fao/geonet/guiservices/groups/GetMineWithProfiles.java
//============================================================================= //=== Copyright (C) 2001-2007 Food and Agriculture Organization of the //=== United Nations (FAO-UN), United Nations World Food Programme (WFP) //=== and United Nations Environment Programme (UNEP) //=== //=== This program is free software; you can redistribute it and/or modify //=== it under the terms of the GNU General Public License as published by //=== the Free Software Foundation; either version 2 of the License, or (at //=== your option) any later version. //=== //=== This program is distributed in the hope that it will be useful, but //=== WITHOUT ANY WARRANTY; without even the implied warranty of //=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //=== General Public License for more details. //=== //=== You should have received a copy of the GNU General Public License //=== along with this program; if not, write to the Free Software //=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //=== //=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, //=== Rome - Italy. email: geonetwork@osgeo.org //============================================================================== package org.fao.geonet.guiservices.groups; import jeeves.interfaces.Service; import jeeves.server.ServiceConfig; import jeeves.server.UserSession; import jeeves.server.context.ServiceContext; import org.fao.geonet.constants.Geonet; import org.fao.geonet.domain.Profile; import org.fao.geonet.domain.UserGroup; import org.fao.geonet.repository.GroupRepository; import org.fao.geonet.repository.UserGroupRepository; import org.fao.geonet.repository.specification.UserGroupSpecs; import org.jdom.Element; import org.springframework.data.jpa.domain.Specifications; import java.nio.file.Path; import static org.fao.geonet.repository.specification.GroupSpecs.isReserved; import static org.springframework.data.jpa.domain.Specifications.not; import static org.springframework.data.jpa.domain.Specifications.where; /** * Service used to return all groups and profiles for current user. */ public class GetMineWithProfiles implements Service { public void init(Path appPath, ServiceConfig params) throws Exception { } public Element exec(Element params, ServiceContext context) throws Exception { UserSession session = context.getUserSession(); if (!session.isAuthenticated()) return new Element(Geonet.Elem.GROUPS); // --- retrieve user groups if (Profile.Administrator == session.getProfile()) { return context.getBean(GroupRepository.class).findAllAsXml(not(isReserved())); } else { final int userIdAsInt = session.getUserIdAsInt(); final Specifications<UserGroup> spec = where(UserGroupSpecs.hasUserId(userIdAsInt)).and(UserGroupSpecs.isReservedGroup(false)); return context.getBean(UserGroupRepository.class).findAllAsXml(spec); } } }
3,017
Java
.java
60
46.9
139
0.715061
GeoscienceAustralia/FSDF-Metadata-Tool
2
0
0
GPL-2.0
9/5/2024, 12:14:28 AM (Europe/Amsterdam)
false
false
false
true
false
false
false
true
3,017
1,486,231
RuleTypesGet.java
Alfresco_alfresco-remote-api/src/main/java/org/alfresco/repo/web/scripts/rule/RuleTypesGet.java
/* * #%L * Alfresco Remote API * %% * Copyright (C) 2005 - 2016 Alfresco Software Limited * %% * This file is part of the Alfresco software. * If the software was purchased under a paid Alfresco license, the terms of * the paid license agreement will prevail. Otherwise, the software is * provided under the following open source license terms: * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Alfresco is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * #L% */ package org.alfresco.repo.web.scripts.rule; import java.util.HashMap; import java.util.List; import java.util.Map; import org.alfresco.service.cmr.rule.RuleType; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.extensions.webscripts.Cache; import org.springframework.extensions.webscripts.Status; import org.springframework.extensions.webscripts.WebScriptRequest; /** * @author unknown * */ public class RuleTypesGet extends AbstractRuleWebScript { @SuppressWarnings("unused") private static Log logger = LogFactory.getLog(RuleTypesGet.class); @Override protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) { Map<String, Object> model = new HashMap<String, Object>(); // get all rule types List<RuleType> ruletypes = ruleService.getRuleTypes(); model.put("ruletypes", ruletypes); return model; } }
2,040
Java
.java
53
34.830189
96
0.749366
Alfresco/alfresco-remote-api
20
31
11
LGPL-3.0
9/4/2024, 7:53:37 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
2,040
1,318,227
A_test19_in.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/ConvertAnonymousToNested/canConvert/A_test19_in.java
package p; class A{ void f(){ final int u= 8; new A(){ int l= 9; int p0= 2, k= u, k1= k; int l1= l+1, p, q= p+u; }; } }
136
Java
.java
11
9.909091
26
0.47619
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
136
385,778
RDocumentCharSequence.java
kspalaiologos_kamilalisp/src/main/java/org/fife/ui/rtextarea/RDocumentCharSequence.java
/* * 06/30/2012 * * RDocumentCharSequence.java - Iterator over a portion of an RTextArea's * document. * * This library is distributed under a modified BSD license. See the included * LICENSE file for details. */ package org.fife.ui.rtextarea; import javax.swing.text.BadLocationException; /** * Allows iterating over a portion of an <code>RDocument</code>. This is of * course not thread-safe, so should only be used on the EDT or with external * synchronization. * * @author Robert Futrell * @version 1.0 */ class RDocumentCharSequence implements CharSequence { private RDocument doc; private int start; private int end; /** * Creates a <code>CharSequence</code> representing the text in a document * from the specified offset to the end of that document. * * @param doc The document. * @param start The starting offset in the document, inclusive. */ RDocumentCharSequence(RDocument doc, int start) { this(doc, start, doc.getLength()); } /** * Constructor. * * @param doc The document. * @param start The starting offset in the document, inclusive. * @param end the ending offset in the document, exclusive. */ RDocumentCharSequence(RDocument doc, int start, int end) { this.doc = doc; this.start = start; this.end = end; } @Override public char charAt(int index) { if (index<0 || index>=length()) { throw new IndexOutOfBoundsException("Index " + index + " is not in range [0-" + length() + ")"); } try { return doc.charAt(start+index); } catch (BadLocationException ble) { throw new IndexOutOfBoundsException(ble.toString()); } } @Override public int length() { return end - start; } @Override public CharSequence subSequence(int start, int end) { if (start<0) { throw new IndexOutOfBoundsException("start must be >= 0 (" + start + ")"); } else if (end<0) { throw new IndexOutOfBoundsException("end must be >= 0 (" + end + ")"); } else if (end>length()) { throw new IndexOutOfBoundsException("end must be <= " + length() + " (" + end + ")"); } else if (start>end) { throw new IndexOutOfBoundsException("start (" + start + ") cannot be > end (" + end + ")"); } int newStart = this.start + start; int newEnd = this.start + end; return new RDocumentCharSequence(doc, newStart, newEnd); } @Override public String toString() { try { return doc.getText(start, length()); } catch (BadLocationException ble) { // Never happens ble.printStackTrace(); return ""; } } }
2,544
Java
.java
93
24.419355
78
0.691454
kspalaiologos/kamilalisp
271
10
6
GPL-3.0
9/4/2024, 7:06:52 PM (Europe/Amsterdam)
true
true
true
true
true
true
true
true
2,544
1,312,435
TestListener.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.junit.sampleproject/src/main/java/junit/framework/TestListener.java
package junit.framework; /*- * #%L * org.eclipse.jdt.ui.junit.sampleproject * %% * Copyright (C) 2020 Eclipse Foundation * %% * This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v. 1.0 which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * #L% */ /** * A Listener for test progress */ public interface TestListener { /** * An error occurred. */ void addError(Test test, Throwable t); /** * A failure occurred. */ void addFailure(Test test, AssertionFailedError t); /** * A test ended. */ void endTest(Test test); /** * A test started. */ void startTest(Test test); }
887
Java
.java
35
23.114286
116
0.724911
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
true
false
true
false
true
true
true
887
1,318,163
TestSimpleEnclosingCodeStyle.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameterObject/testSimpleEnclosingCodeStyle/in/TestSimpleEnclosingCodeStyle.java
package p; public class TestSimpleEnclosingCodeStyle { public void foo(final String[] strings, int b){ System.out.println(strings[0]); b++; } public void fooCaller(){ foo(new String[]{"Test"},6); } }
213
Java
.java
10
19
48
0.715
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
213
1,315,789
NotInMethod1.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceParameter/invalid/NotInMethod1.java
//selection: 5, 23, 5, 28 package invalid; class NotInMethod1 { public int fSum= 1 + 2; }
92
Java
.java
5
17
25
0.709302
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
92
1,856,264
Imgproc.java
jorenham_fingerblox/FingerBlox/OpenCV 3.2.0/src/main/java/org/opencv/imgproc/Imgproc.java
// // This file is auto-generated. Please don't modify it! // package org.opencv.imgproc; import java.lang.String; import java.util.ArrayList; import java.util.List; import org.opencv.core.Mat; import org.opencv.core.MatOfFloat; import org.opencv.core.MatOfInt; import org.opencv.core.MatOfInt4; import org.opencv.core.MatOfPoint; import org.opencv.core.MatOfPoint2f; import org.opencv.core.Point; import org.opencv.core.Rect; import org.opencv.core.RotatedRect; import org.opencv.core.Scalar; import org.opencv.core.Size; import org.opencv.core.TermCriteria; import org.opencv.utils.Converters; public class Imgproc { private static final int IPL_BORDER_CONSTANT = 0, IPL_BORDER_REPLICATE = 1, IPL_BORDER_REFLECT = 2, IPL_BORDER_WRAP = 3, IPL_BORDER_REFLECT_101 = 4, IPL_BORDER_TRANSPARENT = 5, CV_INTER_NN = 0, CV_INTER_LINEAR = 1, CV_INTER_CUBIC = 2, CV_INTER_AREA = 3, CV_INTER_LANCZOS4 = 4, CV_MOP_ERODE = 0, CV_MOP_DILATE = 1, CV_MOP_OPEN = 2, CV_MOP_CLOSE = 3, CV_MOP_GRADIENT = 4, CV_MOP_TOPHAT = 5, CV_MOP_BLACKHAT = 6, CV_RETR_EXTERNAL = 0, CV_RETR_LIST = 1, CV_RETR_CCOMP = 2, CV_RETR_TREE = 3, CV_RETR_FLOODFILL = 4, CV_CHAIN_APPROX_NONE = 1, CV_CHAIN_APPROX_SIMPLE = 2, CV_CHAIN_APPROX_TC89_L1 = 3, CV_CHAIN_APPROX_TC89_KCOS = 4, CV_THRESH_BINARY = 0, CV_THRESH_BINARY_INV = 1, CV_THRESH_TRUNC = 2, CV_THRESH_TOZERO = 3, CV_THRESH_TOZERO_INV = 4, CV_THRESH_MASK = 7, CV_THRESH_OTSU = 8, CV_THRESH_TRIANGLE = 16; public static final int LINE_AA = 16, LINE_8 = 8, LINE_4 = 4, CV_BLUR_NO_SCALE = 0, CV_BLUR = 1, CV_GAUSSIAN = 2, CV_MEDIAN = 3, CV_BILATERAL = 4, CV_GAUSSIAN_5x5 = 7, CV_SCHARR = -1, CV_MAX_SOBEL_KSIZE = 7, CV_RGBA2mRGBA = 125, CV_mRGBA2RGBA = 126, CV_WARP_FILL_OUTLIERS = 8, CV_WARP_INVERSE_MAP = 16, CV_SHAPE_RECT = 0, CV_SHAPE_CROSS = 1, CV_SHAPE_ELLIPSE = 2, CV_SHAPE_CUSTOM = 100, CV_CHAIN_CODE = 0, CV_LINK_RUNS = 5, CV_POLY_APPROX_DP = 0, CV_CONTOURS_MATCH_I1 = 1, CV_CONTOURS_MATCH_I2 = 2, CV_CONTOURS_MATCH_I3 = 3, CV_CLOCKWISE = 1, CV_COUNTER_CLOCKWISE = 2, CV_COMP_CORREL = 0, CV_COMP_CHISQR = 1, CV_COMP_INTERSECT = 2, CV_COMP_BHATTACHARYYA = 3, CV_COMP_HELLINGER = CV_COMP_BHATTACHARYYA, CV_COMP_CHISQR_ALT = 4, CV_COMP_KL_DIV = 5, CV_DIST_MASK_3 = 3, CV_DIST_MASK_5 = 5, CV_DIST_MASK_PRECISE = 0, CV_DIST_LABEL_CCOMP = 0, CV_DIST_LABEL_PIXEL = 1, CV_DIST_USER = -1, CV_DIST_L1 = 1, CV_DIST_L2 = 2, CV_DIST_C = 3, CV_DIST_L12 = 4, CV_DIST_FAIR = 5, CV_DIST_WELSCH = 6, CV_DIST_HUBER = 7, CV_CANNY_L2_GRADIENT = (1 << 31), CV_HOUGH_STANDARD = 0, CV_HOUGH_PROBABILISTIC = 1, CV_HOUGH_MULTI_SCALE = 2, CV_HOUGH_GRADIENT = 3, MORPH_ERODE = 0, MORPH_DILATE = 1, MORPH_OPEN = 2, MORPH_CLOSE = 3, MORPH_GRADIENT = 4, MORPH_TOPHAT = 5, MORPH_BLACKHAT = 6, MORPH_HITMISS = 7, MORPH_RECT = 0, MORPH_CROSS = 1, MORPH_ELLIPSE = 2, INTER_NEAREST = 0, INTER_LINEAR = 1, INTER_CUBIC = 2, INTER_AREA = 3, INTER_LANCZOS4 = 4, INTER_MAX = 7, WARP_FILL_OUTLIERS = 8, WARP_INVERSE_MAP = 16, INTER_BITS = 5, INTER_BITS2 = INTER_BITS * 2, INTER_TAB_SIZE = 1 << INTER_BITS, INTER_TAB_SIZE2 = INTER_TAB_SIZE * INTER_TAB_SIZE, DIST_USER = -1, DIST_L1 = 1, DIST_L2 = 2, DIST_C = 3, DIST_L12 = 4, DIST_FAIR = 5, DIST_WELSCH = 6, DIST_HUBER = 7, DIST_MASK_3 = 3, DIST_MASK_5 = 5, DIST_MASK_PRECISE = 0, THRESH_BINARY = 0, THRESH_BINARY_INV = 1, THRESH_TRUNC = 2, THRESH_TOZERO = 3, THRESH_TOZERO_INV = 4, THRESH_MASK = 7, THRESH_OTSU = 8, THRESH_TRIANGLE = 16, ADAPTIVE_THRESH_MEAN_C = 0, ADAPTIVE_THRESH_GAUSSIAN_C = 1, PROJ_SPHERICAL_ORTHO = 0, PROJ_SPHERICAL_EQRECT = 1, GC_BGD = 0, GC_FGD = 1, GC_PR_BGD = 2, GC_PR_FGD = 3, GC_INIT_WITH_RECT = 0, GC_INIT_WITH_MASK = 1, GC_EVAL = 2, DIST_LABEL_CCOMP = 0, DIST_LABEL_PIXEL = 1, FLOODFILL_FIXED_RANGE = 1 << 16, FLOODFILL_MASK_ONLY = 1 << 17, CC_STAT_LEFT = 0, CC_STAT_TOP = 1, CC_STAT_WIDTH = 2, CC_STAT_HEIGHT = 3, CC_STAT_AREA = 4, CC_STAT_MAX = 5, CCL_WU = 0, CCL_DEFAULT = -1, CCL_GRANA = 1, RETR_EXTERNAL = 0, RETR_LIST = 1, RETR_CCOMP = 2, RETR_TREE = 3, RETR_FLOODFILL = 4, CHAIN_APPROX_NONE = 1, CHAIN_APPROX_SIMPLE = 2, CHAIN_APPROX_TC89_L1 = 3, CHAIN_APPROX_TC89_KCOS = 4, HOUGH_STANDARD = 0, HOUGH_PROBABILISTIC = 1, HOUGH_MULTI_SCALE = 2, HOUGH_GRADIENT = 3, LSD_REFINE_NONE = 0, LSD_REFINE_STD = 1, LSD_REFINE_ADV = 2, HISTCMP_CORREL = 0, HISTCMP_CHISQR = 1, HISTCMP_INTERSECT = 2, HISTCMP_BHATTACHARYYA = 3, HISTCMP_HELLINGER = HISTCMP_BHATTACHARYYA, HISTCMP_CHISQR_ALT = 4, HISTCMP_KL_DIV = 5, COLOR_BGR2BGRA = 0, COLOR_RGB2RGBA = COLOR_BGR2BGRA, COLOR_BGRA2BGR = 1, COLOR_RGBA2RGB = COLOR_BGRA2BGR, COLOR_BGR2RGBA = 2, COLOR_RGB2BGRA = COLOR_BGR2RGBA, COLOR_RGBA2BGR = 3, COLOR_BGRA2RGB = COLOR_RGBA2BGR, COLOR_BGR2RGB = 4, COLOR_RGB2BGR = COLOR_BGR2RGB, COLOR_BGRA2RGBA = 5, COLOR_RGBA2BGRA = COLOR_BGRA2RGBA, COLOR_BGR2GRAY = 6, COLOR_RGB2GRAY = 7, COLOR_GRAY2BGR = 8, COLOR_GRAY2RGB = COLOR_GRAY2BGR, COLOR_GRAY2BGRA = 9, COLOR_GRAY2RGBA = COLOR_GRAY2BGRA, COLOR_BGRA2GRAY = 10, COLOR_RGBA2GRAY = 11, COLOR_BGR2BGR565 = 12, COLOR_RGB2BGR565 = 13, COLOR_BGR5652BGR = 14, COLOR_BGR5652RGB = 15, COLOR_BGRA2BGR565 = 16, COLOR_RGBA2BGR565 = 17, COLOR_BGR5652BGRA = 18, COLOR_BGR5652RGBA = 19, COLOR_GRAY2BGR565 = 20, COLOR_BGR5652GRAY = 21, COLOR_BGR2BGR555 = 22, COLOR_RGB2BGR555 = 23, COLOR_BGR5552BGR = 24, COLOR_BGR5552RGB = 25, COLOR_BGRA2BGR555 = 26, COLOR_RGBA2BGR555 = 27, COLOR_BGR5552BGRA = 28, COLOR_BGR5552RGBA = 29, COLOR_GRAY2BGR555 = 30, COLOR_BGR5552GRAY = 31, COLOR_BGR2XYZ = 32, COLOR_RGB2XYZ = 33, COLOR_XYZ2BGR = 34, COLOR_XYZ2RGB = 35, COLOR_BGR2YCrCb = 36, COLOR_RGB2YCrCb = 37, COLOR_YCrCb2BGR = 38, COLOR_YCrCb2RGB = 39, COLOR_BGR2HSV = 40, COLOR_RGB2HSV = 41, COLOR_BGR2Lab = 44, COLOR_RGB2Lab = 45, COLOR_BGR2Luv = 50, COLOR_RGB2Luv = 51, COLOR_BGR2HLS = 52, COLOR_RGB2HLS = 53, COLOR_HSV2BGR = 54, COLOR_HSV2RGB = 55, COLOR_Lab2BGR = 56, COLOR_Lab2RGB = 57, COLOR_Luv2BGR = 58, COLOR_Luv2RGB = 59, COLOR_HLS2BGR = 60, COLOR_HLS2RGB = 61, COLOR_BGR2HSV_FULL = 66, COLOR_RGB2HSV_FULL = 67, COLOR_BGR2HLS_FULL = 68, COLOR_RGB2HLS_FULL = 69, COLOR_HSV2BGR_FULL = 70, COLOR_HSV2RGB_FULL = 71, COLOR_HLS2BGR_FULL = 72, COLOR_HLS2RGB_FULL = 73, COLOR_LBGR2Lab = 74, COLOR_LRGB2Lab = 75, COLOR_LBGR2Luv = 76, COLOR_LRGB2Luv = 77, COLOR_Lab2LBGR = 78, COLOR_Lab2LRGB = 79, COLOR_Luv2LBGR = 80, COLOR_Luv2LRGB = 81, COLOR_BGR2YUV = 82, COLOR_RGB2YUV = 83, COLOR_YUV2BGR = 84, COLOR_YUV2RGB = 85, COLOR_YUV2RGB_NV12 = 90, COLOR_YUV2BGR_NV12 = 91, COLOR_YUV2RGB_NV21 = 92, COLOR_YUV2BGR_NV21 = 93, COLOR_YUV420sp2RGB = COLOR_YUV2RGB_NV21, COLOR_YUV420sp2BGR = COLOR_YUV2BGR_NV21, COLOR_YUV2RGBA_NV12 = 94, COLOR_YUV2BGRA_NV12 = 95, COLOR_YUV2RGBA_NV21 = 96, COLOR_YUV2BGRA_NV21 = 97, COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21, COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21, COLOR_YUV2RGB_YV12 = 98, COLOR_YUV2BGR_YV12 = 99, COLOR_YUV2RGB_IYUV = 100, COLOR_YUV2BGR_IYUV = 101, COLOR_YUV2RGB_I420 = COLOR_YUV2RGB_IYUV, COLOR_YUV2BGR_I420 = COLOR_YUV2BGR_IYUV, COLOR_YUV420p2RGB = COLOR_YUV2RGB_YV12, COLOR_YUV420p2BGR = COLOR_YUV2BGR_YV12, COLOR_YUV2RGBA_YV12 = 102, COLOR_YUV2BGRA_YV12 = 103, COLOR_YUV2RGBA_IYUV = 104, COLOR_YUV2BGRA_IYUV = 105, COLOR_YUV2RGBA_I420 = COLOR_YUV2RGBA_IYUV, COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV, COLOR_YUV420p2RGBA = COLOR_YUV2RGBA_YV12, COLOR_YUV420p2BGRA = COLOR_YUV2BGRA_YV12, COLOR_YUV2GRAY_420 = 106, COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420, COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420, COLOR_YUV2GRAY_YV12 = COLOR_YUV2GRAY_420, COLOR_YUV2GRAY_IYUV = COLOR_YUV2GRAY_420, COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420, COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420, COLOR_YUV420p2GRAY = COLOR_YUV2GRAY_420, COLOR_YUV2RGB_UYVY = 107, COLOR_YUV2BGR_UYVY = 108, COLOR_YUV2RGB_Y422 = COLOR_YUV2RGB_UYVY, COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY, COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY, COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY, COLOR_YUV2RGBA_UYVY = 111, COLOR_YUV2BGRA_UYVY = 112, COLOR_YUV2RGBA_Y422 = COLOR_YUV2RGBA_UYVY, COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY, COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY, COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY, COLOR_YUV2RGB_YUY2 = 115, COLOR_YUV2BGR_YUY2 = 116, COLOR_YUV2RGB_YVYU = 117, COLOR_YUV2BGR_YVYU = 118, COLOR_YUV2RGB_YUYV = COLOR_YUV2RGB_YUY2, COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2, COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2, COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2, COLOR_YUV2RGBA_YUY2 = 119, COLOR_YUV2BGRA_YUY2 = 120, COLOR_YUV2RGBA_YVYU = 121, COLOR_YUV2BGRA_YVYU = 122, COLOR_YUV2RGBA_YUYV = COLOR_YUV2RGBA_YUY2, COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2, COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2, COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2, COLOR_YUV2GRAY_UYVY = 123, COLOR_YUV2GRAY_YUY2 = 124, COLOR_YUV2GRAY_Y422 = COLOR_YUV2GRAY_UYVY, COLOR_YUV2GRAY_UYNV = COLOR_YUV2GRAY_UYVY, COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2, COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2, COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2, COLOR_RGBA2mRGBA = 125, COLOR_mRGBA2RGBA = 126, COLOR_RGB2YUV_I420 = 127, COLOR_BGR2YUV_I420 = 128, COLOR_RGB2YUV_IYUV = COLOR_RGB2YUV_I420, COLOR_BGR2YUV_IYUV = COLOR_BGR2YUV_I420, COLOR_RGBA2YUV_I420 = 129, COLOR_BGRA2YUV_I420 = 130, COLOR_RGBA2YUV_IYUV = COLOR_RGBA2YUV_I420, COLOR_BGRA2YUV_IYUV = COLOR_BGRA2YUV_I420, COLOR_RGB2YUV_YV12 = 131, COLOR_BGR2YUV_YV12 = 132, COLOR_RGBA2YUV_YV12 = 133, COLOR_BGRA2YUV_YV12 = 134, COLOR_BayerBG2BGR = 46, COLOR_BayerGB2BGR = 47, COLOR_BayerRG2BGR = 48, COLOR_BayerGR2BGR = 49, COLOR_BayerBG2RGB = COLOR_BayerRG2BGR, COLOR_BayerGB2RGB = COLOR_BayerGR2BGR, COLOR_BayerRG2RGB = COLOR_BayerBG2BGR, COLOR_BayerGR2RGB = COLOR_BayerGB2BGR, COLOR_BayerBG2GRAY = 86, COLOR_BayerGB2GRAY = 87, COLOR_BayerRG2GRAY = 88, COLOR_BayerGR2GRAY = 89, COLOR_BayerBG2BGR_VNG = 62, COLOR_BayerGB2BGR_VNG = 63, COLOR_BayerRG2BGR_VNG = 64, COLOR_BayerGR2BGR_VNG = 65, COLOR_BayerBG2RGB_VNG = COLOR_BayerRG2BGR_VNG, COLOR_BayerGB2RGB_VNG = COLOR_BayerGR2BGR_VNG, COLOR_BayerRG2RGB_VNG = COLOR_BayerBG2BGR_VNG, COLOR_BayerGR2RGB_VNG = COLOR_BayerGB2BGR_VNG, COLOR_BayerBG2BGR_EA = 135, COLOR_BayerGB2BGR_EA = 136, COLOR_BayerRG2BGR_EA = 137, COLOR_BayerGR2BGR_EA = 138, COLOR_BayerBG2RGB_EA = COLOR_BayerRG2BGR_EA, COLOR_BayerGB2RGB_EA = COLOR_BayerGR2BGR_EA, COLOR_BayerRG2RGB_EA = COLOR_BayerBG2BGR_EA, COLOR_BayerGR2RGB_EA = COLOR_BayerGB2BGR_EA, COLOR_COLORCVT_MAX = 139, INTERSECT_NONE = 0, INTERSECT_PARTIAL = 1, INTERSECT_FULL = 2, TM_SQDIFF = 0, TM_SQDIFF_NORMED = 1, TM_CCORR = 2, TM_CCORR_NORMED = 3, TM_CCOEFF = 4, TM_CCOEFF_NORMED = 5, COLORMAP_AUTUMN = 0, COLORMAP_BONE = 1, COLORMAP_JET = 2, COLORMAP_WINTER = 3, COLORMAP_RAINBOW = 4, COLORMAP_OCEAN = 5, COLORMAP_SUMMER = 6, COLORMAP_SPRING = 7, COLORMAP_COOL = 8, COLORMAP_HSV = 9, COLORMAP_PINK = 10, COLORMAP_HOT = 11, COLORMAP_PARULA = 12, MARKER_CROSS = 0, MARKER_TILTED_CROSS = 1, MARKER_STAR = 2, MARKER_DIAMOND = 3, MARKER_SQUARE = 4, MARKER_TRIANGLE_UP = 5, MARKER_TRIANGLE_DOWN = 6; // // C++: Mat getAffineTransform(vector_Point2f src, vector_Point2f dst) // //javadoc: getAffineTransform(src, dst) public static Mat getAffineTransform(MatOfPoint2f src, MatOfPoint2f dst) { Mat src_mat = src; Mat dst_mat = dst; Mat retVal = new Mat(getAffineTransform_0(src_mat.nativeObj, dst_mat.nativeObj)); return retVal; } // // C++: Mat getDefaultNewCameraMatrix(Mat cameraMatrix, Size imgsize = Size(), bool centerPrincipalPoint = false) // //javadoc: getDefaultNewCameraMatrix(cameraMatrix, imgsize, centerPrincipalPoint) public static Mat getDefaultNewCameraMatrix(Mat cameraMatrix, Size imgsize, boolean centerPrincipalPoint) { Mat retVal = new Mat(getDefaultNewCameraMatrix_0(cameraMatrix.nativeObj, imgsize.width, imgsize.height, centerPrincipalPoint)); return retVal; } //javadoc: getDefaultNewCameraMatrix(cameraMatrix) public static Mat getDefaultNewCameraMatrix(Mat cameraMatrix) { Mat retVal = new Mat(getDefaultNewCameraMatrix_1(cameraMatrix.nativeObj)); return retVal; } // // C++: Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi = CV_PI*0.5, int ktype = CV_64F) // //javadoc: getGaborKernel(ksize, sigma, theta, lambd, gamma, psi, ktype) public static Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi, int ktype) { Mat retVal = new Mat(getGaborKernel_0(ksize.width, ksize.height, sigma, theta, lambd, gamma, psi, ktype)); return retVal; } //javadoc: getGaborKernel(ksize, sigma, theta, lambd, gamma) public static Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma) { Mat retVal = new Mat(getGaborKernel_1(ksize.width, ksize.height, sigma, theta, lambd, gamma)); return retVal; } // // C++: Mat getGaussianKernel(int ksize, double sigma, int ktype = CV_64F) // //javadoc: getGaussianKernel(ksize, sigma, ktype) public static Mat getGaussianKernel(int ksize, double sigma, int ktype) { Mat retVal = new Mat(getGaussianKernel_0(ksize, sigma, ktype)); return retVal; } //javadoc: getGaussianKernel(ksize, sigma) public static Mat getGaussianKernel(int ksize, double sigma) { Mat retVal = new Mat(getGaussianKernel_1(ksize, sigma)); return retVal; } // // C++: Mat getPerspectiveTransform(Mat src, Mat dst) // //javadoc: getPerspectiveTransform(src, dst) public static Mat getPerspectiveTransform(Mat src, Mat dst) { Mat retVal = new Mat(getPerspectiveTransform_0(src.nativeObj, dst.nativeObj)); return retVal; } // // C++: Mat getRotationMatrix2D(Point2f center, double angle, double scale) // //javadoc: getRotationMatrix2D(center, angle, scale) public static Mat getRotationMatrix2D(Point center, double angle, double scale) { Mat retVal = new Mat(getRotationMatrix2D_0(center.x, center.y, angle, scale)); return retVal; } // // C++: Mat getStructuringElement(int shape, Size ksize, Point anchor = Point(-1,-1)) // //javadoc: getStructuringElement(shape, ksize, anchor) public static Mat getStructuringElement(int shape, Size ksize, Point anchor) { Mat retVal = new Mat(getStructuringElement_0(shape, ksize.width, ksize.height, anchor.x, anchor.y)); return retVal; } //javadoc: getStructuringElement(shape, ksize) public static Mat getStructuringElement(int shape, Size ksize) { Mat retVal = new Mat(getStructuringElement_1(shape, ksize.width, ksize.height)); return retVal; } // // C++: Moments moments(Mat array, bool binaryImage = false) // //javadoc: moments(array, binaryImage) public static Moments moments(Mat array, boolean binaryImage) { Moments retVal = new Moments(moments_0(array.nativeObj, binaryImage)); return retVal; } //javadoc: moments(array) public static Moments moments(Mat array) { Moments retVal = new Moments(moments_1(array.nativeObj)); return retVal; } // // C++: Point2d phaseCorrelate(Mat src1, Mat src2, Mat window = Mat(), double* response = 0) // //javadoc: phaseCorrelate(src1, src2, window, response) public static Point phaseCorrelate(Mat src1, Mat src2, Mat window, double[] response) { double[] response_out = new double[1]; Point retVal = new Point(phaseCorrelate_0(src1.nativeObj, src2.nativeObj, window.nativeObj, response_out)); if(response!=null) response[0] = (double)response_out[0]; return retVal; } //javadoc: phaseCorrelate(src1, src2) public static Point phaseCorrelate(Mat src1, Mat src2) { Point retVal = new Point(phaseCorrelate_1(src1.nativeObj, src2.nativeObj)); return retVal; } // // C++: Ptr_CLAHE createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8)) // //javadoc: createCLAHE(clipLimit, tileGridSize) public static CLAHE createCLAHE(double clipLimit, Size tileGridSize) { CLAHE retVal = new CLAHE(createCLAHE_0(clipLimit, tileGridSize.width, tileGridSize.height)); return retVal; } //javadoc: createCLAHE() public static CLAHE createCLAHE() { CLAHE retVal = new CLAHE(createCLAHE_1()); return retVal; } // // C++: Ptr_LineSegmentDetector createLineSegmentDetector(int _refine = LSD_REFINE_STD, double _scale = 0.8, double _sigma_scale = 0.6, double _quant = 2.0, double _ang_th = 22.5, double _log_eps = 0, double _density_th = 0.7, int _n_bins = 1024) // //javadoc: createLineSegmentDetector(_refine, _scale, _sigma_scale, _quant, _ang_th, _log_eps, _density_th, _n_bins) public static LineSegmentDetector createLineSegmentDetector(int _refine, double _scale, double _sigma_scale, double _quant, double _ang_th, double _log_eps, double _density_th, int _n_bins) { LineSegmentDetector retVal = new LineSegmentDetector(createLineSegmentDetector_0(_refine, _scale, _sigma_scale, _quant, _ang_th, _log_eps, _density_th, _n_bins)); return retVal; } //javadoc: createLineSegmentDetector() public static LineSegmentDetector createLineSegmentDetector() { LineSegmentDetector retVal = new LineSegmentDetector(createLineSegmentDetector_1()); return retVal; } // // C++: Rect boundingRect(vector_Point points) // //javadoc: boundingRect(points) public static Rect boundingRect(MatOfPoint points) { Mat points_mat = points; Rect retVal = new Rect(boundingRect_0(points_mat.nativeObj)); return retVal; } // // C++: RotatedRect fitEllipse(vector_Point2f points) // //javadoc: fitEllipse(points) public static RotatedRect fitEllipse(MatOfPoint2f points) { Mat points_mat = points; RotatedRect retVal = new RotatedRect(fitEllipse_0(points_mat.nativeObj)); return retVal; } // // C++: RotatedRect minAreaRect(vector_Point2f points) // //javadoc: minAreaRect(points) public static RotatedRect minAreaRect(MatOfPoint2f points) { Mat points_mat = points; RotatedRect retVal = new RotatedRect(minAreaRect_0(points_mat.nativeObj)); return retVal; } // // C++: bool clipLine(Rect imgRect, Point& pt1, Point& pt2) // //javadoc: clipLine(imgRect, pt1, pt2) public static boolean clipLine(Rect imgRect, Point pt1, Point pt2) { double[] pt1_out = new double[2]; double[] pt2_out = new double[2]; boolean retVal = clipLine_0(imgRect.x, imgRect.y, imgRect.width, imgRect.height, pt1.x, pt1.y, pt1_out, pt2.x, pt2.y, pt2_out); if(pt1!=null){ pt1.x = pt1_out[0]; pt1.y = pt1_out[1]; } if(pt2!=null){ pt2.x = pt2_out[0]; pt2.y = pt2_out[1]; } return retVal; } // // C++: bool isContourConvex(vector_Point contour) // //javadoc: isContourConvex(contour) public static boolean isContourConvex(MatOfPoint contour) { Mat contour_mat = contour; boolean retVal = isContourConvex_0(contour_mat.nativeObj); return retVal; } // // C++: double arcLength(vector_Point2f curve, bool closed) // //javadoc: arcLength(curve, closed) public static double arcLength(MatOfPoint2f curve, boolean closed) { Mat curve_mat = curve; double retVal = arcLength_0(curve_mat.nativeObj, closed); return retVal; } // // C++: double compareHist(Mat H1, Mat H2, int method) // //javadoc: compareHist(H1, H2, method) public static double compareHist(Mat H1, Mat H2, int method) { double retVal = compareHist_0(H1.nativeObj, H2.nativeObj, method); return retVal; } // // C++: double contourArea(Mat contour, bool oriented = false) // //javadoc: contourArea(contour, oriented) public static double contourArea(Mat contour, boolean oriented) { double retVal = contourArea_0(contour.nativeObj, oriented); return retVal; } //javadoc: contourArea(contour) public static double contourArea(Mat contour) { double retVal = contourArea_1(contour.nativeObj); return retVal; } // // C++: double matchShapes(Mat contour1, Mat contour2, int method, double parameter) // //javadoc: matchShapes(contour1, contour2, method, parameter) public static double matchShapes(Mat contour1, Mat contour2, int method, double parameter) { double retVal = matchShapes_0(contour1.nativeObj, contour2.nativeObj, method, parameter); return retVal; } // // C++: double minEnclosingTriangle(Mat points, Mat& triangle) // //javadoc: minEnclosingTriangle(points, triangle) public static double minEnclosingTriangle(Mat points, Mat triangle) { double retVal = minEnclosingTriangle_0(points.nativeObj, triangle.nativeObj); return retVal; } // // C++: double pointPolygonTest(vector_Point2f contour, Point2f pt, bool measureDist) // //javadoc: pointPolygonTest(contour, pt, measureDist) public static double pointPolygonTest(MatOfPoint2f contour, Point pt, boolean measureDist) { Mat contour_mat = contour; double retVal = pointPolygonTest_0(contour_mat.nativeObj, pt.x, pt.y, measureDist); return retVal; } // // C++: double threshold(Mat src, Mat& dst, double thresh, double maxval, int type) // //javadoc: threshold(src, dst, thresh, maxval, type) public static double threshold(Mat src, Mat dst, double thresh, double maxval, int type) { double retVal = threshold_0(src.nativeObj, dst.nativeObj, thresh, maxval, type); return retVal; } // // C++: float initWideAngleProjMap(Mat cameraMatrix, Mat distCoeffs, Size imageSize, int destImageWidth, int m1type, Mat& map1, Mat& map2, int projType = PROJ_SPHERICAL_EQRECT, double alpha = 0) // //javadoc: initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize, destImageWidth, m1type, map1, map2, projType, alpha) public static float initWideAngleProjMap(Mat cameraMatrix, Mat distCoeffs, Size imageSize, int destImageWidth, int m1type, Mat map1, Mat map2, int projType, double alpha) { float retVal = initWideAngleProjMap_0(cameraMatrix.nativeObj, distCoeffs.nativeObj, imageSize.width, imageSize.height, destImageWidth, m1type, map1.nativeObj, map2.nativeObj, projType, alpha); return retVal; } //javadoc: initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize, destImageWidth, m1type, map1, map2) public static float initWideAngleProjMap(Mat cameraMatrix, Mat distCoeffs, Size imageSize, int destImageWidth, int m1type, Mat map1, Mat map2) { float retVal = initWideAngleProjMap_1(cameraMatrix.nativeObj, distCoeffs.nativeObj, imageSize.width, imageSize.height, destImageWidth, m1type, map1.nativeObj, map2.nativeObj); return retVal; } // // C++: float intersectConvexConvex(Mat _p1, Mat _p2, Mat& _p12, bool handleNested = true) // //javadoc: intersectConvexConvex(_p1, _p2, _p12, handleNested) public static float intersectConvexConvex(Mat _p1, Mat _p2, Mat _p12, boolean handleNested) { float retVal = intersectConvexConvex_0(_p1.nativeObj, _p2.nativeObj, _p12.nativeObj, handleNested); return retVal; } //javadoc: intersectConvexConvex(_p1, _p2, _p12) public static float intersectConvexConvex(Mat _p1, Mat _p2, Mat _p12) { float retVal = intersectConvexConvex_1(_p1.nativeObj, _p2.nativeObj, _p12.nativeObj); return retVal; } // // C++: int connectedComponents(Mat image, Mat& labels, int connectivity, int ltype, int ccltype) // //javadoc: connectedComponents(image, labels, connectivity, ltype, ccltype) public static int connectedComponentsWithAlgorithm(Mat image, Mat labels, int connectivity, int ltype, int ccltype) { int retVal = connectedComponentsWithAlgorithm_0(image.nativeObj, labels.nativeObj, connectivity, ltype, ccltype); return retVal; } // // C++: int connectedComponents(Mat image, Mat& labels, int connectivity = 8, int ltype = CV_32S) // //javadoc: connectedComponents(image, labels, connectivity, ltype) public static int connectedComponents(Mat image, Mat labels, int connectivity, int ltype) { int retVal = connectedComponents_0(image.nativeObj, labels.nativeObj, connectivity, ltype); return retVal; } //javadoc: connectedComponents(image, labels) public static int connectedComponents(Mat image, Mat labels) { int retVal = connectedComponents_1(image.nativeObj, labels.nativeObj); return retVal; } // // C++: int connectedComponentsWithStats(Mat image, Mat& labels, Mat& stats, Mat& centroids, int connectivity, int ltype, int ccltype) // //javadoc: connectedComponentsWithStats(image, labels, stats, centroids, connectivity, ltype, ccltype) public static int connectedComponentsWithStatsWithAlgorithm(Mat image, Mat labels, Mat stats, Mat centroids, int connectivity, int ltype, int ccltype) { int retVal = connectedComponentsWithStatsWithAlgorithm_0(image.nativeObj, labels.nativeObj, stats.nativeObj, centroids.nativeObj, connectivity, ltype, ccltype); return retVal; } // // C++: int connectedComponentsWithStats(Mat image, Mat& labels, Mat& stats, Mat& centroids, int connectivity = 8, int ltype = CV_32S) // //javadoc: connectedComponentsWithStats(image, labels, stats, centroids, connectivity, ltype) public static int connectedComponentsWithStats(Mat image, Mat labels, Mat stats, Mat centroids, int connectivity, int ltype) { int retVal = connectedComponentsWithStats_0(image.nativeObj, labels.nativeObj, stats.nativeObj, centroids.nativeObj, connectivity, ltype); return retVal; } //javadoc: connectedComponentsWithStats(image, labels, stats, centroids) public static int connectedComponentsWithStats(Mat image, Mat labels, Mat stats, Mat centroids) { int retVal = connectedComponentsWithStats_1(image.nativeObj, labels.nativeObj, stats.nativeObj, centroids.nativeObj); return retVal; } // // C++: int floodFill(Mat& image, Mat& mask, Point seedPoint, Scalar newVal, Rect* rect = 0, Scalar loDiff = Scalar(), Scalar upDiff = Scalar(), int flags = 4) // //javadoc: floodFill(image, mask, seedPoint, newVal, rect, loDiff, upDiff, flags) public static int floodFill(Mat image, Mat mask, Point seedPoint, Scalar newVal, Rect rect, Scalar loDiff, Scalar upDiff, int flags) { double[] rect_out = new double[4]; int retVal = floodFill_0(image.nativeObj, mask.nativeObj, seedPoint.x, seedPoint.y, newVal.val[0], newVal.val[1], newVal.val[2], newVal.val[3], rect_out, loDiff.val[0], loDiff.val[1], loDiff.val[2], loDiff.val[3], upDiff.val[0], upDiff.val[1], upDiff.val[2], upDiff.val[3], flags); if(rect!=null){ rect.x = (int)rect_out[0]; rect.y = (int)rect_out[1]; rect.width = (int)rect_out[2]; rect.height = (int)rect_out[3]; } return retVal; } //javadoc: floodFill(image, mask, seedPoint, newVal) public static int floodFill(Mat image, Mat mask, Point seedPoint, Scalar newVal) { int retVal = floodFill_1(image.nativeObj, mask.nativeObj, seedPoint.x, seedPoint.y, newVal.val[0], newVal.val[1], newVal.val[2], newVal.val[3]); return retVal; } // // C++: int rotatedRectangleIntersection(RotatedRect rect1, RotatedRect rect2, Mat& intersectingRegion) // //javadoc: rotatedRectangleIntersection(rect1, rect2, intersectingRegion) public static int rotatedRectangleIntersection(RotatedRect rect1, RotatedRect rect2, Mat intersectingRegion) { int retVal = rotatedRectangleIntersection_0(rect1.center.x, rect1.center.y, rect1.size.width, rect1.size.height, rect1.angle, rect2.center.x, rect2.center.y, rect2.size.width, rect2.size.height, rect2.angle, intersectingRegion.nativeObj); return retVal; } // // C++: void Canny(Mat dx, Mat dy, Mat& edges, double threshold1, double threshold2, bool L2gradient = false) // //javadoc: Canny(dx, dy, edges, threshold1, threshold2, L2gradient) public static void Canny(Mat dx, Mat dy, Mat edges, double threshold1, double threshold2, boolean L2gradient) { Canny_0(dx.nativeObj, dy.nativeObj, edges.nativeObj, threshold1, threshold2, L2gradient); return; } //javadoc: Canny(dx, dy, edges, threshold1, threshold2) public static void Canny(Mat dx, Mat dy, Mat edges, double threshold1, double threshold2) { Canny_1(dx.nativeObj, dy.nativeObj, edges.nativeObj, threshold1, threshold2); return; } // // C++: void Canny(Mat image, Mat& edges, double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false) // //javadoc: Canny(image, edges, threshold1, threshold2, apertureSize, L2gradient) public static void Canny(Mat image, Mat edges, double threshold1, double threshold2, int apertureSize, boolean L2gradient) { Canny_2(image.nativeObj, edges.nativeObj, threshold1, threshold2, apertureSize, L2gradient); return; } //javadoc: Canny(image, edges, threshold1, threshold2) public static void Canny(Mat image, Mat edges, double threshold1, double threshold2) { Canny_3(image.nativeObj, edges.nativeObj, threshold1, threshold2); return; } // // C++: void GaussianBlur(Mat src, Mat& dst, Size ksize, double sigmaX, double sigmaY = 0, int borderType = BORDER_DEFAULT) // //javadoc: GaussianBlur(src, dst, ksize, sigmaX, sigmaY, borderType) public static void GaussianBlur(Mat src, Mat dst, Size ksize, double sigmaX, double sigmaY, int borderType) { GaussianBlur_0(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, sigmaX, sigmaY, borderType); return; } //javadoc: GaussianBlur(src, dst, ksize, sigmaX, sigmaY) public static void GaussianBlur(Mat src, Mat dst, Size ksize, double sigmaX, double sigmaY) { GaussianBlur_1(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, sigmaX, sigmaY); return; } //javadoc: GaussianBlur(src, dst, ksize, sigmaX) public static void GaussianBlur(Mat src, Mat dst, Size ksize, double sigmaX) { GaussianBlur_2(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, sigmaX); return; } // // C++: void HoughCircles(Mat image, Mat& circles, int method, double dp, double minDist, double param1 = 100, double param2 = 100, int minRadius = 0, int maxRadius = 0) // //javadoc: HoughCircles(image, circles, method, dp, minDist, param1, param2, minRadius, maxRadius) public static void HoughCircles(Mat image, Mat circles, int method, double dp, double minDist, double param1, double param2, int minRadius, int maxRadius) { HoughCircles_0(image.nativeObj, circles.nativeObj, method, dp, minDist, param1, param2, minRadius, maxRadius); return; } //javadoc: HoughCircles(image, circles, method, dp, minDist) public static void HoughCircles(Mat image, Mat circles, int method, double dp, double minDist) { HoughCircles_1(image.nativeObj, circles.nativeObj, method, dp, minDist); return; } // // C++: void HoughLines(Mat image, Mat& lines, double rho, double theta, int threshold, double srn = 0, double stn = 0, double min_theta = 0, double max_theta = CV_PI) // //javadoc: HoughLines(image, lines, rho, theta, threshold, srn, stn, min_theta, max_theta) public static void HoughLines(Mat image, Mat lines, double rho, double theta, int threshold, double srn, double stn, double min_theta, double max_theta) { HoughLines_0(image.nativeObj, lines.nativeObj, rho, theta, threshold, srn, stn, min_theta, max_theta); return; } //javadoc: HoughLines(image, lines, rho, theta, threshold) public static void HoughLines(Mat image, Mat lines, double rho, double theta, int threshold) { HoughLines_1(image.nativeObj, lines.nativeObj, rho, theta, threshold); return; } // // C++: void HoughLinesP(Mat image, Mat& lines, double rho, double theta, int threshold, double minLineLength = 0, double maxLineGap = 0) // //javadoc: HoughLinesP(image, lines, rho, theta, threshold, minLineLength, maxLineGap) public static void HoughLinesP(Mat image, Mat lines, double rho, double theta, int threshold, double minLineLength, double maxLineGap) { HoughLinesP_0(image.nativeObj, lines.nativeObj, rho, theta, threshold, minLineLength, maxLineGap); return; } //javadoc: HoughLinesP(image, lines, rho, theta, threshold) public static void HoughLinesP(Mat image, Mat lines, double rho, double theta, int threshold) { HoughLinesP_1(image.nativeObj, lines.nativeObj, rho, theta, threshold); return; } // // C++: void HuMoments(Moments m, Mat& hu) // //javadoc: HuMoments(m, hu) public static void HuMoments(Moments m, Mat hu) { HuMoments_0(m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03, hu.nativeObj); return; } // // C++: void Laplacian(Mat src, Mat& dst, int ddepth, int ksize = 1, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) // //javadoc: Laplacian(src, dst, ddepth, ksize, scale, delta, borderType) public static void Laplacian(Mat src, Mat dst, int ddepth, int ksize, double scale, double delta, int borderType) { Laplacian_0(src.nativeObj, dst.nativeObj, ddepth, ksize, scale, delta, borderType); return; } //javadoc: Laplacian(src, dst, ddepth, ksize, scale, delta) public static void Laplacian(Mat src, Mat dst, int ddepth, int ksize, double scale, double delta) { Laplacian_1(src.nativeObj, dst.nativeObj, ddepth, ksize, scale, delta); return; } //javadoc: Laplacian(src, dst, ddepth) public static void Laplacian(Mat src, Mat dst, int ddepth) { Laplacian_2(src.nativeObj, dst.nativeObj, ddepth); return; } // // C++: void Scharr(Mat src, Mat& dst, int ddepth, int dx, int dy, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) // //javadoc: Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType) public static void Scharr(Mat src, Mat dst, int ddepth, int dx, int dy, double scale, double delta, int borderType) { Scharr_0(src.nativeObj, dst.nativeObj, ddepth, dx, dy, scale, delta, borderType); return; } //javadoc: Scharr(src, dst, ddepth, dx, dy, scale, delta) public static void Scharr(Mat src, Mat dst, int ddepth, int dx, int dy, double scale, double delta) { Scharr_1(src.nativeObj, dst.nativeObj, ddepth, dx, dy, scale, delta); return; } //javadoc: Scharr(src, dst, ddepth, dx, dy) public static void Scharr(Mat src, Mat dst, int ddepth, int dx, int dy) { Scharr_2(src.nativeObj, dst.nativeObj, ddepth, dx, dy); return; } // // C++: void Sobel(Mat src, Mat& dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) // //javadoc: Sobel(src, dst, ddepth, dx, dy, ksize, scale, delta, borderType) public static void Sobel(Mat src, Mat dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType) { Sobel_0(src.nativeObj, dst.nativeObj, ddepth, dx, dy, ksize, scale, delta, borderType); return; } //javadoc: Sobel(src, dst, ddepth, dx, dy, ksize, scale, delta) public static void Sobel(Mat src, Mat dst, int ddepth, int dx, int dy, int ksize, double scale, double delta) { Sobel_1(src.nativeObj, dst.nativeObj, ddepth, dx, dy, ksize, scale, delta); return; } //javadoc: Sobel(src, dst, ddepth, dx, dy) public static void Sobel(Mat src, Mat dst, int ddepth, int dx, int dy) { Sobel_2(src.nativeObj, dst.nativeObj, ddepth, dx, dy); return; } // // C++: void accumulate(Mat src, Mat& dst, Mat mask = Mat()) // //javadoc: accumulate(src, dst, mask) public static void accumulate(Mat src, Mat dst, Mat mask) { accumulate_0(src.nativeObj, dst.nativeObj, mask.nativeObj); return; } //javadoc: accumulate(src, dst) public static void accumulate(Mat src, Mat dst) { accumulate_1(src.nativeObj, dst.nativeObj); return; } // // C++: void accumulateProduct(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) // //javadoc: accumulateProduct(src1, src2, dst, mask) public static void accumulateProduct(Mat src1, Mat src2, Mat dst, Mat mask) { accumulateProduct_0(src1.nativeObj, src2.nativeObj, dst.nativeObj, mask.nativeObj); return; } //javadoc: accumulateProduct(src1, src2, dst) public static void accumulateProduct(Mat src1, Mat src2, Mat dst) { accumulateProduct_1(src1.nativeObj, src2.nativeObj, dst.nativeObj); return; } // // C++: void accumulateSquare(Mat src, Mat& dst, Mat mask = Mat()) // //javadoc: accumulateSquare(src, dst, mask) public static void accumulateSquare(Mat src, Mat dst, Mat mask) { accumulateSquare_0(src.nativeObj, dst.nativeObj, mask.nativeObj); return; } //javadoc: accumulateSquare(src, dst) public static void accumulateSquare(Mat src, Mat dst) { accumulateSquare_1(src.nativeObj, dst.nativeObj); return; } // // C++: void accumulateWeighted(Mat src, Mat& dst, double alpha, Mat mask = Mat()) // //javadoc: accumulateWeighted(src, dst, alpha, mask) public static void accumulateWeighted(Mat src, Mat dst, double alpha, Mat mask) { accumulateWeighted_0(src.nativeObj, dst.nativeObj, alpha, mask.nativeObj); return; } //javadoc: accumulateWeighted(src, dst, alpha) public static void accumulateWeighted(Mat src, Mat dst, double alpha) { accumulateWeighted_1(src.nativeObj, dst.nativeObj, alpha); return; } // // C++: void adaptiveThreshold(Mat src, Mat& dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) // //javadoc: adaptiveThreshold(src, dst, maxValue, adaptiveMethod, thresholdType, blockSize, C) public static void adaptiveThreshold(Mat src, Mat dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) { adaptiveThreshold_0(src.nativeObj, dst.nativeObj, maxValue, adaptiveMethod, thresholdType, blockSize, C); return; } // // C++: void applyColorMap(Mat src, Mat& dst, int colormap) // //javadoc: applyColorMap(src, dst, colormap) public static void applyColorMap(Mat src, Mat dst, int colormap) { applyColorMap_0(src.nativeObj, dst.nativeObj, colormap); return; } // // C++: void approxPolyDP(vector_Point2f curve, vector_Point2f& approxCurve, double epsilon, bool closed) // //javadoc: approxPolyDP(curve, approxCurve, epsilon, closed) public static void approxPolyDP(MatOfPoint2f curve, MatOfPoint2f approxCurve, double epsilon, boolean closed) { Mat curve_mat = curve; Mat approxCurve_mat = approxCurve; approxPolyDP_0(curve_mat.nativeObj, approxCurve_mat.nativeObj, epsilon, closed); return; } // // C++: void arrowedLine(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int line_type = 8, int shift = 0, double tipLength = 0.1) // //javadoc: arrowedLine(img, pt1, pt2, color, thickness, line_type, shift, tipLength) public static void arrowedLine(Mat img, Point pt1, Point pt2, Scalar color, int thickness, int line_type, int shift, double tipLength) { arrowedLine_0(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness, line_type, shift, tipLength); return; } //javadoc: arrowedLine(img, pt1, pt2, color) public static void arrowedLine(Mat img, Point pt1, Point pt2, Scalar color) { arrowedLine_1(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void bilateralFilter(Mat src, Mat& dst, int d, double sigmaColor, double sigmaSpace, int borderType = BORDER_DEFAULT) // //javadoc: bilateralFilter(src, dst, d, sigmaColor, sigmaSpace, borderType) public static void bilateralFilter(Mat src, Mat dst, int d, double sigmaColor, double sigmaSpace, int borderType) { bilateralFilter_0(src.nativeObj, dst.nativeObj, d, sigmaColor, sigmaSpace, borderType); return; } //javadoc: bilateralFilter(src, dst, d, sigmaColor, sigmaSpace) public static void bilateralFilter(Mat src, Mat dst, int d, double sigmaColor, double sigmaSpace) { bilateralFilter_1(src.nativeObj, dst.nativeObj, d, sigmaColor, sigmaSpace); return; } // // C++: void blur(Mat src, Mat& dst, Size ksize, Point anchor = Point(-1,-1), int borderType = BORDER_DEFAULT) // //javadoc: blur(src, dst, ksize, anchor, borderType) public static void blur(Mat src, Mat dst, Size ksize, Point anchor, int borderType) { blur_0(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, anchor.x, anchor.y, borderType); return; } //javadoc: blur(src, dst, ksize, anchor) public static void blur(Mat src, Mat dst, Size ksize, Point anchor) { blur_1(src.nativeObj, dst.nativeObj, ksize.width, ksize.height, anchor.x, anchor.y); return; } //javadoc: blur(src, dst, ksize) public static void blur(Mat src, Mat dst, Size ksize) { blur_2(src.nativeObj, dst.nativeObj, ksize.width, ksize.height); return; } // // C++: void boxFilter(Mat src, Mat& dst, int ddepth, Size ksize, Point anchor = Point(-1,-1), bool normalize = true, int borderType = BORDER_DEFAULT) // //javadoc: boxFilter(src, dst, ddepth, ksize, anchor, normalize, borderType) public static void boxFilter(Mat src, Mat dst, int ddepth, Size ksize, Point anchor, boolean normalize, int borderType) { boxFilter_0(src.nativeObj, dst.nativeObj, ddepth, ksize.width, ksize.height, anchor.x, anchor.y, normalize, borderType); return; } //javadoc: boxFilter(src, dst, ddepth, ksize, anchor, normalize) public static void boxFilter(Mat src, Mat dst, int ddepth, Size ksize, Point anchor, boolean normalize) { boxFilter_1(src.nativeObj, dst.nativeObj, ddepth, ksize.width, ksize.height, anchor.x, anchor.y, normalize); return; } //javadoc: boxFilter(src, dst, ddepth, ksize) public static void boxFilter(Mat src, Mat dst, int ddepth, Size ksize) { boxFilter_2(src.nativeObj, dst.nativeObj, ddepth, ksize.width, ksize.height); return; } // // C++: void boxPoints(RotatedRect box, Mat& points) // //javadoc: boxPoints(box, points) public static void boxPoints(RotatedRect box, Mat points) { boxPoints_0(box.center.x, box.center.y, box.size.width, box.size.height, box.angle, points.nativeObj); return; } // // C++: void calcBackProject(vector_Mat images, vector_int channels, Mat hist, Mat& dst, vector_float ranges, double scale) // //javadoc: calcBackProject(images, channels, hist, dst, ranges, scale) public static void calcBackProject(List<Mat> images, MatOfInt channels, Mat hist, Mat dst, MatOfFloat ranges, double scale) { Mat images_mat = Converters.vector_Mat_to_Mat(images); Mat channels_mat = channels; Mat ranges_mat = ranges; calcBackProject_0(images_mat.nativeObj, channels_mat.nativeObj, hist.nativeObj, dst.nativeObj, ranges_mat.nativeObj, scale); return; } // // C++: void calcHist(vector_Mat images, vector_int channels, Mat mask, Mat& hist, vector_int histSize, vector_float ranges, bool accumulate = false) // //javadoc: calcHist(images, channels, mask, hist, histSize, ranges, accumulate) public static void calcHist(List<Mat> images, MatOfInt channels, Mat mask, Mat hist, MatOfInt histSize, MatOfFloat ranges, boolean accumulate) { Mat images_mat = Converters.vector_Mat_to_Mat(images); Mat channels_mat = channels; Mat histSize_mat = histSize; Mat ranges_mat = ranges; calcHist_0(images_mat.nativeObj, channels_mat.nativeObj, mask.nativeObj, hist.nativeObj, histSize_mat.nativeObj, ranges_mat.nativeObj, accumulate); return; } //javadoc: calcHist(images, channels, mask, hist, histSize, ranges) public static void calcHist(List<Mat> images, MatOfInt channels, Mat mask, Mat hist, MatOfInt histSize, MatOfFloat ranges) { Mat images_mat = Converters.vector_Mat_to_Mat(images); Mat channels_mat = channels; Mat histSize_mat = histSize; Mat ranges_mat = ranges; calcHist_1(images_mat.nativeObj, channels_mat.nativeObj, mask.nativeObj, hist.nativeObj, histSize_mat.nativeObj, ranges_mat.nativeObj); return; } // // C++: void circle(Mat& img, Point center, int radius, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) // //javadoc: circle(img, center, radius, color, thickness, lineType, shift) public static void circle(Mat img, Point center, int radius, Scalar color, int thickness, int lineType, int shift) { circle_0(img.nativeObj, center.x, center.y, radius, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); return; } //javadoc: circle(img, center, radius, color, thickness) public static void circle(Mat img, Point center, int radius, Scalar color, int thickness) { circle_1(img.nativeObj, center.x, center.y, radius, color.val[0], color.val[1], color.val[2], color.val[3], thickness); return; } //javadoc: circle(img, center, radius, color) public static void circle(Mat img, Point center, int radius, Scalar color) { circle_2(img.nativeObj, center.x, center.y, radius, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void convertMaps(Mat map1, Mat map2, Mat& dstmap1, Mat& dstmap2, int dstmap1type, bool nninterpolation = false) // //javadoc: convertMaps(map1, map2, dstmap1, dstmap2, dstmap1type, nninterpolation) public static void convertMaps(Mat map1, Mat map2, Mat dstmap1, Mat dstmap2, int dstmap1type, boolean nninterpolation) { convertMaps_0(map1.nativeObj, map2.nativeObj, dstmap1.nativeObj, dstmap2.nativeObj, dstmap1type, nninterpolation); return; } //javadoc: convertMaps(map1, map2, dstmap1, dstmap2, dstmap1type) public static void convertMaps(Mat map1, Mat map2, Mat dstmap1, Mat dstmap2, int dstmap1type) { convertMaps_1(map1.nativeObj, map2.nativeObj, dstmap1.nativeObj, dstmap2.nativeObj, dstmap1type); return; } // // C++: void convexHull(vector_Point points, vector_int& hull, bool clockwise = false, _hidden_ returnPoints = true) // //javadoc: convexHull(points, hull, clockwise) public static void convexHull(MatOfPoint points, MatOfInt hull, boolean clockwise) { Mat points_mat = points; Mat hull_mat = hull; convexHull_0(points_mat.nativeObj, hull_mat.nativeObj, clockwise); return; } //javadoc: convexHull(points, hull) public static void convexHull(MatOfPoint points, MatOfInt hull) { Mat points_mat = points; Mat hull_mat = hull; convexHull_1(points_mat.nativeObj, hull_mat.nativeObj); return; } // // C++: void convexityDefects(vector_Point contour, vector_int convexhull, vector_Vec4i& convexityDefects) // //javadoc: convexityDefects(contour, convexhull, convexityDefects) public static void convexityDefects(MatOfPoint contour, MatOfInt convexhull, MatOfInt4 convexityDefects) { Mat contour_mat = contour; Mat convexhull_mat = convexhull; Mat convexityDefects_mat = convexityDefects; convexityDefects_0(contour_mat.nativeObj, convexhull_mat.nativeObj, convexityDefects_mat.nativeObj); return; } // // C++: void cornerEigenValsAndVecs(Mat src, Mat& dst, int blockSize, int ksize, int borderType = BORDER_DEFAULT) // //javadoc: cornerEigenValsAndVecs(src, dst, blockSize, ksize, borderType) public static void cornerEigenValsAndVecs(Mat src, Mat dst, int blockSize, int ksize, int borderType) { cornerEigenValsAndVecs_0(src.nativeObj, dst.nativeObj, blockSize, ksize, borderType); return; } //javadoc: cornerEigenValsAndVecs(src, dst, blockSize, ksize) public static void cornerEigenValsAndVecs(Mat src, Mat dst, int blockSize, int ksize) { cornerEigenValsAndVecs_1(src.nativeObj, dst.nativeObj, blockSize, ksize); return; } // // C++: void cornerHarris(Mat src, Mat& dst, int blockSize, int ksize, double k, int borderType = BORDER_DEFAULT) // //javadoc: cornerHarris(src, dst, blockSize, ksize, k, borderType) public static void cornerHarris(Mat src, Mat dst, int blockSize, int ksize, double k, int borderType) { cornerHarris_0(src.nativeObj, dst.nativeObj, blockSize, ksize, k, borderType); return; } //javadoc: cornerHarris(src, dst, blockSize, ksize, k) public static void cornerHarris(Mat src, Mat dst, int blockSize, int ksize, double k) { cornerHarris_1(src.nativeObj, dst.nativeObj, blockSize, ksize, k); return; } // // C++: void cornerMinEigenVal(Mat src, Mat& dst, int blockSize, int ksize = 3, int borderType = BORDER_DEFAULT) // //javadoc: cornerMinEigenVal(src, dst, blockSize, ksize, borderType) public static void cornerMinEigenVal(Mat src, Mat dst, int blockSize, int ksize, int borderType) { cornerMinEigenVal_0(src.nativeObj, dst.nativeObj, blockSize, ksize, borderType); return; } //javadoc: cornerMinEigenVal(src, dst, blockSize, ksize) public static void cornerMinEigenVal(Mat src, Mat dst, int blockSize, int ksize) { cornerMinEigenVal_1(src.nativeObj, dst.nativeObj, blockSize, ksize); return; } //javadoc: cornerMinEigenVal(src, dst, blockSize) public static void cornerMinEigenVal(Mat src, Mat dst, int blockSize) { cornerMinEigenVal_2(src.nativeObj, dst.nativeObj, blockSize); return; } // // C++: void cornerSubPix(Mat image, vector_Point2f& corners, Size winSize, Size zeroZone, TermCriteria criteria) // //javadoc: cornerSubPix(image, corners, winSize, zeroZone, criteria) public static void cornerSubPix(Mat image, MatOfPoint2f corners, Size winSize, Size zeroZone, TermCriteria criteria) { Mat corners_mat = corners; cornerSubPix_0(image.nativeObj, corners_mat.nativeObj, winSize.width, winSize.height, zeroZone.width, zeroZone.height, criteria.type, criteria.maxCount, criteria.epsilon); return; } // // C++: void createHanningWindow(Mat& dst, Size winSize, int type) // //javadoc: createHanningWindow(dst, winSize, type) public static void createHanningWindow(Mat dst, Size winSize, int type) { createHanningWindow_0(dst.nativeObj, winSize.width, winSize.height, type); return; } // // C++: void cvtColor(Mat src, Mat& dst, int code, int dstCn = 0) // //javadoc: cvtColor(src, dst, code, dstCn) public static void cvtColor(Mat src, Mat dst, int code, int dstCn) { cvtColor_0(src.nativeObj, dst.nativeObj, code, dstCn); return; } //javadoc: cvtColor(src, dst, code) public static void cvtColor(Mat src, Mat dst, int code) { cvtColor_1(src.nativeObj, dst.nativeObj, code); return; } // // C++: void demosaicing(Mat _src, Mat& _dst, int code, int dcn = 0) // //javadoc: demosaicing(_src, _dst, code, dcn) public static void demosaicing(Mat _src, Mat _dst, int code, int dcn) { demosaicing_0(_src.nativeObj, _dst.nativeObj, code, dcn); return; } //javadoc: demosaicing(_src, _dst, code) public static void demosaicing(Mat _src, Mat _dst, int code) { demosaicing_1(_src.nativeObj, _dst.nativeObj, code); return; } // // C++: void dilate(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) // //javadoc: dilate(src, dst, kernel, anchor, iterations, borderType, borderValue) public static void dilate(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue) { dilate_0(src.nativeObj, dst.nativeObj, kernel.nativeObj, anchor.x, anchor.y, iterations, borderType, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); return; } //javadoc: dilate(src, dst, kernel, anchor, iterations) public static void dilate(Mat src, Mat dst, Mat kernel, Point anchor, int iterations) { dilate_1(src.nativeObj, dst.nativeObj, kernel.nativeObj, anchor.x, anchor.y, iterations); return; } //javadoc: dilate(src, dst, kernel) public static void dilate(Mat src, Mat dst, Mat kernel) { dilate_2(src.nativeObj, dst.nativeObj, kernel.nativeObj); return; } // // C++: void distanceTransform(Mat src, Mat& dst, Mat& labels, int distanceType, int maskSize, int labelType = DIST_LABEL_CCOMP) // //javadoc: distanceTransform(src, dst, labels, distanceType, maskSize, labelType) public static void distanceTransformWithLabels(Mat src, Mat dst, Mat labels, int distanceType, int maskSize, int labelType) { distanceTransformWithLabels_0(src.nativeObj, dst.nativeObj, labels.nativeObj, distanceType, maskSize, labelType); return; } //javadoc: distanceTransform(src, dst, labels, distanceType, maskSize) public static void distanceTransformWithLabels(Mat src, Mat dst, Mat labels, int distanceType, int maskSize) { distanceTransformWithLabels_1(src.nativeObj, dst.nativeObj, labels.nativeObj, distanceType, maskSize); return; } // // C++: void distanceTransform(Mat src, Mat& dst, int distanceType, int maskSize, int dstType = CV_32F) // //javadoc: distanceTransform(src, dst, distanceType, maskSize, dstType) public static void distanceTransform(Mat src, Mat dst, int distanceType, int maskSize, int dstType) { distanceTransform_0(src.nativeObj, dst.nativeObj, distanceType, maskSize, dstType); return; } //javadoc: distanceTransform(src, dst, distanceType, maskSize) public static void distanceTransform(Mat src, Mat dst, int distanceType, int maskSize) { distanceTransform_1(src.nativeObj, dst.nativeObj, distanceType, maskSize); return; } // // C++: void drawContours(Mat& image, vector_vector_Point contours, int contourIdx, Scalar color, int thickness = 1, int lineType = LINE_8, Mat hierarchy = Mat(), int maxLevel = INT_MAX, Point offset = Point()) // //javadoc: drawContours(image, contours, contourIdx, color, thickness, lineType, hierarchy, maxLevel, offset) public static void drawContours(Mat image, List<MatOfPoint> contours, int contourIdx, Scalar color, int thickness, int lineType, Mat hierarchy, int maxLevel, Point offset) { List<Mat> contours_tmplm = new ArrayList<Mat>((contours != null) ? contours.size() : 0); Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm); drawContours_0(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, hierarchy.nativeObj, maxLevel, offset.x, offset.y); return; } //javadoc: drawContours(image, contours, contourIdx, color, thickness) public static void drawContours(Mat image, List<MatOfPoint> contours, int contourIdx, Scalar color, int thickness) { List<Mat> contours_tmplm = new ArrayList<Mat>((contours != null) ? contours.size() : 0); Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm); drawContours_1(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3], thickness); return; } //javadoc: drawContours(image, contours, contourIdx, color) public static void drawContours(Mat image, List<MatOfPoint> contours, int contourIdx, Scalar color) { List<Mat> contours_tmplm = new ArrayList<Mat>((contours != null) ? contours.size() : 0); Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm); drawContours_2(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void drawMarker(Mat& img, Point position, Scalar color, int markerType = MARKER_CROSS, int markerSize = 20, int thickness = 1, int line_type = 8) // //javadoc: drawMarker(img, position, color, markerType, markerSize, thickness, line_type) public static void drawMarker(Mat img, Point position, Scalar color, int markerType, int markerSize, int thickness, int line_type) { drawMarker_0(img.nativeObj, position.x, position.y, color.val[0], color.val[1], color.val[2], color.val[3], markerType, markerSize, thickness, line_type); return; } //javadoc: drawMarker(img, position, color) public static void drawMarker(Mat img, Point position, Scalar color) { drawMarker_1(img.nativeObj, position.x, position.y, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void ellipse(Mat& img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) // //javadoc: ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness, lineType, shift) public static void ellipse(Mat img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, int thickness, int lineType, int shift) { ellipse_0(img.nativeObj, center.x, center.y, axes.width, axes.height, angle, startAngle, endAngle, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); return; } //javadoc: ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness) public static void ellipse(Mat img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, int thickness) { ellipse_1(img.nativeObj, center.x, center.y, axes.width, axes.height, angle, startAngle, endAngle, color.val[0], color.val[1], color.val[2], color.val[3], thickness); return; } //javadoc: ellipse(img, center, axes, angle, startAngle, endAngle, color) public static void ellipse(Mat img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color) { ellipse_2(img.nativeObj, center.x, center.y, axes.width, axes.height, angle, startAngle, endAngle, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void ellipse(Mat& img, RotatedRect box, Scalar color, int thickness = 1, int lineType = LINE_8) // //javadoc: ellipse(img, box, color, thickness, lineType) public static void ellipse(Mat img, RotatedRect box, Scalar color, int thickness, int lineType) { ellipse_3(img.nativeObj, box.center.x, box.center.y, box.size.width, box.size.height, box.angle, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType); return; } //javadoc: ellipse(img, box, color, thickness) public static void ellipse(Mat img, RotatedRect box, Scalar color, int thickness) { ellipse_4(img.nativeObj, box.center.x, box.center.y, box.size.width, box.size.height, box.angle, color.val[0], color.val[1], color.val[2], color.val[3], thickness); return; } //javadoc: ellipse(img, box, color) public static void ellipse(Mat img, RotatedRect box, Scalar color) { ellipse_5(img.nativeObj, box.center.x, box.center.y, box.size.width, box.size.height, box.angle, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, vector_Point& pts) // //javadoc: ellipse2Poly(center, axes, angle, arcStart, arcEnd, delta, pts) public static void ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, MatOfPoint pts) { Mat pts_mat = pts; ellipse2Poly_0(center.x, center.y, axes.width, axes.height, angle, arcStart, arcEnd, delta, pts_mat.nativeObj); return; } // // C++: void equalizeHist(Mat src, Mat& dst) // //javadoc: equalizeHist(src, dst) public static void equalizeHist(Mat src, Mat dst) { equalizeHist_0(src.nativeObj, dst.nativeObj); return; } // // C++: void erode(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) // //javadoc: erode(src, dst, kernel, anchor, iterations, borderType, borderValue) public static void erode(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue) { erode_0(src.nativeObj, dst.nativeObj, kernel.nativeObj, anchor.x, anchor.y, iterations, borderType, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); return; } //javadoc: erode(src, dst, kernel, anchor, iterations) public static void erode(Mat src, Mat dst, Mat kernel, Point anchor, int iterations) { erode_1(src.nativeObj, dst.nativeObj, kernel.nativeObj, anchor.x, anchor.y, iterations); return; } //javadoc: erode(src, dst, kernel) public static void erode(Mat src, Mat dst, Mat kernel) { erode_2(src.nativeObj, dst.nativeObj, kernel.nativeObj); return; } // // C++: void fillConvexPoly(Mat& img, vector_Point points, Scalar color, int lineType = LINE_8, int shift = 0) // //javadoc: fillConvexPoly(img, points, color, lineType, shift) public static void fillConvexPoly(Mat img, MatOfPoint points, Scalar color, int lineType, int shift) { Mat points_mat = points; fillConvexPoly_0(img.nativeObj, points_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3], lineType, shift); return; } //javadoc: fillConvexPoly(img, points, color) public static void fillConvexPoly(Mat img, MatOfPoint points, Scalar color) { Mat points_mat = points; fillConvexPoly_1(img.nativeObj, points_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void fillPoly(Mat& img, vector_vector_Point pts, Scalar color, int lineType = LINE_8, int shift = 0, Point offset = Point()) // //javadoc: fillPoly(img, pts, color, lineType, shift, offset) public static void fillPoly(Mat img, List<MatOfPoint> pts, Scalar color, int lineType, int shift, Point offset) { List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0); Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); fillPoly_0(img.nativeObj, pts_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3], lineType, shift, offset.x, offset.y); return; } //javadoc: fillPoly(img, pts, color) public static void fillPoly(Mat img, List<MatOfPoint> pts, Scalar color) { List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0); Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); fillPoly_1(img.nativeObj, pts_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void filter2D(Mat src, Mat& dst, int ddepth, Mat kernel, Point anchor = Point(-1,-1), double delta = 0, int borderType = BORDER_DEFAULT) // //javadoc: filter2D(src, dst, ddepth, kernel, anchor, delta, borderType) public static void filter2D(Mat src, Mat dst, int ddepth, Mat kernel, Point anchor, double delta, int borderType) { filter2D_0(src.nativeObj, dst.nativeObj, ddepth, kernel.nativeObj, anchor.x, anchor.y, delta, borderType); return; } //javadoc: filter2D(src, dst, ddepth, kernel, anchor, delta) public static void filter2D(Mat src, Mat dst, int ddepth, Mat kernel, Point anchor, double delta) { filter2D_1(src.nativeObj, dst.nativeObj, ddepth, kernel.nativeObj, anchor.x, anchor.y, delta); return; } //javadoc: filter2D(src, dst, ddepth, kernel) public static void filter2D(Mat src, Mat dst, int ddepth, Mat kernel) { filter2D_2(src.nativeObj, dst.nativeObj, ddepth, kernel.nativeObj); return; } // // C++: void findContours(Mat& image, vector_vector_Point& contours, Mat& hierarchy, int mode, int method, Point offset = Point()) // //javadoc: findContours(image, contours, hierarchy, mode, method, offset) public static void findContours(Mat image, List<MatOfPoint> contours, Mat hierarchy, int mode, int method, Point offset) { Mat contours_mat = new Mat(); findContours_0(image.nativeObj, contours_mat.nativeObj, hierarchy.nativeObj, mode, method, offset.x, offset.y); Converters.Mat_to_vector_vector_Point(contours_mat, contours); contours_mat.release(); return; } //javadoc: findContours(image, contours, hierarchy, mode, method) public static void findContours(Mat image, List<MatOfPoint> contours, Mat hierarchy, int mode, int method) { Mat contours_mat = new Mat(); findContours_1(image.nativeObj, contours_mat.nativeObj, hierarchy.nativeObj, mode, method); Converters.Mat_to_vector_vector_Point(contours_mat, contours); contours_mat.release(); return; } // // C++: void fitLine(Mat points, Mat& line, int distType, double param, double reps, double aeps) // //javadoc: fitLine(points, line, distType, param, reps, aeps) public static void fitLine(Mat points, Mat line, int distType, double param, double reps, double aeps) { fitLine_0(points.nativeObj, line.nativeObj, distType, param, reps, aeps); return; } // // C++: void getDerivKernels(Mat& kx, Mat& ky, int dx, int dy, int ksize, bool normalize = false, int ktype = CV_32F) // //javadoc: getDerivKernels(kx, ky, dx, dy, ksize, normalize, ktype) public static void getDerivKernels(Mat kx, Mat ky, int dx, int dy, int ksize, boolean normalize, int ktype) { getDerivKernels_0(kx.nativeObj, ky.nativeObj, dx, dy, ksize, normalize, ktype); return; } //javadoc: getDerivKernels(kx, ky, dx, dy, ksize) public static void getDerivKernels(Mat kx, Mat ky, int dx, int dy, int ksize) { getDerivKernels_1(kx.nativeObj, ky.nativeObj, dx, dy, ksize); return; } // // C++: void getRectSubPix(Mat image, Size patchSize, Point2f center, Mat& patch, int patchType = -1) // //javadoc: getRectSubPix(image, patchSize, center, patch, patchType) public static void getRectSubPix(Mat image, Size patchSize, Point center, Mat patch, int patchType) { getRectSubPix_0(image.nativeObj, patchSize.width, patchSize.height, center.x, center.y, patch.nativeObj, patchType); return; } //javadoc: getRectSubPix(image, patchSize, center, patch) public static void getRectSubPix(Mat image, Size patchSize, Point center, Mat patch) { getRectSubPix_1(image.nativeObj, patchSize.width, patchSize.height, center.x, center.y, patch.nativeObj); return; } // // C++: void goodFeaturesToTrack(Mat image, vector_Point& corners, int maxCorners, double qualityLevel, double minDistance, Mat mask = Mat(), int blockSize = 3, bool useHarrisDetector = false, double k = 0.04) // //javadoc: goodFeaturesToTrack(image, corners, maxCorners, qualityLevel, minDistance, mask, blockSize, useHarrisDetector, k) public static void goodFeaturesToTrack(Mat image, MatOfPoint corners, int maxCorners, double qualityLevel, double minDistance, Mat mask, int blockSize, boolean useHarrisDetector, double k) { Mat corners_mat = corners; goodFeaturesToTrack_0(image.nativeObj, corners_mat.nativeObj, maxCorners, qualityLevel, minDistance, mask.nativeObj, blockSize, useHarrisDetector, k); return; } //javadoc: goodFeaturesToTrack(image, corners, maxCorners, qualityLevel, minDistance) public static void goodFeaturesToTrack(Mat image, MatOfPoint corners, int maxCorners, double qualityLevel, double minDistance) { Mat corners_mat = corners; goodFeaturesToTrack_1(image.nativeObj, corners_mat.nativeObj, maxCorners, qualityLevel, minDistance); return; } // // C++: void grabCut(Mat img, Mat& mask, Rect rect, Mat& bgdModel, Mat& fgdModel, int iterCount, int mode = GC_EVAL) // //javadoc: grabCut(img, mask, rect, bgdModel, fgdModel, iterCount, mode) public static void grabCut(Mat img, Mat mask, Rect rect, Mat bgdModel, Mat fgdModel, int iterCount, int mode) { grabCut_0(img.nativeObj, mask.nativeObj, rect.x, rect.y, rect.width, rect.height, bgdModel.nativeObj, fgdModel.nativeObj, iterCount, mode); return; } //javadoc: grabCut(img, mask, rect, bgdModel, fgdModel, iterCount) public static void grabCut(Mat img, Mat mask, Rect rect, Mat bgdModel, Mat fgdModel, int iterCount) { grabCut_1(img.nativeObj, mask.nativeObj, rect.x, rect.y, rect.width, rect.height, bgdModel.nativeObj, fgdModel.nativeObj, iterCount); return; } // // C++: void initUndistortRectifyMap(Mat cameraMatrix, Mat distCoeffs, Mat R, Mat newCameraMatrix, Size size, int m1type, Mat& map1, Mat& map2) // //javadoc: initUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, size, m1type, map1, map2) public static void initUndistortRectifyMap(Mat cameraMatrix, Mat distCoeffs, Mat R, Mat newCameraMatrix, Size size, int m1type, Mat map1, Mat map2) { initUndistortRectifyMap_0(cameraMatrix.nativeObj, distCoeffs.nativeObj, R.nativeObj, newCameraMatrix.nativeObj, size.width, size.height, m1type, map1.nativeObj, map2.nativeObj); return; } // // C++: void integral(Mat src, Mat& sum, Mat& sqsum, Mat& tilted, int sdepth = -1, int sqdepth = -1) // //javadoc: integral(src, sum, sqsum, tilted, sdepth, sqdepth) public static void integral3(Mat src, Mat sum, Mat sqsum, Mat tilted, int sdepth, int sqdepth) { integral3_0(src.nativeObj, sum.nativeObj, sqsum.nativeObj, tilted.nativeObj, sdepth, sqdepth); return; } //javadoc: integral(src, sum, sqsum, tilted) public static void integral3(Mat src, Mat sum, Mat sqsum, Mat tilted) { integral3_1(src.nativeObj, sum.nativeObj, sqsum.nativeObj, tilted.nativeObj); return; } // // C++: void integral(Mat src, Mat& sum, Mat& sqsum, int sdepth = -1, int sqdepth = -1) // //javadoc: integral(src, sum, sqsum, sdepth, sqdepth) public static void integral2(Mat src, Mat sum, Mat sqsum, int sdepth, int sqdepth) { integral2_0(src.nativeObj, sum.nativeObj, sqsum.nativeObj, sdepth, sqdepth); return; } //javadoc: integral(src, sum, sqsum) public static void integral2(Mat src, Mat sum, Mat sqsum) { integral2_1(src.nativeObj, sum.nativeObj, sqsum.nativeObj); return; } // // C++: void integral(Mat src, Mat& sum, int sdepth = -1) // //javadoc: integral(src, sum, sdepth) public static void integral(Mat src, Mat sum, int sdepth) { integral_0(src.nativeObj, sum.nativeObj, sdepth); return; } //javadoc: integral(src, sum) public static void integral(Mat src, Mat sum) { integral_1(src.nativeObj, sum.nativeObj); return; } // // C++: void invertAffineTransform(Mat M, Mat& iM) // //javadoc: invertAffineTransform(M, iM) public static void invertAffineTransform(Mat M, Mat iM) { invertAffineTransform_0(M.nativeObj, iM.nativeObj); return; } // // C++: void line(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) // //javadoc: line(img, pt1, pt2, color, thickness, lineType, shift) public static void line(Mat img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift) { line_0(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); return; } //javadoc: line(img, pt1, pt2, color, thickness) public static void line(Mat img, Point pt1, Point pt2, Scalar color, int thickness) { line_1(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness); return; } //javadoc: line(img, pt1, pt2, color) public static void line(Mat img, Point pt1, Point pt2, Scalar color) { line_2(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void linearPolar(Mat src, Mat& dst, Point2f center, double maxRadius, int flags) // //javadoc: linearPolar(src, dst, center, maxRadius, flags) public static void linearPolar(Mat src, Mat dst, Point center, double maxRadius, int flags) { linearPolar_0(src.nativeObj, dst.nativeObj, center.x, center.y, maxRadius, flags); return; } // // C++: void logPolar(Mat src, Mat& dst, Point2f center, double M, int flags) // //javadoc: logPolar(src, dst, center, M, flags) public static void logPolar(Mat src, Mat dst, Point center, double M, int flags) { logPolar_0(src.nativeObj, dst.nativeObj, center.x, center.y, M, flags); return; } // // C++: void matchTemplate(Mat image, Mat templ, Mat& result, int method, Mat mask = Mat()) // //javadoc: matchTemplate(image, templ, result, method, mask) public static void matchTemplate(Mat image, Mat templ, Mat result, int method, Mat mask) { matchTemplate_0(image.nativeObj, templ.nativeObj, result.nativeObj, method, mask.nativeObj); return; } //javadoc: matchTemplate(image, templ, result, method) public static void matchTemplate(Mat image, Mat templ, Mat result, int method) { matchTemplate_1(image.nativeObj, templ.nativeObj, result.nativeObj, method); return; } // // C++: void medianBlur(Mat src, Mat& dst, int ksize) // //javadoc: medianBlur(src, dst, ksize) public static void medianBlur(Mat src, Mat dst, int ksize) { medianBlur_0(src.nativeObj, dst.nativeObj, ksize); return; } // // C++: void minEnclosingCircle(vector_Point2f points, Point2f& center, float& radius) // //javadoc: minEnclosingCircle(points, center, radius) public static void minEnclosingCircle(MatOfPoint2f points, Point center, float[] radius) { Mat points_mat = points; double[] center_out = new double[2]; double[] radius_out = new double[1]; minEnclosingCircle_0(points_mat.nativeObj, center_out, radius_out); if(center!=null){ center.x = center_out[0]; center.y = center_out[1]; } if(radius!=null) radius[0] = (float)radius_out[0]; return; } // // C++: void morphologyEx(Mat src, Mat& dst, int op, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) // //javadoc: morphologyEx(src, dst, op, kernel, anchor, iterations, borderType, borderValue) public static void morphologyEx(Mat src, Mat dst, int op, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue) { morphologyEx_0(src.nativeObj, dst.nativeObj, op, kernel.nativeObj, anchor.x, anchor.y, iterations, borderType, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); return; } //javadoc: morphologyEx(src, dst, op, kernel, anchor, iterations) public static void morphologyEx(Mat src, Mat dst, int op, Mat kernel, Point anchor, int iterations) { morphologyEx_1(src.nativeObj, dst.nativeObj, op, kernel.nativeObj, anchor.x, anchor.y, iterations); return; } //javadoc: morphologyEx(src, dst, op, kernel) public static void morphologyEx(Mat src, Mat dst, int op, Mat kernel) { morphologyEx_2(src.nativeObj, dst.nativeObj, op, kernel.nativeObj); return; } // // C++: void polylines(Mat& img, vector_vector_Point pts, bool isClosed, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) // //javadoc: polylines(img, pts, isClosed, color, thickness, lineType, shift) public static void polylines(Mat img, List<MatOfPoint> pts, boolean isClosed, Scalar color, int thickness, int lineType, int shift) { List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0); Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); polylines_0(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); return; } //javadoc: polylines(img, pts, isClosed, color, thickness) public static void polylines(Mat img, List<MatOfPoint> pts, boolean isClosed, Scalar color, int thickness) { List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0); Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); polylines_1(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3], thickness); return; } //javadoc: polylines(img, pts, isClosed, color) public static void polylines(Mat img, List<MatOfPoint> pts, boolean isClosed, Scalar color) { List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0); Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm); polylines_2(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void preCornerDetect(Mat src, Mat& dst, int ksize, int borderType = BORDER_DEFAULT) // //javadoc: preCornerDetect(src, dst, ksize, borderType) public static void preCornerDetect(Mat src, Mat dst, int ksize, int borderType) { preCornerDetect_0(src.nativeObj, dst.nativeObj, ksize, borderType); return; } //javadoc: preCornerDetect(src, dst, ksize) public static void preCornerDetect(Mat src, Mat dst, int ksize) { preCornerDetect_1(src.nativeObj, dst.nativeObj, ksize); return; } // // C++: void putText(Mat& img, String text, Point org, int fontFace, double fontScale, Scalar color, int thickness = 1, int lineType = LINE_8, bool bottomLeftOrigin = false) // //javadoc: putText(img, text, org, fontFace, fontScale, color, thickness, lineType, bottomLeftOrigin) public static void putText(Mat img, String text, Point org, int fontFace, double fontScale, Scalar color, int thickness, int lineType, boolean bottomLeftOrigin) { putText_0(img.nativeObj, text, org.x, org.y, fontFace, fontScale, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, bottomLeftOrigin); return; } //javadoc: putText(img, text, org, fontFace, fontScale, color, thickness) public static void putText(Mat img, String text, Point org, int fontFace, double fontScale, Scalar color, int thickness) { putText_1(img.nativeObj, text, org.x, org.y, fontFace, fontScale, color.val[0], color.val[1], color.val[2], color.val[3], thickness); return; } //javadoc: putText(img, text, org, fontFace, fontScale, color) public static void putText(Mat img, String text, Point org, int fontFace, double fontScale, Scalar color) { putText_2(img.nativeObj, text, org.x, org.y, fontFace, fontScale, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void pyrDown(Mat src, Mat& dst, Size dstsize = Size(), int borderType = BORDER_DEFAULT) // //javadoc: pyrDown(src, dst, dstsize, borderType) public static void pyrDown(Mat src, Mat dst, Size dstsize, int borderType) { pyrDown_0(src.nativeObj, dst.nativeObj, dstsize.width, dstsize.height, borderType); return; } //javadoc: pyrDown(src, dst, dstsize) public static void pyrDown(Mat src, Mat dst, Size dstsize) { pyrDown_1(src.nativeObj, dst.nativeObj, dstsize.width, dstsize.height); return; } //javadoc: pyrDown(src, dst) public static void pyrDown(Mat src, Mat dst) { pyrDown_2(src.nativeObj, dst.nativeObj); return; } // // C++: void pyrMeanShiftFiltering(Mat src, Mat& dst, double sp, double sr, int maxLevel = 1, TermCriteria termcrit = TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5,1)) // //javadoc: pyrMeanShiftFiltering(src, dst, sp, sr, maxLevel, termcrit) public static void pyrMeanShiftFiltering(Mat src, Mat dst, double sp, double sr, int maxLevel, TermCriteria termcrit) { pyrMeanShiftFiltering_0(src.nativeObj, dst.nativeObj, sp, sr, maxLevel, termcrit.type, termcrit.maxCount, termcrit.epsilon); return; } //javadoc: pyrMeanShiftFiltering(src, dst, sp, sr) public static void pyrMeanShiftFiltering(Mat src, Mat dst, double sp, double sr) { pyrMeanShiftFiltering_1(src.nativeObj, dst.nativeObj, sp, sr); return; } // // C++: void pyrUp(Mat src, Mat& dst, Size dstsize = Size(), int borderType = BORDER_DEFAULT) // //javadoc: pyrUp(src, dst, dstsize, borderType) public static void pyrUp(Mat src, Mat dst, Size dstsize, int borderType) { pyrUp_0(src.nativeObj, dst.nativeObj, dstsize.width, dstsize.height, borderType); return; } //javadoc: pyrUp(src, dst, dstsize) public static void pyrUp(Mat src, Mat dst, Size dstsize) { pyrUp_1(src.nativeObj, dst.nativeObj, dstsize.width, dstsize.height); return; } //javadoc: pyrUp(src, dst) public static void pyrUp(Mat src, Mat dst) { pyrUp_2(src.nativeObj, dst.nativeObj); return; } // // C++: void rectangle(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) // //javadoc: rectangle(img, pt1, pt2, color, thickness, lineType, shift) public static void rectangle(Mat img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift) { rectangle_0(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, shift); return; } //javadoc: rectangle(img, pt1, pt2, color, thickness) public static void rectangle(Mat img, Point pt1, Point pt2, Scalar color, int thickness) { rectangle_1(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3], thickness); return; } //javadoc: rectangle(img, pt1, pt2, color) public static void rectangle(Mat img, Point pt1, Point pt2, Scalar color) { rectangle_2(img.nativeObj, pt1.x, pt1.y, pt2.x, pt2.y, color.val[0], color.val[1], color.val[2], color.val[3]); return; } // // C++: void remap(Mat src, Mat& dst, Mat map1, Mat map2, int interpolation, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) // //javadoc: remap(src, dst, map1, map2, interpolation, borderMode, borderValue) public static void remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation, int borderMode, Scalar borderValue) { remap_0(src.nativeObj, dst.nativeObj, map1.nativeObj, map2.nativeObj, interpolation, borderMode, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); return; } //javadoc: remap(src, dst, map1, map2, interpolation) public static void remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation) { remap_1(src.nativeObj, dst.nativeObj, map1.nativeObj, map2.nativeObj, interpolation); return; } // // C++: void resize(Mat src, Mat& dst, Size dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR) // //javadoc: resize(src, dst, dsize, fx, fy, interpolation) public static void resize(Mat src, Mat dst, Size dsize, double fx, double fy, int interpolation) { resize_0(src.nativeObj, dst.nativeObj, dsize.width, dsize.height, fx, fy, interpolation); return; } //javadoc: resize(src, dst, dsize) public static void resize(Mat src, Mat dst, Size dsize) { resize_1(src.nativeObj, dst.nativeObj, dsize.width, dsize.height); return; } // // C++: void sepFilter2D(Mat src, Mat& dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor = Point(-1,-1), double delta = 0, int borderType = BORDER_DEFAULT) // //javadoc: sepFilter2D(src, dst, ddepth, kernelX, kernelY, anchor, delta, borderType) public static void sepFilter2D(Mat src, Mat dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor, double delta, int borderType) { sepFilter2D_0(src.nativeObj, dst.nativeObj, ddepth, kernelX.nativeObj, kernelY.nativeObj, anchor.x, anchor.y, delta, borderType); return; } //javadoc: sepFilter2D(src, dst, ddepth, kernelX, kernelY, anchor, delta) public static void sepFilter2D(Mat src, Mat dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor, double delta) { sepFilter2D_1(src.nativeObj, dst.nativeObj, ddepth, kernelX.nativeObj, kernelY.nativeObj, anchor.x, anchor.y, delta); return; } //javadoc: sepFilter2D(src, dst, ddepth, kernelX, kernelY) public static void sepFilter2D(Mat src, Mat dst, int ddepth, Mat kernelX, Mat kernelY) { sepFilter2D_2(src.nativeObj, dst.nativeObj, ddepth, kernelX.nativeObj, kernelY.nativeObj); return; } // // C++: void spatialGradient(Mat src, Mat& dx, Mat& dy, int ksize = 3, int borderType = BORDER_DEFAULT) // //javadoc: spatialGradient(src, dx, dy, ksize, borderType) public static void spatialGradient(Mat src, Mat dx, Mat dy, int ksize, int borderType) { spatialGradient_0(src.nativeObj, dx.nativeObj, dy.nativeObj, ksize, borderType); return; } //javadoc: spatialGradient(src, dx, dy, ksize) public static void spatialGradient(Mat src, Mat dx, Mat dy, int ksize) { spatialGradient_1(src.nativeObj, dx.nativeObj, dy.nativeObj, ksize); return; } //javadoc: spatialGradient(src, dx, dy) public static void spatialGradient(Mat src, Mat dx, Mat dy) { spatialGradient_2(src.nativeObj, dx.nativeObj, dy.nativeObj); return; } // // C++: void sqrBoxFilter(Mat _src, Mat& _dst, int ddepth, Size ksize, Point anchor = Point(-1, -1), bool normalize = true, int borderType = BORDER_DEFAULT) // //javadoc: sqrBoxFilter(_src, _dst, ddepth, ksize, anchor, normalize, borderType) public static void sqrBoxFilter(Mat _src, Mat _dst, int ddepth, Size ksize, Point anchor, boolean normalize, int borderType) { sqrBoxFilter_0(_src.nativeObj, _dst.nativeObj, ddepth, ksize.width, ksize.height, anchor.x, anchor.y, normalize, borderType); return; } //javadoc: sqrBoxFilter(_src, _dst, ddepth, ksize, anchor, normalize) public static void sqrBoxFilter(Mat _src, Mat _dst, int ddepth, Size ksize, Point anchor, boolean normalize) { sqrBoxFilter_1(_src.nativeObj, _dst.nativeObj, ddepth, ksize.width, ksize.height, anchor.x, anchor.y, normalize); return; } //javadoc: sqrBoxFilter(_src, _dst, ddepth, ksize) public static void sqrBoxFilter(Mat _src, Mat _dst, int ddepth, Size ksize) { sqrBoxFilter_2(_src.nativeObj, _dst.nativeObj, ddepth, ksize.width, ksize.height); return; } // // C++: void undistort(Mat src, Mat& dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix = Mat()) // //javadoc: undistort(src, dst, cameraMatrix, distCoeffs, newCameraMatrix) public static void undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix) { undistort_0(src.nativeObj, dst.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, newCameraMatrix.nativeObj); return; } //javadoc: undistort(src, dst, cameraMatrix, distCoeffs) public static void undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs) { undistort_1(src.nativeObj, dst.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj); return; } // // C++: void undistortPoints(vector_Point2f src, vector_Point2f& dst, Mat cameraMatrix, Mat distCoeffs, Mat R = Mat(), Mat P = Mat()) // //javadoc: undistortPoints(src, dst, cameraMatrix, distCoeffs, R, P) public static void undistortPoints(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs, Mat R, Mat P) { Mat src_mat = src; Mat dst_mat = dst; undistortPoints_0(src_mat.nativeObj, dst_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, R.nativeObj, P.nativeObj); return; } //javadoc: undistortPoints(src, dst, cameraMatrix, distCoeffs) public static void undistortPoints(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs) { Mat src_mat = src; Mat dst_mat = dst; undistortPoints_1(src_mat.nativeObj, dst_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj); return; } // // C++: void warpAffine(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) // //javadoc: warpAffine(src, dst, M, dsize, flags, borderMode, borderValue) public static void warpAffine(Mat src, Mat dst, Mat M, Size dsize, int flags, int borderMode, Scalar borderValue) { warpAffine_0(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height, flags, borderMode, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); return; } //javadoc: warpAffine(src, dst, M, dsize, flags) public static void warpAffine(Mat src, Mat dst, Mat M, Size dsize, int flags) { warpAffine_1(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height, flags); return; } //javadoc: warpAffine(src, dst, M, dsize) public static void warpAffine(Mat src, Mat dst, Mat M, Size dsize) { warpAffine_2(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height); return; } // // C++: void warpPerspective(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) // //javadoc: warpPerspective(src, dst, M, dsize, flags, borderMode, borderValue) public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize, int flags, int borderMode, Scalar borderValue) { warpPerspective_0(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height, flags, borderMode, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]); return; } //javadoc: warpPerspective(src, dst, M, dsize, flags) public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize, int flags) { warpPerspective_1(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height, flags); return; } //javadoc: warpPerspective(src, dst, M, dsize) public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize) { warpPerspective_2(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height); return; } // // C++: void watershed(Mat image, Mat& markers) // //javadoc: watershed(image, markers) public static void watershed(Mat image, Mat markers) { watershed_0(image.nativeObj, markers.nativeObj); return; } // C++: Size getTextSize(const String& text, int fontFace, double fontScale, int thickness, int* baseLine); //javadoc:getTextSize(text, fontFace, fontScale, thickness, baseLine) public static Size getTextSize(String text, int fontFace, double fontScale, int thickness, int[] baseLine) { if(baseLine != null && baseLine.length != 1) throw new java.lang.IllegalArgumentException("'baseLine' must be 'int[1]' or 'null'."); Size retVal = new Size(n_getTextSize(text, fontFace, fontScale, thickness, baseLine)); return retVal; } // C++: Mat getAffineTransform(vector_Point2f src, vector_Point2f dst) private static native long getAffineTransform_0(long src_mat_nativeObj, long dst_mat_nativeObj); // C++: Mat getDefaultNewCameraMatrix(Mat cameraMatrix, Size imgsize = Size(), bool centerPrincipalPoint = false) private static native long getDefaultNewCameraMatrix_0(long cameraMatrix_nativeObj, double imgsize_width, double imgsize_height, boolean centerPrincipalPoint); private static native long getDefaultNewCameraMatrix_1(long cameraMatrix_nativeObj); // C++: Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi = CV_PI*0.5, int ktype = CV_64F) private static native long getGaborKernel_0(double ksize_width, double ksize_height, double sigma, double theta, double lambd, double gamma, double psi, int ktype); private static native long getGaborKernel_1(double ksize_width, double ksize_height, double sigma, double theta, double lambd, double gamma); // C++: Mat getGaussianKernel(int ksize, double sigma, int ktype = CV_64F) private static native long getGaussianKernel_0(int ksize, double sigma, int ktype); private static native long getGaussianKernel_1(int ksize, double sigma); // C++: Mat getPerspectiveTransform(Mat src, Mat dst) private static native long getPerspectiveTransform_0(long src_nativeObj, long dst_nativeObj); // C++: Mat getRotationMatrix2D(Point2f center, double angle, double scale) private static native long getRotationMatrix2D_0(double center_x, double center_y, double angle, double scale); // C++: Mat getStructuringElement(int shape, Size ksize, Point anchor = Point(-1,-1)) private static native long getStructuringElement_0(int shape, double ksize_width, double ksize_height, double anchor_x, double anchor_y); private static native long getStructuringElement_1(int shape, double ksize_width, double ksize_height); // C++: Moments moments(Mat array, bool binaryImage = false) private static native double[] moments_0(long array_nativeObj, boolean binaryImage); private static native double[] moments_1(long array_nativeObj); // C++: Point2d phaseCorrelate(Mat src1, Mat src2, Mat window = Mat(), double* response = 0) private static native double[] phaseCorrelate_0(long src1_nativeObj, long src2_nativeObj, long window_nativeObj, double[] response_out); private static native double[] phaseCorrelate_1(long src1_nativeObj, long src2_nativeObj); // C++: Ptr_CLAHE createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8)) private static native long createCLAHE_0(double clipLimit, double tileGridSize_width, double tileGridSize_height); private static native long createCLAHE_1(); // C++: Ptr_LineSegmentDetector createLineSegmentDetector(int _refine = LSD_REFINE_STD, double _scale = 0.8, double _sigma_scale = 0.6, double _quant = 2.0, double _ang_th = 22.5, double _log_eps = 0, double _density_th = 0.7, int _n_bins = 1024) private static native long createLineSegmentDetector_0(int _refine, double _scale, double _sigma_scale, double _quant, double _ang_th, double _log_eps, double _density_th, int _n_bins); private static native long createLineSegmentDetector_1(); // C++: Rect boundingRect(vector_Point points) private static native double[] boundingRect_0(long points_mat_nativeObj); // C++: RotatedRect fitEllipse(vector_Point2f points) private static native double[] fitEllipse_0(long points_mat_nativeObj); // C++: RotatedRect minAreaRect(vector_Point2f points) private static native double[] minAreaRect_0(long points_mat_nativeObj); // C++: bool clipLine(Rect imgRect, Point& pt1, Point& pt2) private static native boolean clipLine_0(int imgRect_x, int imgRect_y, int imgRect_width, int imgRect_height, double pt1_x, double pt1_y, double[] pt1_out, double pt2_x, double pt2_y, double[] pt2_out); // C++: bool isContourConvex(vector_Point contour) private static native boolean isContourConvex_0(long contour_mat_nativeObj); // C++: double arcLength(vector_Point2f curve, bool closed) private static native double arcLength_0(long curve_mat_nativeObj, boolean closed); // C++: double compareHist(Mat H1, Mat H2, int method) private static native double compareHist_0(long H1_nativeObj, long H2_nativeObj, int method); // C++: double contourArea(Mat contour, bool oriented = false) private static native double contourArea_0(long contour_nativeObj, boolean oriented); private static native double contourArea_1(long contour_nativeObj); // C++: double matchShapes(Mat contour1, Mat contour2, int method, double parameter) private static native double matchShapes_0(long contour1_nativeObj, long contour2_nativeObj, int method, double parameter); // C++: double minEnclosingTriangle(Mat points, Mat& triangle) private static native double minEnclosingTriangle_0(long points_nativeObj, long triangle_nativeObj); // C++: double pointPolygonTest(vector_Point2f contour, Point2f pt, bool measureDist) private static native double pointPolygonTest_0(long contour_mat_nativeObj, double pt_x, double pt_y, boolean measureDist); // C++: double threshold(Mat src, Mat& dst, double thresh, double maxval, int type) private static native double threshold_0(long src_nativeObj, long dst_nativeObj, double thresh, double maxval, int type); // C++: float initWideAngleProjMap(Mat cameraMatrix, Mat distCoeffs, Size imageSize, int destImageWidth, int m1type, Mat& map1, Mat& map2, int projType = PROJ_SPHERICAL_EQRECT, double alpha = 0) private static native float initWideAngleProjMap_0(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, double imageSize_width, double imageSize_height, int destImageWidth, int m1type, long map1_nativeObj, long map2_nativeObj, int projType, double alpha); private static native float initWideAngleProjMap_1(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, double imageSize_width, double imageSize_height, int destImageWidth, int m1type, long map1_nativeObj, long map2_nativeObj); // C++: float intersectConvexConvex(Mat _p1, Mat _p2, Mat& _p12, bool handleNested = true) private static native float intersectConvexConvex_0(long _p1_nativeObj, long _p2_nativeObj, long _p12_nativeObj, boolean handleNested); private static native float intersectConvexConvex_1(long _p1_nativeObj, long _p2_nativeObj, long _p12_nativeObj); // C++: int connectedComponents(Mat image, Mat& labels, int connectivity, int ltype, int ccltype) private static native int connectedComponentsWithAlgorithm_0(long image_nativeObj, long labels_nativeObj, int connectivity, int ltype, int ccltype); // C++: int connectedComponents(Mat image, Mat& labels, int connectivity = 8, int ltype = CV_32S) private static native int connectedComponents_0(long image_nativeObj, long labels_nativeObj, int connectivity, int ltype); private static native int connectedComponents_1(long image_nativeObj, long labels_nativeObj); // C++: int connectedComponentsWithStats(Mat image, Mat& labels, Mat& stats, Mat& centroids, int connectivity, int ltype, int ccltype) private static native int connectedComponentsWithStatsWithAlgorithm_0(long image_nativeObj, long labels_nativeObj, long stats_nativeObj, long centroids_nativeObj, int connectivity, int ltype, int ccltype); // C++: int connectedComponentsWithStats(Mat image, Mat& labels, Mat& stats, Mat& centroids, int connectivity = 8, int ltype = CV_32S) private static native int connectedComponentsWithStats_0(long image_nativeObj, long labels_nativeObj, long stats_nativeObj, long centroids_nativeObj, int connectivity, int ltype); private static native int connectedComponentsWithStats_1(long image_nativeObj, long labels_nativeObj, long stats_nativeObj, long centroids_nativeObj); // C++: int floodFill(Mat& image, Mat& mask, Point seedPoint, Scalar newVal, Rect* rect = 0, Scalar loDiff = Scalar(), Scalar upDiff = Scalar(), int flags = 4) private static native int floodFill_0(long image_nativeObj, long mask_nativeObj, double seedPoint_x, double seedPoint_y, double newVal_val0, double newVal_val1, double newVal_val2, double newVal_val3, double[] rect_out, double loDiff_val0, double loDiff_val1, double loDiff_val2, double loDiff_val3, double upDiff_val0, double upDiff_val1, double upDiff_val2, double upDiff_val3, int flags); private static native int floodFill_1(long image_nativeObj, long mask_nativeObj, double seedPoint_x, double seedPoint_y, double newVal_val0, double newVal_val1, double newVal_val2, double newVal_val3); // C++: int rotatedRectangleIntersection(RotatedRect rect1, RotatedRect rect2, Mat& intersectingRegion) private static native int rotatedRectangleIntersection_0(double rect1_center_x, double rect1_center_y, double rect1_size_width, double rect1_size_height, double rect1_angle, double rect2_center_x, double rect2_center_y, double rect2_size_width, double rect2_size_height, double rect2_angle, long intersectingRegion_nativeObj); // C++: void Canny(Mat dx, Mat dy, Mat& edges, double threshold1, double threshold2, bool L2gradient = false) private static native void Canny_0(long dx_nativeObj, long dy_nativeObj, long edges_nativeObj, double threshold1, double threshold2, boolean L2gradient); private static native void Canny_1(long dx_nativeObj, long dy_nativeObj, long edges_nativeObj, double threshold1, double threshold2); // C++: void Canny(Mat image, Mat& edges, double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false) private static native void Canny_2(long image_nativeObj, long edges_nativeObj, double threshold1, double threshold2, int apertureSize, boolean L2gradient); private static native void Canny_3(long image_nativeObj, long edges_nativeObj, double threshold1, double threshold2); // C++: void GaussianBlur(Mat src, Mat& dst, Size ksize, double sigmaX, double sigmaY = 0, int borderType = BORDER_DEFAULT) private static native void GaussianBlur_0(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double sigmaX, double sigmaY, int borderType); private static native void GaussianBlur_1(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double sigmaX, double sigmaY); private static native void GaussianBlur_2(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double sigmaX); // C++: void HoughCircles(Mat image, Mat& circles, int method, double dp, double minDist, double param1 = 100, double param2 = 100, int minRadius = 0, int maxRadius = 0) private static native void HoughCircles_0(long image_nativeObj, long circles_nativeObj, int method, double dp, double minDist, double param1, double param2, int minRadius, int maxRadius); private static native void HoughCircles_1(long image_nativeObj, long circles_nativeObj, int method, double dp, double minDist); // C++: void HoughLines(Mat image, Mat& lines, double rho, double theta, int threshold, double srn = 0, double stn = 0, double min_theta = 0, double max_theta = CV_PI) private static native void HoughLines_0(long image_nativeObj, long lines_nativeObj, double rho, double theta, int threshold, double srn, double stn, double min_theta, double max_theta); private static native void HoughLines_1(long image_nativeObj, long lines_nativeObj, double rho, double theta, int threshold); // C++: void HoughLinesP(Mat image, Mat& lines, double rho, double theta, int threshold, double minLineLength = 0, double maxLineGap = 0) private static native void HoughLinesP_0(long image_nativeObj, long lines_nativeObj, double rho, double theta, int threshold, double minLineLength, double maxLineGap); private static native void HoughLinesP_1(long image_nativeObj, long lines_nativeObj, double rho, double theta, int threshold); // C++: void HuMoments(Moments m, Mat& hu) private static native void HuMoments_0(double m_m00, double m_m10, double m_m01, double m_m20, double m_m11, double m_m02, double m_m30, double m_m21, double m_m12, double m_m03, long hu_nativeObj); // C++: void Laplacian(Mat src, Mat& dst, int ddepth, int ksize = 1, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) private static native void Laplacian_0(long src_nativeObj, long dst_nativeObj, int ddepth, int ksize, double scale, double delta, int borderType); private static native void Laplacian_1(long src_nativeObj, long dst_nativeObj, int ddepth, int ksize, double scale, double delta); private static native void Laplacian_2(long src_nativeObj, long dst_nativeObj, int ddepth); // C++: void Scharr(Mat src, Mat& dst, int ddepth, int dx, int dy, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) private static native void Scharr_0(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy, double scale, double delta, int borderType); private static native void Scharr_1(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy, double scale, double delta); private static native void Scharr_2(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy); // C++: void Sobel(Mat src, Mat& dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT) private static native void Sobel_0(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType); private static native void Sobel_1(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy, int ksize, double scale, double delta); private static native void Sobel_2(long src_nativeObj, long dst_nativeObj, int ddepth, int dx, int dy); // C++: void accumulate(Mat src, Mat& dst, Mat mask = Mat()) private static native void accumulate_0(long src_nativeObj, long dst_nativeObj, long mask_nativeObj); private static native void accumulate_1(long src_nativeObj, long dst_nativeObj); // C++: void accumulateProduct(Mat src1, Mat src2, Mat& dst, Mat mask = Mat()) private static native void accumulateProduct_0(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj, long mask_nativeObj); private static native void accumulateProduct_1(long src1_nativeObj, long src2_nativeObj, long dst_nativeObj); // C++: void accumulateSquare(Mat src, Mat& dst, Mat mask = Mat()) private static native void accumulateSquare_0(long src_nativeObj, long dst_nativeObj, long mask_nativeObj); private static native void accumulateSquare_1(long src_nativeObj, long dst_nativeObj); // C++: void accumulateWeighted(Mat src, Mat& dst, double alpha, Mat mask = Mat()) private static native void accumulateWeighted_0(long src_nativeObj, long dst_nativeObj, double alpha, long mask_nativeObj); private static native void accumulateWeighted_1(long src_nativeObj, long dst_nativeObj, double alpha); // C++: void adaptiveThreshold(Mat src, Mat& dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) private static native void adaptiveThreshold_0(long src_nativeObj, long dst_nativeObj, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C); // C++: void applyColorMap(Mat src, Mat& dst, int colormap) private static native void applyColorMap_0(long src_nativeObj, long dst_nativeObj, int colormap); // C++: void approxPolyDP(vector_Point2f curve, vector_Point2f& approxCurve, double epsilon, bool closed) private static native void approxPolyDP_0(long curve_mat_nativeObj, long approxCurve_mat_nativeObj, double epsilon, boolean closed); // C++: void arrowedLine(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int line_type = 8, int shift = 0, double tipLength = 0.1) private static native void arrowedLine_0(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int line_type, int shift, double tipLength); private static native void arrowedLine_1(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void bilateralFilter(Mat src, Mat& dst, int d, double sigmaColor, double sigmaSpace, int borderType = BORDER_DEFAULT) private static native void bilateralFilter_0(long src_nativeObj, long dst_nativeObj, int d, double sigmaColor, double sigmaSpace, int borderType); private static native void bilateralFilter_1(long src_nativeObj, long dst_nativeObj, int d, double sigmaColor, double sigmaSpace); // C++: void blur(Mat src, Mat& dst, Size ksize, Point anchor = Point(-1,-1), int borderType = BORDER_DEFAULT) private static native void blur_0(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double anchor_x, double anchor_y, int borderType); private static native void blur_1(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height, double anchor_x, double anchor_y); private static native void blur_2(long src_nativeObj, long dst_nativeObj, double ksize_width, double ksize_height); // C++: void boxFilter(Mat src, Mat& dst, int ddepth, Size ksize, Point anchor = Point(-1,-1), bool normalize = true, int borderType = BORDER_DEFAULT) private static native void boxFilter_0(long src_nativeObj, long dst_nativeObj, int ddepth, double ksize_width, double ksize_height, double anchor_x, double anchor_y, boolean normalize, int borderType); private static native void boxFilter_1(long src_nativeObj, long dst_nativeObj, int ddepth, double ksize_width, double ksize_height, double anchor_x, double anchor_y, boolean normalize); private static native void boxFilter_2(long src_nativeObj, long dst_nativeObj, int ddepth, double ksize_width, double ksize_height); // C++: void boxPoints(RotatedRect box, Mat& points) private static native void boxPoints_0(double box_center_x, double box_center_y, double box_size_width, double box_size_height, double box_angle, long points_nativeObj); // C++: void calcBackProject(vector_Mat images, vector_int channels, Mat hist, Mat& dst, vector_float ranges, double scale) private static native void calcBackProject_0(long images_mat_nativeObj, long channels_mat_nativeObj, long hist_nativeObj, long dst_nativeObj, long ranges_mat_nativeObj, double scale); // C++: void calcHist(vector_Mat images, vector_int channels, Mat mask, Mat& hist, vector_int histSize, vector_float ranges, bool accumulate = false) private static native void calcHist_0(long images_mat_nativeObj, long channels_mat_nativeObj, long mask_nativeObj, long hist_nativeObj, long histSize_mat_nativeObj, long ranges_mat_nativeObj, boolean accumulate); private static native void calcHist_1(long images_mat_nativeObj, long channels_mat_nativeObj, long mask_nativeObj, long hist_nativeObj, long histSize_mat_nativeObj, long ranges_mat_nativeObj); // C++: void circle(Mat& img, Point center, int radius, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) private static native void circle_0(long img_nativeObj, double center_x, double center_y, int radius, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); private static native void circle_1(long img_nativeObj, double center_x, double center_y, int radius, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); private static native void circle_2(long img_nativeObj, double center_x, double center_y, int radius, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void convertMaps(Mat map1, Mat map2, Mat& dstmap1, Mat& dstmap2, int dstmap1type, bool nninterpolation = false) private static native void convertMaps_0(long map1_nativeObj, long map2_nativeObj, long dstmap1_nativeObj, long dstmap2_nativeObj, int dstmap1type, boolean nninterpolation); private static native void convertMaps_1(long map1_nativeObj, long map2_nativeObj, long dstmap1_nativeObj, long dstmap2_nativeObj, int dstmap1type); // C++: void convexHull(vector_Point points, vector_int& hull, bool clockwise = false, _hidden_ returnPoints = true) private static native void convexHull_0(long points_mat_nativeObj, long hull_mat_nativeObj, boolean clockwise); private static native void convexHull_1(long points_mat_nativeObj, long hull_mat_nativeObj); // C++: void convexityDefects(vector_Point contour, vector_int convexhull, vector_Vec4i& convexityDefects) private static native void convexityDefects_0(long contour_mat_nativeObj, long convexhull_mat_nativeObj, long convexityDefects_mat_nativeObj); // C++: void cornerEigenValsAndVecs(Mat src, Mat& dst, int blockSize, int ksize, int borderType = BORDER_DEFAULT) private static native void cornerEigenValsAndVecs_0(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize, int borderType); private static native void cornerEigenValsAndVecs_1(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize); // C++: void cornerHarris(Mat src, Mat& dst, int blockSize, int ksize, double k, int borderType = BORDER_DEFAULT) private static native void cornerHarris_0(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize, double k, int borderType); private static native void cornerHarris_1(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize, double k); // C++: void cornerMinEigenVal(Mat src, Mat& dst, int blockSize, int ksize = 3, int borderType = BORDER_DEFAULT) private static native void cornerMinEigenVal_0(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize, int borderType); private static native void cornerMinEigenVal_1(long src_nativeObj, long dst_nativeObj, int blockSize, int ksize); private static native void cornerMinEigenVal_2(long src_nativeObj, long dst_nativeObj, int blockSize); // C++: void cornerSubPix(Mat image, vector_Point2f& corners, Size winSize, Size zeroZone, TermCriteria criteria) private static native void cornerSubPix_0(long image_nativeObj, long corners_mat_nativeObj, double winSize_width, double winSize_height, double zeroZone_width, double zeroZone_height, int criteria_type, int criteria_maxCount, double criteria_epsilon); // C++: void createHanningWindow(Mat& dst, Size winSize, int type) private static native void createHanningWindow_0(long dst_nativeObj, double winSize_width, double winSize_height, int type); // C++: void cvtColor(Mat src, Mat& dst, int code, int dstCn = 0) private static native void cvtColor_0(long src_nativeObj, long dst_nativeObj, int code, int dstCn); private static native void cvtColor_1(long src_nativeObj, long dst_nativeObj, int code); // C++: void demosaicing(Mat _src, Mat& _dst, int code, int dcn = 0) private static native void demosaicing_0(long _src_nativeObj, long _dst_nativeObj, int code, int dcn); private static native void demosaicing_1(long _src_nativeObj, long _dst_nativeObj, int code); // C++: void dilate(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) private static native void dilate_0(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations, int borderType, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); private static native void dilate_1(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations); private static native void dilate_2(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj); // C++: void distanceTransform(Mat src, Mat& dst, Mat& labels, int distanceType, int maskSize, int labelType = DIST_LABEL_CCOMP) private static native void distanceTransformWithLabels_0(long src_nativeObj, long dst_nativeObj, long labels_nativeObj, int distanceType, int maskSize, int labelType); private static native void distanceTransformWithLabels_1(long src_nativeObj, long dst_nativeObj, long labels_nativeObj, int distanceType, int maskSize); // C++: void distanceTransform(Mat src, Mat& dst, int distanceType, int maskSize, int dstType = CV_32F) private static native void distanceTransform_0(long src_nativeObj, long dst_nativeObj, int distanceType, int maskSize, int dstType); private static native void distanceTransform_1(long src_nativeObj, long dst_nativeObj, int distanceType, int maskSize); // C++: void drawContours(Mat& image, vector_vector_Point contours, int contourIdx, Scalar color, int thickness = 1, int lineType = LINE_8, Mat hierarchy = Mat(), int maxLevel = INT_MAX, Point offset = Point()) private static native void drawContours_0(long image_nativeObj, long contours_mat_nativeObj, int contourIdx, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, long hierarchy_nativeObj, int maxLevel, double offset_x, double offset_y); private static native void drawContours_1(long image_nativeObj, long contours_mat_nativeObj, int contourIdx, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); private static native void drawContours_2(long image_nativeObj, long contours_mat_nativeObj, int contourIdx, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void drawMarker(Mat& img, Point position, Scalar color, int markerType = MARKER_CROSS, int markerSize = 20, int thickness = 1, int line_type = 8) private static native void drawMarker_0(long img_nativeObj, double position_x, double position_y, double color_val0, double color_val1, double color_val2, double color_val3, int markerType, int markerSize, int thickness, int line_type); private static native void drawMarker_1(long img_nativeObj, double position_x, double position_y, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void ellipse(Mat& img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) private static native void ellipse_0(long img_nativeObj, double center_x, double center_y, double axes_width, double axes_height, double angle, double startAngle, double endAngle, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); private static native void ellipse_1(long img_nativeObj, double center_x, double center_y, double axes_width, double axes_height, double angle, double startAngle, double endAngle, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); private static native void ellipse_2(long img_nativeObj, double center_x, double center_y, double axes_width, double axes_height, double angle, double startAngle, double endAngle, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void ellipse(Mat& img, RotatedRect box, Scalar color, int thickness = 1, int lineType = LINE_8) private static native void ellipse_3(long img_nativeObj, double box_center_x, double box_center_y, double box_size_width, double box_size_height, double box_angle, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType); private static native void ellipse_4(long img_nativeObj, double box_center_x, double box_center_y, double box_size_width, double box_size_height, double box_angle, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); private static native void ellipse_5(long img_nativeObj, double box_center_x, double box_center_y, double box_size_width, double box_size_height, double box_angle, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, vector_Point& pts) private static native void ellipse2Poly_0(double center_x, double center_y, double axes_width, double axes_height, int angle, int arcStart, int arcEnd, int delta, long pts_mat_nativeObj); // C++: void equalizeHist(Mat src, Mat& dst) private static native void equalizeHist_0(long src_nativeObj, long dst_nativeObj); // C++: void erode(Mat src, Mat& dst, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) private static native void erode_0(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations, int borderType, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); private static native void erode_1(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations); private static native void erode_2(long src_nativeObj, long dst_nativeObj, long kernel_nativeObj); // C++: void fillConvexPoly(Mat& img, vector_Point points, Scalar color, int lineType = LINE_8, int shift = 0) private static native void fillConvexPoly_0(long img_nativeObj, long points_mat_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3, int lineType, int shift); private static native void fillConvexPoly_1(long img_nativeObj, long points_mat_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void fillPoly(Mat& img, vector_vector_Point pts, Scalar color, int lineType = LINE_8, int shift = 0, Point offset = Point()) private static native void fillPoly_0(long img_nativeObj, long pts_mat_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3, int lineType, int shift, double offset_x, double offset_y); private static native void fillPoly_1(long img_nativeObj, long pts_mat_nativeObj, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void filter2D(Mat src, Mat& dst, int ddepth, Mat kernel, Point anchor = Point(-1,-1), double delta = 0, int borderType = BORDER_DEFAULT) private static native void filter2D_0(long src_nativeObj, long dst_nativeObj, int ddepth, long kernel_nativeObj, double anchor_x, double anchor_y, double delta, int borderType); private static native void filter2D_1(long src_nativeObj, long dst_nativeObj, int ddepth, long kernel_nativeObj, double anchor_x, double anchor_y, double delta); private static native void filter2D_2(long src_nativeObj, long dst_nativeObj, int ddepth, long kernel_nativeObj); // C++: void findContours(Mat& image, vector_vector_Point& contours, Mat& hierarchy, int mode, int method, Point offset = Point()) private static native void findContours_0(long image_nativeObj, long contours_mat_nativeObj, long hierarchy_nativeObj, int mode, int method, double offset_x, double offset_y); private static native void findContours_1(long image_nativeObj, long contours_mat_nativeObj, long hierarchy_nativeObj, int mode, int method); // C++: void fitLine(Mat points, Mat& line, int distType, double param, double reps, double aeps) private static native void fitLine_0(long points_nativeObj, long line_nativeObj, int distType, double param, double reps, double aeps); // C++: void getDerivKernels(Mat& kx, Mat& ky, int dx, int dy, int ksize, bool normalize = false, int ktype = CV_32F) private static native void getDerivKernels_0(long kx_nativeObj, long ky_nativeObj, int dx, int dy, int ksize, boolean normalize, int ktype); private static native void getDerivKernels_1(long kx_nativeObj, long ky_nativeObj, int dx, int dy, int ksize); // C++: void getRectSubPix(Mat image, Size patchSize, Point2f center, Mat& patch, int patchType = -1) private static native void getRectSubPix_0(long image_nativeObj, double patchSize_width, double patchSize_height, double center_x, double center_y, long patch_nativeObj, int patchType); private static native void getRectSubPix_1(long image_nativeObj, double patchSize_width, double patchSize_height, double center_x, double center_y, long patch_nativeObj); // C++: void goodFeaturesToTrack(Mat image, vector_Point& corners, int maxCorners, double qualityLevel, double minDistance, Mat mask = Mat(), int blockSize = 3, bool useHarrisDetector = false, double k = 0.04) private static native void goodFeaturesToTrack_0(long image_nativeObj, long corners_mat_nativeObj, int maxCorners, double qualityLevel, double minDistance, long mask_nativeObj, int blockSize, boolean useHarrisDetector, double k); private static native void goodFeaturesToTrack_1(long image_nativeObj, long corners_mat_nativeObj, int maxCorners, double qualityLevel, double minDistance); // C++: void grabCut(Mat img, Mat& mask, Rect rect, Mat& bgdModel, Mat& fgdModel, int iterCount, int mode = GC_EVAL) private static native void grabCut_0(long img_nativeObj, long mask_nativeObj, int rect_x, int rect_y, int rect_width, int rect_height, long bgdModel_nativeObj, long fgdModel_nativeObj, int iterCount, int mode); private static native void grabCut_1(long img_nativeObj, long mask_nativeObj, int rect_x, int rect_y, int rect_width, int rect_height, long bgdModel_nativeObj, long fgdModel_nativeObj, int iterCount); // C++: void initUndistortRectifyMap(Mat cameraMatrix, Mat distCoeffs, Mat R, Mat newCameraMatrix, Size size, int m1type, Mat& map1, Mat& map2) private static native void initUndistortRectifyMap_0(long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long R_nativeObj, long newCameraMatrix_nativeObj, double size_width, double size_height, int m1type, long map1_nativeObj, long map2_nativeObj); // C++: void integral(Mat src, Mat& sum, Mat& sqsum, Mat& tilted, int sdepth = -1, int sqdepth = -1) private static native void integral3_0(long src_nativeObj, long sum_nativeObj, long sqsum_nativeObj, long tilted_nativeObj, int sdepth, int sqdepth); private static native void integral3_1(long src_nativeObj, long sum_nativeObj, long sqsum_nativeObj, long tilted_nativeObj); // C++: void integral(Mat src, Mat& sum, Mat& sqsum, int sdepth = -1, int sqdepth = -1) private static native void integral2_0(long src_nativeObj, long sum_nativeObj, long sqsum_nativeObj, int sdepth, int sqdepth); private static native void integral2_1(long src_nativeObj, long sum_nativeObj, long sqsum_nativeObj); // C++: void integral(Mat src, Mat& sum, int sdepth = -1) private static native void integral_0(long src_nativeObj, long sum_nativeObj, int sdepth); private static native void integral_1(long src_nativeObj, long sum_nativeObj); // C++: void invertAffineTransform(Mat M, Mat& iM) private static native void invertAffineTransform_0(long M_nativeObj, long iM_nativeObj); // C++: void line(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) private static native void line_0(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); private static native void line_1(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); private static native void line_2(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void linearPolar(Mat src, Mat& dst, Point2f center, double maxRadius, int flags) private static native void linearPolar_0(long src_nativeObj, long dst_nativeObj, double center_x, double center_y, double maxRadius, int flags); // C++: void logPolar(Mat src, Mat& dst, Point2f center, double M, int flags) private static native void logPolar_0(long src_nativeObj, long dst_nativeObj, double center_x, double center_y, double M, int flags); // C++: void matchTemplate(Mat image, Mat templ, Mat& result, int method, Mat mask = Mat()) private static native void matchTemplate_0(long image_nativeObj, long templ_nativeObj, long result_nativeObj, int method, long mask_nativeObj); private static native void matchTemplate_1(long image_nativeObj, long templ_nativeObj, long result_nativeObj, int method); // C++: void medianBlur(Mat src, Mat& dst, int ksize) private static native void medianBlur_0(long src_nativeObj, long dst_nativeObj, int ksize); // C++: void minEnclosingCircle(vector_Point2f points, Point2f& center, float& radius) private static native void minEnclosingCircle_0(long points_mat_nativeObj, double[] center_out, double[] radius_out); // C++: void morphologyEx(Mat src, Mat& dst, int op, Mat kernel, Point anchor = Point(-1,-1), int iterations = 1, int borderType = BORDER_CONSTANT, Scalar borderValue = morphologyDefaultBorderValue()) private static native void morphologyEx_0(long src_nativeObj, long dst_nativeObj, int op, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations, int borderType, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); private static native void morphologyEx_1(long src_nativeObj, long dst_nativeObj, int op, long kernel_nativeObj, double anchor_x, double anchor_y, int iterations); private static native void morphologyEx_2(long src_nativeObj, long dst_nativeObj, int op, long kernel_nativeObj); // C++: void polylines(Mat& img, vector_vector_Point pts, bool isClosed, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) private static native void polylines_0(long img_nativeObj, long pts_mat_nativeObj, boolean isClosed, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); private static native void polylines_1(long img_nativeObj, long pts_mat_nativeObj, boolean isClosed, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); private static native void polylines_2(long img_nativeObj, long pts_mat_nativeObj, boolean isClosed, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void preCornerDetect(Mat src, Mat& dst, int ksize, int borderType = BORDER_DEFAULT) private static native void preCornerDetect_0(long src_nativeObj, long dst_nativeObj, int ksize, int borderType); private static native void preCornerDetect_1(long src_nativeObj, long dst_nativeObj, int ksize); // C++: void putText(Mat& img, String text, Point org, int fontFace, double fontScale, Scalar color, int thickness = 1, int lineType = LINE_8, bool bottomLeftOrigin = false) private static native void putText_0(long img_nativeObj, String text, double org_x, double org_y, int fontFace, double fontScale, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, boolean bottomLeftOrigin); private static native void putText_1(long img_nativeObj, String text, double org_x, double org_y, int fontFace, double fontScale, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); private static native void putText_2(long img_nativeObj, String text, double org_x, double org_y, int fontFace, double fontScale, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void pyrDown(Mat src, Mat& dst, Size dstsize = Size(), int borderType = BORDER_DEFAULT) private static native void pyrDown_0(long src_nativeObj, long dst_nativeObj, double dstsize_width, double dstsize_height, int borderType); private static native void pyrDown_1(long src_nativeObj, long dst_nativeObj, double dstsize_width, double dstsize_height); private static native void pyrDown_2(long src_nativeObj, long dst_nativeObj); // C++: void pyrMeanShiftFiltering(Mat src, Mat& dst, double sp, double sr, int maxLevel = 1, TermCriteria termcrit = TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5,1)) private static native void pyrMeanShiftFiltering_0(long src_nativeObj, long dst_nativeObj, double sp, double sr, int maxLevel, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon); private static native void pyrMeanShiftFiltering_1(long src_nativeObj, long dst_nativeObj, double sp, double sr); // C++: void pyrUp(Mat src, Mat& dst, Size dstsize = Size(), int borderType = BORDER_DEFAULT) private static native void pyrUp_0(long src_nativeObj, long dst_nativeObj, double dstsize_width, double dstsize_height, int borderType); private static native void pyrUp_1(long src_nativeObj, long dst_nativeObj, double dstsize_width, double dstsize_height); private static native void pyrUp_2(long src_nativeObj, long dst_nativeObj); // C++: void rectangle(Mat& img, Point pt1, Point pt2, Scalar color, int thickness = 1, int lineType = LINE_8, int shift = 0) private static native void rectangle_0(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness, int lineType, int shift); private static native void rectangle_1(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3, int thickness); private static native void rectangle_2(long img_nativeObj, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double color_val0, double color_val1, double color_val2, double color_val3); // C++: void remap(Mat src, Mat& dst, Mat map1, Mat map2, int interpolation, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) private static native void remap_0(long src_nativeObj, long dst_nativeObj, long map1_nativeObj, long map2_nativeObj, int interpolation, int borderMode, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); private static native void remap_1(long src_nativeObj, long dst_nativeObj, long map1_nativeObj, long map2_nativeObj, int interpolation); // C++: void resize(Mat src, Mat& dst, Size dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR) private static native void resize_0(long src_nativeObj, long dst_nativeObj, double dsize_width, double dsize_height, double fx, double fy, int interpolation); private static native void resize_1(long src_nativeObj, long dst_nativeObj, double dsize_width, double dsize_height); // C++: void sepFilter2D(Mat src, Mat& dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor = Point(-1,-1), double delta = 0, int borderType = BORDER_DEFAULT) private static native void sepFilter2D_0(long src_nativeObj, long dst_nativeObj, int ddepth, long kernelX_nativeObj, long kernelY_nativeObj, double anchor_x, double anchor_y, double delta, int borderType); private static native void sepFilter2D_1(long src_nativeObj, long dst_nativeObj, int ddepth, long kernelX_nativeObj, long kernelY_nativeObj, double anchor_x, double anchor_y, double delta); private static native void sepFilter2D_2(long src_nativeObj, long dst_nativeObj, int ddepth, long kernelX_nativeObj, long kernelY_nativeObj); // C++: void spatialGradient(Mat src, Mat& dx, Mat& dy, int ksize = 3, int borderType = BORDER_DEFAULT) private static native void spatialGradient_0(long src_nativeObj, long dx_nativeObj, long dy_nativeObj, int ksize, int borderType); private static native void spatialGradient_1(long src_nativeObj, long dx_nativeObj, long dy_nativeObj, int ksize); private static native void spatialGradient_2(long src_nativeObj, long dx_nativeObj, long dy_nativeObj); // C++: void sqrBoxFilter(Mat _src, Mat& _dst, int ddepth, Size ksize, Point anchor = Point(-1, -1), bool normalize = true, int borderType = BORDER_DEFAULT) private static native void sqrBoxFilter_0(long _src_nativeObj, long _dst_nativeObj, int ddepth, double ksize_width, double ksize_height, double anchor_x, double anchor_y, boolean normalize, int borderType); private static native void sqrBoxFilter_1(long _src_nativeObj, long _dst_nativeObj, int ddepth, double ksize_width, double ksize_height, double anchor_x, double anchor_y, boolean normalize); private static native void sqrBoxFilter_2(long _src_nativeObj, long _dst_nativeObj, int ddepth, double ksize_width, double ksize_height); // C++: void undistort(Mat src, Mat& dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix = Mat()) private static native void undistort_0(long src_nativeObj, long dst_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long newCameraMatrix_nativeObj); private static native void undistort_1(long src_nativeObj, long dst_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj); // C++: void undistortPoints(vector_Point2f src, vector_Point2f& dst, Mat cameraMatrix, Mat distCoeffs, Mat R = Mat(), Mat P = Mat()) private static native void undistortPoints_0(long src_mat_nativeObj, long dst_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj, long R_nativeObj, long P_nativeObj); private static native void undistortPoints_1(long src_mat_nativeObj, long dst_mat_nativeObj, long cameraMatrix_nativeObj, long distCoeffs_nativeObj); // C++: void warpAffine(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) private static native void warpAffine_0(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height, int flags, int borderMode, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); private static native void warpAffine_1(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height, int flags); private static native void warpAffine_2(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height); // C++: void warpPerspective(Mat src, Mat& dst, Mat M, Size dsize, int flags = INTER_LINEAR, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar()) private static native void warpPerspective_0(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height, int flags, int borderMode, double borderValue_val0, double borderValue_val1, double borderValue_val2, double borderValue_val3); private static native void warpPerspective_1(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height, int flags); private static native void warpPerspective_2(long src_nativeObj, long dst_nativeObj, long M_nativeObj, double dsize_width, double dsize_height); // C++: void watershed(Mat image, Mat& markers) private static native void watershed_0(long image_nativeObj, long markers_nativeObj); private static native double[] n_getTextSize(String text, int fontFace, double fontScale, int thickness, int[] baseLine); }
150,695
Java
.java
2,491
51.75552
395
0.689727
jorenham/fingerblox
18
16
1
GPL-3.0
9/4/2024, 8:21:06 PM (Europe/Amsterdam)
false
true
true
true
true
true
true
true
150,695
659,296
ImagingConstants.java
KnIfER_PlainDictionaryAPP/PLOD/src/main/java/org/apache/commons/imaging/ImagingConstants.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.imaging; /** * Defines constants that may be used in passing options to * ImageParser read/write implementations, the utility routines * implemented in the Imaging class, and throughout the * Apache Commons Imaging package. Individual ImageParser * implementations may define their own format-specific options. */ public final class ImagingConstants { /** * Parameter key. Used to hint the filename when reading from a byte array * or InputStream. The filename hint can help disambiguate what file the * image format. * <p> * Applies to read operations. * <p> * Valid values: filename as string * <p> * * @see java.io.InputStream */ public static final String PARAM_KEY_FILENAME = "FILENAME"; /** * Parameter key. Used in write operations to indicate desired image format. * <p> * Valid values: Any format defined in ImageFormat, such as * ImageFormat.IMAGE_FORMAT_PNG. * <p> * * @see ImageFormats */ public static final String PARAM_KEY_FORMAT = "FORMAT"; /** * Parameter key. Used in write operations to indicate desired compression * algorithm. * <p> * Currently only applies to writing TIFF image files. * <p> * Valid values: TiffConstants.TIFF_COMPRESSION_UNCOMPRESSED, * TiffConstants.TIFF_COMPRESSION_CCITT_1D, * TiffConstants.TIFF_COMPRESSION_LZW, * TiffConstants.TIFF_COMPRESSION_PACKBITS. * <p> * * @see org.apache.commons.imaging.formats.tiff.constants.TiffConstants */ public static final String PARAM_KEY_COMPRESSION = "COMPRESSION"; public static final String BUFFERED_IMAGE_FACTORY = "BUFFERED_IMAGE_FACTORY"; /** * Parameter key. Indicates whether to read embedded thumbnails. * <p> * Only applies to read EXIF metadata from JPEG/JFIF files. * <p> * Valid values: Boolean.TRUE and Boolean.FALSE. * <p> * * @see org.apache.commons.imaging.formats.tiff.constants.TiffConstants */ public static final String PARAM_KEY_READ_THUMBNAILS = "READ_THUMBNAILS"; /** * Parameter key. Indicates whether to throw exceptions when parsing invalid * files, or whether to tolerate small problems. * <p> * Valid values: Boolean.TRUE and Boolean.FALSE. Default value: * Boolean.FALSE. * <p> * * @see org.apache.commons.imaging.formats.tiff.constants.TiffConstants */ public static final String PARAM_KEY_STRICT = "STRICT"; /** * Parameter key. * * Only used when writing images. * <p> * Valid values: TiffOutputSet to write into the image's EXIF metadata. * <p> * * @see org.apache.commons.imaging.formats.tiff.write.TiffOutputSet */ public static final String PARAM_KEY_EXIF = "EXIF"; /** * Parameter key. * * Only used when writing images. * <p> * Valid values: String of XMP XML. * <p> */ public static final String PARAM_KEY_XMP_XML = "XMP_XML"; /** * Parameter key. Used in write operations to indicate the desired pixel * density (DPI), and/or aspect ratio. * <p> * Valid values: PixelDensity * <p> * * @see PixelDensity */ public static final String PARAM_KEY_PIXEL_DENSITY = "PIXEL_DENSITY"; private ImagingConstants() { } }
4,224
Java
.java
119
30.478992
81
0.687836
KnIfER/PlainDictionaryAPP
114
18
4
GPL-3.0
9/4/2024, 7:08:18 PM (Europe/Amsterdam)
false
true
false
true
true
true
true
true
4,224
933,113
package-info.java
Transitime_core/transitime/src/main/java/org/transitime/db/hibernate/package-info.java
/* * This file is part of Transitime.org * * Transitime.org is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License (GPL) as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * Transitime.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Transitime.org . If not, see <http://www.gnu.org/licenses/>. */ /** * Classes having to do with reading and writing to the database using * Hibernate. * <p> * Hibernate was selected as the ORM (Object Relational Mapping) tool because * it is both very widely used yet very simple. Once one gets the hang of it * it greatly reduces the amount of code that needs to be written for reading * and writing objects. * <p> * It is intended that annotations be used (as opposed to an xml based schema * config file) to specify how an object is mapped to the database. This way * the mapping info is directly in the class definition and one doesn't need * to deal with a separate file. * <p> * Every object to be persisted needs a unique Id per row. That way Hibernate * can compare objects for equality and such. This also means that each * table should have ah primary key, which of course is also expected for any * table in a relational database. If multiple columns are needed to establish * a unique id/primary key then can simply annotated multiple columns with @Id. * It should be noted that can have null values for primary key columns. This * is unfortunate because null should be considered a valid identifier. So for * AVLReports can't have block be part of the primary key because sometimes * it will be null. * <p> * The primary key will automatically create an index so that the db can * quickly confirm that the object being inserted is unique. So don't * need to create a separate index on the primary key column to speed up queries * that would benefit from an index on that column. It already exists. But * if the primary key is on multiple columns then things are much more * complicated. When multiple columns are used for a primary key then * an index is created but most likely it will simply use a concatenation * of what is in the two columns. This is adequate for the db to quickly make * sure that an object is unique before inserting it but it will not be * adequate for speeding up some queries. For example, for AvlReport the * primary key is on time and vehicleId. The index can therefore be * something like time||vehicleId (concatenation). If one does a query for * reports between a certain time frame the index unfortunately won't help * since it is really just a string that includes time and vehicleId. Can't * find rows based on time. So for this case need a separate index to speed * up such queries. * <p> * Storing time is important yet a nuisance when MySQL is used. Previously * MySQL did not support fractional seconds. But we really do want to store * msec as part of times. This is especially true for AVL data where need * to avoid duplicate key problems with respect to a primary key that uses * a timestamp. Fortunately since MySQL 5.6.4 one can specify fractional * timestamps (and other time values). See * http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html for details. * When specifying timestamp need to specify number of digits past the decimal * point. The default for MySQL is 0 for backwards compatibility. For other * databases the default is 6! So best to explicitly specify the precision * to TIMESTAMP(3) (or perhaps 6) so that fractional seconds will work with * any database. * <p> * The C3P0 db connection pooler is used because the one that comes with * Hibernate is not intended for production use. And C3P0 appears to be * widely used. * If you want to get rid of the C3P0 status that is printed, by default, * when hibernate starts, you need to recompile C3P0 sources after changing * com.mchange.v2.c3p0.Debug.DEBUG to false. This is a public static final field * that cannot be changed by configuration files. * <p> * With Hibernate 4.0 ran into lots of problems with the documentation, * including online, being out of date. For example, the Hibernate @Entity * tag has been deprecated and one must now use the JPA one by specifying * the appropriate import. Even the whole way of creating a session has * changed and will continue to change. This is a nuisance, but bearable. * <p> * One other subtle gotcha with Hibernate is that Sessions are not * threadsafe. Don't pass them between threads! * * @author SkiBu Smith * */ package org.transitime.db.hibernate;
4,949
Java
.java
91
52.285714
81
0.768217
Transitime/core
61
76
10
GPL-3.0
9/4/2024, 7:09:48 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
4,949
1,317,044
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/RenameTypeParameter/test14/in/A.java
package p; /** * @param <ELEMENT> the element * @see A#take(Object) */ class A<ELEMENT> { ELEMENT e; void take(ELEMENT e) {} }
133
Java
.java
9
13.111111
31
0.658537
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
133
2,062,011
BindingProvider.java
openjdk_jdk6/jaxws/drop_included/jaxws_src/src/javax/xml/ws/BindingProvider.java
/* * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.xml.ws; import java.util.Map; import javax.xml.ws.wsaddressing.W3CEndpointReference; import org.w3c.dom.Element; /** * The <code>BindingProvider</code> interface provides access to the * protocol binding and associated context objects for request and * response message processing. * * @since JAX-WS 2.0 * * @see javax.xml.ws.Binding **/ public interface BindingProvider { /** * Standard property: User name for authentication. * <p>Type: <code>java.lang.String</code> **/ public static final String USERNAME_PROPERTY = "javax.xml.ws.security.auth.username"; /** * Standard property: Password for authentication. * <p>Type: <code>java.lang.String</code> **/ public static final String PASSWORD_PROPERTY = "javax.xml.ws.security.auth.password"; /** * Standard property: Target service endpoint address. The * URI scheme for the endpoint address specification MUST * correspond to the protocol/transport binding for the * binding in use. * <p>Type: <code>java.lang.String</code> **/ public static final String ENDPOINT_ADDRESS_PROPERTY = "javax.xml.ws.service.endpoint.address"; /** * Standard property: This boolean property is used by a service * client to indicate whether or not it wants to participate in * a session with a service endpoint. If this property is set to * <code>true</code>, the service client indicates that it wants the session * to be maintained. If set to <code>false</code>, the session is not maintained. * The default value for this property is <code>false</code>. * <p>Type: <code>java.lang.Boolean</code> **/ public static final String SESSION_MAINTAIN_PROPERTY = "javax.xml.ws.session.maintain"; /** * Standard property for SOAPAction. This boolean property * indicates whether or not the value of the * <code>javax.xml.ws.soap.http.soapaction.uri</code> property * is used for the value of the SOAPAction. The * default value of this property is <code>false</code> indicating * that the * <code>javax.xml.ws.soap.http.soapaction.uri</code> property * is not used for the value of the SOAPAction, however, * if WS-Addressing is enabled, the default value is * <code>true</code>. * * <p>Type: <code>java.lang.Boolean</code> **/ public static final String SOAPACTION_USE_PROPERTY = "javax.xml.ws.soap.http.soapaction.use"; /** * Standard property for SOAPAction. Indicates the SOAPAction * URI if the <code>javax.xml.ws.soap.http.soapaction.use</code> * property is set to <code>true</code>. If WS-Addressing * is enabled, this value will also be used for the value of the * WS-Addressing Action header. If this property is not set, * the default SOAPAction and WS-Addressing Action will be sent. * * <p>Type: <code>java.lang.String</code> **/ public static final String SOAPACTION_URI_PROPERTY = "javax.xml.ws.soap.http.soapaction.uri"; /** * Get the context that is used to initialize the message context * for request messages. * * Modifications to the request context do not affect the message context of * either synchronous or asynchronous operations that have already been * started. * * @return The context that is used in processing request messages. **/ Map<String, Object> getRequestContext(); /** * Get the context that resulted from processing a response message. * * The returned context is for the most recently completed synchronous * operation. Subsequent synchronous operation invocations overwrite the * response context. Asynchronous operations return their response context * via the Response interface. * * @return The context that resulted from processing the latest * response messages. **/ Map<String, Object> getResponseContext(); /** * Get the Binding for this binding provider. * * @return The Binding for this binding provider. **/ Binding getBinding(); /** * Returns the <code>EndpointReference</code> associated with * this <code>BindingProvider</code> instance. * <p> * If the Binding for this <code>bindingProvider</code> is * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a * <code>W3CEndpointReference</code> MUST be returned. * * @return EndpointReference of the target endpoint associated with this * <code>BindingProvider</code> instance. * * @throws java.lang.UnsupportedOperationException If this * <code>BindingProvider</code> uses the XML/HTTP binding. * * @see W3CEndpointReference * * @since JAX-WS 2.1 */ public EndpointReference getEndpointReference(); /** * Returns the <code>EndpointReference</code> associated with * this <code>BindingProvider</code> instance. The instance * returned will be of type <code>clazz</code>. * * @param clazz Specifies the type of <code>EndpointReference</code> * that MUST be returned. * @return EndpointReference of the target endpoint associated with this * <code>BindingProvider</code> instance. MUST be of type * <code>clazz</code>. * @throws WebServiceException If the Class <code>clazz</code> * is not supported by this implementation. * @throws java.lang.UnsupportedOperationException If this * <code>BindingProvider</code> uses the XML/HTTP binding. * * @since JAX-WS 2.1 */ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz); }
6,968
Java
.java
165
36.993939
85
0.703464
openjdk/jdk6
19
18
0
GPL-2.0
9/4/2024, 8:28:13 PM (Europe/Amsterdam)
false
true
true
true
false
true
true
true
6,968
3,585,928
BasicDigestAuthorization.java
bonitasoft_bonita-connector-rest/src/main/java/org/bonitasoft/connectors/rest/model/BasicDigestAuthorization.java
package org.bonitasoft.connectors.rest.model; /** This class reflects the information for a Basic or Digest authorization of a HTTP request. */ public class BasicDigestAuthorization implements Authorization { /** Is the authorization information for a Basic authorization. */ private boolean basic = true; /** The username value. */ private String username = null; /** The password value. */ private String password = null; /** The host value. */ private String host = null; /** The port value. */ private Integer port = null; /** The realm value. */ private String realm = null; /** Is this authorization preemptive. */ private boolean isPreemptive = true; /** * Constructor setting if the authorization is a Basic typed one. Default Constructor. * * @param basic States if it is a Basic authorization. */ public BasicDigestAuthorization(final boolean basic) { this.basic = basic; } /** * Username value getter. * * @return The username value. */ public String getUsername() { return username; } /** * Username value setter. * * @param username The new username value. */ public void setUsername(final String username) { this.username = username; } /** * Password value getter. * * @return The password value. */ public String getPassword() { return password; } /** * Password value setter. * * @param password The new password value. */ public void setPassword(final String password) { this.password = password; } /** * Host value getter. * * @return The host value. */ public String getHost() { return host; } /** * Host value setter. * * @param host The new Host value. */ public void setHost(final String host) { this.host = host; } /** * Port value getter. * * @return The port value. */ public Integer getPort() { return port; } /** * Port value setter. * * @param port The new Port value. */ public void setPort(final Integer port) { this.port = port; } /** * Realm value getter. * * @return The realm value. */ public String getRealm() { return realm; } /** * Realm value setter. * * @param realm The new realm value. */ public void setRealm(final String realm) { this.realm = realm; } /** * Preemptive value getter. * * @return The preemptive value. */ public boolean isPreemptive() { return isPreemptive; } /** * Preemptive value setter. * * @param isPreemptive The new preemptive value. */ public void setPreemptive(final boolean isPreemptive) { this.isPreemptive = isPreemptive; } /** * Basic value getter. * * @return The basic value. */ public boolean isBasic() { return basic; } /** * Basic value setter. * * @param basic The new basic value. */ public void setBasic(final boolean basic) { this.basic = basic; } }
3,011
Java
.java
138
18.057971
97
0.654737
bonitasoft/bonita-connector-rest
3
9
6
GPL-2.0
9/4/2024, 11:34:01 PM (Europe/Amsterdam)
false
false
false
true
false
false
false
true
3,011
413,903
NextTickListEntry.java
CobbleSword_NachoSpigot/NachoSpigot-Server/src/main/java/net/minecraft/server/NextTickListEntry.java
package net.minecraft.server; public class NextTickListEntry implements Comparable<NextTickListEntry> { private static long d; private final Block e; public final BlockPosition a; public long b; public int c; private long f; public NextTickListEntry(BlockPosition blockposition, Block block) { this.f = (long) (NextTickListEntry.d++); this.a = blockposition; this.e = block; } public boolean equals(Object object) { if (!(object instanceof NextTickListEntry)) { return false; } else { NextTickListEntry nextticklistentry = (NextTickListEntry) object; return this.a.equals(nextticklistentry.a) && Block.a(this.e, nextticklistentry.e); } } public int hashCode() { return this.a.hashCode(); } public NextTickListEntry a(long i) { this.b = i; return this; } public void a(int i) { this.c = i; } public int a(NextTickListEntry nextticklistentry) { return this.b < nextticklistentry.b ? -1 : (this.b > nextticklistentry.b ? 1 : (this.c != nextticklistentry.c ? this.c - nextticklistentry.c : (this.f < nextticklistentry.f ? -1 : (this.f > nextticklistentry.f ? 1 : 0)))); } public String toString() { return Block.getId(this.e) + ": " + this.a + ", " + this.b + ", " + this.c + ", " + this.f; } public Block a() { return this.e; } public int compareTo(NextTickListEntry object) { return this.a((NextTickListEntry) object); } }
1,577
Java
.java
44
29.022727
230
0.627219
CobbleSword/NachoSpigot
237
86
27
GPL-3.0
9/4/2024, 7:07:11 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
1,577
1,318,802
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_nonstatic_39/in/A.java
package p; public class A { class Inner { public void doit() { foo(); fred++; new Stat(); } } static void foo(){}; static int fred; static class Stat{} }
171
Java
.java
13
10.846154
22
0.622642
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
171
1,316,814
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test21/in/A.java
package p; public class A { Second s; Second s2; public void print() { s.foo(s); s.bar(); s.go(17, 18); equals(this); s.foo(s2); s2.bar(); } }
161
Java
.java
13
10
22
0.59589
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
161
1,315,905
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test11/out/A.java
// 8, 25 -> 8, 25 replaceAll == false package p1; import p3.C; public class A { void f() { int j= 4 * (4*C.BEGRIFF + p3.C.BEGRIFF) + 1; } }
149
Java
.java
8
16.625
47
0.578571
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
149
1,315,261
MultiUnit1B_in.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/MultiUnit1B_in.java
package p; public class MultiUnit1B_in { public void foo3(String[] args) { MultiUnit1A_in mu= new MultiUnit1A_in(16); System.out.println("Value = " + mu.get()); } }
173
Java
.java
7
22.571429
44
0.70122
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
173
1,693,514
GreedyPVRTexturePixelBufferStrategy.java
delight-im_NationSoccer/AndEngine/src/org/andengine/opengl/texture/compressed/pvr/pixelbufferstrategy/GreedyPVRTexturePixelBufferStrategy.java
package org.andengine.opengl.texture.compressed.pvr.pixelbufferstrategy; import java.io.IOException; import java.nio.Buffer; import java.nio.ByteBuffer; import org.andengine.opengl.texture.PixelFormat; import org.andengine.opengl.texture.compressed.pvr.PVRTexture; import org.andengine.opengl.texture.compressed.pvr.PVRTexture.PVRTextureHeader; import android.opengl.GLES20; /** * (c) 2011 Zynga Inc. * * @author Nicolas Gramlich <ngramlich@zynga.com> * @since 11:26:07 - 27.09.2011 */ public class GreedyPVRTexturePixelBufferStrategy implements IPVRTexturePixelBufferStrategy { // =========================================================== // Constants // =========================================================== // =========================================================== // Fields // =========================================================== // =========================================================== // Constructors // =========================================================== // =========================================================== // Getter & Setter // =========================================================== // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== @Override public IPVRTexturePixelBufferStrategyBufferManager newPVRTexturePixelBufferStrategyManager(final PVRTexture pPVRTexture) throws IOException { return new GreedyPVRTexturePixelBufferStrategyBufferManager(pPVRTexture); } @Override public void loadPVRTextureData(final IPVRTexturePixelBufferStrategyBufferManager pPVRTexturePixelBufferStrategyManager, final int pWidth, final int pHeight, final int pBytesPerPixel, final PixelFormat pPixelFormat, final int pLevel, final int pCurrentPixelDataOffset, final int pCurrentPixelDataSize) throws IOException { /* Adjust buffer. */ final Buffer pixelBuffer = pPVRTexturePixelBufferStrategyManager.getPixelBuffer(PVRTextureHeader.SIZE + pCurrentPixelDataOffset, pCurrentPixelDataSize); /* Send to hardware. */ GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, pLevel, pPixelFormat.getGLInternalFormat(), pWidth, pHeight, 0, pPixelFormat.getGLFormat(), pPixelFormat.getGLType(), pixelBuffer); } // =========================================================== // Methods // =========================================================== // =========================================================== // Inner and Anonymous Classes // =========================================================== public static class GreedyPVRTexturePixelBufferStrategyBufferManager implements IPVRTexturePixelBufferStrategyBufferManager { // =========================================================== // Constants // =========================================================== // =========================================================== // Fields // =========================================================== private final ByteBuffer mByteBuffer; // =========================================================== // Constructors // =========================================================== public GreedyPVRTexturePixelBufferStrategyBufferManager(final PVRTexture pPVRTexture) throws IOException { this.mByteBuffer = pPVRTexture.getPVRTextureBuffer(); } // =========================================================== // Getter & Setter // =========================================================== // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== @Override public ByteBuffer getPixelBuffer(final int pStart, final int pByteCount) { this.mByteBuffer.position(pStart); this.mByteBuffer.limit(pStart + pByteCount); return this.mByteBuffer.slice(); } // =========================================================== // Methods // =========================================================== // =========================================================== // Inner and Anonymous Classes // =========================================================== } }
4,225
Java
.java
81
49.518519
322
0.47076
delight-im/NationSoccer
14
8
0
GPL-2.0
9/4/2024, 8:14:49 PM (Europe/Amsterdam)
false
true
true
true
true
true
true
true
4,225
1,320,213
B.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/testFail9/in/B.java
package p; class B extends A { void m() { a(); } void a(){} }
69
Java
.java
7
7.857143
19
0.540984
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
69
1,320,420
B.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/testFail10/in/B.java
package p; class B extends A { int a; void m() { a++; } }
65
Java
.java
7
7.285714
19
0.551724
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
65
1,867,001
ResourceNotFoundException.java
rockitconsulting_test_rockitizer/src/main/java/io/github/rockitconsulting/test/rockitizer/exceptions/ResourceNotFoundException.java
package io.github.rockitconsulting.test.rockitizer.exceptions; /** * Test.Rockitizer - API regression testing framework * Copyright (C) 2020 rockit.consulting GmbH * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * */ public class ResourceNotFoundException extends RuntimeException { /** * */ private static final long serialVersionUID = 984539678680338855L; // final static String allowedConnectorsMessage = // "HTTP, FILEDEL, FILEPUT, FILEGET, MQGET, MQPUT , DBPUT , DBGET , SCPPUT "; public ResourceNotFoundException(String connectorId) { super(" Connector/DataSource configuration not found for id : " + connectorId); } }
1,254
Java
.java
30
40.166667
81
0.767022
rockitconsulting/test.rockitizer
10
20
3
GPL-3.0
9/4/2024, 8:21:24 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
1,254
834,749
XssKillerUtil.java
chen-xing_RgBlog/blog-core/src/main/java/com/zyd/blog/util/XssKillerUtil.java
package com.zyd.blog.util; import org.jsoup.Jsoup; import org.jsoup.safety.Whitelist; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @version 1.0 * @website https://www.zhyd.me * @date 2018/8/07 18:13 * @since 1.0 */ public class XssKillerUtil { private static final String[] WHITE_LIST = {"p", "strong", "pre", "code", "span", "blockquote", "em", "a"}; private static String reg = null; private static String legalTags = null; static { StringBuilder regSb = new StringBuilder("<"); StringBuilder tagsSb = new StringBuilder(); for (String s : WHITE_LIST) { regSb.append("(?!").append(s).append(" )"); tagsSb.append("<").append(s).append(">"); } regSb.append("(?!/)[^>]*>"); reg = regSb.toString(); legalTags = tagsSb.toString(); } /** * xss白名单验证 * * @param xssStr * @return */ public static boolean isValid(String xssStr) { if (null == xssStr || xssStr.isEmpty()) { return true; } Pattern pattern = Pattern.compile(reg); Matcher matcher = pattern.matcher(xssStr); while (matcher.find()) { String tag = matcher.group(); if (!legalTags.contains(tag.toLowerCase())) { return false; } } return true; } /** * xss白名单验证(Jsoup工具,效率较自己实现的那个有些差劲,见com.zyd.blog.util.XssKillerTest.test1()) * * @param xssStr * @return */ public static boolean isValidByJsoup(String xssStr) { return Jsoup.isValid(xssStr, custome()); } /** * 自定义的白名单 * * @return */ private static Whitelist custome() { return Whitelist.none().addTags("p", "strong", "pre", "code", "span", "blockquote", "br").addAttributes("span", "class"); } /** * 根据白名单,剔除多余的属性、标签 * * @param xssStr * @return */ public static String clean(String xssStr) { if (null == xssStr || xssStr.isEmpty()) { return ""; } return Jsoup.clean(xssStr, custome()); } public static String escape(String xssStr) { if (null == xssStr || xssStr.isEmpty()) { return ""; } // TODO ... return xssStr; } }
2,489
Java
.java
84
21.595238
129
0.564495
chen-xing/RgBlog
76
20
1
GPL-3.0
9/4/2024, 7:09:22 PM (Europe/Amsterdam)
false
false
false
true
true
false
true
true
2,381
1,316,522
A_testAll50_in.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeSignature/canModify/A_testAll50_in.java
package p; class A{ A(){ } } class B extends A{ }
51
Java
.java
7
6.142857
18
0.644444
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
51
3,162,892
BulkUploadXmlJobData.java
kaltura_KalturaGeneratedAPIClientsAndroid/KalturaClient/src/main/java/com/kaltura/client/types/BulkUploadXmlJobData.java
// =================================================================================================== // _ __ _ _ // | |/ /__ _| | |_ _ _ _ _ __ _ // | ' </ _` | | _| || | '_/ _` | // |_|\_\__,_|_|\__|\_,_|_| \__,_| // // This file is part of the Kaltura Collaborative Media Suite which allows users // to do with audio, video, and animation what Wiki platforms allow them to do with // text. // // Copyright (C) 2006-2023 Kaltura Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // // @ignore // =================================================================================================== package com.kaltura.client.types; import android.os.Parcel; import com.google.gson.JsonObject; import com.kaltura.client.Params; import com.kaltura.client.utils.request.MultiRequestBuilder; /** * This class was generated using generate.php * against an XML schema provided by Kaltura. * * MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN. */ /** * Represents the Bulk upload job data for xml bulk upload */ @SuppressWarnings("serial") @MultiRequestBuilder.Tokenizer(BulkUploadXmlJobData.Tokenizer.class) public class BulkUploadXmlJobData extends BulkUploadJobData { public interface Tokenizer extends BulkUploadJobData.Tokenizer { } public BulkUploadXmlJobData() { super(); } public BulkUploadXmlJobData(JsonObject jsonObject) throws APIException { super(jsonObject); } public Params toParams() { Params kparams = super.toParams(); kparams.add("objectType", "KalturaBulkUploadXmlJobData"); return kparams; } public static final Creator<BulkUploadXmlJobData> CREATOR = new Creator<BulkUploadXmlJobData>() { @Override public BulkUploadXmlJobData createFromParcel(Parcel source) { return new BulkUploadXmlJobData(source); } @Override public BulkUploadXmlJobData[] newArray(int size) { return new BulkUploadXmlJobData[size]; } }; public BulkUploadXmlJobData(Parcel in) { super(in); } }
2,752
Java
.java
71
35.830986
102
0.63841
kaltura/KalturaGeneratedAPIClientsAndroid
4
3
3
AGPL-3.0
9/4/2024, 11:02:10 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
2,752
1,314,708
A_testInvalidSelection_in.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/ChangeTypeRefactoring/negative/A_testInvalidSelection_in.java
import java.util.Hashtable; class A_testInvalidSelection_in { public static void main(String[] args) { Hashtable h = new Hashtable(); System.out.println("Hello, world!"); } }
182
Java
.java
7
24
41
0.741379
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
182
1,511,958
RenderFireball.java
josephworks_AtomMC/src/main/java/net/minecraft/client/renderer/entity/RenderFireball.java
package net.minecraft.client.renderer.entity; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.projectile.EntityFireball; import net.minecraft.init.Items; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderFireball extends Render<EntityFireball> { private final float scale; public RenderFireball(RenderManager renderManagerIn, float scaleIn) { super(renderManagerIn); this.scale = scaleIn; } public void doRender(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks) { GlStateManager.pushMatrix(); this.bindEntityTexture(entity); GlStateManager.translate((float) x, (float) y, (float) z); GlStateManager.enableRescaleNormal(); GlStateManager.scale(this.scale, this.scale, this.scale); TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.FIRE_CHARGE); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); float f = textureatlassprite.getMinU(); float f1 = textureatlassprite.getMaxU(); float f2 = textureatlassprite.getMinV(); float f3 = textureatlassprite.getMaxV(); float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GlStateManager.rotate((float) (this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * -this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); if (this.renderOutlines) { GlStateManager.enableColorMaterial(); GlStateManager.enableOutlineMode(this.getTeamColor(entity)); } bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL); bufferbuilder.pos(-0.5D, -0.25D, 0.0D).tex((double) f, (double) f3).normal(0.0F, 1.0F, 0.0F).endVertex(); bufferbuilder.pos(0.5D, -0.25D, 0.0D).tex((double) f1, (double) f3).normal(0.0F, 1.0F, 0.0F).endVertex(); bufferbuilder.pos(0.5D, 0.75D, 0.0D).tex((double) f1, (double) f2).normal(0.0F, 1.0F, 0.0F).endVertex(); bufferbuilder.pos(-0.5D, 0.75D, 0.0D).tex((double) f, (double) f2).normal(0.0F, 1.0F, 0.0F).endVertex(); tessellator.draw(); if (this.renderOutlines) { GlStateManager.disableOutlineMode(); GlStateManager.disableColorMaterial(); } GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); super.doRender(entity, x, y, z, entityYaw, partialTicks); } protected ResourceLocation getEntityTexture(EntityFireball entity) { return TextureMap.LOCATION_BLOCKS_TEXTURE; } }
3,234
Java
.java
60
47.1
150
0.721099
josephworks/AtomMC
23
6
21
GPL-3.0
9/4/2024, 7:55:18 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
3,234
3,069,909
CustomPacketPayloadMixin.java
null2264_CobbleGen/src/main/java/io/github/null2264/cobblegen/mixin/network/packet/CustomPacketPayloadMixin.java
//#if MC>=1.20.5 //$$ package io.github.null2264.cobblegen.mixin.network.packet; //$$ //$$ import io.github.null2264.cobblegen.data.CGIdentifier; //$$ import net.minecraft.network.FriendlyByteBuf; //$$ import net.minecraft.network.codec.StreamCodec; //$$ import net.minecraft.network.protocol.common.custom.CustomPacketPayload; //$$ import net.minecraft.resources.ResourceLocation; //$$ import org.spongepowered.asm.mixin.Mixin; //$$ import org.spongepowered.asm.mixin.injection.At; //$$ import org.spongepowered.asm.mixin.injection.Inject; //$$ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //$$ //$$ import static io.github.null2264.cobblegen.CobbleGen.MOD_ID; //$$ import static io.github.null2264.cobblegen.util.Constants.KNOWN_PAYLOADS; //$$ //$$ @Mixin(targets = "net.minecraft.network.protocol.common.custom.CustomPacketPayload$1") //$$ public abstract class CustomPacketPayloadMixin //$$ { //$$ @Inject(method = "findCodec", at = @At("HEAD"), cancellable = true) //$$ private void getCodec( //$$ ResourceLocation id, //$$ CallbackInfoReturnable<StreamCodec<? super FriendlyByteBuf, ? extends CustomPacketPayload>> cir //$$ ) { //$$ if (!(id.getNamespace().equals(MOD_ID))) return; //$$ //$$ StreamCodec<? super FriendlyByteBuf, ? extends CustomPacketPayload> codec = //$$ KNOWN_PAYLOADS.get(CGIdentifier.fromMC(id)); //$$ if (codec == null) return; //$$ //$$ cir.setReturnValue(codec); //$$ } //$$ } //#endif
1,524
Java
.java
34
43.852941
108
0.703555
null2264/CobbleGen
5
3
10
LGPL-3.0
9/4/2024, 10:46:16 PM (Europe/Amsterdam)
true
true
true
true
true
true
true
true
1,524
1,693,997
Statement.java
xuesong123_jsp-jstl-engine/src/main/java/com/skin/ayada/statement/Statement.java
/* * $RCSfile: Statement.java,v $ * $Revision: 1.1 $ * $Date: 2013-03-02 $ * * Copyright (C) 2008 Skin, Inc. All rights reserved. * * This software is the proprietary information of Skin, Inc. * Use is subject to license terms. */ package com.skin.ayada.statement; import com.skin.ayada.tagext.Tag; /** * <p>Title: Statement</p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2006</p> * @author xuesong.net * @version 1.0 */ public class Statement { private Tag tag; private Node node; private Statement parent; private int startTagFlag; /** * @param node */ public Statement(Node node) { this.node = node; } /** * @return the tag */ public Tag getTag() { return this.tag; } /** * @param tag the tag to set */ public void setTag(Tag tag) { this.tag = tag; } /** * @return the node */ public Node getNode() { return this.node; } /** * @param node the node to set */ public void setNode(Node node) { this.node = node; } /** * @return the parent */ public Statement getParent() { return this.parent; } /** * @param parent the parent to set */ public void setParent(Statement parent) { this.parent = parent; } /** * @return the startTagFlag */ public int getStartTagFlag() { return this.startTagFlag; } /** * @param startTagFlag the startTagFlag to set */ public void setStartTagFlag(int startTagFlag) { this.startTagFlag = startTagFlag; } }
1,656
Java
.java
79
16.012658
61
0.587484
xuesong123/jsp-jstl-engine
13
7
1
GPL-2.0
9/4/2024, 8:14:49 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
1,656
1,678,204
DataConverter.java
lenis0012_Marriage/src/main/java/com/lenis0012/bukkit/marriage2/internal/data/DataConverter.java
package com.lenis0012.bukkit.marriage2.internal.data; import com.google.common.collect.Maps; import com.lenis0012.bukkit.marriage2.MData; import com.lenis0012.bukkit.marriage2.internal.MarriageCore; import com.lenis0012.bukkit.marriage2.misc.UUIDFetcher; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.OfflinePlayer; import org.bukkit.World; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import java.io.File; import java.util.ArrayList; import java.util.Map; import java.util.UUID; import java.util.logging.Level; public class DataConverter { private final MarriageCore core; private File dir; public DataConverter(MarriageCore core) { this.core = core; } public boolean isOutdated() { this.dir = new File(core.getPlugin().getDataFolder(), "playerdata"); return dir.exists(); } public void convert() { long lastMessage = 0; File[] files = dir.listFiles(); int totalFiles = files.length; core.getLogger().log(Level.INFO, "Converting " + totalFiles + " old database entries..."); // Retrieve UUIDs from mojang Map<String, UUID> uuidMap = Maps.newHashMap(); UUIDFetcher uuidFetcher = new UUIDFetcher(new ArrayList<String>()); int ranThroughMojang = 0; int failed = 0; for(int completed = 0; completed < totalFiles; completed++) { File file = files[completed]; String name = file.getName().replace(".yml", ""); // status report double progress = (completed + 1.0) / (double) totalFiles; if(System.currentTimeMillis() >= lastMessage) { lastMessage = System.currentTimeMillis() + 2500; // Update every 2.5 seconds reportStatus(progress); } // Pull from cache OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(name); if(offlinePlayer != null) { UUID userId = offlinePlayer.getUniqueId(); if(userId != null) { uuidMap.put(name, userId); continue; } } // Pull from mojang if(ranThroughMojang >= 50000) { // Max 500 requests failed += 1; continue; } uuidFetcher.addName(name); ranThroughMojang += 1; if(uuidFetcher.size() == 100) { try { uuidMap.putAll(uuidFetcher.call()); } catch(Exception e) { core.getLogger().log(Level.WARNING, "Failed to retrieve UUID for 100 players!"); } uuidFetcher = new UUIDFetcher(new ArrayList<String>()); } } core.getLogger().log(Level.INFO, String.format("Converted %s entries. %s locally, %s through mojang, %s failed.", totalFiles, totalFiles - ranThroughMojang - failed, ranThroughMojang, failed)); core.getLogger().log(Level.INFO, "Failed entries are likely from inactive players."); // for(int completed = 0; completed < totalFiles; completed++) { // File file = files[completed]; // String name = file.getName().replace(".yml", ""); // if(files.length > 50000) { // // Over 500 requests, check for marriage // try { // FileConfiguration cnf = YamlConfiguration.loadConfiguration(file); // cnf.load(file); // String partner = cnf.getString("partner"); // if(partner == null) continue; // } catch(Exception e) { // continue; // skip // } // } // // uuidFetcher.addName(name); // if(uuidFetcher.size() >= 100 || completed >= totalFiles - 1) { // try { // uuidMap.putAll(uuidFetcher.call()); // uuidFetcher = new UUIDFetcher(new ArrayList<String>()); // } catch(Exception e) { // core.getLogger().log(Level.WARNING, "Failed to retrieve UUID for 100 players!"); // } // } // // double progress = (completed + 1.0) / (double) totalFiles; // if(System.currentTimeMillis() >= lastMessage) { // lastMessage = System.currentTimeMillis() + 2500; // Update every 2.5 seconds // reportStatus(progress); // } // } // Insert data into new DB... core.getLogger().log(Level.INFO, "Inserting user data into new database..."); int completed = 0; for(Map.Entry<String, UUID> entry : uuidMap.entrySet()) { try { MarriagePlayer mp = core.getDataManager().loadPlayer(entry.getValue()); String name = entry.getKey(); mp.setLastName(name); File file = new File(dir, name + ".yml"); FileConfiguration cnf = YamlConfiguration.loadConfiguration(file); cnf.load(file); if(cnf.contains("partner") && !mp.isMarried()) { UUID uuid = uuidMap.get(cnf.getString("partner")); if(uuid != null) { MarriagePlayer mp2 = core.getDataManager().loadPlayer(uuid); MData mdata = core.marry(mp, mp2); if(cnf.contains("home")) { World world = Bukkit.getWorld(cnf.getString("home.world")); if(world != null) { double x = cnf.getDouble("home.x", 0.0); double y = cnf.getDouble("home.y", 0.0); double z = cnf.getDouble("home.z", 0.0); float yaw = (float) cnf.getDouble("home.yaw", 0.0); float pitch = (float) cnf.getDouble("home.pitch", 0.0); Location location = new Location(world, x, y, z, yaw, pitch); mdata.setHome(location); } } // Only save if players are married, otherwise we really don't care. core.getDataManager().savePlayer(mp); core.getDataManager().savePlayer(mp2); } } } catch(Exception e) { core.getLogger().log(Level.WARNING, "Failed to convert data for player " + entry.getKey(), e); } double progress = ++completed / (double) uuidMap.size(); if(System.currentTimeMillis() >= lastMessage) { lastMessage = System.currentTimeMillis() + 2500; // Update every 2.5 seconds reportStatus(progress); } } // Reset old data core.getLogger().log(Level.INFO, "Renaming playerdata file..."); int remainingTries = 60; // Try 60 times while(!dir.renameTo(new File(core.getPlugin().getDataFolder(), "playerdata_backup"))) { long sleepTime = 500L; // Limit to take 30 seconds max if(remainingTries-- <= 0) { core.getLogger().log(Level.WARNING, "Failed to rename old playerdata file, please do manually!"); core.getLogger().log(Level.INFO, "Server starting normally in 10 seconds."); sleepTime = 10000L; } // Wait try { Thread.sleep(sleepTime); } catch(InterruptedException e) { } } } private void reportStatus(double progress) { int percent = (int) Math.floor(progress * 100); StringBuilder bar = new StringBuilder("["); for(int i = 0; i < percent; i += 5) { bar.append('='); } for(int i = percent; i < 100; i += 5) { bar.append('_'); } bar.append("] (").append(percent).append("%)"); core.getLogger().log(Level.INFO, bar.toString()); } }
8,201
Java
.java
177
35.293785
121
0.538173
lenis0012/Marriage
17
47
16
GPL-3.0
9/4/2024, 8:13:42 PM (Europe/Amsterdam)
false
false
false
true
false
false
false
true
8,201
3,068,751
PluginRegistry.java
Tostis_areca/src/main/java/com/application/areca/plugins/PluginRegistry.java
package com.application.areca.plugins; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.StringTokenizer; import com.application.areca.ApplicationException; import com.application.areca.ArecaConfiguration; import com.application.areca.ArecaFileConstants; import com.application.areca.Utils; import com.myJava.file.FileSystemManager; import com.myJava.util.log.Logger; /** * <BR> * @author Olivier PETRUCCI * <BR> * */ /* Copyright 2005-2015, Olivier PETRUCCI. This file is part of Areca. Areca is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Areca is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Areca; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ public class PluginRegistry implements ArecaFileConstants { public static final String KEY_JAR_PATH = "plugin.jar.file"; public static final String KEY_CLASS = "plugin.class"; public static final String SEPARATOR = ";"; private static final String PLUGIN_DIRECTORY = ArecaConfiguration.get().getPluginsLocationOverride(); private static PluginRegistry instance = new PluginRegistry(); private Map plugins = new HashMap(); public static PluginRegistry getInstance() { return instance; } private PluginRegistry() { File pluginDirectory; if (PLUGIN_DIRECTORY == null) { pluginDirectory = new File(Utils.getApplicationRoot(), DEFAULT_PLUGIN_SUBDIRECTORY_NAME); } else { pluginDirectory = new File(PLUGIN_DIRECTORY); } load(pluginDirectory); // Add default plugins : HD, FTP register(new DefaultStoragePlugin()); register(new FTPStoragePlugin()); register(new SFTPStoragePlugin()); } public void load(File pluginsDirectory) { Logger.defaultLogger().info("Looking for plugins in directory : " + FileSystemManager.getDisplayPath(pluginsDirectory)); String[] pluginFileNames = FileSystemManager.list(pluginsDirectory); if (pluginFileNames != null) { for (int i=0; i<pluginFileNames.length; i++) { File pluginDirectory = new File(pluginsDirectory, pluginFileNames[i]); if (FileSystemManager.isDirectory(pluginDirectory)) { Logger.defaultLogger().info("Attempting to load plugin directory : " + FileSystemManager.getDisplayPath(pluginDirectory)); File configFile = new File(pluginDirectory, FileSystemManager.getName(pluginDirectory) + ".properties"); Plugin plugin = null; try { plugin = instanciate(configFile); } catch (ApplicationException e) { Logger.defaultLogger().error("Error during plugin initialization.", e); } if (plugin != null) { register(plugin); Logger.defaultLogger().info("Plugin directory successfully loaded."); } else { Logger.defaultLogger().warn("Inconsistent plugin or not a plugin directory."); } } else { Logger.defaultLogger().error("Invalid plugin data : " + FileSystemManager.getName(pluginDirectory) + ". Only directories named after the plugin they contain are expected in Areca's main plugins directory (" + pluginsDirectory + ")"); String name = FileSystemManager.getName(pluginDirectory).toLowerCase(); if (name.endsWith(".zip") || name.endsWith(".gz") || name.endsWith(".7z") || name.endsWith(".tar")) { Logger.defaultLogger().error(name + " seems to be an archive. If you downloaded this file as a plugin for Areca, you should probably unzip it."); } } } } } public void register(Plugin plugin) { this.plugins.put(plugin.getId(), plugin); Logger.defaultLogger().info("Plugin successfully registered : " + plugin.toString()); } private Plugin instanciate(File configFile) throws ApplicationException { try { if (FileSystemManager.exists(configFile)) { Logger.defaultLogger().info("Reading plugin configuration file : " + FileSystemManager.getDisplayPath(configFile)); // Read plugin config file InputStream is = null; Properties props = new Properties(); try { is = FileSystemManager.getFileInputStream(configFile); props.load(is); } catch (IOException e) { Logger.defaultLogger().error(e); } finally { if (is != null) { try { is.close(); } catch (IOException e) { Logger.defaultLogger().error(e); } } } // Build class loader File rootDir = FileSystemManager.getParentFile(configFile); String classpath = props.getProperty(KEY_JAR_PATH); ArrayList jars = new ArrayList(); StringTokenizer stt = new StringTokenizer(classpath, SEPARATOR); while (stt.hasMoreTokens()) { String jar = stt.nextToken(); jars.add(jar); } // Also add the parent directory jars.add("/"); URL[] urls = new URL[jars.size()]; for (int i=0; i<urls.length; i++) { String path = (String)jars.get(i); // Load Jar File jarFile = new File(rootDir, path); Logger.defaultLogger().info("Loading jar file : " + FileSystemManager.getDisplayPath(jarFile)); urls[i] = new URL("file:" + FileSystemManager.getAbsolutePath(jarFile)); } ClassLoader cl = new URLClassLoader(urls); // Load main class String mainClass = props.getProperty(KEY_CLASS); Logger.defaultLogger().info("Instanciating class : " + mainClass); Class pluginClass = cl.loadClass(mainClass); Plugin plugin = (Plugin)pluginClass.newInstance(); plugin.setClassLoader(cl); plugin.setPath(FileSystemManager.getAbsolutePath(rootDir)); return plugin; } else { Logger.defaultLogger().info("Plugin configuration file not found."); return null; } } catch (Throwable e) { Logger.defaultLogger().error(e); throw new ApplicationException(e); } } public Collection getAll(Class implementedInterface, boolean ordered) { List ret = new ArrayList(); Iterator iter = this.plugins.values().iterator(); while (iter.hasNext()) { Object plugin = iter.next(); if (implementedInterface.isAssignableFrom(plugin.getClass())) { ret.add(plugin); } } if (ordered) { Object[] content = ret.toArray(); Arrays.sort(content); ret = Arrays.asList(content); } return ret; } public Plugin getById(String id) { return (Plugin)this.plugins.get(id); } }
8,333
Java
.java
178
35.039326
254
0.610504
Tostis/areca
5
0
3
GPL-2.0
9/4/2024, 10:46:08 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
8,333
1,456,611
Lexer.java
zipwith_jacc/src/compiler/Lexer.java
// Copyright (c) Mark P Jones, OGI School of Science & Engineering // Subject to conditions of distribution and use; see LICENSE for details // April 24 2004 01:01 AM // package compiler; /** A framework for building lexical analyzers. * * Conventions: when a token has been recognized, save the integer * code for it in the variable `token' and any corresponding text, * if required, in the variable `textToken'. */ public abstract class Lexer extends Phase { protected int token; protected String lexemeText; /** Construct a lexical analysis phase with a specified diagnostic * handler. */ public Lexer(Handler handler) { super(handler); } /** Construct a lexical analysis phase, and specify which token * should be returned first. This feature is useful in programs * where an initial token is used to allow the same parser to be * used, in effect, with multiple start symbols. By loading the * firstToken with particular values, we can force the parser to * use different productions for the start symbol. * * For example, in a program that needs to parse exprs, stmts, * or files, all using elements from the same grammar, then we * might set up a start symbol with the following productions: * <pre> * start : PARSE_EXPR expr * | PARSE_STMT stmt * | PARSE_FILE file * ; * </pre> * To parse an expression, statement, or file, we just make sure * that our lexer is constructed using the appropriate firstToken: * <pre> * new Lexer(handler, PARSE_EXPR); * new Lexer(handler, PARSE_STMT); * new Lexer(handler, PARSE_FILE); * </pre> * We do not specify either a text or a position for this first * token, so a program using a Lexer should not attempt to read * or use those attributes of the first token. * * In an application where this feature is not required, the program * should just use: * <pre> * new Lexer(handler); * </pre> * and then invoke <code>nextToken()</code> to read the first input * token. */ public Lexer(Handler handler, int firstToken) { super(handler); token = firstToken; } /** Read the next token and return the corresponding integer code. * At the same time, the function should set lexemeText to the text * of the lexeme (if relevant), and should be prepared to respond * to a getPos request with the position at which the token began. * This function should not normally be called again after an end * of input token has been returned. */ public abstract int nextToken(); /** Returns the code for the current token. */ public int getToken() { return token; } /** Returns the text (if any) for the current lexeme. */ public String getLexeme() { return lexemeText; } /** Return a position describing where the current token was * found. This method is abstract because different types * of lexer will need to return different types of source * position depending on how they get their input. */ public abstract Position getPos(); /** Test for a particular next token code. */ public boolean match(int token) { if (token==this.token) { nextToken(); return true; } return false; } /** Close this lexer. Calling this method signals that this * lexer will not be used again, and allows the implementation * to free up any resources that it might be holding such as * files, input streams, etc. */ public abstract void close(); }
3,801
Java
.java
99
32.727273
73
0.656013
zipwith/jacc
25
5
2
GPL-3.0
9/4/2024, 7:52:21 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
3,801
1,319,601
A_test568.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/locals_out/A_test568.java
package locals_out; public class A_test568 { public void foo() { String[] args[]= null; extracted(args); } protected void extracted(String[][] args) { /*[*/for (int i = 0; i < args.length; i++) { args[i]= null; }/*]*/ } }
240
Java
.java
12
17.5
46
0.604444
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
240
1,320,232
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/testStaticImports1/out/A.java
package p; import static java.lang.Math.cos; class A<T>{ void x(T t){} protected void m(T s) {double d= cos(0);} }
120
Java
.java
6
18.166667
42
0.678571
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
120
2,641,971
OneshotSupplier.java
luanon404_awChromium/aw_chromium/src/main/java/org/chromium/base/supplier/OneshotSupplier.java
// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.base.supplier; import androidx.annotation.Nullable; import org.chromium.base.Callback; /** * OneshotSupplier wraps an asynchronously provided, non-null object {@code T}, notifying * observers a single time when the dependency becomes available. Note that null is the un-set * value; a fulfilled supplier will never have a null underlying value. * * <p>This allows classes dependent on {@code T} to be provided with a * OneshotSupplier during construction and register a {@code Callback<T>} to be notified when the * needed dependency is available, but without the need to un-register that Callback upon * destruction. Contrast to {@link ObservableSupplier}, which requires un-registration to prevent * post-destruction callback invocation because the object can change an arbitrary number of times. * * * <p>This class must only be accessed from a single thread. Unless a particular thread designation * is given by the owner of the OneshotSupplier, clients should assume it must only be accessed on * the UI thread. * * <p>If you want to create a supplier, see an implementation in {@link OneshotSupplierImpl}. * * <p>For classes using a OneshotSupplier to receive a dependency: * <ul> * <li>To be notified when the object is available, call {@link #onAvailable(Callback)}. * <li>If the object is already available, the Callback will be posted immediately on the handler * for the thread the supplier was created on. * <li>The object held by this supplier will also be returned at the end of {@link * #onAvailable(Callback)}. * <li>The Callback will be called at most once. It's still * recommended to use {@link org.chromium.base.CallbackController} for safety. * </ul> * * @param <T> The type of the wrapped object. */ public interface OneshotSupplier<T> extends Supplier<T> { /** * Add a callback that's called when the object owned by this supplier is available. * If the object is already available, the callback will be called at the end of the * current message loop. * * @param callback The callback to be called. * @return The value for this supplier if already available. Null otherwise. */ @Nullable T onAvailable(Callback<T> callback); }
2,414
Java
.java
49
46.612245
100
0.752647
luanon404/awChromium
7
3
0
GPL-3.0
9/4/2024, 9:53:43 PM (Europe/Amsterdam)
true
true
true
true
true
true
true
true
2,414
1,318,819
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test_secondary_7/in/A.java
package p; import q.S; import q.T; public class A { S s= new S(); T t= new T(); class B { public B(){ Secondary sec= new Secondary(); sec.f(s); } } } final class Secondary { void f(S s){ } }
211
Java
.java
17
10.235294
34
0.610526
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
211
12,659
InputAstTreeStringPrinterPrintBranch.java
checkstyle_checkstyle/src/test/resources/com/puppycrawl/tools/checkstyle/asttreestringprinter/InputAstTreeStringPrinterPrintBranch.java
package com.puppycrawl.tools.checkstyle.asttreestringprinter; public class InputAstTreeStringPrinterPrintBranch { int variable = 10; }
140
Java
.java
4
32.75
61
0.851852
checkstyle/checkstyle
8,277
3,649
906
LGPL-2.1
9/4/2024, 7:04:55 PM (Europe/Amsterdam)
false
false
false
true
true
false
true
true
140
1,320,301
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test22/out/A.java
package p; class SuperA{ public void m() { } } class A extends SuperA{ public void m() { } } class B extends A{ } class B1 extends A{ public void foo(){ A a= null; a.m(); } }
185
Java
.java
17
9.294118
23
0.654762
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
185
1,316,372
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/DelegateCreator/testf08/in/A.java
package p; public class A { static String foo; }
52
Java
.java
4
11.25
19
0.76087
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
52
3,595,071
AnimatedMoveViewJob.java
letolab_LETO-Toggl_Android/MPChartLib/src/main/java/com/github/mikephil/charting/jobs/AnimatedMoveViewJob.java
package com.github.mikephil.charting.jobs; import android.animation.ValueAnimator; import android.annotation.SuppressLint; import android.view.View; import com.github.mikephil.charting.utils.ObjectPool; import com.github.mikephil.charting.utils.Transformer; import com.github.mikephil.charting.utils.ViewPortHandler; /** * Created by Philipp Jahoda on 19/02/16. */ @SuppressLint("NewApi") public class AnimatedMoveViewJob extends AnimatedViewPortJob { private static ObjectPool<AnimatedMoveViewJob> pool; static { pool = ObjectPool.create(4, new AnimatedMoveViewJob(null,0,0,null,null,0,0,0)); pool.setReplenishPercentage(0.5f); } public static AnimatedMoveViewJob getInstance(ViewPortHandler viewPortHandler, float xValue, float yValue, Transformer trans, View v, float xOrigin, float yOrigin, long duration){ AnimatedMoveViewJob result = pool.get(); result.mViewPortHandler = viewPortHandler; result.xValue = xValue; result.yValue = yValue; result.mTrans = trans; result.view = v; result.xOrigin = xOrigin; result.yOrigin = yOrigin; //result.resetAnimator(); result.animator.setDuration(duration); return result; } public static void recycleInstance(AnimatedMoveViewJob instance){ pool.recycle(instance); } public AnimatedMoveViewJob(ViewPortHandler viewPortHandler, float xValue, float yValue, Transformer trans, View v, float xOrigin, float yOrigin, long duration) { super(viewPortHandler, xValue, yValue, trans, v, xOrigin, yOrigin, duration); } @Override public void onAnimationUpdate(ValueAnimator animation) { pts[0] = xOrigin + (xValue - xOrigin) * phase; pts[1] = yOrigin + (yValue - yOrigin) * phase; mTrans.pointValuesToPixel(pts); mViewPortHandler.centerViewPort(pts, view); } public void recycleSelf(){ recycleInstance(this); } @Override protected ObjectPool.Poolable instantiate() { return new AnimatedMoveViewJob(null,0,0,null,null,0,0,0); } }
2,112
Java
.java
51
35.470588
183
0.725452
letolab/LETO-Toggl_Android
3
1
0
GPL-3.0
9/4/2024, 11:34:37 PM (Europe/Amsterdam)
true
true
true
true
true
true
true
true
2,112
5,100,346
TableBase.java
ggorsontanguy_pocHSQLDB/hsqldb-2.2.9/hsqldb/src/org/hsqldb/TableBase.java
/* Copyright (c) 2001-2011, The HSQL Development Group * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the HSQL Development Group nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG, * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.hsqldb; import org.hsqldb.HsqlNameManager.HsqlName; import org.hsqldb.error.Error; import org.hsqldb.error.ErrorCode; import org.hsqldb.index.Index; import org.hsqldb.lib.ArrayUtil; import org.hsqldb.navigator.RowIterator; import org.hsqldb.persist.PersistentStore; import org.hsqldb.types.Type; /** * The base of all HSQLDB table implementations. * * @author Fred Toussi (fredt@users dot sourceforge.net) * @version 2.2.7 * @since 1.7.2 */ public class TableBase { // types of table public static final int INFO_SCHEMA_TABLE = 1; public static final int SYSTEM_SUBQUERY = 2; public static final int TEMP_TABLE = 3; public static final int MEMORY_TABLE = 4; public static final int CACHED_TABLE = 5; public static final int TEMP_TEXT_TABLE = 6; public static final int TEXT_TABLE = 7; public static final int VIEW_TABLE = 8; public static final int RESULT_TABLE = 9; public static final int TRANSITION_TABLE = 10; public static final int FUNCTION_TABLE = 11; public static final int SYSTEM_TABLE = 12; public static final int CHANGE_SET_TABLE = 13; // public static final int SCOPE_STATEMENT = 21; public static final int SCOPE_TRANSACTION = 22; public static final int SCOPE_SESSION = 23; public static final int SCOPE_FULL = 24; // public PersistentStore store; public int persistenceScope; public long persistenceId; // columns in table int[] primaryKeyCols; // column numbers for primary key Type[] primaryKeyTypes; int[] primaryKeyColsSequence; // {0,1,2,...} // // Index[] indexList; // first index is the primary key index public Database database; int[] bestRowIdentifierCols; // column set for best index boolean bestRowIdentifierStrict; // true if it has no nullable column int[] bestIndexForColumn; // index of the 'best' index for each column Index bestIndex; // the best index overall - null if there is no user-defined index Index fullIndex; // index on all columns boolean[] colNotNull; // nullability Type[] colTypes; // types of columns protected int columnCount; // int tableType; protected boolean isReadOnly; protected boolean isTemp; protected boolean isCached; protected boolean isText; boolean isView; protected boolean isWithDataSource; public boolean isSessionBased; protected boolean isSchemaBased; protected boolean isLogged; private boolean isTransactional = true; boolean hasLobColumn; long dataTimestamp; // TableBase() {} // public TableBase(Session session, Database database, int scope, int type, Type[] colTypes) { tableType = type; persistenceScope = scope; isSessionBased = true; persistenceId = database.persistentStoreCollection.getNextId(); this.database = database; this.colTypes = colTypes; columnCount = colTypes.length; primaryKeyCols = new int[]{}; primaryKeyTypes = new Type[]{}; indexList = new Index[0]; createPrimaryIndex(primaryKeyCols, primaryKeyTypes, null); } public TableBase duplicate() { TableBase copy = new TableBase(); copy.tableType = tableType; copy.persistenceScope = persistenceScope; copy.isSessionBased = isSessionBased; copy.persistenceId = database.persistentStoreCollection.getNextId(); copy.database = database; copy.colTypes = colTypes; copy.columnCount = columnCount; copy.primaryKeyCols = primaryKeyCols; copy.primaryKeyTypes = primaryKeyTypes; copy.indexList = indexList; return copy; } public final int getTableType() { return tableType; } public long getPersistenceId() { return persistenceId; } int getId() { return 0; } public final boolean onCommitPreserve() { return persistenceScope == TableBase.SCOPE_SESSION; } public final RowIterator rowIterator(Session session) { PersistentStore store = getRowStore(session); return getPrimaryIndex().firstRow(session, store); } public final RowIterator rowIterator(PersistentStore store) { return getPrimaryIndex().firstRow(store); } public final int getIndexCount() { return indexList.length; } public final Index getPrimaryIndex() { return indexList.length > 0 ? indexList[0] : null; } public final Type[] getPrimaryKeyTypes() { return primaryKeyTypes; } public final boolean hasPrimaryKey() { return !(primaryKeyCols.length == 0); } public final int[] getPrimaryKey() { return primaryKeyCols; } /** * Returns an array of Type indicating the SQL type of the columns */ public final Type[] getColumnTypes() { return colTypes; } /** * Returns an index on all the columns */ public Index getFullIndex() { return fullIndex; } /** * Returns the Index object at the given index */ public final Index getIndex(int i) { return indexList[i]; } /** * Returns the indexes */ public final Index[] getIndexList() { return indexList; } /** * Returns empty boolean array. */ public final boolean[] getNewColumnCheckList() { return new boolean[getColumnCount()]; } /** * Returns the count of all visible columns. */ public int getColumnCount() { return columnCount; } /** * Returns the count of all columns. */ public final int getDataColumnCount() { return colTypes.length; } public boolean isTransactional() { return isTransactional; } public void setTransactional(boolean value) { isTransactional = value; } /** * This method is called whenever there is a change to table structure and * serves two porposes: (a) to reset the best set of columns that identify * the rows of the table (b) to reset the best index that can be used * to find rows of the table given a column value. * * (a) gives most weight to a primary key index, followed by a unique * address with the lowest count of nullable columns. Otherwise there is * no best row identifier. * * (b) finds for each column an index with a corresponding first column. * It uses any type of visible index and accepts the one with the largest * column count. * * bestIndex is the user defined, primary key, the first unique index, or * the first non-unique index. NULL if there is no user-defined index. * */ public final void setBestRowIdentifiers() { int[] briCols = null; int briColsCount = 0; boolean isStrict = false; int nNullCount = 0; // ignore if called prior to completion of primary key construction if (colNotNull == null) { return; } bestIndex = null; bestIndexForColumn = new int[colTypes.length]; ArrayUtil.fillArray(bestIndexForColumn, -1); for (int i = 0; i < indexList.length; i++) { Index index = indexList[i]; int[] cols = index.getColumns(); int colsCount = index.getColumnCount(); if (colsCount == 0) { continue; } if (i == 0) { isStrict = true; } if (bestIndexForColumn[cols[0]] == -1) { bestIndexForColumn[cols[0]] = i; } else { Index existing = indexList[bestIndexForColumn[cols[0]]]; if (colsCount > existing.getColumns().length) { bestIndexForColumn[cols[0]] = i; } } if (!index.isUnique()) { if (bestIndex == null) { bestIndex = index; } continue; } int nnullc = 0; for (int j = 0; j < colsCount; j++) { if (colNotNull[cols[j]]) { nnullc++; } } if (bestIndex != null) { bestIndex = index; } if (nnullc == colsCount) { if (briCols == null || briColsCount != nNullCount || colsCount < briColsCount) { // nothing found before || // found but has null columns || // found but has more columns than this index briCols = cols; briColsCount = colsCount; nNullCount = colsCount; isStrict = true; } continue; } else if (isStrict) { continue; } else if (briCols == null || colsCount < briColsCount || nnullc > nNullCount) { // nothing found before || // found but has more columns than this index|| // found but has fewer not null columns than this index briCols = cols; briColsCount = colsCount; nNullCount = nnullc; } } if (briCols == null || briColsCount == briCols.length) { bestRowIdentifierCols = briCols; } else { bestRowIdentifierCols = ArrayUtil.arraySlice(briCols, 0, briColsCount); } bestRowIdentifierStrict = isStrict; if (indexList[0].getColumnCount() > 0) { bestIndex = indexList[0]; } } public final void createPrimaryIndex(int[] pkcols, Type[] pktypes, HsqlName name) { long id = database.persistentStoreCollection.getNextId(); Index newIndex = database.logger.newIndex(name, id, this, pkcols, null, null, pktypes, true, pkcols.length > 0, pkcols.length > 0, false); try { addIndex(newIndex); } catch (HsqlException e) {} } public final Index createAndAddIndexStructure(HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward) { Index newindex = createIndexStructure(name, columns, descending, nullsLast, unique, constraint, forward); addIndex(newindex); return newindex; } final Index createIndexStructure(HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward) { if (primaryKeyCols == null) { throw Error.runtimeError(ErrorCode.U_S0500, "createIndex"); } int s = columns.length; int[] cols = new int[s]; Type[] types = new Type[s]; for (int j = 0; j < s; j++) { cols[j] = columns[j]; types[j] = colTypes[cols[j]]; } long id = database.persistentStoreCollection.getNextId(); Index newIndex = database.logger.newIndex(name, id, this, cols, descending, nullsLast, types, false, unique, constraint, forward); return newIndex; } /** * Performs Table structure modification and changes to the index nodes * to remove a given index from a MEMORY or TEXT table. Not for PK index. * */ public void dropIndex(int todrop) { indexList = (Index[]) ArrayUtil.toAdjustedArray(indexList, null, todrop, -1); for (int i = 0; i < indexList.length; i++) { indexList[i].setPosition(i); } setBestRowIdentifiers(); if (store != null) { store.resetAccessorKeys(indexList); } } final void addIndex(Index index) { int i = 0; for (; i < indexList.length; i++) { Index current = indexList[i]; int order = index.getIndexOrderValue() - current.getIndexOrderValue(); if (order < 0) { break; } } indexList = (Index[]) ArrayUtil.toAdjustedArray(indexList, index, i, 1); for (i = 0; i < indexList.length; i++) { indexList[i].setPosition(i); } if (store != null) { try { store.resetAccessorKeys(indexList); } catch (HsqlException e) { indexList = (Index[]) ArrayUtil.toAdjustedArray(indexList, null, index.getPosition(), -1); for (i = 0; i < indexList.length; i++) { indexList[i].setPosition(i); } throw e; } } setBestRowIdentifiers(); } final void removeIndex(int position) { setBestRowIdentifiers(); } public final void setIndexes(Index[] indexes) { this.indexList = indexes; } public final Object[] getEmptyRowData() { return new Object[getDataColumnCount()]; } /** * Create new memory-resident index. For MEMORY and TEXT tables. */ public final Index createIndex(Session session, HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward) { Index newIndex = createAndAddIndexStructure(name, columns, descending, nullsLast, unique, constraint, forward); return newIndex; } public void clearAllData(Session session) { PersistentStore store = getRowStore(session); store.removeAll(); } public void clearAllData(PersistentStore store) { store.removeAll(); } /** * @todo - this is wrong, as it returns true when table has no rows, * but not where it has rows that are not visible by session * Returns true if the table has any rows at all. */ public final boolean isEmpty(Session session) { if (getIndexCount() == 0) { return true; } PersistentStore store = getRowStore(session); return getIndex(0).isEmpty(store); } public PersistentStore getRowStore(Session session) { return store == null ? session.sessionData.persistentStoreCollection.getStore(this) : store; } public void setDataTimestamp(long timestamp) { // no op } }
17,056
Java
.java
442
29.497738
114
0.591531
ggorsontanguy/pocHSQLDB
1
0
3
GPL-3.0
9/5/2024, 12:41:22 AM (Europe/Amsterdam)
false
true
true
true
true
true
true
true
17,056
5,107,005
TransferListener.java
amaralDaniel_megaphone/Megaphone/async-http-client-master/client/src/main/java/org/asynchttpclient/handler/TransferListener.java
/* * Copyright (c) 2010-2012 Sonatype, Inc. All rights reserved. * * This program is licensed to you under the Apache License Version 2.0, * and you may not use this file except in compliance with the Apache License Version 2.0. * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0. * * Unless required by applicable law or agreed to in writing, * software distributed under the Apache License Version 2.0 is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under. */ package org.asynchttpclient.handler; import io.netty.handler.codec.http.HttpHeaders; /** * A simple interface an application can implements in order to received byte transfer information. */ public interface TransferListener { /** * Invoked when the request bytes are starting to get send. * * @param headers the headers */ void onRequestHeadersSent(HttpHeaders headers); /** * Invoked when the response bytes are starting to get received. * * @param headers the headers */ void onResponseHeadersReceived(HttpHeaders headers); /** * Invoked every time response's chunk are received. * * @param bytes a {@link byte[]} */ void onBytesReceived(byte[] bytes); /** * Invoked every time request's chunk are sent. * * @param amount The amount of bytes to transfer * @param current The amount of bytes transferred * @param total The total number of bytes transferred */ void onBytesSent(long amount, long current, long total); /** * Invoked when the response bytes are been fully received. */ void onRequestResponseCompleted(); /** * Invoked when there is an unexpected issue. * * @param t a {@link Throwable} */ void onThrowable(Throwable t); }
2,018
Java
.java
55
32.2
114
0.709826
amaralDaniel/megaphone
1
0
0
GPL-3.0
9/5/2024, 12:41:38 AM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
2,018
1,969,309
Builder.java
com-chain_biletujo/cordova_exchange_dist/plugins/de.appplant.cordova.plugin.local-notification/src/android/notification/Builder.java
/* * Copyright (c) 2013-2015 by appPlant UG. All rights reserved. * * @APPPLANT_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apache License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://opensource.org/licenses/Apache-2.0/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPPLANT_LICENSE_HEADER_END@ */ package de.appplant.cordova.plugin.notification; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.support.v4.app.NotificationCompat; import org.json.JSONObject; import java.util.Random; /** * Builder class for local notifications. Build fully configured local * notification specified by JSON object passed from JS side. */ public class Builder { // Application context passed by constructor private final Context context; // Notification options passed by JS private final Options options; // Receiver to handle the trigger event private Class<?> triggerReceiver; // Receiver to handle the clear event private Class<?> clearReceiver = ClearReceiver.class; // Activity to handle the click event private Class<?> clickActivity = ClickActivity.class; /** * Constructor * * @param context * Application context * @param options * Notification options */ public Builder(Context context, JSONObject options) { this.context = context; this.options = new Options(context).parse(options); } /** * Constructor * * @param options * Notification options */ public Builder(Options options) { this.context = options.getContext(); this.options = options; } /** * Set trigger receiver. * * @param receiver * Broadcast receiver */ public Builder setTriggerReceiver(Class<?> receiver) { this.triggerReceiver = receiver; return this; } /** * Set clear receiver. * * @param receiver * Broadcast receiver */ public Builder setClearReceiver(Class<?> receiver) { this.clearReceiver = receiver; return this; } /** * Set click activity. * * @param activity * Activity */ public Builder setClickActivity(Class<?> activity) { this.clickActivity = activity; return this; } /** * Creates the notification with all its options passed through JS. */ public Notification build() { Uri sound = options.getSoundUri(); int smallIcon = options.getSmallIcon(); int ledColor = options.getLedColor(); NotificationCompat.Builder builder; builder = new NotificationCompat.Builder(context) .setDefaults(0) .setContentTitle(options.getTitle()) .setContentText(options.getText()) .setNumber(options.getBadgeNumber()) .setTicker(options.getText()) .setAutoCancel(options.isAutoClear()) .setOngoing(options.isOngoing()) .setColor(options.getColor()); if (ledColor != 0) { builder.setLights(ledColor, 100, 100); } if (sound != null) { builder.setSound(sound); } if (smallIcon == 0) { builder.setSmallIcon(options.getIcon()); } else { builder.setSmallIcon(options.getSmallIcon()); builder.setLargeIcon(options.getIconBitmap()); } applyDeleteReceiver(builder); applyContentReceiver(builder); return new Notification(context, options, builder, triggerReceiver); } /** * Set intent to handle the delete event. Will clean up some persisted * preferences. * * @param builder * Local notification builder instance */ private void applyDeleteReceiver(NotificationCompat.Builder builder) { if (clearReceiver == null) return; Intent intent = new Intent(context, clearReceiver) .setAction(options.getIdStr()) .putExtra(Options.EXTRA, options.toString()); PendingIntent deleteIntent = PendingIntent.getBroadcast( context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); builder.setDeleteIntent(deleteIntent); } /** * Set intent to handle the click event. Will bring the app to * foreground. * * @param builder * Local notification builder instance */ private void applyContentReceiver(NotificationCompat.Builder builder) { if (clickActivity == null) return; Intent intent = new Intent(context, clickActivity) .putExtra(Options.EXTRA, options.toString()) .setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); int reqCode = new Random().nextInt(); PendingIntent contentIntent = PendingIntent.getActivity( context, reqCode, intent, PendingIntent.FLAG_UPDATE_CURRENT); builder.setContentIntent(contentIntent); } }
5,805
Java
.java
166
28.072289
77
0.659768
com-chain/biletujo
10
2
8
AGPL-3.0
9/4/2024, 8:24:57 PM (Europe/Amsterdam)
false
true
true
true
true
true
true
true
5,805
1,315,421
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/SafeDeleteType/testFail8/in/A.java
package p; class A{ void m(){ new A(); } }
47
Java
.java
6
6.166667
10
0.560976
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
47
2,924,668
CompletionParserTestKeyword.java
maxeler_eclipse/eclipse.jdt.core/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTestKeyword.java
/******************************************************************************* * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.core.tests.compiler.parser; import junit.framework.Test; public class CompletionParserTestKeyword extends AbstractCompletionTest { public CompletionParserTestKeyword(String testName) { super(testName); } public static Test suite() { return buildAllCompliancesTestSuite(CompletionParserTestKeyword.class); } /* * Test for 'abstract' keyword. */ public void test0001(){ String str = "abst"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0002(){ String str = "abst zzz"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0003(){ String str = "package p;\n" + "abst"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0004(){ String str = "package p;\n" + "abst zzz"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0005(){ String str = "package p;\n" + "import yyy;\n" + "abst"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0006(){ String str = "package p;\n" + "import yyy;\n" + "abst zzz"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0007(){ String str = "package p;\n" + "import yyy;\n" + "public abst"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0008(){ String str = "package p;\n" + "import yyy;\n" + "public abst zzz"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0009(){ String str = "package p;\n" + "import yyy;\n" + "abstract abst"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0010(){ String str = "package p;\n" + "import yyy;\n" + "abstract abst zzz"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0011(){ String str = "package p;\n" + "import \n" + "abst"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnImport:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnImport:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0012(){ String str = "package p;\n" + "import yyy;\n" + "public class X {}\n" + "abst"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0013(){ String str = "package p;\n" + "import yyy;\n" + "public class X {}\n" + "abst zzz"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0014(){ String str = "package p;\n" + "import yyy;\n" + "final abst"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0015(){ String str = "package p;\n" + "public class X {\n" + " abst\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0016(){ String str = "package p;\n" + "public class X {\n" + " abst zzz\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0017(){ String str = "package p;\n" + "public class X {\n" + " public abst zzz\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0018(){ String str = "package p;\n" + "public class X {\n" + " final abst\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0019(){ String str = "package p;\n" + "public class X {\n" + " abstract abst\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0020(){ String str = "package p;\n" + "public class X {\n" + " static abst\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + " <clinit>() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0021_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " abst\n" + " }\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0021_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " abst\n" + " }\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:abst>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'abstract' keyword. */ public void test0022_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " abst zzz\n" + " }\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0022_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " abst zzz\n" + " }\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:abst>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'break' keyword. */ public void test0023_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " bre\n" + " }\n" + "}\n"; String completeBehind = "bre"; int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'break' keyword. */ public void test0023_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " bre\n" + " }\n" + "}\n"; String completeBehind = "bre"; int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:bre>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "bre"; String expectedReplacedSource = "bre"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:bre>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'break' keyword. */ public void test0024_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " for(int i; i < 10; i++) {\n" + " bre\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "bre"; int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'break' keyword. */ public void test0024_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " for(int i; i < 10; i++) {\n" + " bre\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "bre"; int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:bre>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "bre"; String expectedReplacedSource = "bre"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " int i;\n" + " {\n" + " <CompleteOnName:bre>;\n" + " }\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'case' keyword. */ public void test0025_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " cas\n" + " }\n" + "}\n"; String completeBehind = "cas"; int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'case' keyword. */ public void test0025_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " cas\n" + " }\n" + "}\n"; String completeBehind = "cas"; int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cas>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cas"; String expectedReplacedSource = "cas"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cas>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'case' keyword. */ public void test0026_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " switch(0) {\n" + " cas\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "cas"; int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'case' keyword. */ public void test0026_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " switch(0) {\n" + " cas\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "cas"; int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cas>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cas"; String expectedReplacedSource = "cas"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnKeyword:cas>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'catch' keyword. */ public void test0027_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'catch' keyword. */ public void test0027_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cat"; String expectedReplacedSource = "cat"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cat>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'catch' keyword. */ public void test0028_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {\n" + " } cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'catch' keyword. */ public void test0028_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {\n" + " } cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cat"; String expectedReplacedSource = "cat"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnKeyword:cat>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'class' keyword. */ public void test0029(){ String str = "cla"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "import <CompleteOnKeyword:cla>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0030(){ String str = "public cla"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "import <CompleteOnKeyword:cla>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0031(){ String str = "public final cla"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "import <CompleteOnKeyword:cla>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0032(){ String str = "public final cla X"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "import <CompleteOnKeyword:cla>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0033(){ String str = "public class X {\n" + " cla\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:cla>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0034(){ String str = "public class X {\n" + " public cla\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:cla>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0035(){ String str = "public class X {\n" + " public final cla\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:cla>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0036(){ String str = "public class X {\n" + " public final cla Y\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:cla>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:cla>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0037_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " cla\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0037_Method(){ String str = "public class X {\n" + " void foo() {\n" + " cla\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cla>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'class' keyword. */ public void test0038_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " final cla\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0038_Method(){ String str = "public class X {\n" + " void foo() {\n" + " final cla\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cla>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'class' keyword. */ public void test0039_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " final cla Y\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0039_Method(){ String str = "public class X {\n" + " void foo() {\n" + " final cla Y\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cla>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'continue' keyword. */ public void test0040_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " con\n" + " }\n" + "}\n"; String completeBehind = "con"; int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'continue' keyword. */ public void test0040_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " con\n" + " }\n" + "}\n"; String completeBehind = "con"; int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:con>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "con"; String expectedReplacedSource = "con"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:con>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'continue' keyword. */ public void test0041_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " for(int i; i < 5; i++) {\n" + " con\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "con"; int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'continue' keyword. */ public void test0041_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " for(int i; i < 5; i++) {\n" + " con\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "con"; int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:con>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "con"; String expectedReplacedSource = "con"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " int i;\n" + " {\n" + " <CompleteOnName:con>;\n" + " }\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'default' keyword. */ public void test0042_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " def\n" + " }\n" + "}\n"; String completeBehind = "def"; int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'default' keyword. */ public void test0042_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " def\n" + " }\n" + "}\n"; String completeBehind = "def"; int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:def>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "def"; String expectedReplacedSource = "def"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:def>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'default' keyword. */ public void test0043_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " switch(0) {\n" + " case 1 : break;\n" + " def\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "def"; int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'default' keyword. */ public void test0043_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " switch(0) {\n" + " case 1 : break;\n" + " def\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "def"; int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:def>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "def"; String expectedReplacedSource = "def"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " {\n" + " <CompleteOnName:def>;\n" + " }\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'do' keyword. */ public void test0044_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " do\n" + " }\n" + "}\n"; String completeBehind = "do"; int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'do' keyword. */ public void test0044_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " do\n" + " }\n" + "}\n"; String completeBehind = "do"; int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:do>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "do"; String expectedReplacedSource = "do"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:do>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'else' keyword. */ public void test0045_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " els\n" + " }\n" + "}\n"; String completeBehind = "els"; int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'else' keyword. */ public void test0045_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " els\n" + " }\n" + "}\n"; String completeBehind = "els"; int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:els>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "els"; String expectedReplacedSource = "els"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:els>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'else' keyword. */ public void test0046_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " if(true) {\n" + " } els\n" + " }\n" + "}\n"; String completeBehind = "els"; int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'else' keyword. */ public void test0046_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " if(true) {\n" + " } els\n" + " }\n" + "}\n"; String completeBehind = "els"; int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:els>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "els"; String expectedReplacedSource = "els"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:els>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'extends' keyword. */ public void test0047(){ String str = "ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "import <CompleteOnKeyword:ext>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0048(){ String str = "X ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = ""; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0049(){ String str = "ext Y"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "import <CompleteOnKeyword:ext>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0050(){ String str = "class X ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:ext> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0051(){ String str = "class X ext Y"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:ext> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0052(){ String str = "class X ext Y {"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:ext> {\n" + " {\n" + " }\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0053(){ String str = "class X extends Y ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:ext> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0054(){ String str = "class X implements Y ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X implements Y {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0055_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0055_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:fin>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'finally' keyword. */ public void test0056_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0056_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnKeyword:fin>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'for' keyword. */ public void test0057_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " for" + " }\n" + "}\n"; String completeBehind = "for"; int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'for' keyword. */ public void test0057_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " for" + " }\n" + "}\n"; String completeBehind = "for"; int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:for>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "for"; String expectedReplacedSource = "for"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:for>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'if' keyword. */ public void test0058_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " if" + " }\n" + "}\n"; String completeBehind = "if"; int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'if' keyword. */ public void test0058_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " if" + " }\n" + "}\n"; String completeBehind = "if"; int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:if>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "if"; String expectedReplacedSource = "if"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:if>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'switch' keyword. */ public void test0059_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " swi" + " }\n" + "}\n"; String completeBehind = "swi"; int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'switch' keyword. */ public void test0059_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " swi" + " }\n" + "}\n"; String completeBehind = "swi"; int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:swi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "swi"; String expectedReplacedSource = "swi"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:swi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'implements' keyword. */ public void test0060(){ String str = "impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "import <CompleteOnKeyword:impl>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0061(){ String str = "X impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = ""; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0062(){ String str = "impl Y"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "import <CompleteOnKeyword:impl>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0063(){ String str = "class X impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:impl> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0064(){ String str = "class X impl Y"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:impl> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0065(){ String str = "class X impl Y {"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:impl> {\n" + " {\n" + " }\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0066(){ String str = "class X extends Y impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:impl> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0067(){ String str = "class X implements Y impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X implements Y {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'import' keyword. */ public void test0068(){ String str = "impo"; String completeBehind = "impo"; int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impo"; String expectedReplacedSource = "impo"; String expectedUnitDisplayString = "import <CompleteOnKeyword:impo>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'import' keyword. */ public void test0069(){ String str = "package p;\n" + "impo"; String completeBehind = "impo"; int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impo"; String expectedReplacedSource = "impo"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnKeyword:impo>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'import' keyword. */ public void test0070(){ String str = "package p;\n" + "import p2.Y;\n" + "impo"; String completeBehind = "impo"; int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impo"; String expectedReplacedSource = "impo"; String expectedUnitDisplayString = "package p;\n" + "import p2.Y;\n" + "import <CompleteOnKeyword:impo>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'import' keyword. */ public void test0071(){ String str = "impo p2.Y"; String completeBehind = "impo"; int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impo"; String expectedReplacedSource = "impo"; String expectedUnitDisplayString = "import <CompleteOnKeyword:impo>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0072(){ String str = "int"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0073(){ String str = "public int"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0074(){ String str = "public abstract int"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0075(){ String str = "public abstract int X"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0076(){ String str = "public class X {\n" + " int\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:int>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0077(){ String str = "public class X {\n" + " public int\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:int>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0078(){ String str = "public class X {\n" + " public abstract int\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:int>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0079(){ String str = "public class X {\n" + " public abstract int Y\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:int>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:int>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0080_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " int\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0080_Method(){ String str = "public class X {\n" + " void foo() {\n" + " int\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:int>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'interface' keyword. */ public void test0081_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " abstract int\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0081_Method(){ String str = "public class X {\n" + " void foo() {\n" + " abstract int\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:int>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'interface' keyword. */ public void test0082_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " abstract int Y\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0082_Method(){ String str = "public class X {\n" + " void foo() {\n" + " abstract int Y\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:int>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'interface' keyword. */ public void test0083(){ String str = "public final int"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0084(){ String str = "public final int X"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0085(){ String str = "pac"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pac>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0086(){ String str = "pac p"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pac>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0087(){ String str = "package p;" + "pac"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnKeyword:pac>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0088(){ String str = "import p;" + "pac"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "import p;\n" + "import <CompleteOnKeyword:pac>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0089(){ String str = "class X {}" + "pac"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pac>;\n" + "class X {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'return' keyword. */ public void test0090_Diet(){ String str = "public class X {\n" + " int foo() {\n" + " ret\n" + " }\n" + "}"; String completeBehind = "ret"; int cursorLocation = str.lastIndexOf("ret") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " int foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'return' keyword. */ public void test0090_Method(){ String str = "public class X {\n" + " int foo() {\n" + " ret\n" + " }\n" + "}"; String completeBehind = "ret"; int cursorLocation = str.lastIndexOf("ret") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ret>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ret"; String expectedReplacedSource = "ret"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " int foo() {\n" + " <CompleteOnName:ret>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'throw' keyword. */ public void test0091_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throw' keyword. */ public void test0091_Method(){ String str = "public class X {\n" + " void foo() {\n" + " thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:thr>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'try' keyword. */ public void test0092_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " try\n" + " }\n" + "}"; String completeBehind = "try"; int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'try' keyword. */ public void test0092_Method(){ String str = "public class X {\n" + " void foo() {\n" + " try\n" + " }\n" + "}"; String completeBehind = "try"; int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:try>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "try"; String expectedReplacedSource = "try"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:try>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'try' keyword. */ public void test0093_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " if(try\n" + " }\n" + "}"; String completeBehind = "try"; int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'try' keyword. */ public void test0093_Method(){ String str = "public class X {\n" + " void foo() {\n" + " if(try\n" + " }\n" + "}"; String completeBehind = "try"; int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:try>"; String expectedParentNodeToString = "if (<CompleteOnName:try>)\n ;"; String completionIdentifier = "try"; String expectedReplacedSource = "try"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:try>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'do' keyword. */ public void test0094_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " if(do\n" + " }\n" + "}"; String completeBehind = "do"; int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'do' keyword. */ public void test0094_Method(){ String str = "public class X {\n" + " void foo() {\n" + " if(do\n" + " }\n" + "}"; String completeBehind = "do"; int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:do>"; String expectedParentNodeToString = "if (<CompleteOnName:do>)\n ;"; String completionIdentifier = "do"; String expectedReplacedSource = "do"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:do>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'for' keyword. */ public void test0095_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " if(for\n" + " }\n" + "}"; String completeBehind = "for"; int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'for' keyword. */ public void test0095_Method(){ String str = "public class X {\n" + " void foo() {\n" + " if(for\n" + " }\n" + "}"; String completeBehind = "for"; int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:for>"; String expectedParentNodeToString = "if (<CompleteOnName:for>)\n ;"; String completionIdentifier = "for"; String expectedReplacedSource = "for"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:for>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'if' keyword. */ public void test0096_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " if(if\n" + " }\n" + "}"; String completeBehind = "if"; int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'if' keyword. */ public void test0096_Method(){ String str = "public class X {\n" + " void foo() {\n" + " if(if\n" + " }\n" + "}"; String completeBehind = "if"; int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:if>"; String expectedParentNodeToString = "if (<CompleteOnName:if>)\n ;"; String completionIdentifier = "if"; String expectedReplacedSource = "if"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:if>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'switch' keyword. */ public void test0097_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " if(swi\n" + " }\n" + "}"; String completeBehind = "swi"; int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'switch' keyword. */ public void test0097_Method(){ String str = "public class X {\n" + " void foo() {\n" + " if(swi\n" + " }\n" + "}"; String completeBehind = "swi"; int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:swi>"; String expectedParentNodeToString = "if (<CompleteOnName:swi>)\n ;"; String completionIdentifier = "swi"; String expectedReplacedSource = "swi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:swi>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'new' keyword. */ public void test0098_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " new\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'new' keyword. */ public void test0098_Method(){ String str = "public class X {\n" + " void foo() {\n" + " new\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:new>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "new"; String expectedReplacedSource = "new"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:new>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'new' keyword. */ public void test0099_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " new X\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'new' keyword. */ public void test0099_Method(){ String str = "public class X {\n" + " void foo() {\n" + " new X\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:new>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "new"; String expectedReplacedSource = "new"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:new>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'new' keyword. */ public void test0100_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " new X()\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'new' keyword. */ public void test0100_Method(){ String str = "public class X {\n" + " void foo() {\n" + " new X()\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:new>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "new"; String expectedReplacedSource = "new"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:new>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'throws' keyword. */ public void test0101(){ String str = "public class X {\n" + " void foo() thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0102(){ String str = "public class X {\n" + " void foo() thr {\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0103(){ String str = "public class X {\n" + " void foo() thr E {\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0104(){ String str = "public class X {\n" + " void foo() throws E thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() throws E {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0105(){ String str = "public class X {\n" + " X() thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " X() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0106(){ String str = "public class X {\n" + " int foo()[] thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " int[] foo() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'while' keyword. */ public void test0107_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'while' keyword. */ public void test0107_Method(){ String str = "public class X {\n" + " void foo() {\n" + " whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:whi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "whi"; String expectedReplacedSource = "whi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:whi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'while' keyword. */ public void test0108_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " if(whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'while' keyword. */ public void test0108_Method(){ String str = "public class X {\n" + " void foo() {\n" + " if(whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:whi>"; String expectedParentNodeToString = "if (<CompleteOnName:whi>)\n ;"; String completionIdentifier = "whi"; String expectedReplacedSource = "whi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:whi>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'assert' keyword. */ public void test0109_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " ass\n" + " }\n" + "}"; String completeBehind = "ass"; int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'assert' keyword. */ public void test0109_Method(){ String str = "public class X {\n" + " void foo() {\n" + " ass\n" + " }\n" + "}"; String completeBehind = "ass"; int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ass>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ass"; String expectedReplacedSource = "ass"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:ass>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'assert' keyword. */ public void test0110_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " if(ass\n" + " }\n" + "}"; String completeBehind = "ass"; int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'assert' keyword. */ public void test0110_Method(){ String str = "public class X {\n" + " void foo() {\n" + " if(ass\n" + " }\n" + "}"; String completeBehind = "ass"; int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ass>"; String expectedParentNodeToString = "if (<CompleteOnName:ass>)\n ;"; String completionIdentifier = "ass"; String expectedReplacedSource = "ass"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:ass>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'final' keyword. */ public void test0111(){ String str = "fin"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0112(){ String str = "public fin"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0113(){ String str = "fin zzz"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0114(){ String str = "final fin"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0115(){ String str = "abstract fin"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0116(){ String str = "public fin class X {}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n" + "class X {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0117(){ String str = "public class X {\n" + " fin\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0118(){ String str = "public class X {\n" + " public fin\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0119(){ String str = "public class X {\n" + " fin zzz\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0120(){ String str = "public class X {\n" + " final fin\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0121(){ String str = "public class X {\n" + " abstract fin\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0122(){ String str = "public class X {\n" + " nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0123(){ String str = "public class X {\n" + " public nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0124(){ String str = "public class X {\n" + " transient nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0125(){ String str = "public class X {\n" + " transient nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0126(){ String str = "public class X {\n" + " volatile nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0127(){ String str = "public class X {\n" + " str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0128(){ String str = "public class X {\n" + " public str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0129(){ String str = "public class X {\n" + " transient str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0130(){ String str = "public class X {\n" + " transient str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0131(){ String str = "public class X {\n" + " volatile str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0132(){ String str = "public class X {\n" + " vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0133(){ String str = "public class X {\n" + " public vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0134(){ String str = "public class X {\n" + " transient vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0135(){ String str = "public class X {\n" + " volatile vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0136(){ String str = "public class X {\n" + " native vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0137(){ String str = "public class X {\n" + " tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0138(){ String str = "public class X {\n" + " public tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0139(){ String str = "public class X {\n" + " transient tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0140(){ String str = "public class X {\n" + " volatile tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0141(){ String str = "public class X {\n" + " native tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0142(){ String str = "public class X {\n" + " syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0143(){ String str = "public class X {\n" + " public syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0144(){ String str = "public class X {\n" + " transient syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0145(){ String str = "public class X {\n" + " transient syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0146(){ String str = "public class X {\n" + " volatile syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0147_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " syn\n" + " }\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0147_Method(){ String str = "public class X {\n" + " void foo() {\n" + " syn\n" + " }\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:syn>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'synchronized' keyword. */ public void test0148_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " if(syn\n" + " }\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0148_Method(){ String str = "public class X {\n" + " void foo() {\n" + " if(syn\n" + " }\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:syn>"; String expectedParentNodeToString = "if (<CompleteOnName:syn>)\n ;"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:syn>)\n ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'static' keyword. */ public void test0149(){ String str = "public class X {\n" + " sta\n" + "}"; String completeBehind = "sta"; int cursorLocation = str.lastIndexOf("sta") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:sta>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "sta"; String expectedReplacedSource = "sta"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:sta>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'static' keyword. */ public void test0150(){ String str = "public class X {\n" + " public sta\n" + "}"; String completeBehind = "sta"; int cursorLocation = str.lastIndexOf("sta") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:sta>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "sta"; String expectedReplacedSource = "sta"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:sta>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0151(){ String str = "pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0152(){ String str = "final pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0153(){ String str = "public pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0154(){ String str = "private pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0155(){ String str = "public class X{}\n" + "pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0156(){ String str = "public class X{\n" + " pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0157(){ String str = "public class X{\n" + " public pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0158(){ String str = "public class X{\n" + " private pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0159(){ String str = "public class X{\n" + " protected pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0160(){ String str = "public class X{\n" + " abstract pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0161(){ String str = "pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = ""; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0162(){ String str = "final pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pro>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0163(){ String str = "public pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pro>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0164(){ String str = "private pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pro>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0165(){ String str = "public class X{}\n" + "pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pro>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0166(){ String str = "public class X{\n" + " pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0167(){ String str = "public class X{\n" + " public pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0168(){ String str = "public class X{\n" + " private pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0169(){ String str = "public class X{\n" + " protected pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0170(){ String str = "public class X{\n" + " abstract pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0171(){ String str = "pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = ""; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0172(){ String str = "final pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pri>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0173(){ String str = "public pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pri>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0174(){ String str = "private pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pri>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0175(){ String str = "public class X{}\n" + "pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pri>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0176(){ String str = "public class X{\n" + " pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0177(){ String str = "public class X{\n" + " public pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0178(){ String str = "public class X{\n" + " private pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0179(){ String str = "public class X{\n" + " protected pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0180(){ String str = "public class X{\n" + " abstract pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'super' keyword. */ public void test0181_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " sup\n" + " }\n" + "}\n"; String completeBehind = "sup"; int cursorLocation = str.lastIndexOf("sup") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'super' keyword. */ public void test0181_Method(){ String str = "public class X {\n" + " void foo(){\n" + " sup\n" + " }\n" + "}\n"; String completeBehind = "sup"; int cursorLocation = str.lastIndexOf("sup") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:sup>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "sup"; String expectedReplacedSource = "sup"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:sup>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'this' keyword. */ public void test0182_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " thi\n" + " }\n" + "}\n"; String completeBehind = "thi"; int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'this' keyword. */ public void test0182_Method(){ String str = "public class X {\n" + " void foo(){\n" + " thi\n" + " }\n" + "}\n"; String completeBehind = "thi"; int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:thi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thi"; String expectedReplacedSource = "thi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:thi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'true' keyword. */ public void test0183_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " tru\n" + " }\n" + "}\n"; String completeBehind = "tru"; int cursorLocation = str.lastIndexOf("tru") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'true' keyword. */ public void test0183_Method(){ String str = "public class X {\n" + " void foo(){\n" + " tru\n" + " }\n" + "}\n"; String completeBehind = "tru"; int cursorLocation = str.lastIndexOf("tru") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:tru>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tru"; String expectedReplacedSource = "tru"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:tru>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'false' keyword. */ public void test0184_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " fal\n" + " }\n" + "}\n"; String completeBehind = "fal"; int cursorLocation = str.lastIndexOf("fal") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'false' keyword. */ public void test0184_Method(){ String str = "public class X {\n" + " void foo(){\n" + " fal\n" + " }\n" + "}\n"; String completeBehind = "fal"; int cursorLocation = str.lastIndexOf("fal") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:fal>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fal"; String expectedReplacedSource = "fal"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:fal>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'null' keyword. */ public void test0185_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " nul\n" + " }\n" + "}\n"; String completeBehind = "nul"; int cursorLocation = str.lastIndexOf("nul") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'null' keyword. */ public void test0185_Method(){ String str = "public class X {\n" + " void foo(){\n" + " nul\n" + " }\n" + "}\n"; String completeBehind = "nul"; int cursorLocation = str.lastIndexOf("nul") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:nul>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nul"; String expectedReplacedSource = "nul"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:nul>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'instanceof' keyword. */ public void test0186_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " if(zzz ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'instanceof' keyword. */ public void test0186_Method(){ String str = "public class X {\n" + " void foo(){\n" + " if(zzz ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ins>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ins"; String expectedReplacedSource = "ins"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnKeyword:ins>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'instanceof' keyword. */ public void test0187_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'instanceof' keyword. */ public void test0187_Method(){ String str = "public class X {\n" + " void foo(){\n" + " ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ins>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ins"; String expectedReplacedSource = "ins"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:ins>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'instanceof' keyword. */ public void test0188_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " if(zzz zzz ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'instanceof' keyword. */ public void test0188_Method(){ String str = "public class X {\n" + " void foo(){\n" + " if(zzz zzz ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ins>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ins"; String expectedReplacedSource = "ins"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " zzz zzz;\n" + " <CompleteOnName:ins>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'while' keyword. */ public void test0189_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " do{\n" + " } whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'while' keyword. */ public void test0189_Method(){ String str = "public class X {\n" + " void foo() {\n" + " do{\n" + " } whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:whi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "whi"; String expectedReplacedSource = "whi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnKeyword:whi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'catch' keyword. */ public void test0190_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {\n" + " } catch(E e) {\n" + " } cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'catch' keyword. */ public void test0190_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {\n" + " } catch(E e) {\n" + " } cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cat"; String expectedReplacedSource = "cat"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cat>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'finally' keyword. */ public void test0191_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {" + " } catch(E e) {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0191_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {" + " } catch(E e) {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:fin>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'finally' keyword. */ public void test0192_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {" + " } finally {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0192_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " try {" + " } finally {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:fin>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'this' keyword. */ public void test0193_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " X.thi\n" + " }\n" + "}\n"; String completeBehind = "thi"; int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'this' keyword. */ public void test0193_Method(){ String str = "public class X {\n" + " void foo(){\n" + " X.thi\n" + " }\n" + "}\n"; String completeBehind = "thi"; int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:X.thi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thi"; String expectedReplacedSource = "X.thi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:X.thi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// /* * Test for 'abstract' keyword. */ public void test0194(){ String str = "#\n" + "abst"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0195(){ String str = "#\n" + "abst zzz"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0196(){ String str = "#\n" + "package p;\n" + "abst"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0197(){ String str = "#\n" + "package p;\n" + "abst zzz"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0198(){ String str = "#\n" + "package p;\n" + "import yyy;\n" + "abst"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0199(){ String str = "#\n" + "package p;\n" + "import yyy;\n" + "abst zzz"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0200(){ String str = "#\n" + "package p;\n" + "import yyy;\n" + "public abst"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0201(){ String str = "#\n" + "package p;\n" + "import yyy;\n" + "public abst zzz"; String completeBehind = "abst"; int cursorLocation = str.indexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0202(){ String str = "#\n" + "package p;\n" + "import yyy;\n" + "abstract abst"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0203(){ String str = "#\n" + "package p;\n" + "import yyy;\n" + "abstract abst zzz"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0204(){ String str = "#\n" + "package p;\n" + "import \n" + "abst"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnImport:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnImport:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0205(){ String str = "#\n" + "package p;\n" + "import yyy;\n" + "public class X {}\n" + "abst"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0206(){ String str = "#\n" + "package p;\n" + "import yyy;\n" + "public class X {}\n" + "abst zzz"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0207(){ String str = "#\n" + "package p;\n" + "import yyy;\n" + "final abst"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "import yyy;\n" + "import <CompleteOnKeyword:abst>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0208(){ String str = "#\n" + "package p;\n" + "public class X {\n" + " abst\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0209(){ String str = "#\n" + "package p;\n" + "public class X {\n" + " abst zzz\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0210(){ String str = "#\n" + "package p;\n" + "public class X {\n" + " public abst zzz\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0211(){ String str = "#\n" + "package p;\n" + "public class X {\n" + " final abst\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0212(){ String str = "#\n" + "package p;\n" + "public class X {\n" + " abstract abst\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0213(){ String str = "#\n" + "package p;\n" + "public class X {\n" + " static abst\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " <CompleteOnType:abst>;\n" + " public X() {\n" + " }\n" + " <clinit>() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0214_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " abst\n" + " }\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0214_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " abst\n" + " }\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:abst>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'abstract' keyword. */ public void test0216_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " abst zzz\n" + " }\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'abstract' keyword. */ public void test0216_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " abst zzz\n" + " }\n" + "}\n"; String completeBehind = "abst"; int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:abst>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "abst"; String expectedReplacedSource = "abst"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:abst>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'break' keyword. */ public void test0217_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " bre\n" + " }\n" + "}\n"; String completeBehind = "bre"; int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'break' keyword. */ public void test0217_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " bre\n" + " }\n" + "}\n"; String completeBehind = "bre"; int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:bre>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "bre"; String expectedReplacedSource = "bre"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:bre>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'break' keyword. */ public void test0218_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " for(int i; i < 10; i++) {\n" + " bre\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "bre"; int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'break' keyword. */ public void test0218_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " for(int i; i < 10; i++) {\n" + " bre\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "bre"; int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:bre>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "bre"; String expectedReplacedSource = "bre"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " int i;\n" + " {\n" + " <CompleteOnName:bre>;\n" + " }\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'case' keyword. */ public void test0219_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " cas\n" + " }\n" + "}\n"; String completeBehind = "cas"; int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'case' keyword. */ public void test0219_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " cas\n" + " }\n" + "}\n"; String completeBehind = "cas"; int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cas>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cas"; String expectedReplacedSource = "cas"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cas>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'case' keyword. */ public void test0220_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " switch(0) {\n" + " cas\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "cas"; int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'case' keyword. */ public void test0220_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " switch(0) {\n" + " cas\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "cas"; int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cas>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cas"; String expectedReplacedSource = "cas"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " {\n" + " <CompleteOnKeyword:cas>;\n" + " }\n"+ " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'catch' keyword. */ public void test0221_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'catch' keyword. */ public void test0221_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cat"; String expectedReplacedSource = "cat"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cat>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'catch' keyword. */ public void test0222_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {\n" + " } cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'catch' keyword. */ public void test0222_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {\n" + " } cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cat"; String expectedReplacedSource = "cat"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnKeyword:cat>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'class' keyword. */ public void test0223(){ String str = "#\n" + "cla"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "import <CompleteOnKeyword:cla>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0224(){ String str = "#\n" + "public cla"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "import <CompleteOnKeyword:cla>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0225(){ String str = "#\n" + "public final cla"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "import <CompleteOnKeyword:cla>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0226(){ String str = "#\n" + "public final cla X"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "import <CompleteOnKeyword:cla>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0227(){ String str = "#\n" + "public class X {\n" + " cla\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:cla>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0228(){ String str = "#\n" + "public class X {\n" + " public cla\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:cla>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0229(){ String str = "#\n" + "public class X {\n" + " public final cla\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:cla>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0230(){ String str = "#\n" + "public class X {\n" + " public final cla Y\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:cla>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:cla>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0231_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " cla\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0231_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " cla\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cla>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'class' keyword. */ public void test0232_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " final cla\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0232_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " final cla\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cla>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'class' keyword. */ public void test0233_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " final cla Y\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'class' keyword. */ public void test0233_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " final cla Y\n" + " }\n" + "}"; String completeBehind = "cla"; int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cla>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cla"; String expectedReplacedSource = "cla"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cla>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'continue' keyword. */ public void test0234_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " con\n" + " }\n" + "}\n"; String completeBehind = "con"; int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'continue' keyword. */ public void test0234_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " con\n" + " }\n" + "}\n"; String completeBehind = "con"; int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:con>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "con"; String expectedReplacedSource = "con"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:con>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'continue' keyword. */ public void test0235_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " for(int i; i < 5; i++) {\n" + " con\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "con"; int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'continue' keyword. */ public void test0235_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " for(int i; i < 5; i++) {\n" + " con\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "con"; int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:con>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "con"; String expectedReplacedSource = "con"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " int i;\n" + " {\n" + " <CompleteOnName:con>;\n" + " }\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'default' keyword. */ public void test0236_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " def\n" + " }\n" + "}\n"; String completeBehind = "def"; int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'default' keyword. */ public void test0236_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " def\n" + " }\n" + "}\n"; String completeBehind = "def"; int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:def>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "def"; String expectedReplacedSource = "def"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:def>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'default' keyword. */ public void test0237_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " switch(0) {\n" + " case 1 : break;\n" + " def\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "def"; int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'default' keyword. */ public void test0237_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " switch(0) {\n" + " case 1 : break;\n" + " def\n" + " }\n" + " }\n" + "}\n"; String completeBehind = "def"; int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:def>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "def"; String expectedReplacedSource = "def"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " {\n" + " <CompleteOnName:def>;\n" + " }\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'do' keyword. */ public void test0238_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " do\n" + " }\n" + "}\n"; String completeBehind = "do"; int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'do' keyword. */ public void test0238_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " do\n" + " }\n" + "}\n"; String completeBehind = "do"; int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:do>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "do"; String expectedReplacedSource = "do"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:do>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'else' keyword. */ public void test0239_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " els\n" + " }\n" + "}\n"; String completeBehind = "els"; int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'else' keyword. */ public void test0239_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " els\n" + " }\n" + "}\n"; String completeBehind = "els"; int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:els>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "els"; String expectedReplacedSource = "els"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:els>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'else' keyword. */ public void test0240_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " if(true) {\n" + " } els\n" + " }\n" + "}\n"; String completeBehind = "els"; int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'else' keyword. */ public void test0240_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " if(true) {\n" + " } els\n" + " }\n" + "}\n"; String completeBehind = "els"; int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:els>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "els"; String expectedReplacedSource = "els"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:els>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'extends' keyword. */ public void test0241(){ String str = "#\n" + "ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "import <CompleteOnKeyword:ext>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0242(){ String str = "#\n" + "X ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = ""; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0243(){ String str = "#\n" + "ext Y"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "import <CompleteOnKeyword:ext>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0244(){ String str = "#\n" + "class X ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:ext> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0245(){ String str = "#\n" + "class X ext Y"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:ext> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0246(){ String str = "#\n" + "class X ext Y {"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:ext> {\n" + " {\n" + " }\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0247(){ String str = "#\n" + "class X extends Y ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:ext> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'extends' keyword. */ public void test0248(){ String str = "#\n" + "class X implements Y ext"; String completeBehind = "ext"; int cursorLocation = str.lastIndexOf("ext") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ext"; String expectedReplacedSource = "ext"; String expectedUnitDisplayString = "class X implements Y {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0249_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0249_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:fin>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'finally' keyword. */ public void test0250_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0250_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnKeyword:fin>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'for' keyword. */ public void test0251_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " for" + " }\n" + "}\n"; String completeBehind = "for"; int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'for' keyword. */ public void test0251_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " for" + " }\n" + "}\n"; String completeBehind = "for"; int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:for>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "for"; String expectedReplacedSource = "for"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:for>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'if' keyword. */ public void test0252_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " if" + " }\n" + "}\n"; String completeBehind = "if"; int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'if' keyword. */ public void test0252_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " if" + " }\n" + "}\n"; String completeBehind = "if"; int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:if>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "if"; String expectedReplacedSource = "if"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:if>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'switch' keyword. */ public void test0253_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " swi" + " }\n" + "}\n"; String completeBehind = "swi"; int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'switch' keyword. */ public void test0253_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " swi" + " }\n" + "}\n"; String completeBehind = "swi"; int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:swi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "swi"; String expectedReplacedSource = "swi"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:swi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'implements' keyword. */ public void test0254(){ String str = "#\n" + "impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "import <CompleteOnKeyword:impl>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0255(){ String str = "#\n" + "X impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = ""; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0256(){ String str = "#\n" + "impl Y"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "import <CompleteOnKeyword:impl>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0257(){ String str = "#\n" + "class X impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:impl> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0258(){ String str = "#\n" + "class X impl Y"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:impl> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0259(){ String str = "#\n" + "class X impl Y {"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:impl> {\n" + " {\n" + " }\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0260(){ String str = "#\n" + "class X extends Y impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impl>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X extends <CompleteOnKeyword:impl> {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'implements' keyword. */ public void test0261(){ String str = "#\n" + "class X implements Y impl"; String completeBehind = "impl"; int cursorLocation = str.lastIndexOf("impl") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impl"; String expectedReplacedSource = "impl"; String expectedUnitDisplayString = "class X implements Y {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'import' keyword. */ public void test0262(){ String str = "#\n" + "impo"; String completeBehind = "impo"; int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impo"; String expectedReplacedSource = "impo"; String expectedUnitDisplayString = "import <CompleteOnKeyword:impo>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'import' keyword. */ public void test0263(){ String str = "#\n" + "package p;\n" + "impo"; String completeBehind = "impo"; int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impo"; String expectedReplacedSource = "impo"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnKeyword:impo>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'import' keyword. */ public void test0264(){ String str = "#\n" + "package p;\n" + "import p2.Y;\n" + "impo"; String completeBehind = "impo"; int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impo"; String expectedReplacedSource = "impo"; String expectedUnitDisplayString = "package p;\n" + "import p2.Y;\n" + "import <CompleteOnKeyword:impo>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'import' keyword. */ public void test0265(){ String str = "#\n" + "impo p2.Y"; String completeBehind = "impo"; int cursorLocation = str.lastIndexOf("impo") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:impo>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "impo"; String expectedReplacedSource = "impo"; String expectedUnitDisplayString = "import <CompleteOnKeyword:impo>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0266(){ String str = "#\n" + "int"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0267(){ String str = "#\n" + "public int"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0268(){ String str = "#\n" + "public abstract int"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0269(){ String str = "#\n" + "public abstract int X"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0270(){ String str = "#\n" + "public class X {\n" + " int\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:int>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0271(){ String str = "#\n" + "public class X {\n" + " public int\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:int>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0272(){ String str = "#\n" + "public class X {\n" + " public abstract int\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:int>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0273(){ String str = "#\n" + "public class X {\n" + " public abstract int Y\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:int>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:int>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0274_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " int\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0274_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " int\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:int>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'interface' keyword. */ public void test0275_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " abstract int\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0275_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " abstract int\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:int>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'interface' keyword. */ public void test0276_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " abstract int Y\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0276_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " abstract int Y\n" + " }\n" + "}"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:int>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'interface' keyword. */ public void test0277(){ String str = "#\n" + "public final int"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'interface' keyword. */ public void test0278(){ String str = "#\n" + "public final int X"; String completeBehind = "int"; int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:int>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "int"; String expectedReplacedSource = "int"; String expectedUnitDisplayString = "import <CompleteOnKeyword:int>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0279(){ String str = "#\n" + "pac"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pac>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0280(){ String str = "#\n" + "pac p"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pac>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0281(){ String str = "#\n" + "package p;" + "pac"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "package p;\n" + "import <CompleteOnKeyword:pac>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0282(){ String str = "#\n" + "import p;" + "pac"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "import p;\n" + "import <CompleteOnKeyword:pac>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'package' keyword. */ public void test0283(){ String str = "#\n" + "class X {}" + "pac"; String completeBehind = "pac"; int cursorLocation = str.lastIndexOf("pac") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pac>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pac"; String expectedReplacedSource = "pac"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pac>;\n" + "class X {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'return' keyword. */ public void test0284_Diet(){ String str = "public class X {\n" + " int foo() {\n" + " #\n" + " ret\n" + " }\n" + "}"; String completeBehind = "ret"; int cursorLocation = str.lastIndexOf("ret") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " int foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'return' keyword. */ public void test0284_Method(){ String str = "public class X {\n" + " int foo() {\n" + " #\n" + " ret\n" + " }\n" + "}"; String completeBehind = "ret"; int cursorLocation = str.lastIndexOf("ret") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ret>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ret"; String expectedReplacedSource = "ret"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " int foo() {\n" + " <CompleteOnName:ret>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'throw' keyword. */ public void test0285_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throw' keyword. */ public void test0285_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:thr>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'try' keyword. */ public void test0286_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " try\n" + " }\n" + "}"; String completeBehind = "try"; int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'try' keyword. */ public void test0286_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " try\n" + " }\n" + "}"; String completeBehind = "try"; int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:try>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "try"; String expectedReplacedSource = "try"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:try>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'try' keyword. */ public void test0287_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(try\n" + " }\n" + "}"; String completeBehind = "try"; int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'try' keyword. */ public void test0287_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(try\n" + " }\n" + "}"; String completeBehind = "try"; int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:try>"; String expectedParentNodeToString = "if (<CompleteOnName:try>)\n ;"; String completionIdentifier = "try"; String expectedReplacedSource = "try"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:try>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'do' keyword. */ public void test0288_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(do\n" + " }\n" + "}"; String completeBehind = "do"; int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'do' keyword. */ public void test0288_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(do\n" + " }\n" + "}"; String completeBehind = "do"; int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:do>"; String expectedParentNodeToString = "if (<CompleteOnName:do>)\n ;"; String completionIdentifier = "do"; String expectedReplacedSource = "do"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:do>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'for' keyword. */ public void test0289_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(for\n" + " }\n" + "}"; String completeBehind = "for"; int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'for' keyword. */ public void test0289_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(for\n" + " }\n" + "}"; String completeBehind = "for"; int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:for>"; String expectedParentNodeToString = "if (<CompleteOnName:for>)\n ;"; String completionIdentifier = "for"; String expectedReplacedSource = "for"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:for>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'if' keyword. */ public void test0290_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(if\n" + " }\n" + "}"; String completeBehind = "if"; int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'if' keyword. */ public void test0290_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(if\n" + " }\n" + "}"; String completeBehind = "if"; int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:if>"; String expectedParentNodeToString = "if (<CompleteOnName:if>)\n ;"; String completionIdentifier = "if"; String expectedReplacedSource = "if"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:if>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'switch' keyword. */ public void test0291_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(swi\n" + " }\n" + "}"; String completeBehind = "swi"; int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'switch' keyword. */ public void test0291_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(swi\n" + " }\n" + "}"; String completeBehind = "swi"; int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:swi>"; String expectedParentNodeToString = "if (<CompleteOnName:swi>)\n ;"; String completionIdentifier = "swi"; String expectedReplacedSource = "swi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:swi>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'new' keyword. */ public void test0292_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " new\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'new' keyword. */ public void test0292_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " new\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:new>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "new"; String expectedReplacedSource = "new"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:new>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'new' keyword. */ public void test0293_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " new X\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'new' keyword. */ public void test0293_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " new X\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:new>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "new"; String expectedReplacedSource = "new"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:new>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'new' keyword. */ public void test0294_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " new X()\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'new' keyword. */ public void test0294_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " new X()\n" + " }\n" + "}"; String completeBehind = "new"; int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:new>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "new"; String expectedReplacedSource = "new"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:new>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'throws' keyword. */ public void test0295(){ String str = "#\n" + "public class X {\n" + " void foo() thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0296(){ String str = "#\n" + "public class X {\n" + " void foo() thr {\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0297(){ String str = "#\n" + "public class X {\n" + " void foo() thr E {\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0298(){ String str = "#\n" + "public class X {\n" + " void foo() throws E thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() throws E {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0299(){ String str = "#\n" + "public class X {\n" + " X() thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " X() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'throws' keyword. */ public void test0300(){ String str = "#\n" + "public class X {\n" + " int foo()[] thr\n" + " }\n" + "}"; String completeBehind = "thr"; int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:thr>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thr"; String expectedReplacedSource = "thr"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " int[] foo() throws <CompleteOnKeyword:thr> {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'while' keyword. */ public void test0301_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'while' keyword. */ public void test0301_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:whi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "whi"; String expectedReplacedSource = "whi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:whi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'while' keyword. */ public void test0302_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'while' keyword. */ public void test0302_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:whi>"; String expectedParentNodeToString = "if (<CompleteOnName:whi>)\n ;"; String completionIdentifier = "whi"; String expectedReplacedSource = "whi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:whi>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'assert' keyword. */ public void test0303_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " ass\n" + " }\n" + "}"; String completeBehind = "ass"; int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'assert' keyword. */ public void test0303_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " ass\n" + " }\n" + "}"; String completeBehind = "ass"; int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ass>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ass"; String expectedReplacedSource = "ass"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:ass>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'assert' keyword. */ public void test0304_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(ass\n" + " }\n" + "}"; String completeBehind = "ass"; int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'assert' keyword. */ public void test0304_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(ass\n" + " }\n" + "}"; String completeBehind = "ass"; int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ass>"; String expectedParentNodeToString = "if (<CompleteOnName:ass>)\n ;"; String completionIdentifier = "ass"; String expectedReplacedSource = "ass"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:ass>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'final' keyword. */ public void test0305(){ String str = "#\n" + "fin"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0306(){ String str = "#\n" + "public fin"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0307(){ String str = "#\n" + "fin zzz"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0308(){ String str = "#\n" + "final fin"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0309(){ String str = "#\n" + "abstract fin"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0310(){ String str = "#\n" + "public fin class X {}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "import <CompleteOnKeyword:fin>;\n" + "class X {\n" + " X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0311(){ String str = "#\n" + "public class X {\n" + " fin\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0312(){ String str = "#\n" + "public class X {\n" + " public fin\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0313(){ String str = "#\n" + "public class X {\n" + " fin zzz\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>;"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0314(){ String str = "#\n" + "public class X {\n" + " final fin\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'final' keyword. */ public void test0315(){ String str = "#\n" + "public class X {\n" + " abstract fin\n" + "}"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:fin>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0316(){ String str = "#\n" + "public class X {\n" + " nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0317(){ String str = "#\n" + "public class X {\n" + " public nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0318(){ String str = "#\n" + "public class X {\n" + " transient nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0319(){ String str = "#\n" + "public class X {\n" + " transient nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'native' keyword. */ public void test0320(){ String str = "#\n" + "public class X {\n" + " volatile nat\n" + "}"; String completeBehind = "nat"; int cursorLocation = str.lastIndexOf("nat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:nat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nat"; String expectedReplacedSource = "nat"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:nat>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0321(){ String str = "#\n" + "public class X {\n" + " str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0322(){ String str = "#\n" + "public class X {\n" + " public str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0323(){ String str = "#\n" + "public class X {\n" + " transient str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0324(){ String str = "#\n" + "public class X {\n" + " transient str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'strictfp' keyword. */ public void test0325(){ String str = "#\n" + "public class X {\n" + " volatile str\n" + "}"; String completeBehind = "str"; int cursorLocation = str.lastIndexOf("str") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:str>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "str"; String expectedReplacedSource = "str"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:str>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0326(){ String str = "#\n" + "public class X {\n" + " vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0327(){ String str = "#\n" + "public class X {\n" + " public vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0328(){ String str = "#\n" + "public class X {\n" + " transient vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0329(){ String str = "#\n" + "public class X {\n" + " volatile vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'volatile' keyword. */ public void test0330(){ String str = "#\n" + "public class X {\n" + " native vol\n" + "}"; String completeBehind = "vol"; int cursorLocation = str.lastIndexOf("vol") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:vol>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "vol"; String expectedReplacedSource = "vol"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:vol>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0331(){ String str = "#\n" + "public class X {\n" + " tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0332(){ String str = "#\n" + "public class X {\n" + " public tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0333(){ String str = "#\n" + "public class X {\n" + " transient tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0334(){ String str = "#\n" + "public class X {\n" + " volatile tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'transient' keyword. */ public void test0335(){ String str = "#\n" + "public class X {\n" + " native tra\n" + "}"; String completeBehind = "tra"; int cursorLocation = str.lastIndexOf("tra") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:tra>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tra"; String expectedReplacedSource = "tra"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:tra>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0336(){ String str = "#\n" + "public class X {\n" + " syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0337(){ String str = "#\n" + "public class X {\n" + " public syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0338(){ String str = "#\n" + "public class X {\n" + " transient syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0339(){ String str = "#\n" + "public class X {\n" + " transient syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0340(){ String str = "#\n" + "public class X {\n" + " volatile syn\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:syn>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0341_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " syn\n" + " }\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0341_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " syn\n" + " }\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:syn>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:syn>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'synchronized' keyword. */ public void test0342_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(syn\n" + " }\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'synchronized' keyword. */ public void test0342_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " if(syn\n" + " }\n" + "}"; String completeBehind = "syn"; int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:syn>"; String expectedParentNodeToString = "if (<CompleteOnName:syn>)\n ;"; String completionIdentifier = "syn"; String expectedReplacedSource = "syn"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " if (<CompleteOnName:syn>)\n" + " ;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'static' keyword. */ public void test0343(){ String str = "#\n" + "public class X {\n" + " sta\n" + "}"; String completeBehind = "sta"; int cursorLocation = str.lastIndexOf("sta") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:sta>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "sta"; String expectedReplacedSource = "sta"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:sta>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'static' keyword. */ public void test0344(){ String str = "#\n" + "public class X {\n" + " public sta\n" + "}"; String completeBehind = "sta"; int cursorLocation = str.lastIndexOf("sta") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:sta>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "sta"; String expectedReplacedSource = "sta"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:sta>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0345(){ String str = "#\n" + "pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0346(){ String str = "#\n" + "final pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0347(){ String str = "#\n" + "public pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0348(){ String str = "#\n" + "private pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0349(){ String str = "#\n" + "public class X{}\n" + "pub"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pub>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0350(){ String str = "#\n" + "public class X{\n" + " pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0351(){ String str = "#\n" + "public class X{\n" + " public pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0352(){ String str = "#\n" + "public class X{\n" + " private pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0353(){ String str = "#\n" + "public class X{\n" + " protected pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'public' keyword. */ public void test0354(){ String str = "#\n" + "public class X{\n" + " abstract pub\n" + "}"; String completeBehind = "pub"; int cursorLocation = str.lastIndexOf("pub") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pub>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pub"; String expectedReplacedSource = "pub"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pub>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0355(){ String str = "#\n" + "pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = ""; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0356(){ String str = "#\n" + "final pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pro>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0357(){ String str = "#\n" + "public pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pro>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0358(){ String str = "#\n" + "private pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pro>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0359(){ String str = "#\n" + "public class X{}\n" + "pro"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pro>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0360(){ String str = "#\n" + "public class X{\n" + " pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0361(){ String str = "#\n" + "public class X{\n" + " public pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0362(){ String str = "#\n" + "public class X{\n" + " private pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0363(){ String str = "#\n" + "public class X{\n" + " protected pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'protected' keyword. */ public void test0364(){ String str = "#\n" + "public class X{\n" + " abstract pro\n" + "}"; String completeBehind = "pro"; int cursorLocation = str.lastIndexOf("pro") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pro>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pro"; String expectedReplacedSource = "pro"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pro>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0365(){ String str = "#\n" + "pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = ""; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0366(){ String str = "#\n" + "final pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pri>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0367(){ String str = "#\n" + "public pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pri>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0368(){ String str = "#\n" + "private pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pri>;\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0369(){ String str = "#\n" + "public class X{}\n" + "pri"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "import <CompleteOnKeyword:pri>;\n" + "public class X {\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0370(){ String str = "#\n" + "public class X{\n" + " pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0371(){ String str = "#\n" + "public class X{\n" + " public pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0372(){ String str = "#\n" + "public class X{\n" + " private pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0373(){ String str = "#\n" + "public class X{\n" + " protected pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'private' keyword. */ public void test0374(){ String str = "#\n" + "public class X{\n" + " abstract pri\n" + "}"; String completeBehind = "pri"; int cursorLocation = str.lastIndexOf("pri") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnType:pri>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "pri"; String expectedReplacedSource = "pri"; String expectedUnitDisplayString = "public class X {\n" + " <CompleteOnType:pri>;\n" + " public X() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'super' keyword. */ public void test0375_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " sup\n" + " }\n" + "}\n"; String completeBehind = "sup"; int cursorLocation = str.lastIndexOf("sup") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'super' keyword. */ public void test0375_Method(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " sup\n" + " }\n" + "}\n"; String completeBehind = "sup"; int cursorLocation = str.lastIndexOf("sup") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:sup>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "sup"; String expectedReplacedSource = "sup"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:sup>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'this' keyword. */ public void test0376_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " thi\n" + " }\n" + "}\n"; String completeBehind = "thi"; int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'this' keyword. */ public void test0376_Method(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " thi\n" + " }\n" + "}\n"; String completeBehind = "thi"; int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:thi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thi"; String expectedReplacedSource = "thi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:thi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'true' keyword. */ public void test0377_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " tru\n" + " }\n" + "}\n"; String completeBehind = "tru"; int cursorLocation = str.lastIndexOf("tru") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'true' keyword. */ public void test0377_Method(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " tru\n" + " }\n" + "}\n"; String completeBehind = "tru"; int cursorLocation = str.lastIndexOf("tru") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:tru>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "tru"; String expectedReplacedSource = "tru"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:tru>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'false' keyword. */ public void test0378_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " fal\n" + " }\n" + "}\n"; String completeBehind = "fal"; int cursorLocation = str.lastIndexOf("fal") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'false' keyword. */ public void test0378_Method(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " fal\n" + " }\n" + "}\n"; String completeBehind = "fal"; int cursorLocation = str.lastIndexOf("fal") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:fal>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fal"; String expectedReplacedSource = "fal"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:fal>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'null' keyword. */ public void test0379_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " nul\n" + " }\n" + "}\n"; String completeBehind = "nul"; int cursorLocation = str.lastIndexOf("nul") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'null' keyword. */ public void test0379_Method(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " nul\n" + " }\n" + "}\n"; String completeBehind = "nul"; int cursorLocation = str.lastIndexOf("nul") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:nul>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "nul"; String expectedReplacedSource = "nul"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:nul>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'instanceof' keyword. */ public void test0380_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " if(zzz ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'instanceof' keyword. */ public void test0380_Method(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " if(zzz ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:ins>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ins"; String expectedReplacedSource = "ins"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnKeyword:ins>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'instanceof' keyword. */ public void test0381_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'instanceof' keyword. */ public void test0381_Method(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ins>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ins"; String expectedReplacedSource = "ins"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:ins>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'instanceof' keyword. */ public void test0382_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " if(zzz zzz ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'instanceof' keyword. */ public void test0382_Method(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " if(zzz zzz ins\n" + " }\n" + "}\n"; String completeBehind = "ins"; int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:ins>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "ins"; String expectedReplacedSource = "ins"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " zzz zzz;\n" + " <CompleteOnName:ins>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'while' keyword. */ public void test0384_Diet(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " do{\n" + " } whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'while' keyword. */ public void test0384_Method(){ String str = "public class X {\n" + " void foo() {\n" + " #\n" + " do{\n" + " } whi\n" + " }\n" + "}"; String completeBehind = "whi"; int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnKeyword:whi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "whi"; String expectedReplacedSource = "whi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnKeyword:whi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'catch' keyword. */ public void test0385_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {\n" + " } catch(E e) {\n" + " } cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'catch' keyword. */ public void test0385_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {\n" + " } catch(E e) {\n" + " } cat\n" + " }\n" + "}\n"; String completeBehind = "cat"; int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:cat>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "cat"; String expectedReplacedSource = "cat"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:cat>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'finally' keyword. */ public void test0386_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {" + " } catch(E e) {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0386_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {" + " } catch(E e) {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:fin>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'finally' keyword. */ public void test0387_Diet(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {" + " } finally {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'finally' keyword. */ public void test0387_Method(){ String str = "package p;\n" + "public class X {\n" + " void foo(){\n" + " #\n" + " try {" + " } finally {" + " } fin" + " }\n" + "}\n"; String completeBehind = "fin"; int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:fin>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "fin"; String expectedReplacedSource = "fin"; String expectedUnitDisplayString = "package p;\n" + "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:fin>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } /* * Test for 'this' keyword. */ public void test0388_Diet(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " X.thi\n" + " }\n" + "}\n"; String completeBehind = "thi"; int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<NONE>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "<NONE>"; String expectedReplacedSource = "<NONE>"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " }\n" + "}\n"; checkDietParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "diet ast"); } /* * Test for 'this' keyword. */ public void test0388_Method(){ String str = "public class X {\n" + " void foo(){\n" + " #\n" + " X.thi\n" + " }\n" + "}\n"; String completeBehind = "thi"; int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1; String expectedCompletionNodeToString = "<CompleteOnName:X.thi>"; String expectedParentNodeToString = "<NONE>"; String completionIdentifier = "thi"; String expectedReplacedSource = "X.thi"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " void foo() {\n" + " <CompleteOnName:X.thi>;\n" + " }\n" + "}\n"; checkMethodParse( str.toCharArray(), cursorLocation, expectedCompletionNodeToString, expectedParentNodeToString, expectedUnitDisplayString, completionIdentifier, expectedReplacedSource, "full ast"); } }
407,469
Java
.java
15,765
23.238947
101
0.698064
maxeler/eclipse
5
4
3
EPL-1.0
9/4/2024, 10:35:19 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
407,469
3,412,335
HelpActivity.java
DAMWID_rterm/src/com/roiding/rterm/HelpActivity.java
package com.roiding.rterm; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; public class HelpActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act_help); String url = "file:///android_asset/help/help.htm"; WebView web = (WebView) findViewById(R.id.view_webview); web.loadUrl(url); web.computeScroll(); } }
459
Java
.java
15
28.4
58
0.789116
DAMWID/rterm
3
0
0
GPL-3.0
9/4/2024, 11:23:21 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
459
2,417,834
ModelAdapterSkeletonHorse.java
dotexe1337_bdsm-client-1_16/src/main/java/net/optifine/entity/model/ModelAdapterSkeletonHorse.java
package net.optifine.entity.model; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.UndeadHorseRenderer; import net.minecraft.client.renderer.entity.model.HorseModel; import net.minecraft.client.renderer.model.Model; import net.minecraft.entity.EntityType; public class ModelAdapterSkeletonHorse extends ModelAdapterHorse { public ModelAdapterSkeletonHorse() { super(EntityType.SKELETON_HORSE, "skeleton_horse", 0.75F); } public IEntityRenderer makeEntityRender(Model modelBase, float shadowSize) { EntityRendererManager entityrenderermanager = Minecraft.getInstance().getRenderManager(); UndeadHorseRenderer undeadhorserenderer = new UndeadHorseRenderer(entityrenderermanager); undeadhorserenderer.entityModel = (HorseModel)modelBase; undeadhorserenderer.shadowSize = shadowSize; return undeadhorserenderer; } }
989
Java
.java
22
40.545455
97
0.810166
dotexe1337/bdsm-client-1.16
8
1
1
GPL-2.0
9/4/2024, 9:22:36 PM (Europe/Amsterdam)
false
false
false
true
true
false
true
true
989
2,032,351
IJobHandler.java
ifeevel_xxl-job-mysql-oracle/xxl-job-core/src/main/java/com/xxl/job/core/handler/IJobHandler.java
package com.xxl.job.core.handler; import com.xxl.job.core.biz.model.ReturnT; import java.lang.reflect.InvocationTargetException; /** * job handler * * @author xuxueli 2015-12-19 19:06:38 */ public abstract class IJobHandler { /** success */ public static final ReturnT<String> SUCCESS = new ReturnT<String>(200, null); /** fail */ public static final ReturnT<String> FAIL = new ReturnT<String>(500, null); /** fail timeout */ public static final ReturnT<String> FAIL_TIMEOUT = new ReturnT<String>(502, null); /** * execute handler, invoked when executor receives a scheduling request * * @param param * @return * @throws Exception */ public abstract ReturnT<String> execute(String param) throws Exception; /** * init handler, invoked when JobThread init */ public void init() throws InvocationTargetException, IllegalAccessException { // do something } /** * destroy handler, invoked when JobThread destroy */ public void destroy() throws InvocationTargetException, IllegalAccessException { // do something } }
1,066
Java
.java
36
27.083333
83
0.749263
ifeevel/xxl-job-mysql-oracle
12
10
4
GPL-3.0
9/4/2024, 8:27:02 PM (Europe/Amsterdam)
false
false
false
true
true
false
true
true
1,066
2,055,232
RateTransposer.java
pterodactylus42_ccgt/app/src/main/java/be/tarsos/dsp/resample/RateTransposer.java
/* * _______ _____ _____ _____ * |__ __| | __ \ / ____| __ \ * | | __ _ _ __ ___ ___ ___| | | | (___ | |__) | * | |/ _` | '__/ __|/ _ \/ __| | | |\___ \| ___/ * | | (_| | | \__ \ (_) \__ \ |__| |____) | | * |_|\__,_|_| |___/\___/|___/_____/|_____/|_| * * ------------------------------------------------------------- * * TarsosDSP is developed by Joren Six at IPEM, University Ghent * * ------------------------------------------------------------- * * Info: http://0110.be/tag/TarsosDSP * Github: https://github.com/JorenSix/TarsosDSP * Releases: http://0110.be/releases/TarsosDSP/ * * TarsosDSP includes modified source code by various authors, * for credits and info, see README. * */ package be.tarsos.dsp.resample; import be.tarsos.dsp.AudioEvent; import be.tarsos.dsp.AudioProcessor; /** * Sample rate transposer. Changes sample rate by using interpolation * * Together with the time stretcher this can be used for pitch shifting. * @author Joren Six */ public class RateTransposer implements AudioProcessor { private double factor; private Resampler r; /** * Create a new sample rate transposer. The factor determines the new sample * rate. E.g. 0.5 is half the sample rate, 1.0 does not change a thing and * 2.0 doubles the samplerate. If the samples are played at the original * speed the pitch doubles (0.5), does not change (1.0) or halves (0.5) * respectively. Playback length follows the same rules, obviously. * * @param factor * Determines the new sample rate. E.g. 0.5 is half the sample * rate, 1.0 does not change a thing and 2.0 doubles the sample * rate. If the samples are played at the original speed the * pitch doubles (0.5), does not change (1.0) or halves (0.5) * respectively. Playback length follows the same rules, * obviously. */ public RateTransposer(double factor){ this.factor = factor; r= new Resampler(false,0.1,4.0); } public void setFactor(double tempo){ this.factor = tempo; } @Override public boolean process(AudioEvent audioEvent) { float[] src = audioEvent.getFloatBuffer(); //Creation of float array in loop could be prevented if src.length is known beforehand... //Possible optimization is to instantiate it outside the loop and get a pointer to the //array here, in the process method method. float[] out = new float[(int) (src.length * factor)]; r.process(factor, src, 0, src.length, false, out, 0, out.length); //The size of the output buffer changes (according to factor). audioEvent.setFloatBuffer(out); return true; } @Override public void processingFinished() { } }
2,851
Java
.java
72
36.222222
91
0.579652
pterodactylus42/ccgt
15
3
4
GPL-3.0
9/4/2024, 8:27:55 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
2,851
1,941,822
ParamGrid.java
GeekAbdelouahed_sign-language/openCVLibrary340/src/main/java/org/opencv/ml/ParamGrid.java
// // This file is auto-generated. Please don't modify it! // package org.opencv.ml; // C++: class ParamGrid //javadoc: ParamGrid public class ParamGrid { protected final long nativeObj; protected ParamGrid(long addr) { nativeObj = addr; } public long getNativeObjAddr() { return nativeObj; } // // C++: static Ptr_ParamGrid create(double minVal = 0., double maxVal = 0., double logstep = 1.) // //javadoc: ParamGrid::create(minVal, maxVal, logstep) public static ParamGrid create(double minVal, double maxVal, double logstep) { ParamGrid retVal = new ParamGrid(create_0(minVal, maxVal, logstep)); return retVal; } //javadoc: ParamGrid::create() public static ParamGrid create() { ParamGrid retVal = new ParamGrid(create_1()); return retVal; } // // C++: double ParamGrid::minVal // //javadoc: ParamGrid::get_minVal() public double get_minVal() { double retVal = get_minVal_0(nativeObj); return retVal; } // // C++: void ParamGrid::minVal // //javadoc: ParamGrid::set_minVal(minVal) public void set_minVal(double minVal) { set_minVal_0(nativeObj, minVal); return; } // // C++: double ParamGrid::maxVal // //javadoc: ParamGrid::get_maxVal() public double get_maxVal() { double retVal = get_maxVal_0(nativeObj); return retVal; } // // C++: void ParamGrid::maxVal // //javadoc: ParamGrid::set_maxVal(maxVal) public void set_maxVal(double maxVal) { set_maxVal_0(nativeObj, maxVal); return; } // // C++: double ParamGrid::logStep // //javadoc: ParamGrid::get_logStep() public double get_logStep() { double retVal = get_logStep_0(nativeObj); return retVal; } // // C++: void ParamGrid::logStep // //javadoc: ParamGrid::set_logStep(logStep) public void set_logStep(double logStep) { set_logStep_0(nativeObj, logStep); return; } @Override protected void finalize() throws Throwable { delete(nativeObj); } // C++: static Ptr_ParamGrid create(double minVal = 0., double maxVal = 0., double logstep = 1.) private static native long create_0(double minVal, double maxVal, double logstep); private static native long create_1(); // C++: double ParamGrid::minVal private static native double get_minVal_0(long nativeObj); // C++: void ParamGrid::minVal private static native void set_minVal_0(long nativeObj, double minVal); // C++: double ParamGrid::maxVal private static native double get_maxVal_0(long nativeObj); // C++: void ParamGrid::maxVal private static native void set_maxVal_0(long nativeObj, double maxVal); // C++: double ParamGrid::logStep private static native double get_logStep_0(long nativeObj); // C++: void ParamGrid::logStep private static native void set_logStep_0(long nativeObj, double logStep); // native support for java finalize() private static native void delete(long nativeObj); }
3,328
Java
.java
101
25.762376
100
0.6476
GeekAbdelouahed/sign-language
11
2
1
GPL-3.0
9/4/2024, 8:24:04 PM (Europe/Amsterdam)
false
true
true
true
true
true
true
true
3,328
4,579,269
TConTextureResourcePackBase.java
Zerek-Cheng_Zerek-Develop-Projects-For-Work/Avaritia-master/src/main/java/fox/spiteful/avaritia/compat/ticon/TConTextureResourcePackBase.java
// Original file by RWTema for Extra Utilities // Even though the rest of the mod is open, please don't use this class without Tema's permission package fox.spiteful.avaritia.compat.ticon; import com.google.common.base.Throwables; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.ObfuscationReflectionHelper; import fox.spiteful.avaritia.Lumberjack; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.*; import net.minecraft.client.resources.data.IMetadataSection; import net.minecraft.client.resources.data.IMetadataSerializer; import net.minecraft.util.ResourceLocation; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.awt.image.DirectColorModel; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Set; /** * Original class by RWTema for Extra Utilities */ public abstract class TConTextureResourcePackBase implements IResourcePack, IResourceManagerReloadListener { public static List<IResourcePack> packs; protected static DirectColorModel rgb = new DirectColorModel(32, 0x00ff0000, // Red 0x0000ff00, // Green 0x000000ff, // Blue 0xff000000 // Alpha ); protected final String name; public HashMap<ResourceLocation, byte[]> cachedImages = new HashMap<ResourceLocation, byte[]>(); protected IResourcePack delegate; protected List<IResourcePack> resourcePackz = null; public TConTextureResourcePackBase(String name) { this.name = name.toLowerCase(); this.delegate = FMLClientHandler.instance().getResourcePackFor("TConstruct"); } public int brightness(int col) { return brightness(rgb.getRed(col), rgb.getGreen(col), rgb.getBlue(col)); } public int brightness(int r, int g, int b) { return (int) (r * 0.2126F + g * 0.7152F + b * 0.0722F); } public void register() { List<IResourcePack> packs = getiResourcePacks(); packs.add(this); ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(this); Lumberjack.info("Registered TCon Resource Pack (" + name + ") - " + this.getClass().getSimpleName()); } public List<IResourcePack> getiResourcePacks() { List<IResourcePack> packs1 = packs; if (packs1 == null) packs1 = ObfuscationReflectionHelper.getPrivateValue(FMLClientHandler.class, FMLClientHandler.instance(), "resourcePackList"); return packs1; } public InputStream getStream(ResourceLocation location) { InputStream stream = null; for (IResourcePack iResourcePack : getPacks()) { if (iResourcePack.resourceExists(location)) { try { stream = iResourcePack.getInputStream(location); } catch (IOException ignore) { } } } return stream; } @SuppressWarnings("unchecked") public List<IResourcePack> getPacks() { if (resourcePackz == null) { resourcePackz = new ArrayList<IResourcePack>(); resourcePackz.add(delegate); List<ResourcePackRepository.Entry> t = Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries(); for (ResourcePackRepository.Entry entry : t) { IResourcePack resourcePack = entry.getResourcePack(); if (resourcePack.getResourceDomains().contains("tinker")) { resourcePackz.add(resourcePack); } } } return resourcePackz; } @Override public InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException { byte[] bytes = cachedImages.get(p_110590_1_); if (bytes == null) { ResourceLocation location = new ResourceLocation("tinker", p_110590_1_.getResourcePath().replace(name, "")); InputStream inputStream = getStream(location); if (inputStream == null) { location = new ResourceLocation("tinker", p_110590_1_.getResourcePath().replace(name, "iron")); inputStream = getStream(location); } if (inputStream == null) { location = new ResourceLocation("tinker", p_110590_1_.getResourcePath().replace(name, "stone")); inputStream = getStream(location); } if (inputStream == null) return delegate.getInputStream(p_110590_1_); BufferedImage bufferedimage; try { bufferedimage = ImageIO.read(inputStream); } catch (IOException err) { throw Throwables.propagate(err); } BufferedImage image; try { image = modifyImage(bufferedimage); } catch (Throwable t) { t.printStackTrace(); return delegate.getInputStream(location); } ByteArrayOutputStream stream = new ByteArrayOutputStream(); ImageIO.write(image, "PNG", stream); bytes = stream.toByteArray(); cachedImages.put(location, bytes); } return new ByteArrayInputStream(bytes); } public abstract BufferedImage modifyImage(BufferedImage image); @Override public boolean resourceExists(ResourceLocation p_110589_1_) { if (!"tinker".equals(p_110589_1_.getResourceDomain())) return false; String resourcePath = p_110589_1_.getResourcePath(); if (!(resourcePath.startsWith("textures/items/") && resourcePath.endsWith(".png"))) return false; if (delegate.resourceExists(p_110589_1_)) return false; if (!resourcePath.contains(name)) return false; return delegate.resourceExists(new ResourceLocation("tinker", resourcePath.replace(name, "stone"))) || delegate.resourceExists(new ResourceLocation("tinker", resourcePath.replace(name, "iron"))) || delegate.resourceExists(new ResourceLocation("tinker", resourcePath.replace(name, ""))); } @SuppressWarnings("rawtypes") @Override public Set getResourceDomains() { return delegate.getResourceDomains(); } @Override public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { return null; } @Override public BufferedImage getPackImage() throws IOException { return null; } @Override public String getPackName() { return "Avaritia_Delegate_Pack"; } @Override public void onResourceManagerReload(IResourceManager p_110549_1_) { cachedImages.clear(); resourcePackz = null; } private int[] colourarray = new int[4]; protected int colour(int r, int g, int b, int a) { colourarray[0] = r; colourarray[1] = g; colourarray[2] = b; colourarray[3] = a; return rgb.getDataElement(colourarray, 0); } }
7,290
Java
.java
170
34.217647
138
0.661418
Zerek-Cheng/Zerek-Develop-Projects-For-Work
2
1
0
GPL-3.0
9/5/2024, 12:18:11 AM (Europe/Amsterdam)
false
false
false
true
false
false
true
true
7,290
1,700,478
ReloadContextTestExecutionListener.java
geomajas_geomajas-project-server/testdata/src/main/java/org/geomajas/testdata/ReloadContextTestExecutionListener.java
/* * This is part of Geomajas, a GIS framework, http://www.geomajas.org/. * * Copyright 2008-2016 Geosparc nv, http://www.geosparc.com/, Belgium. * * The program is available in open source according to the GNU Affero * General Public License. All contributions in this program are covered * by the Geomajas Contributors License Agreement. For full licensing * details, see LICENSE.txt in the project root. */ package org.geomajas.testdata; import java.lang.reflect.Method; import org.geomajas.testdata.ReloadContext.ClassMode; import org.springframework.test.context.TestContext; import org.springframework.test.context.support.AbstractTestExecutionListener; import org.springframework.test.context.support.DependencyInjectionTestExecutionListener; /** * Execution listener that forces a context reload before the test method is executed on methods/classes annotated with * {@link ReloadContext}. * * WARNING: if used in conjunction with {@link DependencyInjectionTestExecutionListener}, the * {@link ReloadContextTestExecutionListener} should come first! * * @author Jan De Moerloose * */ public class ReloadContextTestExecutionListener extends AbstractTestExecutionListener { /** * Marks the {@link ApplicationContext application context} of the supplied {@link TestContext test context} as * {@link TestContext#markApplicationContextDirty() dirty}, and sets the * {@link DependencyInjectionTestExecutionListener#REINJECT_DEPENDENCIES_ATTRIBUTE REINJECT_DEPENDENCIES_ATTRIBUTE} * in the test context to <code>true</code> . */ protected void reloadContext(TestContext testContext) { testContext.markApplicationContextDirty(); testContext .setAttribute(DependencyInjectionTestExecutionListener.REINJECT_DEPENDENCIES_ATTRIBUTE, Boolean.TRUE); } /** * Forces context reload before test method if the annotation is present on the method or if the annotation is * present on the class and {@link ReloadContext.ClassMode} is set to <code>ClassMode.BEFORE_EACH_TEST_METHOD</code> * . */ @Override public void beforeTestMethod(TestContext testContext) throws Exception { Class<?> testClass = testContext.getTestClass(); Method testMethod = testContext.getTestMethod(); final Class<ReloadContext> annotationType = ReloadContext.class; boolean methodReloadContext = testMethod.isAnnotationPresent(annotationType); boolean classReloadContext = testClass.isAnnotationPresent(annotationType); ReloadContext classReloadContextAnnotation = testClass.getAnnotation(annotationType); ClassMode classMode = classReloadContext ? classReloadContextAnnotation.classMode() : null; if (methodReloadContext || (classReloadContext && classMode == ClassMode.BEFORE_EACH_TEST_METHOD)) { reloadContext(testContext); } } /** * Forces context reload before test method if the annotation is present on the class and * {@link ReloadContext.ClassMode} is set to <code>ClassMode.BEFORE_CLASS</code> . */ @Override public void beforeTestClass(TestContext testContext) throws Exception { Class<?> testClass = testContext.getTestClass(); final Class<ReloadContext> annotationType = ReloadContext.class; boolean reloadContext = testClass.isAnnotationPresent(ReloadContext.class); if (reloadContext) { ReloadContext reloadContextAnnotation = testClass.getAnnotation(annotationType); if (reloadContextAnnotation.classMode() == ClassMode.BEFORE_CLASS) { reloadContext(testContext); } } } }
3,467
Java
.java
73
44.890411
119
0.804431
geomajas/geomajas-project-server
13
13
1
AGPL-3.0
9/4/2024, 8:15:17 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
3,467
4,535,301
JsonAdapter.java
nadinCodeHat_MyDialog_14_1_1/sources/com/google/gson/annotations/JsonAdapter.java
package com.google.gson.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface JsonAdapter { Class<?> value(); }
339
Java
.java
10
32.3
46
0.831804
nadinCodeHat/MyDialog_14.1.1
2
1
0
GPL-2.0
9/5/2024, 12:16:26 AM (Europe/Amsterdam)
false
true
true
true
true
true
true
true
339
1,009,986
TopM.java
fracpete_princeton-java-algorithms/src/main/java/edu/princeton/cs/algorithms/TopM.java
package edu.princeton.cs.algorithms; import edu.princeton.cs.introcs.StdIn; import edu.princeton.cs.introcs.StdOut; /************************************************************************* * Compilation: javac TopM.java * Execution: java TopM M < input.txt * Dependencies: MinPQ.java Transaction.java StdIn.java StdOut.java * Data files: http://algs4.cs.princeton.edu/24pq/tinyBatch.txt * * Given an integer M from the command line and an input stream where * each line contains a String and a long value, this MinPQ client * prints the M lines whose numbers are the highest. * * % java TopM 5 < tinyBatch.txt * Thompson 2/27/2000 4747.08 * vonNeumann 2/12/1994 4732.35 * vonNeumann 1/11/1999 4409.74 * Hoare 8/18/1992 4381.21 * vonNeumann 3/26/2002 4121.85 * *************************************************************************/ /** * The <tt>TopM</tt> class provides a client that reads a sequence of * transactions from standard input and prints the <em>M</em> largest ones * to standard output. This implementation uses a {@link MinPQ} of size * at most <em>M</em> + 1 to identify the <em>M</em> largest transactions * and a {@link Stack} to output them in the proper order. * <p> * For additional documentation, see <a href="http://algs4.cs.princeton.edu/24pq">Section 2.4</a> * of <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne. * * @author Robert Sedgewick * @author Kevin Wayne */ public class TopM { // This class should not be instantiated. private TopM() { } /** * Reads a sequence of transactions from standard input; takes a * command-line integer M; prints to standard output the M largest * transactions in descending order. */ public static void main(String[] args) { int M = Integer.parseInt(args[0]); MinPQ<Transaction> pq = new MinPQ<Transaction>(M+1); while (StdIn.hasNextLine()) { // Create an entry from the next line and put on the PQ. String line = StdIn.readLine(); Transaction transaction = new Transaction(line); pq.insert(transaction); // remove minimum if M+1 entries on the PQ if (pq.size() > M) pq.delMin(); } // top M entries are on the PQ // print entries on PQ in reverse order Stack<Transaction> stack = new Stack<Transaction>(); for (Transaction transaction : pq) stack.push(transaction); for (Transaction transaction : stack) StdOut.println(transaction); } }
2,641
Java
.java
62
37.290323
98
0.624514
fracpete/princeton-java-algorithms
51
40
0
GPL-3.0
9/4/2024, 7:10:22 PM (Europe/Amsterdam)
false
true
true
true
false
true
true
true
2,641
1,318,834
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/MoveInnerToTopLevel/test44/in/A.java
package p; public class A { protected class B { public void execute() { B b = p.A.B.this; synchronized (A.this) { System.err.println(); } } } }
163
Java
.java
11
12.090909
26
0.618421
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
163
596,331
DataGroupHash.java
redfish64_TinyTravelTracker/app/src/main/java/org/bouncycastle/asn1/icao/DataGroupHash.java
package org.bouncycastle.asn1.icao; import java.util.Enumeration; import org.bouncycastle.asn1.ASN1EncodableVector; import org.bouncycastle.asn1.ASN1Integer; import org.bouncycastle.asn1.ASN1Object; import org.bouncycastle.asn1.ASN1OctetString; import org.bouncycastle.asn1.ASN1Primitive; import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.DERSequence; /** * The DataGroupHash object. * <pre> * DataGroupHash ::= SEQUENCE { * dataGroupNumber DataGroupNumber, * dataGroupHashValue OCTET STRING } * * DataGroupNumber ::= INTEGER { * dataGroup1 (1), * dataGroup1 (2), * dataGroup1 (3), * dataGroup1 (4), * dataGroup1 (5), * dataGroup1 (6), * dataGroup1 (7), * dataGroup1 (8), * dataGroup1 (9), * dataGroup1 (10), * dataGroup1 (11), * dataGroup1 (12), * dataGroup1 (13), * dataGroup1 (14), * dataGroup1 (15), * dataGroup1 (16) } * * </pre> */ public class DataGroupHash extends ASN1Object { ASN1Integer dataGroupNumber; ASN1OctetString dataGroupHashValue; public static DataGroupHash getInstance( Object obj) { if (obj instanceof DataGroupHash) { return (DataGroupHash)obj; } else if (obj != null) { return new DataGroupHash(ASN1Sequence.getInstance(obj)); } return null; } private DataGroupHash(ASN1Sequence seq) { Enumeration e = seq.getObjects(); // dataGroupNumber dataGroupNumber = ASN1Integer.getInstance(e.nextElement()); // dataGroupHashValue dataGroupHashValue = ASN1OctetString.getInstance(e.nextElement()); } public DataGroupHash( int dataGroupNumber, ASN1OctetString dataGroupHashValue) { this.dataGroupNumber = new ASN1Integer(dataGroupNumber); this.dataGroupHashValue = dataGroupHashValue; } public int getDataGroupNumber() { return dataGroupNumber.getValue().intValue(); } public ASN1OctetString getDataGroupHashValue() { return dataGroupHashValue; } public ASN1Primitive toASN1Primitive() { ASN1EncodableVector seq = new ASN1EncodableVector(); seq.add(dataGroupNumber); seq.add(dataGroupHashValue); return new DERSequence(seq); } }
2,576
Java
.java
85
24.552941
77
0.625051
redfish64/TinyTravelTracker
135
31
69
GPL-3.0
9/4/2024, 7:08:18 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
2,576
1,319,703
TestThisExpressionWithGetterSetter.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/SefWorkSpace/SefTests/existingmethods_in/TestThisExpressionWithGetterSetter.java
package base_in; public class TestThisExpression { int field; public void foo() { this.field= 10; new TestThisExpression().field= 11; } public void setField(int newValue){ this.field=newValue; } public int getField(){ return field; } }
258
Java
.java
14
15.857143
37
0.742616
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
258
3,353,880
ImageCache_FormsLruCache.java
IShiraiKurokoI_DLUTToolBoxMobile/DLUTToolBoxMobile/DLUTToolBoxMobile.Android/obj/Debug/120/android/src/crc643f46942d9dd1fff9/ImageCache_FormsLruCache.java
package crc643f46942d9dd1fff9; public class ImageCache_FormsLruCache extends android.util.LruCache implements mono.android.IGCUserPeer { /** @hide */ public static final String __md_methods; static { __md_methods = "n_sizeOf:(Ljava/lang/Object;Ljava/lang/Object;)I:GetSizeOf_Ljava_lang_Object_Ljava_lang_Object_Handler\n" + ""; mono.android.Runtime.register ("Xamarin.Forms.Platform.Android.ImageCache+FormsLruCache, Xamarin.Forms.Platform.Android", ImageCache_FormsLruCache.class, __md_methods); } public ImageCache_FormsLruCache (int p0) { super (p0); if (getClass () == ImageCache_FormsLruCache.class) mono.android.TypeManager.Activate ("Xamarin.Forms.Platform.Android.ImageCache+FormsLruCache, Xamarin.Forms.Platform.Android", "System.Int32, mscorlib", this, new java.lang.Object[] { p0 }); } public int sizeOf (java.lang.Object p0, java.lang.Object p1) { return n_sizeOf (p0, p1); } private native int n_sizeOf (java.lang.Object p0, java.lang.Object p1); private java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
1,283
Java
.java
38
31.131579
192
0.755663
IShiraiKurokoI/DLUTToolBoxMobile
4
0
0
GPL-2.0
9/4/2024, 11:14:57 PM (Europe/Amsterdam)
false
true
false
true
true
true
true
true
1,283
1,052,462
StartTLS.java
kontalk_tigase-server/src/main/java/tigase/xmpp/impl/StartTLS.java
/* * StartTLS.java * * Tigase Jabber/XMPP Server * Copyright (C) 2004-2013 "Tigase, Inc." <office@tigase.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, * or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. Look for COPYING file in the top folder. * If not, see http://www.gnu.org/licenses/. * */ package tigase.xmpp.impl; //~--- non-JDK imports -------------------------------------------------------- import tigase.db.NonAuthUserRepository; import tigase.server.Command; import tigase.server.Packet; import tigase.vhosts.VHostItem; import tigase.xml.Element; import tigase.xmpp.NoConnectionIdException; import tigase.xmpp.StanzaType; import tigase.xmpp.XMPPPreprocessorIfc; import tigase.xmpp.XMPPProcessor; import tigase.xmpp.XMPPProcessorIfc; import tigase.xmpp.XMPPResourceConnection; //~--- JDK imports ------------------------------------------------------------ import java.util.logging.Level; import java.util.logging.Logger; import java.util.Map; import java.util.Queue; /** * Describe class StartTLS here. * * * Created: Fri Mar 24 07:22:57 2006 * * @author <a href="mailto:artur.hefczyc@tigase.org">Artur Hefczyc</a> * @version $Rev$ */ public class StartTLS extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc { // private static final String TLS_STARTED_KEY = "TLS-Started"; /** Field description */ public static final String EL_NAME = "starttls"; /** Field description */ protected static final String ID = EL_NAME; private static final String[][] ELEMENTS = { { EL_NAME }, { "proceed" }, { "failure" } }; private static final Logger log = Logger.getLogger(StartTLS.class.getName()); private static final String XMLNS = "urn:ietf:params:xml:ns:xmpp-tls"; private static final String[] XMLNSS = { XMLNS, XMLNS, XMLNS }; private static final Element[] F_REQUIRED = { new Element("starttls", new Element[] { new Element("required") }, new String[] { Packet.XMLNS_ATT }, new String[] { XMLNS }) }; private static final Element[] F_NOT_REQUIRED = { new Element(EL_NAME, new String[] { Packet.XMLNS_ATT }, new String[] { XMLNS }) }; //~--- fields --------------------------------------------------------------- private Element proceed = new Element("proceed", new String[] { Packet.XMLNS_ATT }, new String[] { XMLNS }); private Element failure = new Element("failure", new String[] { Packet.XMLNS_ATT }, new String[] { XMLNS }); //~--- methods -------------------------------------------------------------- @Override public String id() { return ID; } @Override public void process(final Packet packet, final XMPPResourceConnection session, final NonAuthUserRepository repo, final Queue<Packet> results, final Map<String, Object> settings) { if (session == null) { return; } // end of if (session == null) if (packet.isElement("starttls", XMLNS)) { if (session.getSessionData(ID) != null) { // Somebody tries to activate multiple TLS layers. // This is possible and can even work but this can also be // a DOS attack. Blocking it now, unless someone requests he wants // to have multiple layers of TLS for his connection log.log(Level.WARNING, "Multiple TLS requests, possible DOS attack, closing connection: {0}", packet); results.offer(packet.swapFromTo(failure, null, null)); results.offer(Command.CLOSE.getPacket(packet.getTo(), packet.getFrom(), StanzaType .set, session.nextStanzaId())); return; } session.putSessionData(ID, "true"); Packet result = Command.STARTTLS.getPacket(packet.getTo(), packet.getFrom(), StanzaType.set, session.nextStanzaId(), Command.DataType.submit); Command.setData(result, proceed); results.offer(result); } else { log.log(Level.WARNING, "Unknown TLS element: {0}", packet); results.offer(packet.swapFromTo(failure, null, null)); results.offer(Command.CLOSE.getPacket(packet.getTo(), packet.getFrom(), StanzaType .set, session.nextStanzaId())); } // end of if (packet.getElement().getName().equals("starttls")) else } @Override public String[][] supElementNamePaths() { return ELEMENTS; } @Override public String[] supNamespaces() { return XMLNSS; } @Override public Element[] supStreamFeatures(final XMPPResourceConnection session) { // If session does not exist, just return null, we don't provide features // for non-existen stream, the second condition means that the TLS // has not been yet completed for the user connection. if ((session != null) && (session.getSessionData(ID) == null)) { VHostItem vhost = session.getDomain(); if ((vhost != null) && session.isTlsRequired()) { return F_REQUIRED; } else { return F_NOT_REQUIRED; } } else { return null; } // end of if (session.isAuthorized()) else } @Override public boolean preProcess(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) { boolean stop = false; if ((session == null) || session.isServerSession()) { return stop; } VHostItem vhost = session.getDomain(); if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "VHost: {0}", new Object[] { vhost }); } // Check whether the TLS has been completed // and the packet is allowed to be processed. if ((vhost != null) && session.isTlsRequired() && (session.getSessionData(ID) == null) && !packet.isElement(EL_NAME, XMLNS)) { stop = true; } return stop; } } // StartTLS //~ Formatted in Tigase Code Convention on 13/03/12
6,139
Java
.java
155
36.632258
88
0.689412
kontalk/tigase-server
47
26
2
AGPL-3.0
9/4/2024, 7:11:02 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
6,139
3,882,305
EntityPolarBear.java
llyxa05_ZeUsClient-1_12_2/net/minecraft/entity/monster/EntityPolarBear.java
package net.minecraft.entity.monster; import com.google.common.base.Predicate; import javax.annotation.Nullable; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackMelee; import net.minecraft.entity.ai.EntityAIFollowParent; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAIPanic; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.util.DamageSource; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.World; import net.minecraft.world.storage.loot.LootTableList; public class EntityPolarBear extends EntityAnimal { private static final DataParameter<Boolean> IS_STANDING = EntityDataManager.<Boolean>createKey(EntityPolarBear.class, DataSerializers.BOOLEAN); private float clientSideStandAnimation0; private float clientSideStandAnimation; private int warningSoundTicks; public EntityPolarBear(World worldIn) { super(worldIn); this.setSize(1.3F, 1.4F); } public EntityAgeable createChild(EntityAgeable ageable) { return new EntityPolarBear(this.world); } /** * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on * the animal type) */ public boolean isBreedingItem(ItemStack stack) { return false; } protected void initEntityAI() { super.initEntityAI(); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityPolarBear.AIMeleeAttack()); this.tasks.addTask(1, new EntityPolarBear.AIPanic()); this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D)); this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityPolarBear.AIHurtByTarget()); this.targetTasks.addTask(2, new EntityPolarBear.AIAttackPlayer()); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D); this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(20.0D); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE); this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D); } protected SoundEvent getAmbientSound() { return this.isChild() ? SoundEvents.ENTITY_POLAR_BEAR_BABY_AMBIENT : SoundEvents.ENTITY_POLAR_BEAR_AMBIENT; } protected SoundEvent getHurtSound(DamageSource p_184601_1_) { return SoundEvents.ENTITY_POLAR_BEAR_HURT; } protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_POLAR_BEAR_DEATH; } protected void playStepSound(BlockPos pos, Block blockIn) { this.playSound(SoundEvents.ENTITY_POLAR_BEAR_STEP, 0.15F, 1.0F); } protected void playWarningSound() { if (this.warningSoundTicks <= 0) { this.playSound(SoundEvents.ENTITY_POLAR_BEAR_WARNING, 1.0F, 1.0F); this.warningSoundTicks = 40; } } @Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_POLAR_BEAR; } protected void entityInit() { super.entityInit(); this.dataManager.register(IS_STANDING, Boolean.valueOf(false)); } /** * Called to update the entity's position/logic. */ public void onUpdate() { super.onUpdate(); if (this.world.isRemote) { this.clientSideStandAnimation0 = this.clientSideStandAnimation; if (this.isStanding()) { this.clientSideStandAnimation = MathHelper.clamp(this.clientSideStandAnimation + 1.0F, 0.0F, 6.0F); } else { this.clientSideStandAnimation = MathHelper.clamp(this.clientSideStandAnimation - 1.0F, 0.0F, 6.0F); } } if (this.warningSoundTicks > 0) { --this.warningSoundTicks; } } public boolean attackEntityAsMob(Entity entityIn) { boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float)((int)this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue())); if (flag) { this.applyEnchantments(this, entityIn); } return flag; } public boolean isStanding() { return ((Boolean)this.dataManager.get(IS_STANDING)).booleanValue(); } public void setStanding(boolean standing) { this.dataManager.set(IS_STANDING, Boolean.valueOf(standing)); } public float getStandingAnimationScale(float p_189795_1_) { return (this.clientSideStandAnimation0 + (this.clientSideStandAnimation - this.clientSideStandAnimation0) * p_189795_1_) / 6.0F; } protected float getWaterSlowDown() { return 0.98F; } /** * Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called * when entity is reloaded from nbt. Mainly used for initializing attributes and inventory */ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) { if (livingdata instanceof EntityPolarBear.GroupData) { if (((EntityPolarBear.GroupData)livingdata).madeParent) { this.setGrowingAge(-24000); } } else { EntityPolarBear.GroupData entitypolarbear$groupdata = new EntityPolarBear.GroupData(); entitypolarbear$groupdata.madeParent = true; livingdata = entitypolarbear$groupdata; } return livingdata; } class AIAttackPlayer extends EntityAINearestAttackableTarget<EntityPlayer> { public AIAttackPlayer() { super(EntityPolarBear.this, EntityPlayer.class, 20, true, true, (Predicate)null); } public boolean shouldExecute() { if (EntityPolarBear.this.isChild()) { return false; } else { if (super.shouldExecute()) { for (EntityPolarBear entitypolarbear : EntityPolarBear.this.world.getEntitiesWithinAABB(EntityPolarBear.class, EntityPolarBear.this.getEntityBoundingBox().expand(8.0D, 4.0D, 8.0D))) { if (entitypolarbear.isChild()) { return true; } } } EntityPolarBear.this.setAttackTarget((EntityLivingBase)null); return false; } } protected double getTargetDistance() { return super.getTargetDistance() * 0.5D; } } class AIHurtByTarget extends EntityAIHurtByTarget { public AIHurtByTarget() { super(EntityPolarBear.this, false); } public void startExecuting() { super.startExecuting(); if (EntityPolarBear.this.isChild()) { this.alertOthers(); this.resetTask(); } } protected void setEntityAttackTarget(EntityCreature creatureIn, EntityLivingBase entityLivingBaseIn) { if (creatureIn instanceof EntityPolarBear && !creatureIn.isChild()) { super.setEntityAttackTarget(creatureIn, entityLivingBaseIn); } } } class AIMeleeAttack extends EntityAIAttackMelee { public AIMeleeAttack() { super(EntityPolarBear.this, 1.25D, true); } protected void checkAndPerformAttack(EntityLivingBase p_190102_1_, double p_190102_2_) { double d0 = this.getAttackReachSqr(p_190102_1_); if (p_190102_2_ <= d0 && this.attackTick <= 0) { this.attackTick = 20; this.attacker.attackEntityAsMob(p_190102_1_); EntityPolarBear.this.setStanding(false); } else if (p_190102_2_ <= d0 * 2.0D) { if (this.attackTick <= 0) { EntityPolarBear.this.setStanding(false); this.attackTick = 20; } if (this.attackTick <= 10) { EntityPolarBear.this.setStanding(true); EntityPolarBear.this.playWarningSound(); } } else { this.attackTick = 20; EntityPolarBear.this.setStanding(false); } } public void resetTask() { EntityPolarBear.this.setStanding(false); super.resetTask(); } protected double getAttackReachSqr(EntityLivingBase attackTarget) { return (double)(4.0F + attackTarget.width); } } class AIPanic extends EntityAIPanic { public AIPanic() { super(EntityPolarBear.this, 2.0D); } public boolean shouldExecute() { return !EntityPolarBear.this.isChild() && !EntityPolarBear.this.isBurning() ? false : super.shouldExecute(); } } static class GroupData implements IEntityLivingData { public boolean madeParent; private GroupData() { } } }
10,945
Java
.java
301
27.571429
201
0.651382
llyxa05/ZeUsClient-1.12.2
3
0
0
GPL-3.0
9/4/2024, 11:46:40 PM (Europe/Amsterdam)
false
false
false
true
true
true
true
true
10,945
4,042,378
Flight.java
deathspeeder_class-guard/spring-framework-3.2.x/spring-oxm/src/test/java/org/springframework/oxm/xstream/Flight.java
/* * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.oxm.xstream; import com.thoughtworks.xstream.annotations.XStreamAlias; @XStreamAlias("flight") public class Flight { @XStreamAlias("number") private long flightNumber; public long getFlightNumber() { return flightNumber; } public void setFlightNumber(long number) { this.flightNumber = number; } }
963
Java
.java
28
32.321429
75
0.776103
deathspeeder/class-guard
2
2
0
GPL-2.0
9/5/2024, 12:00:55 AM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
963
2,377,669
ClusterImportController.java
tomdev2008_easyrec_major/easyrec-web/src/main/java/org/easyrec/controller/clusterManager/ClusterImportController.java
/* * Copyright 2011 Research Studios Austria Forschungsgesellschaft mBH * * This file is part of easyrec. * * easyrec is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * easyrec is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with easyrec. If not, see <http://www.gnu.org/licenses/>. */ package org.easyrec.controller.clusterManager; import org.easyrec.exception.core.ClusterException; import org.easyrec.model.core.ClusterVO; import org.easyrec.model.core.web.Item; import org.easyrec.model.core.web.RemoteTenant; import org.easyrec.model.web.FileUploadBean; import org.easyrec.service.core.ClusterService; import org.easyrec.service.web.ViewInitializationService; import org.easyrec.store.dao.IDMappingDAO; import org.easyrec.store.dao.core.ItemDAO; import org.easyrec.store.dao.core.types.ItemTypeDAO; import org.easyrec.utils.io.tabular.input.InconsistentFieldCountException; import org.easyrec.utils.io.tabular.input.impl.CsvInput; import org.springframework.validation.BindException; import org.springframework.web.bind.ServletRequestDataBinder; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.support.ByteArrayMultipartFileEditor; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.SimpleFormController; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; /** * This controller provides file upload for the webapp. * <p/> * <p><b>Company:&nbsp;</b> * SAT, Research Studios Austria</p> * <p/> * <p><b>Copyright:&nbsp;</b> * (c) 2010</p> * <p/> * <p><b>last modified:</b><br/> * $Author: fsalcher $<br/> * $Date: 2012-03-23 15:35:07 +0100 (Fr, 23 Mär 2012) $<br/> * $Revision: 18791 $</p> * * @author Stephan Zavrel */ public class ClusterImportController extends SimpleFormController { private ClusterService clusterService; private ItemDAO itemDAO; private ItemTypeDAO itemTypeDAO; private IDMappingDAO idMappingDAO; private ViewInitializationService viewInitializationService; public ClusterImportController(ClusterService clusterService, IDMappingDAO idMappingDAO, ItemDAO itemDAO, ItemTypeDAO itemTypeDAO,ViewInitializationService viewInitializationService) { this.clusterService = clusterService; this.idMappingDAO = idMappingDAO; this.itemDAO = itemDAO; this.itemTypeDAO = itemTypeDAO; this.viewInitializationService = viewInitializationService; } @Override protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { ModelAndView mav = new ModelAndView("page"); RemoteTenant remoteTenant = viewInitializationService.initializeView(request, mav); FileUploadBean bean = (FileUploadBean) command; // cast the bean if (bean == null || bean.getFile() == null || bean.getFile().isEmpty()) { logger.info("no file or empty file was uploaded, aborting"); // well, let's do nothing with the bean for now and return return super.onSubmit(request, response, command, errors); } // check if there's content there MultipartFile file = bean.getFile(); CsvInput csvInput = new CsvInput(";", null); csvInput.setSource(file.getInputStream(), "UTF-8"); List<String> validationErrors = new ArrayList<String>(); List<String> touchedClusters = new ArrayList<String>(); int lineNumber = 0; int numberOfItems = 0; int numberOfTouchedClusters = 0; int tenantId = 0; while (csvInput.hasNext()) { lineNumber++; List<String> fields = null; try { fields = csvInput.next(); //read one line } catch (InconsistentFieldCountException e) { validationErrors.add("ERROR in line number " + lineNumber + ": column numbers don't equal headerline columns!"); continue; } if (lineNumber == 1) { continue; } // header line boolean lineError = false; if (fields.size() < 3) { validationErrors.add("ERROR in line number " + lineNumber + ": column numbers smaller then 3!"); continue; } // init the CSV Columns to Java Variables String clusterName = fields.get(0); String itemId = fields.get(1); String itemType = fields.get(2); // the following code is used to validate the CSV line ... if (clusterName.equals("")) { validationErrors.add("ERROR in line number " + lineNumber + ": clusterName is missing."); lineError = true; } if (itemId.equals("")) { validationErrors.add("ERROR in line number " + lineNumber + ": itemId is missing."); lineError = true; } if (itemType.equals("")) { validationErrors.add("ERROR in line number " + lineNumber + ": itemType is missing."); lineError = true; } ClusterVO cluster = clusterService.loadCluster(remoteTenant.getId(), clusterName); if(cluster == null) { validationErrors.add("ERROR in line number " + lineNumber + ": cluster with name'" + clusterName + "' does not exist. Please create before importing!"); lineError = true; } Integer itemTypeId = itemTypeDAO.getIdOfType(remoteTenant.getId(), itemType); Item item = itemDAO.get(remoteTenant, itemId, itemType); if (null == item) { validationErrors.add("ERROR in line number " + lineNumber + ": item with id '" + itemId + "' and type '" + itemType + "' does not exist."); lineError = true; } if (lineError) { continue; } Integer itemIdInt = idMappingDAO.lookup(item.getItemId()); try { clusterService.addItemToCluster(remoteTenant.getId(), clusterName, itemIdInt, itemTypeId); } catch (ClusterException ex) { validationErrors.add("ERROR in line number " + lineNumber + ": " + ex.getMessage()); continue; } numberOfItems++; if (!touchedClusters.contains(clusterName)) { numberOfTouchedClusters++; touchedClusters.add(clusterName); } } mav.addObject("tenant", remoteTenant); mav.addObject("page", "clustermanager/import/importResult"); mav.addObject("numberOfItems", numberOfItems); mav.addObject("numberOfTouchedClusters", numberOfTouchedClusters); mav.addObject("validationErrors", validationErrors); return mav; } @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws ServletException { // to actually be able to convert Multipart instance to byte[] // we have to register a custom editor binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor()); // now Spring knows how to handle multipart object and convert them } }
7,949
Java
.java
168
38.928571
188
0.669076
tomdev2008/easyrec_major
8
8
0
GPL-3.0
9/4/2024, 9:15:20 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
7,949
3,234,201
KSPrivateKeyEntry.java
linagora_linsign/linsign-dss/dss-spi/src/main/java/eu/europa/esig/dss/token/KSPrivateKeyEntry.java
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package eu.europa.esig.dss.token; import java.security.KeyStore.PrivateKeyEntry; import java.security.PrivateKey; import java.security.cert.Certificate; import java.security.cert.X509Certificate; import java.security.interfaces.DSAPrivateKey; import java.security.interfaces.ECPrivateKey; import java.security.interfaces.RSAPrivateKey; import java.util.ArrayList; import java.util.List; import eu.europa.esig.dss.DSSException; import eu.europa.esig.dss.EncryptionAlgorithm; import eu.europa.esig.dss.x509.CertificateToken; /** * Wrapper of a PrivateKeyEntry coming from a KeyStore. * */ public class KSPrivateKeyEntry implements DSSPrivateKeyEntry { private final CertificateToken certificate; private final CertificateToken[] certificateChain; private final PrivateKey privateKey; /** * The default constructor for KSPrivateKeyEntry. */ public KSPrivateKeyEntry(final PrivateKeyEntry privateKeyEntry) { certificate = new CertificateToken((X509Certificate) privateKeyEntry.getCertificate()); final List<CertificateToken> x509CertificateList = new ArrayList<CertificateToken>(); final Certificate[] simpleCertificateChain = privateKeyEntry.getCertificateChain(); for (final Certificate certificate : simpleCertificateChain) { x509CertificateList.add(new CertificateToken((X509Certificate) certificate)); } final CertificateToken[] certificateChain_ = new CertificateToken[x509CertificateList.size()]; certificateChain = x509CertificateList.toArray(certificateChain_); privateKey = privateKeyEntry.getPrivateKey(); } @Override public CertificateToken getCertificate() { return certificate; } @Override public CertificateToken[] getCertificateChain() { return certificateChain; } /** * @return */ public PrivateKey getPrivateKey() { return privateKey; } @Override public EncryptionAlgorithm getEncryptionAlgorithm() throws DSSException { if (privateKey instanceof RSAPrivateKey) { return EncryptionAlgorithm.RSA; } else if (privateKey instanceof DSAPrivateKey) { return EncryptionAlgorithm.DSA; } else if (privateKey instanceof ECPrivateKey) { return EncryptionAlgorithm.ECDSA; } else if (EncryptionAlgorithm.RSA.getName().equals(privateKey.getAlgorithm())) { return EncryptionAlgorithm.RSA; } else if (EncryptionAlgorithm.DSA.getName().equals(privateKey.getAlgorithm())) { return EncryptionAlgorithm.DSA; } else if (EncryptionAlgorithm.ECDSA.getName().equals(privateKey.getAlgorithm())) { return EncryptionAlgorithm.ECDSA; } else { throw new DSSException("Don't find algorithm for PrivateKey of type " + privateKey.getClass()); } } }
3,840
Java
.java
88
38.227273
107
0.744709
linagora/linsign
4
2
1
AGPL-3.0
9/4/2024, 11:07:08 PM (Europe/Amsterdam)
false
false
false
true
false
true
false
true
3,840
2,528,488
ForwardingRepaintManager.java
isp-insoft-gmbh_SwingX/swingx-core/src/main/java/org/jdesktop/swingx/ForwardingRepaintManager.java
/* * $Id: ForwardingRepaintManager.java 3690 2010-05-03 17:55:44Z kschaefe $ * * Copyright 2009 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package org.jdesktop.swingx; import java.applet.Applet; import java.awt.Component; import java.awt.Dimension; import java.awt.Image; import java.awt.Rectangle; import java.awt.Window; import javax.swing.JComponent; import javax.swing.RepaintManager; import org.jdesktop.swingx.util.Contract; /** * A {@code RepaintManager} that is designed to forward all calls to a contained * delegate. This class is designed for extension, such that subclasses should * override method as appropriate and allow the original repaint manager to * handle the rest of the work. * <p> * Install a forwarding repaint manager: * * <pre> * RepaintManager manager = RepaintManager.currentManager(this); * RepaintManager frm = new ForwardingRepaintManager(manager); * RepaintManager.setCurrentManager(frm); * </pre> * * @author Karl George Schaefer * @author pietblok (original facade/delegate idea) */ public class ForwardingRepaintManager extends RepaintManager { private RepaintManager delegate; /** * Creates a new forwarding manager that forwards all calls to the delegate. * * @param delegate * the manager backing this {@code ForwardingRepaintManager} * @throws NullPointerException * if {@code delegate} is {@code null} */ public ForwardingRepaintManager(RepaintManager delegate) { this.delegate = Contract.asNotNull(delegate, "delegate is null"); } /** * {@inheritDoc} */ @Override public void addDirtyRegion(Applet applet, int x, int y, int w, int h) { delegate.addDirtyRegion(applet, x, y, w, h); } /** * {@inheritDoc} */ @Override public void addDirtyRegion(JComponent c, int x, int y, int w, int h) { delegate.addDirtyRegion(c, x, y, w, h); } /** * {@inheritDoc} */ @Override public void addDirtyRegion(Window window, int x, int y, int w, int h) { delegate.addDirtyRegion(window, x, y, w, h); } /** * {@inheritDoc} */ @Override public synchronized void addInvalidComponent(JComponent invalidComponent) { delegate.addInvalidComponent(invalidComponent); } /** * {@inheritDoc} */ @Override public Rectangle getDirtyRegion(JComponent component) { return delegate.getDirtyRegion(component); } /** * {@inheritDoc} */ @Override public Dimension getDoubleBufferMaximumSize() { return delegate.getDoubleBufferMaximumSize(); } /** * {@inheritDoc} */ @Override public Image getOffscreenBuffer(Component c, int proposedWidth, int proposedHeight) { return delegate.getOffscreenBuffer(c, proposedWidth, proposedHeight); } /** * {@inheritDoc} */ @Override public Image getVolatileOffscreenBuffer(Component c, int proposedWidth, int proposedHeight) { return delegate.getVolatileOffscreenBuffer(c, proposedWidth, proposedHeight); } /** * {@inheritDoc} */ @Override public boolean isCompletelyDirty(JComponent component) { return delegate.isCompletelyDirty(component); } /** * {@inheritDoc} */ @Override public boolean isDoubleBufferingEnabled() { return delegate.isDoubleBufferingEnabled(); } /** * {@inheritDoc} */ @Override public void markCompletelyClean(JComponent component) { delegate.markCompletelyClean(component); } /** * {@inheritDoc} */ @Override public void markCompletelyDirty(JComponent component) { delegate.markCompletelyDirty(component); } /** * {@inheritDoc} */ @Override public void paintDirtyRegions() { delegate.paintDirtyRegions(); } /** * {@inheritDoc} */ @Override public synchronized void removeInvalidComponent(JComponent component) { delegate.removeInvalidComponent(component); } /** * {@inheritDoc} */ @Override public void setDoubleBufferingEnabled(boolean flag) { delegate.setDoubleBufferingEnabled(flag); } /** * {@inheritDoc} */ @Override public void setDoubleBufferMaximumSize(Dimension d) { delegate.setDoubleBufferMaximumSize(d); } /** * {@inheritDoc} */ @Override public synchronized String toString() { return delegate.toString(); } /** * {@inheritDoc} */ @Override public void validateInvalidComponents() { delegate.validateInvalidComponents(); } /** * Gets the delegate repaint manager backing this forwarding repaint * manager. * * @return the delegate for this forwarding manager */ public final RepaintManager getDelegateManager() { return delegate; } }
6,025
Java
.java
196
24.622449
98
0.66107
isp-insoft-gmbh/SwingX
7
1
10
GPL-3.0
9/4/2024, 9:46:18 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
6,025
1,941,821
ANN_MLP.java
GeekAbdelouahed_sign-language/openCVLibrary340/src/main/java/org/opencv/ml/ANN_MLP.java
// // This file is auto-generated. Please don't modify it! // package org.opencv.ml; import java.lang.String; import org.opencv.core.Mat; import org.opencv.core.TermCriteria; // C++: class ANN_MLP //javadoc: ANN_MLP public class ANN_MLP extends StatModel { protected ANN_MLP(long addr) { super(addr); } public static final int BACKPROP = 0, RPROP = 1, ANNEAL = 2, IDENTITY = 0, SIGMOID_SYM = 1, GAUSSIAN = 2, RELU = 3, LEAKYRELU = 4, UPDATE_WEIGHTS = 1, NO_INPUT_SCALE = 2, NO_OUTPUT_SCALE = 4; // // C++: Mat getLayerSizes() // //javadoc: ANN_MLP::getLayerSizes() public Mat getLayerSizes() { Mat retVal = new Mat(getLayerSizes_0(nativeObj)); return retVal; } // // C++: Mat getWeights(int layerIdx) // //javadoc: ANN_MLP::getWeights(layerIdx) public Mat getWeights(int layerIdx) { Mat retVal = new Mat(getWeights_0(nativeObj, layerIdx)); return retVal; } // // C++: static Ptr_ANN_MLP create() // //javadoc: ANN_MLP::create() public static ANN_MLP create() { ANN_MLP retVal = new ANN_MLP(create_0()); return retVal; } // // C++: static Ptr_ANN_MLP load(String filepath) // //javadoc: ANN_MLP::load(filepath) public static ANN_MLP load(String filepath) { ANN_MLP retVal = new ANN_MLP(load_0(filepath)); return retVal; } // // C++: TermCriteria getTermCriteria() // //javadoc: ANN_MLP::getTermCriteria() public TermCriteria getTermCriteria() { TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj)); return retVal; } // // C++: double getAnnealCoolingRatio() // //javadoc: ANN_MLP::getAnnealCoolingRatio() public double getAnnealCoolingRatio() { double retVal = getAnnealCoolingRatio_0(nativeObj); return retVal; } // // C++: double getAnnealFinalT() // //javadoc: ANN_MLP::getAnnealFinalT() public double getAnnealFinalT() { double retVal = getAnnealFinalT_0(nativeObj); return retVal; } // // C++: double getAnnealInitialT() // //javadoc: ANN_MLP::getAnnealInitialT() public double getAnnealInitialT() { double retVal = getAnnealInitialT_0(nativeObj); return retVal; } // // C++: double getBackpropMomentumScale() // //javadoc: ANN_MLP::getBackpropMomentumScale() public double getBackpropMomentumScale() { double retVal = getBackpropMomentumScale_0(nativeObj); return retVal; } // // C++: double getBackpropWeightScale() // //javadoc: ANN_MLP::getBackpropWeightScale() public double getBackpropWeightScale() { double retVal = getBackpropWeightScale_0(nativeObj); return retVal; } // // C++: double getRpropDW0() // //javadoc: ANN_MLP::getRpropDW0() public double getRpropDW0() { double retVal = getRpropDW0_0(nativeObj); return retVal; } // // C++: double getRpropDWMax() // //javadoc: ANN_MLP::getRpropDWMax() public double getRpropDWMax() { double retVal = getRpropDWMax_0(nativeObj); return retVal; } // // C++: double getRpropDWMin() // //javadoc: ANN_MLP::getRpropDWMin() public double getRpropDWMin() { double retVal = getRpropDWMin_0(nativeObj); return retVal; } // // C++: double getRpropDWMinus() // //javadoc: ANN_MLP::getRpropDWMinus() public double getRpropDWMinus() { double retVal = getRpropDWMinus_0(nativeObj); return retVal; } // // C++: double getRpropDWPlus() // //javadoc: ANN_MLP::getRpropDWPlus() public double getRpropDWPlus() { double retVal = getRpropDWPlus_0(nativeObj); return retVal; } // // C++: int getAnnealItePerStep() // //javadoc: ANN_MLP::getAnnealItePerStep() public int getAnnealItePerStep() { int retVal = getAnnealItePerStep_0(nativeObj); return retVal; } // // C++: int getTrainMethod() // //javadoc: ANN_MLP::getTrainMethod() public int getTrainMethod() { int retVal = getTrainMethod_0(nativeObj); return retVal; } // // C++: void setActivationFunction(int type, double param1 = 0, double param2 = 0) // //javadoc: ANN_MLP::setActivationFunction(type, param1, param2) public void setActivationFunction(int type, double param1, double param2) { setActivationFunction_0(nativeObj, type, param1, param2); return; } //javadoc: ANN_MLP::setActivationFunction(type) public void setActivationFunction(int type) { setActivationFunction_1(nativeObj, type); return; } // // C++: void setAnnealCoolingRatio(double val) // //javadoc: ANN_MLP::setAnnealCoolingRatio(val) public void setAnnealCoolingRatio(double val) { setAnnealCoolingRatio_0(nativeObj, val); return; } // // C++: void setAnnealFinalT(double val) // //javadoc: ANN_MLP::setAnnealFinalT(val) public void setAnnealFinalT(double val) { setAnnealFinalT_0(nativeObj, val); return; } // // C++: void setAnnealInitialT(double val) // //javadoc: ANN_MLP::setAnnealInitialT(val) public void setAnnealInitialT(double val) { setAnnealInitialT_0(nativeObj, val); return; } // // C++: void setAnnealItePerStep(int val) // //javadoc: ANN_MLP::setAnnealItePerStep(val) public void setAnnealItePerStep(int val) { setAnnealItePerStep_0(nativeObj, val); return; } // // C++: void setBackpropMomentumScale(double val) // //javadoc: ANN_MLP::setBackpropMomentumScale(val) public void setBackpropMomentumScale(double val) { setBackpropMomentumScale_0(nativeObj, val); return; } // // C++: void setBackpropWeightScale(double val) // //javadoc: ANN_MLP::setBackpropWeightScale(val) public void setBackpropWeightScale(double val) { setBackpropWeightScale_0(nativeObj, val); return; } // // C++: void setLayerSizes(Mat _layer_sizes) // //javadoc: ANN_MLP::setLayerSizes(_layer_sizes) public void setLayerSizes(Mat _layer_sizes) { setLayerSizes_0(nativeObj, _layer_sizes.nativeObj); return; } // // C++: void setRpropDW0(double val) // //javadoc: ANN_MLP::setRpropDW0(val) public void setRpropDW0(double val) { setRpropDW0_0(nativeObj, val); return; } // // C++: void setRpropDWMax(double val) // //javadoc: ANN_MLP::setRpropDWMax(val) public void setRpropDWMax(double val) { setRpropDWMax_0(nativeObj, val); return; } // // C++: void setRpropDWMin(double val) // //javadoc: ANN_MLP::setRpropDWMin(val) public void setRpropDWMin(double val) { setRpropDWMin_0(nativeObj, val); return; } // // C++: void setRpropDWMinus(double val) // //javadoc: ANN_MLP::setRpropDWMinus(val) public void setRpropDWMinus(double val) { setRpropDWMinus_0(nativeObj, val); return; } // // C++: void setRpropDWPlus(double val) // //javadoc: ANN_MLP::setRpropDWPlus(val) public void setRpropDWPlus(double val) { setRpropDWPlus_0(nativeObj, val); return; } // // C++: void setTermCriteria(TermCriteria val) // //javadoc: ANN_MLP::setTermCriteria(val) public void setTermCriteria(TermCriteria val) { setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon); return; } // // C++: void setTrainMethod(int method, double param1 = 0, double param2 = 0) // //javadoc: ANN_MLP::setTrainMethod(method, param1, param2) public void setTrainMethod(int method, double param1, double param2) { setTrainMethod_0(nativeObj, method, param1, param2); return; } //javadoc: ANN_MLP::setTrainMethod(method) public void setTrainMethod(int method) { setTrainMethod_1(nativeObj, method); return; } @Override protected void finalize() throws Throwable { delete(nativeObj); } // C++: Mat getLayerSizes() private static native long getLayerSizes_0(long nativeObj); // C++: Mat getWeights(int layerIdx) private static native long getWeights_0(long nativeObj, int layerIdx); // C++: static Ptr_ANN_MLP create() private static native long create_0(); // C++: static Ptr_ANN_MLP load(String filepath) private static native long load_0(String filepath); // C++: TermCriteria getTermCriteria() private static native double[] getTermCriteria_0(long nativeObj); // C++: double getAnnealCoolingRatio() private static native double getAnnealCoolingRatio_0(long nativeObj); // C++: double getAnnealFinalT() private static native double getAnnealFinalT_0(long nativeObj); // C++: double getAnnealInitialT() private static native double getAnnealInitialT_0(long nativeObj); // C++: double getBackpropMomentumScale() private static native double getBackpropMomentumScale_0(long nativeObj); // C++: double getBackpropWeightScale() private static native double getBackpropWeightScale_0(long nativeObj); // C++: double getRpropDW0() private static native double getRpropDW0_0(long nativeObj); // C++: double getRpropDWMax() private static native double getRpropDWMax_0(long nativeObj); // C++: double getRpropDWMin() private static native double getRpropDWMin_0(long nativeObj); // C++: double getRpropDWMinus() private static native double getRpropDWMinus_0(long nativeObj); // C++: double getRpropDWPlus() private static native double getRpropDWPlus_0(long nativeObj); // C++: int getAnnealItePerStep() private static native int getAnnealItePerStep_0(long nativeObj); // C++: int getTrainMethod() private static native int getTrainMethod_0(long nativeObj); // C++: void setActivationFunction(int type, double param1 = 0, double param2 = 0) private static native void setActivationFunction_0(long nativeObj, int type, double param1, double param2); private static native void setActivationFunction_1(long nativeObj, int type); // C++: void setAnnealCoolingRatio(double val) private static native void setAnnealCoolingRatio_0(long nativeObj, double val); // C++: void setAnnealFinalT(double val) private static native void setAnnealFinalT_0(long nativeObj, double val); // C++: void setAnnealInitialT(double val) private static native void setAnnealInitialT_0(long nativeObj, double val); // C++: void setAnnealItePerStep(int val) private static native void setAnnealItePerStep_0(long nativeObj, int val); // C++: void setBackpropMomentumScale(double val) private static native void setBackpropMomentumScale_0(long nativeObj, double val); // C++: void setBackpropWeightScale(double val) private static native void setBackpropWeightScale_0(long nativeObj, double val); // C++: void setLayerSizes(Mat _layer_sizes) private static native void setLayerSizes_0(long nativeObj, long _layer_sizes_nativeObj); // C++: void setRpropDW0(double val) private static native void setRpropDW0_0(long nativeObj, double val); // C++: void setRpropDWMax(double val) private static native void setRpropDWMax_0(long nativeObj, double val); // C++: void setRpropDWMin(double val) private static native void setRpropDWMin_0(long nativeObj, double val); // C++: void setRpropDWMinus(double val) private static native void setRpropDWMinus_0(long nativeObj, double val); // C++: void setRpropDWPlus(double val) private static native void setRpropDWPlus_0(long nativeObj, double val); // C++: void setTermCriteria(TermCriteria val) private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon); // C++: void setTrainMethod(int method, double param1 = 0, double param2 = 0) private static native void setTrainMethod_0(long nativeObj, int method, double param1, double param2); private static native void setTrainMethod_1(long nativeObj, int method); // native support for java finalize() private static native void delete(long nativeObj); }
13,543
Java
.java
396
26.484848
117
0.654132
GeekAbdelouahed/sign-language
11
2
1
GPL-3.0
9/4/2024, 8:24:04 PM (Europe/Amsterdam)
true
true
true
true
true
true
true
true
13,543
3,426,107
MonitorAnalysis.java
insightfullogic_insightfullogic-soot/src/soot/jimple/toolkits/thread/mhp/MonitorAnalysis.java
package soot.jimple.toolkits.thread.mhp; import soot.*; import java.util.*; import soot.toolkits.scalar.*; import soot.tagkit.*; import soot.jimple.toolkits.thread.mhp.stmt.JPegStmt; // *** USE AT YOUR OWN RISK *** // May Happen in Parallel (MHP) analysis by Lin Li. // This code should be treated as beta-quality code. // It was written in 2003, but not incorporated into Soot until 2006. // As such, it may contain incorrect assumptions about the usage // of certain Soot classes. // Some portions of this MHP analysis have been quality-checked, and are // now used by the Transactions toolkit. // // -Richard L. Halpert, 2006-11-30 //STEP 1: What are we computing? //SETS OF STMTS INSIDE MONITORS => Use MonitorSet. // //STEP 2: Precisely define what we are computing. //Set of objects inside a monitor reaches a program point. // //STEP 3: Decide whether it is a backwards or forwards analysis. //FORWARDS // public class MonitorAnalysis extends ForwardFlowAnalysis { private PegGraph g; private final HashMap<String, FlowSet> monitor = new HashMap<String, FlowSet>(); private final Vector<Object> nodes = new Vector<Object>(); private final Vector<Object> valueBefore = new Vector<Object>(); private final Vector<Object> valueAfter = new Vector<Object>(); public MonitorAnalysis(PegGraph g) { super(g); this.g = g; doAnalysis(); //computeSynchNodes(); g.setMonitor(monitor); // testMonitor(); } protected void doAnalysis() { LinkedList<Object> changedUnits = new LinkedList<Object>(); HashSet<Object> changedUnitsSet = new HashSet<Object>(); int numNodes = graph.size(); int numComputations = 0; // Set initial values and nodes to visit. createWorkList(changedUnits, changedUnitsSet ); //testWorkList(changedUnits); // Set initial values for entry points { Iterator it = graph.getHeads().iterator(); while (it.hasNext()) { Object s = it.next(); //unitToBeforeFlow.put(s, entryInitialFlow()); nodes.add(s); valueBefore.add(entryInitialFlow()); } } // Perform fixed point flow analysis { Object previousAfterFlow = newInitialFlow(); while(!changedUnits.isEmpty()) { Object beforeFlow; Object afterFlow; Object s = changedUnits.removeFirst(); Tag tag = (Tag)((JPegStmt)s).getTags().get(0); //System.out.println("===unit is: "+tag+" "+s); changedUnitsSet.remove(s); //copy(unitToAfterFlow.get(s), previousAfterFlow); //add for debug april 6 int pos = nodes.indexOf(s); copy(valueAfter.elementAt(pos), previousAfterFlow); //end add for debug april // Compute and store beforeFlow { List preds = graph.getPredsOf(s); //beforeFlow = unitToBeforeFlow.get(s); beforeFlow = valueBefore.elementAt(pos); if(preds.size() == 1){ //copy(unitToAfterFlow.get(preds.get(0)), beforeFlow); copy(valueAfter.elementAt(nodes.indexOf(preds.get(0))), beforeFlow); } else if(preds.size() != 0) { Iterator predIt = preds.iterator(); Object obj = predIt.next(); //copy(unitToAfterFlow.get(obj), beforeFlow); copy(valueAfter.elementAt(nodes.indexOf(obj)), beforeFlow); while(predIt.hasNext()) { JPegStmt stmt = (JPegStmt)predIt.next(); if (stmt.equals(obj)){ //System.out.println("!!!same object!!!"); continue; } Tag tag1 = (Tag)stmt.getTags().get(0); // System.out.println("pred: "+tag1+" "+stmt); // Object otherBranchFlow = unitToAfterFlow.get(stmt); if(nodes.indexOf(stmt) >= 0) // RLH { Object otherBranchFlow = valueAfter.elementAt(nodes.indexOf(stmt)); merge(beforeFlow, otherBranchFlow, beforeFlow); } } } } // Compute afterFlow and store it. { //afterFlow = unitToAfterFlow.get(s); afterFlow = valueAfter.elementAt(nodes.indexOf(s)); flowThrough(beforeFlow, s, afterFlow); //unitToAfterFlow.put(s, afterFlow); valueAfter.set(nodes.indexOf(s), afterFlow); //System.out.println("update afterFlow nodes: "+s); //System.out.println("afterFlow: "+afterFlow); //((MonitorSet)unitToAfterFlow.get(s)).test(); numComputations++; } // Update queue appropriately if(!afterFlow.equals(previousAfterFlow)) { Iterator succIt = graph.getSuccsOf(s).iterator(); while(succIt.hasNext()) { Object succ = succIt.next(); if(!changedUnitsSet.contains(succ)) { changedUnits.addLast(succ); changedUnitsSet.add(succ); /*if (succ instanceof JPegStmt){ Tag tag1 = (Tag)((JPegStmt)succ).getTags().get(0); System.out.println("add to worklist: "+tag1+" "+succ); } else System.out.println("add to worklist: "+succ); */ } } } } } // G.v().out.println(graph.getBody().getMethod().getSignature() + " numNodes: " + numNodes + // " numComputations: " + numComputations + " avg: " + Main.truncatedOf((double) numComputations / numNodes, 2)); Timers.v().totalFlowNodes += numNodes; Timers.v().totalFlowComputations += numComputations; } // STEP 4: Is the merge operator union or intersection? // UNION protected void merge(Object in1, Object in2, Object out) { MonitorSet inSet1 = (MonitorSet) in1; MonitorSet inSet2 = (MonitorSet) in2; MonitorSet outSet = (MonitorSet) out; inSet1.intersection(inSet2, outSet); } // STEP 5: Define flow equations. // in(s) = ( out(s) minus defs(s) ) union uses(s) // protected void flowThrough(Object inValue, Object unit, Object outValue) { MonitorSet in = (MonitorSet) inValue; MonitorSet out = (MonitorSet) outValue; JPegStmt s = (JPegStmt)unit; Tag tag = (Tag)s.getTags().get(0); //System.out.println("s: "+tag+" "+s); // Copy in to out //if (in.contains("&")) in.remove("&"); in.copy( out ); // System.out.println("-----in: "); //in.test(); if (in.size() >0){ if (!s.getName().equals("waiting") && !s.getName().equals("notified-entry")) updateMonitor(in, unit); } String objName = s.getObject(); //if (objName == null) throw new RuntimeException("null object: "+s.getUnit()); if (s.getName().equals("entry") || s.getName().equals("exit")){ if (out.contains("&")) out.remove("&"); Object obj = out.getMonitorDepth(objName) ; if (obj == null){ if (s.getName().equals("entry")){ MonitorDepth md = new MonitorDepth(objName, 1); out.add(md); //System.out.println("add to out: "+md.getObjName()+" "+md.getDepth()); } /* else{ throw new RuntimeException("The monitor depth can not be decreased at "+ (Tag)((JPegStmt)s).getTags().get(0)+" "+unit); } */ } else{ //System.out.println("obj: "+obj); if (obj instanceof MonitorDepth){ MonitorDepth md = (MonitorDepth)obj; if (s.getName().equals("entry")) { md.increaseDepth(); //System.out.println("===increase depth==="); } else { if (md.getDepth() > 1) { //System.out.println("===decrease depth=="); md.decreaseDepth(); } else if (md.getDepth() == 1){ // System.out.println("===remove monitordepth: "+md); out.remove(md); } else throw new RuntimeException("The monitor depth can not be decreased at "+unit); } } else throw new RuntimeException("MonitorSet contains non MonitorDepth element!"); } } //System.out.println("-----out: "+out); //out.test(); //testForDebug(); } /* private void testForDebug(){ System.out.println("--------test for debug-------"); int i = 0; for (i=0;i<nodes.size();i++){ JPegStmt stmt = (JPegStmt)nodes.elementAt(i); //System.out.println("Tag: "+ ((Tag)stmt.getTags().get(0)).toString()); if (((Tag)stmt.getTags().get(0)).toString().equals("8")){ int pos = nodes.indexOf(stmt); if (((MonitorSet)valueAfter.elementAt(pos)).size() >0 && !((MonitorSet)valueAfter.elementAt(pos)).contains("&")){ System.out.println("sp"+stmt.getTags().get(0)+" "+nodes.elementAt(pos)); ((MonitorSet)valueAfter.elementAt(pos)).test(); } } } System.out.println("--------test for debug end------"); } */ protected void copy(Object source, Object dest) { MonitorSet sourceSet = (MonitorSet) source; MonitorSet destSet = (MonitorSet) dest; sourceSet.copy(destSet); } // STEP 6: Determine value for start/end node, and // initial approximation. // // start node: empty set // initial approximation: empty set protected Object entryInitialFlow() { return new MonitorSet(); } protected Object newInitialFlow() { MonitorSet fullSet = new MonitorSet(); fullSet.add("&"); return fullSet; //return fullSet.clone(); } private void updateMonitor(MonitorSet ms, Object unit){ //System.out.println("===inside updateMonitor==="); //ml.test(); Iterator it = ms.iterator(); while (it.hasNext()){ Object obj = it.next(); if (obj instanceof MonitorDepth){ MonitorDepth md = (MonitorDepth)obj; String objName = md.getObjName(); if (monitor.containsKey(objName)){ if (md.getDepth() > 0) { monitor.get(objName).add(unit); //System.out.println("add to monitorset "+unit); } } else{ FlowSet monitorObjs = new ArraySparseSet(); monitorObjs.add(unit); monitor.put(objName, monitorObjs); //System.out.println("put into monitor: "+objName); } } } } private void createWorkList(LinkedList<Object> changedUnits, HashSet<Object> changedUnitsSet ){ createWorkList( changedUnits, changedUnitsSet, g.getMainPegChain()); Set maps = g.getStartToThread().entrySet(); for(Iterator iter=maps.iterator(); iter.hasNext();){ Map.Entry entry = (Map.Entry)iter.next(); List runMethodChainList = (List)entry.getValue(); Iterator it = runMethodChainList.iterator(); while (it.hasNext()){ PegChain chain=(PegChain)it.next(); createWorkList( changedUnits, changedUnitsSet, chain); } } } public void computeSynchNodes(){ int num = 0; Set maps = monitor.entrySet(); for(Iterator iter=maps.iterator(); iter.hasNext();){ Map.Entry entry = (Map.Entry)iter.next(); FlowSet fs = (FlowSet)entry.getValue(); num += fs.size(); } System.err.println("synch objects: "+num); } /* private void createWorkList(LinkedList changedUnits, HashSet changedUnitsSet, PegChain chain ){ //breadth first scan Iterator it = chain.getHeads().iterator(); while (it.hasNext()) { Object head = it.next(); Set gray = new HashSet(); LinkedList queue = new LinkedList(); queue.add(head); changedUnits.addLast(head); changedUnitsSet.add(head); //unitToBeforeFlow.put(head, newInitialFlow()); //unitToAfterFlow.put(head, newInitialFlow()); // add for debug April 6 nodes.add(head); valueBefore.add(newInitialFlow()); valueAfter.add(newInitialFlow()); // end add for debug April 6 while (queue.size()>0){ Object root = queue.getFirst(); Iterator succsIt = graph.getSuccsOf(root).iterator(); while (succsIt.hasNext()){ Object succ = succsIt.next(); if (!gray.contains(succ)){ gray.add(succ); queue.addLast(succ); changedUnits.addLast(succ); changedUnitsSet.add(succ); // unitToBeforeFlow.put(succ, newInitialFlow()); //unitToAfterFlow.put(succ, newInitialFlow()); // add for debug April 6 nodes.add(succ); valueBefore.add(newInitialFlow()); valueAfter.add(newInitialFlow()); // end add for debug April 6 } } queue.remove(root); } } }*/ private void createWorkList(LinkedList<Object> changedUnits, HashSet<Object> changedUnitsSet, PegChain chain ){ //Depth first scan Iterator it = chain.getHeads().iterator(); Set<Object> gray = new HashSet<Object>(); while (it.hasNext()) { Object head = it.next(); if (!gray.contains(head)){ visitNode(gray, head, changedUnits, changedUnitsSet); } } } private void visitNode(Set<Object> gray, Object obj,LinkedList<Object> changedUnits, HashSet<Object> changedUnitsSet ){ gray.add(obj); changedUnits.addLast(obj); changedUnitsSet.add(obj); nodes.add(obj); valueBefore.add(newInitialFlow()); valueAfter.add(newInitialFlow()); Iterator succsIt = graph.getSuccsOf(obj).iterator(); if (g.getSuccsOf(obj).size()>0){ while (succsIt.hasNext()){ Object succ = succsIt.next(); if (!gray.contains(succ)){ visitNode(gray, succ, changedUnits, changedUnitsSet ); } } } } public Map<String, FlowSet> getMonitor(){ return monitor; } public void testMonitor(){ System.out.println("=====test monitor size: "+monitor.size()); Set maps = monitor.entrySet(); for(Iterator iter=maps.iterator(); iter.hasNext();){ Map.Entry entry = (Map.Entry)iter.next(); String key = (String)entry.getKey(); System.out.println("---key= "+key); FlowSet list = (FlowSet)entry.getValue(); if (list.size()>0){ System.out.println("**set: "+list.size()); Iterator it = list.iterator(); while (it.hasNext()){ JPegStmt stmt = (JPegStmt)it.next(); Tag tag1 = (Tag)stmt.getTags().get(0); System.out.println(tag1+" "+stmt); } } } System.out.println("=========monitor--ends--------"); } }
13,793
Java
.java
406
28.440887
120
0.656771
insightfullogic/insightfullogic-soot
3
0
0
LGPL-2.1
9/4/2024, 11:25:38 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
13,793
1,320,137
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes2/in/A.java
package p; class A<T extends A<T>> {} class B<T> extends A<B<T>> {}
69
Java
.java
3
21.666667
29
0.630769
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
69
4,700,611
ClassPath.java
erhard-lab_gedi/Gedi/src/gedi/app/classpath/ClassPath.java
/* * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package gedi.app.classpath; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; public interface ClassPath { public abstract boolean isResource(String resource); public abstract boolean isPackage(String packageName); public abstract String[] listPackages(String string); public abstract InputStream getResourceAsStream(String resource); public abstract URL getResourceAsURL(String resource) throws MalformedURLException; public abstract URL getURL(); public abstract String[] listResources(String packageName); public abstract String[] findResources(String rootPackageName, ResourceFilter resourceFilter); }
1,301
Java
.java
29
41.103448
96
0.787319
erhard-lab/gedi
2
1
10
GPL-3.0
9/5/2024, 12:21:59 AM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
1,301
4,132,044
COCTMT230100UVSubContent.java
flaviociaware_cwEnsaiosWeb/cwCADSUS/src/main/java/org/hl7/v3/COCTMT230100UVSubContent.java
package org.hl7.v3; import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for COCT_MT230100UV.SubContent complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="COCT_MT230100UV.SubContent"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;group ref="{urn:hl7-org:v3}InfrastructureRootElements"/> * &lt;element name="quantity" type="{urn:hl7-org:v3}RTO_QTY_QTY" minOccurs="0"/> * &lt;element name="containedPackagedMedicine" type="{urn:hl7-org:v3}COCT_MT230100UV.PackagedMedicine" minOccurs="0"/> * &lt;/sequence> * &lt;attGroup ref="{urn:hl7-org:v3}InfrastructureRootAttributes"/> * &lt;attribute name="nullFlavor" type="{urn:hl7-org:v3}NullFlavor" /> * &lt;attribute name="classCode" use="required" type="{urn:hl7-org:v3}RoleClass" fixed="CONT" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "COCT_MT230100UV.SubContent", propOrder = { "realmCode", "typeId", "templateId", "quantity", "containedPackagedMedicine" }) public class COCTMT230100UVSubContent { protected List<CS> realmCode; protected II typeId; protected List<II> templateId; protected RTOQTYQTY quantity; @XmlElementRef(name = "containedPackagedMedicine", namespace = "urn:hl7-org:v3", type = JAXBElement.class, required = false) protected JAXBElement<COCTMT230100UVPackagedMedicine> containedPackagedMedicine; @XmlAttribute(name = "nullFlavor") protected List<String> nullFlavor; @XmlAttribute(name = "classCode", required = true) protected List<String> classCode; /** * Gets the value of the realmCode property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the realmCode property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRealmCode().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link CS } * * */ public List<CS> getRealmCode() { if (realmCode == null) { realmCode = new ArrayList<CS>(); } return this.realmCode; } /** * Gets the value of the typeId property. * * @return * possible object is * {@link II } * */ public II getTypeId() { return typeId; } /** * Sets the value of the typeId property. * * @param value * allowed object is * {@link II } * */ public void setTypeId(II value) { this.typeId = value; } /** * Gets the value of the templateId property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the templateId property. * * <p> * For example, to add a new item, do as follows: * <pre> * getTemplateId().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link II } * * */ public List<II> getTemplateId() { if (templateId == null) { templateId = new ArrayList<II>(); } return this.templateId; } /** * Gets the value of the quantity property. * * @return * possible object is * {@link RTOQTYQTY } * */ public RTOQTYQTY getQuantity() { return quantity; } /** * Sets the value of the quantity property. * * @param value * allowed object is * {@link RTOQTYQTY } * */ public void setQuantity(RTOQTYQTY value) { this.quantity = value; } /** * Gets the value of the containedPackagedMedicine property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link COCTMT230100UVPackagedMedicine }{@code >} * */ public JAXBElement<COCTMT230100UVPackagedMedicine> getContainedPackagedMedicine() { return containedPackagedMedicine; } /** * Sets the value of the containedPackagedMedicine property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link COCTMT230100UVPackagedMedicine }{@code >} * */ public void setContainedPackagedMedicine(JAXBElement<COCTMT230100UVPackagedMedicine> value) { this.containedPackagedMedicine = value; } /** * Gets the value of the nullFlavor property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the nullFlavor property. * * <p> * For example, to add a new item, do as follows: * <pre> * getNullFlavor().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getNullFlavor() { if (nullFlavor == null) { nullFlavor = new ArrayList<String>(); } return this.nullFlavor; } /** * Gets the value of the classCode property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the classCode property. * * <p> * For example, to add a new item, do as follows: * <pre> * getClassCode().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getClassCode() { if (classCode == null) { classCode = new ArrayList<String>(); } return this.classCode; } }
6,997
Java
.java
231
24.506494
128
0.617926
flaviociaware/cwEnsaiosWeb
2
0
13
GPL-2.0
9/5/2024, 12:03:50 AM (Europe/Amsterdam)
true
true
true
true
false
true
true
true
6,997
3,748,675
ResourceBundleData.java
Meeds-io_gatein-portal/component/api/src/main/java/org/exoplatform/services/resources/ResourceBundleData.java
/** * Copyright (C) 2009 eXo Platform SAS. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.exoplatform.services.resources; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Created by The eXo Platform SAS . Author : Tuan Nguyen tuan08@users.sourceforge.net Date: May 14, 2004 Time: 1:12:22 PM */ @SuppressWarnings("serial") public class ResourceBundleData extends ResourceBundleDescription implements Serializable { /** . */ private static Pattern LINE_SEPARATOR = Pattern.compile("[\\r]?\\n"); /** . */ private static Pattern UNICODE_CHARACTER = Pattern.compile("\\\\u[\\p{XDigit}]{4}+"); /** . */ private String data; /** . */ Object[][] contents; public ResourceBundleData(String data) { setData(data); setResourceType("-"); setLanguage(DEFAULT_LANGUAGE); } public ResourceBundleData() { this(null); } public String getData() { return data; } public void setData(String data) { this.data = data; if (data != null) { String[] tokens = LINE_SEPARATOR.split(data); List<String[]> properties = new ArrayList<String[]>(); for (String token : tokens) { int idx = token.indexOf('='); if (idx < 0 || idx >= token.length() - 1) { continue; } String key = token.substring(0, idx); if (key.trim().startsWith("#")) { continue; } String value = convert(token.substring(idx + 1, token.length())); properties.add(new String[] { key, value }); } String[][] aProperties = new String[properties.size()][2]; contents = properties.toArray(aProperties); } else { contents = new Object[0][]; } } static String convert(String content) { Matcher matcher = UNICODE_CHARACTER.matcher(content); StringBuilder buffer = new StringBuilder(content.length()); int start = 0; while (matcher.find(start)) { buffer.append(content.substring(start, matcher.start())); buffer.append(unicode2Char(matcher.group())); start = matcher.end(); } if (start >= 0 && start < content.length()) { buffer.append(content.substring(start)); } return buffer.toString(); } static char unicode2Char(String unicodeChar) { int value = 0; char aChar; for (int i = 0; i < 4; i++) { aChar = unicodeChar.charAt(i + 2); switch (aChar) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { value = (value << 4) + aChar - '0'; break; } case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': { value = (value << 4) + 10 + aChar - 'a'; break; } case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': { value = (value << 4) + 10 + aChar - 'A'; break; } default: { throw new IllegalArgumentException("Malformed \\uxxxx encoding."); } } } return (char) value; } }
4,585
Java
.java
130
25.046154
122
0.529849
Meeds-io/gatein-portal
3
5
2
LGPL-3.0
9/4/2024, 11:41:00 PM (Europe/Amsterdam)
false
false
false
true
false
false
false
true
4,585
575,526
KafkaUpsertTableSink.java
springMoon_sqlSubmit/src/main/scala/com/rookie/submit/connector/kafka/KafkaUpsertTableSink.java
//package com.rookie.submit.connector.kafka; // //import org.apache.flink.api.common.functions.FlatMapFunction; //import org.apache.flink.api.common.serialization.SerializationSchema; //import org.apache.flink.api.common.typeinfo.TypeInformation; //import org.apache.flink.api.java.tuple.Tuple2; //import org.apache.flink.streaming.api.datastream.DataStream; //import org.apache.flink.streaming.api.datastream.DataStreamSink; //import org.apache.flink.streaming.api.functions.sink.SinkFunction; //import org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer; //import org.apache.flink.streaming.connectors.kafka.internals.KeyedSerializationSchemaWrapper; //import org.apache.flink.streaming.connectors.kafka.partitioner.FlinkKafkaPartitioner; //import org.apache.flink.table.api.TableSchema; //import org.apache.flink.table.api.ValidationException; //import org.apache.flink.table.sinks.UpsertStreamTableSink; //import org.apache.flink.table.utils.TableConnectorUtils; //import org.apache.flink.table.utils.TableSchemaUtils; //import org.apache.flink.types.Row; //import org.apache.flink.util.Collector; //import org.apache.flink.util.Preconditions; //import org.slf4j.Logger; //import org.slf4j.LoggerFactory; // //import java.util.Arrays; //import java.util.Objects; //import java.util.Optional; //import java.util.Properties; // ///** // * kafka upsert sink // */ //public class KafkaUpsertTableSink implements UpsertStreamTableSink<Row> { // // Logger logger = LoggerFactory.getLogger(KafkaUpsertTableSink.class); // // /** The schema of the table. */ // private TableSchema schema = null; // // /** The Kafka topic to write to. */ // protected String topic = null; // // /** Properties for the Kafka producer. */ // protected Properties properties = null; // // /** Serialization schema for encoding records to Kafka. */ // protected SerializationSchema<Row> serializationSchema = null; // // /** Partitioner to select Kafka partition for each item. */ // protected Optional<FlinkKafkaPartitioner<Row>> partitioner = null; // // KafkaUpsertTableSink( // TableSchema schema, // String topic, // Properties properties, // Optional<FlinkKafkaPartitioner<Row>> partitioner, // SerializationSchema<Row> serializationSchema) { // this.schema = TableSchemaUtils.checkNoGeneratedColumns(schema); // this.topic = Preconditions.checkNotNull(topic, "Topic must not be null."); // this.properties = Preconditions.checkNotNull(properties, "Properties must not be null."); // this.partitioner = Preconditions.checkNotNull(partitioner, "Partitioner must not be null."); // this.serializationSchema = Preconditions.checkNotNull(serializationSchema, "Serialization schema must not be null."); // } // // /** // * Returns the version-specific Kafka producer. // * // * @param topic Kafka topic to produce to. // * @param properties Properties for the Kafka producer. // * @param serializationSchema Serialization schema to use to create Kafka records. // * @param partitioner Partitioner to select Kafka partition. // * @return The version-specific Kafka producer // */ // protected SinkFunction<Row> createKafkaProducer( // String topic, // Properties properties, // SerializationSchema<Row> serializationSchema, // Optional<FlinkKafkaPartitioner<Row>> partitioner){ // // return new FlinkKafkaProducer<>( // topic, // new KeyedSerializationSchemaWrapper<>(serializationSchema), // properties, // partitioner); // } // // @Override // public DataStreamSink<?> consumeDataStream(DataStream<Tuple2<Boolean, Row>> dataStream) { // // final SinkFunction<Row> kafkaProducer = createKafkaProducer( // topic, // properties, // serializationSchema, // partitioner); // // // todo cast DataStream<Tuple2<Boolean, Row>> to DataStream<Row> // return dataStream // .flatMap(new FlatMapFunction<Tuple2<Boolean, Row>, Row>() { // @Override // public void flatMap(Tuple2<Boolean, Row> element, Collector<Row> out) throws Exception { // // upsertStream include insert/update/delete change, true is upsert, false is delete // // create new row include upsert message // if (element.f0) { // out.collect(element.f1); // } else { // System.out.println("KafkaUpsertTableSinkBase : retract stream f0 will be false"); // } // } // }) // .addSink(kafkaProducer) // .setParallelism(dataStream.getParallelism()) // .name(TableConnectorUtils.generateRuntimeName(this.getClass(), getFieldNames())); // } // // // public void setKeyFields(String[] strings) { // // } // // @Override // public String[] getFieldNames() { // return schema.getFieldNames(); // } // // public void setIsAppendOnly(Boolean aBoolean) { // // } // // public TypeInformation<Row> getRecordType() { // return schema.toRowType(); // } // // public void emitDataStream(DataStream<Tuple2<Boolean, Row>> dataStream) { // consumeDataStream(dataStream); // } // // @Override // public TypeInformation<?>[] getFieldTypes() { // return schema.getFieldTypes(); // } // // @Override // public KafkaUpsertTableSink configure(String[] fieldNames, TypeInformation<?>[] fieldTypes) { // if (!Arrays.equals(getFieldNames(), fieldNames) || !Arrays.equals(getFieldTypes(), fieldTypes)) { // throw new ValidationException("Reconfiguration with different fields is not allowed. " + // "Expected: " + Arrays.toString(getFieldNames()) + " / " + Arrays.toString(getFieldTypes()) + ". " + // "But was: " + Arrays.toString(fieldNames) + " / " + Arrays.toString(fieldTypes)); // } // return this; // } // // public boolean equals(Object o) { // if (this == o) { // return true; // } else if (o != null && this.getClass() == o.getClass()) { // KafkaUpsertTableSink that = (KafkaUpsertTableSink)o; // return Objects.equals(this.schema, that.schema) && Objects.equals(this.topic, that.topic) && Objects.equals(this.properties, that.properties) && Objects.equals(this.serializationSchema, that.serializationSchema) && Objects.equals(this.partitioner, that.partitioner); // } else { // return false; // } // } // // public int hashCode() { // return Objects.hash(new Object[]{this.schema, this.topic, this.properties, this.serializationSchema, this.partitioner}); // } //}
7,029
Java
.java
165
41.6
280
0.652098
springMoon/sqlSubmit
145
57
8
GPL-3.0
9/4/2024, 7:08:18 PM (Europe/Amsterdam)
true
true
true
true
true
true
true
true
7,029
1,317,322
A.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/RenameType/testFail52/in/A.java
package p; class A extends Exception{ } class X{ class B extends Exception{ } void m() throws A{ } }
104
Java
.java
9
10.222222
27
0.729167
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
104
4,858,407
PropertyValue.java
zhangjianying_12306-android-Decompile/src/org/codehaus/jackson/map/deser/PropertyValue.java
package org.codehaus.jackson.map.deser; import java.io.IOException; import java.util.Map; import org.codehaus.jackson.JsonProcessingException; abstract class PropertyValue { public final PropertyValue next; public final Object value; protected PropertyValue(PropertyValue paramPropertyValue, Object paramObject) { this.next = paramPropertyValue; this.value = paramObject; } public abstract void assign(Object paramObject) throws IOException, JsonProcessingException; static final class Any extends PropertyValue { final SettableAnyProperty _property; final String _propertyName; public Any(PropertyValue paramPropertyValue, Object paramObject, SettableAnyProperty paramSettableAnyProperty, String paramString) { super(paramObject); this._property = paramSettableAnyProperty; this._propertyName = paramString; } public void assign(Object paramObject) throws IOException, JsonProcessingException { this._property.set(paramObject, this._propertyName, this.value); } } static final class Map extends PropertyValue { final Object _key; public Map(PropertyValue paramPropertyValue, Object paramObject1, Object paramObject2) { super(paramObject1); this._key = paramObject2; } public void assign(Object paramObject) throws IOException, JsonProcessingException { ((Map)paramObject).put(this._key, this.value); } } static final class Regular extends PropertyValue { final SettableBeanProperty _property; public Regular(PropertyValue paramPropertyValue, Object paramObject, SettableBeanProperty paramSettableBeanProperty) { super(paramObject); this._property = paramSettableBeanProperty; } public void assign(Object paramObject) throws IOException, JsonProcessingException { this._property.set(paramObject, this.value); } } } /* Location: D:\开发工具\dex2jar-0.0.9.13\classes_dex2jar.jar * Qualified Name: org.codehaus.jackson.map.deser.PropertyValue * JD-Core Version: 0.6.0 */
2,113
Java
.java
64
28.390625
134
0.754931
zhangjianying/12306-android-Decompile
1
1
0
GPL-3.0
9/5/2024, 12:33:53 AM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
2,105
3,137,727
TaskRunner.java
crypto-coder_open-cyclos/src/nl/strohalm/cyclos/utils/tasks/TaskRunner.java
/* This file is part of Cyclos (www.cyclos.org). A project of the Social Trade Organisation (www.socialtrade.org). Cyclos is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Cyclos is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Cyclos; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package nl.strohalm.cyclos.utils.tasks; import java.util.Calendar; import java.util.Collection; import java.util.concurrent.Callable; import nl.strohalm.cyclos.services.InitializingService; /** * Runs system tasks * * @author luis */ public interface TaskRunner { /** * Handles the database initialization */ void handleDatabaseInitialization(Runnable runnable); /** * Runs all the given initializations, which are spring bean names. All such beans implement {@link InitializingService} */ void runInitializations(Collection<String> beanNames); /** * Executes the given polling task */ boolean runPollingTask(String key, Callable<Boolean> task); /** * Runs the scheduled task with the given name */ void runScheduledTasks(Calendar time, Collection<String> taskNames); }
1,683
Java
.java
43
34.837209
124
0.7457
crypto-coder/open-cyclos
4
9
0
GPL-2.0
9/4/2024, 10:59:44 PM (Europe/Amsterdam)
false
false
true
true
false
true
false
true
1,683
2,726,944
CommandBuilder.java
nogago_nogago/Maps/nogagoMaps/src/com/nogago/android/maps/voice/CommandBuilder.java
package com.nogago.android.maps.voice; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.commons.logging.Log; import com.nogago.android.maps.LogUtil; import alice.tuprolog.Struct; import alice.tuprolog.Term; public class CommandBuilder { private static final Log log = LogUtil.getLog(CommandBuilder.class); protected static final String C_PREPARE_TURN = "prepare_turn"; //$NON-NLS-1$ protected static final String C_PREPARE_ROUNDABOUT = "prepare_roundabout"; //$NON-NLS-1$ protected static final String C_PREPARE_MAKE_UT = "prepare_make_ut"; //$NON-NLS-1$ protected static final String C_ROUNDABOUT = "roundabout"; //$NON-NLS-1$ protected static final String C_GO_AHEAD = "go_ahead"; //$NON-NLS-1$ protected static final String C_TURN = "turn"; //$NON-NLS-1$ protected static final String C_MAKE_UT = "make_ut"; //$NON-NLS-1$ protected static final String C_MAKE_UTWP = "make_ut_wp"; //$NON-NLS-1$ protected static final String C_PREAMBLE = "preamble"; //$NON-NLS-1$ protected static final String C_AND_ARRIVE_DESTINATION = "and_arrive_destination"; //$NON-NLS-1$ protected static final String C_THEN = "then"; //$NON-NLS-1$ protected static final String C_REACHED_DESTINATION = "reached_destination"; //$NON-NLS-1$ protected static final String C_BEAR_LEFT = "bear_left"; //$NON-NLS-1$ protected static final String C_BEAR_RIGHT = "bear_right"; //$NON-NLS-1$ protected static final String C_ROUTE_RECALC = "route_recalc"; //$NON-NLS-1$ protected static final String C_ROUTE_NEW_CALC = "route_new_calc"; //$NON-NLS-1$ protected static final String C_LOCATION_LOST = "location_lost"; //$NON-NLS-1$ /** * */ private final CommandPlayer commandPlayer; private boolean alreadyExecuted = false; private List<Struct> listStruct = new ArrayList<Struct>(); public CommandBuilder(CommandPlayer commandPlayer){ this(commandPlayer, true); } public CommandBuilder(CommandPlayer commandPlayer, boolean preamble) { this.commandPlayer = commandPlayer; if (preamble) { addCommand(C_PREAMBLE); } } private void checkState(){ if(alreadyExecuted){ throw new IllegalArgumentException(); } } private CommandBuilder addCommand(String name, Object... args){ checkState(); Term[] list = new Term[args.length]; for (int i = 0; i < args.length; i++) { Object o = args[i]; if(o instanceof java.lang.Number){ if(o instanceof java.lang.Double){ list[i] = new alice.tuprolog.Double((Double) o); } else if(o instanceof java.lang.Float){ list[i] = new alice.tuprolog.Float((Float) o); } else if(o instanceof java.lang.Long){ list[i] = new alice.tuprolog.Long((Long) o); } else { list[i] = new alice.tuprolog.Int(((java.lang.Number)o).intValue()); } } else if(o instanceof String){ list[i] = new Struct((String) o); } if(list[i]== null){ throw new NullPointerException(name +" " + o); //$NON-NLS-1$ } } Struct struct = new Struct(name, list); if(log.isDebugEnabled()){ log.debug("Adding command : " + name + " " + Arrays.toString(args)); //$NON-NLS-1$ //$NON-NLS-2$ } listStruct.add(struct); return this; } public CommandBuilder goAhead(){ return addCommand(C_GO_AHEAD); } public CommandBuilder goAhead(double dist){ return addCommand(C_GO_AHEAD, dist); } public CommandBuilder makeUTwp(){ return addCommand(C_MAKE_UTWP); } public CommandBuilder makeUT(){ return addCommand(C_MAKE_UT); } public CommandBuilder makeUT(double dist){ return addCommand(C_MAKE_UT, dist); } public CommandBuilder prepareMakeUT(double dist){ return addCommand(C_PREPARE_MAKE_UT, dist); } public CommandBuilder turn(String param){ return addCommand(C_TURN, param); } public CommandBuilder turn(String param, double dist){ return addCommand(C_TURN, param, dist); } /** * * @param param A_LEFT, A_RIGHT, ... * @param dist * @return */ public CommandBuilder prepareTurn(String param, double dist){ return addCommand(C_PREPARE_TURN, param, dist); } public CommandBuilder prepareRoundAbout(double dist){ return addCommand(C_PREPARE_ROUNDABOUT, dist); } public CommandBuilder roundAbout(double dist, double angle, int exit){ return addCommand(C_ROUNDABOUT, dist, angle, exit); } public CommandBuilder roundAbout(double angle, int exit){ return addCommand(C_ROUNDABOUT, angle, exit); } public CommandBuilder andArriveAtDestination(){ return addCommand(C_AND_ARRIVE_DESTINATION); } public CommandBuilder arrivedAtDestination(){ return addCommand(C_REACHED_DESTINATION); } public CommandBuilder bearLeft(){ return addCommand(C_BEAR_LEFT); } public CommandBuilder bearRight(){ return addCommand(C_BEAR_RIGHT); } public CommandBuilder then(){ return addCommand(C_THEN); } public CommandBuilder gpsLocationLost() { return addCommand(C_LOCATION_LOST); } public CommandBuilder newRouteCalculated(double dist){ return addCommand(C_ROUTE_NEW_CALC, dist); } public CommandBuilder routeRecalculated(double dist){ return addCommand(C_ROUTE_RECALC, dist); } public void play(){ this.commandPlayer.playCommands(this); } protected List<String> execute(){ alreadyExecuted = true; return this.commandPlayer.execute(listStruct); } }
5,326
Java
.java
150
32.413333
99
0.734914
nogago/nogago
6
0
8
GPL-3.0
9/4/2024, 10:10:16 PM (Europe/Amsterdam)
false
false
false
true
false
false
true
true
5,326
4,952,527
HTTP.java
WTIGER001_tingy/org.bauer.tinyg/src/org/json/HTTP.java
package org.json; /* Copyright (c) 2002 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The Software shall be used for Good, not Evil. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import java.util.Iterator; /** * Convert an HTTP header to a JSONObject and back. * @author JSON.org * @version 2010-12-24 */ public class HTTP { /** Carriage return/line feed. */ public static final String CRLF = "\r\n"; /** * Convert an HTTP header string into a JSONObject. It can be a request * header or a response header. A request header will contain * <pre>{ * Method: "POST" (for example), * "Request-URI": "/" (for example), * "HTTP-Version": "HTTP/1.1" (for example) * }</pre> * A response header will contain * <pre>{ * "HTTP-Version": "HTTP/1.1" (for example), * "Status-Code": "200" (for example), * "Reason-Phrase": "OK" (for example) * }</pre> * In addition, the other parameters in the header will be captured, using * the HTTP field names as JSON names, so that <pre> * Date: Sun, 26 May 2002 18:06:04 GMT * Cookie: Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s * Cache-Control: no-cache</pre> * become * <pre>{... * Date: "Sun, 26 May 2002 18:06:04 GMT", * Cookie: "Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s", * "Cache-Control": "no-cache", * ...}</pre> * It does no further checking or conversion. It does not parse dates. * It does not do '%' transforms on URLs. * @param string An HTTP header string. * @return A JSONObject containing the elements and attributes * of the XML string. * @throws JSONException */ public static JSONObject toJSONObject(String string) throws JSONException { JSONObject jo = new JSONObject(); HTTPTokener x = new HTTPTokener(string); String token; token = x.nextToken(); if (token.toUpperCase().startsWith("HTTP")) { // Response jo.put("HTTP-Version", token); jo.put("Status-Code", x.nextToken()); jo.put("Reason-Phrase", x.nextTo('\0')); x.next(); } else { // Request jo.put("Method", token); jo.put("Request-URI", x.nextToken()); jo.put("HTTP-Version", x.nextToken()); } // Fields while (x.more()) { String name = x.nextTo(':'); x.next(':'); jo.put(name, x.nextTo('\0')); x.next(); } return jo; } /** * Convert a JSONObject into an HTTP header. A request header must contain * <pre>{ * Method: "POST" (for example), * "Request-URI": "/" (for example), * "HTTP-Version": "HTTP/1.1" (for example) * }</pre> * A response header must contain * <pre>{ * "HTTP-Version": "HTTP/1.1" (for example), * "Status-Code": "200" (for example), * "Reason-Phrase": "OK" (for example) * }</pre> * Any other members of the JSONObject will be output as HTTP fields. * The result will end with two CRLF pairs. * @param jo A JSONObject * @return An HTTP header string. * @throws JSONException if the object does not contain enough * information. */ @SuppressWarnings("rawtypes") public static String toString(JSONObject jo) throws JSONException { Iterator keys = jo.keys(); String string; StringBuffer sb = new StringBuffer(); if (jo.has("Status-Code") && jo.has("Reason-Phrase")) { sb.append(jo.getString("HTTP-Version")); sb.append(' '); sb.append(jo.getString("Status-Code")); sb.append(' '); sb.append(jo.getString("Reason-Phrase")); } else if (jo.has("Method") && jo.has("Request-URI")) { sb.append(jo.getString("Method")); sb.append(' '); sb.append('"'); sb.append(jo.getString("Request-URI")); sb.append('"'); sb.append(' '); sb.append(jo.getString("HTTP-Version")); } else { throw new JSONException("Not enough material for an HTTP header."); } sb.append(CRLF); while (keys.hasNext()) { string = keys.next().toString(); if (!"HTTP-Version".equals(string) && !"Status-Code".equals(string) && !"Reason-Phrase".equals(string) && !"Method".equals(string) && !"Request-URI".equals(string) && !jo.isNull(string)) { sb.append(string); sb.append(": "); sb.append(jo.getString(string)); sb.append(CRLF); } } sb.append(CRLF); return sb.toString(); } }
5,790
Java
.java
145
32.634483
87
0.600071
WTIGER001/tingy
1
0
0
EPL-1.0
9/5/2024, 12:37:05 AM (Europe/Amsterdam)
true
true
true
true
true
true
true
true
5,790
1,315,228
DifferentArgs.java
eclipse-jdt_eclipse_jdt_ui/org.eclipse.jdt.ui.tests.refactoring/resources/IntroduceFactory/positive/DifferentArgs.java
package p; import java.lang.StringBuffer; public class DifferentArgs_in { public void foo(String[] args) { StringBuffer buf = createStringBuffer(16); buf.append("Args:"); for(int i=0; i < args.length; i++) buf.append(" '") .append(args[i]) .append("'"); System.out.println(buf.toString()); } public void bar(String[] args) { StringBuffer buf = createStringBuffer(24); buf.append("Args:"); for(int i=0; i < args.length; i++) buf.append(" '") .append(args[i]) .append("'"); System.out.println(buf.toString()); } public static StringBuffer createStringBuffer(int arg0) { return new StringBuffer(arg0); } }
664
Java
.java
27
21.333333
58
0.667722
eclipse-jdt/eclipse.jdt.ui
35
86
242
EPL-2.0
9/4/2024, 7:34:16 PM (Europe/Amsterdam)
false
false
true
true
true
true
true
true
664