Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2008-02-07 23:13:59 +0000
committerMike Kucera2008-02-07 23:13:59 +0000
commitecf9c5833d2df63b0d19a98e644f2b69c9c97b3a (patch)
tree32bf4bd20df74efb46d17394c23471dc7a6db4fd /core/org.eclipse.cdt.core/model/org
parent6a80d1f5da5119d136f433a5b9b586afe9707100 (diff)
downloadorg.eclipse.cdt-ecf9c5833d2df63b0d19a98e644f2b69c9c97b3a.tar.gz
org.eclipse.cdt-ecf9c5833d2df63b0d19a98e644f2b69c9c97b3a.tar.xz
org.eclipse.cdt-ecf9c5833d2df63b0d19a98e644f2b69c9c97b3a.zip
218265 - replace Enum class with Java 5 enums
Diffstat (limited to 'core/org.eclipse.cdt.core/model/org')
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java6
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DebugLogConstants.java (renamed from core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IDebugLogConstants.java)16
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java4
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java13
4 files changed, 15 insertions, 24 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java
index 879e3c8e2c0..49f2619eadf 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java
@@ -236,7 +236,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
+ fTranslationUnit.getElementName()
+ " mode="+ (quickParseMode ? "skip all " : "skip indexed ") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ " time="+ ( System.currentTimeMillis() - startTime ) + "ms", //$NON-NLS-1$ //$NON-NLS-2$
- IDebugLogConstants.MODEL, false);
+ DebugLogConstants.MODEL, false);
if (ast == null) {
return;
@@ -249,7 +249,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
Util.debugLog("CModelBuilder2: building " //$NON-NLS-1$
+"children="+ fTranslationUnit.getElementInfo().internalGetChildren().size() //$NON-NLS-1$
+" time="+ (System.currentTimeMillis() - startTime) + "ms", //$NON-NLS-1$ //$NON-NLS-2$
- IDebugLogConstants.MODEL, false);
+ DebugLogConstants.MODEL, false);
if (elementInfo instanceof ASTHolderTUInfo) {
((ASTHolderTUInfo)elementInfo).fAST= ast;
@@ -269,7 +269,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
private void checkCanceled() {
if (fProgressMonitor != null && fProgressMonitor.isCanceled()) {
- Util.debugLog("CModelBuilder2: cancelled ", IDebugLogConstants.MODEL, false); //$NON-NLS-1$
+ Util.debugLog("CModelBuilder2: cancelled ", DebugLogConstants.MODEL, false); //$NON-NLS-1$
throw new OperationCanceledException();
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IDebugLogConstants.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DebugLogConstants.java
index 664f423e34b..dfb7969ca18 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IDebugLogConstants.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DebugLogConstants.java
@@ -10,18 +10,10 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
-import org.eclipse.cdt.core.parser.Enum;
-public interface IDebugLogConstants {
- public class DebugLogConstant extends Enum {
- protected DebugLogConstant( int value )
- {
- super( value );
- }
-
- }
+public enum DebugLogConstants {
- public static final DebugLogConstant PARSER = new DebugLogConstant( 1 );
- public static final DebugLogConstant MODEL = new DebugLogConstant ( 2 );
- public static final DebugLogConstant SCANNER = new DebugLogConstant( 3 );
+ PARSER,
+ MODEL,
+ SCANNER,
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java
index c83ded1e388..1286f89ed0d 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java
@@ -635,7 +635,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
}
} catch (Exception e) {
// use the debug log for this exception.
- Util.debugLog( "Exception in CModelBuilder", IDebugLogConstants.MODEL); //$NON-NLS-1$
+ Util.debugLog( "Exception in CModelBuilder", DebugLogConstants.MODEL); //$NON-NLS-1$
}
}
@@ -644,7 +644,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
mb.parse(quickParseMode);
} catch (Exception e) {
// use the debug log for this exception.
- Util.debugLog( "Exception in contributed model builder", IDebugLogConstants.MODEL); //$NON-NLS-1$
+ Util.debugLog( "Exception in contributed model builder", DebugLogConstants.MODEL); //$NON-NLS-1$
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java
index 30d03da8c39..f01a9401a82 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java
@@ -25,7 +25,6 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ICLogConstants;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICModelStatusConstants;
-import org.eclipse.cdt.internal.core.model.IDebugLogConstants.DebugLogConstant;
import org.eclipse.cdt.internal.core.util.CharArrayBuffer;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileInfo;
@@ -208,11 +207,11 @@ public class Util implements ICLogConstants {
Util.log(status, logType);
}
- public static void debugLog(String message, DebugLogConstant client) {
+ public static void debugLog(String message, DebugLogConstants client) {
Util.debugLog(message, client, true);
}
- public static void debugLog(String message, DebugLogConstant client,
+ public static void debugLog(String message, DebugLogConstants client,
boolean addTimeStamp) {
if (CCorePlugin.getDefault() == null)
return;
@@ -238,12 +237,12 @@ public class Util implements ICLogConstants {
* @param client
* @return
*/
- public static boolean isActive(DebugLogConstant client) {
- if (client.equals(IDebugLogConstants.PARSER)) {
+ public static boolean isActive(DebugLogConstants client) {
+ if (client.equals(DebugLogConstants.PARSER)) {
return VERBOSE_PARSER;
- } else if (client.equals(IDebugLogConstants.SCANNER))
+ } else if (client.equals(DebugLogConstants.SCANNER))
return VERBOSE_SCANNER;
- else if (client.equals(IDebugLogConstants.MODEL)) {
+ else if (client.equals(DebugLogConstants.MODEL)) {
return VERBOSE_MODEL;
}
return false;

Back to the top