- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
更具体:我自己写了ClassLoader
, 加载
.jar
来自全局库路径的文件.jar
来自项目特定路径的文件.java
项目特定路径中的文件.class
项目特定路径中的文件到目前为止,这分离了我的项目实例,从所有(子)目录加载一切正常,适用于 (1) 所有库和 (2) 子库,(3) 可以编译所有 .java
文件,(4) 可以加载 .class
文件,我还可以重新实例化已经加载的类,因为我的 ClassLoader
管理子ClassLoader
允许这样做。
现在,我想改进的是,在 (3) 处调用编译器时,我不想每 .java
重新编译一次目录中的文件,但只有那些,其中对应的 .class
文件不存在或时间戳错误。
所以我只传递那些 .java
需要重新编译的文件,而不是全部,结果是编译器无法找到所有需要的类(在我没有传递给他编译的那些 .java
文件中)。相反,编译器应该从我的类加载器中获取它缺少的编译信息(.class
文件而不是 .java
文件),它已经加载了那些 .class
文件。文件。
为了意识到这一点,我实现了自己的 FileManager
,我传递给 JavaCompiler.getTask()
.在那个习俗中 FileManager
,我在 FileManager.getClassLoader()
返回我的 ClassLoader .
应该是这样的:
.jar
来自全局库路径的文件.jar
来自项目特定路径的文件.java
项目特定路径中的文件,从 .class
加载缺少的类定义文件(由我的特定 ClassLoader
加载).class
项目特定路径中的文件但是当JavaCompiler.CompilationTask
运行,它从不访问我的 ClassLoader 的 .loadClass()
或 .findClass()
方法,因此没有找到必要的 .class
文件,因此“抛出”我一个编译错误。 (即我得到诊断,并将它们转换为异常)
所以,我的实际问题是:
.class
文件而不是 .java
文件?好的,所以我要发布我编写的部分代码,但这使用了我的很多库和更多的内部类,所以你不会让这段代码工作!!
另请注意,这要复杂得多,因为我存储了很多额外的信息,而我要求的任务不需要这些信息。
因此以此为指导。基本上,您可以省去我在 Maps/Multimaps 中存储数据的所有信息处理,它们主要用于跟踪资源。
此外,JcDirLoader 不必为工作扩展 ClassLoader,这也是为“更高”目的而设计的;-)而且ClassLoader之间相互调用的方式也可以大大简化!
package jc.lib.lang.reflect.loader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import com.sun.org.apache.xalan.internal.xsltc.compiler.CompilerException;
import jc.lib.collection.list.JcList;
import jc.lib.collection.map.JcHashMap;
import jc.lib.collection.map.JcMultiMap;
import jc.lib.io.files.finder.JcFileFinder;
import jc.lib.lang.JcUFile;
import jc.lib.lang.JcUFileType;
import jc.lib.lang.reflect.classfileanalyzer.JcClassFileInfo;
import jc.lib.lang.reflect.compiler.JcJavaFileCompiler;
import jc.lib.lang.reflect.loader.classes.JcClassFileLoader;
import jc.lib.lang.reflect.loader.classes.JcUClassLoader;
import jc.lib.lang.reflect.loader.jars.JcUJarfileLoader;
import jc.lib.lang.reflect.loader.util.ClassName;
import jc.lib.lang.reflect.loader.util.ClassState;
import jc.lib.lang.reflect.loader.util.JcClassLoaderInfo;
public class JcDirLoader extends ClassLoader {
private final JcHashMap<File, ClassName> mFile2Classname = new JcHashMap<>();
private final JcHashMap<ClassName, JcClassLoaderInfo> mClassname2Classinfo = new JcHashMap<>();
private final JcMultiMap<ClassName, JcClassFileLoader> mClassname2Loaders = new JcMultiMap<>();
private final ArrayList<JcClassFileLoader> mAvailableFileLoaders = new ArrayList<>();
private final ClassLoader mParentLoader;
public JcDirLoader() {
// super(JcUClassLoader.getThreadContextClassLoader());
// JcDirLoader.class.getClassLoader();
mParentLoader = JcUClassLoader.getThreadContextClassLoader();
}
public JcList<JcClassLoaderInfo> getLoadedClasses() {
final JcList<JcClassLoaderInfo> ret = new JcList<>(mClassname2Classinfo.values());
return ret;
}
public Class<?> forName(final ClassName pClassName) throws ClassNotFoundException {
final JcClassLoaderInfo ret = mClassname2Classinfo.get(pClassName);
if (ret != null) return ret.mClass;
final Class<?> ret2 = mParentLoader.loadClass(pClassName.toString());
return ret2;
}
public JcClassLoaderInfo getClassInfo(final ClassName pClassName) {
return mClassname2Classinfo.get(pClassName);
}
public ArrayList<JcClassLoaderInfo> getClassInfos() {
return new ArrayList<>(mClassname2Classinfo.values());
}
public void loadDirectory(final File pDir) throws ClassNotFoundException, IOException, CompilerException {
// collect all files
final JcList<File> files = JcFileFinder.findInDir(pDir, true);
final JcList<File> jarFiles = new JcList<>();
final JcList<File> classFiles = new JcList<>();
final JcList<File> javaFiles = new JcList<>();
for (final File file : files) {
if (JcUFileType.isJavaPackedFile(file)) jarFiles.addItem(file);
if (JcUFileType.isJavaClassFile(file)) classFiles.addItem(file);
if (JcUFileType.isJavaSourceFile(file)) javaFiles.addItem(file);
}
// handle .jar files
handleJars(jarFiles);
// compile .java files
final boolean reloadNecessary = handleJavaFiles(javaFiles, jarFiles);
if (reloadNecessary) {
classFiles.removeAllItems();
final JcList<File> files2 = JcFileFinder.findInDir(pDir, true);
for (final File file : files2) {
if (JcUFileType.isJavaClassFile(file)) classFiles.addItem(file);
}
}
// handle .class files
handleClassFiles(classFiles);
}
/*
* .jar files
*/
private void handleJars(final JcList<File> pAvailableJarFiles) throws MalformedURLException, IOException {
System.out.println("\tLoading " + pAvailableJarFiles.getItemCount() + " .jar files:");
final JcList<JcClassLoaderInfo> loadedClasses = JcUJarfileLoader.loadJars(pAvailableJarFiles);
for (final JcClassLoaderInfo ci : loadedClasses) {
mFile2Classname.put(ci.mContainingFile, ci.mClassName);
mClassname2Classinfo.put(ci.mClassName, ci);
}
for (final File file : pAvailableJarFiles) {
System.out.println("\t\t" + file + " OK");
}
System.out.println("\t\tAll OK");
}
/*
* .class files
*/
private ArrayList<Class<?>> handleClassFiles(final JcList<File> pClassFiles) throws FileNotFoundException, IOException, ClassNotFoundException {
System.out.println("\tLoading " + pClassFiles.getItemCount() + " .class files:");
for (final File file : pClassFiles) {
final JcClassFileInfo cfi = new JcClassFileInfo(file);
final ClassName className = ClassName.fromClassFileInfo(cfi);
final JcClassLoaderInfo info = new JcClassLoaderInfo(null, file, className, null, ClassState.CLASS_FILE, file.lastModified(), null);
mFile2Classname.put(file, className);
mClassname2Classinfo.put(className, info);
}
final ArrayList<Class<?>> ret = new ArrayList<>();
for (final File file : pClassFiles) {
final Class<?> cls = handleClassFile(file);
ret.add(cls);
}
System.out.println("\t\t" + pClassFiles.getItemCount() + " .class files loaded.");
return ret;
}
private Class<?> handleClassFile(final File pFile) throws FileNotFoundException, IOException, ClassNotFoundException {
final JcClassFileInfo cfi = new JcClassFileInfo(pFile);
final ClassName className = ClassName.fromClassFileInfo(cfi);
final JcClassLoaderInfo existing = mClassname2Classinfo.get(className);
if (!needsReloading(existing, pFile)) return existing.mClass;
final JcClassFileLoader fileLoader = getCompatibleFileLoader(className);
fileLoader.setInfo(pFile, className);
final Class<?> c = fileLoader.loadClass(className.toString());
final JcClassLoaderInfo info = new JcClassLoaderInfo(null, pFile, className, c, ClassState.CLASS_FILE, pFile.lastModified(), fileLoader);
mFile2Classname.put(pFile, className);
mClassname2Classinfo.put(className, info);
return c;
}
static private boolean needsReloading(final JcClassLoaderInfo pExisting, final File pNewFile) {
if (pExisting == null) return true;
if (pExisting.mClass == null) return true;
if (!pNewFile.equals(pExisting.mContainingFile)) return true;
if (pNewFile.lastModified() != pExisting.mContainingFile.lastModified()) return true;
return false;
}
/*
* .java files
*/
private boolean handleJavaFiles(final JcList<File> pJavaFiles, final JcList<File> pAvailableJarFiles) throws IOException, CompilerException {
System.out.println("\tChecking " + pJavaFiles.getItemCount() + " .java files:");
final boolean recompile = needRecompiling(pJavaFiles);
if (!recompile) {
System.out.println("\t\tNo Java files needed recompiling.");
return false;
}
final JcList<File> javaFilesToCompile = pJavaFiles;
// info
System.out.print("\t\tRecompiling files: ");
for (final File file : javaFilesToCompile) {
System.out.print(file.getName() + " ");
}
System.out.println();
// recompile
final String[] jarFileNames = new String[pAvailableJarFiles.getItemCount()];
for (int i = 0; i < pAvailableJarFiles.getItemCount(); i++) {
final File jarFile = pAvailableJarFiles.getItem(i);
jarFileNames[i] = jarFile.getAbsolutePath();
}
JcJavaFileCompiler.compileFiles(pJavaFiles.toArray(), this, jarFileNames);
// set time of compiled files to match dates
for (final File f : pJavaFiles) {
final long timestamp = f.lastModified();
final File cls = getClassfileForSourcefile(f);
cls.setLastModified(timestamp);
}
// return results
final JcList<JcClassLoaderInfo> ret = new JcList<>();
for (final File file : javaFilesToCompile) {
final File classFile = getClassfileForSourcefile(file);
if (!classFile.exists()) throw new FileNotFoundException("File '" + classFile.getAbsolutePath() + "' could not be found, but was compiled from '" + file.getAbsolutePath() + "'!");
final JcClassLoaderInfo ci = new JcClassLoaderInfo(file, classFile, null, null, ClassState.JAVA_FILE, classFile.lastModified(), null);
ret.addItem(ci);
}
System.out.println("\t\t" + pJavaFiles.getItemCount() + " Java files recompiled.");
return true;
}
static private boolean needRecompiling(final JcList<File> pJavaFiles) {
for (final File file : pJavaFiles) {
if (!JcUFileType.isJavaSourceFile(file)) continue;
final long sourceDate = file.lastModified();
final File classFile = getClassfileForSourcefile(file);
final long classDate = !classFile.exists() ? 0 : classFile.lastModified();
if (sourceDate > classDate) return true;
}
return false;
}
private JcClassFileLoader getCompatibleFileLoader(final ClassName pClassName) {
// check if can re-use another existing loader
final HashSet<JcClassFileLoader> oldLoaders = mClassname2Loaders.getUniqueValues(pClassName);
for (final JcClassFileLoader loader : mAvailableFileLoaders) {
if (oldLoaders.contains(loader)) continue;
mClassname2Loaders.put(pClassName, loader);
// System.out.println("\tUsing " + loader + " for " + pClassName);
return loader;
}
// create new loader
final JcClassFileLoader newLoader = new JcClassFileLoader(mParentLoader, this);
mAvailableFileLoaders.add(newLoader);
mClassname2Loaders.put(pClassName, newLoader);
// System.out.println("Created new " + newLoader + " for " + pClassName);
return newLoader;
}
static public File getClassfileForSourcefile(final File pSourceFile) {
final String classFilename = JcUFile.toString(pSourceFile, true, true, true, false) + JcUFileType.CLASS_EXTENSION;
final File classFile = new File(classFilename);
return classFile;
}
@Override public Class<?> loadClass(final String pClassname) throws ClassNotFoundException {
System.out.println(" -> JcDirLoader.loadClass(" + pClassname + ")");
try {
final ClassName cn = ClassName.fromString(pClassname);
final JcClassLoaderInfo ci = getClassInfo(cn);
if (ci == null) return mParentLoader.loadClass(pClassname);
final File f = ci.mContainingFile;
final Class<?> cls = handleClassFile(f);
return cls;
} catch (final Exception e) {
throw new ClassNotFoundException(pClassname, e);
}
}
@Override public Class<?> findClass(final String pClassname) throws ClassNotFoundException {
System.out.println(" -> JcDirLoader.findClass(" + pClassname + ")");
final ClassName cn = ClassName.fromString(pClassname);
final JcClassLoaderInfo ci = getClassInfo(cn);
if (ci != null) return ci.mClassLoader.loadClass(pClassname);
final Class<?> test = loadClass(pClassname);
if (test != null) return test;
System.out.println("XXX -> " + pClassname);
return super.findClass(pClassname);
}
@Override public URL getResource(final String pName) {
return super.getResource(pName);
}
}
更多代码
public class JcUJarfileLoader {
static public JcList<JcClassLoaderInfo> loadJars(final JcList<File> pJarFiles) throws MalformedURLException, IOException {
final JcList<JcClassLoaderInfo> ret = new JcList<>();
if (pJarFiles == null || pJarFiles.getItemCount() < 1) return ret;
// convert files to URL to make all jars available to all requests
final ArrayList<URL> urls = new ArrayList<>(pJarFiles.getItemCount());
for (final File jarFile : pJarFiles) {
final URL url = jarFile.toURI().toURL();
urls.add(url);
}
final URL[] urlArr = urls.toArray(new URL[0]);
// iterate through jar, load all inner classes
try (final URLClassLoader classLoader = new URLClassLoader(urlArr);) { //
for (final File jarFile : pJarFiles) {
try (final JarFile file = new JarFile(jarFile);) {
final Enumeration<JarEntry> entries = file.entries();
while (entries.hasMoreElements()) {
final JarEntry jarEntry = entries.nextElement();
if (!JcUFileType.isJavaClassFile(jarEntry)) continue;
try {
// System.out.println("reloading1 " + jarEntry);
final ClassName className = ClassName.fromZipEntry(jarEntry);
final Class<?> cls = classLoader.loadClass(className.toString());
final JcClassLoaderInfo i = new JcClassLoaderInfo(null, jarFile, className, cls, ClassState.CLASS_FILE_IN_JAR, jarFile.lastModified(), classLoader);
ret.addItem(i);
} catch (final ClassNotFoundException e2) {
System.out.println("JcUJarfileLoader.reloadJar(e2) " + e2);
}
}
}
}
}
return ret;
}
}
还有更多
package jc.lib.lang.reflect.compiler;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import javax.tools.Diagnostic;
import javax.tools.DiagnosticCollector;
import javax.tools.JavaCompiler;
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;
import com.sun.org.apache.xalan.internal.xsltc.compiler.CompilerException;
import jc.lib.lang.JcUFile;
import jc.lib.lang.reflect.loader.JcDirLoader;
import jc.lib.lang.string.JcUString;
public class JcJavaFileCompiler {
static public void compileCode(final String pCode) throws IOException, CompilerException {
final File tempFile = File.createTempFile("jccompiler_", ".java");
try {
JcUFile.writeString_UTF8(tempFile, pCode);
compileFiles(new File[] { tempFile }, null);
} finally {
tempFile.deleteOnExit();
}
}
static public void compileFiles(final File pFiles[], @SuppressWarnings("unused") final JcDirLoader pClassLoader_Nullable, final String... pBindingLibraries) throws IOException, CompilerException {
if (pFiles == null || pFiles.length < 1) return;
for (final File f : pFiles) {
if (!f.exists()) throw new FileNotFoundException(f.getAbsolutePath());
}
final DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
if (compiler == null) throw new NoClassDefFoundError("ToolProvider.getSystemJavaCompiler() cannot find a compiler! Make sure you're running on JDK or have linked tools.jar into the classpath!");
try (final StandardJavaFileManager fileManager2 = compiler.getStandardFileManager(diagnostics, null, null);
/*JcJavaFileManager fileManager = new JcJavaFileManager(pClassLoader_Nullable, fileManager2);*/) {
String addLibs = "";
if (pBindingLibraries != null) for (final String l : pBindingLibraries) {
if (l == null || l.length() < 1) continue;
addLibs += ";" + l;
}
final ArrayList<String> optionList = new ArrayList<>();
optionList.add("-classpath");
optionList.add(System.getProperty("java.class.path") + addLibs);
final Iterable<? extends JavaFileObject> compilationUnit = /*fileManager*/fileManager2.getJavaFileObjectsFromFiles(Arrays.asList(pFiles));
final JavaCompiler.CompilationTask task = compiler.getTask(null, /*fileManager*/ fileManager2, diagnostics, optionList, null, compilationUnit);
final boolean done = task.call().booleanValue();
if (done) return;
// collect error data and throw
final StringBuilder sb = new StringBuilder();
for (final Diagnostic<? extends JavaFileObject> diagnostic : diagnostics.getDiagnostics()) {
sb.append(diagnostic + "\n");
}
throw new CompilerException(sb.toString());
} catch (final IOException e) {
e.printStackTrace();
throw e;
}
}
static public String getClassNameFromJavaCode(final File pJavaFile) throws IOException {
String code = JcUFile.loadString(pJavaFile);
code = JcUString.removeJavaComments(code);
final String pkg = JcUString.getBetween(code, "package ", ";");
final String name = JcUFile.toString(pJavaFile, false, true, false, false);
return pkg + "." + name;
}
static public Class<?> getClass(final String pFullClassName) throws ClassNotFoundException, IOException {
try (final URLClassLoader classLoader = new URLClassLoader(new URL[] { new File("./").toURI().toURL() });) {
final Class<?> loadedClass = classLoader.loadClass(pFullClassName);
return loadedClass;
}
}
}
今天的最后一个文件
package jc.lib.lang.reflect.loader.classes;
import java.io.File;
import java.io.IOException;
import jc.lib.lang.JcUFile;
import jc.lib.lang.reflect.loader.JcDirLoader;
import jc.lib.lang.reflect.loader.util.ClassName;
import jc.lib.lang.string.JcUString;
/**
* Our Custom Class Loader to load the classes. Any class in the com.journaldev
* package will be loaded using this ClassLoader. For other classes, it will
* delegate the request to its Parent ClassLoader.
*
*/
public class JcClassFileLoader extends ClassLoader {
private final JcDirLoader mJcDirLoader;
private File mFile;
private ClassName mClassname;
public JcClassFileLoader(final ClassLoader parent, final JcDirLoader pJcDirLoader) {
super(parent);
mJcDirLoader = pJcDirLoader;
}
public void setInfo(final File pFile, final ClassName pClassname) {
mFile = pFile;
mClassname = pClassname;
}
@Override public Class<?> loadClass(final String pClassname) throws ClassNotFoundException {
// System.out.println(" *** JcClassFileLoader.loadClass(" + pClassname + ") primed with (" + mFile + "," + mClassname + ")");
if (!JcUString.equals(pClassname, mClassname.toString())) return super.loadClass(pClassname);
try {
final byte[] b = JcUFile.readBytes(mFile);
final Class<?> c = defineClass(mClassname.toString(), b, 0, b.length);
resolveClass(c);
// System.out.println("LOADED: " + c.getSimpleName() + "\t" + c.getName() + "\t" + c.getPackage());
return c;
} catch (final LinkageError e) {
throw new LinkageError("Error while loading file '" + mFile + "' as Class '" + mClassname + "'", e);
} catch (final IOException e) {
e.printStackTrace();
return null;
}
}
@Override protected Class<?> findClass(final String pName) throws ClassNotFoundException {
System.out.println(" *** JcClassFileLoader.findClass(" + pName + ")");
return mJcDirLoader.findClass(pName);
}
}
最佳答案
Eclipse 具有可以独立使用的增量编译器,应该可以根据您的需要对其进行调整。我认为使用标准 javac
不可能完成您尝试的操作,但了解 oracle 编译器人员对此的想法会很有趣。
Gradle中也有增量编译器,但不确定重用它有多容易。
关于java - 如何使 JavaCompiler.CompilationTask 使用自定义 ClassLoader 或将 .class 文件用于 missin .java 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50333117/
我在网上搜索但没有找到任何合适的文章解释如何使用 javascript 使用 WCF 服务,尤其是 WebScriptEndpoint。 任何人都可以对此给出任何指导吗? 谢谢 最佳答案 这是一篇关于
我正在编写一个将运行 Linux 命令的 C 程序,例如: cat/etc/passwd | grep 列表 |剪切-c 1-5 我没有任何结果 *这里 parent 等待第一个 child (chi
所以我正在尝试处理文件上传,然后将该文件作为二进制文件存储到数据库中。在我存储它之后,我尝试在给定的 URL 上提供文件。我似乎找不到适合这里的方法。我需要使用数据库,因为我使用 Google 应用引
我正在尝试制作一个宏,将下面的公式添加到单元格中,然后将其拖到整个列中并在 H 列中复制相同的公式 我想在 F 和 H 列中输入公式的数据 Range("F1").formula = "=IF(ISE
问题类似于this one ,但我想使用 OperatorPrecedenceParser 解析带有函数应用程序的表达式在 FParsec . 这是我的 AST: type Expression =
我想通过使用 sequelize 和 node.js 将这个查询更改为代码取决于在哪里 select COUNT(gender) as genderCount from customers where
我正在使用GNU bash,版本5.0.3(1)-发行版(x86_64-pc-linux-gnu),我想知道为什么简单的赋值语句会出现语法错误: #/bin/bash var1=/tmp
这里,为什么我的代码在 IE 中不起作用。我的代码适用于所有浏览器。没有问题。但是当我在 IE 上运行我的项目时,它发现错误。 而且我的 jquery 类和 insertadjacentHTMl 也不
我正在尝试更改标签的innerHTML。我无权访问该表单,因此无法编辑 HTML。标签具有的唯一标识符是“for”属性。 这是输入和标签的结构:
我有一个页面,我可以在其中返回用户帖子,可以使用一些 jquery 代码对这些帖子进行即时评论,在发布新评论后,我在帖子下插入新评论以及删除 按钮。问题是 Delete 按钮在新插入的元素上不起作用,
我有一个大约有 20 列的“管道分隔”文件。我只想使用 sha1sum 散列第一列,它是一个数字,如帐号,并按原样返回其余列。 使用 awk 或 sed 执行此操作的最佳方法是什么? Accounti
我需要将以下内容插入到我的表中...我的用户表有五列 id、用户名、密码、名称、条目。 (我还没有提交任何东西到条目中,我稍后会使用 php 来做)但由于某种原因我不断收到这个错误:#1054 - U
所以我试图有一个输入字段,我可以在其中输入任何字符,但然后将输入的值小写,删除任何非字母数字字符,留下“。”而不是空格。 例如,如果我输入: 地球的 70% 是水,-!*#$^^ & 30% 土地 输
我正在尝试做一些我认为非常简单的事情,但出于某种原因我没有得到想要的结果?我是 javascript 的新手,但对 java 有经验,所以我相信我没有使用某种正确的规则。 这是一个获取输入值、检查选择
我想使用 angularjs 从 mysql 数据库加载数据。 这就是应用程序的工作原理;用户登录,他们的用户名存储在 cookie 中。该用户名显示在主页上 我想获取这个值并通过 angularjs
我正在使用 autoLayout,我想在 UITableViewCell 上放置一个 UIlabel,它应该始终位于单元格的右侧和右侧的中心。 这就是我想要实现的目标 所以在这里你可以看到我正在谈论的
我需要与 MySql 等效的 elasticsearch 查询。我的 sql 查询: SELECT DISTINCT t.product_id AS id FROM tbl_sup_price t
我正在实现代码以使用 JSON。 func setup() { if let flickrURL = NSURL(string: "https://api.flickr.com/
我尝试使用for循环声明变量,然后测试cols和rols是否相同。如果是,它将运行递归函数。但是,我在 javascript 中执行 do 时遇到问题。有人可以帮忙吗? 现在,在比较 col.1 和
我举了一个我正在处理的问题的简短示例。 HTML代码: 1 2 3 CSS 代码: .BB a:hover{ color: #000; } .BB > li:after {
我是一名优秀的程序员,十分优秀!