Skip to content

Commit

Permalink
Add remaining test files for jetty
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Apr 7, 2024
1 parent 6d106c2 commit 680fc96
Show file tree
Hide file tree
Showing 11 changed files with 4,401 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/test/java/org/codetracker/util/OracleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public <H extends AbstractHistoryInfo, E extends CodeElement> void testCodeTrack
String repositoryWebURL = historyInfo.getRepositoryWebURL();
//TODO temporary if check, remove when all local files are created
if(fileName.startsWith("checkstyle") || fileName.startsWith("commons-lang") || fileName.startsWith("flink") || fileName.startsWith("hibernate") || fileName.startsWith("javaparser") || fileName.startsWith("jgit") || fileName.startsWith("junit") ||
fileName.startsWith("okhttp") || fileName.startsWith("spring-framework") || fileName.startsWith("commons-io") || fileName.startsWith("elasticsearch") || fileName.startsWith("hadoop") || fileName.startsWith("intellij")) {
fileName.startsWith("okhttp") || fileName.startsWith("spring-framework") || fileName.startsWith("commons-io") || fileName.startsWith("elasticsearch") || fileName.startsWith("hadoop") || fileName.startsWith("intellij") || fileName.startsWith("jetty")) {
HashMap<String, ChangeHistory> oracleChanges = oracle(historyInfo.getExpectedChanges());
History<E> history = tracker.apply(historyInfo, repositoryWebURL);
HashMap<String, ChangeHistory> detectedChanges = new HashMap<>();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
//
// ========================================================================
// Copyright (c) 1995-2018 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//

package org.eclipse.jetty.annotations;

import java.util.ArrayList;
import java.util.List;

/**
* AnnotationIntrospector
*
*
*/
public class AnnotationIntrospector
{
protected List<IntrospectableAnnotationHandler> _handlers = new ArrayList<IntrospectableAnnotationHandler>();


/**
* IntrospectableAnnotationHandler
*
* Interface for all handlers that wish to introspect a class to find a particular annotation
*/
public interface IntrospectableAnnotationHandler
{
public void handle(Class<?> clazz);
}



/**
* AbstractIntrospectableAnnotationHandler
*
* Base class for handlers that introspect a class to find a particular annotation.
* A handler can optionally introspect the parent hierarchy of a class.
*/
public static abstract class AbstractIntrospectableAnnotationHandler implements IntrospectableAnnotationHandler
{
private boolean _introspectAncestors;

public abstract void doHandle(Class<?> clazz);


public AbstractIntrospectableAnnotationHandler(boolean introspectAncestors)
{
_introspectAncestors = introspectAncestors;
}

@Override
public void handle(Class<?> clazz)
{
Class<?> c = clazz;

//process the whole inheritance hierarchy for the class
while (c!=null && (!c.equals(Object.class)))
{
doHandle(c);
if (!_introspectAncestors)
break;

c = c.getSuperclass();
}
}
}

public void registerHandler (IntrospectableAnnotationHandler handler)
{
_handlers.add(handler);
}

public void introspect (Class<?> clazz)
{
if (_handlers == null)
return;
if (clazz == null)
return;

for (IntrospectableAnnotationHandler handler:_handlers)
{
try
{
handler.handle(clazz);
}
catch (RuntimeException e)
{
throw e;
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}

}
}
Loading

0 comments on commit 680fc96

Please sign in to comment.